first commit
This commit is contained in:
35
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/common.getters.js
generated
vendored
Normal file
35
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/common.getters.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var common_getters_exports = {};
|
||||
__export(common_getters_exports, {
|
||||
getClassName: () => getClassName
|
||||
});
|
||||
module.exports = __toCommonJS(common_getters_exports);
|
||||
function getClassName(classDeclaration) {
|
||||
if (!classDeclaration.id)
|
||||
return null;
|
||||
return {
|
||||
ast: classDeclaration.id,
|
||||
value: classDeclaration.id.name
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getClassName
|
||||
});
|
||||
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/communityPackageJson.getters.js
generated
vendored
Normal file
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/communityPackageJson.getters.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var communityPackageJson_getters_exports = {};
|
||||
__export(communityPackageJson_getters_exports, {
|
||||
getAuthor: () => getAuthor,
|
||||
getDescription: () => getDescription,
|
||||
getKeywords: () => getKeywords,
|
||||
getLicense: () => getLicense,
|
||||
getN8n: () => getN8n,
|
||||
getName: () => getName,
|
||||
getRepository: () => getRepository,
|
||||
getVersion: () => getVersion
|
||||
});
|
||||
module.exports = __toCommonJS(communityPackageJson_getters_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
const getPackageJsonProperty = (keyName) => (node) => {
|
||||
const found = node.properties.find((property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Literal && property.key.value === keyName;
|
||||
});
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
// @ts-ignore
|
||||
value: found.value.value ?? "TODO restored object"
|
||||
// TODO: Restoring nested object unneeded for now
|
||||
// 'Literal' (found.value.value) or 'ObjectExpression' (nested object)
|
||||
};
|
||||
};
|
||||
const getName = getPackageJsonProperty("name");
|
||||
const getKeywords = getPackageJsonProperty("keywords");
|
||||
const getDescription = getPackageJsonProperty("description");
|
||||
const getVersion = getPackageJsonProperty("version");
|
||||
const getN8n = getPackageJsonProperty("n8n");
|
||||
const getAuthor = getPackageJsonProperty("author");
|
||||
const getLicense = getPackageJsonProperty("license");
|
||||
const getRepository = getPackageJsonProperty("repository");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getAuthor,
|
||||
getDescription,
|
||||
getKeywords,
|
||||
getLicense,
|
||||
getN8n,
|
||||
getName,
|
||||
getRepository,
|
||||
getVersion
|
||||
});
|
||||
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/credentialClassBody.getters.js
generated
vendored
Normal file
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/credentialClassBody.getters.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var credentialClassBody_getters_exports = {};
|
||||
__export(credentialClassBody_getters_exports, {
|
||||
getDisplayName: () => getDisplayName,
|
||||
getDocumentationUrl: () => getDocumentationUrl,
|
||||
getExtendsValue: () => getExtendsValue,
|
||||
getName: () => getName,
|
||||
getPlaceholder: () => getPlaceholder
|
||||
});
|
||||
module.exports = __toCommonJS(credentialClassBody_getters_exports);
|
||||
var import_identifiers = require("../identifiers");
|
||||
var import_restoreValue = require("../utils/restoreValue");
|
||||
function getStringClassField(identifier, nodeParam) {
|
||||
const found = nodeParam.body.find(identifier);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: found.value.value
|
||||
};
|
||||
}
|
||||
function getName(classBody) {
|
||||
return getStringClassField(import_identifiers.id.credClassBody.isName, classBody);
|
||||
}
|
||||
function getDisplayName(classBody) {
|
||||
return getStringClassField(import_identifiers.id.credClassBody.isDisplayName, classBody);
|
||||
}
|
||||
function getDocumentationUrl(classBody) {
|
||||
return getStringClassField(import_identifiers.id.credClassBody.isDocumentationUrl, classBody);
|
||||
}
|
||||
function getPlaceholder(classBody) {
|
||||
return getStringClassField(import_identifiers.id.credClassBody.isPlaceholder, classBody);
|
||||
}
|
||||
function getExtendsValue(classBody, context) {
|
||||
const extendsNode = classBody.body.find(import_identifiers.id.credClassBody.isFieldExtends);
|
||||
if (!extendsNode)
|
||||
return null;
|
||||
const extendsSource = context.getSourceCode().getText(extendsNode.value);
|
||||
return (0, import_restoreValue.restoreValue)(extendsSource) ?? null;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getDisplayName,
|
||||
getDocumentationUrl,
|
||||
getExtendsValue,
|
||||
getName,
|
||||
getPlaceholder
|
||||
});
|
||||
51
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/index.js
generated
vendored
Normal file
51
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/index.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var getters_exports = {};
|
||||
__export(getters_exports, {
|
||||
getters: () => getters
|
||||
});
|
||||
module.exports = __toCommonJS(getters_exports);
|
||||
var nodeParam = __toESM(require("./nodeParameter.getters"));
|
||||
var nodeClassDescription = __toESM(require("./nodeClassDescription.getters"));
|
||||
var credClassBody = __toESM(require("./credentialClassBody.getters"));
|
||||
var communityPackageJson = __toESM(require("./communityPackageJson.getters"));
|
||||
var nodeExecuteBlock = __toESM(require("./nodeExecuteBlock.getters"));
|
||||
var common = __toESM(require("./common.getters"));
|
||||
const getters = {
|
||||
nodeParam,
|
||||
nodeClassDescription,
|
||||
credClassBody,
|
||||
communityPackageJson,
|
||||
nodeExecuteBlock,
|
||||
...common
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getters
|
||||
});
|
||||
111
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/nodeClassDescription.getters.js
generated
vendored
Normal file
111
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/nodeClassDescription.getters.js
generated
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var nodeClassDescription_getters_exports = {};
|
||||
__export(nodeClassDescription_getters_exports, {
|
||||
getCredOptions: () => getCredOptions,
|
||||
getDefaultVersion: () => getDefaultVersion,
|
||||
getDefaults: () => getDefaults,
|
||||
getDescription: () => getDescription,
|
||||
getDisplayName: () => getDisplayName,
|
||||
getIcon: () => getIcon,
|
||||
getInputs: () => getInputs,
|
||||
getName: () => getName,
|
||||
getOutputs: () => getOutputs,
|
||||
getSubtitle: () => getSubtitle,
|
||||
getVersion: () => getVersion
|
||||
});
|
||||
module.exports = __toCommonJS(nodeClassDescription_getters_exports);
|
||||
var import_identifiers = require("../identifiers");
|
||||
var import_restorers = require("../restorers");
|
||||
var import_nodeParameter = require("./nodeParameter.getters");
|
||||
function getCredOptions(nodeParam) {
|
||||
const found = nodeParam.properties.find(
|
||||
import_identifiers.id.nodeClassDescription.isCredentials
|
||||
);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: (0, import_restorers.restoreClassDescriptionOptions)(found.value.elements)
|
||||
};
|
||||
}
|
||||
function getInputs(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeClassDescription.isInputs);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
// @ts-ignore @TODO
|
||||
value: (0, import_restorers.restoreArray)(found.value.elements)
|
||||
};
|
||||
}
|
||||
function getOutputs(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeClassDescription.isOutputs);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
// @ts-ignore @TODO
|
||||
value: (0, import_restorers.restoreArray)(found.value.elements)
|
||||
};
|
||||
}
|
||||
function getSubtitle(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeClassDescription.isSubtitle);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: found.value.value
|
||||
};
|
||||
}
|
||||
const getName = import_nodeParameter.getName;
|
||||
const getDisplayName = import_nodeParameter.getDisplayName;
|
||||
const getDescription = import_nodeParameter.getDescription;
|
||||
function getVersion(nodeParam) {
|
||||
return (0, import_nodeParameter.getNumberProperty)(import_identifiers.id.nodeClassDescription.isVersion, nodeParam);
|
||||
}
|
||||
function getDefaultVersion(nodeParam) {
|
||||
return (0, import_nodeParameter.getNumberProperty)(import_identifiers.id.nodeClassDescription.isDefaultVersion, nodeParam);
|
||||
}
|
||||
function getIcon(nodeParam) {
|
||||
return (0, import_nodeParameter.getStringProperty)(import_identifiers.id.nodeClassDescription.isIcon, nodeParam);
|
||||
}
|
||||
function getDefaults(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeClassDescription.isDefaults);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: (0, import_restorers.restoreObject)(found.value)
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getCredOptions,
|
||||
getDefaultVersion,
|
||||
getDefaults,
|
||||
getDescription,
|
||||
getDisplayName,
|
||||
getIcon,
|
||||
getInputs,
|
||||
getName,
|
||||
getOutputs,
|
||||
getSubtitle,
|
||||
getVersion
|
||||
});
|
||||
119
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/nodeExecuteBlock.getters.js
generated
vendored
Normal file
119
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/nodeExecuteBlock.getters.js
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var nodeExecuteBlock_getters_exports = {};
|
||||
__export(nodeExecuteBlock_getters_exports, {
|
||||
collectConsequents: () => collectConsequents,
|
||||
getExecuteContent: () => getExecuteContent,
|
||||
getInputItemsIndexName: () => getInputItemsIndexName,
|
||||
getMarkedNodeFromConsequent: () => getMarkedNodeFromConsequent,
|
||||
getOperationConsequents: () => getOperationConsequents,
|
||||
getPairedItemValue: () => getPairedItemValue
|
||||
});
|
||||
module.exports = __toCommonJS(nodeExecuteBlock_getters_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_identifiers = require("../identifiers");
|
||||
function getOperationConsequents(node, { filter }) {
|
||||
const executeMethod = getExecuteContent(node);
|
||||
if (!executeMethod)
|
||||
return;
|
||||
const returnDataArrayName = getReturnDataArrayName(executeMethod);
|
||||
if (!returnDataArrayName)
|
||||
return;
|
||||
const forLoop = executeMethod.body.find(import_identifiers.id.nodeExecuteBlock.isForLoop);
|
||||
if (!forLoop)
|
||||
return;
|
||||
const inputItemsIndexName = getInputItemsIndexName(forLoop);
|
||||
if (!inputItemsIndexName)
|
||||
return;
|
||||
const tryCatch = forLoop.body.body.find(import_identifiers.id.nodeExecuteBlock.isTryCatch);
|
||||
if (!tryCatch)
|
||||
return;
|
||||
const resourcesRoot = tryCatch.block.body.find(
|
||||
import_identifiers.id.nodeExecuteBlock.isResourceChecksRoot
|
||||
);
|
||||
if (!resourcesRoot)
|
||||
return;
|
||||
const operationConsequents = collectConsequents(resourcesRoot).reduce((acc, resourceConsequent) => {
|
||||
if (resourceConsequent.body.length !== 1)
|
||||
return acc;
|
||||
const [operationsRoot] = resourceConsequent.body;
|
||||
const opConsequentsPerResource = filter === "all" ? collectConsequents(operationsRoot) : collectConsequents(operationsRoot).filter(
|
||||
(consequent) => filter === "plural" ? isGetAll(consequent) : !isGetAll(consequent)
|
||||
);
|
||||
return [...acc, ...opConsequentsPerResource];
|
||||
}, []);
|
||||
return {
|
||||
operationConsequents,
|
||||
inputItemsIndexName,
|
||||
returnDataArrayName
|
||||
};
|
||||
}
|
||||
function getExecuteContent({ key, value }) {
|
||||
if (key.type === import_utils.AST_NODE_TYPES.Identifier && key.name === "execute" && value.type === import_utils.AST_NODE_TYPES.FunctionExpression && value.body.type === import_utils.AST_NODE_TYPES.BlockStatement) {
|
||||
return value.body;
|
||||
}
|
||||
}
|
||||
function getReturnDataArrayName(executeMethod) {
|
||||
for (const node of executeMethod.body) {
|
||||
if (node.type === import_utils.AST_NODE_TYPES.VariableDeclaration && node.declarations.length === 1 && node.declarations[0].id.type === import_utils.AST_NODE_TYPES.Identifier && node.declarations[0].init !== null && node.declarations[0].init.type === import_utils.AST_NODE_TYPES.ArrayExpression && node.declarations[0].init.elements.length === 0 && node.declarations[0].id.typeAnnotation !== void 0 && node.declarations[0].id.typeAnnotation.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSArrayType && node.declarations[0].id.typeAnnotation.typeAnnotation.elementType.type === import_utils.AST_NODE_TYPES.TSTypeReference && node.declarations[0].id.typeAnnotation.typeAnnotation.elementType.typeName.type === import_utils.AST_NODE_TYPES.Identifier && ["IDataObject", "INodeExecutionData"].includes(
|
||||
node.declarations[0].id.typeAnnotation.typeAnnotation.elementType.typeName.name
|
||||
)) {
|
||||
return node.declarations[0].id.name;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getInputItemsIndexName(forLoop) {
|
||||
if (forLoop.init !== null && forLoop.init.type === import_utils.AST_NODE_TYPES.VariableDeclaration && forLoop.init.declarations.length > 0 && forLoop.init.declarations[0].type === import_utils.AST_NODE_TYPES.VariableDeclarator && forLoop.init.declarations[0].id.type === import_utils.AST_NODE_TYPES.Identifier) {
|
||||
return forLoop.init.declarations[0].id.name;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function collectConsequents(node, collection = []) {
|
||||
if (node.type === import_utils.AST_NODE_TYPES.IfStatement && node.consequent.type === import_utils.AST_NODE_TYPES.BlockStatement) {
|
||||
collection.push(node.consequent);
|
||||
}
|
||||
if (node.type === import_utils.AST_NODE_TYPES.IfStatement && node.alternate !== null && node.alternate.type === import_utils.AST_NODE_TYPES.IfStatement) {
|
||||
collectConsequents(node.alternate, collection);
|
||||
}
|
||||
return collection;
|
||||
}
|
||||
function getPairedItemValue(properties) {
|
||||
const found = properties.find(
|
||||
(property) => property.type === import_utils.AST_NODE_TYPES.Property && property.value.type === import_utils.AST_NODE_TYPES.ObjectExpression
|
||||
);
|
||||
return found ? found.value : null;
|
||||
}
|
||||
function getMarkedNodeFromConsequent(consequent) {
|
||||
if (consequent.parent?.type === import_utils.AST_NODE_TYPES.IfStatement && consequent.parent?.test.type === import_utils.AST_NODE_TYPES.BinaryExpression && consequent.parent?.test.operator === "===" && consequent.parent?.test.left.type === import_utils.AST_NODE_TYPES.Identifier && consequent.parent?.test.left.name === "operation") {
|
||||
return consequent.parent?.test.right;
|
||||
}
|
||||
}
|
||||
function isGetAll(consequent) {
|
||||
return consequent.parent !== void 0 && consequent.parent.type === import_utils.AST_NODE_TYPES.IfStatement && consequent.parent.test.type === import_utils.AST_NODE_TYPES.BinaryExpression && consequent.parent.test.operator === "===" && consequent.parent.test.left.type === import_utils.AST_NODE_TYPES.Identifier && consequent.parent.test.left.name === "operation" && consequent.parent.test.right.type === import_utils.AST_NODE_TYPES.Literal && consequent.parent.test.right.value === "getAll";
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
collectConsequents,
|
||||
getExecuteContent,
|
||||
getInputItemsIndexName,
|
||||
getMarkedNodeFromConsequent,
|
||||
getOperationConsequents,
|
||||
getPairedItemValue
|
||||
});
|
||||
316
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/nodeParameter.getters.js
generated
vendored
Normal file
316
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/getters/nodeParameter.getters.js
generated
vendored
Normal file
@@ -0,0 +1,316 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var nodeParameter_getters_exports = {};
|
||||
__export(nodeParameter_getters_exports, {
|
||||
getCollectionOptions: () => getCollectionOptions,
|
||||
getDefault: () => getDefault,
|
||||
getDescription: () => getDescription,
|
||||
getDisplayName: () => getDisplayName,
|
||||
getFixedCollectionValues: () => getFixedCollectionValues,
|
||||
getGetAllOption: () => getGetAllOption,
|
||||
getHint: () => getHint,
|
||||
getLoadOptionsMethod: () => getLoadOptionsMethod,
|
||||
getMaxValue: () => getMaxValue,
|
||||
getMinValue: () => getMinValue,
|
||||
getName: () => getName,
|
||||
getNoDataExpression: () => getNoDataExpression,
|
||||
getNumberProperty: () => getNumberProperty,
|
||||
getOptions: () => getOptions,
|
||||
getPlaceholder: () => getPlaceholder,
|
||||
getRequired: () => getRequired,
|
||||
getStringProperty: () => getStringProperty,
|
||||
getType: () => getType,
|
||||
getTypeOptions: () => getTypeOptions
|
||||
});
|
||||
module.exports = __toCommonJS(nodeParameter_getters_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_identifiers = require("../identifiers");
|
||||
var import_restorers = require("../restorers");
|
||||
var import_common = require("../identifiers/common.identifiers");
|
||||
function getStringProperty(identifier, nodeParam) {
|
||||
const found = nodeParam.properties.find(identifier);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: found.value.value
|
||||
};
|
||||
}
|
||||
function getDisplayName(nodeParam) {
|
||||
return getStringProperty(import_identifiers.id.nodeParam.isDisplayName, nodeParam);
|
||||
}
|
||||
function getPlaceholder(nodeParam) {
|
||||
return getStringProperty(import_identifiers.id.nodeParam.isPlaceholder, nodeParam);
|
||||
}
|
||||
function getName(nodeParam) {
|
||||
return getStringProperty(import_identifiers.id.nodeParam.isName, nodeParam);
|
||||
}
|
||||
function getHint(nodeParam) {
|
||||
return getStringProperty(import_identifiers.id.nodeParam.isHint, nodeParam);
|
||||
}
|
||||
function getType(nodeParam) {
|
||||
return getStringProperty(import_identifiers.id.nodeParam.isType, nodeParam);
|
||||
}
|
||||
function getBooleanProperty(identifier, nodeParam) {
|
||||
const found = nodeParam.properties.find(identifier);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: found.value.value
|
||||
};
|
||||
}
|
||||
function getNoDataExpression(nodeParam) {
|
||||
return getBooleanProperty(import_identifiers.id.nodeParam.isNoDataExpression, nodeParam);
|
||||
}
|
||||
function getRequired(nodeParam) {
|
||||
return getBooleanProperty(import_identifiers.id.nodeParam.isRequired, nodeParam);
|
||||
}
|
||||
function getNumberProperty(identifier, nodeParam) {
|
||||
const found = nodeParam.properties.find(identifier);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: found.value.value
|
||||
};
|
||||
}
|
||||
function getGetAllOption(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeParam.isGetAllOptionProperty);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: ""
|
||||
// TODO
|
||||
};
|
||||
}
|
||||
function getTypeOptions(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeParam.isTypeOptions);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: (0, import_restorers.restoreObject)(found.value)
|
||||
};
|
||||
}
|
||||
function getOptions(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeParam.isOptions);
|
||||
if (!found)
|
||||
return null;
|
||||
if (!found.value.elements) {
|
||||
return {
|
||||
ast: found,
|
||||
value: [{ name: "", value: "", description: "", action: "" }],
|
||||
// unused placeholder
|
||||
hasPropertyPointingToIdentifier: true
|
||||
};
|
||||
}
|
||||
const elements = found.value.elements.filter(
|
||||
(i) => i.type === "ObjectExpression"
|
||||
);
|
||||
if (!elements.length)
|
||||
return null;
|
||||
if (hasMemberExpression(elements)) {
|
||||
return {
|
||||
ast: found,
|
||||
value: (0, import_restorers.restoreNodeParamOptions)(elements),
|
||||
hasPropertyPointingToMemberExpression: true
|
||||
};
|
||||
}
|
||||
return {
|
||||
ast: found,
|
||||
value: (0, import_restorers.restoreNodeParamOptions)(elements)
|
||||
};
|
||||
}
|
||||
function getCollectionOptions(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeParam.isOptions);
|
||||
if (!found)
|
||||
return null;
|
||||
if (!found.value.elements) {
|
||||
return {
|
||||
ast: found,
|
||||
value: [{ displayName: "" }],
|
||||
// unused placeholder
|
||||
hasPropertyPointingToIdentifier: true
|
||||
};
|
||||
}
|
||||
const elements = found.value.elements.filter(
|
||||
(i) => i.type === "ObjectExpression"
|
||||
);
|
||||
if (!elements.length)
|
||||
return null;
|
||||
if (hasMemberExpression(elements)) {
|
||||
return {
|
||||
ast: found,
|
||||
value: (0, import_restorers.restoreNodeParamCollectionOptions)(elements),
|
||||
hasPropertyPointingToMemberExpression: true
|
||||
};
|
||||
}
|
||||
return {
|
||||
ast: found,
|
||||
value: (0, import_restorers.restoreNodeParamCollectionOptions)(elements),
|
||||
hasPropertyPointingToIdentifier: false
|
||||
};
|
||||
}
|
||||
function hasMemberExpression(elements) {
|
||||
return elements.find(
|
||||
(element) => element.properties.find(import_common.isMemberExpression)
|
||||
);
|
||||
}
|
||||
function getFixedCollectionValues(nodeParam) {
|
||||
const found = nodeParam.properties.find(import_identifiers.id.nodeParam.isFixedCollectionValues);
|
||||
if (!found)
|
||||
return null;
|
||||
const elements = found.value.elements.filter(
|
||||
(i) => i.type === "ObjectExpression"
|
||||
);
|
||||
if (!elements.length)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: (0, import_restorers.restoreFixedCollectionValues)(elements)
|
||||
};
|
||||
}
|
||||
function getTypeOptionsValue(nodeParam, identifier) {
|
||||
const typeOptions = getTypeOptions(nodeParam);
|
||||
if (!typeOptions)
|
||||
return null;
|
||||
const { properties } = typeOptions.ast.value;
|
||||
const found = properties.find(identifier);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: found.value.value
|
||||
};
|
||||
}
|
||||
const getMinValue = (nodeParam) => getTypeOptionsValue(nodeParam, import_identifiers.id.nodeParam.isMinValue);
|
||||
const getMaxValue = (nodeParam) => getTypeOptionsValue(nodeParam, import_identifiers.id.nodeParam.isMaxValue);
|
||||
function getLoadOptionsMethod(nodeParam) {
|
||||
const typeOptions = getTypeOptions(nodeParam);
|
||||
if (!typeOptions)
|
||||
return null;
|
||||
const { properties } = typeOptions.ast.value;
|
||||
const found = properties.find(import_identifiers.id.nodeParam.isLoadOptionsMethod);
|
||||
if (!found)
|
||||
return null;
|
||||
return {
|
||||
ast: found,
|
||||
value: found.value.value
|
||||
};
|
||||
}
|
||||
function getDescription(nodeParam) {
|
||||
for (const property of nodeParam.properties) {
|
||||
if (import_identifiers.id.nodeParam.isDescription(property)) {
|
||||
return {
|
||||
ast: property,
|
||||
value: property.value.value
|
||||
};
|
||||
}
|
||||
if (import_identifiers.id.nodeParam.isTemplateDescription(property)) {
|
||||
if (property.value.quasis.length > 1) {
|
||||
const consolidated = property.value.quasis.map((templateElement2) => templateElement2.value.cooked).join();
|
||||
return {
|
||||
ast: property,
|
||||
value: consolidated,
|
||||
hasUnneededBackticks: false
|
||||
};
|
||||
}
|
||||
const [templateElement] = property.value.quasis;
|
||||
const { value: content } = templateElement;
|
||||
const escapedRawContent = content.raw.replace(/\\/g, "");
|
||||
return {
|
||||
ast: property,
|
||||
value: content.raw,
|
||||
hasUnneededBackticks: escapedRawContent === content.cooked
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getDefault(nodeParam) {
|
||||
const isUnparseable = (type) => [import_utils.AST_NODE_TYPES.CallExpression, import_utils.AST_NODE_TYPES.Identifier].includes(type);
|
||||
for (const property of nodeParam.properties) {
|
||||
if (property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "default" && isUnparseable(property.value.type)) {
|
||||
return {
|
||||
ast: property,
|
||||
isUnparseable: true
|
||||
// `default: myVar.join(',')` or `default: myVar`
|
||||
};
|
||||
}
|
||||
if (import_identifiers.id.nodeParam.isTemplateLiteralDefault(property)) {
|
||||
const consolidated = property.value.quasis.map((templateElement) => templateElement.value.cooked).join();
|
||||
return {
|
||||
ast: property,
|
||||
value: consolidated
|
||||
};
|
||||
}
|
||||
if (import_identifiers.id.nodeParam.isUnaryExpression(property)) {
|
||||
return {
|
||||
ast: property,
|
||||
value: parseInt(
|
||||
property.value.operator + property.value.argument.raw
|
||||
// e.g. -1
|
||||
)
|
||||
};
|
||||
}
|
||||
if (import_identifiers.id.nodeParam.isPrimitiveDefault(property)) {
|
||||
return {
|
||||
ast: property,
|
||||
value: property.value.value
|
||||
};
|
||||
}
|
||||
if (import_identifiers.id.nodeParam.isObjectDefault(property)) {
|
||||
return {
|
||||
ast: property,
|
||||
value: (0, import_restorers.restoreObject)(property.value)
|
||||
};
|
||||
}
|
||||
if (import_identifiers.id.nodeParam.isArrayDefault(property)) {
|
||||
return {
|
||||
ast: property,
|
||||
value: property.value.elements
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getCollectionOptions,
|
||||
getDefault,
|
||||
getDescription,
|
||||
getDisplayName,
|
||||
getFixedCollectionValues,
|
||||
getGetAllOption,
|
||||
getHint,
|
||||
getLoadOptionsMethod,
|
||||
getMaxValue,
|
||||
getMinValue,
|
||||
getName,
|
||||
getNoDataExpression,
|
||||
getNumberProperty,
|
||||
getOptions,
|
||||
getPlaceholder,
|
||||
getRequired,
|
||||
getStringProperty,
|
||||
getType,
|
||||
getTypeOptions
|
||||
});
|
||||
119
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/common.identifiers.js
generated
vendored
Normal file
119
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/common.identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var common_identifiers_exports = {};
|
||||
__export(common_identifiers_exports, {
|
||||
hasValue: () => hasValue,
|
||||
isArgument: () => isArgument,
|
||||
isArrayExpression: () => isArrayExpression,
|
||||
isArrayPropertyNamed: () => isArrayPropertyNamed,
|
||||
isBooleanPropertyNamed: () => isBooleanPropertyNamed,
|
||||
isCredentialClass: () => isCredentialClass,
|
||||
isIdentifierPropertyNamed: () => isIdentifierPropertyNamed,
|
||||
isLiteral: () => isLiteral,
|
||||
isMemberExpression: () => isMemberExpression,
|
||||
isNumericPropertyNamed: () => isNumericPropertyNamed,
|
||||
isObjectPropertyNamed: () => isObjectPropertyNamed,
|
||||
isReturnValue: () => isReturnValue,
|
||||
isStringPropertyNamed: () => isStringPropertyNamed,
|
||||
isWeakDescription: () => isWeakDescription
|
||||
});
|
||||
module.exports = __toCommonJS(common_identifiers_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_constants = require("../../constants");
|
||||
function isTargetProperty({
|
||||
keyName,
|
||||
valueType
|
||||
}, property) {
|
||||
if (property.type !== import_utils.AST_NODE_TYPES.Property || property.computed !== false || property.key.type !== import_utils.AST_NODE_TYPES.Identifier || property.key.name !== keyName) {
|
||||
return false;
|
||||
}
|
||||
if (valueType === "object") {
|
||||
return property.value.type === import_utils.AST_NODE_TYPES.ObjectExpression;
|
||||
}
|
||||
if (valueType === "array") {
|
||||
return property.value.type === import_utils.AST_NODE_TYPES.ArrayExpression;
|
||||
}
|
||||
return property.value.type === import_utils.AST_NODE_TYPES.Literal && typeof property.value.value === valueType;
|
||||
}
|
||||
function isStringPropertyNamed(keyName, property) {
|
||||
return isTargetProperty({ keyName, valueType: "string" }, property);
|
||||
}
|
||||
function isNumericPropertyNamed(keyName, property) {
|
||||
return isTargetProperty({ keyName, valueType: "number" }, property);
|
||||
}
|
||||
function isBooleanPropertyNamed(keyName, property) {
|
||||
return isTargetProperty({ keyName, valueType: "boolean" }, property);
|
||||
}
|
||||
function isObjectPropertyNamed(keyName, property) {
|
||||
return isTargetProperty({ keyName, valueType: "object" }, property);
|
||||
}
|
||||
function isArrayPropertyNamed(keyName, property) {
|
||||
return isTargetProperty({ keyName, valueType: "array" }, property);
|
||||
}
|
||||
function isIdentifierPropertyNamed(keyName, property) {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === keyName && property.value.type === import_utils.AST_NODE_TYPES.Identifier;
|
||||
}
|
||||
function isCredentialClass(node) {
|
||||
return node.implements?.length === 1 && node.implements[0].type === import_utils.AST_NODE_TYPES.TSClassImplements && node.implements[0].expression.type === import_utils.AST_NODE_TYPES.Identifier && node.implements[0].expression.name === "ICredentialType";
|
||||
}
|
||||
function hasValue(value, nodeParam) {
|
||||
for (const property of nodeParam.properties) {
|
||||
if (property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.value.type === import_utils.AST_NODE_TYPES.Literal && property.value.value === value && typeof property.value.value === "string") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isReturnValue(node) {
|
||||
return node.parent?.type === import_utils.AST_NODE_TYPES.ReturnStatement;
|
||||
}
|
||||
function isArgument(node) {
|
||||
return node.parent?.type === import_utils.AST_NODE_TYPES.TSAsExpression || node.parent?.type === import_utils.AST_NODE_TYPES.CallExpression;
|
||||
}
|
||||
function isWeakDescription({ value }) {
|
||||
return import_constants.WEAK_DESCRIPTIONS.some(
|
||||
(wd) => value.toLowerCase().includes(wd.toLowerCase())
|
||||
);
|
||||
}
|
||||
const isLiteral = (property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.value.type === import_utils.AST_NODE_TYPES.Literal;
|
||||
};
|
||||
const isArrayExpression = (property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && typeof property.key.name === "string" && property.value.type === import_utils.AST_NODE_TYPES.ArrayExpression;
|
||||
};
|
||||
const isMemberExpression = (property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && typeof property.key.name === "string" && property.value.type === import_utils.AST_NODE_TYPES.MemberExpression;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
hasValue,
|
||||
isArgument,
|
||||
isArrayExpression,
|
||||
isArrayPropertyNamed,
|
||||
isBooleanPropertyNamed,
|
||||
isCredentialClass,
|
||||
isIdentifierPropertyNamed,
|
||||
isLiteral,
|
||||
isMemberExpression,
|
||||
isNumericPropertyNamed,
|
||||
isObjectPropertyNamed,
|
||||
isReturnValue,
|
||||
isStringPropertyNamed,
|
||||
isWeakDescription
|
||||
});
|
||||
72
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/communityPackageJson.identifiers.js
generated
vendored
Normal file
72
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/communityPackageJson.identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var communityPackageJson_identifiers_exports = {};
|
||||
__export(communityPackageJson_identifiers_exports, {
|
||||
hasEmailLiteral: () => hasEmailLiteral,
|
||||
hasNameLiteral: () => hasNameLiteral,
|
||||
hasNodesApiVersion: () => hasNodesApiVersion,
|
||||
hasNodesLiteral: () => hasNodesLiteral,
|
||||
hasUrlLiteral: () => hasUrlLiteral,
|
||||
isCommunityPackageJson: () => isCommunityPackageJson,
|
||||
prod: () => prod,
|
||||
test: () => test
|
||||
});
|
||||
module.exports = __toCommonJS(communityPackageJson_identifiers_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_identifiers = require("../identifiers");
|
||||
const isTestRun = process.env.NODE_ENV === "test";
|
||||
const isProdRun = !isTestRun;
|
||||
function isCommunityPackageJson(filename, node) {
|
||||
if (isProdRun && !filename.includes("package.json"))
|
||||
return false;
|
||||
if (isProdRun && !import_identifiers.id.prod.isTopLevelObjectExpression(node))
|
||||
return false;
|
||||
if (isTestRun && !import_identifiers.id.test.isTopLevelObjectExpression(node))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
const prod = {
|
||||
isTopLevelObjectExpression(node) {
|
||||
return node.parent?.parent?.type === import_utils.AST_NODE_TYPES.Program;
|
||||
}
|
||||
};
|
||||
const test = {
|
||||
isTopLevelObjectExpression(node) {
|
||||
return node.parent?.parent?.type === import_utils.AST_NODE_TYPES.VariableDeclaration;
|
||||
}
|
||||
};
|
||||
const hasLiteral = (keyName) => (property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Literal && property.key.value === keyName;
|
||||
};
|
||||
const hasNameLiteral = hasLiteral("name");
|
||||
const hasEmailLiteral = hasLiteral("email");
|
||||
const hasNodesLiteral = hasLiteral("nodes");
|
||||
const hasNodesApiVersion = hasLiteral("n8nNodesApiVersion");
|
||||
const hasUrlLiteral = hasLiteral("url");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
hasEmailLiteral,
|
||||
hasNameLiteral,
|
||||
hasNodesApiVersion,
|
||||
hasNodesLiteral,
|
||||
hasUrlLiteral,
|
||||
isCommunityPackageJson,
|
||||
prod,
|
||||
test
|
||||
});
|
||||
61
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/credentialClassBody.identifiers.js
generated
vendored
Normal file
61
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/credentialClassBody.identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var credentialClassBody_identifiers_exports = {};
|
||||
__export(credentialClassBody_identifiers_exports, {
|
||||
isDisplayName: () => isDisplayName,
|
||||
isDocumentationUrl: () => isDocumentationUrl,
|
||||
isFieldExtends: () => isFieldExtends,
|
||||
isName: () => isName,
|
||||
isPlaceholder: () => isPlaceholder
|
||||
});
|
||||
module.exports = __toCommonJS(credentialClassBody_identifiers_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
function isStringField(fieldName, property) {
|
||||
return "key" in property && "type" in property.key && // property.type === AST_NODE_TYPES.PropertyDefinition &&
|
||||
// property.computed === false &&
|
||||
property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === fieldName && property.value !== null && property.value.type === import_utils.AST_NODE_TYPES.Literal && typeof property.value.value === "string";
|
||||
}
|
||||
function isName(property) {
|
||||
return isStringField("name", property);
|
||||
}
|
||||
function isDisplayName(property) {
|
||||
return isStringField("displayName", property);
|
||||
}
|
||||
function isDocumentationUrl(property) {
|
||||
return isStringField("documentationUrl", property);
|
||||
}
|
||||
function isPlaceholder(property) {
|
||||
return isStringField("placeholder", property);
|
||||
}
|
||||
function isArrayField(fieldName, property) {
|
||||
return "key" in property && "type" in property.key && // property.type === AST_NODE_TYPES.PropertyDefinition &&
|
||||
// property.computed === false &&
|
||||
property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === fieldName && property.value !== null && property.value.type === import_utils.AST_NODE_TYPES.ArrayExpression;
|
||||
}
|
||||
function isFieldExtends(property) {
|
||||
return isArrayField("extends", property);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
isDisplayName,
|
||||
isDocumentationUrl,
|
||||
isFieldExtends,
|
||||
isName,
|
||||
isPlaceholder
|
||||
});
|
||||
53
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/index.js
generated
vendored
Normal file
53
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/index.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var identifiers_exports = {};
|
||||
__export(identifiers_exports, {
|
||||
id: () => id
|
||||
});
|
||||
module.exports = __toCommonJS(identifiers_exports);
|
||||
var communityPackageJson = __toESM(require("./communityPackageJson.identifiers"));
|
||||
var nodeParam = __toESM(require("./nodeParameter.identifiers"));
|
||||
var nodeClassDescription = __toESM(require("./nodeClassDescription.identifiers"));
|
||||
var credClassBody = __toESM(require("./credentialClassBody.identifiers"));
|
||||
var nodeExecuteBlock = __toESM(require("./nodeExecuteBlock.identifiers"));
|
||||
var lintableSections = __toESM(require("./lintable.identifiers"));
|
||||
var common = __toESM(require("./common.identifiers"));
|
||||
const id = {
|
||||
nodeParam,
|
||||
credClassBody,
|
||||
nodeClassDescription,
|
||||
nodeExecuteBlock,
|
||||
...communityPackageJson,
|
||||
...lintableSections,
|
||||
...common
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
id
|
||||
});
|
||||
66
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/lintable.identifiers.js
generated
vendored
Normal file
66
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/lintable.identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var lintable_identifiers_exports = {};
|
||||
__export(lintable_identifiers_exports, {
|
||||
IDENTIFIER_KEYS: () => IDENTIFIER_KEYS,
|
||||
isFixedCollectionSection: () => isFixedCollectionSection,
|
||||
isNodeClassDescription: () => isNodeClassDescription,
|
||||
isNodeParameter: () => isNodeParameter,
|
||||
isOption: () => isOption
|
||||
});
|
||||
module.exports = __toCommonJS(lintable_identifiers_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
const IDENTIFIER_KEYS = {
|
||||
nodeParam: ["displayName", "name", "type", "default"],
|
||||
option: ["name", "value"],
|
||||
// in options-type or multi-options-type node param
|
||||
fixedCollectionSection: ["displayName", "name", "values"],
|
||||
nodeClassDescription: ["displayName", "name", "group"]
|
||||
};
|
||||
function isLintableSection(section, node, options) {
|
||||
const requiredKeys = IDENTIFIER_KEYS[section];
|
||||
const keysToCheck = options ? requiredKeys.filter((key) => !options.skipKeys.includes(key)) : requiredKeys;
|
||||
const totalFound = node.properties.reduce((acc, property) => {
|
||||
if (property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Identifier && keysToCheck.includes(property.key.name)) {
|
||||
acc++;
|
||||
}
|
||||
return acc;
|
||||
}, 0);
|
||||
return totalFound === keysToCheck.length;
|
||||
}
|
||||
function isNodeParameter(node, options) {
|
||||
return isLintableSection("nodeParam", node, options);
|
||||
}
|
||||
function isOption(node) {
|
||||
return isLintableSection("option", node);
|
||||
}
|
||||
function isFixedCollectionSection(node) {
|
||||
return isLintableSection("fixedCollectionSection", node);
|
||||
}
|
||||
function isNodeClassDescription(node) {
|
||||
return isLintableSection("nodeClassDescription", node);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
IDENTIFIER_KEYS,
|
||||
isFixedCollectionSection,
|
||||
isNodeClassDescription,
|
||||
isNodeParameter,
|
||||
isOption
|
||||
});
|
||||
76
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/nodeClassDescription.identifiers.js
generated
vendored
Normal file
76
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/nodeClassDescription.identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var nodeClassDescription_identifiers_exports = {};
|
||||
__export(nodeClassDescription_identifiers_exports, {
|
||||
isCredentials: () => isCredentials,
|
||||
isDefaultVersion: () => isDefaultVersion,
|
||||
isDefaults: () => isDefaults,
|
||||
isIcon: () => isIcon,
|
||||
isInputs: () => isInputs,
|
||||
isName: () => isName,
|
||||
isOutputs: () => isOutputs,
|
||||
isProperties: () => isProperties,
|
||||
isSubtitle: () => isSubtitle,
|
||||
isVersion: () => isVersion
|
||||
});
|
||||
module.exports = __toCommonJS(nodeClassDescription_identifiers_exports);
|
||||
var import_common = require("./common.identifiers");
|
||||
function isName(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("name", property);
|
||||
}
|
||||
function isIcon(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("icon", property);
|
||||
}
|
||||
function isVersion(property) {
|
||||
return (0, import_common.isNumericPropertyNamed)("version", property);
|
||||
}
|
||||
function isSubtitle(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("subtitle", property);
|
||||
}
|
||||
function isDefaultVersion(property) {
|
||||
return (0, import_common.isNumericPropertyNamed)("defaultVersion", property);
|
||||
}
|
||||
function isInputs(property) {
|
||||
return (0, import_common.isArrayPropertyNamed)("inputs", property);
|
||||
}
|
||||
function isOutputs(property) {
|
||||
return (0, import_common.isArrayPropertyNamed)("outputs", property);
|
||||
}
|
||||
function isCredentials(property) {
|
||||
return (0, import_common.isArrayPropertyNamed)("credentials", property);
|
||||
}
|
||||
function isProperties(property) {
|
||||
return (0, import_common.isArrayPropertyNamed)("properties", property);
|
||||
}
|
||||
function isDefaults(property) {
|
||||
return (0, import_common.isObjectPropertyNamed)("defaults", property);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
isCredentials,
|
||||
isDefaultVersion,
|
||||
isDefaults,
|
||||
isIcon,
|
||||
isInputs,
|
||||
isName,
|
||||
isOutputs,
|
||||
isProperties,
|
||||
isSubtitle,
|
||||
isVersion
|
||||
});
|
||||
129
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/nodeExecuteBlock.identifiers.js
generated
vendored
Normal file
129
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/nodeExecuteBlock.identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var nodeExecuteBlock_identifiers_exports = {};
|
||||
__export(nodeExecuteBlock_identifiers_exports, {
|
||||
hasValidPluralPairingArgument: () => hasValidPluralPairingArgument,
|
||||
hasValidSingularPairingArgument: () => hasValidSingularPairingArgument,
|
||||
isForLoop: () => isForLoop,
|
||||
isPluralPairingStatement: () => isPluralPairingStatement,
|
||||
isResourceChecksRoot: () => isResourceChecksRoot,
|
||||
isSingularPairingStatement: () => isSingularPairingStatement,
|
||||
isTryCatch: () => isTryCatch
|
||||
});
|
||||
module.exports = __toCommonJS(nodeExecuteBlock_identifiers_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_getters = require("../getters");
|
||||
const isForLoop = (node) => node.type === import_utils.AST_NODE_TYPES.ForStatement;
|
||||
const isTryCatch = (node) => node.type === import_utils.AST_NODE_TYPES.TryStatement;
|
||||
const isResourceChecksRoot = (node) => node.type === import_utils.AST_NODE_TYPES.IfStatement && node.test.type === import_utils.AST_NODE_TYPES.BinaryExpression && node.test.operator === "===" && node.test.left.type === import_utils.AST_NODE_TYPES.Identifier && node.test.left.name === "resource";
|
||||
function isPluralPairingStatement(lastStatement, returnDataArrayName) {
|
||||
return lastStatement.type === import_utils.AST_NODE_TYPES.ExpressionStatement && isReturnDataPush(lastStatement, returnDataArrayName) && hasSpreadArgument(lastStatement);
|
||||
}
|
||||
const hasSpreadArgument = (statement) => statement.expression.arguments.length === 1 && statement.expression.arguments[0].type === import_utils.AST_NODE_TYPES.SpreadElement;
|
||||
function isSingularPairingStatement(lastStatement, returnDataArrayName) {
|
||||
return lastStatement.type === import_utils.AST_NODE_TYPES.ExpressionStatement && isReturnDataPush(lastStatement, returnDataArrayName) && hasSingleArgument(lastStatement);
|
||||
}
|
||||
const isReturnDataPush = (node, returnDataArrayName) => {
|
||||
return node.expression.type === import_utils.AST_NODE_TYPES.CallExpression && node.expression.callee.type === import_utils.AST_NODE_TYPES.MemberExpression && node.expression.callee.object.type === import_utils.AST_NODE_TYPES.Identifier && node.expression.callee.object.name === returnDataArrayName && node.expression.callee.property.type === import_utils.AST_NODE_TYPES.Identifier && node.expression.callee.property.name === "push";
|
||||
};
|
||||
const hasSingleArgument = (statement) => statement.expression.arguments.length === 1;
|
||||
function hasValidSingularPairingArgument(lastStatement, inputItemsIndexName) {
|
||||
const [argument] = lastStatement.expression.arguments;
|
||||
if (argument.type !== import_utils.AST_NODE_TYPES.ObjectExpression)
|
||||
return false;
|
||||
const hasJsonKey = argument.properties.some(
|
||||
(property) => property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "json"
|
||||
);
|
||||
if (!hasJsonKey)
|
||||
return false;
|
||||
const hasResponseDataValue = argument.properties.some(
|
||||
(property) => property.type === import_utils.AST_NODE_TYPES.Property && property.value.type === import_utils.AST_NODE_TYPES.Identifier && property.value.name === "responseData"
|
||||
);
|
||||
if (!hasResponseDataValue)
|
||||
return false;
|
||||
const hasPairedItemKey = argument.properties.some(
|
||||
(property) => property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "pairedItem"
|
||||
);
|
||||
if (!hasPairedItemKey)
|
||||
return false;
|
||||
const pairedItemValue = import_getters.getters.nodeExecuteBlock.getPairedItemValue(
|
||||
argument.properties
|
||||
);
|
||||
if (!pairedItemValue)
|
||||
return false;
|
||||
const hasPairedItemValueContent = pairedItemValue.properties.find(
|
||||
(property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "item" && property.value.type === import_utils.AST_NODE_TYPES.Identifier && property.value.name === inputItemsIndexName;
|
||||
}
|
||||
);
|
||||
if (!hasPairedItemValueContent)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
function hasValidPluralPairingArgument(lastStatement, inputItemsIndexName) {
|
||||
const [argument] = lastStatement.expression.arguments;
|
||||
if (argument.type !== import_utils.AST_NODE_TYPES.SpreadElement)
|
||||
return false;
|
||||
if (argument.argument.type !== import_utils.AST_NODE_TYPES.CallExpression)
|
||||
return false;
|
||||
const hasResponseDataMap = argument.argument.callee.type === import_utils.AST_NODE_TYPES.MemberExpression && argument.argument.callee.object.type === import_utils.AST_NODE_TYPES.Identifier && argument.argument.callee.object.name === "responseData" && argument.argument.callee.property.type === import_utils.AST_NODE_TYPES.Identifier && argument.argument.callee.property.name === "map";
|
||||
if (!hasResponseDataMap)
|
||||
return false;
|
||||
if (argument.argument.arguments.length !== 1)
|
||||
return false;
|
||||
const [arrowFunction] = argument.argument.arguments;
|
||||
const hasArrowFunctionWithJsonArg = arrowFunction.type === import_utils.AST_NODE_TYPES.ArrowFunctionExpression && arrowFunction.params.length === 1 && arrowFunction.params[0].type === import_utils.AST_NODE_TYPES.Identifier && arrowFunction.params[0].name === "json";
|
||||
if (!hasArrowFunctionWithJsonArg)
|
||||
return false;
|
||||
const returnsObject = arrowFunction.body.type === import_utils.AST_NODE_TYPES.BlockStatement && arrowFunction.body.body.length === 1 && arrowFunction.body.body[0].type === import_utils.AST_NODE_TYPES.ReturnStatement && arrowFunction.body.body[0].argument !== null && arrowFunction.body.body[0].argument.type === import_utils.AST_NODE_TYPES.ObjectExpression;
|
||||
if (!returnsObject)
|
||||
return false;
|
||||
const { properties } = arrowFunction.body.body[0].argument;
|
||||
const returnedObjectHasJson = properties.some(
|
||||
(property) => property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "json" && property.value.type === import_utils.AST_NODE_TYPES.Identifier && property.value.name === "json"
|
||||
);
|
||||
if (!returnedObjectHasJson)
|
||||
return false;
|
||||
const returnedObjectHasPairedItem = properties.find(
|
||||
(property) => property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "pairedItem" && property.value.type === import_utils.AST_NODE_TYPES.ObjectExpression && property.value.properties.length === 1
|
||||
);
|
||||
if (!returnedObjectHasPairedItem)
|
||||
return false;
|
||||
const pairedItemValue = import_getters.getters.nodeExecuteBlock.getPairedItemValue(properties);
|
||||
if (!pairedItemValue)
|
||||
return false;
|
||||
const hasPairedItemValueContent = pairedItemValue.properties.find(
|
||||
(property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "item" && property.value.type === import_utils.AST_NODE_TYPES.Identifier && property.value.name === inputItemsIndexName;
|
||||
}
|
||||
);
|
||||
if (!hasPairedItemValueContent)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
hasValidPluralPairingArgument,
|
||||
hasValidSingularPairingArgument,
|
||||
isForLoop,
|
||||
isPluralPairingStatement,
|
||||
isResourceChecksRoot,
|
||||
isSingularPairingStatement,
|
||||
isTryCatch
|
||||
});
|
||||
250
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/nodeParameter.identifiers.js
generated
vendored
Normal file
250
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/identifiers/nodeParameter.identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,250 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var nodeParameter_identifiers_exports = {};
|
||||
__export(nodeParameter_identifiers_exports, {
|
||||
hasName: () => hasName,
|
||||
isAction: () => isAction,
|
||||
isArrayDefault: () => isArrayDefault,
|
||||
isBooleanType: () => isBooleanType,
|
||||
isCollectionType: () => isCollectionType,
|
||||
isDescription: () => isDescription,
|
||||
isDisplayName: () => isDisplayName,
|
||||
isDisplayOptions: () => isDisplayOptions,
|
||||
isDisplayOptionsShow: () => isDisplayOptionsShow,
|
||||
isEmail: () => isEmail,
|
||||
isFixedCollectionType: () => isFixedCollectionType,
|
||||
isFixedCollectionValues: () => isFixedCollectionValues,
|
||||
isGetAllOptionProperty: () => isGetAllOptionProperty,
|
||||
isHint: () => isHint,
|
||||
isIgnoreSslIssues: () => isIgnoreSslIssues,
|
||||
isLimit: () => isLimit,
|
||||
isLoadOptionsMethod: () => isLoadOptionsMethod,
|
||||
isMaxValue: () => isMaxValue,
|
||||
isMinValue: () => isMinValue,
|
||||
isMultiOptionsType: () => isMultiOptionsType,
|
||||
isName: () => isName,
|
||||
isNoDataExpression: () => isNoDataExpression,
|
||||
isNumericType: () => isNumericType,
|
||||
isObjectDefault: () => isObjectDefault,
|
||||
isOperation: () => isOperation,
|
||||
isOptions: () => isOptions,
|
||||
isOptionsType: () => isOptionsType,
|
||||
isPlaceholder: () => isPlaceholder,
|
||||
isPrimitiveDefault: () => isPrimitiveDefault,
|
||||
isRequired: () => isRequired,
|
||||
isResource: () => isResource,
|
||||
isReturnAll: () => isReturnAll,
|
||||
isShowSetting: () => isShowSetting,
|
||||
isSimplify: () => isSimplify,
|
||||
isStringType: () => isStringType,
|
||||
isTemplateDescription: () => isTemplateDescription,
|
||||
isTemplateLiteralDefault: () => isTemplateLiteralDefault,
|
||||
isType: () => isType,
|
||||
isTypeOptions: () => isTypeOptions,
|
||||
isUnaryExpression: () => isUnaryExpression,
|
||||
isUpdateFields: () => isUpdateFields,
|
||||
isValue: () => isValue
|
||||
});
|
||||
module.exports = __toCommonJS(nodeParameter_identifiers_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_common = require("./common.identifiers");
|
||||
function isParamOfType(type, nodeParam) {
|
||||
const found = nodeParam.properties.find((property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "type" && property.value.type === import_utils.AST_NODE_TYPES.Literal && property.value.value === type;
|
||||
});
|
||||
return Boolean(found);
|
||||
}
|
||||
function isStringType(nodeParam) {
|
||||
return isParamOfType("string", nodeParam);
|
||||
}
|
||||
function isNumericType(nodeParam) {
|
||||
return isParamOfType("number", nodeParam);
|
||||
}
|
||||
function isBooleanType(nodeParam) {
|
||||
return isParamOfType("boolean", nodeParam);
|
||||
}
|
||||
function isOptionsType(nodeParam) {
|
||||
return isParamOfType("options", nodeParam);
|
||||
}
|
||||
function isMultiOptionsType(nodeParam) {
|
||||
return isParamOfType("multiOptions", nodeParam);
|
||||
}
|
||||
function isCollectionType(nodeParam) {
|
||||
return isParamOfType("collection", nodeParam);
|
||||
}
|
||||
function isFixedCollectionType(nodeParam) {
|
||||
return isParamOfType("fixedCollection", nodeParam);
|
||||
}
|
||||
function hasName(name, nodeParam) {
|
||||
let check = (value) => value === name;
|
||||
if (name === "update")
|
||||
check = (value) => /update/.test(value);
|
||||
for (const property of nodeParam.properties) {
|
||||
if (property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "name" && property.value.type === import_utils.AST_NODE_TYPES.Literal && typeof property.value.value === "string" && check(property.value.value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isEmail(nodeParam) {
|
||||
return isStringType(nodeParam) && hasName("email", nodeParam);
|
||||
}
|
||||
function isSimplify(nodeParam) {
|
||||
return isBooleanType(nodeParam) && hasName("simple", nodeParam);
|
||||
}
|
||||
function isLimit(nodeParam) {
|
||||
return isNumericType(nodeParam) && hasName("limit", nodeParam);
|
||||
}
|
||||
function isReturnAll(nodeParam) {
|
||||
return isBooleanType(nodeParam) && hasName("returnAll", nodeParam);
|
||||
}
|
||||
function isIgnoreSslIssues(nodeParam) {
|
||||
return isBooleanType(nodeParam) && hasName("allowUnauthorizedCerts", nodeParam);
|
||||
}
|
||||
function isUpdateFields(nodeParam) {
|
||||
return isCollectionType(nodeParam) && hasName("update", nodeParam);
|
||||
}
|
||||
function isResource(nodeParam) {
|
||||
return isOptionsType(nodeParam) && hasName("resource", nodeParam);
|
||||
}
|
||||
function isOperation(nodeParam) {
|
||||
return isOptionsType(nodeParam) && hasName("operation", nodeParam);
|
||||
}
|
||||
function isAction(nodeParam) {
|
||||
return isOptionsType(nodeParam) && hasName("action", nodeParam);
|
||||
}
|
||||
function isRequired(property) {
|
||||
return (0, import_common.isBooleanPropertyNamed)("required", property);
|
||||
}
|
||||
function isNoDataExpression(property) {
|
||||
return (0, import_common.isBooleanPropertyNamed)("noDataExpression", property);
|
||||
}
|
||||
function isDisplayName(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("displayName", property);
|
||||
}
|
||||
function isPlaceholder(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("placeholder", property);
|
||||
}
|
||||
function isType(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("type", property);
|
||||
}
|
||||
function isName(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("name", property);
|
||||
}
|
||||
function isHint(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("hint", property);
|
||||
}
|
||||
function isValue(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("value", property);
|
||||
}
|
||||
function isDisplayOptions(property) {
|
||||
return (0, import_common.isObjectPropertyNamed)("displayOptions", property);
|
||||
}
|
||||
const isUnaryExpression = (property) => {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.value.type === import_utils.AST_NODE_TYPES.UnaryExpression;
|
||||
};
|
||||
function isPrimitiveDefault(property) {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "default" && property.value.type === import_utils.AST_NODE_TYPES.Literal;
|
||||
}
|
||||
function isTemplateLiteralDefault(property) {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "default" && property.value.type === import_utils.AST_NODE_TYPES.TemplateLiteral && property.value.quasis.length > 0;
|
||||
}
|
||||
function isObjectDefault(property) {
|
||||
return (0, import_common.isObjectPropertyNamed)("default", property);
|
||||
}
|
||||
function isArrayDefault(property) {
|
||||
return (0, import_common.isArrayPropertyNamed)("default", property);
|
||||
}
|
||||
function isOptions(property) {
|
||||
return (0, import_common.isArrayPropertyNamed)("options", property) || (0, import_common.isIdentifierPropertyNamed)("options", property);
|
||||
}
|
||||
function isTypeOptions(property) {
|
||||
return (0, import_common.isObjectPropertyNamed)("typeOptions", property);
|
||||
}
|
||||
function isTypeOptionsValue(property, keyName, valueType) {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.value.type === import_utils.AST_NODE_TYPES.Literal && property.key.name === keyName && typeof property.value.value === valueType;
|
||||
}
|
||||
const isMinValue = (property) => isTypeOptionsValue(property, "minValue", "number");
|
||||
const isMaxValue = (property) => isTypeOptionsValue(property, "maxValue", "number");
|
||||
function isLoadOptionsMethod(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("loadOptionsMethod", property);
|
||||
}
|
||||
function isDescription(property) {
|
||||
return (0, import_common.isStringPropertyNamed)("description", property);
|
||||
}
|
||||
function isTemplateDescription(property) {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "description" && property.value.type === import_utils.AST_NODE_TYPES.TemplateLiteral && property.value.quasis.length > 0;
|
||||
}
|
||||
function isFixedCollectionValues(property) {
|
||||
return (0, import_common.isArrayPropertyNamed)("values", property);
|
||||
}
|
||||
function isDisplayOptionsShow(property) {
|
||||
return (0, import_common.isObjectPropertyNamed)("show", property);
|
||||
}
|
||||
function isShowSetting(showSettingKey, property) {
|
||||
return (0, import_common.isArrayPropertyNamed)(showSettingKey, property);
|
||||
}
|
||||
function isGetAllOptionProperty(property) {
|
||||
return property.type === import_utils.AST_NODE_TYPES.Property && property.computed === false && property.key.type === import_utils.AST_NODE_TYPES.Identifier && property.key.name === "value" && property.value.type === import_utils.AST_NODE_TYPES.Literal && typeof property.value.value === "string" && property.value.value === "getAll";
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
hasName,
|
||||
isAction,
|
||||
isArrayDefault,
|
||||
isBooleanType,
|
||||
isCollectionType,
|
||||
isDescription,
|
||||
isDisplayName,
|
||||
isDisplayOptions,
|
||||
isDisplayOptionsShow,
|
||||
isEmail,
|
||||
isFixedCollectionType,
|
||||
isFixedCollectionValues,
|
||||
isGetAllOptionProperty,
|
||||
isHint,
|
||||
isIgnoreSslIssues,
|
||||
isLimit,
|
||||
isLoadOptionsMethod,
|
||||
isMaxValue,
|
||||
isMinValue,
|
||||
isMultiOptionsType,
|
||||
isName,
|
||||
isNoDataExpression,
|
||||
isNumericType,
|
||||
isObjectDefault,
|
||||
isOperation,
|
||||
isOptions,
|
||||
isOptionsType,
|
||||
isPlaceholder,
|
||||
isPrimitiveDefault,
|
||||
isRequired,
|
||||
isResource,
|
||||
isReturnAll,
|
||||
isShowSetting,
|
||||
isSimplify,
|
||||
isStringType,
|
||||
isTemplateDescription,
|
||||
isTemplateLiteralDefault,
|
||||
isType,
|
||||
isTypeOptions,
|
||||
isUnaryExpression,
|
||||
isUpdateFields,
|
||||
isValue
|
||||
});
|
||||
36
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/index.js
generated
vendored
Normal file
36
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/index.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var ast_exports = {};
|
||||
module.exports = __toCommonJS(ast_exports);
|
||||
__reExport(ast_exports, require("./utils/docline"), module.exports);
|
||||
__reExport(ast_exports, require("./utils/filename"), module.exports);
|
||||
__reExport(ast_exports, require("./utils/format"), module.exports);
|
||||
__reExport(ast_exports, require("./utils/insertion"), module.exports);
|
||||
__reExport(ast_exports, require("./utils/range"), module.exports);
|
||||
__reExport(ast_exports, require("./utils/restoreValue"), module.exports);
|
||||
__reExport(ast_exports, require("./utils/rule"), module.exports);
|
||||
__reExport(ast_exports, require("./utils/sort"), module.exports);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
...require("./utils/docline"),
|
||||
...require("./utils/filename"),
|
||||
...require("./utils/format"),
|
||||
...require("./utils/insertion"),
|
||||
...require("./utils/range"),
|
||||
...require("./utils/restoreValue"),
|
||||
...require("./utils/rule"),
|
||||
...require("./utils/sort")
|
||||
});
|
||||
22
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/restorers/index.js
generated
vendored
Normal file
22
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/restorers/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var restorers_exports = {};
|
||||
module.exports = __toCommonJS(restorers_exports);
|
||||
__reExport(restorers_exports, require("./restorers"), module.exports);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
...require("./restorers")
|
||||
});
|
||||
120
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/restorers/restorers.js
generated
vendored
Normal file
120
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/restorers/restorers.js
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var restorers_exports = {};
|
||||
__export(restorers_exports, {
|
||||
restoreArray: () => restoreArray,
|
||||
restoreArrayOfObjects: () => restoreArrayOfObjects,
|
||||
restoreClassDescriptionOptions: () => restoreClassDescriptionOptions,
|
||||
restoreFixedCollectionValues: () => restoreFixedCollectionValues,
|
||||
restoreNodeParamCollectionOptions: () => restoreNodeParamCollectionOptions,
|
||||
restoreNodeParamOptions: () => restoreNodeParamOptions,
|
||||
restoreObject: () => restoreObject
|
||||
});
|
||||
module.exports = __toCommonJS(restorers_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_common = require("../identifiers/common.identifiers");
|
||||
var import_nodeParameter = require("../identifiers/nodeParameter.identifiers");
|
||||
function restoreArray(elements) {
|
||||
return elements.reduce((acc, element) => {
|
||||
if (element.type === import_utils.AST_NODE_TYPES.Literal && element.value) {
|
||||
acc.push(element.value.toString());
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
function restoreArrayOfObjects(elements) {
|
||||
return elements.reduce((acc, element) => {
|
||||
if (element.type === import_utils.AST_NODE_TYPES.ObjectExpression) {
|
||||
acc.push(restoreObject(element));
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
}
|
||||
function restoreObject(objectExpression) {
|
||||
return objectExpression.properties.reduce(
|
||||
(acc, property) => {
|
||||
if ((0, import_common.isArrayExpression)(property)) {
|
||||
acc[property.key.name] = restoreArrayOfObjects(property.value.elements);
|
||||
} else if ((0, import_common.isLiteral)(property)) {
|
||||
acc[property.key.name] = property.value.value;
|
||||
} else if ((0, import_nodeParameter.isUnaryExpression)(property)) {
|
||||
acc[property.key.name] = parseInt(
|
||||
property.value.operator + property.value.argument.raw
|
||||
// e.g. -1
|
||||
);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
{}
|
||||
);
|
||||
}
|
||||
function restoreFixedCollectionValues(options) {
|
||||
const isNodeParameterAsValue = (entity) => entity.displayName !== void 0;
|
||||
const restoredValues = [];
|
||||
for (const option of options) {
|
||||
const restoredValue = restoreObject(option);
|
||||
if (!isNodeParameterAsValue(restoredValue))
|
||||
continue;
|
||||
restoredValues.push(restoredValue);
|
||||
}
|
||||
return restoredValues;
|
||||
}
|
||||
function restoreNodeParamOptions(options) {
|
||||
const isOption = (entity) => entity.name !== void 0 && entity.value !== void 0;
|
||||
const restoredOptions = [];
|
||||
for (const option of options) {
|
||||
const restoredOption = restoreObject(option);
|
||||
if (!isOption(restoredOption))
|
||||
continue;
|
||||
restoredOptions.push(restoredOption);
|
||||
}
|
||||
return restoredOptions;
|
||||
}
|
||||
function restoreNodeParamCollectionOptions(options) {
|
||||
const isNodeParameterAsValue = (entity) => entity.displayName !== void 0;
|
||||
const restoredOptions = [];
|
||||
for (const option of options) {
|
||||
const restoredOption = restoreObject(option);
|
||||
if (!isNodeParameterAsValue(restoredOption))
|
||||
continue;
|
||||
restoredOptions.push(restoredOption);
|
||||
}
|
||||
return restoredOptions;
|
||||
}
|
||||
function restoreClassDescriptionOptions(credOptions) {
|
||||
const isCredOption = (entity) => entity.name !== void 0;
|
||||
const restoredCredOptions = [];
|
||||
for (const credOption of credOptions) {
|
||||
const restoredCredOption = restoreObject(credOption);
|
||||
if (!isCredOption(restoredCredOption))
|
||||
continue;
|
||||
restoredCredOptions.push(restoredCredOption);
|
||||
}
|
||||
return restoredCredOptions;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
restoreArray,
|
||||
restoreArrayOfObjects,
|
||||
restoreClassDescriptionOptions,
|
||||
restoreFixedCollectionValues,
|
||||
restoreNodeParamCollectionOptions,
|
||||
restoreNodeParamOptions,
|
||||
restoreObject
|
||||
});
|
||||
31
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/apiSuffixExemption.js
generated
vendored
Normal file
31
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/apiSuffixExemption.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var apiSuffixExemption_exports = {};
|
||||
__export(apiSuffixExemption_exports, {
|
||||
isExemptedFromApiSuffix: () => isExemptedFromApiSuffix
|
||||
});
|
||||
module.exports = __toCommonJS(apiSuffixExemption_exports);
|
||||
var import_constants = require("../../constants");
|
||||
function isExemptedFromApiSuffix(filename) {
|
||||
return import_constants.CREDS_EXEMPTED_FROM_API_SUFFIX.some((cred) => filename.includes(cred));
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
isExemptedFromApiSuffix
|
||||
});
|
||||
30
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/defaultValue.js
generated
vendored
Normal file
30
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/defaultValue.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var defaultValue_exports = {};
|
||||
__export(defaultValue_exports, {
|
||||
getDefaultValue: () => getDefaultValue
|
||||
});
|
||||
module.exports = __toCommonJS(defaultValue_exports);
|
||||
function getDefaultValue(options, keyName) {
|
||||
return options.find((o) => o[keyName] !== void 0)?.[keyName];
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getDefaultValue
|
||||
});
|
||||
36
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/docline.js
generated
vendored
Normal file
36
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/docline.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var docline_exports = {};
|
||||
__export(docline_exports, {
|
||||
docline: () => docline
|
||||
});
|
||||
module.exports = __toCommonJS(docline_exports);
|
||||
function docline(sections, ...vars) {
|
||||
return sections.reduce((acc, templateSection, index) => {
|
||||
if (vars[index] === "") {
|
||||
vars[index] = "`''` (empty string)";
|
||||
}
|
||||
acc += templateSection + (vars[index] ?? "");
|
||||
return acc;
|
||||
}, "");
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
docline
|
||||
});
|
||||
78
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/filename.js
generated
vendored
Normal file
78
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/filename.js
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var filename_exports = {};
|
||||
__export(filename_exports, {
|
||||
getNodeFilename: () => getNodeFilename,
|
||||
isCredClassFile: () => isCredClassFile,
|
||||
isCredentialFile: () => isCredentialFile,
|
||||
isNodeFile: () => isNodeFile,
|
||||
isRegularNodeFile: () => isRegularNodeFile,
|
||||
isTriggerNodeFile: () => isTriggerNodeFile,
|
||||
toExpectedNodeFilename: () => toExpectedNodeFilename
|
||||
});
|
||||
module.exports = __toCommonJS(filename_exports);
|
||||
const isTestRun = process.env.NODE_ENV === "test";
|
||||
function getNodeFilename(fullPath) {
|
||||
if (isTestRun)
|
||||
return "Test.node.ts";
|
||||
const filename = fullPath.replace(/\\/g, "/").split("/").pop();
|
||||
if (!filename) {
|
||||
throw new Error(`Failed to extract node filename from path: ${fullPath}`);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
function isCredentialFile(fullPath) {
|
||||
if (isTestRun)
|
||||
return true;
|
||||
return getNodeFilename(fullPath).endsWith(".credentials.ts");
|
||||
}
|
||||
function isNodeFile(fullPath) {
|
||||
if (isTestRun)
|
||||
return true;
|
||||
return getNodeFilename(fullPath).endsWith(".node.ts");
|
||||
}
|
||||
function isRegularNodeFile(filePath) {
|
||||
if (isTestRun)
|
||||
return true;
|
||||
const filename = getNodeFilename(filePath);
|
||||
return filename.endsWith(".node.ts") && !filename.endsWith("Trigger.node.ts") && !filename.endsWith("EmailReadImap.node.ts");
|
||||
}
|
||||
function isTriggerNodeFile(filePath) {
|
||||
if (isTestRun)
|
||||
return true;
|
||||
return getNodeFilename(filePath).endsWith("Trigger.node.ts");
|
||||
}
|
||||
function isCredClassFile(filePath) {
|
||||
if (isTestRun)
|
||||
return true;
|
||||
return getNodeFilename(filePath).endsWith(".credentials.ts");
|
||||
}
|
||||
function toExpectedNodeFilename(name) {
|
||||
return name.charAt(0).toUpperCase() + name.slice(1) + ".node.ts";
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getNodeFilename,
|
||||
isCredClassFile,
|
||||
isCredentialFile,
|
||||
isNodeFile,
|
||||
isRegularNodeFile,
|
||||
isTriggerNodeFile,
|
||||
toExpectedNodeFilename
|
||||
});
|
||||
123
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/format.js
generated
vendored
Normal file
123
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/format.js
generated
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var format_exports = {};
|
||||
__export(format_exports, {
|
||||
clean_OLD: () => clean_OLD,
|
||||
formatItems: () => formatItems,
|
||||
getBaseIndentationForOption: () => getBaseIndentationForOption,
|
||||
getIndentationString: () => getIndentationString,
|
||||
isAllowedLowercase: () => isAllowedLowercase,
|
||||
isKebabCase: () => isKebabCase,
|
||||
toDisplayOrder: () => toDisplayOrder,
|
||||
toDisplayOrderForCollection: () => toDisplayOrderForCollection
|
||||
});
|
||||
module.exports = __toCommonJS(format_exports);
|
||||
var import_constants = require("../../constants");
|
||||
var import_functional = require("./functional");
|
||||
function formatItems(obj, baseIndentation) {
|
||||
const str = JSON.stringify(obj, null, 2);
|
||||
const punctuated = (0, import_functional.pipe)(addTrailingCommas, singleQuoteAll, unquoteKeys)(str);
|
||||
return indent(punctuated, baseIndentation);
|
||||
}
|
||||
function addTrailingCommas(str) {
|
||||
return str.replace(/(\})(\s)/g, "$1,$2").replace(/(\])(\s)/g, "$1,$2").replace(/(\s+)(\},)/g, ",$1$2");
|
||||
}
|
||||
function singleQuoteAll(str) {
|
||||
return str.replace(/'/g, "\\'").replace(/"/g, "'");
|
||||
}
|
||||
function unquoteKeys(str) {
|
||||
return str.replace(/'(.*)':/g, "$1:");
|
||||
}
|
||||
function indent(str, baseIndentation) {
|
||||
return str.split("\n").map((line) => {
|
||||
const match = line.match(/^(?<leadingWhitespace>\s*)(?<rest>.*)/);
|
||||
if (!match || !match.groups)
|
||||
return line;
|
||||
const { leadingWhitespace, rest } = match.groups;
|
||||
if (!rest)
|
||||
return line;
|
||||
if (!leadingWhitespace) {
|
||||
return baseIndentation + " " + rest;
|
||||
}
|
||||
if (rest.startsWith("{") || rest.startsWith("}")) {
|
||||
return baseIndentation + " ".repeat(leadingWhitespace.length) + rest;
|
||||
}
|
||||
return baseIndentation + " ".repeat(leadingWhitespace.length - 1) + rest;
|
||||
}).join("\n").trim();
|
||||
}
|
||||
function clean_OLD(obj, indentation) {
|
||||
const clean = JSON.stringify(obj, null, 2).replace(/\'/g, "\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm, (m) => m.replace(/"/g, "")).replace(/"/g, "'").replace(/\}\s/g, "},\n").replace("]", " ]").replace(/ /g, " ").replace(/\tname:\t/g, "name: ").replace(/\tvalue:\t/g, "value: ").replace(/\tdisplayName:\t/g, "displayName: ").replace(/\tdescription:\t/g, "description: ").replace(/\tplaceholder:\t/g, "placeholder: ").replace(/\toptions:\t/g, "options: ").replace(/\ttype:\t/g, "type: ").replace(/\tdefault:\t/g, "default: ").replace(/(\.)\t\b/g, ". ").replace(/\t\(/g, " (").replace(/\t</g, " <").replace(/\)\t/g, ") ").replace(/,\t\b/g, ", ").replace(/\t\\/g, " \\").replace(/'\t/g, "' ").replace(/\b\t\b/g, " ").replace(/'\s\t/g, "',\n ").replace(/false\n/g, "false,\n").replace(/true\n/g, "true,\n").replace(/href=\\'/g, 'href="').replace(/\\'>/g, '">').replace(/\n/g, `
|
||||
${indentation}`).replace(/\t{8}/gm, `${" ".repeat(6)}`).replace(/^\t{2}\]/gm, `${" ".repeat(3)}]`).replace(/^\t{7}\]/gm, `${" ".repeat(5)}]`);
|
||||
return clean;
|
||||
}
|
||||
function toDisplayOrder(options) {
|
||||
return options.reduce((acc, cur) => {
|
||||
return acc.push(cur.name), acc;
|
||||
}, []).join(" | ");
|
||||
}
|
||||
function toDisplayOrderForCollection(options) {
|
||||
return options.reduce((acc, cur) => {
|
||||
return acc.push(cur.displayName), acc;
|
||||
}, []).join(" | ");
|
||||
}
|
||||
const getIndentationString = (referenceNode) => {
|
||||
return " ".repeat(referenceNode.ast.loc.start.column);
|
||||
};
|
||||
const getBaseIndentationForOption = (referenceNode) => {
|
||||
return " ".repeat(referenceNode.ast.loc.start.column - 1);
|
||||
};
|
||||
function isKebabCase(str) {
|
||||
if (str !== str.toLowerCase())
|
||||
return false;
|
||||
if (/\s/.test(str))
|
||||
return false;
|
||||
if (!/-/.test(str))
|
||||
return false;
|
||||
return str === str.toLowerCase().replace(/\s/g, "-");
|
||||
}
|
||||
function isAllowedLowercase(value) {
|
||||
if (isUrl(value))
|
||||
return true;
|
||||
if (isKebabCase(value))
|
||||
return true;
|
||||
if (import_constants.VERSION_REGEX.test(value))
|
||||
return true;
|
||||
return ["bmp", "tiff", "gif", "jpg", "jpeg", "png", "webp"].includes(value);
|
||||
}
|
||||
function isUrl(str) {
|
||||
try {
|
||||
if (["com", "org", "net", "io", "edu"].includes(str.slice(-3)))
|
||||
return true;
|
||||
new URL(str);
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
clean_OLD,
|
||||
formatItems,
|
||||
getBaseIndentationForOption,
|
||||
getIndentationString,
|
||||
isAllowedLowercase,
|
||||
isKebabCase,
|
||||
toDisplayOrder,
|
||||
toDisplayOrderForCollection
|
||||
});
|
||||
28
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/functional.js
generated
vendored
Normal file
28
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/functional.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var functional_exports = {};
|
||||
__export(functional_exports, {
|
||||
pipe: () => pipe
|
||||
});
|
||||
module.exports = __toCommonJS(functional_exports);
|
||||
const pipe = (...fns) => (x) => fns.reduce((v, f) => f(v), x);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
pipe
|
||||
});
|
||||
53
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/index.js
generated
vendored
Normal file
53
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/index.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var utils_exports = {};
|
||||
__export(utils_exports, {
|
||||
utils: () => utils
|
||||
});
|
||||
module.exports = __toCommonJS(utils_exports);
|
||||
var filename = __toESM(require("./filename"));
|
||||
var format = __toESM(require("./format"));
|
||||
var insertion = __toESM(require("./insertion"));
|
||||
var range = __toESM(require("./range"));
|
||||
var restoreValue = __toESM(require("./restoreValue"));
|
||||
var rule = __toESM(require("./rule"));
|
||||
var sort = __toESM(require("./sort"));
|
||||
const utils = {
|
||||
...filename,
|
||||
...format,
|
||||
...insertion,
|
||||
...range,
|
||||
...restoreValue,
|
||||
...rule,
|
||||
...sort
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
utils
|
||||
});
|
||||
79
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/insertion.js
generated
vendored
Normal file
79
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/insertion.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var insertion_exports = {};
|
||||
__export(insertion_exports, {
|
||||
addApiSuffix: () => addApiSuffix,
|
||||
addEndSegment: () => addEndSegment,
|
||||
getInsertionArgs: () => getInsertionArgs,
|
||||
keyValue: () => keyValue
|
||||
});
|
||||
module.exports = __toCommonJS(insertion_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_format = require("./format");
|
||||
var import_range = require("./range");
|
||||
const getInsertionArgs = (referenceNode) => {
|
||||
if (referenceNode.ast.type === import_utils.AST_NODE_TYPES.PropertyDefinition || // @ts-ignore
|
||||
referenceNode.ast.type === import_utils.AST_NODE_TYPES.ClassProperty) {
|
||||
return {
|
||||
range: referenceNode.ast.range,
|
||||
indentation: (0, import_format.getIndentationString)(referenceNode)
|
||||
};
|
||||
}
|
||||
return {
|
||||
range: (0, import_range.getRangeWithTrailingComma)(referenceNode),
|
||||
indentation: (0, import_format.getIndentationString)(referenceNode)
|
||||
};
|
||||
};
|
||||
function keyValue(key, value, { backtickedValue } = { backtickedValue: false }) {
|
||||
const unescapedQuote = new RegExp(/(?<!\\)'/, "g");
|
||||
const escapedValue = value.replace(unescapedQuote, "\\'");
|
||||
if (backtickedValue) {
|
||||
return `${key}: \`${escapedValue}\``;
|
||||
}
|
||||
return `${key}: '${escapedValue}'`;
|
||||
}
|
||||
function addEndSegment(value) {
|
||||
if (/\w+\sName(s?)\s*\/\s*ID(s?)/.test(value))
|
||||
return value.replace(/Name(s?)\s*\/\s*ID(s?)/, "Name or ID");
|
||||
if (/\w+\sID(s?)\s*\/\s*Name(s?)/.test(value))
|
||||
return value.replace(/ID(s?)\s*\/\s*Name(s?)/, "Name or ID");
|
||||
if (/\w+\sName(s?)$/.test(value))
|
||||
return value.replace(/Name(s?)$/, "Name or ID");
|
||||
if (/\w+\sID(s?)$/.test(value))
|
||||
return value.replace(/ID(s?)$/, "Name or ID");
|
||||
if (value === "ID" || value === "Name")
|
||||
return "Name or ID";
|
||||
if (/Name or/.test(value))
|
||||
return value.replace("Name or", "Name or ID");
|
||||
return value.concat(" Name or ID");
|
||||
}
|
||||
function addApiSuffix(name, { uppercased } = { uppercased: false }) {
|
||||
if (name.endsWith("Ap"))
|
||||
return uppercased ? `${name}I` : `${name}i`;
|
||||
if (name.endsWith("A"))
|
||||
return uppercased ? `${name}PI` : `${name}pi`;
|
||||
return uppercased ? `${name} API` : `${name}Api`;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
addApiSuffix,
|
||||
addEndSegment,
|
||||
getInsertionArgs,
|
||||
keyValue
|
||||
});
|
||||
53
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/range.js
generated
vendored
Normal file
53
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/range.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var range_exports = {};
|
||||
__export(range_exports, {
|
||||
getRangeOfAssertion: () => getRangeOfAssertion,
|
||||
getRangeToRemove: () => getRangeToRemove,
|
||||
getRangeWithTrailingComma: () => getRangeWithTrailingComma,
|
||||
isMultiline: () => isMultiline
|
||||
});
|
||||
module.exports = __toCommonJS(range_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_format = require("./format");
|
||||
function getRangeWithTrailingComma(referenceNode) {
|
||||
const { range } = referenceNode.ast;
|
||||
return [range[0], range[1] + 1];
|
||||
}
|
||||
function isMultiline(node) {
|
||||
return node.ast.loc.start.line !== node.ast.loc.end.line;
|
||||
}
|
||||
function getRangeOfAssertion(typeIdentifier) {
|
||||
return [typeIdentifier.range[0] - 4, typeIdentifier.range[1]];
|
||||
}
|
||||
function getRangeToRemove(referenceNode) {
|
||||
const { range } = referenceNode.ast;
|
||||
const indentation = (0, import_format.getIndentationString)(referenceNode);
|
||||
if (referenceNode.ast.type === import_utils.AST_NODE_TYPES.TSArrayType) {
|
||||
return [range[0] - indentation.length, range[1] - 1];
|
||||
}
|
||||
return [range[0] - indentation.length, range[1] + 2];
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getRangeOfAssertion,
|
||||
getRangeToRemove,
|
||||
getRangeWithTrailingComma,
|
||||
isMultiline
|
||||
});
|
||||
34
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/restoreValue.js
generated
vendored
Normal file
34
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/restoreValue.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var restoreValue_exports = {};
|
||||
__export(restoreValue_exports, {
|
||||
restoreValue: () => restoreValue
|
||||
});
|
||||
module.exports = __toCommonJS(restoreValue_exports);
|
||||
function restoreValue(source) {
|
||||
try {
|
||||
return eval(`(${source})`);
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
restoreValue
|
||||
});
|
||||
34
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/rule.js
generated
vendored
Normal file
34
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/rule.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var rule_exports = {};
|
||||
__export(rule_exports, {
|
||||
createRule: () => createRule,
|
||||
getRuleName: () => getRuleName
|
||||
});
|
||||
module.exports = __toCommonJS(rule_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
const createRule = import_utils.ESLintUtils.RuleCreator((ruleName) => {
|
||||
return `https://github.com/ivov/eslint-plugin-n8n-nodes-base/blob/master/docs/rules/${ruleName}.md`;
|
||||
});
|
||||
const getRuleName = ({ filename }) => filename.split("/").pop()?.replace(/(\.test)?\.(j|t)s/, "") ?? "Unknown";
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
createRule,
|
||||
getRuleName
|
||||
});
|
||||
73
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/sort.js
generated
vendored
Normal file
73
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/ast/utils/sort.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var sort_exports = {};
|
||||
__export(sort_exports, {
|
||||
areIdenticallySortedOptions: () => areIdenticallySortedOptions,
|
||||
areIdenticallySortedOptionsForCollection: () => areIdenticallySortedOptionsForCollection,
|
||||
areIdenticallySortedParams: () => areIdenticallySortedParams,
|
||||
optionComparator: () => optionComparator,
|
||||
optionComparatorForCollection: () => optionComparatorForCollection
|
||||
});
|
||||
module.exports = __toCommonJS(sort_exports);
|
||||
var import_constants = require("../../constants");
|
||||
function areIdenticallySortedOptions(first, second) {
|
||||
for (let i = 0; i < first.length; i++) {
|
||||
if (first[i].name !== second[i].name)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function areIdenticallySortedOptionsForCollection(first, second) {
|
||||
for (let i = 0; i < first.length; i++) {
|
||||
if (first[i].displayName !== second[i].displayName)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function optionComparator(a, b) {
|
||||
if (import_constants.VERSION_REGEX.test(a.name)) {
|
||||
if (a.name === b.name)
|
||||
return 0;
|
||||
return parseFloat(a.name.slice(1)) > parseFloat(b.name.slice(1)) ? -1 : 1;
|
||||
}
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
function optionComparatorForCollection(a, b) {
|
||||
if (import_constants.VERSION_REGEX.test(a.displayName)) {
|
||||
if (a.displayName === b.displayName)
|
||||
return 0;
|
||||
return parseFloat(a.displayName.slice(1)) > parseFloat(b.displayName.slice(1)) ? -1 : 1;
|
||||
}
|
||||
return a.displayName.localeCompare(b.displayName);
|
||||
}
|
||||
function areIdenticallySortedParams(first, second) {
|
||||
for (let i = 0; i < first.length; i++) {
|
||||
if (first[i].displayName !== second[i].displayName)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
areIdenticallySortedOptions,
|
||||
areIdenticallySortedOptionsForCollection,
|
||||
areIdenticallySortedParams,
|
||||
optionComparator,
|
||||
optionComparatorForCollection
|
||||
});
|
||||
247
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/constants.js
generated
vendored
Normal file
247
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/constants.js
generated
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var constants_exports = {};
|
||||
__export(constants_exports, {
|
||||
COMMUNITY_PACKAGE_JSON: () => COMMUNITY_PACKAGE_JSON,
|
||||
CREDS_EXEMPTED_FROM_API_SUFFIX: () => CREDS_EXEMPTED_FROM_API_SUFFIX,
|
||||
CRED_SENSITIVE_CLASS_FIELDS: () => CRED_SENSITIVE_CLASS_FIELDS,
|
||||
DOCUMENTATION: () => DOCUMENTATION,
|
||||
DYNAMIC_MULTI_OPTIONS_NODE_PARAMETER: () => DYNAMIC_MULTI_OPTIONS_NODE_PARAMETER,
|
||||
DYNAMIC_OPTIONS_NODE_PARAMETER: () => DYNAMIC_OPTIONS_NODE_PARAMETER,
|
||||
EMAIL_PLACEHOLDER: () => EMAIL_PLACEHOLDER,
|
||||
FALSE_POSITIVE_CRED_SENSITIVE_CLASS_FIELDS: () => FALSE_POSITIVE_CRED_SENSITIVE_CLASS_FIELDS,
|
||||
FALSE_POSITIVE_NODE_SENSITIVE_PARAM_NAMES: () => FALSE_POSITIVE_NODE_SENSITIVE_PARAM_NAMES,
|
||||
IGNORE_SSL_ISSUES_NODE_PARAMETER: () => IGNORE_SSL_ISSUES_NODE_PARAMETER,
|
||||
LIMIT_NODE_PARAMETER: () => LIMIT_NODE_PARAMETER,
|
||||
LINE_BREAK_HTML_TAG_REGEX: () => LINE_BREAK_HTML_TAG_REGEX,
|
||||
MIN_ITEMS_TO_ALPHABETIZE: () => MIN_ITEMS_TO_ALPHABETIZE,
|
||||
MIN_ITEMS_TO_ALPHABETIZE_SPELLED_OUT: () => MIN_ITEMS_TO_ALPHABETIZE_SPELLED_OUT,
|
||||
MISCASED_ID_REGEX: () => MISCASED_ID_REGEX,
|
||||
MISCASED_JSON_REGEX: () => MISCASED_JSON_REGEX,
|
||||
MISCASED_URL_REGEX: () => MISCASED_URL_REGEX,
|
||||
N8N_NODE_ERROR_TYPES: () => N8N_NODE_ERROR_TYPES,
|
||||
NODE_CLASS_DESCRIPTION_SUBTITLE: () => NODE_CLASS_DESCRIPTION_SUBTITLE,
|
||||
NODE_SENSITIVE_PARAM_NAMES: () => NODE_SENSITIVE_PARAM_NAMES,
|
||||
RESOURCE_DESCRIPTION_SUFFIX: () => RESOURCE_DESCRIPTION_SUFFIX,
|
||||
RETURN_ALL_NODE_PARAMETER: () => RETURN_ALL_NODE_PARAMETER,
|
||||
SIMPLIFY_NODE_PARAMETER: () => SIMPLIFY_NODE_PARAMETER,
|
||||
SVG_ICON_SOURCES: () => SVG_ICON_SOURCES,
|
||||
TOP_LEVEL_FIXED_COLLECTION: () => TOP_LEVEL_FIXED_COLLECTION,
|
||||
UPDATE_FIELDS_NODE_PARAM_DISPLAY_NAME: () => UPDATE_FIELDS_NODE_PARAM_DISPLAY_NAME,
|
||||
UPSERT_NODE_PARAMETER: () => UPSERT_NODE_PARAMETER,
|
||||
VALID_HTML_TAG_REGEX: () => VALID_HTML_TAG_REGEX,
|
||||
VERSION_REGEX: () => VERSION_REGEX,
|
||||
WEAK_DESCRIPTIONS: () => WEAK_DESCRIPTIONS
|
||||
});
|
||||
module.exports = __toCommonJS(constants_exports);
|
||||
const MIN_ITEMS_TO_ALPHABETIZE = 5;
|
||||
const MIN_ITEMS_TO_ALPHABETIZE_SPELLED_OUT = "five";
|
||||
const WEAK_DESCRIPTIONS = [
|
||||
"Resource to consume",
|
||||
"Resource to operate on",
|
||||
"Operation to perform",
|
||||
"Action to perform",
|
||||
"Method of authentication"
|
||||
];
|
||||
const SVG_ICON_SOURCES = [
|
||||
"https://vecta.io/symbols",
|
||||
"https://github.com/gilbarbara/logos"
|
||||
];
|
||||
const RESOURCE_DESCRIPTION_SUFFIX = "Description.ts";
|
||||
const EXPRESSIONS_DOCS_URL = "https://docs.n8n.io/code/expressions/";
|
||||
const DYNAMIC_MULTI_OPTIONS_NODE_PARAMETER = {
|
||||
DISPLAY_NAME_SUFFIX: "Names or IDs",
|
||||
DESCRIPTION: `Choose from the list, or specify IDs using an <a href="${EXPRESSIONS_DOCS_URL}">expression</a>`
|
||||
};
|
||||
const DYNAMIC_OPTIONS_NODE_PARAMETER = {
|
||||
DISPLAY_NAME_SUFFIX: "Name or ID",
|
||||
DESCRIPTION: `Choose from the list, or specify an ID using an <a href="${EXPRESSIONS_DOCS_URL}">expression</a>`
|
||||
};
|
||||
const NODE_CLASS_DESCRIPTION_SUBTITLE = '={{ $parameter["operation"] + ": " + $parameter["resource"] }}';
|
||||
const LIMIT_NODE_PARAMETER = {
|
||||
DEFAULT_VALUE: 50,
|
||||
DESCRIPTION: "Max number of results to return"
|
||||
};
|
||||
const UPSERT_NODE_PARAMETER = {
|
||||
DESCRIPTION: "Create a new record, or update the current one if it already exists (upsert)"
|
||||
};
|
||||
const UPDATE_FIELDS_NODE_PARAM_DISPLAY_NAME = "Update Fields";
|
||||
const SIMPLIFY_NODE_PARAMETER = {
|
||||
DISPLAY_NAME: "Simplify",
|
||||
DESCRIPTION: "Whether to return a simplified version of the response instead of the raw data"
|
||||
};
|
||||
const RETURN_ALL_NODE_PARAMETER = {
|
||||
DISPLAY_NAME: "Return All",
|
||||
DESCRIPTION: "Whether to return all results or only up to a given limit"
|
||||
};
|
||||
const IGNORE_SSL_ISSUES_NODE_PARAMETER = {
|
||||
DISPLAY_NAME: "Ignore SSL Issues",
|
||||
DESCRIPTION: "Whether to connect even if SSL certificate validation is not possible"
|
||||
};
|
||||
const TOP_LEVEL_FIXED_COLLECTION = {
|
||||
STANDARD_DISPLAY_NAME: {
|
||||
CREATE: "Additional Fields",
|
||||
UPDATE: "Update Fields",
|
||||
GETALL: "Options"
|
||||
}
|
||||
};
|
||||
const EMAIL_PLACEHOLDER = "name@email.com";
|
||||
const CRED_SENSITIVE_CLASS_FIELDS = [
|
||||
"secret",
|
||||
"password",
|
||||
"token",
|
||||
"key"
|
||||
];
|
||||
const FALSE_POSITIVE_CRED_SENSITIVE_CLASS_FIELDS = [
|
||||
"accessKeyId",
|
||||
"passwordless",
|
||||
"/token"
|
||||
// when part of OAuth token endpoint
|
||||
// plus `-Url` pattern
|
||||
];
|
||||
const NODE_SENSITIVE_PARAM_NAMES = [
|
||||
"secret",
|
||||
"password",
|
||||
"token",
|
||||
"apiKey"
|
||||
// `"key"` leads to too many false positives
|
||||
];
|
||||
const FALSE_POSITIVE_NODE_SENSITIVE_PARAM_NAMES = [
|
||||
"maxTokens",
|
||||
"password_needs_reset"
|
||||
];
|
||||
const MISCASED_ID_REGEX = /\b(i|I)d(s?)\b/;
|
||||
const MISCASED_URL_REGEX = /\b(u|U)rl(s?)\b/;
|
||||
const MISCASED_JSON_REGEX = /\b(j|J)son\b/;
|
||||
const VALID_HTML_TAG_REGEX = /<\/?(h\d|p|b|em|i|a|ol|ul|li|code|br)>/;
|
||||
const LINE_BREAK_HTML_TAG_REGEX = /<\/? ?br ?\/?>/;
|
||||
const VERSION_REGEX = /^v\d+\.\d+$/;
|
||||
const COMMUNITY_PACKAGE_JSON = {
|
||||
NAME: "n8n-nodes-<...>",
|
||||
DESCRIPTION: "",
|
||||
OFFICIAL_TAG: "n8n-community-node-package",
|
||||
LICENSE: "MIT",
|
||||
AUTHOR_NAME: "",
|
||||
AUTHOR_EMAIL: "",
|
||||
REPOSITORY_URL: "https://github.com/<...>/n8n-nodes-<...>.git",
|
||||
CREDENTIALS: [
|
||||
"dist/credentials/ExampleCredentials.credentials.js",
|
||||
"dist/credentials/HttpBinApi.credentials.js"
|
||||
],
|
||||
NODES: [
|
||||
"dist/nodes/ExampleNode/ExampleNode.node.js",
|
||||
"dist/nodes/HttpBin/HttpBin.node.js"
|
||||
],
|
||||
SCRIPTS: `{
|
||||
"dev": "npm run watch",
|
||||
"build": "tsc && gulp",
|
||||
"lint": "tslint -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js ./nodes",
|
||||
"lintfix": "tslint --fix -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js --fix ./nodes",
|
||||
"watch": "tsc --watch",
|
||||
"test": "jest"
|
||||
}`,
|
||||
DEV_DEPENDENCIES: `{
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/request-promise-native": "~1.0.15",
|
||||
"@typescript-eslint/parser": "^5.29.0",
|
||||
"eslint-plugin-n8n-nodes-base": "^1.0.43",
|
||||
"gulp": "^4.0.2",
|
||||
"jest": "^26.4.2",
|
||||
"n8n-workflow": "~0.104.0",
|
||||
"ts-jest": "^26.3.0",
|
||||
"tslint": "^6.1.2",
|
||||
"typescript": "~4.3.5"
|
||||
}`
|
||||
};
|
||||
const DOCUMENTATION = {
|
||||
APPLICABLE_BY_EXTENSION_TO_NAME: "Applicable by extension to `name` in options-type or multi-options-type node parameter.",
|
||||
APPLICABLE_BY_EXTENSION_TO_DESCRIPTION_IN_OPTION: "Applicable by extension to `description` in option in options-type and multi-options-type node parameter."
|
||||
};
|
||||
const N8N_NODE_ERROR_TYPES = [
|
||||
"ApplicationError",
|
||||
"NodeOperationError",
|
||||
"NodeApiError",
|
||||
"TriggerCloseError"
|
||||
];
|
||||
const CREDS_EXEMPTED_FROM_API_SUFFIX = [
|
||||
"Amqp",
|
||||
"Aws",
|
||||
"CrateDb",
|
||||
"FileMaker",
|
||||
"Ftp",
|
||||
"GitPassword",
|
||||
"GmailOAuth2Api",
|
||||
"GoogleAnalyticsOAuth2Api",
|
||||
"HttpBasicAuth",
|
||||
"HttpDigestAuth",
|
||||
"HttpHeaderAuth",
|
||||
"HttpQueryAuth",
|
||||
"HubspotAppToken",
|
||||
"Imap",
|
||||
"Kafka",
|
||||
"MicrosoftSql",
|
||||
"MongoDb",
|
||||
"Mqtt",
|
||||
"MySql",
|
||||
"NocoDb",
|
||||
"Postgres",
|
||||
"QuestDb",
|
||||
"RabbitMQ",
|
||||
"Redis",
|
||||
"S3",
|
||||
"Sftp",
|
||||
"Smtp",
|
||||
"Snowflake",
|
||||
"SshPassword",
|
||||
"SshPrivateKey",
|
||||
"TimescaleDb"
|
||||
];
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
COMMUNITY_PACKAGE_JSON,
|
||||
CREDS_EXEMPTED_FROM_API_SUFFIX,
|
||||
CRED_SENSITIVE_CLASS_FIELDS,
|
||||
DOCUMENTATION,
|
||||
DYNAMIC_MULTI_OPTIONS_NODE_PARAMETER,
|
||||
DYNAMIC_OPTIONS_NODE_PARAMETER,
|
||||
EMAIL_PLACEHOLDER,
|
||||
FALSE_POSITIVE_CRED_SENSITIVE_CLASS_FIELDS,
|
||||
FALSE_POSITIVE_NODE_SENSITIVE_PARAM_NAMES,
|
||||
IGNORE_SSL_ISSUES_NODE_PARAMETER,
|
||||
LIMIT_NODE_PARAMETER,
|
||||
LINE_BREAK_HTML_TAG_REGEX,
|
||||
MIN_ITEMS_TO_ALPHABETIZE,
|
||||
MIN_ITEMS_TO_ALPHABETIZE_SPELLED_OUT,
|
||||
MISCASED_ID_REGEX,
|
||||
MISCASED_JSON_REGEX,
|
||||
MISCASED_URL_REGEX,
|
||||
N8N_NODE_ERROR_TYPES,
|
||||
NODE_CLASS_DESCRIPTION_SUBTITLE,
|
||||
NODE_SENSITIVE_PARAM_NAMES,
|
||||
RESOURCE_DESCRIPTION_SUFFIX,
|
||||
RETURN_ALL_NODE_PARAMETER,
|
||||
SIMPLIFY_NODE_PARAMETER,
|
||||
SVG_ICON_SOURCES,
|
||||
TOP_LEVEL_FIXED_COLLECTION,
|
||||
UPDATE_FIELDS_NODE_PARAM_DISPLAY_NAME,
|
||||
UPSERT_NODE_PARAMETER,
|
||||
VALID_HTML_TAG_REGEX,
|
||||
VERSION_REGEX,
|
||||
WEAK_DESCRIPTIONS
|
||||
});
|
||||
87
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-email-still-default.js
generated
vendored
Normal file
87
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-email-still-default.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_author_email_still_default_exports = {};
|
||||
__export(community_package_json_author_email_still_default_exports, {
|
||||
default: () => community_package_json_author_email_still_default_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_author_email_still_default_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var import_constants = require("../constants");
|
||||
var import_defaultValue = require("../ast/utils/defaultValue");
|
||||
var import_ast = require("../ast");
|
||||
var community_package_json_author_email_still_default_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
defaultOptions: [{ authorEmail: import_constants.COMMUNITY_PACKAGE_JSON.AUTHOR_EMAIL }],
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: import_ast.docline`The \`author.email\` value in the \`package.json\` of a community package must be different from the default value ${import_constants.COMMUNITY_PACKAGE_JSON.AUTHOR_EMAIL} or a user-defined default.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
authorEmail: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
],
|
||||
messages: {
|
||||
updateAuthorEmail: "Update the `author.email` key in package.json"
|
||||
}
|
||||
},
|
||||
create(context, options) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const author = import_getters.getters.communityPackageJson.getAuthor(node);
|
||||
if (!author)
|
||||
return;
|
||||
const authorEmail = getAuthorEmail(author);
|
||||
if (authorEmail === null)
|
||||
return;
|
||||
const defaultAuthorEmail = (0, import_defaultValue.getDefaultValue)(options, "authorEmail");
|
||||
if (authorEmail === defaultAuthorEmail) {
|
||||
context.report({
|
||||
messageId: "updateAuthorEmail",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getAuthorEmail(author) {
|
||||
if (author.ast.type === import_utils2.AST_NODE_TYPES.Property && author.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
const authorEmail = author.ast.value.properties.find(import_identifiers.id.hasEmailLiteral);
|
||||
if (authorEmail === void 0)
|
||||
return null;
|
||||
if (authorEmail.type === import_utils2.AST_NODE_TYPES.Property && authorEmail.value.type === import_utils2.AST_NODE_TYPES.Literal && typeof authorEmail.value.value === "string") {
|
||||
return authorEmail.value.value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-missing.js
generated
vendored
Normal file
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-missing.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_author_missing_exports = {};
|
||||
__export(community_package_json_author_missing_exports, {
|
||||
default: () => community_package_json_author_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_author_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var community_package_json_author_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `author` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addAuthor: "Add an `author` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
if (!import_getters.getters.communityPackageJson.getAuthor(node)) {
|
||||
context.report({
|
||||
messageId: "addAuthor",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-name-missing.js
generated
vendored
Normal file
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-name-missing.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_author_name_missing_exports = {};
|
||||
__export(community_package_json_author_name_missing_exports, {
|
||||
default: () => community_package_json_author_name_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_author_name_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var community_package_json_author_name_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `author.name` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addAuthorName: "Add an `author.name` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const author = import_getters.getters.communityPackageJson.getAuthor(node);
|
||||
if (!author)
|
||||
return;
|
||||
if (!hasAuthorName(author)) {
|
||||
context.report({
|
||||
messageId: "addAuthorName",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function hasAuthorName(author) {
|
||||
if (author.ast.type === import_utils2.AST_NODE_TYPES.Property && author.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
return author.ast.value.properties.some(import_identifiers.id.hasNameLiteral);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
87
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-name-still-default.js
generated
vendored
Normal file
87
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-author-name-still-default.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_author_name_still_default_exports = {};
|
||||
__export(community_package_json_author_name_still_default_exports, {
|
||||
default: () => community_package_json_author_name_still_default_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_author_name_still_default_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var import_constants = require("../constants");
|
||||
var import_defaultValue = require("../ast/utils/defaultValue");
|
||||
var import_ast = require("../ast");
|
||||
var community_package_json_author_name_still_default_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
defaultOptions: [{ authorName: import_constants.COMMUNITY_PACKAGE_JSON.AUTHOR_NAME }],
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: import_ast.docline`The \`author.name\` value in the \`package.json\` of a community package must be different from the default value ${import_constants.COMMUNITY_PACKAGE_JSON.AUTHOR_NAME} or a user-defined default.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
authorName: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
],
|
||||
messages: {
|
||||
updateAuthorName: "Update the `author.name` key in package.json"
|
||||
}
|
||||
},
|
||||
create(context, options) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const author = import_getters.getters.communityPackageJson.getAuthor(node);
|
||||
if (!author)
|
||||
return;
|
||||
const authorName = getAuthorName(author);
|
||||
if (authorName === null)
|
||||
return;
|
||||
const defaultAuthorName = (0, import_defaultValue.getDefaultValue)(options, "authorName");
|
||||
if (authorName === defaultAuthorName) {
|
||||
context.report({
|
||||
messageId: "updateAuthorName",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getAuthorName(author) {
|
||||
if (author.ast.type === import_utils2.AST_NODE_TYPES.Property && author.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
const authorName = author.ast.value.properties.find(import_identifiers.id.hasNameLiteral);
|
||||
if (authorName === void 0)
|
||||
return null;
|
||||
if (authorName.type === import_utils2.AST_NODE_TYPES.Property && authorName.value.type === import_utils2.AST_NODE_TYPES.Literal && typeof authorName.value.value === "string") {
|
||||
return authorName.value.value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-description-missing.js
generated
vendored
Normal file
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-description-missing.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_description_missing_exports = {};
|
||||
__export(community_package_json_description_missing_exports, {
|
||||
default: () => community_package_json_description_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_description_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var community_package_json_description_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `description` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addDescription: "Add a `description` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
if (!import_getters.getters.communityPackageJson.getDescription(node)) {
|
||||
context.report({
|
||||
messageId: "addDescription",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
72
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-description-still-default.js
generated
vendored
Normal file
72
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-description-still-default.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_description_still_default_exports = {};
|
||||
__export(community_package_json_description_still_default_exports, {
|
||||
default: () => community_package_json_description_still_default_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_description_still_default_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_constants = require("../constants");
|
||||
var import_defaultValue = require("../ast/utils/defaultValue");
|
||||
var import_ast = require("../ast");
|
||||
var community_package_json_description_still_default_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
defaultOptions: [{ description: import_constants.COMMUNITY_PACKAGE_JSON.DESCRIPTION }],
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: import_ast.docline`The \`description\` value in the \`package.json\` of a community package must be different from the default value ${import_constants.COMMUNITY_PACKAGE_JSON.DESCRIPTION} or a user-defined default.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
description: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
],
|
||||
messages: {
|
||||
updateDescription: "Update the `description` key in package.json"
|
||||
}
|
||||
},
|
||||
create(context, options) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const description = import_getters.getters.communityPackageJson.getDescription(node);
|
||||
if (!description)
|
||||
return;
|
||||
const defaultDescription = (0, import_defaultValue.getDefaultValue)(options, "description");
|
||||
if (description.value === defaultDescription) {
|
||||
context.report({
|
||||
messageId: "updateDescription",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-keywords-missing.js
generated
vendored
Normal file
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-keywords-missing.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_keywords_missing_exports = {};
|
||||
__export(community_package_json_keywords_missing_exports, {
|
||||
default: () => community_package_json_keywords_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_keywords_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var community_package_json_keywords_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `keywords` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addKeywords: "Add a `keywords` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
if (!import_getters.getters.communityPackageJson.getKeywords(node)) {
|
||||
context.report({
|
||||
messageId: "addKeywords",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
68
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-keywords-without-official-tag.js
generated
vendored
Normal file
68
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-keywords-without-official-tag.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_keywords_without_official_tag_exports = {};
|
||||
__export(community_package_json_keywords_without_official_tag_exports, {
|
||||
default: () => community_package_json_keywords_without_official_tag_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_keywords_without_official_tag_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_constants = require("../constants");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var community_package_json_keywords_without_official_tag_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `The \`keywords\` value in the \`package.json\` of a community package must be an array containing the value \`'${import_constants.COMMUNITY_PACKAGE_JSON.OFFICIAL_TAG}'\`.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addOfficialTag: `Add \`${import_constants.COMMUNITY_PACKAGE_JSON.OFFICIAL_TAG}\` to \`keywords\` in package.json`
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const keywords = import_getters.getters.communityPackageJson.getKeywords(node);
|
||||
if (!keywords)
|
||||
return;
|
||||
if (!hasOfficialTag(keywords)) {
|
||||
context.report({
|
||||
messageId: "addOfficialTag",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function hasOfficialTag(keywords) {
|
||||
if (keywords.ast.type === import_utils2.AST_NODE_TYPES.Property && keywords.ast.value.type === import_utils2.AST_NODE_TYPES.ArrayExpression) {
|
||||
return keywords.ast.value.elements.some(
|
||||
(element) => element?.type === import_utils2.AST_NODE_TYPES.Literal && element.value === import_constants.COMMUNITY_PACKAGE_JSON.OFFICIAL_TAG
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-license-missing.js
generated
vendored
Normal file
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-license-missing.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_license_missing_exports = {};
|
||||
__export(community_package_json_license_missing_exports, {
|
||||
default: () => community_package_json_license_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_license_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var community_package_json_license_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `description` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addLicense: "Add a `license` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
if (!import_getters.getters.communityPackageJson.getLicense(node)) {
|
||||
context.report({
|
||||
messageId: "addLicense",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
59
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-license-not-default.js
generated
vendored
Normal file
59
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-license-not-default.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_license_not_default_exports = {};
|
||||
__export(community_package_json_license_not_default_exports, {
|
||||
default: () => community_package_json_license_not_default_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_license_not_default_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_constants = require("../constants");
|
||||
var community_package_json_license_not_default_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `The \`license\` key in the \`package.json\` of a community package must be the default value \`${import_constants.COMMUNITY_PACKAGE_JSON.LICENSE}\`.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
updateLicense: `Update the \`license\` key to ${import_constants.COMMUNITY_PACKAGE_JSON.LICENSE} in package.json`
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const license = import_getters.getters.communityPackageJson.getLicense(node);
|
||||
if (!license)
|
||||
return;
|
||||
if (license.value !== import_constants.COMMUNITY_PACKAGE_JSON.LICENSE) {
|
||||
context.report({
|
||||
messageId: "updateLicense",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-api-version-missing.js
generated
vendored
Normal file
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-api-version-missing.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_n8n_api_version_missing_exports = {};
|
||||
__export(community_package_json_n8n_api_version_missing_exports, {
|
||||
default: () => community_package_json_n8n_api_version_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_n8n_api_version_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var community_package_json_n8n_api_version_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `n8n.n8nNodesApiVersion` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addN8nNodesApiVersion: "Add an `n8n.n8nNodesApiVersion` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const n8n = import_getters.getters.communityPackageJson.getN8n(node);
|
||||
if (!n8n)
|
||||
return;
|
||||
if (!hasN8nNodesApiVersion(n8n)) {
|
||||
context.report({
|
||||
messageId: "addN8nNodesApiVersion",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function hasN8nNodesApiVersion(n8n) {
|
||||
if (n8n.ast.type === import_utils2.AST_NODE_TYPES.Property && n8n.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
return n8n.ast.value.properties.some(import_identifiers.id.hasNodesApiVersion);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
71
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-api-version-not-number.js
generated
vendored
Normal file
71
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-api-version-not-number.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_n8n_api_version_not_number_exports = {};
|
||||
__export(community_package_json_n8n_api_version_not_number_exports, {
|
||||
default: () => community_package_json_n8n_api_version_not_number_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_n8n_api_version_not_number_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var community_package_json_n8n_api_version_not_number_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `n8n.n8nNodesApiVersion` value in the `package.json` of a community package must be a number.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
changeToNumber: "Change the `n8n.n8nNodesApiVersion` value to number in package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const n8n = import_getters.getters.communityPackageJson.getN8n(node);
|
||||
if (!n8n)
|
||||
return;
|
||||
const apiVersion = getN8nNodesApiVersion(n8n);
|
||||
if (!apiVersion)
|
||||
return;
|
||||
if (!hasNumberValue(apiVersion)) {
|
||||
context.report({
|
||||
messageId: "changeToNumber",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getN8nNodesApiVersion(n8n) {
|
||||
if (n8n.ast.type === import_utils2.AST_NODE_TYPES.Property && n8n.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
return n8n.ast.value.properties.find(import_identifiers.id.hasNodesApiVersion) ?? null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function hasNumberValue(n8nNodesApiVersion) {
|
||||
return n8nNodesApiVersion.type === import_utils2.AST_NODE_TYPES.Property && n8nNodesApiVersion.value.type === import_utils2.AST_NODE_TYPES.Literal && typeof n8nNodesApiVersion.value.value === "number";
|
||||
}
|
||||
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-missing.js
generated
vendored
Normal file
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-missing.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_n8n_missing_exports = {};
|
||||
__export(community_package_json_n8n_missing_exports, {
|
||||
default: () => community_package_json_n8n_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_n8n_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var community_package_json_n8n_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `n8n` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addN8n: "Add an `n8n` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
if (!import_getters.getters.communityPackageJson.getN8n(node)) {
|
||||
context.report({
|
||||
messageId: "addN8n",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
72
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-nodes-empty.js
generated
vendored
Normal file
72
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-nodes-empty.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_n8n_nodes_empty_exports = {};
|
||||
__export(community_package_json_n8n_nodes_empty_exports, {
|
||||
default: () => community_package_json_n8n_nodes_empty_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_n8n_nodes_empty_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var community_package_json_n8n_nodes_empty_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `n8n.nodes` value in the `package.json` of a community package must contain at least one filepath.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addOneFilepath: "Enter at least one filepath in `n8n.nodes` in package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const n8n = import_getters.getters.communityPackageJson.getN8n(node);
|
||||
if (!n8n)
|
||||
return;
|
||||
if (!hasAtLeastOneFilepath(n8n)) {
|
||||
context.report({
|
||||
messageId: "addOneFilepath",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function hasAtLeastOneFilepath(n8n) {
|
||||
if (n8n.ast.type === import_utils2.AST_NODE_TYPES.Property && n8n.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
const nodes = n8n.ast.value.properties.find(import_identifiers.id.hasNodesLiteral);
|
||||
if (!nodes)
|
||||
return false;
|
||||
if (nodes.type === import_utils2.AST_NODE_TYPES.Property && nodes.value.type === import_utils2.AST_NODE_TYPES.ArrayExpression) {
|
||||
return nodes.value.elements.some(
|
||||
(element) => element?.type === import_utils2.AST_NODE_TYPES.Literal
|
||||
);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-nodes-missing.js
generated
vendored
Normal file
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-n8n-nodes-missing.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_n8n_nodes_missing_exports = {};
|
||||
__export(community_package_json_n8n_nodes_missing_exports, {
|
||||
default: () => community_package_json_n8n_nodes_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_n8n_nodes_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var community_package_json_n8n_nodes_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `n8n.nodes` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addN8nNodes: "Add an `n8n.nodes` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const n8n = import_getters.getters.communityPackageJson.getN8n(node);
|
||||
if (!n8n)
|
||||
return;
|
||||
if (!hasN8nNodes(n8n)) {
|
||||
context.report({
|
||||
messageId: "addN8nNodes",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function hasN8nNodes(n8n) {
|
||||
if (n8n.ast.type === import_utils2.AST_NODE_TYPES.Property && n8n.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
return n8n.ast.value.properties.some(import_identifiers.id.hasNodesLiteral);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-name-missing.js
generated
vendored
Normal file
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-name-missing.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_name_missing_exports = {};
|
||||
__export(community_package_json_name_missing_exports, {
|
||||
default: () => community_package_json_name_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_name_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var community_package_json_name_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `name` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addName: "Add a `name` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
if (!import_getters.getters.communityPackageJson.getName(node)) {
|
||||
context.report({
|
||||
messageId: "addName",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
78
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-name-still-default.js
generated
vendored
Normal file
78
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-name-still-default.js
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_name_still_default_exports = {};
|
||||
__export(community_package_json_name_still_default_exports, {
|
||||
default: () => community_package_json_name_still_default_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_name_still_default_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_constants = require("../constants");
|
||||
var import_defaultValue = require("../ast/utils/defaultValue");
|
||||
const isTestRun = process.env.NODE_ENV === "test";
|
||||
const isProdRun = !isTestRun;
|
||||
var community_package_json_name_still_default_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
defaultOptions: [{ name: import_constants.COMMUNITY_PACKAGE_JSON.NAME }],
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `The \`name\` key in the \`package.json\` of a community package must be different from the default value \`${import_constants.COMMUNITY_PACKAGE_JSON.NAME}\` or a user-defined default.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
name: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
],
|
||||
messages: {
|
||||
updateName: "Update the `name` key in package.json"
|
||||
}
|
||||
},
|
||||
create(context, options) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
const filename = context.getFilename();
|
||||
if (isProdRun && !filename.includes("package.json"))
|
||||
return;
|
||||
if (isProdRun && !import_identifiers.id.prod.isTopLevelObjectExpression(node))
|
||||
return;
|
||||
if (isTestRun && !import_identifiers.id.test.isTopLevelObjectExpression(node))
|
||||
return;
|
||||
const name = import_getters.getters.communityPackageJson.getName(node);
|
||||
if (!name)
|
||||
return;
|
||||
const defaultName = (0, import_defaultValue.getDefaultValue)(options, "name");
|
||||
if (name.value === defaultName) {
|
||||
context.report({
|
||||
messageId: "updateName",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
89
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-repository-url-still-default.js
generated
vendored
Normal file
89
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-repository-url-still-default.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_repository_url_still_default_exports = {};
|
||||
__export(community_package_json_repository_url_still_default_exports, {
|
||||
default: () => community_package_json_repository_url_still_default_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_repository_url_still_default_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var import_constants = require("../constants");
|
||||
var import_defaultValue = require("../ast/utils/defaultValue");
|
||||
var import_ast = require("../ast");
|
||||
var community_package_json_repository_url_still_default_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
defaultOptions: [{ repositoryUrl: import_constants.COMMUNITY_PACKAGE_JSON.REPOSITORY_URL }],
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: import_ast.docline`The \`repository.url\` value in the \`package.json\` of a community package must be different from the default value \`${import_constants.COMMUNITY_PACKAGE_JSON.REPOSITORY_URL}\` or a user-defined default.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
repositoryUrl: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
],
|
||||
messages: {
|
||||
updateRepositoryUrl: "Update the `repository.url` key in package.json"
|
||||
}
|
||||
},
|
||||
create(context, options) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
const repository = import_getters.getters.communityPackageJson.getRepository(node);
|
||||
if (!repository)
|
||||
return;
|
||||
const repositoryUrl = getRepositoryUrl(repository);
|
||||
if (!repositoryUrl)
|
||||
return;
|
||||
const defaultRepositoryUrl = (0, import_defaultValue.getDefaultValue)(options, "repositoryUrl");
|
||||
if (repositoryUrl === defaultRepositoryUrl) {
|
||||
context.report({
|
||||
messageId: "updateRepositoryUrl",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getRepositoryUrl(repository) {
|
||||
if (repository.ast.type === import_utils2.AST_NODE_TYPES.Property && repository.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
const repositoryUrl = repository.ast.value.properties.find(
|
||||
import_identifiers.id.hasUrlLiteral
|
||||
);
|
||||
if (!repositoryUrl)
|
||||
return null;
|
||||
if (repositoryUrl.type === import_utils2.AST_NODE_TYPES.Property && repositoryUrl.value.type === import_utils2.AST_NODE_TYPES.Literal && typeof repositoryUrl.value.value === "string") {
|
||||
return repositoryUrl.value.value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-version-missing.js
generated
vendored
Normal file
55
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/community-package-json-version-missing.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var community_package_json_version_missing_exports = {};
|
||||
__export(community_package_json_version_missing_exports, {
|
||||
default: () => community_package_json_version_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(community_package_json_version_missing_exports);
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils = require("../ast/utils");
|
||||
var community_package_json_version_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `version` key must be present in the `package.json` of a community package.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addVersion: "Add a `version` key to package.json"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isCommunityPackageJson(context.getFilename(), node))
|
||||
return;
|
||||
if (!import_getters.getters.communityPackageJson.getVersion(node)) {
|
||||
context.report({
|
||||
messageId: "addVersion",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
80
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-authenticate-type-assertion.js
generated
vendored
Normal file
80
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-authenticate-type-assertion.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_authenticate_type_assertion_exports = {};
|
||||
__export(cred_class_field_authenticate_type_assertion_exports, {
|
||||
default: () => cred_class_field_authenticate_type_assertion_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_authenticate_type_assertion_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_utils2 = require("../ast/utils");
|
||||
var cred_class_field_authenticate_type_assertion_default = import_utils2.utils.createRule({
|
||||
name: import_utils2.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "In a credential class, the field `authenticate` must be typed `IAuthenticateGeneric`",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
removeAssertionAndType: "Remove assertion and type field `authenticate` with `IAuthenticateGeneric` [autofixable]",
|
||||
removeAssertion: "Remove assertion [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
TSAsExpression(node) {
|
||||
if (!import_utils2.utils.isCredentialFile(context.getFilename()))
|
||||
return;
|
||||
if (node.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSTypeReference && node.typeAnnotation.typeName.type === import_utils.AST_NODE_TYPES.Identifier && node.typeAnnotation.typeName.name === "IAuthenticateGeneric" && node.parent !== void 0 && node.parent.type === import_utils.AST_NODE_TYPES.PropertyDefinition && node.parent.key.type === import_utils.AST_NODE_TYPES.Identifier && node.parent.key.name === "authenticate") {
|
||||
const removalNode = node.typeAnnotation.typeName;
|
||||
const insertionNode = node.parent.key;
|
||||
const rangeToRemove = import_utils2.utils.getRangeOfAssertion(removalNode);
|
||||
if (isAlreadyTyped(insertionNode)) {
|
||||
return context.report({
|
||||
messageId: "removeAssertion",
|
||||
node,
|
||||
fix: (fixer) => fixer.removeRange(rangeToRemove)
|
||||
});
|
||||
}
|
||||
context.report({
|
||||
messageId: "removeAssertionAndType",
|
||||
node,
|
||||
fix: (fixer) => {
|
||||
return [
|
||||
fixer.removeRange(rangeToRemove),
|
||||
fixer.insertTextAfterRange(
|
||||
insertionNode.range,
|
||||
": IAuthenticateGeneric"
|
||||
)
|
||||
];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function isAlreadyTyped(node) {
|
||||
if (!node.typeAnnotation)
|
||||
return false;
|
||||
return node.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSTypeAnnotation && node.typeAnnotation.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSArrayType && node.typeAnnotation.typeAnnotation.elementType.type === import_utils.AST_NODE_TYPES.TSTypeReference && node.typeAnnotation.typeAnnotation.elementType.typeName.type === import_utils.AST_NODE_TYPES.Identifier && node.typeAnnotation.typeAnnotation.elementType.typeName.name === "IAuthenticateGeneric";
|
||||
}
|
||||
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-display-name-miscased.js
generated
vendored
Normal file
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-display-name-miscased.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_display_name_miscased_exports = {};
|
||||
__export(cred_class_field_display_name_miscased_exports, {
|
||||
default: () => cred_class_field_display_name_miscased_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_display_name_miscased_exports);
|
||||
var import_title_case = require("title-case");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_class_field_display_name_miscased_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`displayName` field in credential class must be title cased, except for `n8n API` and `E-goi API`",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
useTitleCase: "Change to title case [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const displayName = import_getters.getters.credClassBody.getDisplayName(node.body);
|
||||
if (!displayName || EXCEPTIONS.includes(displayName.value))
|
||||
return;
|
||||
if (displayName.value !== (0, import_title_case.titleCase)(displayName.value)) {
|
||||
context.report({
|
||||
messageId: "useTitleCase",
|
||||
node: displayName.ast,
|
||||
fix: (fixer) => fixer.replaceText(
|
||||
displayName.ast,
|
||||
`displayName = '${(0, import_title_case.titleCase)(displayName.value)}';`
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
const EXCEPTIONS = ["n8n API", "E-goi API"];
|
||||
66
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-display-name-missing-api.js
generated
vendored
Normal file
66
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-display-name-missing-api.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_display_name_missing_api_exports = {};
|
||||
__export(cred_class_field_display_name_missing_api_exports, {
|
||||
default: () => cred_class_field_display_name_missing_api_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_display_name_missing_api_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_apiSuffixExemption = require("../ast/utils/apiSuffixExemption");
|
||||
var cred_class_field_display_name_missing_api_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`displayName` field in credential class must be end with `API`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixSuffix: "Append 'API' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
if ((0, import_apiSuffixExemption.isExemptedFromApiSuffix)(context.getFilename()))
|
||||
return;
|
||||
const displayName = import_getters.getters.credClassBody.getDisplayName(node.body);
|
||||
if (!displayName)
|
||||
return;
|
||||
if (!displayName.value.endsWith(" API")) {
|
||||
const fixed = import_utils.utils.addApiSuffix(displayName.value, {
|
||||
uppercased: true
|
||||
});
|
||||
context.report({
|
||||
messageId: "fixSuffix",
|
||||
node: displayName.ast,
|
||||
fix: (fixer) => fixer.replaceText(displayName.ast, `displayName = '${fixed}';`)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-display-name-missing-oauth2.js
generated
vendored
Normal file
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-display-name-missing-oauth2.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_display_name_missing_oauth2_exports = {};
|
||||
__export(cred_class_field_display_name_missing_oauth2_exports, {
|
||||
default: () => cred_class_field_display_name_missing_oauth2_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_display_name_missing_oauth2_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_class_field_display_name_missing_oauth2_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`displayName` field in credential class must mention `OAuth2` if the credential is OAuth2.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addOAuth2: "Add 'OAuth2' [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const extendsValue = import_getters.getters.credClassBody.getExtendsValue(
|
||||
node.body,
|
||||
context
|
||||
);
|
||||
if (!extendsValue)
|
||||
return;
|
||||
const displayName = import_getters.getters.credClassBody.getDisplayName(node.body);
|
||||
if (!displayName)
|
||||
return;
|
||||
if (extendsValue.includes("oAuth2Api") && !displayName.value.endsWith("OAuth2 API")) {
|
||||
context.report({
|
||||
messageId: "addOAuth2",
|
||||
node: displayName.ast
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
67
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-documentation-url-miscased.js
generated
vendored
Normal file
67
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-documentation-url-miscased.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_documentation_url_miscased_exports = {};
|
||||
__export(cred_class_field_documentation_url_miscased_exports, {
|
||||
default: () => cred_class_field_documentation_url_miscased_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_documentation_url_miscased_exports);
|
||||
var import_camel_case = require("camel-case");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_class_field_documentation_url_miscased_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`documentationUrl` field in credential class must be camel cased. Only applicable to nodes in the main repository.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
useCamelCase: "Change to camelCase [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const documentationUrl = import_getters.getters.credClassBody.getDocumentationUrl(
|
||||
node.body
|
||||
);
|
||||
if (!documentationUrl)
|
||||
return;
|
||||
const camelCasedDocumentationUrl = (0, import_camel_case.camelCase)(documentationUrl.value);
|
||||
if (documentationUrl.value !== camelCasedDocumentationUrl) {
|
||||
context.report({
|
||||
messageId: "useCamelCase",
|
||||
node: documentationUrl.ast,
|
||||
fix: (fixer) => fixer.replaceText(
|
||||
documentationUrl.ast,
|
||||
`documentationUrl = '${camelCasedDocumentationUrl}';`
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
71
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-documentation-url-missing.js
generated
vendored
Normal file
71
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-documentation-url-missing.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_documentation_url_missing_exports = {};
|
||||
__export(cred_class_field_documentation_url_missing_exports, {
|
||||
default: () => cred_class_field_documentation_url_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_documentation_url_missing_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_class_field_documentation_url_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`documentationUrl` field in credential class must be present.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
addDocumentationUrl: "Add `documentationUrl` [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const { body: classBody } = node;
|
||||
const documentationUrl = import_getters.getters.credClassBody.getDocumentationUrl(classBody);
|
||||
if (!documentationUrl) {
|
||||
const displayName = import_getters.getters.credClassBody.getDisplayName(classBody);
|
||||
if (!displayName)
|
||||
return;
|
||||
const className = import_getters.getters.credClassBody.getName(classBody);
|
||||
if (!className)
|
||||
return;
|
||||
const { indentation, range } = import_utils.utils.getInsertionArgs(displayName);
|
||||
const fixed = className.value.replace(/(OAuth2)?Api/g, "");
|
||||
context.report({
|
||||
messageId: "addDocumentationUrl",
|
||||
node: classBody,
|
||||
fix: (fixer) => fixer.insertTextAfterRange(
|
||||
range,
|
||||
`
|
||||
${indentation}documentationUrl = '${fixed}';`
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
73
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-documentation-url-not-http-url.js
generated
vendored
Normal file
73
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-documentation-url-not-http-url.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_documentation_url_not_http_url_exports = {};
|
||||
__export(cred_class_field_documentation_url_not_http_url_exports, {
|
||||
default: () => cred_class_field_documentation_url_not_http_url_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_documentation_url_not_http_url_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
const isTestRun = process.env.NODE_ENV === "test";
|
||||
var cred_class_field_documentation_url_not_http_url_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`documentationUrl` field in credential class must be an HTTP URL. Only applicable to community credentials.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
useHttpUrl: "Use an HTTP URL, e.g. `https://example.com/docs/auth` [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
const filename = context.getFilename();
|
||||
if (!import_identifiers.id.isCredentialClass(node) || !isCommunityCredential(filename)) {
|
||||
return;
|
||||
}
|
||||
const documentationUrl = import_getters.getters.credClassBody.getDocumentationUrl(
|
||||
node.body
|
||||
);
|
||||
if (!documentationUrl)
|
||||
return;
|
||||
if (!isHttpUrl(documentationUrl.value)) {
|
||||
context.report({
|
||||
messageId: "useHttpUrl",
|
||||
node: documentationUrl.ast
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function isHttpUrl(string) {
|
||||
let url;
|
||||
try {
|
||||
url = new URL(string);
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
return url.protocol === "http:" || url.protocol === "https:";
|
||||
}
|
||||
const isCommunityCredential = (filename) => (!filename.includes("packages/credentials") || !filename.includes("packages\\credentials") || isTestRun) && !filename.includes("scratchpad");
|
||||
66
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-name-missing-oauth2.js
generated
vendored
Normal file
66
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-name-missing-oauth2.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_name_missing_oauth2_exports = {};
|
||||
__export(cred_class_field_name_missing_oauth2_exports, {
|
||||
default: () => cred_class_field_name_missing_oauth2_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_name_missing_oauth2_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_class_field_name_missing_oauth2_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`name` field in credential class must mention `OAuth2` if the credential is OAuth2.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addOAuth2: "Insert 'OAuth2' [non-autofixable]"
|
||||
// unpredictable input
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const { body: classBody } = node;
|
||||
const extendsValue = import_getters.getters.credClassBody.getExtendsValue(
|
||||
classBody,
|
||||
context
|
||||
);
|
||||
if (!extendsValue)
|
||||
return;
|
||||
const name = import_getters.getters.credClassBody.getName(classBody);
|
||||
if (!name)
|
||||
return;
|
||||
if (extendsValue.includes("oAuth2Api") && !name.value.endsWith("OAuth2Api")) {
|
||||
context.report({
|
||||
messageId: "addOAuth2",
|
||||
node: name.ast
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-name-unsuffixed.js
generated
vendored
Normal file
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-name-unsuffixed.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_name_unsuffixed_exports = {};
|
||||
__export(cred_class_field_name_unsuffixed_exports, {
|
||||
default: () => cred_class_field_name_unsuffixed_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_name_unsuffixed_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_apiSuffixExemption = require("../ast/utils/apiSuffixExemption");
|
||||
var cred_class_field_name_unsuffixed_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`name` field in credential class must be suffixed with `-Api`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixSuffix: "Suffix with '-Api' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
if ((0, import_apiSuffixExemption.isExemptedFromApiSuffix)(context.getFilename()))
|
||||
return;
|
||||
const name = import_getters.getters.credClassBody.getName(node.body);
|
||||
if (!name)
|
||||
return;
|
||||
if (!name.value.endsWith("Api")) {
|
||||
const fixed = import_utils.utils.addApiSuffix(name.value);
|
||||
context.report({
|
||||
messageId: "fixSuffix",
|
||||
node: name.ast,
|
||||
fix: (fixer) => fixer.replaceText(name.ast, `name = '${fixed}';`)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
61
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-name-uppercase-first-char.js
generated
vendored
Normal file
61
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-name-uppercase-first-char.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_name_uppercase_first_char_exports = {};
|
||||
__export(cred_class_field_name_uppercase_first_char_exports, {
|
||||
default: () => cred_class_field_name_uppercase_first_char_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_name_uppercase_first_char_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_class_field_name_uppercase_first_char_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "First char in `name` in credential class must be lowercase.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
uppercaseFirstChar: "Change first char to lowercase [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const name = import_getters.getters.credClassBody.getName(node.body);
|
||||
if (!name)
|
||||
return;
|
||||
const fixed = name.value.charAt(0).toLowerCase() + name.value.slice(1);
|
||||
if (/[A-Z]/.test(name.value.charAt(0))) {
|
||||
context.report({
|
||||
messageId: "uppercaseFirstChar",
|
||||
node: name.ast,
|
||||
fix: (fixer) => fixer.replaceText(name.ast, `name = '${fixed}';`)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-placeholder-url-missing-eg.js
generated
vendored
Normal file
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-placeholder-url-missing-eg.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_placeholder_url_missing_eg_exports = {};
|
||||
__export(cred_class_field_placeholder_url_missing_eg_exports, {
|
||||
default: () => cred_class_field_placeholder_url_missing_eg_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_placeholder_url_missing_eg_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_class_field_placeholder_url_missing_eg_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`placeholder` for a URL in credential class must be prepended with `e.g.`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
prependEg: "Prepend 'e.g.' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const placeholder = import_getters.getters.credClassBody.getPlaceholder(node.body);
|
||||
if (!placeholder)
|
||||
return;
|
||||
if (placeholder.value.startsWith("http")) {
|
||||
context.report({
|
||||
messageId: "prependEg",
|
||||
node: placeholder.ast,
|
||||
fix: (fixer) => fixer.replaceText(
|
||||
placeholder.ast,
|
||||
`placeholder = 'e.g. ${placeholder.value}';`
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
97
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-properties-assertion.js
generated
vendored
Normal file
97
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-properties-assertion.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_properties_assertion_exports = {};
|
||||
__export(cred_class_field_properties_assertion_exports, {
|
||||
default: () => cred_class_field_properties_assertion_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_properties_assertion_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_utils2 = require("../ast/utils");
|
||||
var cred_class_field_properties_assertion_default = import_utils2.utils.createRule({
|
||||
name: import_utils2.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "In a credential class, the field `properties` must be typed `INodeProperties` and individual properties must have no assertions.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
removeAssertionAndType: "Remove assertion and type field 'properties' with 'INodeProperties[]' [autofixable]",
|
||||
removeAssertion: "Remove assertion [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
TSAsExpression(node) {
|
||||
if (!import_utils2.utils.isCredentialFile(context.getFilename()))
|
||||
return;
|
||||
const assertionNodes = getAssertionNodes(node);
|
||||
if (assertionNodes) {
|
||||
const { insertionNode, removalNode, typingExists } = assertionNodes;
|
||||
const rangeToRemove = import_utils2.utils.getRangeOfAssertion(removalNode);
|
||||
if (typingExists) {
|
||||
return context.report({
|
||||
messageId: "removeAssertion",
|
||||
node,
|
||||
fix: (fixer) => fixer.removeRange(rangeToRemove)
|
||||
});
|
||||
}
|
||||
context.report({
|
||||
messageId: "removeAssertionAndType",
|
||||
node,
|
||||
fix: (fixer) => {
|
||||
return [
|
||||
fixer.removeRange(rangeToRemove),
|
||||
fixer.insertTextAfterRange(
|
||||
insertionNode.range,
|
||||
": INodeProperties[]"
|
||||
)
|
||||
];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getAssertionNodes(node) {
|
||||
if (node.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSTypeReference && node.typeAnnotation.typeName.type === import_utils.AST_NODE_TYPES.Identifier && node.typeAnnotation.typeName.name === "NodePropertyTypes" && node.parent?.type === import_utils.AST_NODE_TYPES.Property && node.parent.key.type === import_utils.AST_NODE_TYPES.Identifier && node.parent.key.name === "type") {
|
||||
const insertionNode = node.parent?.parent?.parent?.parent;
|
||||
if (!insertionNode)
|
||||
return null;
|
||||
if ("key" in insertionNode && "type" in insertionNode.key && // insertionNode.type === AST_NODE_TYPES.PropertyDefinition &&
|
||||
// insertionNode.computed === false &&
|
||||
insertionNode.key.type === import_utils.AST_NODE_TYPES.Identifier && insertionNode.key.name === "properties") {
|
||||
return {
|
||||
removalNode: node.typeAnnotation.typeName,
|
||||
insertionNode: insertionNode.key,
|
||||
typingExists: isAlreadyTyped(insertionNode)
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function isAlreadyTyped(node) {
|
||||
if (!node.typeAnnotation)
|
||||
return false;
|
||||
return node.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSTypeAnnotation && node.typeAnnotation.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSArrayType && node.typeAnnotation.typeAnnotation.elementType.type === import_utils.AST_NODE_TYPES.TSTypeReference && node.typeAnnotation.typeAnnotation.elementType.typeName.type === import_utils.AST_NODE_TYPES.Identifier && node.typeAnnotation.typeAnnotation.elementType.typeName.name === "INodeProperties";
|
||||
}
|
||||
90
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-type-options-password-missing.js
generated
vendored
Normal file
90
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-field-type-options-password-missing.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_field_type_options_password_missing_exports = {};
|
||||
__export(cred_class_field_type_options_password_missing_exports, {
|
||||
default: () => cred_class_field_type_options_password_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_field_type_options_password_missing_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_constants = require("../constants");
|
||||
const isFalsePositive = (fieldName) => {
|
||||
if (fieldName.endsWith("Url"))
|
||||
return true;
|
||||
return import_constants.FALSE_POSITIVE_CRED_SENSITIVE_CLASS_FIELDS.includes(fieldName);
|
||||
};
|
||||
const isSensitive = (fieldName) => {
|
||||
if (isFalsePositive(fieldName))
|
||||
return false;
|
||||
return import_constants.CRED_SENSITIVE_CLASS_FIELDS.some(
|
||||
(sensitiveField) => fieldName.toLowerCase().includes(sensitiveField.toLowerCase())
|
||||
);
|
||||
};
|
||||
const sensitiveStrings = import_constants.CRED_SENSITIVE_CLASS_FIELDS.map(
|
||||
(i) => `\`${i}\``
|
||||
).join(",");
|
||||
var cred_class_field_type_options_password_missing_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `In a sensitive string-type field, \`typeOptions.password\` must be set to \`true\` to obscure the input. A field name is sensitive if it contains the strings: ${sensitiveStrings}. See exceptions in source.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
addPasswordAutofixable: "Add `typeOptions.password` with `true` [autofixable]",
|
||||
addPasswordNonAutofixable: "Add `typeOptions.password` with `true` [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
const name = import_getters.getters.nodeParam.getName(node);
|
||||
if (!name || !isSensitive(name.value))
|
||||
return;
|
||||
const type = import_getters.getters.nodeParam.getType(node);
|
||||
if (!type || type.value !== "string")
|
||||
return;
|
||||
const typeOptions = import_getters.getters.nodeParam.getTypeOptions(node);
|
||||
if (typeOptions?.value.password === true)
|
||||
return;
|
||||
if (typeOptions) {
|
||||
return context.report({
|
||||
messageId: "addPasswordNonAutofixable",
|
||||
node: typeOptions.ast
|
||||
// @TODO: Autofix this case
|
||||
});
|
||||
}
|
||||
const { indentation, range } = import_utils.utils.getInsertionArgs(type);
|
||||
context.report({
|
||||
messageId: "addPasswordAutofixable",
|
||||
node: type.ast,
|
||||
fix: (fixer) => fixer.insertTextAfterRange(
|
||||
range,
|
||||
`
|
||||
${indentation}typeOptions: { password: true },`
|
||||
)
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-name-missing-oauth2-suffix.js
generated
vendored
Normal file
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-name-missing-oauth2-suffix.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_name_missing_oauth2_suffix_exports = {};
|
||||
__export(cred_class_name_missing_oauth2_suffix_exports, {
|
||||
default: () => cred_class_name_missing_oauth2_suffix_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_name_missing_oauth2_suffix_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_class_name_missing_oauth2_suffix_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "Credential class name must mention `OAuth2` if the credential is OAuth2.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addOAuth2: "Insert 'OAuth2' [non-autofixable]"
|
||||
// unpredictable input
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const extendsValue = import_getters.getters.credClassBody.getExtendsValue(
|
||||
node.body,
|
||||
context
|
||||
);
|
||||
if (!extendsValue)
|
||||
return;
|
||||
const className = import_getters.getters.getClassName(node);
|
||||
if (!className)
|
||||
return;
|
||||
if (extendsValue.includes("oAuth2Api") && !className.value.endsWith("OAuth2Api")) {
|
||||
context.report({
|
||||
messageId: "addOAuth2",
|
||||
node: className.ast
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-name-unsuffixed.js
generated
vendored
Normal file
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-class-name-unsuffixed.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_class_name_unsuffixed_exports = {};
|
||||
__export(cred_class_name_unsuffixed_exports, {
|
||||
default: () => cred_class_name_unsuffixed_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_class_name_unsuffixed_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_apiSuffixExemption = require("../ast/utils/apiSuffixExemption");
|
||||
var cred_class_name_unsuffixed_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "Credential class name must be suffixed with `-Api`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixSuffix: "Suffix with '-Api' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
if ((0, import_apiSuffixExemption.isExemptedFromApiSuffix)(context.getFilename()))
|
||||
return;
|
||||
const className = import_getters.getters.getClassName(node);
|
||||
if (!className)
|
||||
return;
|
||||
if (!className.value.endsWith("Api")) {
|
||||
const fixed = import_utils.utils.addApiSuffix(className.value);
|
||||
context.report({
|
||||
messageId: "fixSuffix",
|
||||
node: className.ast,
|
||||
fix: (fixer) => fixer.replaceText(className.ast, fixed)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-filename-against-convention.js
generated
vendored
Normal file
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/cred-filename-against-convention.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cred_filename_against_convention_exports = {};
|
||||
__export(cred_filename_against_convention_exports, {
|
||||
default: () => cred_filename_against_convention_default
|
||||
});
|
||||
module.exports = __toCommonJS(cred_filename_against_convention_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var cred_filename_against_convention_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "Credentials filename must match credentials class name, excluding the filename suffix. Example: `TestApi.credentials.ts` matches `TestApi` in `class TestApi implements ICredentialType`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
renameFile: "Rename file to {{ expected }} [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration(node) {
|
||||
if (!import_identifiers.id.isCredentialClass(node))
|
||||
return;
|
||||
const actual = context.getFilename().replace(/\\/g, "/").split("/").pop();
|
||||
if (!actual)
|
||||
return;
|
||||
const className = import_getters.getters.getClassName(node);
|
||||
if (!className)
|
||||
return;
|
||||
const expected = className.value + ".credentials.ts";
|
||||
if (actual !== expected) {
|
||||
const topOfFile = { line: 1, column: 1 };
|
||||
context.report({
|
||||
messageId: "renameFile",
|
||||
loc: { start: topOfFile, end: topOfFile },
|
||||
data: { expected }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
119
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-credentials-name-unsuffixed.js
generated
vendored
Normal file
119
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-credentials-name-unsuffixed.js
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_credentials_name_unsuffixed_exports = {};
|
||||
__export(node_class_description_credentials_name_unsuffixed_exports, {
|
||||
default: () => node_class_description_credentials_name_unsuffixed_default,
|
||||
getUnsuffixedCredOptionName: () => getUnsuffixedCredOptionName
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_credentials_name_unsuffixed_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_credentials_name_unsuffixed_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`name` under `credentials` in node class description must be suffixed with `-Api`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixSuffix: "Suffix with `-Api` [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
if (hasCredExemptedFromApiSuffix(context.getFilename()))
|
||||
return;
|
||||
const credOptions = import_getters.getters.nodeClassDescription.getCredOptions(node);
|
||||
if (!credOptions)
|
||||
return;
|
||||
const unsuffixed = getUnsuffixedCredOptionName(credOptions);
|
||||
if (unsuffixed) {
|
||||
const suffixed = import_utils.utils.addApiSuffix(unsuffixed.value);
|
||||
const fixed = import_utils.utils.keyValue("name", suffixed);
|
||||
context.report({
|
||||
messageId: "fixSuffix",
|
||||
node: unsuffixed.ast,
|
||||
fix: (fixer) => fixer.replaceText(unsuffixed.ast, fixed)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getUnsuffixedCredOptionName(credOptions) {
|
||||
for (const credOption of credOptions.ast.value.elements) {
|
||||
for (const property of credOption.properties) {
|
||||
if (import_identifiers.id.nodeClassDescription.isName(property) && typeof property.value.value === "string" && !property.value.value.endsWith("Api")) {
|
||||
return {
|
||||
ast: property,
|
||||
value: property.value.value
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
const NODES_EXEMPTED_FROM_HAVING_CREDS_WITH_API_SUFFIX = [
|
||||
"Amqp",
|
||||
"Aws",
|
||||
"CrateDb",
|
||||
"EmailReadImap",
|
||||
"EmailSend",
|
||||
"FileMaker",
|
||||
"Ftp",
|
||||
"Git",
|
||||
"Google",
|
||||
"GraphQL",
|
||||
"HttpRequest",
|
||||
"Hubspot",
|
||||
"Kafka",
|
||||
"MQTT",
|
||||
"Microsoft",
|
||||
"MongoDb",
|
||||
"MySql",
|
||||
"NocoDB",
|
||||
"Pipedrive",
|
||||
"Postgres",
|
||||
"QuestDb",
|
||||
"RabbitMQ",
|
||||
"Redis",
|
||||
"S3",
|
||||
"Snowflake",
|
||||
"Ssh",
|
||||
"TimescaleDb",
|
||||
"Wait",
|
||||
"Webhook"
|
||||
];
|
||||
function hasCredExemptedFromApiSuffix(filename) {
|
||||
return NODES_EXEMPTED_FROM_HAVING_CREDS_WITH_API_SUFFIX.some(
|
||||
(cred) => filename.includes(cred)
|
||||
);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getUnsuffixedCredOptionName
|
||||
});
|
||||
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-display-name-unsuffixed-trigger-node.js
generated
vendored
Normal file
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-display-name-unsuffixed-trigger-node.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_display_name_unsuffixed_trigger_node_exports = {};
|
||||
__export(node_class_description_display_name_unsuffixed_trigger_node_exports, {
|
||||
default: () => node_class_description_display_name_unsuffixed_trigger_node_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_display_name_unsuffixed_trigger_node_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_display_name_unsuffixed_trigger_node_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`displayName` in node class description for trigger node must be suffixed with `-Trigger`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixInputs: "Suffix with '-Trigger' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_utils.utils.isTriggerNodeFile(context.getFilename()))
|
||||
return;
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const displayName = import_getters.getters.nodeClassDescription.getDisplayName(node);
|
||||
if (!displayName)
|
||||
return;
|
||||
const displayValue = displayName.value.replace(/\s*\(Beta\)$/, "");
|
||||
if (!displayValue.endsWith("Trigger")) {
|
||||
const suffixed = `${displayName.value} Trigger`;
|
||||
const fixed = import_utils.utils.keyValue("displayName", suffixed);
|
||||
context.report({
|
||||
messageId: "fixInputs",
|
||||
node: displayName.ast,
|
||||
fix: (fixer) => fixer.replaceText(displayName.ast, fixed)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
59
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-empty-string.js
generated
vendored
Normal file
59
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-empty-string.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_empty_string_exports = {};
|
||||
__export(node_class_description_empty_string_exports, {
|
||||
default: () => node_class_description_empty_string_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_empty_string_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_empty_string_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`description` in node class description must be filled out.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
fillOutDescription: "Fill out description [non-autofixable]"
|
||||
// unknowable description
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const description = import_getters.getters.nodeClassDescription.getDescription(node);
|
||||
if (!description)
|
||||
return;
|
||||
if (description.value === "") {
|
||||
context.report({
|
||||
messageId: "fillOutDescription",
|
||||
node: description.ast
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-icon-not-svg.js
generated
vendored
Normal file
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-icon-not-svg.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_icon_not_svg_exports = {};
|
||||
__export(node_class_description_icon_not_svg_exports, {
|
||||
default: () => node_class_description_icon_not_svg_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_icon_not_svg_exports);
|
||||
var import_constants = require("../constants");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
const iconSources = import_constants.SVG_ICON_SOURCES.join(" | ");
|
||||
var node_class_description_icon_not_svg_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`icon` in node class description should be an SVG icon.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
useSvg: `Try to use an SVG icon. Icon sources: ${iconSources} [non-autofixable]`
|
||||
// unavailable file
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const icon = import_getters.getters.nodeClassDescription.getIcon(node);
|
||||
if (!icon)
|
||||
return;
|
||||
if (icon.value.startsWith("fa:"))
|
||||
return;
|
||||
if (!icon.value.endsWith(".svg")) {
|
||||
context.report({
|
||||
messageId: "useSvg",
|
||||
node: icon.ast
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
73
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-inputs-wrong-regular-node.js
generated
vendored
Normal file
73
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-inputs-wrong-regular-node.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_inputs_wrong_regular_node_exports = {};
|
||||
__export(node_class_description_inputs_wrong_regular_node_exports, {
|
||||
default: () => node_class_description_inputs_wrong_regular_node_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_inputs_wrong_regular_node_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_inputs_wrong_regular_node_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The number of `inputs` in node class description for regular node should be one, or two for Merge node.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixInputs: `Replace with "['main']" [autofixable]`,
|
||||
fixInputsMerge: `Replace with "['main', 'main']" [autofixable]`
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const inputs = import_getters.getters.nodeClassDescription.getInputs(node);
|
||||
if (!inputs)
|
||||
return;
|
||||
const filename = context.getFilename();
|
||||
if (!import_utils.utils.isRegularNodeFile(filename))
|
||||
return;
|
||||
const isMergeNode = filename.endsWith("Merge.node.ts");
|
||||
const inputsTotal = inputs.value.length;
|
||||
if (isMergeNode && inputsTotal !== 2) {
|
||||
context.report({
|
||||
messageId: "fixInputsMerge",
|
||||
node: inputs.ast,
|
||||
fix: (fixer) => fixer.replaceText(inputs.ast, "inputs: ['main', 'main']")
|
||||
});
|
||||
}
|
||||
if (!isMergeNode && inputsTotal !== 1 || !isMergeNode && inputsTotal === 1 && inputs.value[0] !== "main") {
|
||||
context.report({
|
||||
messageId: "fixInputs",
|
||||
node: inputs.ast,
|
||||
fix: (fixer) => fixer.replaceText(inputs.ast, "inputs: ['main']")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-inputs-wrong-trigger-node.js
generated
vendored
Normal file
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-inputs-wrong-trigger-node.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_inputs_wrong_trigger_node_exports = {};
|
||||
__export(node_class_description_inputs_wrong_trigger_node_exports, {
|
||||
default: () => node_class_description_inputs_wrong_trigger_node_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_inputs_wrong_trigger_node_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_inputs_wrong_trigger_node_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The number of `inputs` in node class description for trigger node should be zero.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixInputs: "Replace with '[]' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_utils.utils.isTriggerNodeFile(context.getFilename()))
|
||||
return;
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const inputs = import_getters.getters.nodeClassDescription.getInputs(node);
|
||||
if (!inputs)
|
||||
return;
|
||||
const inputsTotal = inputs.value.length;
|
||||
if (inputsTotal !== 0) {
|
||||
context.report({
|
||||
messageId: "fixInputs",
|
||||
node: inputs.ast,
|
||||
fix: (fixer) => fixer.replaceText(inputs.ast, "inputs: []")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
93
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-missing-subtitle.js
generated
vendored
Normal file
93
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-missing-subtitle.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_missing_subtitle_exports = {};
|
||||
__export(node_class_description_missing_subtitle_exports, {
|
||||
default: () => node_class_description_missing_subtitle_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_missing_subtitle_exports);
|
||||
var import_constants = require("../constants");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_missing_subtitle_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`subtitle` in node class description must be present.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
addSubtitle: `Add subtitle: '${import_constants.NODE_CLASS_DESCRIPTION_SUBTITLE}' [autofixable]`
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const allDisplayNames = getAllDisplayNames(node);
|
||||
if (!allDisplayNames)
|
||||
return;
|
||||
const hasNoSubtitleComponents = !allDisplayNames.every(
|
||||
(dn) => ["Resource", "Operation"].includes(dn)
|
||||
);
|
||||
if (hasNoSubtitleComponents)
|
||||
return;
|
||||
if (!import_getters.getters.nodeClassDescription.getSubtitle(node)) {
|
||||
const version = import_getters.getters.nodeClassDescription.getVersion(node) ?? import_getters.getters.nodeClassDescription.getDefaultVersion(node);
|
||||
if (!version)
|
||||
return;
|
||||
const { range, indentation } = import_utils.utils.getInsertionArgs(version);
|
||||
context.report({
|
||||
messageId: "addSubtitle",
|
||||
node,
|
||||
fix: (fixer) => fixer.insertTextAfterRange(
|
||||
range,
|
||||
`
|
||||
${indentation}subtitle: '${import_constants.NODE_CLASS_DESCRIPTION_SUBTITLE}',`
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getAllDisplayNames(nodeParam) {
|
||||
const properties = nodeParam.properties.find(
|
||||
import_identifiers.id.nodeClassDescription.isProperties
|
||||
);
|
||||
if (!properties)
|
||||
return null;
|
||||
const displayNames = properties.value.elements.reduce(
|
||||
(acc, element) => {
|
||||
const found = element.properties?.find(import_identifiers.id.nodeParam.isDisplayName);
|
||||
if (found)
|
||||
acc.push(found.value.value);
|
||||
return acc;
|
||||
},
|
||||
[]
|
||||
);
|
||||
if (!displayNames.length)
|
||||
return null;
|
||||
return displayNames;
|
||||
}
|
||||
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-name-miscased.js
generated
vendored
Normal file
65
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-name-miscased.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_name_miscased_exports = {};
|
||||
__export(node_class_description_name_miscased_exports, {
|
||||
default: () => node_class_description_name_miscased_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_name_miscased_exports);
|
||||
var import_camel_case = require("camel-case");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_name_miscased_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`name` in node class description must be camel cased.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
useCamelCase: "Change to camel case [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
if (!import_utils.utils.isNodeFile(context.getFilename()))
|
||||
return;
|
||||
const name = import_getters.getters.nodeClassDescription.getName(node);
|
||||
if (!name)
|
||||
return;
|
||||
const camelCased = (0, import_camel_case.camelCase)(name.value);
|
||||
if (name.value !== camelCased) {
|
||||
const fixed = import_utils.utils.keyValue("name", camelCased);
|
||||
context.report({
|
||||
messageId: "useCamelCase",
|
||||
node: name.ast,
|
||||
fix: (fixer) => fixer.replaceText(name.ast, fixed)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-name-unsuffixed-trigger-node.js
generated
vendored
Normal file
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-name-unsuffixed-trigger-node.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_name_unsuffixed_trigger_node_exports = {};
|
||||
__export(node_class_description_name_unsuffixed_trigger_node_exports, {
|
||||
default: () => node_class_description_name_unsuffixed_trigger_node_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_name_unsuffixed_trigger_node_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_name_unsuffixed_trigger_node_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`name` in node class description for trigger node must be suffixed with `-Trigger`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixInputs: "Suffix with '-Trigger' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
if (!import_utils.utils.isTriggerNodeFile(context.getFilename()))
|
||||
return;
|
||||
const name = import_getters.getters.nodeClassDescription.getName(node);
|
||||
if (!name)
|
||||
return;
|
||||
if (!name.value.endsWith("Trigger")) {
|
||||
const suffixed = `${name.value}Trigger`;
|
||||
const fixed = import_utils.utils.keyValue("name", suffixed);
|
||||
context.report({
|
||||
messageId: "fixInputs",
|
||||
node: name.ast,
|
||||
fix: (fixer) => fixer.replaceText(name.ast, fixed)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
72
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-non-core-color-present.js
generated
vendored
Normal file
72
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-non-core-color-present.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_non_core_color_present_exports = {};
|
||||
__export(node_class_description_non_core_color_present_exports, {
|
||||
default: () => node_class_description_non_core_color_present_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_non_core_color_present_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var node_class_description_non_core_color_present_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`color` in node class description is deprecated and must not be present, except for nodes whose icon is a Font Awesome icon - usually core nodes.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
removeColor: "Remove `color` property [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const icon = import_getters.getters.nodeClassDescription.getIcon(node);
|
||||
if (icon?.value.startsWith("fa:"))
|
||||
return;
|
||||
const defaults = import_getters.getters.nodeClassDescription.getDefaults(node);
|
||||
if (!defaults)
|
||||
return;
|
||||
if (defaults.ast.type === import_utils2.AST_NODE_TYPES.Property && defaults.ast.value.type === import_utils2.AST_NODE_TYPES.ObjectExpression) {
|
||||
const colorProperty = defaults.ast.value.properties.find(
|
||||
(property) => {
|
||||
return property.type === import_utils2.AST_NODE_TYPES.Property && property.key.type === import_utils2.AST_NODE_TYPES.Identifier && property.key.name === "color";
|
||||
}
|
||||
);
|
||||
if (!colorProperty)
|
||||
return;
|
||||
const rangeToRemove = import_utils.utils.getRangeToRemove({ ast: colorProperty });
|
||||
context.report({
|
||||
messageId: "removeColor",
|
||||
node: colorProperty,
|
||||
fix: (fixer) => fixer.removeRange(rangeToRemove)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
83
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-outputs-wrong.js
generated
vendored
Normal file
83
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-class-description-outputs-wrong.js
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_class_description_outputs_wrong_exports = {};
|
||||
__export(node_class_description_outputs_wrong_exports, {
|
||||
default: () => node_class_description_outputs_wrong_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_class_description_outputs_wrong_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_class_description_outputs_wrong_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The number of `outputs` in node class description for any node must be one, or two for If node, or four for Switch node.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
fixOutputs: `Replace with "['main']" [autofixable]`,
|
||||
fixOutputsIf: `Replace with "['main', 'main']" [autofixable]`,
|
||||
fixOutputsSwitch: `Replace with "['main', 'main', 'main', 'main']" [autofixable]`
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const outputs = import_getters.getters.nodeClassDescription.getOutputs(node);
|
||||
if (!outputs)
|
||||
return;
|
||||
const inputsTotal = outputs.value.length;
|
||||
const name = import_getters.getters.nodeClassDescription.getName(node);
|
||||
if (!name)
|
||||
return;
|
||||
if (name.value === "if" && inputsTotal !== 2) {
|
||||
context.report({
|
||||
messageId: "fixOutputsIf",
|
||||
node: outputs.ast,
|
||||
fix: (fixer) => fixer.replaceText(outputs.ast, "inputs: ['main', 'main']")
|
||||
});
|
||||
}
|
||||
if (name.value === "switch" && inputsTotal !== 4) {
|
||||
context.report({
|
||||
messageId: "fixOutputsSwitch",
|
||||
node: outputs.ast,
|
||||
fix: (fixer) => fixer.replaceText(
|
||||
outputs.ast,
|
||||
"inputs: ['main', 'main', 'main', 'main']"
|
||||
)
|
||||
});
|
||||
}
|
||||
if (inputsTotal !== 1 || inputsTotal === 1 && outputs.value[0] !== "main") {
|
||||
context.report({
|
||||
messageId: "fixOutputs",
|
||||
node: outputs.ast,
|
||||
fix: (fixer) => fixer.replaceText(outputs.ast, "outputs: ['main']")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
58
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-dirname-against-convention.js
generated
vendored
Normal file
58
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-dirname-against-convention.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_dirname_against_convention_exports = {};
|
||||
__export(node_dirname_against_convention_exports, {
|
||||
default: () => node_dirname_against_convention_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_dirname_against_convention_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var node_dirname_against_convention_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "Node dirname must match node filename, excluding the filename suffix. Example: `Test` node dirname matches `Test` section of `Test.node.ts` node filename.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
renameDir: "Rename node dir to {{ expected }} [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ClassDeclaration() {
|
||||
const filepath = context.getFilename();
|
||||
if (!filepath.endsWith(".node.ts"))
|
||||
return;
|
||||
const [filename, parentDir] = filepath.replace(/\\/g, "/").split("/").reverse().map((i) => i.replace("trigger", ""));
|
||||
const expected = filename.replace(".node.ts", "");
|
||||
if (!expected.toLowerCase().includes(parentDir.toLowerCase())) {
|
||||
const topOfFile = { line: 1, column: 1 };
|
||||
context.report({
|
||||
messageId: "renameDir",
|
||||
loc: { start: topOfFile, end: topOfFile },
|
||||
data: { expected }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
75
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-execute-block-double-assertion-for-items.js
generated
vendored
Normal file
75
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-execute-block-double-assertion-for-items.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_execute_block_double_assertion_for_items_exports = {};
|
||||
__export(node_execute_block_double_assertion_for_items_exports, {
|
||||
default: () => node_execute_block_double_assertion_for_items_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_execute_block_double_assertion_for_items_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_utils2 = require("../ast/utils");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_execute_block_double_assertion_for_items_default = import_utils2.utils.createRule({
|
||||
name: import_utils2.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "In the `execute()` method there is no need to double assert the type of `items.length`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
removeDoubleAssertion: "Remove double assertion [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
MethodDefinition(node) {
|
||||
if (!import_utils2.utils.isNodeFile(context.getFilename()))
|
||||
return;
|
||||
const executeContent = import_getters.getters.nodeExecuteBlock.getExecuteContent(node);
|
||||
if (!executeContent)
|
||||
return;
|
||||
const init = getDoublyAssertedDeclarationInit(executeContent);
|
||||
if (init) {
|
||||
context.report({
|
||||
messageId: "removeDoubleAssertion",
|
||||
node: init,
|
||||
fix: (fixer) => fixer.replaceText(init, "items.length")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getDoublyAssertedDeclarationInit(executeMethod) {
|
||||
for (const node of executeMethod.body) {
|
||||
if (node.type === import_utils.AST_NODE_TYPES.VariableDeclaration) {
|
||||
for (const declaration of node.declarations) {
|
||||
if (!declaration.init)
|
||||
continue;
|
||||
if (declaration.init.type === import_utils.AST_NODE_TYPES.TSAsExpression && declaration.init.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSNumberKeyword && declaration.init.expression.type === import_utils.AST_NODE_TYPES.TSAsExpression && declaration.init.expression.typeAnnotation.type === import_utils.AST_NODE_TYPES.TSUnknownKeyword && declaration.init.expression.expression.type === import_utils.AST_NODE_TYPES.MemberExpression && declaration.init.expression.expression.object.type === import_utils.AST_NODE_TYPES.Identifier && declaration.init.expression.expression.object.name === "items" && declaration.init.expression.expression.property.type === import_utils.AST_NODE_TYPES.Identifier && declaration.init.expression.expression.property.name === "length") {
|
||||
return declaration.init;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
132
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-execute-block-error-missing-item-index.js
generated
vendored
Normal file
132
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-execute-block-error-missing-item-index.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_execute_block_error_missing_item_index_exports = {};
|
||||
__export(node_execute_block_error_missing_item_index_exports, {
|
||||
default: () => node_execute_block_error_missing_item_index_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_execute_block_error_missing_item_index_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var import_constants = require("../constants");
|
||||
const {
|
||||
nodeExecuteBlock: { getOperationConsequents, collectConsequents }
|
||||
} = import_getters.getters;
|
||||
var node_execute_block_error_missing_item_index_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "In the operations in the `execute()` method in a node, `NodeApiError` and `NodeOperationError` must specify `itemIndex` as the third argument.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addItemIndexSameName: "Add `{ itemIndex }` as third argument [non-autofixable]",
|
||||
addItemIndexDifferentName: "Add `{ itemIndex: {{ indexName }} }` as third argument [non-autofixable]",
|
||||
changeThirdArgSameName: "Change third argument to `{ itemIndex }` [non-autofixable]",
|
||||
changeThirdArgDifferentName: "Change third argument to `{ itemIndex: {{ indexName }} }` [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
MethodDefinition(node) {
|
||||
if (!import_utils.utils.isNodeFile(context.getFilename()))
|
||||
return;
|
||||
const result = getOperationConsequents(node, { filter: "all" });
|
||||
if (!result)
|
||||
return;
|
||||
const {
|
||||
operationConsequents: opConsequents,
|
||||
inputItemsIndexName: indexName
|
||||
} = result;
|
||||
const throwStatements = findThrowStatements(opConsequents);
|
||||
for (const statement of throwStatements) {
|
||||
if (statement.argument === null || // @ts-ignore @TODO: This does not typecheck but AST check is correct
|
||||
statement.argument.type !== import_utils2.AST_NODE_TYPES.NewExpression) {
|
||||
continue;
|
||||
}
|
||||
if (!isNodeErrorType(statement.argument))
|
||||
continue;
|
||||
const { arguments: errorArguments } = statement.argument;
|
||||
if (errorArguments.length !== 3 && indexName === "itemIndex") {
|
||||
context.report({
|
||||
messageId: "addItemIndexSameName",
|
||||
node: statement
|
||||
});
|
||||
continue;
|
||||
}
|
||||
if (errorArguments.length !== 3 && indexName !== "itemIndex") {
|
||||
context.report({
|
||||
messageId: "addItemIndexDifferentName",
|
||||
node: statement,
|
||||
data: { indexName }
|
||||
});
|
||||
continue;
|
||||
}
|
||||
const [thirdArg] = [...errorArguments].reverse();
|
||||
if (!isItemIndexArg(thirdArg) && indexName === "itemIndex") {
|
||||
context.report({
|
||||
messageId: "changeThirdArgSameName",
|
||||
node: statement
|
||||
});
|
||||
continue;
|
||||
}
|
||||
if (!isItemIndexArg(thirdArg) && indexName !== "itemIndex") {
|
||||
context.report({
|
||||
messageId: "changeThirdArgDifferentName",
|
||||
node: statement,
|
||||
data: { indexName }
|
||||
});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function findIfStatements(consequent) {
|
||||
return consequent.body.filter(
|
||||
(statement) => statement.type === import_utils2.AST_NODE_TYPES.IfStatement
|
||||
);
|
||||
}
|
||||
const isThrowStatement = (node) => node.type === import_utils2.AST_NODE_TYPES.ThrowStatement;
|
||||
function findThrowStatements(operationConsequents) {
|
||||
return operationConsequents.reduce(
|
||||
(acc, operationConsequent) => {
|
||||
const topLevelThrows = operationConsequent.body.filter(isThrowStatement);
|
||||
const throwStatements = [...topLevelThrows];
|
||||
const nestedIfs = findIfStatements(operationConsequent);
|
||||
const nestedConsequents = nestedIfs.flatMap((s) => collectConsequents(s));
|
||||
const nestedThrows = nestedConsequents.flatMap(
|
||||
(c) => c.body.filter(isThrowStatement)
|
||||
);
|
||||
throwStatements.push(...nestedThrows);
|
||||
return [...acc, ...throwStatements];
|
||||
},
|
||||
[]
|
||||
);
|
||||
}
|
||||
function isNodeErrorType(newExpressionArg) {
|
||||
return newExpressionArg.callee.type === import_utils2.AST_NODE_TYPES.Identifier && import_constants.N8N_NODE_ERROR_TYPES.includes(newExpressionArg.callee.name);
|
||||
}
|
||||
function isItemIndexArg(node) {
|
||||
return node.type === import_utils2.AST_NODE_TYPES.ObjectExpression && node.properties.length === 1 && node.properties[0].type === import_utils2.AST_NODE_TYPES.Property && node.properties[0].key.type === import_utils2.AST_NODE_TYPES.Identifier && node.properties[0].key.name === "itemIndex";
|
||||
}
|
||||
79
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-execute-block-missing-continue-on-fail.js
generated
vendored
Normal file
79
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-execute-block-missing-continue-on-fail.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_execute_block_missing_continue_on_fail_exports = {};
|
||||
__export(node_execute_block_missing_continue_on_fail_exports, {
|
||||
default: () => node_execute_block_missing_continue_on_fail_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_execute_block_missing_continue_on_fail_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_utils2 = require("../ast/utils");
|
||||
var node_execute_block_missing_continue_on_fail_default = import_utils2.utils.createRule({
|
||||
name: import_utils2.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `execute()` method in a node must implement `continueOnFail` in a try-catch block.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
addContinueOnFail: "Implement 'continueOnFail' [non-autofixable]"
|
||||
// unknowable implementation
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
MethodDefinition(node) {
|
||||
if (!import_utils2.utils.isNodeFile(context.getFilename()))
|
||||
return;
|
||||
const executeForLoop = getExecuteForLoop(node);
|
||||
if (!executeForLoop)
|
||||
return;
|
||||
const hasContinueOnFail = executeForLoop.body.some((e) => {
|
||||
const tryCatch = getTryCatch(e);
|
||||
if (!tryCatch)
|
||||
return;
|
||||
return tryCatch.body.some(isContinueOnFail);
|
||||
});
|
||||
if (!hasContinueOnFail) {
|
||||
context.report({
|
||||
messageId: "addContinueOnFail",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getExecuteForLoop(node) {
|
||||
if (node.key.type === import_utils.AST_NODE_TYPES.Identifier && node.key.name === "execute" && node.value.type === import_utils.AST_NODE_TYPES.FunctionExpression && node.value.body.type === import_utils.AST_NODE_TYPES.BlockStatement && node.value.body.body.length === 1 && node.value.body.body[0].type === import_utils.AST_NODE_TYPES.ForStatement && node.value.body.body[0].body.type === import_utils.AST_NODE_TYPES.BlockStatement) {
|
||||
return node.value.body.body[0].body;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getTryCatch(node) {
|
||||
if (node.type === import_utils.AST_NODE_TYPES.TryStatement && node.handler !== null && node.handler.body.type === import_utils.AST_NODE_TYPES.BlockStatement) {
|
||||
return node.handler.body;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function isContinueOnFail(node) {
|
||||
return node.type === import_utils.AST_NODE_TYPES.IfStatement && node.test.type === import_utils.AST_NODE_TYPES.CallExpression && node.test.callee.type === import_utils.AST_NODE_TYPES.MemberExpression && node.test.callee.object.type === import_utils.AST_NODE_TYPES.ThisExpression && node.test.callee.property.type === import_utils.AST_NODE_TYPES.Identifier && node.test.callee.property.name === "continueOnFail";
|
||||
}
|
||||
58
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-execute-block-wrong-error-thrown.js
generated
vendored
Normal file
58
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-execute-block-wrong-error-thrown.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_execute_block_wrong_error_thrown_exports = {};
|
||||
__export(node_execute_block_wrong_error_thrown_exports, {
|
||||
default: () => node_execute_block_wrong_error_thrown_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_execute_block_wrong_error_thrown_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_utils2 = require("../ast/utils");
|
||||
var import_constants = require("../constants");
|
||||
var node_execute_block_wrong_error_thrown_default = import_utils2.utils.createRule({
|
||||
name: import_utils2.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "The `execute()` method in a node may only throw `ApplicationError`, NodeApiError`, `NodeOperationError`, or `TriggerCloseError`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
useProperError: "Use `ApplicationError`, NodeApiError`, `NodeOperationError`, or `TriggerCloseError` [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
"ThrowStatement > NewExpression"(node) {
|
||||
if (!import_utils2.utils.isNodeFile(context.getFilename()))
|
||||
return;
|
||||
if (node.callee.type !== import_utils.AST_NODE_TYPES.Identifier)
|
||||
return;
|
||||
const { name: errorType } = node.callee;
|
||||
if (!import_constants.N8N_NODE_ERROR_TYPES.includes(errorType)) {
|
||||
context.report({
|
||||
messageId: "useProperError",
|
||||
node
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-filename-against-convention.js
generated
vendored
Normal file
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-filename-against-convention.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_filename_against_convention_exports = {};
|
||||
__export(node_filename_against_convention_exports, {
|
||||
default: () => node_filename_against_convention_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_filename_against_convention_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_filename_against_convention_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`name` in node class description must match the node filename without the `.node.ts` suffix. Example: If `description.name` is `Test`, then filename must be `Test.node.ts`. Version suffix in filename (e.g. `-V2`) is disregarded.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
renameFile: "Rename file to {{ expected }} [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeClassDescription(node))
|
||||
return;
|
||||
const name = import_getters.getters.nodeClassDescription.getName(node);
|
||||
if (!name)
|
||||
return;
|
||||
const actual = import_utils.utils.getNodeFilename(context.getFilename().replace(/\\/g, "/")).replace(/V\d+\.node\.ts$/, ".node.ts");
|
||||
const expected = import_utils.utils.toExpectedNodeFilename(name.value);
|
||||
if (actual !== expected) {
|
||||
const topOfFile = { line: 1, column: 1 };
|
||||
context.report({
|
||||
messageId: "renameFile",
|
||||
loc: { start: topOfFile, end: topOfFile },
|
||||
data: { expected }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
81
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-array-type-assertion.js
generated
vendored
Normal file
81
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-array-type-assertion.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_array_type_assertion_exports = {};
|
||||
__export(node_param_array_type_assertion_exports, {
|
||||
default: () => node_param_array_type_assertion_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_array_type_assertion_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_utils2 = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var node_param_array_type_assertion_default = import_utils2.utils.createRule({
|
||||
name: import_utils2.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "Array of node parameters must be typed, not type-asserted.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
typeArray: "Use ': INodeProperties[]' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
TSAsExpression(node) {
|
||||
if (containsArrayOfNodeParams(node)) {
|
||||
if (node.parent?.type !== import_utils.AST_NODE_TYPES.VariableDeclarator || node.parent?.id.type !== import_utils.AST_NODE_TYPES.Identifier) {
|
||||
return;
|
||||
}
|
||||
const rangeToRemove = import_utils2.utils.getRangeToRemove({
|
||||
ast: node.typeAnnotation
|
||||
});
|
||||
const { range } = node.parent.id;
|
||||
if (!range)
|
||||
return null;
|
||||
const indentation = getTrailingBracketIndentation(node);
|
||||
context.report({
|
||||
messageId: "typeArray",
|
||||
node,
|
||||
fix: (fixer) => {
|
||||
return [
|
||||
fixer.replaceTextRange(rangeToRemove, indentation),
|
||||
fixer.insertTextAfterRange(range, ": INodeProperties[]")
|
||||
];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function containsArrayOfNodeParams(node) {
|
||||
if (node.expression.type !== import_utils.AST_NODE_TYPES.ArrayExpression || node.expression.elements.length === 0) {
|
||||
return false;
|
||||
}
|
||||
return node.expression.elements.every((element) => {
|
||||
return element?.type === import_utils.AST_NODE_TYPES.ObjectExpression && import_identifiers.id.isNodeParameter(element);
|
||||
});
|
||||
}
|
||||
function getTrailingBracketIndentation(node) {
|
||||
return " ".repeat(node.expression.loc.end.column - 1);
|
||||
}
|
||||
75
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-collection-type-item-required.js
generated
vendored
Normal file
75
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-collection-type-item-required.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_collection_type_item_required_exports = {};
|
||||
__export(node_param_collection_type_item_required_exports, {
|
||||
default: () => node_param_collection_type_item_required_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_collection_type_item_required_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var import_utils2 = require("@typescript-eslint/utils");
|
||||
var node_param_collection_type_item_required_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `Items in collection-type node parameter must not have a \`required\` property.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
removeRequired: "Remove `required: true` [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isCollectionType(node))
|
||||
return;
|
||||
const options = import_getters.getters.nodeParam.getCollectionOptions(node);
|
||||
if (!options)
|
||||
return;
|
||||
if (options.value.every((param) => param.required === void 0)) {
|
||||
return;
|
||||
}
|
||||
if (options.ast.value.type !== import_utils2.AST_NODE_TYPES.ArrayExpression)
|
||||
return;
|
||||
const [objectExpression] = options.ast.value.elements;
|
||||
const requiredTrueProperties = objectExpression.properties.filter(
|
||||
(property) => {
|
||||
return property.type === import_utils2.AST_NODE_TYPES.Property && property.key.type === import_utils2.AST_NODE_TYPES.Identifier && property.key.name === "required" && property.value.type === import_utils2.AST_NODE_TYPES.Literal && property.value.value === true;
|
||||
}
|
||||
);
|
||||
for (const property of requiredTrueProperties) {
|
||||
const rangeToRemove = import_utils.utils.getRangeToRemove({ ast: property });
|
||||
context.report({
|
||||
messageId: "removeRequired",
|
||||
node: property,
|
||||
fix: (fixer) => fixer.removeRange(rangeToRemove)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
71
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-collection-type-unsorted-items.js
generated
vendored
Normal file
71
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-collection-type-unsorted-items.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_collection_type_unsorted_items_exports = {};
|
||||
__export(node_param_collection_type_unsorted_items_exports, {
|
||||
default: () => node_param_collection_type_unsorted_items_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_collection_type_unsorted_items_exports);
|
||||
var import_constants = require("../constants");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_collection_type_unsorted_items_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `Items in collection-type node parameter must be alphabetized by \`name\` if ${import_constants.MIN_ITEMS_TO_ALPHABETIZE_SPELLED_OUT} or more than ${import_constants.MIN_ITEMS_TO_ALPHABETIZE_SPELLED_OUT}.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
sortItems: "Alphabetize by 'name'. Order: {{ displayOrder }} [non-autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isCollectionType(node))
|
||||
return;
|
||||
const options = import_getters.getters.nodeParam.getCollectionOptions(node);
|
||||
if (!options)
|
||||
return;
|
||||
if (options.value.length < import_constants.MIN_ITEMS_TO_ALPHABETIZE)
|
||||
return;
|
||||
const sortedOptions = [...options.value].sort(
|
||||
import_utils.utils.optionComparatorForCollection
|
||||
);
|
||||
if (!import_utils.utils.areIdenticallySortedOptionsForCollection(
|
||||
options.value,
|
||||
sortedOptions
|
||||
)) {
|
||||
const displayOrder = import_utils.utils.toDisplayOrderForCollection(sortedOptions);
|
||||
context.report({
|
||||
messageId: "sortItems",
|
||||
node: options.ast,
|
||||
data: { displayOrder }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-color-type-unused.js
generated
vendored
Normal file
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-color-type-unused.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_color_type_unused_exports = {};
|
||||
__export(node_param_color_type_unused_exports, {
|
||||
default: () => node_param_color_type_unused_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_color_type_unused_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_color_type_unused_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`string`-type color-related node parameter must be `color`-type.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
useColorParam: "Use 'color' for 'type' [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
const name = import_getters.getters.nodeParam.getName(node);
|
||||
if (!name)
|
||||
return;
|
||||
const type = import_getters.getters.nodeParam.getType(node);
|
||||
if (!type)
|
||||
return;
|
||||
if (/colo(u?)r/i.test(name.value) && type.value === "string") {
|
||||
context.report({
|
||||
messageId: "useColorParam",
|
||||
node: type.ast,
|
||||
fix: (fixer) => fixer.replaceText(type.ast, "type: 'color'")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
94
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-missing.js
generated
vendored
Normal file
94
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-missing.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_missing_exports = {};
|
||||
__export(node_param_default_missing_exports, {
|
||||
default: () => node_param_default_missing_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_missing_exports);
|
||||
var import_utils = require("@typescript-eslint/utils");
|
||||
var import_utils2 = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_missing_default = import_utils2.utils.createRule({
|
||||
name: import_utils2.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` must be present in a node parameter, except in node parameters under `modes`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
addDefault: "Add a default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node, { skipKeys: ["default"] }))
|
||||
return;
|
||||
if (node.parent?.parent) {
|
||||
if (node.parent.parent.type === import_utils.AST_NODE_TYPES.Property && node.parent.parent.key.type === import_utils.AST_NODE_TYPES.Identifier && node.parent.parent.key.name === "modes") {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const type = import_getters.getters.nodeParam.getType(node);
|
||||
if (!type)
|
||||
return;
|
||||
const fixValues = {
|
||||
string: "",
|
||||
number: 0,
|
||||
boolean: false,
|
||||
options: getDefaultForOptionsTypeParam(node),
|
||||
multiOptions: [],
|
||||
collection: {},
|
||||
fixedCollection: {}
|
||||
};
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (_default?.isUnparseable)
|
||||
return;
|
||||
if (!_default) {
|
||||
const { range, indentation } = import_utils2.utils.getInsertionArgs(type);
|
||||
context.report({
|
||||
messageId: "addDefault",
|
||||
node,
|
||||
fix: (fixer) => fixer.insertTextAfterRange(
|
||||
range,
|
||||
`
|
||||
${indentation}default: '${fixValues[type.value]}',`
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
function getDefaultForOptionsTypeParam(node) {
|
||||
const zerothOption = getZerothOption(node);
|
||||
if (!zerothOption)
|
||||
return "";
|
||||
return zerothOption.value;
|
||||
}
|
||||
function getZerothOption(nodeParamArg) {
|
||||
if (!import_identifiers.id.nodeParam.isOptionsType(nodeParamArg))
|
||||
return null;
|
||||
return import_getters.getters.nodeParam.getOptions(nodeParamArg)?.value[0] ?? null;
|
||||
}
|
||||
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-boolean.js
generated
vendored
Normal file
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-boolean.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_boolean_exports = {};
|
||||
__export(node_param_default_wrong_for_boolean_exports, {
|
||||
default: () => node_param_default_wrong_for_boolean_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_boolean_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_boolean_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` for boolean-type node parameter must be a boolean.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
setBooleanDefault: "Set a boolean default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isBooleanType(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
if (typeof _default.value !== "boolean") {
|
||||
context.report({
|
||||
messageId: "setBooleanDefault",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, "default: false")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-collection.js
generated
vendored
Normal file
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-collection.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_collection_exports = {};
|
||||
__export(node_param_default_wrong_for_collection_exports, {
|
||||
default: () => node_param_default_wrong_for_collection_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_collection_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_collection_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` for collection-type node parameter must be an object.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
setObjectDefault: "Set an object default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isCollectionType(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
if (!Array.isArray(_default.value) && _default.value !== null && typeof _default.value !== "object") {
|
||||
context.report({
|
||||
messageId: "setObjectDefault",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, "default: {}")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-fixed-collection.js
generated
vendored
Normal file
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-fixed-collection.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_fixed_collection_exports = {};
|
||||
__export(node_param_default_wrong_for_fixed_collection_exports, {
|
||||
default: () => node_param_default_wrong_for_fixed_collection_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_fixed_collection_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_fixed_collection_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` for fixed-collection-type node parameter must be an object.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
setObjectDefault: "Set an object default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isFixedCollectionType(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
if (!Array.isArray(_default.value) && _default.value !== null && typeof _default.value !== "object") {
|
||||
context.report({
|
||||
messageId: "setObjectDefault",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, "default: {}")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
66
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-limit.js
generated
vendored
Normal file
66
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-limit.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_limit_exports = {};
|
||||
__export(node_param_default_wrong_for_limit_exports, {
|
||||
default: () => node_param_default_wrong_for_limit_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_limit_exports);
|
||||
var import_constants = require("../constants");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_limit_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `\`default\` for a Limit node parameter must be \`${import_constants.LIMIT_NODE_PARAMETER.DEFAULT_VALUE}\`.`,
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
setLimitDefault: `Set ${import_constants.LIMIT_NODE_PARAMETER.DEFAULT_VALUE} as default [autofixable]`
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isLimit(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
if (_default.value !== import_constants.LIMIT_NODE_PARAMETER.DEFAULT_VALUE) {
|
||||
context.report({
|
||||
messageId: "setLimitDefault",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(
|
||||
_default.ast,
|
||||
`default: ${import_constants.LIMIT_NODE_PARAMETER.DEFAULT_VALUE}`
|
||||
)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-multi-options.js
generated
vendored
Normal file
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-multi-options.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_multi_options_exports = {};
|
||||
__export(node_param_default_wrong_for_multi_options_exports, {
|
||||
default: () => node_param_default_wrong_for_multi_options_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_multi_options_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_multi_options_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` for a multi-options-type node parameter must be an array.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
setArrayDefault: "Set an array as default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isMultiOptionsType(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
if (!Array.isArray(_default.value)) {
|
||||
context.report({
|
||||
messageId: "setArrayDefault",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, `default: []`)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-number.js
generated
vendored
Normal file
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-number.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_number_exports = {};
|
||||
__export(node_param_default_wrong_for_number_exports, {
|
||||
default: () => node_param_default_wrong_for_number_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_number_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_number_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` for a number-type node parameter must be a number, except for a number-type ID parameter.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
setNumberDefault: "Set a number default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isNumericType(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
if (!Boolean(_default.value))
|
||||
return;
|
||||
if (typeof _default.value !== "number") {
|
||||
context.report({
|
||||
messageId: "setNumberDefault",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, "default: 0")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
89
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-options.js
generated
vendored
Normal file
89
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-options.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_options_exports = {};
|
||||
__export(node_param_default_wrong_for_options_exports, {
|
||||
default: () => node_param_default_wrong_for_options_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_options_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_options_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` for an options-type node parameter must be one of the options.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
chooseOption: "Set one of {{ eligibleOptions }} as default [autofixable]",
|
||||
setEmptyString: "Set an empty string as default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isOptionsType(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
const options = import_getters.getters.nodeParam.getOptions(node);
|
||||
if (!options && _default.value !== "") {
|
||||
context.report({
|
||||
messageId: "setEmptyString",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, "default: ''")
|
||||
});
|
||||
}
|
||||
if (!options)
|
||||
return;
|
||||
if (options.hasPropertyPointingToIdentifier || // e.g. `value: myVar`
|
||||
options.hasPropertyPointingToMemberExpression) {
|
||||
return;
|
||||
}
|
||||
const eligibleOptions = options.value.reduce(
|
||||
// @ts-ignore @TODO
|
||||
(acc, option) => {
|
||||
return acc.push(option.value), acc;
|
||||
},
|
||||
[]
|
||||
);
|
||||
if (!eligibleOptions.includes(_default.value)) {
|
||||
const zerothOption = eligibleOptions[0];
|
||||
const fixed = `default: ${typeof zerothOption === "string" ? `'${zerothOption}'` : zerothOption}`;
|
||||
context.report({
|
||||
messageId: "chooseOption",
|
||||
data: {
|
||||
eligibleOptions: eligibleOptions.join(" or ")
|
||||
},
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, fixed)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-simplify.js
generated
vendored
Normal file
62
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-simplify.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_simplify_exports = {};
|
||||
__export(node_param_default_wrong_for_simplify_exports, {
|
||||
default: () => node_param_default_wrong_for_simplify_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_simplify_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_simplify_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` for a Simplify node parameter must be `true`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
setTrueDefault: "Set 'true' as default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isSimplify(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
if (_default.value === false) {
|
||||
context.report({
|
||||
messageId: "setTrueDefault",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, "default: true")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
68
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-string.js
generated
vendored
Normal file
68
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-default-wrong-for-string.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_default_wrong_for_string_exports = {};
|
||||
__export(node_param_default_wrong_for_string_exports, {
|
||||
default: () => node_param_default_wrong_for_string_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_default_wrong_for_string_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_default_wrong_for_string_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`default` for a string-type node parameter must be a string, unless `typeOptions.multipleValues` is set to `true`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
setStringDefault: "Set a string default [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isStringType(node))
|
||||
return;
|
||||
const _default = import_getters.getters.nodeParam.getDefault(node);
|
||||
if (!_default)
|
||||
return;
|
||||
if (_default?.isUnparseable)
|
||||
return;
|
||||
const typeOptions = import_getters.getters.nodeParam.getTypeOptions(node);
|
||||
if (typeOptions?.value.multipleValues && Array.isArray(_default.value)) {
|
||||
return;
|
||||
}
|
||||
if (typeof _default.value !== "string") {
|
||||
context.report({
|
||||
messageId: "setStringDefault",
|
||||
node: _default.ast,
|
||||
fix: (fixer) => fixer.replaceText(_default.ast, "default: ''")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-description-boolean-without-whether.js
generated
vendored
Normal file
63
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-description-boolean-without-whether.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_description_boolean_without_whether_exports = {};
|
||||
__export(node_param_description_boolean_without_whether_exports, {
|
||||
default: () => node_param_description_boolean_without_whether_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_description_boolean_without_whether_exports);
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_description_boolean_without_whether_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "`description` in a boolean node parameter must start with `Whether`.",
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
useWhether: "Start with 'Whether' [non-autofixable]"
|
||||
// unpredictable input, unknowable description
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node))
|
||||
return;
|
||||
if (!import_identifiers.id.nodeParam.isBooleanType(node))
|
||||
return;
|
||||
if (import_identifiers.id.nodeParam.isSimplify(node))
|
||||
return;
|
||||
const description = import_getters.getters.nodeParam.getDescription(node);
|
||||
if (!description)
|
||||
return;
|
||||
if (!description.value.startsWith("Whether")) {
|
||||
context.report({
|
||||
messageId: "useWhether",
|
||||
node: description.ast
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
68
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-description-comma-separated-hyphen.js
generated
vendored
Normal file
68
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-description-comma-separated-hyphen.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_description_comma_separated_hyphen_exports = {};
|
||||
__export(node_param_description_comma_separated_hyphen_exports, {
|
||||
default: () => node_param_description_comma_separated_hyphen_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_description_comma_separated_hyphen_exports);
|
||||
var import_constants = require("../constants");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_description_comma_separated_hyphen_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `The string \`comma-separated\` in \`description\` must be hyphenated. ${import_constants.DOCUMENTATION.APPLICABLE_BY_EXTENSION_TO_DESCRIPTION_IN_OPTION}`,
|
||||
recommended: "strict"
|
||||
},
|
||||
fixable: "code",
|
||||
schema: [],
|
||||
messages: {
|
||||
hyphenate: "Hyphenate [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node) && !import_identifiers.id.isOption(node))
|
||||
return;
|
||||
const description = import_getters.getters.nodeParam.getDescription(node);
|
||||
if (!description)
|
||||
return;
|
||||
if (description.value.toLowerCase().includes("omma separated")) {
|
||||
const hyphenated = description.value.replace(
|
||||
/omma separated/g,
|
||||
"omma-separated"
|
||||
);
|
||||
const fixed = import_utils.utils.keyValue("description", hyphenated, {
|
||||
backtickedValue: import_utils.utils.isMultiline(description)
|
||||
});
|
||||
context.report({
|
||||
messageId: "hyphenate",
|
||||
node: description.ast,
|
||||
fix: (fixer) => fixer.replaceText(description.ast, fixed)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-description-empty-string.js
generated
vendored
Normal file
64
node_modules/eslint-plugin-n8n-nodes-base/dist/lib/rules/node-param-description-empty-string.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_param_description_empty_string_exports = {};
|
||||
__export(node_param_description_empty_string_exports, {
|
||||
default: () => node_param_description_empty_string_default
|
||||
});
|
||||
module.exports = __toCommonJS(node_param_description_empty_string_exports);
|
||||
var import_constants = require("../constants");
|
||||
var import_utils = require("../ast/utils");
|
||||
var import_identifiers = require("../ast/identifiers");
|
||||
var import_getters = require("../ast/getters");
|
||||
var node_param_description_empty_string_default = import_utils.utils.createRule({
|
||||
name: import_utils.utils.getRuleName(module),
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: `\`description\` in node parameter or in option in options-type and multi-options-type param must be filled out or removed. ${import_constants.DOCUMENTATION.APPLICABLE_BY_EXTENSION_TO_DESCRIPTION_IN_OPTION}`,
|
||||
recommended: "strict"
|
||||
},
|
||||
schema: [],
|
||||
fixable: "code",
|
||||
messages: {
|
||||
fillOutOrRemoveDescription: "Fill out or remove description [autofixable]"
|
||||
}
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return {
|
||||
ObjectExpression(node) {
|
||||
if (!import_identifiers.id.isNodeParameter(node) && !import_identifiers.id.isOption(node))
|
||||
return;
|
||||
if (import_getters.getters.nodeParam.getLoadOptionsMethod(node))
|
||||
return;
|
||||
const description = import_getters.getters.nodeParam.getDescription(node);
|
||||
if (!description)
|
||||
return;
|
||||
if (description.value === "") {
|
||||
const rangeToRemove = import_utils.utils.getRangeToRemove(description);
|
||||
context.report({
|
||||
messageId: "fillOutOrRemoveDescription",
|
||||
node: description.ast,
|
||||
fix: (fixer) => fixer.removeRange(rangeToRemove)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user