n8n-nodes-lemonsqueezy 0.7.1 → 0.7.2

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/README.md CHANGED
@@ -204,10 +204,9 @@ The webhook trigger includes built-in security features:
204
204
 
205
205
  The node includes built-in error handling with detailed messages:
206
206
 
207
- - **Rate Limiting**: Automatically waits and retries when rate limited (429 errors)
208
- - **Retry Logic**: Retries failed requests with exponential backoff for 5xx errors
209
207
  - **Continue on Fail**: Enable to process remaining items even if some fail
210
208
  - **Detailed Errors**: Field-level error details for validation failures
209
+ - **Workflow Retry**: Use n8n's built-in workflow error handling for retry logic
211
210
 
212
211
  ### Error Code Reference
213
212
 
@@ -245,20 +244,13 @@ The node includes built-in error handling with detailed messages:
245
244
 
246
245
  ### Rate Limiting Issues
247
246
 
248
- The node handles rate limiting automatically with the following defaults:
247
+ If you encounter rate limiting (429 errors):
249
248
 
250
- | Setting | Value | Description |
251
- |---------|-------|-------------|
252
- | Max Retries | 3 | Maximum retry attempts for failed requests |
253
- | Retry Delay | 1 second | Initial delay between retries (exponential backoff) |
254
- | Rate Limit Wait | 60 seconds | Wait time when rate limited (429 response) |
255
-
256
- If you're hitting rate limits frequently:
257
-
258
- 1. Reduce the frequency of API calls
259
- 2. Use "Return All" sparingly for large datasets
260
- 3. Consider caching responses where appropriate
261
- 4. Space out bulk operations with delays
249
+ 1. Configure n8n's workflow error handling to retry on failure
250
+ 2. Reduce the frequency of API calls
251
+ 3. Use "Return All" sparingly for large datasets
252
+ 4. Consider caching responses where appropriate
253
+ 5. Space out bulk operations using the Wait node
262
254
 
263
255
  ### Validation Errors
264
256
 
@@ -311,12 +303,12 @@ Contributions are welcome! Please feel free to submit a Pull Request.
311
303
 
312
304
  ## Changelog
313
305
 
314
- ### v0.7.1
306
+ ### v0.7.2
315
307
 
316
308
  **n8n Community Package Compliance:**
317
309
  - Resolved all n8n community package scanner ESLint violations
318
310
  - Replaced deprecated `requestWithAuthentication` with `httpRequestWithAuthentication`
319
- - Fixed restricted `setTimeout` global usage
311
+ - Removed restricted globals (use n8n's built-in workflow retry for error handling)
320
312
 
321
313
  ### v0.7.0
322
314
 
@@ -118,18 +118,6 @@ export declare function validateField(fieldName: string, value: unknown, validat
118
118
  * // Throws: "config contains invalid JSON"
119
119
  */
120
120
  export declare function safeJsonParse<T = unknown>(jsonString: string, fieldName: string): T;
121
- /**
122
- * Pauses execution for a specified duration.
123
- *
124
- * Used for implementing retry delays and rate limit backoff.
125
- *
126
- * @param ms - The number of milliseconds to sleep
127
- * @returns A promise that resolves after the specified duration
128
- *
129
- * @example
130
- * await sleep(1000) // Wait 1 second
131
- */
132
- export declare function sleep(ms: number): Promise<void>;
133
121
  /**
134
122
  * Checks if an error is a rate limit error (HTTP 429).
135
123
  *
@@ -51,7 +51,6 @@ exports.isValidIsoDate = isValidIsoDate;
51
51
  exports.isPositiveInteger = isPositiveInteger;
52
52
  exports.validateField = validateField;
53
53
  exports.safeJsonParse = safeJsonParse;
54
- exports.sleep = sleep;
55
54
  exports.isRateLimitError = isRateLimitError;
56
55
  exports.isRetryableError = isRetryableError;
57
56
  exports.lemonSqueezyApiRequest = lemonSqueezyApiRequest;
@@ -270,22 +269,6 @@ function safeJsonParse(jsonString, fieldName) {
270
269
  throw new Error(`${fieldName} contains invalid JSON`);
271
270
  }
272
271
  }
273
- // Reference to avoid direct global usage (n8n linter restriction)
274
- const setTimeoutRef = globalThis.setTimeout;
275
- /**
276
- * Pauses execution for a specified duration.
277
- *
278
- * Used for implementing retry delays and rate limit backoff.
279
- *
280
- * @param ms - The number of milliseconds to sleep
281
- * @returns A promise that resolves after the specified duration
282
- *
283
- * @example
284
- * await sleep(1000) // Wait 1 second
285
- */
286
- function sleep(ms) {
287
- return new Promise((resolve) => setTimeoutRef(resolve, ms));
288
- }
289
272
  /**
290
273
  * Checks if an error is a rate limit error (HTTP 429).
291
274
  *
@@ -378,32 +361,14 @@ async function lemonSqueezyApiRequest(method, endpoint, body, qs = {}, timeout =
378
361
  if (body) {
379
362
  options.body = body;
380
363
  }
381
- let lastError;
382
- for (let attempt = 0; attempt < constants_1.MAX_RETRIES; attempt++) {
383
- try {
384
- return (await this.helpers.httpRequestWithAuthentication.call(this, 'lemonSqueezyApi', options));
385
- }
386
- catch (error) {
387
- lastError = error;
388
- if (isRateLimitError(error)) {
389
- await sleep(constants_1.RATE_LIMIT_DELAY_MS);
390
- continue;
391
- }
392
- if (isRetryableError(error) && attempt < constants_1.MAX_RETRIES - 1) {
393
- const delayMs = constants_1.RETRY_DELAY_MS * Math.pow(2, attempt);
394
- await sleep(delayMs);
395
- continue;
396
- }
397
- // Non-retryable error, throw immediately
398
- throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
399
- message: getErrorMessage(error),
400
- });
401
- }
364
+ try {
365
+ return (await this.helpers.httpRequestWithAuthentication.call(this, 'lemonSqueezyApi', options));
366
+ }
367
+ catch (error) {
368
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
369
+ message: getErrorMessage(error),
370
+ });
402
371
  }
403
- // All retries exhausted
404
- throw new n8n_workflow_1.NodeApiError(this.getNode(), lastError, {
405
- message: getErrorMessage(lastError),
406
- });
407
372
  }
408
373
  /**
409
374
  * Makes paginated requests to fetch all items from a Lemon Squeezy API endpoint.
@@ -460,10 +425,6 @@ async function lemonSqueezyApiRequestAllItems(method, endpoint, qs = {}, paginat
460
425
  responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'lemonSqueezyApi', options));
461
426
  }
462
427
  catch (error) {
463
- if (isRateLimitError(error)) {
464
- await sleep(constants_1.RATE_LIMIT_DELAY_MS);
465
- continue;
466
- }
467
428
  throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
468
429
  message: getErrorMessage(error),
469
430
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-lemonsqueezy",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "n8n community node for Lemon Squeezy - digital products and subscriptions platform",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",