@dartfx/n8n-nodes-qsv 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +8 -8
  2. package/package.json +4 -4
  3. package/dist/nodes/Qsv/actions/executeClean.d.ts +0 -2
  4. package/dist/nodes/Qsv/actions/executeClean.js +0 -147
  5. package/dist/nodes/Qsv/actions/executeClipboard.d.ts +0 -2
  6. package/dist/nodes/Qsv/actions/executeClipboard.js +0 -114
  7. package/dist/nodes/Qsv/actions/executeColor.d.ts +0 -2
  8. package/dist/nodes/Qsv/actions/executeColor.js +0 -126
  9. package/dist/nodes/Qsv/actions/executeLens.d.ts +0 -2
  10. package/dist/nodes/Qsv/actions/executeLens.js +0 -156
  11. package/dist/nodes/Qsv/actions/executeLog.d.ts +0 -2
  12. package/dist/nodes/Qsv/actions/executeLog.js +0 -111
  13. package/dist/nodes/Qsv/actions/executePrompt.d.ts +0 -2
  14. package/dist/nodes/Qsv/actions/executePrompt.js +0 -132
  15. package/dist/nodes/Qsv/descriptions/CleanDescription.d.ts +0 -2
  16. package/dist/nodes/Qsv/descriptions/CleanDescription.js +0 -140
  17. package/dist/nodes/Qsv/descriptions/ClipboardDescription.d.ts +0 -2
  18. package/dist/nodes/Qsv/descriptions/ClipboardDescription.js +0 -63
  19. package/dist/nodes/Qsv/descriptions/ColorDescription.d.ts +0 -2
  20. package/dist/nodes/Qsv/descriptions/ColorDescription.js +0 -91
  21. package/dist/nodes/Qsv/descriptions/LensDescription.d.ts +0 -2
  22. package/dist/nodes/Qsv/descriptions/LensDescription.js +0 -161
  23. package/dist/nodes/Qsv/descriptions/LogDescription.d.ts +0 -2
  24. package/dist/nodes/Qsv/descriptions/LogDescription.js +0 -55
  25. package/dist/nodes/Qsv/descriptions/PromptDescription.d.ts +0 -2
  26. package/dist/nodes/Qsv/descriptions/PromptDescription.js +0 -105
@@ -1,111 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.executeLog = executeLog;
4
- const n8n_workflow_1 = require("n8n-workflow");
5
- const child_process_1 = require("child_process");
6
- const util_1 = require("util");
7
- const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
8
- async function executeLog(itemIndex) {
9
- const inputPath = this.getNodeParameter("inputPath", itemIndex);
10
- if (!inputPath || !inputPath.trim()) {
11
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Input CSV file path is required.", { itemIndex });
12
- }
13
- const outputPath = this.getNodeParameter("outputPath", itemIndex, "") || "";
14
- const additionalArgs = this.getNodeParameter("additionalArgs", itemIndex, "") || "";
15
- const options = this.getNodeParameter("options", itemIndex, {}) || {};
16
- const args = ["log"];
17
- if (additionalArgs.trim()) {
18
- const rawMatches = additionalArgs.match(/[^\s"']+|"[^"]*"|'[^']*'/g) || [];
19
- const parsedArgs = rawMatches.map((arg) => {
20
- if ((arg.startsWith('"') && arg.endsWith('"')) ||
21
- (arg.startsWith("'") && arg.endsWith("'"))) {
22
- return arg.slice(1, -1);
23
- }
24
- return arg;
25
- });
26
- args.push(...parsedArgs);
27
- }
28
- if (outputPath.trim()) {
29
- args.push("--output", outputPath.trim());
30
- }
31
- args.push(inputPath);
32
- const qsvBin = process.env.DARTFX_QSV_BIN_PATH ||
33
- process.env.QSV_BIN_PATH ||
34
- process.env.QSV_PATH ||
35
- "qsv";
36
- try {
37
- const { stdout, stderr } = await execFileAsync(qsvBin, args, {
38
- maxBuffer: 50 * 1024 * 1024,
39
- encoding: "utf8",
40
- });
41
- let resultJson;
42
- try {
43
- resultJson = JSON.parse(stdout);
44
- }
45
- catch {
46
- resultJson = {
47
- command: "qsv log",
48
- inputPath,
49
- rawOutput: stdout,
50
- };
51
- }
52
- const returnJson = {
53
- success: true,
54
- command: "log",
55
- inputPath,
56
- result: resultJson,
57
- };
58
- if (outputPath.trim()) {
59
- returnJson.outputPath = outputPath.trim();
60
- }
61
- if (stderr && stderr.trim()) {
62
- returnJson.warnings = stderr.trim();
63
- }
64
- return [
65
- {
66
- json: returnJson,
67
- },
68
- ];
69
- }
70
- catch (error) {
71
- if (error.code === "ENOENT") {
72
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The QSV CLI binary ('${qsvBin}') was not found`, {
73
- itemIndex,
74
- description: `Please ensure 'qsv' is installed and available in the system PATH where n8n is running, or specify its absolute path via the DARTFX_QSV_BIN_PATH environment variable. (https://github.com/dathere/qsv)`,
75
- });
76
- }
77
- if (error.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER" ||
78
- (error.message && error.message.includes("maxBuffer"))) {
79
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `QSV execution exceeded maximum stdout buffer (50 MB)`, {
80
- itemIndex,
81
- description: `qsv log returned more data than could fit into memory. Specify an 'Output File Path' to stream results directly to disk instead.`,
82
- });
83
- }
84
- const rawError = (error.stderr || error.message || "").trim();
85
- if (rawError.includes("is not a qsv command") ||
86
- rawError.includes("unrecognized subcommand") ||
87
- rawError.includes("not available in this")) {
88
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation 'log' is not available in the installed QSV binary`, {
89
- itemIndex,
90
- description: `The installed QSV binary at '${qsvBin}' does not include the 'log' feature. This feature may require a full feature build of QSV (e.g. qsv with all_features or a prebuilt binary with feature flags enabled). See https://github.com/dathere/qsv#feature-flags`,
91
- });
92
- }
93
- if (rawError.includes("No such file or directory") ||
94
- rawError.includes("os error 2")) {
95
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Input file not found: '${inputPath}'`, {
96
- itemIndex,
97
- description: `qsv log could not find the file at '${inputPath}'. Check for typos, or if n8n is running in Docker, ensure the host directory is mounted into the container.`,
98
- });
99
- }
100
- if (rawError.includes("Operation not permitted") ||
101
- rawError.includes("os error 1") ||
102
- rawError.includes("Permission denied") ||
103
- rawError.includes("os error 13")) {
104
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Permission denied accessing file: '${inputPath}'`, {
105
- itemIndex,
106
- description: `qsv log was denied read access to '${inputPath}'. On macOS, check Full Disk Access or Removable Volumes permissions for the application running n8n.`,
107
- });
108
- }
109
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed executing 'qsv log': ${rawError}`, { itemIndex });
110
- }
111
- }
@@ -1,2 +0,0 @@
1
- import type { IExecuteFunctions, INodeExecutionData } from "n8n-workflow";
2
- export declare function executePrompt(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData[]>;
@@ -1,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.executePrompt = executePrompt;
4
- const n8n_workflow_1 = require("n8n-workflow");
5
- const child_process_1 = require("child_process");
6
- const util_1 = require("util");
7
- const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
8
- async function executePrompt(itemIndex) {
9
- const inputPath = this.getNodeParameter("inputPath", itemIndex);
10
- if (!inputPath || !inputPath.trim()) {
11
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Input CSV file path is required.", { itemIndex });
12
- }
13
- const outputPath = this.getNodeParameter("outputPath", itemIndex, "") || "";
14
- const additionalArgs = this.getNodeParameter("additionalArgs", itemIndex, "") || "";
15
- const options = this.getNodeParameter("options", itemIndex, {}) || {};
16
- const args = ["prompt"];
17
- if (options.msg !== undefined && options.msg !== "") {
18
- args.push("--msg", String(options.msg));
19
- }
20
- if (options.filters !== undefined && options.filters !== "") {
21
- args.push("--filters", String(options.filters));
22
- }
23
- if (options.workdir !== undefined && options.workdir !== "") {
24
- args.push("--workdir", String(options.workdir));
25
- }
26
- if (options.fdOutput === true) {
27
- args.push("--fd-output");
28
- }
29
- if (options.saveFname !== undefined && options.saveFname !== "") {
30
- args.push("--save-fname", String(options.saveFname));
31
- }
32
- if (options.baseDelayMs !== undefined && options.baseDelayMs !== "") {
33
- args.push("--base-delay-ms", String(options.baseDelayMs));
34
- }
35
- if (options.quiet === true) {
36
- args.push("--quiet");
37
- }
38
- if (additionalArgs.trim()) {
39
- const rawMatches = additionalArgs.match(/[^\s"']+|"[^"]*"|'[^']*'/g) || [];
40
- const parsedArgs = rawMatches.map((arg) => {
41
- if ((arg.startsWith('"') && arg.endsWith('"')) ||
42
- (arg.startsWith("'") && arg.endsWith("'"))) {
43
- return arg.slice(1, -1);
44
- }
45
- return arg;
46
- });
47
- args.push(...parsedArgs);
48
- }
49
- if (outputPath.trim()) {
50
- args.push("--output", outputPath.trim());
51
- }
52
- args.push(inputPath);
53
- const qsvBin = process.env.DARTFX_QSV_BIN_PATH ||
54
- process.env.QSV_BIN_PATH ||
55
- process.env.QSV_PATH ||
56
- "qsv";
57
- try {
58
- const { stdout, stderr } = await execFileAsync(qsvBin, args, {
59
- maxBuffer: 50 * 1024 * 1024,
60
- encoding: "utf8",
61
- });
62
- let resultJson;
63
- try {
64
- resultJson = JSON.parse(stdout);
65
- }
66
- catch {
67
- resultJson = {
68
- command: "qsv prompt",
69
- inputPath,
70
- rawOutput: stdout,
71
- };
72
- }
73
- const returnJson = {
74
- success: true,
75
- command: "prompt",
76
- inputPath,
77
- result: resultJson,
78
- };
79
- if (outputPath.trim()) {
80
- returnJson.outputPath = outputPath.trim();
81
- }
82
- if (stderr && stderr.trim()) {
83
- returnJson.warnings = stderr.trim();
84
- }
85
- return [
86
- {
87
- json: returnJson,
88
- },
89
- ];
90
- }
91
- catch (error) {
92
- if (error.code === "ENOENT") {
93
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The QSV CLI binary ('${qsvBin}') was not found`, {
94
- itemIndex,
95
- description: `Please ensure 'qsv' is installed and available in the system PATH where n8n is running, or specify its absolute path via the DARTFX_QSV_BIN_PATH environment variable. (https://github.com/dathere/qsv)`,
96
- });
97
- }
98
- if (error.code === "ERR_CHILD_PROCESS_STDIO_MAXBUFFER" ||
99
- (error.message && error.message.includes("maxBuffer"))) {
100
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `QSV execution exceeded maximum stdout buffer (50 MB)`, {
101
- itemIndex,
102
- description: `qsv prompt returned more data than could fit into memory. Specify an 'Output File Path' to stream results directly to disk instead.`,
103
- });
104
- }
105
- const rawError = (error.stderr || error.message || "").trim();
106
- if (rawError.includes("is not a qsv command") ||
107
- rawError.includes("unrecognized subcommand") ||
108
- rawError.includes("not available in this")) {
109
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation 'prompt' is not available in the installed QSV binary`, {
110
- itemIndex,
111
- description: `The installed QSV binary at '${qsvBin}' does not include the 'prompt' feature. This feature may require a full feature build of QSV (e.g. qsv with all_features or a prebuilt binary with feature flags enabled). See https://github.com/dathere/qsv#feature-flags`,
112
- });
113
- }
114
- if (rawError.includes("No such file or directory") ||
115
- rawError.includes("os error 2")) {
116
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Input file not found: '${inputPath}'`, {
117
- itemIndex,
118
- description: `qsv prompt could not find the file at '${inputPath}'. Check for typos, or if n8n is running in Docker, ensure the host directory is mounted into the container.`,
119
- });
120
- }
121
- if (rawError.includes("Operation not permitted") ||
122
- rawError.includes("os error 1") ||
123
- rawError.includes("Permission denied") ||
124
- rawError.includes("os error 13")) {
125
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Permission denied accessing file: '${inputPath}'`, {
126
- itemIndex,
127
- description: `qsv prompt was denied read access to '${inputPath}'. On macOS, check Full Disk Access or Removable Volumes permissions for the application running n8n.`,
128
- });
129
- }
130
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed executing 'qsv prompt': ${rawError}`, { itemIndex });
131
- }
132
- }
@@ -1,2 +0,0 @@
1
- import type { INodeProperties } from "n8n-workflow";
2
- export declare const CleanDescription: INodeProperties[];
@@ -1,140 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CleanDescription = void 0;
4
- exports.CleanDescription = [
5
- {
6
- displayName: "Input CSV File Path",
7
- name: "inputPath",
8
- type: "string",
9
- required: true,
10
- default: "",
11
- description: "Path to input CSV file on disk or host filesystem",
12
- displayOptions: {
13
- show: {
14
- operation: ["clean"],
15
- },
16
- },
17
- },
18
- {
19
- displayName: "Output File Path",
20
- name: "outputPath",
21
- type: "string",
22
- default: "",
23
- description: "Optional path to write output file directly to disk (if omitted, results are returned in node output)",
24
- displayOptions: {
25
- show: {
26
- operation: ["clean"],
27
- },
28
- },
29
- },
30
- {
31
- displayName: "Additional Flags",
32
- name: "additionalArgs",
33
- type: "string",
34
- default: "",
35
- description: "Additional raw command line arguments to pass to qsv clean",
36
- displayOptions: {
37
- show: {
38
- operation: ["clean"],
39
- },
40
- },
41
- },
42
- {
43
- displayName: "Options",
44
- name: "options",
45
- type: "collection",
46
- placeholder: "Add Option",
47
- default: {},
48
- displayOptions: {
49
- show: {
50
- operation: ["clean"],
51
- },
52
- },
53
- options: [
54
- {
55
- displayName: "Stale",
56
- name: "stale",
57
- type: "boolean",
58
- default: false,
59
- description: "Only remove STALE or ORPHANED caches: a cache whose",
60
- },
61
- {
62
- displayName: "Recursive",
63
- name: "recursive",
64
- type: "boolean",
65
- default: false,
66
- description: "Recurse into subdirectories when <input> is a directory.",
67
- },
68
- {
69
- displayName: "Dry Run",
70
- name: "dryRun",
71
- type: "boolean",
72
- default: false,
73
- description: "Preview only; never delete. Wins over --force if both",
74
- },
75
- {
76
- displayName: "Force",
77
- name: "force",
78
- type: "boolean",
79
- default: false,
80
- description: "Actually delete the files.",
81
- },
82
- {
83
- displayName: "Index",
84
- name: "index",
85
- type: "boolean",
86
- default: false,
87
- description: "Index (.idx) caches. [default category]",
88
- },
89
- {
90
- displayName: "Stats",
91
- name: "stats",
92
- type: "boolean",
93
- default: false,
94
- description: "Stats caches. [default category]",
95
- },
96
- {
97
- displayName: "Frequency",
98
- name: "frequency",
99
- type: "boolean",
100
- default: false,
101
- description: "Frequency caches. [default category]",
102
- },
103
- {
104
- displayName: "Schema",
105
- name: "schema",
106
- type: "boolean",
107
- default: false,
108
- description: "schema .schema.json / .pschema.json outputs.",
109
- },
110
- {
111
- displayName: "Validate",
112
- name: "validate",
113
- type: "boolean",
114
- default: false,
115
- description: "validate .valid / .invalid / .validation-errors.tsv outputs.",
116
- },
117
- {
118
- displayName: "Moarstats",
119
- name: "moarstats",
120
- type: "boolean",
121
- default: false,
122
- description: "moarstats .stats.bivariate[.joined].csv outputs.",
123
- },
124
- {
125
- displayName: "All",
126
- name: "all",
127
- type: "boolean",
128
- default: false,
129
- description: "Select every category above.",
130
- },
131
- {
132
- displayName: "Quiet",
133
- name: "quiet",
134
- type: "boolean",
135
- default: false,
136
- description: "Do not print the per-file / summary report.",
137
- },
138
- ],
139
- },
140
- ];
@@ -1,2 +0,0 @@
1
- import type { INodeProperties } from "n8n-workflow";
2
- export declare const ClipboardDescription: INodeProperties[];
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClipboardDescription = void 0;
4
- exports.ClipboardDescription = [
5
- {
6
- displayName: "Input CSV File Path",
7
- name: "inputPath",
8
- type: "string",
9
- required: true,
10
- default: "",
11
- description: "Path to input CSV file on disk or host filesystem",
12
- displayOptions: {
13
- show: {
14
- operation: ["clipboard"],
15
- },
16
- },
17
- },
18
- {
19
- displayName: "Output File Path",
20
- name: "outputPath",
21
- type: "string",
22
- default: "",
23
- description: "Optional path to write output file directly to disk (if omitted, results are returned in node output)",
24
- displayOptions: {
25
- show: {
26
- operation: ["clipboard"],
27
- },
28
- },
29
- },
30
- {
31
- displayName: "Additional Flags",
32
- name: "additionalArgs",
33
- type: "string",
34
- default: "",
35
- description: "Additional raw command line arguments to pass to qsv clipboard",
36
- displayOptions: {
37
- show: {
38
- operation: ["clipboard"],
39
- },
40
- },
41
- },
42
- {
43
- displayName: "Options",
44
- name: "options",
45
- type: "collection",
46
- placeholder: "Add Option",
47
- default: {},
48
- displayOptions: {
49
- show: {
50
- operation: ["clipboard"],
51
- },
52
- },
53
- options: [
54
- {
55
- displayName: "Save",
56
- name: "save",
57
- type: "boolean",
58
- default: false,
59
- description: "Save output to clipboard.",
60
- },
61
- ],
62
- },
63
- ];
@@ -1,2 +0,0 @@
1
- import type { INodeProperties } from "n8n-workflow";
2
- export declare const ColorDescription: INodeProperties[];
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ColorDescription = void 0;
4
- exports.ColorDescription = [
5
- {
6
- displayName: "Input CSV File Path",
7
- name: "inputPath",
8
- type: "string",
9
- required: true,
10
- default: "",
11
- description: "Path to input CSV file on disk or host filesystem",
12
- displayOptions: {
13
- show: {
14
- operation: ["color"],
15
- },
16
- },
17
- },
18
- {
19
- displayName: "Output File Path",
20
- name: "outputPath",
21
- type: "string",
22
- default: "",
23
- description: "Optional path to write output file directly to disk (if omitted, results are returned in node output)",
24
- displayOptions: {
25
- show: {
26
- operation: ["color"],
27
- },
28
- },
29
- },
30
- {
31
- displayName: "Additional Flags",
32
- name: "additionalArgs",
33
- type: "string",
34
- default: "",
35
- description: "Additional raw command line arguments to pass to qsv color",
36
- displayOptions: {
37
- show: {
38
- operation: ["color"],
39
- },
40
- },
41
- },
42
- {
43
- displayName: "Options",
44
- name: "options",
45
- type: "collection",
46
- placeholder: "Add Option",
47
- default: {},
48
- displayOptions: {
49
- show: {
50
- operation: ["color"],
51
- },
52
- },
53
- options: [
54
- {
55
- displayName: "Color",
56
- name: "color",
57
- type: "boolean",
58
- default: false,
59
- description: "Force color on, even in situations where colors",
60
- },
61
- {
62
- displayName: "Row Numbers",
63
- name: "rowNumbers",
64
- type: "boolean",
65
- default: false,
66
- description: "Show row numbers.",
67
- },
68
- {
69
- displayName: "Title",
70
- name: "title",
71
- type: "string",
72
- default: "",
73
- description: "Add a title row above the headers.",
74
- },
75
- {
76
- displayName: "Delimiter",
77
- name: "delimiter",
78
- type: "string",
79
- default: "",
80
- description: "The field delimiter for reading CSV data.",
81
- },
82
- {
83
- displayName: "Memcheck",
84
- name: "memcheck",
85
- type: "boolean",
86
- default: false,
87
- description: "Check if there is enough memory to load the entire",
88
- },
89
- ],
90
- },
91
- ];
@@ -1,2 +0,0 @@
1
- import type { INodeProperties } from "n8n-workflow";
2
- export declare const LensDescription: INodeProperties[];