@joshuanode/n8n-nodes-scalepad 0.0.2 → 0.0.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.
|
@@ -124,7 +124,7 @@ class ScalePadCore {
|
|
|
124
124
|
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
125
125
|
const qs = {};
|
|
126
126
|
if (!returnAll) {
|
|
127
|
-
qs.
|
|
127
|
+
qs.page_size = this.getNodeParameter('limit', i);
|
|
128
128
|
}
|
|
129
129
|
// Handle filters
|
|
130
130
|
if (additionalFields.filter) {
|
|
@@ -172,7 +172,7 @@ class ScalePadCore {
|
|
|
172
172
|
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
173
173
|
const qs = {};
|
|
174
174
|
if (!returnAll) {
|
|
175
|
-
qs.
|
|
175
|
+
qs.page_size = this.getNodeParameter('limit', i);
|
|
176
176
|
}
|
|
177
177
|
if (additionalFields.clientId) {
|
|
178
178
|
qs['filter[client_id]'] = `eq:${additionalFields.clientId}`;
|
|
@@ -204,7 +204,7 @@ class ScalePadCore {
|
|
|
204
204
|
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
205
205
|
const qs = {};
|
|
206
206
|
if (!returnAll) {
|
|
207
|
-
qs.
|
|
207
|
+
qs.page_size = this.getNodeParameter('limit', i);
|
|
208
208
|
}
|
|
209
209
|
if (additionalFields.clientId) {
|
|
210
210
|
qs['filter[client_id]'] = `eq:${additionalFields.clientId}`;
|
|
@@ -239,7 +239,7 @@ class ScalePadCore {
|
|
|
239
239
|
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
240
240
|
const qs = {};
|
|
241
241
|
if (!returnAll) {
|
|
242
|
-
qs.
|
|
242
|
+
qs.page_size = this.getNodeParameter('limit', i);
|
|
243
243
|
}
|
|
244
244
|
if (additionalFields.clientId) {
|
|
245
245
|
qs['filter[client_id]'] = `eq:${additionalFields.clientId}`;
|
|
@@ -290,7 +290,7 @@ class ScalePadCore {
|
|
|
290
290
|
const additionalFields = this.getNodeParameter('additionalFields', i);
|
|
291
291
|
const qs = {};
|
|
292
292
|
if (!returnAll) {
|
|
293
|
-
qs.
|
|
293
|
+
qs.page_size = this.getNodeParameter('limit', i);
|
|
294
294
|
}
|
|
295
295
|
// Apply common filters
|
|
296
296
|
if (additionalFields.clientId) {
|
|
@@ -53,13 +53,12 @@ async function scalePadCoreApiRequest(method, endpoint, body = {}, qs = {}) {
|
|
|
53
53
|
* Make an authenticated API request to ScalePad Core API with automatic pagination
|
|
54
54
|
*/
|
|
55
55
|
async function scalePadCoreApiRequestAllItems(method, endpoint, body = {}, qs = {}) {
|
|
56
|
-
var _a, _b;
|
|
57
56
|
const returnData = [];
|
|
58
57
|
let cursor;
|
|
59
58
|
let hasMore = true;
|
|
60
|
-
// Set default
|
|
61
|
-
if (!qs.
|
|
62
|
-
qs.
|
|
59
|
+
// Set default page size if not specified
|
|
60
|
+
if (!qs.page_size) {
|
|
61
|
+
qs.page_size = 200; // Maximum allowed by API
|
|
63
62
|
}
|
|
64
63
|
while (hasMore) {
|
|
65
64
|
if (cursor) {
|
|
@@ -70,7 +69,7 @@ async function scalePadCoreApiRequestAllItems(method, endpoint, body = {}, qs =
|
|
|
70
69
|
returnData.push(...response.data);
|
|
71
70
|
}
|
|
72
71
|
// Check for cursor-based pagination
|
|
73
|
-
cursor =
|
|
72
|
+
cursor = response.next_cursor;
|
|
74
73
|
hasMore = !!cursor;
|
|
75
74
|
// Safety check to prevent infinite loops
|
|
76
75
|
if (returnData.length > 10000) {
|