first commit
This commit is contained in:
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
|
||||
});
|
||||
Reference in New Issue
Block a user