n8n-nodes-fingrid 0.2.6 → 0.2.8
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.
|
@@ -329,8 +329,8 @@ class Fingrid {
|
|
|
329
329
|
displayName: "Page Size",
|
|
330
330
|
name: "pageSize",
|
|
331
331
|
type: "number",
|
|
332
|
-
default:
|
|
333
|
-
description: "Rows to request per page from the API when 'Return All' is on. Fingrid
|
|
332
|
+
default: 250,
|
|
333
|
+
description: "Rows to request per page from the API when 'Return All' is on. Fingrid enforces a maximum of 250 per page.",
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
336
|
displayName: "Sort By",
|
|
@@ -45,7 +45,9 @@ async function requestWithRateLimitHandling(options, i) {
|
|
|
45
45
|
function buildDatasetRequest(operation, i) {
|
|
46
46
|
const qs = {};
|
|
47
47
|
if (operation === "get") {
|
|
48
|
-
const datasetId = this.getNodeParameter("datasetId", i
|
|
48
|
+
const datasetId = this.getNodeParameter("datasetId", i, undefined, {
|
|
49
|
+
extractValue: true,
|
|
50
|
+
});
|
|
49
51
|
return { endpoint: `/datasets/${datasetId}`, qs };
|
|
50
52
|
}
|
|
51
53
|
if (operation === "search") {
|
|
@@ -59,23 +61,31 @@ function buildDatasetRequest(operation, i) {
|
|
|
59
61
|
return { endpoint: "/datasets", qs };
|
|
60
62
|
}
|
|
61
63
|
if (operation === "getData") {
|
|
62
|
-
const datasetId = this.getNodeParameter("datasetId", i
|
|
64
|
+
const datasetId = this.getNodeParameter("datasetId", i, undefined, {
|
|
65
|
+
extractValue: true,
|
|
66
|
+
});
|
|
63
67
|
qs.startTime = this.getNodeParameter("startTime", i);
|
|
64
68
|
qs.endTime = this.getNodeParameter("endTime", i);
|
|
65
69
|
Object.assign(qs, this.getNodeParameter("additionalOptions", i, {}));
|
|
66
70
|
return { endpoint: `/datasets/${datasetId}/data`, qs };
|
|
67
71
|
}
|
|
68
72
|
if (operation === "getLatestData") {
|
|
69
|
-
const datasetId = this.getNodeParameter("datasetId", i
|
|
73
|
+
const datasetId = this.getNodeParameter("datasetId", i, undefined, {
|
|
74
|
+
extractValue: true,
|
|
75
|
+
});
|
|
70
76
|
return { endpoint: `/datasets/${datasetId}/data/latest`, qs };
|
|
71
77
|
}
|
|
72
78
|
if (operation === "getFile") {
|
|
73
|
-
const datasetId = this.getNodeParameter("datasetId", i
|
|
79
|
+
const datasetId = this.getNodeParameter("datasetId", i, undefined, {
|
|
80
|
+
extractValue: true,
|
|
81
|
+
});
|
|
74
82
|
const fileId = this.getNodeParameter("fileId", i);
|
|
75
83
|
return { endpoint: `/datasets/${datasetId}/files/${fileId}`, qs };
|
|
76
84
|
}
|
|
77
85
|
if (operation === "getFileData") {
|
|
78
|
-
const datasetId = this.getNodeParameter("datasetId", i
|
|
86
|
+
const datasetId = this.getNodeParameter("datasetId", i, undefined, {
|
|
87
|
+
extractValue: true,
|
|
88
|
+
});
|
|
79
89
|
qs.startTime = this.getNodeParameter("startTime", i);
|
|
80
90
|
qs.endTime = this.getNodeParameter("endTime", i);
|
|
81
91
|
Object.assign(qs, this.getNodeParameter("additionalOptions", i, {}));
|
|
@@ -142,7 +152,7 @@ async function fetchPaginated(endpoint, qs, i) {
|
|
|
142
152
|
var _a;
|
|
143
153
|
const returnAll = this.getNodeParameter("returnAll", i, false);
|
|
144
154
|
const limit = this.getNodeParameter("limit", i, 50);
|
|
145
|
-
const pageSize = qs.pageSize ||
|
|
155
|
+
const pageSize = qs.pageSize || 250;
|
|
146
156
|
const collected = [];
|
|
147
157
|
let page = 1;
|
|
148
158
|
let lastPage = 1;
|