first commit
This commit is contained in:
11
node_modules/@n8n/node-cli/dist/utils/ast.d.ts
generated
vendored
Normal file
11
node_modules/@n8n/node-cli/dist/utils/ast.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { type ClassDeclaration, type ObjectLiteralExpression } from 'ts-morph';
|
||||
export declare const loadSingleSourceFile: (path: string) => import("ts-morph").SourceFile;
|
||||
export declare const updateStringProperty: ({ obj, key, value, }: {
|
||||
obj: ObjectLiteralExpression | ClassDeclaration;
|
||||
key: string;
|
||||
value: string;
|
||||
}) => void;
|
||||
export declare const getChildObjectLiteral: ({ obj, key, }: {
|
||||
obj: ObjectLiteralExpression;
|
||||
key: string;
|
||||
}) => ObjectLiteralExpression;
|
||||
32
node_modules/@n8n/node-cli/dist/utils/ast.js
generated
vendored
Normal file
32
node_modules/@n8n/node-cli/dist/utils/ast.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getChildObjectLiteral = exports.updateStringProperty = exports.loadSingleSourceFile = void 0;
|
||||
const ts_morph_1 = require("ts-morph");
|
||||
const loadSingleSourceFile = (path) => {
|
||||
const project = new ts_morph_1.Project({
|
||||
skipFileDependencyResolution: true,
|
||||
});
|
||||
return project.addSourceFileAtPath(path);
|
||||
};
|
||||
exports.loadSingleSourceFile = loadSingleSourceFile;
|
||||
const setStringInitializer = (prop, value) => {
|
||||
prop.getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.StringLiteral).setLiteralValue(value);
|
||||
};
|
||||
const updateStringProperty = ({ obj, key, value, }) => {
|
||||
const prop = obj.getPropertyOrThrow(key);
|
||||
if (prop.isKind(ts_morph_1.SyntaxKind.PropertyAssignment)) {
|
||||
setStringInitializer(prop.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyAssignment), value);
|
||||
}
|
||||
else if (prop.isKind(ts_morph_1.SyntaxKind.PropertyDeclaration)) {
|
||||
setStringInitializer(prop.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyDeclaration), value);
|
||||
}
|
||||
};
|
||||
exports.updateStringProperty = updateStringProperty;
|
||||
const getChildObjectLiteral = ({ obj, key, }) => {
|
||||
return obj
|
||||
.getPropertyOrThrow(key)
|
||||
.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyAssignment)
|
||||
.getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
|
||||
};
|
||||
exports.getChildObjectLiteral = getChildObjectLiteral;
|
||||
//# sourceMappingURL=ast.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/ast.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/ast.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/utils/ast.ts"],"names":[],"mappings":";;;AAAA,uCAOkB;AAEX,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,EAAE;IACpD,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC;QAC3B,4BAA4B,EAAE,IAAI;KAClC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B;AAEF,MAAM,oBAAoB,GAAG,CAAC,IAA8C,EAAE,KAAa,EAAE,EAAE;IAC9F,IAAI,CAAC,2BAA2B,CAAC,qBAAU,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AACnF,CAAC,CAAC;AAEK,MAAM,oBAAoB,GAAG,CAAC,EACpC,GAAG,EACH,GAAG,EACH,KAAK,GAC4E,EAAE,EAAE;IACrF,MAAM,IAAI,GAAG,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAEzC,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAChD,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,qBAAU,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,CAAC;IAChF,CAAC;SAAM,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACxD,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,qBAAU,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,CAAC;IACjF,CAAC;AACF,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B;AAEK,MAAM,qBAAqB,GAAG,CAAC,EACrC,GAAG,EACH,GAAG,GAC4C,EAAE,EAAE;IACnD,OAAO,GAAG;SACR,kBAAkB,CAAC,GAAG,CAAC;SACvB,aAAa,CAAC,qBAAU,CAAC,kBAAkB,CAAC;SAC5C,2BAA2B,CAAC,qBAAU,CAAC,uBAAuB,CAAC,CAAC;AACnE,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC"}
|
||||
16
node_modules/@n8n/node-cli/dist/utils/child-process.d.ts
generated
vendored
Normal file
16
node_modules/@n8n/node-cli/dist/utils/child-process.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { type StdioOptions } from 'node:child_process';
|
||||
export declare class ChildProcessError extends Error {
|
||||
code: number | null;
|
||||
signal: NodeJS.Signals | null;
|
||||
constructor(message: string, code: number | null, signal: NodeJS.Signals | null);
|
||||
}
|
||||
export declare function runCommand(cmd: string, args?: string[], opts?: {
|
||||
cwd?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
stdio?: StdioOptions;
|
||||
context?: 'local' | 'global';
|
||||
printOutput?: (options: {
|
||||
stdout: Buffer[];
|
||||
stderr: Buffer[];
|
||||
}) => void;
|
||||
}): Promise<void>;
|
||||
62
node_modules/@n8n/node-cli/dist/utils/child-process.js
generated
vendored
Normal file
62
node_modules/@n8n/node-cli/dist/utils/child-process.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ChildProcessError = void 0;
|
||||
exports.runCommand = runCommand;
|
||||
const node_child_process_1 = require("node:child_process");
|
||||
const package_manager_1 = require("./package-manager");
|
||||
class ChildProcessError extends Error {
|
||||
constructor(message, code, signal) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.signal = signal;
|
||||
}
|
||||
}
|
||||
exports.ChildProcessError = ChildProcessError;
|
||||
async function runCommand(cmd, args = [], opts = {}) {
|
||||
const packageManager = (await (0, package_manager_1.detectPackageManager)()) ?? 'npm';
|
||||
return await new Promise((resolve, reject) => {
|
||||
const options = {
|
||||
cwd: opts.cwd,
|
||||
env: { ...process.env, ...opts.env },
|
||||
stdio: opts.stdio ?? ['ignore', 'pipe', 'pipe'],
|
||||
shell: process.platform === 'win32',
|
||||
};
|
||||
const child = opts.context === 'local'
|
||||
? (0, node_child_process_1.spawn)(packageManager, ['exec', '--', cmd, ...args], options)
|
||||
: (0, node_child_process_1.spawn)(cmd, args, options);
|
||||
const stdoutBuffers = [];
|
||||
const stderrBuffers = [];
|
||||
child.stdout?.on('data', (data) => {
|
||||
stdoutBuffers.push(data);
|
||||
});
|
||||
child.stderr?.on('data', (data) => {
|
||||
stderrBuffers.push(data);
|
||||
});
|
||||
function printOutput() {
|
||||
if (opts.printOutput) {
|
||||
opts.printOutput({ stdout: stdoutBuffers, stderr: stderrBuffers });
|
||||
return;
|
||||
}
|
||||
for (const buffer of stdoutBuffers) {
|
||||
process.stdout.write(buffer);
|
||||
}
|
||||
for (const buffer of stderrBuffers) {
|
||||
process.stderr.write(buffer);
|
||||
}
|
||||
}
|
||||
child.on('error', (error) => {
|
||||
printOutput();
|
||||
reject(new ChildProcessError(error.message, null, null));
|
||||
});
|
||||
child.on('close', (code, signal) => {
|
||||
printOutput();
|
||||
if (code === 0) {
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
reject(new ChildProcessError(`${cmd} exited with code ${code}${signal ? ` (signal: ${signal})` : ''}`, code, signal));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=child-process.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/child-process.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/child-process.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":";;;AAcA,gCAoEC;AAlFD,2DAAiF;AAEjF,uDAAyD;AAEzD,MAAa,iBAAkB,SAAQ,KAAK;IAC3C,YACC,OAAe,EACR,IAAmB,EACnB,MAA6B;QAEpC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAe;QACnB,WAAM,GAAN,MAAM,CAAuB;IAGrC,CAAC;CACD;AARD,8CAQC;AAEM,KAAK,UAAU,UAAU,CAC/B,GAAW,EACX,OAAiB,EAAE,EACnB,OAMI,EAAE;IAEN,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,sCAAoB,GAAE,CAAC,IAAI,KAAK,CAAC;IAE/D,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC5C,MAAM,OAAO,GAAiB;YAC7B,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE;YACpC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;YAC/C,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO;SACnC,CAAC;QACF,MAAM,KAAK,GACV,IAAI,CAAC,OAAO,KAAK,OAAO;YACvB,CAAC,CAAC,IAAA,0BAAK,EAAC,cAAc,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC;YAC9D,CAAC,CAAC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BAChB,OAAO,EAAE,CAAC;YACX,CAAC;iBAAM,CAAC;gBACP,MAAM,CACL,IAAI,iBAAiB,CACpB,GAAG,GAAG,qBAAqB,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EACxE,IAAI,EACJ,MAAM,CACN,CACD,CAAC;YACH,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
||||
6
node_modules/@n8n/node-cli/dist/utils/command-suggestions.d.ts
generated
vendored
Normal file
6
node_modules/@n8n/node-cli/dist/utils/command-suggestions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
type ExecCommandType = 'cli' | 'script';
|
||||
export declare function getExecCommand(type?: ExecCommandType): Promise<string>;
|
||||
export declare function formatCommand(command: string): string;
|
||||
export declare function suggestCloudSupportCommand(action: 'enable' | 'disable'): Promise<string>;
|
||||
export declare function suggestLintCommand(): Promise<string>;
|
||||
export {};
|
||||
30
node_modules/@n8n/node-cli/dist/utils/command-suggestions.js
generated
vendored
Normal file
30
node_modules/@n8n/node-cli/dist/utils/command-suggestions.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getExecCommand = getExecCommand;
|
||||
exports.formatCommand = formatCommand;
|
||||
exports.suggestCloudSupportCommand = suggestCloudSupportCommand;
|
||||
exports.suggestLintCommand = suggestLintCommand;
|
||||
const picocolors_1 = __importDefault(require("picocolors"));
|
||||
const package_manager_1 = require("./package-manager");
|
||||
async function getExecCommand(type = 'cli') {
|
||||
const packageManager = (await (0, package_manager_1.detectPackageManager)()) ?? 'npm';
|
||||
if (type === 'script') {
|
||||
return packageManager === 'npm' ? 'npm run' : packageManager;
|
||||
}
|
||||
return packageManager === 'npm' ? 'npx' : packageManager;
|
||||
}
|
||||
function formatCommand(command) {
|
||||
return picocolors_1.default.cyan(command);
|
||||
}
|
||||
async function suggestCloudSupportCommand(action) {
|
||||
const execCommand = await getExecCommand('cli');
|
||||
return formatCommand(`${execCommand} n8n-node cloud-support ${action}`);
|
||||
}
|
||||
async function suggestLintCommand() {
|
||||
const execCommand = await getExecCommand('script');
|
||||
return formatCommand(`${execCommand} lint`);
|
||||
}
|
||||
//# sourceMappingURL=command-suggestions.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/command-suggestions.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/command-suggestions.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"command-suggestions.js","sourceRoot":"","sources":["../../src/utils/command-suggestions.ts"],"names":[],"mappings":";;;;;AAMA,wCAQC;AAED,sCAEC;AAED,gEAGC;AAED,gDAGC;AA5BD,4DAAoC;AAEpC,uDAAyD;AAIlD,KAAK,UAAU,cAAc,CAAC,OAAwB,KAAK;IACjE,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,sCAAoB,GAAE,CAAC,IAAI,KAAK,CAAC;IAE/D,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACvB,OAAO,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC;IAC9D,CAAC;IAED,OAAO,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC;AAC1D,CAAC;AAED,SAAgB,aAAa,CAAC,OAAe;IAC5C,OAAO,oBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAEM,KAAK,UAAU,0BAA0B,CAAC,MAA4B;IAC5E,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,aAAa,CAAC,GAAG,WAAW,2BAA2B,MAAM,EAAE,CAAC,CAAC;AACzE,CAAC;AAEM,KAAK,UAAU,kBAAkB;IACvC,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;IACnD,OAAO,aAAa,CAAC,GAAG,WAAW,OAAO,CAAC,CAAC;AAC7C,CAAC"}
|
||||
11
node_modules/@n8n/node-cli/dist/utils/filesystem.d.ts
generated
vendored
Normal file
11
node_modules/@n8n/node-cli/dist/utils/filesystem.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export declare function folderExists(dir: string): Promise<boolean>;
|
||||
export declare function copyFolder({ source: source, destination, ignore, }: {
|
||||
source: string;
|
||||
destination: string;
|
||||
ignore?: string[];
|
||||
}): Promise<void>;
|
||||
export declare function delayAtLeast<T>(promise: Promise<T>, minMs: number): Promise<T>;
|
||||
export declare function writeFileSafe(filePath: string, contents: string | Uint8Array): Promise<void>;
|
||||
export declare function ensureFolder(dir: string): Promise<string | undefined>;
|
||||
export declare function renameFilesInDirectory(dirPath: string, oldName: string, newName: string): Promise<void>;
|
||||
export declare function renameDirectory(oldDirPath: string, newDirName: string): Promise<string>;
|
||||
78
node_modules/@n8n/node-cli/dist/utils/filesystem.js
generated
vendored
Normal file
78
node_modules/@n8n/node-cli/dist/utils/filesystem.js
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.folderExists = folderExists;
|
||||
exports.copyFolder = copyFolder;
|
||||
exports.delayAtLeast = delayAtLeast;
|
||||
exports.writeFileSafe = writeFileSafe;
|
||||
exports.ensureFolder = ensureFolder;
|
||||
exports.renameFilesInDirectory = renameFilesInDirectory;
|
||||
exports.renameDirectory = renameDirectory;
|
||||
const change_case_1 = require("change-case");
|
||||
const promises_1 = __importDefault(require("node:fs/promises"));
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
async function folderExists(dir) {
|
||||
try {
|
||||
const stat = await promises_1.default.stat(dir);
|
||||
return stat.isDirectory();
|
||||
}
|
||||
catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async function copyFolder({ source: source, destination, ignore = [], }) {
|
||||
const ignoreSet = new Set(ignore);
|
||||
async function walkAndCopy(currentSrc, currentDest) {
|
||||
const entries = await promises_1.default.readdir(currentSrc, { withFileTypes: true });
|
||||
await Promise.all(entries.map(async (entry) => {
|
||||
if (ignoreSet.has(entry.name))
|
||||
return;
|
||||
const srcPath = node_path_1.default.join(currentSrc, entry.name);
|
||||
const destPath = node_path_1.default.join(currentDest, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
await promises_1.default.mkdir(destPath, { recursive: true });
|
||||
await walkAndCopy(srcPath, destPath);
|
||||
}
|
||||
else {
|
||||
await promises_1.default.copyFile(srcPath, destPath);
|
||||
}
|
||||
}));
|
||||
}
|
||||
await promises_1.default.mkdir(destination, { recursive: true });
|
||||
await walkAndCopy(source, destination);
|
||||
}
|
||||
async function delayAtLeast(promise, minMs) {
|
||||
const delayPromise = new Promise((res) => setTimeout(res, minMs));
|
||||
const [result] = await Promise.all([promise, delayPromise]);
|
||||
return result;
|
||||
}
|
||||
async function writeFileSafe(filePath, contents) {
|
||||
await promises_1.default.mkdir(node_path_1.default.dirname(filePath), { recursive: true });
|
||||
await promises_1.default.writeFile(filePath, contents);
|
||||
}
|
||||
async function ensureFolder(dir) {
|
||||
return await promises_1.default.mkdir(dir, { recursive: true });
|
||||
}
|
||||
async function renameFilesInDirectory(dirPath, oldName, newName) {
|
||||
const files = await promises_1.default.readdir(dirPath);
|
||||
for (const file of files) {
|
||||
const oldPath = node_path_1.default.resolve(dirPath, file);
|
||||
const oldFileName = node_path_1.default.basename(oldPath);
|
||||
const newFileName = oldFileName
|
||||
.replace(oldName, newName)
|
||||
.replace((0, change_case_1.camelCase)(oldName), (0, change_case_1.camelCase)(newName));
|
||||
if (newFileName !== oldFileName) {
|
||||
const newPath = node_path_1.default.resolve(dirPath, newFileName);
|
||||
await promises_1.default.rename(oldPath, newPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
async function renameDirectory(oldDirPath, newDirName) {
|
||||
const parentDir = node_path_1.default.dirname(oldDirPath);
|
||||
const newDirPath = node_path_1.default.resolve(parentDir, newDirName);
|
||||
await promises_1.default.rename(oldDirPath, newDirPath);
|
||||
return newDirPath;
|
||||
}
|
||||
//# sourceMappingURL=filesystem.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/filesystem.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/filesystem.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/utils/filesystem.ts"],"names":[],"mappings":";;;;;AAIA,oCAOC;AAED,gCA6BC;AAED,oCAIC;AAED,sCAMC;AAED,oCAEC;AAED,wDAmBC;AAED,0CAKC;AAxFD,6CAAwC;AACxC,gEAAkC;AAClC,0DAA6B;AAEtB,KAAK,UAAU,YAAY,CAAC,GAAW;IAC7C,IAAI,CAAC;QACJ,MAAM,IAAI,GAAG,MAAM,kBAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAEM,KAAK,UAAU,UAAU,CAAC,EAChC,MAAM,EAAE,MAAM,EACd,WAAW,EACX,MAAM,GAAG,EAAE,GACiD;IAC5D,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IAElC,KAAK,UAAU,WAAW,CAAC,UAAkB,EAAE,WAAmB;QACjE,MAAM,OAAO,GAAG,MAAM,kBAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,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I,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACvD,MAAM,kBAAE,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACxC,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
||||
7
node_modules/@n8n/node-cli/dist/utils/git.d.ts
generated
vendored
Normal file
7
node_modules/@n8n/node-cli/dist/utils/git.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
type GitUser = {
|
||||
name?: string;
|
||||
email?: string;
|
||||
};
|
||||
export declare function tryReadGitUser(): GitUser;
|
||||
export declare function initGit(dir: string): Promise<void>;
|
||||
export {};
|
||||
36
node_modules/@n8n/node-cli/dist/utils/git.js
generated
vendored
Normal file
36
node_modules/@n8n/node-cli/dist/utils/git.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.tryReadGitUser = tryReadGitUser;
|
||||
exports.initGit = initGit;
|
||||
const node_child_process_1 = require("node:child_process");
|
||||
const child_process_1 = require("./child-process");
|
||||
function tryReadGitUser() {
|
||||
const user = { name: '', email: '' };
|
||||
try {
|
||||
const name = (0, node_child_process_1.execSync)('git config --get user.name', {
|
||||
stdio: ['pipe', 'pipe', 'ignore'],
|
||||
})
|
||||
.toString()
|
||||
.trim();
|
||||
if (name)
|
||||
user.name = name;
|
||||
}
|
||||
catch {
|
||||
}
|
||||
try {
|
||||
const email = (0, node_child_process_1.execSync)('git config --get user.email', {
|
||||
stdio: ['pipe', 'pipe', 'ignore'],
|
||||
})
|
||||
.toString()
|
||||
.trim();
|
||||
if (email)
|
||||
user.email = email;
|
||||
}
|
||||
catch {
|
||||
}
|
||||
return user;
|
||||
}
|
||||
async function initGit(dir) {
|
||||
await (0, child_process_1.runCommand)('git', ['init', '-b', 'main'], { cwd: dir });
|
||||
}
|
||||
//# sourceMappingURL=git.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/git.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/git.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":";;AASA,wCA0BC;AAED,0BAEC;AAvCD,2DAA8C;AAE9C,mDAA6C;AAO7C,SAAgB,cAAc;IAC7B,MAAM,IAAI,GAAY,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAE9C,IAAI,CAAC;QACJ,MAAM,IAAI,GAAG,IAAA,6BAAQ,EAAC,4BAA4B,EAAE;YACnD,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;SACjC,CAAC;aACA,QAAQ,EAAE;aACV,IAAI,EAAE,CAAC;QACT,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,KAAK,GAAG,IAAA,6BAAQ,EAAC,6BAA6B,EAAE;YACrD,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;SACjC,CAAC;aACA,QAAQ,EAAE;aACV,IAAI,EAAE,CAAC;QACT,IAAI,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAEM,KAAK,UAAU,OAAO,CAAC,GAAW;IACxC,MAAM,IAAA,0BAAU,EAAC,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAC/D,CAAC"}
|
||||
1
node_modules/@n8n/node-cli/dist/utils/json.d.ts
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/json.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function jsonParse<T>(data: string): T | null;
|
||||
12
node_modules/@n8n/node-cli/dist/utils/json.js
generated
vendored
Normal file
12
node_modules/@n8n/node-cli/dist/utils/json.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.jsonParse = jsonParse;
|
||||
function jsonParse(data) {
|
||||
try {
|
||||
return JSON.parse(data);
|
||||
}
|
||||
catch (error) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=json.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/json.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/json.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/utils/json.ts"],"names":[],"mappings":";;AAAA,8BAMC;AAND,SAAgB,SAAS,CAAI,IAAY;IACxC,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC"}
|
||||
4
node_modules/@n8n/node-cli/dist/utils/package-manager.d.ts
generated
vendored
Normal file
4
node_modules/@n8n/node-cli/dist/utils/package-manager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
type PackageManager = 'npm' | 'yarn' | 'pnpm';
|
||||
export declare function detectPackageManagerFromUserAgent(): PackageManager | null;
|
||||
export declare function detectPackageManager(): Promise<PackageManager | null>;
|
||||
export {};
|
||||
48
node_modules/@n8n/node-cli/dist/utils/package-manager.js
generated
vendored
Normal file
48
node_modules/@n8n/node-cli/dist/utils/package-manager.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.detectPackageManagerFromUserAgent = detectPackageManagerFromUserAgent;
|
||||
exports.detectPackageManager = detectPackageManager;
|
||||
const promises_1 = __importDefault(require("node:fs/promises"));
|
||||
function detectPackageManagerFromUserAgent() {
|
||||
if ('npm_config_user_agent' in process.env) {
|
||||
const ua = process.env['npm_config_user_agent'] ?? '';
|
||||
if (ua.includes('pnpm'))
|
||||
return 'pnpm';
|
||||
if (ua.includes('yarn'))
|
||||
return 'yarn';
|
||||
if (ua.includes('npm'))
|
||||
return 'npm';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async function detectPackageManagerFromLockFiles() {
|
||||
const lockFiles = {
|
||||
npm: 'package-lock.json',
|
||||
yarn: 'yarn.lock',
|
||||
pnpm: 'pnpm-lock.yaml',
|
||||
};
|
||||
for (const [pm, lockFile] of Object.entries(lockFiles)) {
|
||||
try {
|
||||
const stats = await promises_1.default.stat(lockFile);
|
||||
if (stats.isFile()) {
|
||||
return pm;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async function detectPackageManager() {
|
||||
const fromUserAgent = detectPackageManagerFromUserAgent();
|
||||
if (fromUserAgent)
|
||||
return fromUserAgent;
|
||||
const fromLockFiles = await detectPackageManagerFromLockFiles();
|
||||
if (fromLockFiles)
|
||||
return fromLockFiles;
|
||||
return null;
|
||||
}
|
||||
//# sourceMappingURL=package-manager.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/package-manager.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/package-manager.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"package-manager.js","sourceRoot":"","sources":["../../src/utils/package-manager.ts"],"names":[],"mappings":";;;;;AAIA,8EAQC;AAsBD,oDAUC;AA5CD,gEAAkC;AAIlC,SAAgB,iCAAiC;IAChD,IAAI,uBAAuB,IAAI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package.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
export type N8nPackageJson = {
|
||||
name: string;
|
||||
version: string;
|
||||
n8n?: {
|
||||
nodes?: string[];
|
||||
credentials?: string[];
|
||||
strict?: boolean;
|
||||
};
|
||||
};
|
||||
export declare function updatePackageJson(dirPath: string, updater: (packageJson: N8nPackageJson) => N8nPackageJson): Promise<void>;
|
||||
export declare function getPackageJson(dirPath: string): Promise<N8nPackageJson | null>;
|
||||
export declare function isN8nNodePackage(dirPath?: string): Promise<boolean>;
|
||||
export declare function getPackageJsonNodes(dirPath: string): Promise<string[]>;
|
||||
export declare function setNodesPackageJson(dirPath: string, nodes: string[]): Promise<void>;
|
||||
export declare function addCredentialPackageJson(dirPath: string, credential: string): Promise<void>;
|
||||
53
node_modules/@n8n/node-cli/dist/utils/package.js
generated
vendored
Normal file
53
node_modules/@n8n/node-cli/dist/utils/package.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.updatePackageJson = updatePackageJson;
|
||||
exports.getPackageJson = getPackageJson;
|
||||
exports.isN8nNodePackage = isN8nNodePackage;
|
||||
exports.getPackageJsonNodes = getPackageJsonNodes;
|
||||
exports.setNodesPackageJson = setNodesPackageJson;
|
||||
exports.addCredentialPackageJson = addCredentialPackageJson;
|
||||
const promises_1 = __importDefault(require("node:fs/promises"));
|
||||
const node_path_1 = __importDefault(require("node:path"));
|
||||
const prettier_1 = __importDefault(require("prettier"));
|
||||
const filesystem_1 = require("./filesystem");
|
||||
const json_1 = require("./json");
|
||||
async function updatePackageJson(dirPath, updater) {
|
||||
const packageJsonPath = node_path_1.default.resolve(dirPath, 'package.json');
|
||||
const packageJson = (0, json_1.jsonParse)(await promises_1.default.readFile(packageJsonPath, 'utf-8'));
|
||||
if (!packageJson)
|
||||
return;
|
||||
const updatedPackageJson = updater(packageJson);
|
||||
await (0, filesystem_1.writeFileSafe)(packageJsonPath, await prettier_1.default.format(JSON.stringify(updatedPackageJson), { parser: 'json' }));
|
||||
}
|
||||
async function getPackageJson(dirPath) {
|
||||
const packageJsonPath = node_path_1.default.resolve(dirPath, 'package.json');
|
||||
const packageJson = (0, json_1.jsonParse)(await promises_1.default.readFile(packageJsonPath, 'utf-8'));
|
||||
return packageJson;
|
||||
}
|
||||
async function isN8nNodePackage(dirPath = process.cwd()) {
|
||||
const packageJson = await getPackageJson(dirPath).catch(() => null);
|
||||
return Array.isArray(packageJson?.n8n?.nodes);
|
||||
}
|
||||
async function getPackageJsonNodes(dirPath) {
|
||||
const packageJson = await getPackageJson(dirPath);
|
||||
return packageJson?.n8n?.nodes ?? [];
|
||||
}
|
||||
async function setNodesPackageJson(dirPath, nodes) {
|
||||
await updatePackageJson(dirPath, (packageJson) => {
|
||||
packageJson['n8n'] ??= {};
|
||||
packageJson['n8n'].nodes = nodes;
|
||||
return packageJson;
|
||||
});
|
||||
}
|
||||
async function addCredentialPackageJson(dirPath, credential) {
|
||||
await updatePackageJson(dirPath, (packageJson) => {
|
||||
packageJson['n8n'] ??= {};
|
||||
packageJson['n8n'].credentials ??= [];
|
||||
packageJson['n8n'].credentials.push(credential);
|
||||
return packageJson;
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=package.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/package.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/package.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/utils/package.ts"],"names":[],"mappings":";;;;;AAiBA,8CAeC;AAED,wCAKC;AAED,4CAIC;AAED,kDAGC;AAED,kDAMC;AAED,4DAOC;AAnED,gEAAkC;AAClC,0DAA6B;AAC7B,wDAAgC;AAEhC,6CAA6C;AAC7C,iCAAmC;AAY5B,KA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UAAU,mBAAmB,CAAC,OAAe,EAAE,KAAe;IACzE,MAAM,iBAAiB,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE;QAChD,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1B,WAAW,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC;QACjC,OAAO,WAAW,CAAC;IACpB,CAAC,CAAC,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,wBAAwB,CAAC,OAAe,EAAE,UAAkB;IACjF,MAAM,iBAAiB,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE;QAChD,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC1B,WAAW,CAAC,KAAK,CAAC,CAAC,WAAW,KAAK,EAAE,CAAC;QACtC,WAAW,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChD,OAAO,WAAW,CAAC;IACpB,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
||||
3
node_modules/@n8n/node-cli/dist/utils/prompts.d.ts
generated
vendored
Normal file
3
node_modules/@n8n/node-cli/dist/utils/prompts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare function withCancelHandler<T>(prompt: Promise<symbol | T>): Promise<T>;
|
||||
export declare const onCancel: (message?: string, code?: number) => never;
|
||||
export declare function ensureN8nPackage(commandName: string): Promise<void>;
|
||||
37
node_modules/@n8n/node-cli/dist/utils/prompts.js
generated
vendored
Normal file
37
node_modules/@n8n/node-cli/dist/utils/prompts.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.onCancel = void 0;
|
||||
exports.withCancelHandler = withCancelHandler;
|
||||
exports.ensureN8nPackage = ensureN8nPackage;
|
||||
const prompts_1 = require("@clack/prompts");
|
||||
const package_1 = require("./package");
|
||||
async function withCancelHandler(prompt) {
|
||||
const result = await prompt;
|
||||
if ((0, prompts_1.isCancel)(result))
|
||||
return (0, exports.onCancel)();
|
||||
return result;
|
||||
}
|
||||
const onCancel = (message = 'Cancelled', code = 0) => {
|
||||
(0, prompts_1.cancel)(message);
|
||||
process.exit(code);
|
||||
};
|
||||
exports.onCancel = onCancel;
|
||||
async function ensureN8nPackage(commandName) {
|
||||
const isN8nNode = await (0, package_1.isN8nNodePackage)();
|
||||
if (!isN8nNode) {
|
||||
prompts_1.log.error(`Make sure you are in the root directory of your node package and your package.json contains the "n8n" field
|
||||
|
||||
For example:
|
||||
{
|
||||
"name": "n8n-nodes-my-app",
|
||||
"version": "0.1.0",
|
||||
"n8n": {
|
||||
"nodes": ["dist/nodes/MyApp.node.js"]
|
||||
}
|
||||
}
|
||||
`);
|
||||
(0, exports.onCancel)(`${commandName} can only be run in an n8n node package`, 1);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=prompts.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/prompts.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/prompts.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/utils/prompts.ts"],"names":[],"mappings":";;;AAIA,8CAIC;AAOD,4CAiBC;AAhCD,4CAAuD;AAEvD,uCAA6C;AAEtC,KAAK,UAAU,iBAAiB,CAAI,MAA2B;IACrE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC;IAC5B,IAAI,IAAA,kBAAQ,EAAC,MAAM,CAAC;QAAE,OAAO,IAAA,gBAAQ,GAAE,CAAC;IACxC,OAAO,MAAM,CAAC;AACf,CAAC;AAEM,MAAM,QAAQ,GAAG,CAAC,OAAO,GAAG,WAAW,EAAE,IAAI,GAAG,CAAC,EAAE,EAAE;IAC3D,IAAA,gBAAM,EAAC,OAAO,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC,CAAC;AAHW,QAAA,QAAQ,YAGnB;AAEK,KAAK,UAAU,gBAAgB,CAAC,WAAmB;IACzD,MAAM,SAAS,GAAG,MAAM,IAAA,0BAAgB,GAAE,CAAC;IAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,aAAG,CAAC,KAAK,CAAC;;;;;;;;;;CAUX,CAAC,CAAC;QACD,IAAA,gBAAQ,EAAC,GAAG,WAAW,yCAAyC,EAAE,CAAC,CAAC,CAAC;QACrE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACF,CAAC"}
|
||||
3
node_modules/@n8n/node-cli/dist/utils/validation.d.ts
generated
vendored
Normal file
3
node_modules/@n8n/node-cli/dist/utils/validation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const validateNodeName: (name: string) => string | undefined;
|
||||
export declare function isNodeErrnoException(error: unknown): error is NodeJS.ErrnoException;
|
||||
export declare function isEnoentError(error: unknown): boolean;
|
||||
23
node_modules/@n8n/node-cli/dist/utils/validation.js
generated
vendored
Normal file
23
node_modules/@n8n/node-cli/dist/utils/validation.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.validateNodeName = void 0;
|
||||
exports.isNodeErrnoException = isNodeErrnoException;
|
||||
exports.isEnoentError = isEnoentError;
|
||||
const validateNodeName = (name) => {
|
||||
if (!name)
|
||||
return;
|
||||
const regexScoped = /^@([a-z0-9]+(?:-[a-z0-9]+)*)\/n8n-nodes-([a-z0-9]+(?:-[a-z0-9]+)*)$/;
|
||||
const regexUnscoped = /^n8n-nodes-([a-z0-9]+(?:-[a-z0-9]+)*)$/;
|
||||
if (!regexScoped.test(name) && !regexUnscoped.test(name)) {
|
||||
return "Must start with 'n8n-nodes-' or '@org/n8n-nodes-'. Examples: n8n-nodes-my-app, @mycompany/n8n-nodes-my-app";
|
||||
}
|
||||
return;
|
||||
};
|
||||
exports.validateNodeName = validateNodeName;
|
||||
function isNodeErrnoException(error) {
|
||||
return error instanceof Error && 'code' in error;
|
||||
}
|
||||
function isEnoentError(error) {
|
||||
return isNodeErrnoException(error) && error.code === 'ENOENT';
|
||||
}
|
||||
//# sourceMappingURL=validation.js.map
|
||||
1
node_modules/@n8n/node-cli/dist/utils/validation.js.map
generated
vendored
Normal file
1
node_modules/@n8n/node-cli/dist/utils/validation.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":";;;AAcA,oDAEC;AAED,sCAEC;AApBM,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAsB,EAAE;IACpE,IAAI,CAAC,IAAI;QAAE,OAAO;IAGlB,MAAM,WAAW,GAAG,qEAAqE,CAAC;IAE1F,MAAM,aAAa,GAAG,wCAAwC,CAAC;IAE/D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1D,OAAO,4GAA4G,CAAC;IACrH,CAAC;IACD,OAAO;AACR,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B;AAEF,SAAgB,oBAAoB,CAAC,KAAc;IAClD,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC;AAClD,CAAC;AAED,SAAgB,aAAa,CAAC,KAAc;IAC3C,OAAO,oBAAoB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC/D,CAAC"}
|
||||
Reference in New Issue
Block a user