@couleetech/n8n-nodes-enlightenedmsp 0.0.1 → 1.0.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.
Files changed (33) hide show
  1. package/dist/credentials/EnlightenedMspGraphql.credentials.d.ts +8 -0
  2. package/dist/credentials/EnlightenedMspGraphql.credentials.js +40 -0
  3. package/dist/nodes/EnlightenedMsp/GraphqlBase.d.ts +13 -0
  4. package/dist/nodes/EnlightenedMsp/GraphqlBase.js +50 -0
  5. package/dist/nodes/EnlightenedMsp/{McpClient.node.d.ts → UpdateTicket.node.d.ts} +1 -1
  6. package/dist/nodes/EnlightenedMsp/UpdateTicket.node.js +135 -0
  7. package/dist/nodes/EnlightenedMsp/enlightenedmsp.svg +490 -0
  8. package/dist/nodes/EnlightenedMsp/index.d.ts +2 -1
  9. package/dist/nodes/EnlightenedMsp/index.js +3 -1
  10. package/package.json +5 -3
  11. package/dist/credentials/BraveSearchApi.credentials.d.ts +0 -9
  12. package/dist/credentials/BraveSearchApi.credentials.js +0 -47
  13. package/dist/credentials/BraveSearchApi.credentials.js.map +0 -1
  14. package/dist/credentials/McpClientApi.credentials.d.ts +0 -7
  15. package/dist/credentials/McpClientApi.credentials.js +0 -29
  16. package/dist/nodes/BraveSearch/BraveSearch.node.d.ts +0 -5
  17. package/dist/nodes/BraveSearch/BraveSearch.node.js +0 -213
  18. package/dist/nodes/BraveSearch/BraveSearch.node.js.map +0 -1
  19. package/dist/nodes/BraveSearch/brave-logo-sans-text.svg +0 -1
  20. package/dist/nodes/BraveSearch/types.d.ts +0 -21
  21. package/dist/nodes/BraveSearch/types.js +0 -2
  22. package/dist/nodes/BraveSearch/types.js.map +0 -1
  23. package/dist/nodes/BraveSearchTool/BraveSearchTool.node.d.ts +0 -7
  24. package/dist/nodes/BraveSearchTool/BraveSearchTool.node.js +0 -208
  25. package/dist/nodes/BraveSearchTool/brave-logo-sans-text.svg +0 -1
  26. package/dist/nodes/EnlightenedMsp/McpClient.node.js +0 -95
  27. package/dist/nodes/EnlightenedMsp/mcpClient.svg +0 -7
  28. package/dist/nodes/McpClient/McpClient.node.d.ts +0 -5
  29. package/dist/nodes/McpClient/McpClient.node.js +0 -95
  30. package/dist/nodes/McpClient/mcpClient.svg +0 -7
  31. package/dist/nodes/NpmSearch/NpmSearch.node.d.ts +0 -5
  32. package/dist/nodes/NpmSearch/NpmSearch.node.js +0 -94
  33. package/dist/nodes/NpmSearch/npm.svg +0 -5
@@ -1,213 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.BraveSearch = void 0;
7
- const n8n_workflow_1 = require("n8n-workflow");
8
- const axios_1 = __importDefault(require("axios"));
9
- class BraveSearch {
10
- constructor() {
11
- this.description = {
12
- displayName: 'Brave Search',
13
- name: 'braveSearch',
14
- icon: 'file:brave-logo-sans-text.svg',
15
- group: ['transform'],
16
- version: 1,
17
- subtitle: '={{$parameter["operation"]}}',
18
- description: 'Make requests to Brave Search API',
19
- defaults: {
20
- name: 'Brave Search',
21
- },
22
- inputs: ['main'],
23
- outputs: ['main'],
24
- credentials: [
25
- {
26
- name: 'braveSearchApi',
27
- required: true,
28
- },
29
- ],
30
- properties: [
31
- {
32
- displayName: 'Operation',
33
- name: 'operation',
34
- type: 'options',
35
- noDataExpression: true,
36
- options: [
37
- {
38
- name: 'Web Search',
39
- value: 'webSearch',
40
- description: 'Perform a web search',
41
- action: 'Perform a web search',
42
- },
43
- ],
44
- default: 'webSearch',
45
- },
46
- {
47
- displayName: 'Query',
48
- name: 'query',
49
- type: 'string',
50
- default: '',
51
- required: true,
52
- displayOptions: {
53
- show: {
54
- operation: ['webSearch'],
55
- },
56
- },
57
- description: 'The search query to execute',
58
- },
59
- {
60
- displayName: 'Additional Fields',
61
- name: 'additionalFields',
62
- type: 'collection',
63
- placeholder: 'Add Field',
64
- default: {},
65
- displayOptions: {
66
- show: {
67
- operation: ['webSearch'],
68
- },
69
- },
70
- options: [
71
- {
72
- displayName: 'Country',
73
- name: 'country',
74
- type: 'string',
75
- default: '',
76
- description: 'Country code for search results (e.g., US, GB)',
77
- },
78
- {
79
- displayName: 'Results Count',
80
- name: 'count',
81
- type: 'number',
82
- typeOptions: {
83
- minValue: 1,
84
- maxValue: 20,
85
- },
86
- default: 10,
87
- description: 'Number of results to return (max: 20)',
88
- },
89
- {
90
- displayName: 'Offset',
91
- name: 'offset',
92
- type: 'number',
93
- typeOptions: {
94
- minValue: 0,
95
- },
96
- default: 0,
97
- description: 'Offset for pagination',
98
- },
99
- {
100
- displayName: 'Safe Search',
101
- name: 'safesearch',
102
- type: 'options',
103
- options: [
104
- {
105
- name: 'Strict',
106
- value: 'strict',
107
- },
108
- {
109
- name: 'Moderate',
110
- value: 'moderate',
111
- },
112
- {
113
- name: 'Off',
114
- value: 'off',
115
- },
116
- ],
117
- default: 'moderate',
118
- description: 'Safe search setting',
119
- },
120
- ],
121
- },
122
- ],
123
- };
124
- }
125
- async execute() {
126
- var _a, _b, _c, _d, _e;
127
- const items = this.getInputData();
128
- const returnData = [];
129
- let query = '';
130
- let params;
131
- for (let i = 0; i < items.length; i++) {
132
- try {
133
- const operation = this.getNodeParameter('operation', i);
134
- if (operation === 'webSearch') {
135
- query = this.getNodeParameter('query', i);
136
- const additionalFields = this.getNodeParameter('additionalFields', i);
137
- const credentials = await this.getCredentials('braveSearchApi');
138
- if (!(credentials === null || credentials === void 0 ? void 0 : credentials.apiKey)) {
139
- throw new Error('No API key provided in credentials');
140
- }
141
- params = {
142
- q: query,
143
- ...additionalFields,
144
- };
145
- try {
146
- const response = await axios_1.default.get('https://api.search.brave.com/res/v1/web/search', {
147
- params,
148
- headers: {
149
- 'X-Subscription-Token': credentials.apiKey,
150
- 'Accept': 'application/json',
151
- },
152
- });
153
- console.log('Response status:', response.status);
154
- console.log('Response data structure:', Object.keys(response.data));
155
- if (!response.data) {
156
- throw new Error('Empty response from Brave Search API');
157
- }
158
- if (!response.data.web || !Array.isArray(response.data.web.results)) {
159
- throw new Error(`Invalid response structure. Got: ${JSON.stringify(response.data)}`);
160
- }
161
- const responseData = {
162
- ...response.data,
163
- web: {
164
- ...(response.data.web || {}),
165
- results: response.data.web.results.map((result) => ({
166
- ...result,
167
- title: result.title || '',
168
- url: result.url || '',
169
- description: result.description || ''
170
- }))
171
- }
172
- };
173
- returnData.push({
174
- json: responseData,
175
- pairedItem: i,
176
- });
177
- }
178
- catch (error) {
179
- if (axios_1.default.isAxiosError(error)) {
180
- throw new Error(`API Request failed: ${error.message}. ` +
181
- `Status: ${(_a = error.response) === null || _a === void 0 ? void 0 : _a.status}. ` +
182
- `Response: ${JSON.stringify((_b = error.response) === null || _b === void 0 ? void 0 : _b.data)}`);
183
- }
184
- throw error;
185
- }
186
- }
187
- }
188
- catch (error) {
189
- if (this.continueOnFail()) {
190
- returnData.push({
191
- json: {
192
- error: error.message,
193
- details: ((_c = error.response) === null || _c === void 0 ? void 0 : _c.data) || 'No additional error details available',
194
- status: ((_d = error.response) === null || _d === void 0 ? void 0 : _d.status) || 'Unknown status',
195
- query: query || 'No query provided',
196
- params: params || 'No params available'
197
- },
198
- pairedItem: i,
199
- });
200
- continue;
201
- }
202
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Execution failed: ${error.message}`, {
203
- description: ((_e = error.response) === null || _e === void 0 ? void 0 : _e.data)
204
- ? `API Response: ${JSON.stringify(error.response.data)}`
205
- : undefined,
206
- itemIndex: i,
207
- });
208
- }
209
- }
210
- return [returnData];
211
- }
212
- }
213
- exports.BraveSearch = BraveSearch;
@@ -1 +0,0 @@
1
- {"version":3,"file":"BraveSearch.node.js","sourceRoot":"","sources":["../../../nodes/BraveSearch/BraveSearch.node.ts"],"names":[],"mappings":";;;;;;AAAA,+CAOsB;AACtB,kDAA6C;AAO7C,MAAa,WAAW;IAAxB;QACI,gBAAW,GAAyB;YAChC,WA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AAE,CAAC;qBAChB,CAAC,CAAC;iBACN;aACJ;YAAC,OAAO,KAAK,EAAE;gBACZ,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE;oBACvB,UAAU,CAAC,IAAI,CAAC;wBACZ,IAAI,EAAE;4BACF,KAAK,EAAE,KAAK,CAAC,OAAO;4BACpB,OAAO,EAAE,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,KAAI,uCAAuC;4BACxE,MAAM,EAAE,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,KAAI,gBAAgB;yBACrD;wBACD,UAAU,EAAE,CAAC;qBAChB,CAAC,CAAC;oBACH,SAAS;iBACZ;gBACD,MAAM,YAAY,GAAG,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI;oBACrC,CAAC,CAAC,cAAc,KAAK,CAAC,OAAO,cAAc,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;oBAChF,CAAC,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChC,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;aACzE;SACJ;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;CACJ;AA7LD,kCA6LC"}
@@ -1 +0,0 @@
1
- <svg width="56" height="64" viewBox="0 0 56 64" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M53.292 15.321l1.5-3.676s-1.909-2.043-4.227-4.358c-2.317-2.315-7.225-.953-7.225-.953L37.751 0H18.12l-5.589 6.334s-4.908-1.362-7.225.953C2.988 9.602 1.08 11.645 1.08 11.645l1.5 3.676-1.91 5.447s5.614 21.236 6.272 23.83c1.295 5.106 2.181 7.08 5.862 9.668 3.68 2.587 10.36 7.08 11.45 7.762 1.091.68 2.455 1.84 3.682 1.84 1.227 0 2.59-1.16 3.68-1.84 1.091-.681 7.77-5.175 11.452-7.762 3.68-2.587 4.567-4.562 5.862-9.668.657-2.594 6.27-23.83 6.27-23.83l-1.908-5.447z" fill="url(#paint0_linear)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M34.888 11.508c.818 0 6.885-1.157 6.885-1.157s7.189 8.68 7.189 10.536c0 1.534-.619 2.134-1.347 2.842-.152.148-.31.3-.467.468l-5.39 5.717a9.42 9.42 0 01-.176.18c-.538.54-1.33 1.336-.772 2.658l.115.269c.613 1.432 1.37 3.2.407 4.99-1.025 1.906-2.78 3.178-3.905 2.967-1.124-.21-3.766-1.589-4.737-2.218-.971-.63-4.05-3.166-4.05-4.137 0-.809 2.214-2.155 3.29-2.81.214-.13.383-.232.48-.298.111-.075.297-.19.526-.332.981-.61 2.754-1.71 2.799-2.197.055-.602.034-.778-.758-2.264-.168-.316-.365-.654-.568-1.004-.754-1.295-1.598-2.745-1.41-3.784.21-1.173 2.05-1.845 3.608-2.415.194-.07.385-.14.567-.209l1.623-.609c1.556-.582 3.284-1.229 3.57-1.36.394-.181.292-.355-.903-.468a54.655 54.655 0 01-.58-.06c-1.48-.157-4.209-.446-5.535-.077-.261.073-.553.152-.86.235-1.49.403-3.317.897-3.493 1.182-.03.05-.06.093-.089.133-.168.238-.277.394-.091 1.406.055.302.169.895.31 1.629.41 2.148 1.053 5.498 1.134 6.25.011.106.024.207.036.305.103.84.171 1.399-.805 1.622l-.255.058c-1.102.252-2.717.623-3.3.623-.584 0-2.2-.37-3.302-.623l-.254-.058c-.976-.223-.907-.782-.804-1.622.012-.098.024-.2.035-.305.081-.753.725-4.112 1.137-6.259.14-.73.253-1.32.308-1.62.185-1.012.076-1.168-.092-1.406a3.743 3.743 0 01-.09-.133c-.174-.285-2-.779-3.491-1.182-.307-.083-.6-.162-.86-.235-1.327-.37-4.055-.08-5.535.077-.226.024-.422.045-.58.06-1.196.113-1.297.287-.903.468.285.131 2.013.778 3.568 1.36.597.223 1.17.437 1.624.609.183.069.373.138.568.21 1.558.57 3.398 1.241 3.608 2.414.187 1.039-.657 2.489-1.41 3.784-.204.35-.4.688-.569 1.004-.791 1.486-.812 1.662-.757 2.264.044.488 1.816 1.587 2.798 2.197.229.142.415.257.526.332.098.066.266.168.48.298 1.076.654 3.29 2 3.29 2.81 0 .97-3.078 3.507-4.05 4.137-.97.63-3.612 2.008-4.737 2.218-1.124.21-2.88-1.061-3.904-2.966-.963-1.791-.207-3.559.406-4.99l.115-.27c.559-1.322-.233-2.118-.772-2.658a9.377 9.377 0 01-.175-.18l-5.39-5.717c-.158-.167-.316-.32-.468-.468-.728-.707-1.346-1.308-1.346-2.842 0-1.855 7.189-10.536 7.189-10.536s6.066 1.157 6.884 1.157c.653 0 1.913-.433 3.227-.885.333-.114.669-.23 1-.34 1.635-.545 2.726-.549 2.726-.549s1.09.004 2.726.549c.33.11.667.226 1 .34 1.313.452 2.574.885 3.226.885zm-1.041 30.706c1.282.66 2.192 1.128 2.536 1.343.445.278.174.803-.232 1.09-.405.285-5.853 4.499-6.381 4.965l-.215.191c-.509.459-1.159 1.044-1.62 1.044-.46 0-1.11-.586-1.62-1.044l-.213-.191c-.53-.466-5.977-4.68-6.382-4.966-.405-.286-.677-.81-.232-1.09.344-.214 1.255-.683 2.539-1.344l1.22-.629c1.92-.992 4.315-1.837 4.689-1.837.373 0 2.767.844 4.689 1.837.436.226.845.437 1.222.63z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M43.34 6.334L37.751 0H18.12l-5.589 6.334s-4.908-1.362-7.225.953c0 0 6.544-.59 8.793 3.064 0 0 6.066 1.157 6.884 1.157.818 0 2.59-.68 4.226-1.225 1.636-.545 2.727-.549 2.727-.549s1.09.004 2.726.549 3.408 1.225 4.226 1.225c.818 0 6.885-1.157 6.885-1.157 2.249-3.654 8.792-3.064 8.792-3.064-2.317-2.315-7.225-.953-7.225-.953z" fill="url(#paint1_linear)"/><defs><linearGradient id="paint0_linear" x1=".671" y1="64.319" x2="55.2" y2="64.319" gradientUnits="userSpaceOnUse"><stop stop-color="#F50"/><stop offset=".41" stop-color="#F50"/><stop offset=".582" stop-color="#FF2000"/><stop offset="1" stop-color="#FF2000"/></linearGradient><linearGradient id="paint1_linear" x1="6.278" y1="11.466" x2="50.565" y2="11.466" gradientUnits="userSpaceOnUse"><stop stop-color="#FF452A"/><stop offset="1" stop-color="#FF2000"/></linearGradient></defs></svg>
@@ -1,21 +0,0 @@
1
- import { IDataObject } from 'n8n-workflow';
2
- export interface IBraveSearchCredentials {
3
- apiKey: string;
4
- }
5
- export interface IBraveSearchParams extends IDataObject {
6
- q: string;
7
- country?: string;
8
- count?: number;
9
- offset?: number;
10
- safesearch?: 'strict' | 'moderate' | 'off';
11
- }
12
- export interface IBraveSearchResponse {
13
- web: {
14
- results: Array<{
15
- title: string;
16
- url: string;
17
- description: string;
18
- }>;
19
- total?: number;
20
- };
21
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../nodes/BraveSearch/types.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class BraveSearchTool implements INodeType {
3
- description: INodeTypeDescription & {
4
- usableAsTool?: boolean;
5
- };
6
- execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
7
- }
@@ -1,208 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.BraveSearchTool = void 0;
7
- const n8n_workflow_1 = require("n8n-workflow");
8
- const axios_1 = __importDefault(require("axios"));
9
- class BraveSearchTool {
10
- constructor() {
11
- this.description = {
12
- displayName: 'Brave Search Tool',
13
- name: 'braveSearchTool',
14
- icon: 'file:brave-logo-sans-text.svg',
15
- group: ['transform', 'output'],
16
- version: 1,
17
- subtitle: '={{$parameter["operation"]}}',
18
- description: 'Make requests to Brave Search API',
19
- defaults: {
20
- name: 'Brave Search Tool',
21
- },
22
- inputs: ["main"],
23
- outputs: ["main"],
24
- usableAsTool: true,
25
- credentials: [
26
- {
27
- name: 'braveSearchApi',
28
- required: true,
29
- },
30
- ],
31
- properties: [
32
- {
33
- displayName: 'Operation',
34
- name: 'operation',
35
- type: 'options',
36
- noDataExpression: true,
37
- options: [
38
- {
39
- name: 'Web Search',
40
- value: 'webSearch',
41
- description: 'Perform a web search',
42
- action: 'Perform a web search',
43
- },
44
- ],
45
- default: 'webSearch',
46
- },
47
- {
48
- displayName: 'Query',
49
- name: 'query',
50
- type: 'string',
51
- default: '',
52
- required: true,
53
- displayOptions: {
54
- show: {
55
- operation: ['webSearch'],
56
- },
57
- },
58
- description: 'The search query to execute',
59
- },
60
- {
61
- displayName: 'Additional Fields',
62
- name: 'additionalFields',
63
- type: 'collection',
64
- placeholder: 'Add Field',
65
- default: {},
66
- displayOptions: {
67
- show: {
68
- operation: ['webSearch'],
69
- },
70
- },
71
- options: [
72
- {
73
- displayName: 'Country',
74
- name: 'country',
75
- type: 'string',
76
- default: '',
77
- description: 'Country code for search results (e.g., US, GB)',
78
- },
79
- {
80
- displayName: 'Results Count',
81
- name: 'count',
82
- type: 'number',
83
- typeOptions: {
84
- minValue: 1,
85
- maxValue: 20,
86
- },
87
- default: 10,
88
- description: 'Number of results to return (max: 20)',
89
- },
90
- {
91
- displayName: 'Offset',
92
- name: 'offset',
93
- type: 'number',
94
- typeOptions: {
95
- minValue: 0,
96
- },
97
- default: 0,
98
- description: 'Offset for pagination',
99
- },
100
- {
101
- displayName: 'Safe Search',
102
- name: 'safesearch',
103
- type: 'options',
104
- options: [
105
- {
106
- name: 'Strict',
107
- value: 'strict',
108
- },
109
- {
110
- name: 'Moderate',
111
- value: 'moderate',
112
- },
113
- {
114
- name: 'Off',
115
- value: 'off',
116
- },
117
- ],
118
- default: 'moderate',
119
- description: 'Safe search setting',
120
- },
121
- ],
122
- },
123
- ],
124
- };
125
- }
126
- async execute() {
127
- var _a, _b, _c, _d, _e;
128
- const items = this.getInputData();
129
- const returnData = [];
130
- let query = '';
131
- let params;
132
- for (let i = 0; i < items.length; i++) {
133
- try {
134
- const operation = this.getNodeParameter('operation', i);
135
- if (operation === 'webSearch') {
136
- query = this.getNodeParameter('query', i);
137
- const additionalFields = this.getNodeParameter('additionalFields', i);
138
- const credentials = await this.getCredentials('braveSearchApi');
139
- if (!(credentials === null || credentials === void 0 ? void 0 : credentials.apiKey)) {
140
- throw new Error('No API key provided in credentials');
141
- }
142
- params = {
143
- q: query,
144
- ...additionalFields,
145
- };
146
- try {
147
- const response = await axios_1.default.get('https://api.search.brave.com/res/v1/web/search', {
148
- params,
149
- headers: {
150
- 'X-Subscription-Token': credentials.apiKey,
151
- 'Accept': 'application/json',
152
- },
153
- });
154
- if (!response.data) {
155
- throw new Error('Empty response from Brave Search API');
156
- }
157
- if (!response.data.web || !Array.isArray(response.data.web.results)) {
158
- throw new Error(`Invalid response structure. Got: ${JSON.stringify(response.data)}`);
159
- }
160
- const responseData = {
161
- ...response.data,
162
- web: {
163
- ...(response.data.web || {}),
164
- results: response.data.web.results.map((result) => ({
165
- ...result,
166
- title: result.title || '',
167
- url: result.url || '',
168
- description: result.description || ''
169
- }))
170
- }
171
- };
172
- const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
173
- returnData.push(...executionData);
174
- }
175
- catch (error) {
176
- if (axios_1.default.isAxiosError(error)) {
177
- throw new Error(`API Request failed: ${error.message}. ` +
178
- `Status: ${(_a = error.response) === null || _a === void 0 ? void 0 : _a.status}. ` +
179
- `Response: ${JSON.stringify((_b = error.response) === null || _b === void 0 ? void 0 : _b.data)}`);
180
- }
181
- throw error;
182
- }
183
- }
184
- }
185
- catch (error) {
186
- if (this.continueOnFail()) {
187
- const executionErrorData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray({
188
- error: error.message,
189
- details: ((_c = error.response) === null || _c === void 0 ? void 0 : _c.data) || 'No additional error details available',
190
- status: ((_d = error.response) === null || _d === void 0 ? void 0 : _d.status) || 'Unknown status',
191
- query: query || 'No query provided',
192
- params: params || 'No params available'
193
- }), { itemData: { item: i } });
194
- returnData.push(...executionErrorData);
195
- continue;
196
- }
197
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Execution failed: ${error.message}`, {
198
- description: ((_e = error.response) === null || _e === void 0 ? void 0 : _e.data)
199
- ? `API Response: ${JSON.stringify(error.response.data)}`
200
- : undefined,
201
- itemIndex: i,
202
- });
203
- }
204
- }
205
- return [returnData];
206
- }
207
- }
208
- exports.BraveSearchTool = BraveSearchTool;
@@ -1 +0,0 @@
1
- <svg width="56" height="64" viewBox="0 0 56 64" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M53.292 15.321l1.5-3.676s-1.909-2.043-4.227-4.358c-2.317-2.315-7.225-.953-7.225-.953L37.751 0H18.12l-5.589 6.334s-4.908-1.362-7.225.953C2.988 9.602 1.08 11.645 1.08 11.645l1.5 3.676-1.91 5.447s5.614 21.236 6.272 23.83c1.295 5.106 2.181 7.08 5.862 9.668 3.68 2.587 10.36 7.08 11.45 7.762 1.091.68 2.455 1.84 3.682 1.84 1.227 0 2.59-1.16 3.68-1.84 1.091-.681 7.77-5.175 11.452-7.762 3.68-2.587 4.567-4.562 5.862-9.668.657-2.594 6.27-23.83 6.27-23.83l-1.908-5.447z" fill="url(#paint0_linear)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M34.888 11.508c.818 0 6.885-1.157 6.885-1.157s7.189 8.68 7.189 10.536c0 1.534-.619 2.134-1.347 2.842-.152.148-.31.3-.467.468l-5.39 5.717a9.42 9.42 0 01-.176.18c-.538.54-1.33 1.336-.772 2.658l.115.269c.613 1.432 1.37 3.2.407 4.99-1.025 1.906-2.78 3.178-3.905 2.967-1.124-.21-3.766-1.589-4.737-2.218-.971-.63-4.05-3.166-4.05-4.137 0-.809 2.214-2.155 3.29-2.81.214-.13.383-.232.48-.298.111-.075.297-.19.526-.332.981-.61 2.754-1.71 2.799-2.197.055-.602.034-.778-.758-2.264-.168-.316-.365-.654-.568-1.004-.754-1.295-1.598-2.745-1.41-3.784.21-1.173 2.05-1.845 3.608-2.415.194-.07.385-.14.567-.209l1.623-.609c1.556-.582 3.284-1.229 3.57-1.36.394-.181.292-.355-.903-.468a54.655 54.655 0 01-.58-.06c-1.48-.157-4.209-.446-5.535-.077-.261.073-.553.152-.86.235-1.49.403-3.317.897-3.493 1.182-.03.05-.06.093-.089.133-.168.238-.277.394-.091 1.406.055.302.169.895.31 1.629.41 2.148 1.053 5.498 1.134 6.25.011.106.024.207.036.305.103.84.171 1.399-.805 1.622l-.255.058c-1.102.252-2.717.623-3.3.623-.584 0-2.2-.37-3.302-.623l-.254-.058c-.976-.223-.907-.782-.804-1.622.012-.098.024-.2.035-.305.081-.753.725-4.112 1.137-6.259.14-.73.253-1.32.308-1.62.185-1.012.076-1.168-.092-1.406a3.743 3.743 0 01-.09-.133c-.174-.285-2-.779-3.491-1.182-.307-.083-.6-.162-.86-.235-1.327-.37-4.055-.08-5.535.077-.226.024-.422.045-.58.06-1.196.113-1.297.287-.903.468.285.131 2.013.778 3.568 1.36.597.223 1.17.437 1.624.609.183.069.373.138.568.21 1.558.57 3.398 1.241 3.608 2.414.187 1.039-.657 2.489-1.41 3.784-.204.35-.4.688-.569 1.004-.791 1.486-.812 1.662-.757 2.264.044.488 1.816 1.587 2.798 2.197.229.142.415.257.526.332.098.066.266.168.48.298 1.076.654 3.29 2 3.29 2.81 0 .97-3.078 3.507-4.05 4.137-.97.63-3.612 2.008-4.737 2.218-1.124.21-2.88-1.061-3.904-2.966-.963-1.791-.207-3.559.406-4.99l.115-.27c.559-1.322-.233-2.118-.772-2.658a9.377 9.377 0 01-.175-.18l-5.39-5.717c-.158-.167-.316-.32-.468-.468-.728-.707-1.346-1.308-1.346-2.842 0-1.855 7.189-10.536 7.189-10.536s6.066 1.157 6.884 1.157c.653 0 1.913-.433 3.227-.885.333-.114.669-.23 1-.34 1.635-.545 2.726-.549 2.726-.549s1.09.004 2.726.549c.33.11.667.226 1 .34 1.313.452 2.574.885 3.226.885zm-1.041 30.706c1.282.66 2.192 1.128 2.536 1.343.445.278.174.803-.232 1.09-.405.285-5.853 4.499-6.381 4.965l-.215.191c-.509.459-1.159 1.044-1.62 1.044-.46 0-1.11-.586-1.62-1.044l-.213-.191c-.53-.466-5.977-4.68-6.382-4.966-.405-.286-.677-.81-.232-1.09.344-.214 1.255-.683 2.539-1.344l1.22-.629c1.92-.992 4.315-1.837 4.689-1.837.373 0 2.767.844 4.689 1.837.436.226.845.437 1.222.63z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M43.34 6.334L37.751 0H18.12l-5.589 6.334s-4.908-1.362-7.225.953c0 0 6.544-.59 8.793 3.064 0 0 6.066 1.157 6.884 1.157.818 0 2.59-.68 4.226-1.225 1.636-.545 2.727-.549 2.727-.549s1.09.004 2.726.549 3.408 1.225 4.226 1.225c.818 0 6.885-1.157 6.885-1.157 2.249-3.654 8.792-3.064 8.792-3.064-2.317-2.315-7.225-.953-7.225-.953z" fill="url(#paint1_linear)"/><defs><linearGradient id="paint0_linear" x1=".671" y1="64.319" x2="55.2" y2="64.319" gradientUnits="userSpaceOnUse"><stop stop-color="#F50"/><stop offset=".41" stop-color="#F50"/><stop offset=".582" stop-color="#FF2000"/><stop offset="1" stop-color="#FF2000"/></linearGradient><linearGradient id="paint1_linear" x1="6.278" y1="11.466" x2="50.565" y2="11.466" gradientUnits="userSpaceOnUse"><stop stop-color="#FF452A"/><stop offset="1" stop-color="#FF2000"/></linearGradient></defs></svg>
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.McpClient = void 0;
4
- const n8n_workflow_1 = require("n8n-workflow");
5
- const child_process_1 = require("child_process");
6
- class McpClient {
7
- constructor() {
8
- this.description = {
9
- displayName: 'MCP Client',
10
- name: 'mcpClient',
11
- icon: 'file:mcpClient.svg',
12
- group: ['transform'],
13
- version: 1,
14
- description: 'Provide Model Context Protocol (MCP) tools to AI nodes',
15
- defaults: {
16
- name: 'MCP Client',
17
- },
18
- inputs: ['main'],
19
- outputs: ["ai_tool"],
20
- credentials: [
21
- {
22
- name: 'mcpClientApi',
23
- required: true,
24
- },
25
- ],
26
- properties: [],
27
- };
28
- }
29
- async execute() {
30
- var _a;
31
- const credentials = await this.getCredentials('mcpClientApi');
32
- const command = credentials.command;
33
- const args = credentials.args;
34
- const executeMcpCommand = async (input) => {
35
- return new Promise((resolve, reject) => {
36
- const process = (0, child_process_1.spawn)(command, args);
37
- let stdout = '';
38
- let stderr = '';
39
- process.stdin.write(JSON.stringify(input) + '\n');
40
- process.stdin.end();
41
- process.stdout.on('data', (data) => {
42
- stdout += data.toString();
43
- });
44
- process.stderr.on('data', (data) => {
45
- stderr += data.toString();
46
- });
47
- process.on('close', (code) => {
48
- if (code !== 0) {
49
- reject(new Error(`Process exited with code ${code}: ${stderr}`));
50
- return;
51
- }
52
- try {
53
- const response = JSON.parse(stdout);
54
- resolve(response);
55
- }
56
- catch (error) {
57
- reject(new Error(`Failed to parse MCP response: ${error.message}`));
58
- }
59
- });
60
- process.on('error', (error) => {
61
- reject(error);
62
- });
63
- });
64
- };
65
- try {
66
- const toolsResponse = await executeMcpCommand({
67
- method: 'tools/list',
68
- params: {},
69
- });
70
- const tools = ((_a = toolsResponse.result) === null || _a === void 0 ? void 0 : _a.tools) || [];
71
- const aiTools = tools.map((tool) => ({
72
- name: tool.name,
73
- description: tool.description,
74
- execute: async (params) => {
75
- const response = await executeMcpCommand({
76
- method: 'tools/call',
77
- params: {
78
- name: tool.name,
79
- arguments: params,
80
- },
81
- });
82
- if (response.error) {
83
- throw new Error(`Tool execution failed: ${response.error.message}`);
84
- }
85
- return response.result;
86
- },
87
- }));
88
- return [[{ json: { tools: aiTools } }]];
89
- }
90
- catch (error) {
91
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), error);
92
- }
93
- }
94
- }
95
- exports.McpClient = McpClient;
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
- <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
4
- <circle fill="#6772E5" cx="16" cy="16" r="16"/>
5
- <path d="M10,8 L22,8 C23.1045695,8 24,8.8954305 24,10 L24,22 C24,23.1045695 23.1045695,24 22,24 L10,24 C8.8954305,24 8,23.1045695 8,22 L8,10 C8,8.8954305 8.8954305,8 10,8 Z M11,12 L21,12 L21,14 L11,14 L11,12 Z M11,16 L21,16 L21,18 L11,18 L11,16 Z M11,20 L17,20 L17,22 L11,22 L11,20 Z" fill="#FFFFFF"/>
6
- </g>
7
- </svg>
@@ -1,5 +0,0 @@
1
- import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class McpClient implements INodeType {
3
- description: INodeTypeDescription;
4
- execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
- }