n8n-nodes-base 2.35.2 → 2.35.3
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/dist/cjs/build.tsbuildinfo +1 -1
- package/dist/node-definitions/.nodes-hash +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/elasticsearch/v1/resource_document/operation_get_all.schema.js +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/elasticsearch/v1/resource_document/operation_get_all.ts +7 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/googleAds/v1/resource_campaign/operation_get.ts +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/googleAds/v1/resource_campaign/operation_get_all.ts +1 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/googleAnalytics/v2/resource_report/operation_get.ts +2 -2
- package/dist/node-definitions/nodes/n8n-nodes-base/googleFirebaseCloudFirestore/v1/resource_document/operation_query.schema.js +1 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/googleFirebaseCloudFirestore/v1/resource_document/operation_query.ts +8 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/googleFirebaseCloudFirestore/v11/resource_document/operation_query.schema.js +1 -0
- package/dist/node-definitions/nodes/n8n-nodes-base/googleFirebaseCloudFirestore/v11/resource_document/operation_query.ts +8 -1
- package/dist/node-definitions/nodes/n8n-nodes-base/microsoftOutlook/v2/resource_event/operation_create.ts +2 -2
- package/dist/nodes/Brevo/GenericFunctions.d.ts.map +1 -1
- package/dist/nodes/Brevo/GenericFunctions.js +5 -1
- package/dist/nodes/Brevo/GenericFunctions.js.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/Elasticsearch.node.d.ts.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/Elasticsearch.node.js +3 -2
- package/dist/nodes/Elastic/Elasticsearch/Elasticsearch.node.js.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.d.ts.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.js +15 -1
- package/dist/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.js.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/descriptions/placeholders.d.ts +1 -1
- package/dist/nodes/Elastic/Elasticsearch/descriptions/placeholders.d.ts.map +1 -1
- package/dist/nodes/Elastic/Elasticsearch/descriptions/placeholders.js +1 -1
- package/dist/nodes/Elastic/Elasticsearch/types.d.ts +1 -0
- package/dist/nodes/Elastic/Elasticsearch/types.d.ts.map +1 -1
- package/dist/nodes/Git/GenericFunctions.d.ts +1 -0
- package/dist/nodes/Git/GenericFunctions.d.ts.map +1 -1
- package/dist/nodes/Git/GenericFunctions.js +45 -0
- package/dist/nodes/Git/GenericFunctions.js.map +1 -1
- package/dist/nodes/Git/Git.node.d.ts.map +1 -1
- package/dist/nodes/Git/Git.node.js +26 -6
- package/dist/nodes/Git/Git.node.js.map +1 -1
- package/dist/nodes/Google/Ads/CampaignDescription.js +2 -2
- package/dist/nodes/Google/Ads/CampaignDescription.js.map +1 -1
- package/dist/nodes/Google/Ads/__schema__/v1.0.0/campaign/get.json +1 -1
- package/dist/nodes/Google/Ads/__schema__/v1.0.0/campaign/getAll.json +1 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/DocumentDescription.d.ts.map +1 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/DocumentDescription.js +22 -2
- package/dist/nodes/Google/Firebase/CloudFirestore/DocumentDescription.js.map +1 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.d.ts.map +1 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.js +4 -1
- package/dist/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.js.map +1 -1
- package/dist/nodes/Google/Gmail/GenericFunctions.d.ts.map +1 -1
- package/dist/nodes/Google/Gmail/GenericFunctions.js +2 -0
- package/dist/nodes/Google/Gmail/GenericFunctions.js.map +1 -1
- package/dist/nodes/MongoDb/GenericFunctions.d.ts +0 -1
- package/dist/nodes/MongoDb/GenericFunctions.d.ts.map +1 -1
- package/dist/nodes/MongoDb/GenericFunctions.js +2 -78
- package/dist/nodes/MongoDb/GenericFunctions.js.map +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.d.ts.map +1 -1
- package/dist/nodes/MongoDb/MongoDb.node.js +4 -3
- package/dist/nodes/MongoDb/MongoDb.node.js.map +1 -1
- package/dist/nodes/Notion/shared/GenericFunctions.d.ts +3 -3
- package/dist/nodes/Notion/shared/GenericFunctions.d.ts.map +1 -1
- package/dist/types/nodes.json +5 -5
- package/dist/utils/query-parameters.d.ts +12 -0
- package/dist/utils/query-parameters.d.ts.map +1 -0
- package/dist/utils/query-parameters.js +90 -0
- package/dist/utils/query-parameters.js.map +1 -0
- package/package.json +12 -12
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { INode } from 'n8n-workflow';
|
|
2
|
+
type QueryParameterScalar = string | number | boolean | bigint | Date | null;
|
|
3
|
+
export declare function isScalarValue(value: unknown): value is QueryParameterScalar;
|
|
4
|
+
/**
|
|
5
|
+
* Parses a JSON query and substitutes `$1`, `$2`, ... placeholders with the given parameters.
|
|
6
|
+
*
|
|
7
|
+
* Placeholders are only substituted when they make up a complete string value, so a parameter
|
|
8
|
+
* can never contribute structure (keys, operators, extra clauses) to the resulting query.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseAndResolveQueryParameters(query: string, rawParameters: unknown, node: INode, itemIndex: number): unknown;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=query-parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-parameters.d.ts","sourceRoot":"","sources":["../../utils/query-parameters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,oBAAoB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;AAG7E,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,oBAAoB,CAS3E;AA4CD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,KAAK,EACX,SAAS,EAAE,MAAM,GACf,OAAO,CAiDT"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isScalarValue = isScalarValue;
|
|
4
|
+
exports.parseAndResolveQueryParameters = parseAndResolveQueryParameters;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
function isScalarValue(value) {
|
|
7
|
+
return (value === null ||
|
|
8
|
+
typeof value === 'string' ||
|
|
9
|
+
typeof value === 'number' ||
|
|
10
|
+
typeof value === 'boolean' ||
|
|
11
|
+
typeof value === 'bigint' ||
|
|
12
|
+
value instanceof Date);
|
|
13
|
+
}
|
|
14
|
+
function parseQueryParameters(rawParameters, node, itemIndex) {
|
|
15
|
+
let parameters = rawParameters;
|
|
16
|
+
if (typeof parameters === 'string') {
|
|
17
|
+
try {
|
|
18
|
+
parameters = JSON.parse(parameters);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
throw new n8n_workflow_1.NodeOperationError(node, error, {
|
|
22
|
+
itemIndex,
|
|
23
|
+
message: 'Query Parameters must be valid JSON',
|
|
24
|
+
description: 'Enter the parameters as a JSON array',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (!Array.isArray(parameters)) {
|
|
29
|
+
throw new n8n_workflow_1.NodeOperationError(node, 'Query Parameters must be a JSON array', {
|
|
30
|
+
itemIndex,
|
|
31
|
+
description: 'Enter the parameters as a JSON array',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return parameters.map((parameter, index) => {
|
|
35
|
+
if (isScalarValue(parameter) || (Array.isArray(parameter) && parameter.every(isScalarValue))) {
|
|
36
|
+
return parameter;
|
|
37
|
+
}
|
|
38
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Query parameter ${index + 1} must be a scalar or an array of scalars`, {
|
|
39
|
+
itemIndex,
|
|
40
|
+
description: 'Objects and nested arrays are not supported',
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parses a JSON query and substitutes `$1`, `$2`, ... placeholders with the given parameters.
|
|
46
|
+
*
|
|
47
|
+
* Placeholders are only substituted when they make up a complete string value, so a parameter
|
|
48
|
+
* can never contribute structure (keys, operators, extra clauses) to the resulting query.
|
|
49
|
+
*/
|
|
50
|
+
function parseAndResolveQueryParameters(query, rawParameters, node, itemIndex) {
|
|
51
|
+
const parsedQuery = (0, n8n_workflow_1.jsonParse)(query, {
|
|
52
|
+
errorMessage: "Invalid JSON in 'Query'",
|
|
53
|
+
});
|
|
54
|
+
const parameters = parseQueryParameters(rawParameters, node, itemIndex);
|
|
55
|
+
if (parameters.length === 0)
|
|
56
|
+
return parsedQuery;
|
|
57
|
+
const usedParameters = new Set();
|
|
58
|
+
const resolveValue = (value) => {
|
|
59
|
+
if (typeof value === 'string') {
|
|
60
|
+
const match = /^\$(\d+)$/.exec(value);
|
|
61
|
+
if (!match)
|
|
62
|
+
return value;
|
|
63
|
+
const parameterIndex = Number(match[1]) - 1;
|
|
64
|
+
if (parameterIndex < 0 || parameterIndex >= parameters.length) {
|
|
65
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Query placeholder ${value} has no matching value`, {
|
|
66
|
+
itemIndex,
|
|
67
|
+
description: `Add a value for ${value} to Query Parameters`,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
usedParameters.add(parameterIndex);
|
|
71
|
+
return parameters[parameterIndex];
|
|
72
|
+
}
|
|
73
|
+
if (Array.isArray(value))
|
|
74
|
+
return value.map(resolveValue);
|
|
75
|
+
if (value !== null && typeof value === 'object') {
|
|
76
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, resolveValue(entry)]));
|
|
77
|
+
}
|
|
78
|
+
return value;
|
|
79
|
+
};
|
|
80
|
+
const resolvedQuery = resolveValue(parsedQuery);
|
|
81
|
+
const unusedParameter = parameters.findIndex((_, index) => !usedParameters.has(index));
|
|
82
|
+
if (unusedParameter !== -1) {
|
|
83
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Query parameter ${unusedParameter + 1} is not used`, {
|
|
84
|
+
itemIndex,
|
|
85
|
+
description: `Add $${unusedParameter + 1} to the query or remove the unused parameter`,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return resolvedQuery;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=query-parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-parameters.js","sourceRoot":"","sources":["../../utils/query-parameters.ts"],"names":[],"mappings":";;;;AAAA,+CAA6D;AAM7D,uBAA8B,KAAc;IAC3C,OAAO,CACN,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,YAAY,IAAI,CACrB,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAC5B,aAAsB,EACtB,IAAW,EACX,SAAiB;IAEjB,IAAI,UAAU,GAAY,aAAa,CAAC;IAExC,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACpC,IAAI,CAAC;YACJ,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAY,CAAC;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,iCAAkB,CAAC,IAAI,EAAE,KAAc,EAAE;gBAClD,SAAS;gBACT,OAAO,EAAE,qCAAqC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EAAE;YACxF,SAAS;YACT,WAAW,EAAE,QAAQ,eAAe,GAAG,CAAC,8CAA8C;SACtF,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC;AACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-base",
|
|
3
|
-
"version": "2.35.
|
|
3
|
+
"version": "2.35.3",
|
|
4
4
|
"description": "Base nodes of n8n",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typesVersions": {
|
|
@@ -905,13 +905,13 @@
|
|
|
905
905
|
"vite": "^8.0.2",
|
|
906
906
|
"vitest": "^4.1.9",
|
|
907
907
|
"vitest-mock-extended": "^3.1.0",
|
|
908
|
-
"@n8n/
|
|
909
|
-
"@n8n/playwright-janitor": "0.1.0",
|
|
908
|
+
"@n8n/client-oauth2": "1.17.3",
|
|
910
909
|
"@n8n/typescript-config": "1.9.0",
|
|
911
|
-
"@n8n/
|
|
910
|
+
"@n8n/eslint-plugin-community-nodes": "0.29.0",
|
|
912
911
|
"@n8n/vitest-config": "1.20.0",
|
|
913
|
-
"n8n-
|
|
914
|
-
"n8n-containers": "1.0.0"
|
|
912
|
+
"@n8n/playwright-janitor": "0.1.0",
|
|
913
|
+
"n8n-containers": "1.0.0",
|
|
914
|
+
"n8n-core": "2.35.3"
|
|
915
915
|
},
|
|
916
916
|
"dependencies": {
|
|
917
917
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
@@ -999,13 +999,13 @@
|
|
|
999
999
|
"xml2js": "0.6.2",
|
|
1000
1000
|
"xmlhttprequest-ssl": "3.1.0",
|
|
1001
1001
|
"zod": "3.25.76",
|
|
1002
|
-
"@n8n/backend-network": "1.9.
|
|
1003
|
-
"@n8n/
|
|
1004
|
-
"@n8n/config": "2.33.2",
|
|
1005
|
-
"@n8n/imap": "0.25.0",
|
|
1002
|
+
"@n8n/backend-network": "1.9.3",
|
|
1003
|
+
"@n8n/config": "2.33.3",
|
|
1006
1004
|
"@n8n/errors": "0.13.0",
|
|
1007
|
-
"n8n
|
|
1008
|
-
"
|
|
1005
|
+
"@n8n/di": "0.16.0",
|
|
1006
|
+
"n8n-workflow": "2.35.2",
|
|
1007
|
+
"@n8n/utils": "1.43.1",
|
|
1008
|
+
"@n8n/imap": "0.25.0"
|
|
1009
1009
|
},
|
|
1010
1010
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
1011
1011
|
"homepage": "https://n8n.io",
|