n8n-nodes-mq 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +90 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/Mq/Mq.node.d.ts +6 -0
- package/dist/nodes/Mq/Mq.node.d.ts.map +1 -0
- package/dist/nodes/Mq/Mq.node.js +177 -0
- package/dist/nodes/Mq/Mq.node.js.map +1 -0
- package/dist/nodes/Mq/MqEngine.d.ts +48 -0
- package/dist/nodes/Mq/MqEngine.d.ts.map +1 -0
- package/dist/nodes/Mq/MqEngine.js +172 -0
- package/dist/nodes/Mq/MqEngine.js.map +1 -0
- package/dist/nodes/Mq/mq.svg +10 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Mauricio Perera
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# n8n-nodes-mq
|
|
2
|
+
|
|
3
|
+
n8n community node for processing Markdown using the **mq** query language.
|
|
4
|
+
|
|
5
|
+
[mq](https://github.com/harehare/mq) is a jq-like tool for Markdown - slice, filter, map, and transform structured data from Markdown files.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Query**: Run mq queries on Markdown content (extract headers, code blocks, lists, etc.)
|
|
10
|
+
- **Extract Sections**: Split matching sections into separate n8n items
|
|
11
|
+
- **Format Query**: Format mq query strings
|
|
12
|
+
- **Validate Query**: Check if mq queries are valid
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### In n8n (Community Nodes)
|
|
17
|
+
|
|
18
|
+
1. Go to **Settings > Community Nodes**
|
|
19
|
+
2. Select **Install**
|
|
20
|
+
3. Enter `n8n-nodes-mq`
|
|
21
|
+
4. Click **Install**
|
|
22
|
+
|
|
23
|
+
### Manual Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install n8n-nodes-mq
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Operations
|
|
30
|
+
|
|
31
|
+
### Query
|
|
32
|
+
|
|
33
|
+
Run an mq query and get the result as a string.
|
|
34
|
+
|
|
35
|
+
**Parameters:**
|
|
36
|
+
- **Markdown Content**: The Markdown to process
|
|
37
|
+
- **Query**: The mq query (e.g., `.h`, `.h2`, `.code`)
|
|
38
|
+
- **Input Format**: markdown, mdx, or html
|
|
39
|
+
- **Output Field**: Name of the result field
|
|
40
|
+
|
|
41
|
+
### Extract Sections
|
|
42
|
+
|
|
43
|
+
Extract matching sections as separate items - useful for batch processing.
|
|
44
|
+
|
|
45
|
+
**Parameters:**
|
|
46
|
+
- **Markdown Content**: The Markdown to process
|
|
47
|
+
- **Query**: The mq query
|
|
48
|
+
- **Split By**: How to split (line breaks or single items)
|
|
49
|
+
|
|
50
|
+
### Format Query
|
|
51
|
+
|
|
52
|
+
Format an mq query string for readability.
|
|
53
|
+
|
|
54
|
+
### Validate Query
|
|
55
|
+
|
|
56
|
+
Check if a query is valid and get diagnostic information.
|
|
57
|
+
|
|
58
|
+
## Query Examples
|
|
59
|
+
|
|
60
|
+
| Query | Description |
|
|
61
|
+
|-------|-------------|
|
|
62
|
+
| `.h` | All headers |
|
|
63
|
+
| `.h1` | Only h1 headers |
|
|
64
|
+
| `.h2` | Only h2 headers |
|
|
65
|
+
| `.code` | All code blocks |
|
|
66
|
+
| `.blockquote` | All blockquotes |
|
|
67
|
+
| `.link` | All links |
|
|
68
|
+
| `.h2 \| select(contains("API"))` | h2 headers containing "API" |
|
|
69
|
+
|
|
70
|
+
## Example Workflow
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
[HTTP Request] → [MQ: .h2] → [Extract Sections] → [For Each Item]
|
|
74
|
+
↓ ↓ ↓ ↓
|
|
75
|
+
Fetch doc Query headers Split items Process each header
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Requirements
|
|
79
|
+
|
|
80
|
+
- n8n version 1.0.0 or later
|
|
81
|
+
- No external dependencies (uses WebAssembly)
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT
|
|
86
|
+
|
|
87
|
+
## Credits
|
|
88
|
+
|
|
89
|
+
- [mq](https://github.com/harehare/mq) by harehare - The underlying Markdown query tool
|
|
90
|
+
- Built with [n8n](https://n8n.io)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,OAAO,EAAE,EAAE,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mq = void 0;
|
|
4
|
+
const Mq_node_1 = require("./nodes/Mq/Mq.node");
|
|
5
|
+
Object.defineProperty(exports, "Mq", { enumerable: true, get: function () { return Mq_node_1.Mq; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,gDAAwC;AAE/B,mFAFA,YAAE,OAEA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class Mq implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=Mq.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mq.node.d.ts","sourceRoot":"","sources":["../../../nodes/Mq/Mq.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAGpB,MAAM,cAAc,CAAC;AAItB,qBAAa,EAAG,YAAW,SAAS;IACnC,WAAW,EAAE,oBAAoB,CAoF/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAgFvE"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mq = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const MqEngine_1 = require("./MqEngine");
|
|
6
|
+
class Mq {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'MQ (Markdown Query)',
|
|
10
|
+
name: 'mq',
|
|
11
|
+
icon: 'file:mq.svg',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
15
|
+
description: 'Process Markdown using mq query language - filter, transform and extract data like jq for JSON',
|
|
16
|
+
defaults: {
|
|
17
|
+
name: 'MQ',
|
|
18
|
+
},
|
|
19
|
+
inputs: ['main'],
|
|
20
|
+
outputs: ['main'],
|
|
21
|
+
properties: [
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Operation',
|
|
24
|
+
name: 'operation',
|
|
25
|
+
type: 'options',
|
|
26
|
+
noDataExpression: true,
|
|
27
|
+
options: [
|
|
28
|
+
{ name: 'Query', value: 'query', description: 'Run an mq query on Markdown content', action: 'Run mq query' },
|
|
29
|
+
{ name: 'Extract Sections', value: 'extractSections', description: 'Extract matching sections as separate items', action: 'Extract sections' },
|
|
30
|
+
{ name: 'Format Query', value: 'format', description: 'Format an mq query string', action: 'Format mq query' },
|
|
31
|
+
{ name: 'Validate Query', value: 'validate', description: 'Check if an mq query is valid', action: 'Validate mq query' },
|
|
32
|
+
],
|
|
33
|
+
default: 'query',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
displayName: 'Markdown Content',
|
|
37
|
+
name: 'content',
|
|
38
|
+
type: 'string',
|
|
39
|
+
typeOptions: { rows: 10 },
|
|
40
|
+
default: '',
|
|
41
|
+
required: true,
|
|
42
|
+
description: 'The Markdown content to process',
|
|
43
|
+
displayOptions: { show: { operation: ['query', 'extractSections'] } },
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Query',
|
|
47
|
+
name: 'query',
|
|
48
|
+
type: 'string',
|
|
49
|
+
default: '.h',
|
|
50
|
+
required: true,
|
|
51
|
+
description: 'The mq query. Examples: .h (headers), .h2, .code, .blockquote',
|
|
52
|
+
displayOptions: { show: { operation: ['query', 'extractSections', 'format', 'validate'] } },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Input Format',
|
|
56
|
+
name: 'inputFormat',
|
|
57
|
+
type: 'options',
|
|
58
|
+
options: [
|
|
59
|
+
{ name: 'Markdown', value: 'markdown' },
|
|
60
|
+
{ name: 'MDX', value: 'mdx' },
|
|
61
|
+
{ name: 'HTML', value: 'html' },
|
|
62
|
+
],
|
|
63
|
+
default: 'markdown',
|
|
64
|
+
displayOptions: { show: { operation: ['query', 'extractSections'] } },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Split By',
|
|
68
|
+
name: 'splitBy',
|
|
69
|
+
type: 'options',
|
|
70
|
+
options: [
|
|
71
|
+
{ name: 'Line Breaks', value: 'lines' },
|
|
72
|
+
{ name: 'Single Items', value: 'single' },
|
|
73
|
+
],
|
|
74
|
+
default: 'lines',
|
|
75
|
+
displayOptions: { show: { operation: ['extractSections'] } },
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Output Field',
|
|
79
|
+
name: 'outputField',
|
|
80
|
+
type: 'string',
|
|
81
|
+
default: 'result',
|
|
82
|
+
displayOptions: { show: { operation: ['query', 'format'] } },
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Include Original',
|
|
86
|
+
name: 'includeOriginal',
|
|
87
|
+
type: 'boolean',
|
|
88
|
+
default: false,
|
|
89
|
+
displayOptions: { show: { operation: ['query', 'extractSections'] } },
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async execute() {
|
|
95
|
+
const items = this.getInputData();
|
|
96
|
+
const returnData = [];
|
|
97
|
+
for (let i = 0; i < items.length; i++) {
|
|
98
|
+
try {
|
|
99
|
+
const operation = this.getNodeParameter('operation', i);
|
|
100
|
+
let result = {};
|
|
101
|
+
switch (operation) {
|
|
102
|
+
case 'query': {
|
|
103
|
+
const content = this.getNodeParameter('content', i);
|
|
104
|
+
const query = this.getNodeParameter('query', i);
|
|
105
|
+
const inputFormat = this.getNodeParameter('inputFormat', i);
|
|
106
|
+
const outputField = this.getNodeParameter('outputField', i);
|
|
107
|
+
const includeOriginal = this.getNodeParameter('includeOriginal', i);
|
|
108
|
+
const queryResult = await (0, MqEngine_1.run)(query, content, { inputFormat });
|
|
109
|
+
result = { success: true, [outputField]: queryResult, query };
|
|
110
|
+
if (includeOriginal)
|
|
111
|
+
result.original = content;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
case 'extractSections': {
|
|
115
|
+
const content = this.getNodeParameter('content', i);
|
|
116
|
+
const query = this.getNodeParameter('query', i);
|
|
117
|
+
const inputFormat = this.getNodeParameter('inputFormat', i);
|
|
118
|
+
const splitBy = this.getNodeParameter('splitBy', i);
|
|
119
|
+
const includeOriginal = this.getNodeParameter('includeOriginal', i);
|
|
120
|
+
const queryResult = await (0, MqEngine_1.run)(query, content, { inputFormat });
|
|
121
|
+
let sections;
|
|
122
|
+
if (splitBy === "lines") {
|
|
123
|
+
sections = queryResult.split("\n\n").map(s => s.trim()).filter(s => s.length > 0);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
sections = queryResult.split("\n").map(s => s.trim()).filter(s => s.length > 0);
|
|
127
|
+
}
|
|
128
|
+
for (let j = 0; j < sections.length; j++) {
|
|
129
|
+
const sectionResult = {
|
|
130
|
+
success: true, section: sections[j], index: j, total: sections.length, query,
|
|
131
|
+
};
|
|
132
|
+
if (includeOriginal)
|
|
133
|
+
sectionResult.original = content;
|
|
134
|
+
returnData.push({ json: sectionResult, pairedItem: { item: i } });
|
|
135
|
+
}
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
case 'format': {
|
|
139
|
+
const query = this.getNodeParameter('query', i);
|
|
140
|
+
const outputField = this.getNodeParameter('outputField', i);
|
|
141
|
+
const formatted = await (0, MqEngine_1.format)(query);
|
|
142
|
+
result = { success: true, [outputField]: formatted, original: query };
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
case 'validate': {
|
|
146
|
+
const query = this.getNodeParameter('query', i);
|
|
147
|
+
const diags = await (0, MqEngine_1.diagnostics)(query);
|
|
148
|
+
const isValid = diags.length === 0;
|
|
149
|
+
let ast;
|
|
150
|
+
if (isValid) {
|
|
151
|
+
try {
|
|
152
|
+
ast = await (0, MqEngine_1.toAst)(query);
|
|
153
|
+
}
|
|
154
|
+
catch { }
|
|
155
|
+
}
|
|
156
|
+
result = { success: true, valid: isValid, query, diagnostics: diags, ...(ast && { ast }) };
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
default:
|
|
160
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Unknown operation: ' + operation);
|
|
161
|
+
}
|
|
162
|
+
returnData.push({ json: result, pairedItem: { item: i } });
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
if (this.continueOnFail()) {
|
|
166
|
+
returnData.push({ json: { success: false, error: error instanceof Error ? error.message : String(error) }, pairedItem: { item: i } });
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return [returnData];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.Mq = Mq;
|
|
177
|
+
//# sourceMappingURL=Mq.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mq.node.js","sourceRoot":"","sources":["../../../nodes/Mq/Mq.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,yCAA2E;AAE3E,MAAa,EAAE;IAAf;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,qBAAqB;YACl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mq-web WASM module
|
|
3
|
+
*
|
|
4
|
+
* mq-web is designed for browsers and uses fetch to load its WASM file.
|
|
5
|
+
* This wrapper patches fetch to work in Node.js by loading the WASM
|
|
6
|
+
* file from the filesystem.
|
|
7
|
+
*/
|
|
8
|
+
export interface MqRunOptions {
|
|
9
|
+
isUpdate?: boolean;
|
|
10
|
+
inputFormat?: 'markdown' | 'mdx' | 'html';
|
|
11
|
+
listStyle?: 'dash' | 'star' | 'plus';
|
|
12
|
+
linkUrlStyle?: 'none' | 'inline' | 'reference';
|
|
13
|
+
linkTitleStyle?: 'paren' | 'quote';
|
|
14
|
+
}
|
|
15
|
+
export interface MqDiagnostic {
|
|
16
|
+
startLine: number;
|
|
17
|
+
startColumn: number;
|
|
18
|
+
endLine: number;
|
|
19
|
+
endColumn: number;
|
|
20
|
+
message: string;
|
|
21
|
+
severity: string;
|
|
22
|
+
}
|
|
23
|
+
export interface MqDefinedValue {
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Run an mq query on markdown content
|
|
30
|
+
*/
|
|
31
|
+
export declare function run(query: string, content: string, options?: MqRunOptions): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Format an mq query
|
|
34
|
+
*/
|
|
35
|
+
export declare function format(query: string): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Get diagnostics for an mq query
|
|
38
|
+
*/
|
|
39
|
+
export declare function diagnostics(query: string): Promise<MqDiagnostic[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Get the AST of an mq query
|
|
42
|
+
*/
|
|
43
|
+
export declare function toAst(query: string): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Get defined values from an mq query
|
|
46
|
+
*/
|
|
47
|
+
export declare function definedValues(query: string, module?: string): Promise<MqDefinedValue[]>;
|
|
48
|
+
//# sourceMappingURL=MqEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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AM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,cAAc,EAAE,CAAC,CAI3B"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MqEngine - Node.js wrapper for mq-web WASM module
|
|
4
|
+
*
|
|
5
|
+
* mq-web is designed for browsers and uses fetch to load its WASM file.
|
|
6
|
+
* This wrapper patches fetch to work in Node.js by loading the WASM
|
|
7
|
+
* file from the filesystem.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.run = run;
|
|
44
|
+
exports.format = format;
|
|
45
|
+
exports.diagnostics = diagnostics;
|
|
46
|
+
exports.toAst = toAst;
|
|
47
|
+
exports.definedValues = definedValues;
|
|
48
|
+
const fs_1 = require("fs");
|
|
49
|
+
const path_1 = require("path");
|
|
50
|
+
let mqModule = null;
|
|
51
|
+
let initPromise = null;
|
|
52
|
+
let wasmInitialized = false;
|
|
53
|
+
let wasmBuffer = null;
|
|
54
|
+
let originalFetch = null;
|
|
55
|
+
/**
|
|
56
|
+
* Setup fetch patch for WASM loading
|
|
57
|
+
*/
|
|
58
|
+
function setupFetchPatch() {
|
|
59
|
+
if (originalFetch)
|
|
60
|
+
return; // Already patched
|
|
61
|
+
// Find the WASM file
|
|
62
|
+
const possiblePaths = [
|
|
63
|
+
(0, path_1.join)(__dirname, '../../node_modules/mq-web/dist/mq_wasm_bg.wasm'),
|
|
64
|
+
(0, path_1.join)(__dirname, '../../../node_modules/mq-web/dist/mq_wasm_bg.wasm'),
|
|
65
|
+
(0, path_1.join)((0, path_1.dirname)(require.resolve('mq-web')), 'mq_wasm_bg.wasm'),
|
|
66
|
+
];
|
|
67
|
+
for (const wasmPath of possiblePaths) {
|
|
68
|
+
try {
|
|
69
|
+
wasmBuffer = (0, fs_1.readFileSync)(wasmPath);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (!wasmBuffer) {
|
|
77
|
+
throw new Error('Could not find mq_wasm_bg.wasm file');
|
|
78
|
+
}
|
|
79
|
+
// Store original fetch and patch it
|
|
80
|
+
originalFetch = globalThis.fetch;
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
globalThis.fetch = async (input, init) => {
|
|
83
|
+
const url = String(input);
|
|
84
|
+
if (url.includes('mq_wasm_bg.wasm') || url.endsWith('.wasm')) {
|
|
85
|
+
return new Response(wasmBuffer, {
|
|
86
|
+
status: 200,
|
|
87
|
+
headers: { 'Content-Type': 'application/wasm' },
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return originalFetch(input, init);
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Initialize the mq WASM module for Node.js
|
|
95
|
+
*/
|
|
96
|
+
async function initMq() {
|
|
97
|
+
if (mqModule && wasmInitialized) {
|
|
98
|
+
return mqModule;
|
|
99
|
+
}
|
|
100
|
+
if (initPromise) {
|
|
101
|
+
await initPromise;
|
|
102
|
+
return mqModule;
|
|
103
|
+
}
|
|
104
|
+
initPromise = (async () => {
|
|
105
|
+
setupFetchPatch();
|
|
106
|
+
const mq = await Promise.resolve().then(() => __importStar(require('mq-web')));
|
|
107
|
+
mqModule = mq;
|
|
108
|
+
})();
|
|
109
|
+
await initPromise;
|
|
110
|
+
return mqModule;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Ensure WASM is loaded
|
|
114
|
+
*/
|
|
115
|
+
async function ensureWasmLoaded() {
|
|
116
|
+
if (wasmInitialized)
|
|
117
|
+
return;
|
|
118
|
+
const mq = await initMq();
|
|
119
|
+
await mq.format('.h');
|
|
120
|
+
wasmInitialized = true;
|
|
121
|
+
if (originalFetch) {
|
|
122
|
+
globalThis.fetch = originalFetch;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Run an mq query on markdown content
|
|
127
|
+
*/
|
|
128
|
+
async function run(query, content, options) {
|
|
129
|
+
await ensureWasmLoaded();
|
|
130
|
+
const mq = await initMq();
|
|
131
|
+
return mq.run(query, content, {
|
|
132
|
+
isUpdate: false,
|
|
133
|
+
inputFormat: 'markdown',
|
|
134
|
+
listStyle: 'dash',
|
|
135
|
+
linkUrlStyle: 'none',
|
|
136
|
+
linkTitleStyle: 'paren',
|
|
137
|
+
...options,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Format an mq query
|
|
142
|
+
*/
|
|
143
|
+
async function format(query) {
|
|
144
|
+
await ensureWasmLoaded();
|
|
145
|
+
const mq = await initMq();
|
|
146
|
+
return mq.format(query);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get diagnostics for an mq query
|
|
150
|
+
*/
|
|
151
|
+
async function diagnostics(query) {
|
|
152
|
+
await ensureWasmLoaded();
|
|
153
|
+
const mq = await initMq();
|
|
154
|
+
return mq.diagnostics(query);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get the AST of an mq query
|
|
158
|
+
*/
|
|
159
|
+
async function toAst(query) {
|
|
160
|
+
await ensureWasmLoaded();
|
|
161
|
+
const mq = await initMq();
|
|
162
|
+
return mq.toAst(query);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Get defined values from an mq query
|
|
166
|
+
*/
|
|
167
|
+
async function definedValues(query, module) {
|
|
168
|
+
await ensureWasmLoaded();
|
|
169
|
+
const mq = await initMq();
|
|
170
|
+
return mq.definedValues(query, module);
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=MqEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MqEngine.js","sourceRoot":"","sources":["../../../nodes/Mq/MqEngine.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIH,kBAeC;AAKD,wBAIC;AAKD,kCAIC;AAKD,sBAIC;AAKD,sCAOC;AApLD,2BAAkC;AAClC,+BAAqC;AAkCrC,IAAI,QAAQ,GAAoB,IAAI,CAAC;AACrC,IAAI,WAAW,GAAyB,IAAI,CAAC;AAC7C,IAAI,eAAe,GA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zB,MAAM,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,WAAW,CAAC,KAAa;IAC7C,MAAM,gBAAgB,EAAE,CAAC;IACzB,MAAM,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,KAAK,CAAC,KAAa;IACvC,MAAM,gBAAgB,EAAE,CAAC;IACzB,MAAM,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,aAAa,CACjC,KAAa,EACb,MAAe;IAEf,MAAM,gBAAgB,EAAE,CAAC;IACzB,MAAM,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" />
|
|
5
|
+
<stop offset="100%" style="stop-color:#8b5cf6;stop-opacity:1" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect x="5" y="5" width="90" height="90" rx="15" fill="url(#grad)"/>
|
|
9
|
+
<text x="50" y="72" font-family="Arial, sans-serif" font-size="55" font-weight="bold" fill="white" text-anchor="middle">mq</text>
|
|
10
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-mq",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for processing Markdown using mq query language - filter, transform and extract structured data from Markdown files",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Mauricio Perera",
|
|
7
|
+
"email": "mauricio.perera@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/MauricioPerera/n8n-nodes-mq.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"n8n",
|
|
15
|
+
"n8n-community-node-package",
|
|
16
|
+
"markdown",
|
|
17
|
+
"mq",
|
|
18
|
+
"jq",
|
|
19
|
+
"transform",
|
|
20
|
+
"filter",
|
|
21
|
+
"extract",
|
|
22
|
+
"query"
|
|
23
|
+
],
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"type": "commonjs",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc && shx cp nodes/Mq/*.svg dist/nodes/Mq/",
|
|
29
|
+
"dev": "tsc --watch",
|
|
30
|
+
"lint": "eslint nodes --ext .ts",
|
|
31
|
+
"lintfix": "eslint nodes --ext .ts --fix",
|
|
32
|
+
"prepublishOnly": "npm run build && npm run lint",
|
|
33
|
+
"release": "npm run build && npm publish --access public"
|
|
34
|
+
},
|
|
35
|
+
"n8n": {
|
|
36
|
+
"n8nNodesApiVersion": 1,
|
|
37
|
+
"nodes": [
|
|
38
|
+
"dist/nodes/Mq/Mq.node.js"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist"
|
|
43
|
+
],
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"mq-web": "^0.5.8"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^20.0.0",
|
|
49
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
50
|
+
"eslint": "^8.57.0",
|
|
51
|
+
"eslint-plugin-n8n-nodes-base": "^1.16.0",
|
|
52
|
+
"n8n-workflow": "^1.0.0",
|
|
53
|
+
"shx": "^0.3.4",
|
|
54
|
+
"typescript": "^5.3.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"n8n-workflow": "*"
|
|
58
|
+
}
|
|
59
|
+
}
|