Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Sep 23, 2025

Resolves #16068

Summary by CodeRabbit

  • New Features
    • New GoDaddy actions: Check Domain Availability, List Domains, Renew Domain, Suggest Domains.
    • New "New Domain Added" event source with incremental polling, event emission, and deploy/run hooks.
    • Interactive inputs, pagination, domain/TLD selection, filters (statuses, status groups, includes), and domain suggestion support.
    • Shared GoDaddy constants and a client surface for domain operations.
  • Chores
    • Bumped GoDaddy component to 0.1.0 and added a runtime dependency.

@vercel
Copy link

vercel bot commented Sep 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Sep 30, 2025 3:02pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 30, 2025 3:02pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds a GoDaddy integration: client with HTTP helpers and propDefinitions, domain-related constants, four actions (check availability, list, renew, suggest), a polling source base plus a “New Domain Added” source with incremental fetching, and a package version bump with a new dependency.

Changes

Cohort / File(s) Summary
GoDaddy App Client
components/godaddy/godaddy.app.mjs
Implements HTTP helper (_makeRequest), _baseUrl, endpoints (listDomains, listTlds, checkDomainAvailability, renewDomain, suggestDomains), an async paginate generator, and propDefinitions (domain, tlds, statuses, statusGroups, includes).
Actions
components/godaddy/actions/check-domain-availability/check-domain-availability.mjs, components/godaddy/actions/list-domains/list-domains.mjs, components/godaddy/actions/renew-domain/renew-domain.mjs, components/godaddy/actions/suggest-domains/suggest-domains.mjs
Adds four action modules exporting metadata, props, and run() implementations that call the app client methods, export a $summary, and return API responses.
Sources
components/godaddy/sources/common/base.mjs, components/godaddy/sources/new-domain-added/new-domain-added.mjs
Adds a polling base with db/timer props and _getLastTs/_setLastTs, and a “New Domain Added” source that paginates listDomains, generates event meta, emits per-domain events, and updates last-timestamp (includes deploy and run hooks).
Common Constants
components/godaddy/common/constants.mjs
Adds exported arrays: DOMAIN_STATUSES, STATUS_GROUPS, DOMAIN_DETAIL_FIELDS, and DOMAIN_SUGGESTION_SOURCES, and a default export aggregating them.
Package
components/godaddy/package.json
Bumps version to 0.1.0 and adds dependency "@pipedream/platform": "^3.1.0".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Action (List / Check / Renew / Suggest)
  participant App as GoDaddy App Client
  participant API as GoDaddy API

  User->>Action: Invoke with props
  Action->>App: call corresponding method (listDomains / checkDomainAvailability / renewDomain / suggestDomains) with params and `$`
  App->>API: HTTP request to /v1/... (GET/POST)
  API-->>App: 200 OK (payload)
  App-->>Action: return payload
  Action-->>User: Return result + export `$summary`
Loading
sequenceDiagram
  autonumber
  participant Timer as Source Timer
  participant Source as New Domain Added Source
  participant DB as Source DB
  participant App as GoDaddy App Client
  participant API as GoDaddy API

  Timer->>Source: Trigger run()
  Source->>DB: _getLastTs()
  Source->>App: listDomains({ modifiedDate: lastTs, includes, statuses, statusGroups })
  App->>API: GET /v1/domains?modifiedDate=...
  API-->>App: 200 OK (domains page)
  App-->>Source: domains
  loop For each domain
    Source->>Source: generateMeta(domain)
    Source->>Source: $emit(domain, meta)
  end
  Source->>DB: _setLastTs(newestModifiedDate)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Poem

I hopped through TLDs with a twitch of my nose,
Sniffed which names bloom where the DNS wind blows.
I check and I list, I nudge renewals near,
I whisper suggestions with a happy cheer.
Little paws on the timer—new domains appear. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description only states “Resolves #16068” and does not follow the repository’s required template, which begins with a “## WHY” section explaining the purpose and rationale for the changes. Please populate the description template by adding the “## WHY” header and a concise explanation of why these new GoDaddy components are needed, including any context or motivations behind the implementation.
Title Check ❓ Inconclusive The title “GoDaddy - new components” accurately indicates that new GoDaddy-related components are being added but remains overly generic by not specifying which key features or modules (actions, source, constants, etc.) were introduced. Consider revising the title to clearly reflect the main changes, for example “Add GoDaddy domain actions, source, and constants modules,” so that the primary additions are immediately clear to reviewers.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The changes introduce all required GoDaddy actions (List Domains, Renew Domain, Check Domain Availability, Suggest Domains) and the New Domain Added source, along with necessary constants and app integration methods, fully addressing the objectives of issue #16068.
Out of Scope Changes Check ✅ Passed All modifications—including the new constants module, enhanced GoDaddy app file, and base source helper—directly support the implementation of the linked GoDaddy actions and source without introducing unrelated functionality.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (3)
components/godaddy/actions/suggest-domains/suggest-domains.mjs (1)

68-82: Avoid sending undefined query params.

Filter out undefined/null before calling the API.

Apply:

-    const domains = await this.godaddy.suggestDomains({
-      $,
-      params: {
-        query: this.query,
-        country: this.country,
-        city: this.city,
-        sources: this.sources,
-        tlds: this.tlds,
-        lengthMax: this.lengthMax,
-        lengthMin: this.lengthMin,
-        limit: this.limit,
-        waitMs: this.waitMs,
-      },
-    });
+    const rawParams = {
+      query: this.query,
+      country: this.country,
+      city: this.city,
+      sources: this.sources,
+      tlds: this.tlds,
+      lengthMax: this.lengthMax,
+      lengthMin: this.lengthMin,
+      limit: this.limit,
+      waitMs: this.waitMs,
+    };
+    const params = Object.fromEntries(
+      Object.entries(rawParams).filter(([, v]) => v !== undefined && v !== null),
+    );
+    const domains = await this.godaddy.suggestDomains({ $, params });
components/godaddy/actions/check-domain-availability/check-domain-availability.mjs (1)

33-41: Filter undefined params for a clean request.

Prevents undefined from being serialized in the query string.

Apply:

-    const response = await this.godaddy.checkDomainAvailability({
-      $,
-      params: {
-        domain: this.domain,
-        checkType: this.checkType,
-        forTransfer: this.forTransfer,
-      },
-    });
+    const params = Object.fromEntries(
+      Object.entries({
+        domain: this.domain,
+        checkType: this.checkType,
+        forTransfer: this.forTransfer,
+      }).filter(([, v]) => v !== undefined && v !== null),
+    );
+    const response = await this.godaddy.checkDomainAvailability({ $, params });
components/godaddy/common/constants.mjs (1)

244-253: Normalize DOMAIN_SUGGESTION_SOURCES to a single canonical set.

Mixing upper/lowercase duplicates can confuse users; keep one set.

Apply:

 const DOMAIN_SUGGESTION_SOURCES = [
-  "CC_TLD",
-  "EXTENSION",
-  "KEYWORD_SPIN",
-  "PREMIUM",
-  "cctld",
-  "extension",
-  "keywordspin",
-  "premium",
+  "CC_TLD",
+  "EXTENSION",
+  "KEYWORD_SPIN",
+  "PREMIUM",
 ];
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8855cf9 and 3e7922e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • components/godaddy/actions/check-domain-availability/check-domain-availability.mjs (1 hunks)
  • components/godaddy/actions/list-domains/list-domains.mjs (1 hunks)
  • components/godaddy/actions/renew-domain/renew-domain.mjs (1 hunks)
  • components/godaddy/actions/suggest-domains/suggest-domains.mjs (1 hunks)
  • components/godaddy/common/constants.mjs (1 hunks)
  • components/godaddy/godaddy.app.mjs (1 hunks)
  • components/godaddy/package.json (2 hunks)
  • components/godaddy/sources/common/base.mjs (1 hunks)
  • components/godaddy/sources/new-domain-added/new-domain-added.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/godaddy/package.json
🧬 Code graph analysis (7)
components/godaddy/actions/list-domains/list-domains.mjs (2)
components/godaddy/actions/suggest-domains/suggest-domains.mjs (1)
  • domains (69-82)
components/godaddy/godaddy.app.mjs (1)
  • domains (13-15)
components/godaddy/sources/common/base.mjs (1)
components/godaddy/sources/new-domain-added/new-domain-added.mjs (1)
  • lastTs (42-42)
components/godaddy/actions/renew-domain/renew-domain.mjs (1)
components/godaddy/actions/check-domain-availability/check-domain-availability.mjs (1)
  • response (34-41)
components/godaddy/actions/check-domain-availability/check-domain-availability.mjs (1)
components/godaddy/actions/renew-domain/renew-domain.mjs (1)
  • response (27-33)
components/godaddy/godaddy.app.mjs (3)
components/godaddy/actions/list-domains/list-domains.mjs (1)
  • domains (49-59)
components/godaddy/actions/suggest-domains/suggest-domains.mjs (1)
  • domains (69-82)
components/godaddy/sources/new-domain-added/new-domain-added.mjs (2)
  • domains (43-43)
  • results (45-54)
components/godaddy/actions/suggest-domains/suggest-domains.mjs (2)
components/godaddy/actions/list-domains/list-domains.mjs (1)
  • domains (49-59)
components/godaddy/godaddy.app.mjs (1)
  • domains (13-15)
components/godaddy/sources/new-domain-added/new-domain-added.mjs (2)
components/godaddy/actions/list-domains/list-domains.mjs (1)
  • domains (49-59)
components/godaddy/godaddy.app.mjs (2)
  • domains (13-15)
  • results (119-121)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (5)
components/godaddy/actions/renew-domain/renew-domain.mjs (1)

26-36: LGTM.

Implementation aligns with app method; optional period will be omitted from JSON.

components/godaddy/package.json (1)

15-17: LGTM on dependency; confirm platform version compatibility.

Looks good. Please confirm @pipedream/platform@^3.1.0 is required for DEFAULT_POLLING_SOURCE_TIMER_INTERVAL and aligns with other GoDaddy components.

Run to check for usage and ensure only one platform version is referenced:

components/godaddy/actions/suggest-domains/suggest-domains.mjs (2)

37-42: Verify propDefinition "tlds" exists in app.

If propDefinition: [godaddy, "tlds"] isn’t defined, component build will fail.

Run:


12-17: Keep query optional — docs mark it optional.

GoDaddy’s /v1/domains/suggest documents query as optional, so leave optional: true.

Likely an incorrect or invalid review comment.

components/godaddy/godaddy.app.mjs (1)

77-94: Consistency: use params (not data) for GET methods

listDomains, listTlds, checkDomainAvailability and suggestDomains are GET endpoints — callers/docs/examples must pass query args via params. The client maps data → params as a safeguard, but align callers to params to avoid ambiguity. Location: components/godaddy/godaddy.app.mjs (methods ~lines 77–94).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
components/godaddy/godaddy.app.mjs (1)

12-17: Limit dynamic options page size to reduce API load.

Add a small per-page cap (e.g., 50) to avoid fetching large batches in the UI picker.

Apply:

       async options({ prevContext }) {
         const domains = await this.listDomains({
           params: {
             marker: prevContext?.marker,
+            limit: 50,
           },
         });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3e7922e and d0df473.

📒 Files selected for processing (4)
  • components/godaddy/actions/list-domains/list-domains.mjs (1 hunks)
  • components/godaddy/common/constants.mjs (1 hunks)
  • components/godaddy/godaddy.app.mjs (1 hunks)
  • components/godaddy/sources/common/base.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • components/godaddy/common/constants.mjs
  • components/godaddy/actions/list-domains/list-domains.mjs
  • components/godaddy/sources/common/base.mjs
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: LucBerge
PR: PipedreamHQ/pipedream#14080
File: components/nocodb/nocodb.app.mjs:133-133
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When implementing pagination with an offset, incrementing `args.params.offset` within the loop ensures correct tracking of the offset, particularly when a maximum count limit (`max`) is used.

Applied to files:

  • components/godaddy/godaddy.app.mjs
🧬 Code graph analysis (1)
components/godaddy/godaddy.app.mjs (3)
components/godaddy/actions/list-domains/list-domains.mjs (1)
  • domains (49-59)
components/godaddy/actions/suggest-domains/suggest-domains.mjs (1)
  • domains (69-82)
components/godaddy/sources/new-domain-added/new-domain-added.mjs (2)
  • domains (43-43)
  • results (45-54)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (5)
components/godaddy/godaddy.app.mjs (5)

12-17: Dynamic options query param fix looks good.

Marker is correctly passed under params now.


62-64: Defaulting to production URL is correct. Consider optional OTE toggle.

Optionally allow switching to OTE via a prop or env flag for testing.


65-77: Harden HTTP helper: set method default, headers, timeout, and guard GET params.

Prevents subtle bugs and improves resilience.

Apply:

-    _makeRequest({
-      $ = this,
-      path,
-      ...opts
-    }) {
-      return axios($, {
-        url: `${this._baseUrl()}${path}`,
-        headers: {
-          "Authorization": `sso-key ${this.$auth.api_key}:${this.$auth.api_secret}`,
-        },
-        ...opts,
-      });
-    },
+    _makeRequest({
+      $ = this,
+      path,
+      method = "GET",
+      headers = {},
+      ...opts
+    }) {
+      const config = {
+        method,
+        url: `${this._baseUrl()}${path}`,
+        headers: {
+          "Authorization": `sso-key ${this.$auth.api_key}:${this.$auth.api_secret}`,
+          "Accept": "application/json",
+          ...(method?.toUpperCase() !== "GET" ? { "Content-Type": "application/json" } : {}),
+          ...headers,
+        },
+        timeout: 10000,
+        ...opts,
+      };
+      // If callers mistakenly pass GET query under `data`, map it to `params`
+      if (config.method.toUpperCase() === "GET" && config.data && !config.params) {
+        config.params = config.data;
+        delete config.data;
+      }
+      return axios($, config);
+    },

96-103: URL‑encode domain in renew endpoint path.

Avoids path issues with edge cases and IDNs.

Apply:

       return this._makeRequest({
         method: "POST",
-        path: `/domains/${domain}/renew`,
+        path: `/domains/${encodeURIComponent(domain)}/renew`,
         ...opts,
       });

111-135: Fix lost this binding and respect caller-provided limit in paginate.

Current call to fn(...) loses context and will throw; also overwrites limit.

Apply:

-    async *paginate({
-      fn, params = {}, max,
-    }) {
-      params = {
-        ...params,
-        limit: 100,
-      };
+    async *paginate({
+      fn, params = {}, max, $ = this,
+    }) {
+      params = {
+        limit: params.limit ?? 100,
+        ...params,
+      };
       let total, count = 0;
       do {
-        const results = await fn({
-          params,
-        });
+        const results = await fn.call(this, {
+          $,
+          params,
+        });
         if (!results?.length) {
           return;
         }
         for (const item of results) {
           yield item;
           if (max && ++count >= max) {
             return;
           }
         }
         total = results?.length;
         params.marker = results[results.length - 1].domain;
       } while (total === params.limit);
     },

GTFalcao
GTFalcao previously approved these changes Sep 25, 2025
Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
components/godaddy/actions/suggest-domains/suggest-domains.mjs (3)

42-53: Add basic bounds on lengthMin/lengthMax.

Provide minimal validation to prevent invalid requests.

     lengthMax: {
       type: "integer",
       label: "Length Max",
       description: "Maximum length of second-level domain",
       optional: true,
+      min: 1,
     },
     lengthMin: {
       type: "integer",
       label: "Length Min",
       description: "Minimum length of second-level domain",
       optional: true,
+      min: 1,
     },

54-65: Constrain limit and waitMs to sane ranges.

Prevents accidental huge payloads or excessive waits.

     limit: {
       type: "integer",
       label: "Limit",
       description: "Maximum number of suggestions to return",
       optional: true,
+      min: 1,
+      max: 1000,
     },
     waitMs: {
       type: "integer",
       label: "Wait Ms",
       description: "Maximum amount of time, in milliseconds, to wait for responses. If elapses, return the results compiled up to that point",
       optional: true,
+      min: 0,
+      max: 30000,
     },

83-84: Guard summary in case of non-array response.

Minor safety to avoid .length on unexpected payloads.

-    $.export("$summary", `Found ${domains.length} domain(s)`);
-    return domains;
+    const list = Array.isArray(domains) ? domains : [];
+    $.export("$summary", `Found ${list.length} domain(s)`);
+    return list;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d0df473 and cf2591b.

📒 Files selected for processing (2)
  • components/godaddy/actions/suggest-domains/suggest-domains.mjs (1 hunks)
  • components/godaddy/godaddy.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-09-25T16:13:11.505Z
Learnt from: LucBerge
PR: PipedreamHQ/pipedream#14080
File: components/nocodb/nocodb.app.mjs:133-133
Timestamp: 2024-09-25T16:13:11.505Z
Learning: When implementing pagination with an offset, incrementing `args.params.offset` within the loop ensures correct tracking of the offset, particularly when a maximum count limit (`max`) is used.

Applied to files:

  • components/godaddy/godaddy.app.mjs
🧬 Code graph analysis (2)
components/godaddy/actions/suggest-domains/suggest-domains.mjs (2)
components/godaddy/godaddy.app.mjs (1)
  • domains (13-17)
components/godaddy/actions/list-domains/list-domains.mjs (1)
  • domains (49-59)
components/godaddy/godaddy.app.mjs (3)
components/godaddy/actions/suggest-domains/suggest-domains.mjs (1)
  • domains (68-81)
components/godaddy/actions/list-domains/list-domains.mjs (1)
  • domains (49-59)
components/godaddy/sources/new-domain-added/new-domain-added.mjs (2)
  • domains (43-43)
  • results (45-54)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (5)
components/godaddy/godaddy.app.mjs (5)

12-27: LGTM: options now pass marker under params.

Pagination for the “Domain” prop will work as expected.


96-104: URL‑encode domain in renew path.

Avoids path issues for edge cases.

       return this._makeRequest({
         method: "POST",
-        path: `/domains/${domain}/renew`,
+        path: `/domains/${encodeURIComponent(domain)}/renew`,
         ...opts,
       });

62-64: Provide a production fallback for base URL (avoid undefined/v1).

If this.$auth.api_url isn’t set, requests will target undefined/v1. Default to prod and trim trailing slashes.

     _baseUrl() {
-      return `${this.$auth.api_url}/v1`;
+      const base = (this.$auth.api_url || "https://api.godaddy.com").replace(/\/+$/, "");
+      return `${base}/v1`;
     },

65-77: Normalize requests and fix array query serialization; add headers/timeout.

Adds method defaults, JSON headers, 10s timeout, GET data→params mapping, and a paramsSerializer that repeats array keys (required for GoDaddy).

-    _makeRequest({
-      $ = this,
-      path,
-      ...opts
-    }) {
-      return axios($, {
-        url: `${this._baseUrl()}${path}`,
-        headers: {
-          "Authorization": `sso-key ${this.$auth.api_key}:${this.$auth.api_secret}`,
-        },
-        ...opts,
-      });
-    },
+    _makeRequest({
+      $ = this,
+      path,
+      method = "GET",
+      headers = {},
+      ...opts
+    }) {
+      const config = {
+        method,
+        url: `${this._baseUrl()}${path}`,
+        headers: {
+          "Authorization": `sso-key ${this.$auth.api_key}:${this.$auth.api_secret}`,
+          "Accept": "application/json",
+          ...(method?.toUpperCase() !== "GET" ? { "Content-Type": "application/json" } : {}),
+          ...headers,
+        },
+        timeout: 10000,
+        // Ensure arrays are serialized as repeated keys: ?tlds=com&tlds=net
+        paramsSerializer: (params) => {
+          const usp = new URLSearchParams();
+          for (const [k, v] of Object.entries(params || {})) {
+            if (v === undefined || v === null) continue;
+            if (Array.isArray(v)) {
+              for (const item of v) usp.append(k, item);
+            } else {
+              usp.append(k, v);
+            }
+          }
+          return usp.toString();
+        },
+        ...opts,
+      };
+      // Support callers that mistakenly pass GET query under `data`
+      if (config.method.toUpperCase() === "GET" && config.data && !config.params) {
+        config.params = config.data;
+        delete config.data;
+      }
+      return axios($, config);
+    },

111-134: Blocker: lost this binding in paginate + hard‑overwrites limit.

Unbound method will crash; also ignore caller’s limit. Bind this, pass $, and only default limit when absent.

-    async *paginate({
-      fn, params = {}, max,
-    }) {
-      params = {
-        ...params,
-        limit: 100,
-      };
+    async *paginate({
+      fn, params = {}, max, $ = this,
+    }) {
+      params = {
+        ...params,
+        limit: params.limit ?? 100,
+      };
       let total, count = 0;
       do {
-        const results = await fn({
-          params,
-        });
+        const results = await fn.call(this, {
+          $,
+          params,
+        });
         if (!results?.length) {
           return;
         }
         for (const item of results) {
           yield item;
           if (max && ++count >= max) {
             return;
           }
         }
         total = results?.length;
-        params.marker = results[results.length - 1].domain;
+        params.marker = results[results.length - 1]?.domain;
       } while (total === params.limit);
     },

@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 61d0151 into master Sep 30, 2025
10 checks passed
@michelle0927 michelle0927 deleted the issue-16068 branch September 30, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GoDaddy

3 participants