Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Dec 8, 2025

Resolves #7152

Summary by CodeRabbit

  • New Features

    • Added quote polling source to monitor new or updated quotes
    • Added listQuotes method to query quotes from Xero
  • Refactor

    • Introduced a shared base-polling module and migrated polling sources to use it
    • Polling sources now emit event timestamps for items
  • Chores

    • Bumped package to 0.5.0 and updated component/action versions across the Xero integration
  • Bug Fixes

    • Adjusted success messaging in purchase bill creation output

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Walkthrough

Adds a shared base polling source, refactors two polling sources to use it, introduces a new "New or Updated Quote" polling source, adds listQuotes to the app client, bumps package version, and increments versions across many action modules; mostly metadata changes with a few functional polling/source updates.

Changes

Cohort / File(s) Summary
Action version bumps (many modules)
components/xero_accounting_api/actions/*/*.mjs
Version field incremented in numerous action modules (e.g., 0.0.x → 0.0.x+1, 0.1.x → 0.1.x+1, 0.2.x/0.3.x → +0.1); no runtime logic or control-flow changes aside from metadata updates.
Package version
components/xero_accounting_api/package.json
Package version bumped from 0.4.0 to 0.5.0.
Base polling module (new)
components/xero_accounting_api/sources/common/base-polling.mjs
New shared polling mixin exporting common props: xeroAccountingApi, db, timer (with DEFAULT_POLLING_SOURCE_TIMER_INTERVAL), and tenantId (propDefinition).
New quote polling source
components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs
New source that extends the base polling mixin, polls /Quotes using modifiedSince, maintains lastDateChecked in DB, emits per-quote events with id, summary, ts, and payload, and uses Accept: application/json header.
Refactored polling sources
components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs, components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs
Sources now spread ...common base polling props (removed explicit props), initialize/persist lastDateChecked in DB, use sliced date (first 10 chars) and Accept: application/json header for API calls, include ts timestamp in emitted events, and bump versions (0.0.4 → 0.0.5).
Webhook source version bump
components/xero_accounting_api/sources/webhook-event-received/webhook-event-received.mjs
Version bumped from 0.0.2 to 0.0.3; no logic changes.
App client method added
components/xero_accounting_api/xero_accounting_api.app.mjs
Added listQuotes(opts = {}) method that builds a request to the /Quotes endpoint using existing request builder.

Sequence Diagram(s)

sequenceDiagram
    participant Timer
    participant Source as Polling Source
    participant DB
    participant XeroAPI as Xero API
    participant Emit as Event Emitter

    Timer->>Source: Trigger (interval)
    Source->>DB: Read lastDateChecked
    alt not set
        Source->>DB: Initialize lastDateChecked = now()
    end
    Source->>XeroAPI: GET /Quotes?modifiedSince={lastDateChecked} (Accept: application/json)
    XeroAPI-->>Source: Quotes JSON
    loop For each quote (reverse order)
        Source->>Source: Format UpdatedDateUTC (slice date)
        Source->>DB: Update lastDateChecked
        Source->>Emit: Emit event (id, summary, ts, payload)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Areas needing attention:
    • components/xero_accounting_api/sources/common/base-polling.mjs — verify props and defaults align with callers.
    • new-or-updated-quote — validate API path/params and emitted id/ts formatting.
    • Refactored new-updated-contact and new-updated-invoice — ensure DB initialization and date-slicing changes preserve intended ordering/deduping.
    • components/xero_accounting_api/xero_accounting_api.app.mjs — confirm listQuotes uses auth/request builder consistently.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is incomplete. It only contains 'Resolves #7152' but fails to follow the template structure which requires a 'WHY' section explaining the rationale for the changes. Add a 'WHY' section to the description explaining the motivation and context for implementing the new quote trigger feature.
Out of Scope Changes check ❓ Inconclusive While most changes align with the quote trigger feature, numerous version bumps across 31+ action files and the addition of a base-polling module may extend beyond the immediate scope of adding a single new trigger. Clarify whether the broad version bumping and base-polling refactoring are necessary dependencies for the quote trigger feature, or if they should be separated into distinct PRs.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new Xero trigger for monitoring quote creation or updates.
Linked Issues check ✅ Passed The PR successfully implements the core requirements from issue #7152: adds a new 'New or Updated Quote' trigger for the Xero Accounting API that monitors quote creation and updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-7152

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

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

@vercel
Copy link

vercel bot commented Dec 8, 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 Dec 11, 2025 4:18pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Dec 11, 2025 4:18pm

@michelle0927 michelle0927 marked this pull request as ready for review December 8, 2025 18:54
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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (7)
components/xero_accounting_api/actions/create-payment/create-payment.mjs (1)

133-137: Bug: Property name mismatch causes accountCode to be ignored.

The prop is defined as accountCode (line 29), but it's referenced here as this.account_code. This will always pass undefined as the account code, breaking the flow when users provide an account code instead of an account ID.

   } else {
     data["Account"] = {
-      Code: this.account_code,
+      Code: this.accountCode,
     };
   }
components/xero_accounting_api/actions/xero-accounting-update-contact/xero-accounting-update-contact.mjs (1)

154-159: Fix typo property names in contact-related modules.

The properties puchasesDefaultAccountCode (line 154) and puechasesTrackingCategories (line 166) contain typos in their names. These should be purchasesDefaultAccountCode and purchasesTrackingCategories to match the API field names and improve code clarity. The same typos exist in xero-accounting-create-or-update-contact.mjs, affecting at least 4 occurrences total across both modules.

components/xero_accounting_api/actions/list-credit-notes/list-credit-notes.mjs (1)

7-65: Version bump is fine; consider not swallowing all errors as “No credit notes found”.

Current catch converts any failure (including auth / config / network errors) into an empty {} with a generic summary, which makes debugging harder. Consider only treating specific “no results” responses this way (e.g., by checking HTTP status or error code) and surfacing other errors.

   async run({ $ }) {
     try {
       const response = await this.xeroAccountingApi.listCreditNotes({
         $,
         tenantId: this.tenantId,
         modifiedSince: this.modifiedAfter,
         params: {
           Where: this.where,
           order: this.order,
           page: this.page,
         },
       });
 
       $.export("$summary", `Successfully fetched ${response.CreditNotes.length} credit notes`);
       return response;
-    } catch (e) {
-      $.export("$summary", "No credit notes found");
-      return {};
-    }
+    } catch (err) {
+      // Adjust this condition to match your HTTP/client error shape
+      if (err?.response?.status === 404) {
+        $.export("$summary", "No credit notes found");
+        return {};
+      }
+      throw err;
+    }
   },
components/xero_accounting_api/actions/list-invoices/list-invoices.mjs (1)

7-101: Version bump is fine; consider narrowing the generic “No invoices found” catch.

As with credit notes, the catch path currently hides all failures as “No invoices found”, which can obscure auth or API errors. It’s safer to only treat known “no data” conditions this way and rethrow or surface other errors.

   async run({ $ }) {
     try {
       const response = await this.xeroAccountingApi.listInvoices({
         $,
         tenantId: this.tenantId,
         modifiedSince: this.modifiedAfter,
         params: {
           IDs: this.ids,
           InvoiceNumbers: this.invoiceNumbers,
           ContactIDs: this.contactIds,
           Statuses: this.statuses,
           Where: this.where,
           createdByMyApp: this.createdByMyApp,
           order: this.order,
           page: this.page,
         },
       });
 
       $.export("$summary", `Successfully fetched ${response.Invoices.length} invoices`);
       return response;
-    } catch (e) {
-      $.export("$summary", "No invoices found");
-      return {};
-    }
+    } catch (err) {
+      // Adjust this condition to match your HTTP/client error shape
+      if (err?.response?.status === 404) {
+        $.export("$summary", "No invoices found");
+        return {};
+      }
+      throw err;
+    }
   },
components/xero_accounting_api/actions/create-tracking-category/create-tracking-category.mjs (1)

9-67: Improve error handling and remove console.log from the catch block.

The catch block has two issues: it logs the raw error object via console.log (lines 63), and it unsafely accesses err.response.data.Elements[0].ValidationErrors[0].Message without guarding against missing properties. Either issue will break error handling. Use optional chaining and provide a fallback message instead.

   async run({ $ }) {
     try {
       const response = await this.xeroAccountingApi.createTrackingCategory({
         $,
         tenantId: this.tenantId,
         data: {
           Name: this.name,
         },
       });

       if (this.options) {
         const parsedOptions = parseObject(this.options);

         for (const option of parsedOptions) {
           const optionResponse = await this.xeroAccountingApi.createTrackingOption({
             $,
             tenantId: this.tenantId,
             trackingCategoryId: response.TrackingCategories[0].TrackingCategoryID,
             data: {
               Name: option,
             },
           });
           response.TrackingCategories[0].Options.push(optionResponse.Options[0]);
         }
       }

       $.export("$summary", `Successfully created tracking category with ID: ${response.TrackingCategories[0].TrackingCategoryID}`);
       return response;
     } catch (err) {
-      console.log(err);
-      throw new ConfigurationError(err.response.data.Elements[0].ValidationErrors[0].Message);
+      const message =
+        err?.response?.data?.Elements?.[0]?.ValidationErrors?.[0]?.Message
+        || err?.message
+        || "Failed to create tracking category";
+      throw new ConfigurationError(message);
     }
   },
components/xero_accounting_api/actions/update-tracking-category/update-tracking-category.mjs (1)

8-67: Harden error handling to avoid destructuring failures in catch.

The catch ({ response: { data } }) destructuring will throw a TypeError if the error lacks a response or data property (e.g., network errors, SDK errors), masking the original failure. Catch the full error object and use optional chaining to safely access nested properties before constructing the ConfigurationError message.

-    } catch ({ response: { data } }) {
-      throw new ConfigurationError(data.Elements[0].ValidationErrors[0].Message);
+    } catch (err) {
+      const message =
+        err?.response?.data?.Elements?.[0]?.ValidationErrors?.[0]?.Message
+        || err?.message
+        || "Failed to update tracking category";
+      throw new ConfigurationError(message);
     }
components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs (1)

9-145: Fix undefined PurchaseBillID in summary export.

The response from createInvoice follows Xero's standard structure with Invoices: [...], so response.PurchaseBillID will be undefined. Access the ID from response.Invoices[0].InvoiceID instead:

-    $.export("$summary", `Successfully created purchase bill with ID: ${response.PurchaseBillID}`);
-    return response;
+    const invoiceId = response?.Invoices?.[0]?.InvoiceID;
+    $.export(
+      "$summary",
+      invoiceId
+        ? `Successfully created purchase bill with ID: ${invoiceId}`
+        : "Successfully created purchase bill",
+    );
+    return response;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e061bd2 and 89a2b2b.

📒 Files selected for processing (45)
  • components/xero_accounting_api/actions/add-line-item-to-invoice/add-line-item-to-invoice.mjs (1 hunks)
  • components/xero_accounting_api/actions/create-bank-transaction/create-bank-transaction.mjs (1 hunks)
  • components/xero_accounting_api/actions/create-bill/create-bill.mjs (1 hunks)
  • components/xero_accounting_api/actions/create-credit-note/create-credit-note.mjs (1 hunks)
  • components/xero_accounting_api/actions/create-history-note/create-history-note.mjs (1 hunks)
  • components/xero_accounting_api/actions/create-item/create-item.mjs (1 hunks)
  • components/xero_accounting_api/actions/create-payment/create-payment.mjs (1 hunks)
  • components/xero_accounting_api/actions/create-tracking-category/create-tracking-category.mjs (1 hunks)
  • components/xero_accounting_api/actions/create-update-contact/create-update-contact.mjs (1 hunks)
  • components/xero_accounting_api/actions/delete-tracking-category-option/delete-tracking-category-option.mjs (1 hunks)
  • components/xero_accounting_api/actions/delete-tracking-category/delete-tracking-category.mjs (1 hunks)
  • components/xero_accounting_api/actions/download-invoice/download-invoice.mjs (1 hunks)
  • components/xero_accounting_api/actions/email-an-invoice/email-an-invoice.mjs (1 hunks)
  • components/xero_accounting_api/actions/find-invoice/find-invoice.mjs (1 hunks)
  • components/xero_accounting_api/actions/find-or-create-contact/find-or-create-contact.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-bank-statements-report/get-bank-statements-report.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-bank-summary/get-bank-summary.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-contact/get-contact.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-history-of-changes/get-history-of-changes.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-invoice-online-url/get-invoice-online-url.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-invoice/get-invoice.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-item/get-item.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-tenant-connections/get-tenant-connections.mjs (1 hunks)
  • components/xero_accounting_api/actions/get-tracking-category/get-tracking-category.mjs (1 hunks)
  • components/xero_accounting_api/actions/list-contacts/list-contacts.mjs (1 hunks)
  • components/xero_accounting_api/actions/list-credit-notes/list-credit-notes.mjs (1 hunks)
  • components/xero_accounting_api/actions/list-invoices/list-invoices.mjs (1 hunks)
  • components/xero_accounting_api/actions/list-manual-journals/list-manual-journals.mjs (1 hunks)
  • components/xero_accounting_api/actions/list-tracking-categories/list-tracking-categories.mjs (1 hunks)
  • components/xero_accounting_api/actions/make-an-api-call/make-an-api-call.mjs (1 hunks)
  • components/xero_accounting_api/actions/update-tracking-category-option/update-tracking-category-option.mjs (1 hunks)
  • components/xero_accounting_api/actions/update-tracking-category/update-tracking-category.mjs (1 hunks)
  • components/xero_accounting_api/actions/upload-file/upload-file.mjs (1 hunks)
  • components/xero_accounting_api/actions/xero-accounting-create-employee/xero-accounting-create-employee.mjs (1 hunks)
  • components/xero_accounting_api/actions/xero-accounting-create-or-update-contact/xero-accounting-create-or-update-contact.mjs (1 hunks)
  • components/xero_accounting_api/actions/xero-accounting-update-contact/xero-accounting-update-contact.mjs (1 hunks)
  • components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs (1 hunks)
  • components/xero_accounting_api/actions/xero-create-sales-invoice/xero-create-sales-invoice.mjs (1 hunks)
  • components/xero_accounting_api/package.json (1 hunks)
  • components/xero_accounting_api/sources/common/base-polling.mjs (1 hunks)
  • components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs (1 hunks)
  • components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs (3 hunks)
  • components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs (3 hunks)
  • components/xero_accounting_api/sources/webhook-event-received/webhook-event-received.mjs (1 hunks)
  • components/xero_accounting_api/xero_accounting_api.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.

Applied to files:

  • components/xero_accounting_api/sources/webhook-event-received/webhook-event-received.mjs
🧬 Code graph analysis (2)
components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs (2)
components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs (1)
  • lastDateChecked (13-13)
components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs (1)
  • lastDateChecked (13-13)
components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs (2)
components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs (1)
  • lastDateChecked (13-13)
components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs (1)
  • lastDateChecked (13-13)
⏰ 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). (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (42)
components/xero_accounting_api/actions/find-invoice/find-invoice.mjs (1)

11-11: Verify the rationale for systematic version bumps across 35 actions.

This is a patch version bump (0.0.4 → 0.0.5) applied to this action module. According to the PR summary, the primary objective is to add a new "New or Updated Quote" polling source. Verify that this version bump across 35 action modules is intentional and whether it should be coordinated with the core feature changes rather than applied as a blanket metadata update.

components/xero_accounting_api/actions/get-item/get-item.mjs (1)

7-7: Verify the necessity of the version bump.

The version has been incremented from 0.2.3 to 0.2.4, but the code logic, error handling, and runtime behavior remain unchanged. According to the enriched summary, this is part of a broader pattern across 35 action modules, none of which have logic changes.

Typically, version bumps accompany functional or feature changes. Please clarify whether this coordinated version bump across unrelated modules is intentional—for example, whether it's tied to an overall package version release or required by Pipedream's versioning policy.

components/xero_accounting_api/actions/get-tenant-connections/get-tenant-connections.mjs (1)

7-7: LGTM!

The patch version bump is appropriate for a metadata-only change with no behavioral modifications.

components/xero_accounting_api/actions/list-contacts/list-contacts.mjs (1)

7-7: Verify the rationale for this version bump.

The version has been incremented from 0.2.1 to 0.2.2, but the action's code logic remains unchanged. While the AI summary notes this is part of a batch version bump across 35 actions, this particular action is unrelated to the core PR objectives (quote trigger and polling refactors).

Please confirm whether this version bump is intentional as part of a coordinated release strategy or if it should be reverted.

components/xero_accounting_api/actions/create-payment/create-payment.mjs (1)

8-8: LGTM!

Version bump is consistent with the PR pattern.

components/xero_accounting_api/actions/xero-accounting-update-contact/xero-accounting-update-contact.mjs (1)

9-9: Version bump approved as routine maintenance.

The version bump to 0.1.4 is consistent with the PR objective of updating versions across action modules. No functional changes are introduced.

components/xero_accounting_api/actions/xero-accounting-create-or-update-contact/xero-accounting-create-or-update-contact.mjs (1)

8-8: Version bump is appropriate as part of coordinated release.

The version increment aligns with the broader pattern of updates across the Xero actions in this PR, which includes additions to the shared app client. This change is approved.

components/xero_accounting_api/actions/get-history-of-changes/get-history-of-changes.mjs (1)

8-8: Version bump is appropriate and isolated.

The metadata version update is consistent with other action version increments in this PR.

components/xero_accounting_api/actions/make-an-api-call/make-an-api-call.mjs (1)

9-9: Version bump is appropriate and isolated.

The metadata version update is consistent with other action version increments in this PR.

components/xero_accounting_api/actions/get-bank-summary/get-bank-summary.mjs (1)

8-8: Version bump is appropriate and isolated.

The metadata version update is consistent with other action version increments in this PR.

components/xero_accounting_api/actions/create-credit-note/create-credit-note.mjs (1)

9-9: Version bump is appropriate and isolated.

The metadata version update is consistent with other action version increments in this PR.

components/xero_accounting_api/actions/email-an-invoice/email-an-invoice.mjs (1)

8-8: Version bump is appropriate and isolated.

The metadata version update is consistent with other action version increments in this PR.

components/xero_accounting_api/actions/update-tracking-category-option/update-tracking-category-option.mjs (1)

8-8: Version bump is appropriate and isolated.

The metadata version update is consistent with other action version increments in this PR. Note that this action uses the 0.0.x series while most others use 0.1.x.

components/xero_accounting_api/actions/delete-tracking-category/delete-tracking-category.mjs (2)

8-8: Version bump is appropriate and isolated.

The metadata version update is consistent with other action version increments in this PR.


43-45: Defensive error handling is well-structured.

The optional chaining on line 44 appropriately guards against missing nested error properties, ensuring robust error handling.

components/xero_accounting_api/actions/create-history-note/create-history-note.mjs (2)

8-8: Version bump is appropriate and isolated.

The metadata version update is consistent with other action version increments in this PR.


27-41: Quote support was already available in endpoint options.

The action already includes "Quotes" among the supported document types (line 40), indicating the app had partial quote infrastructure in place prior to this PR.

components/xero_accounting_api/actions/create-bill/create-bill.mjs (1)

13-13: LGTM!

Version bump aligns with the package version update to 0.5.0.

components/xero_accounting_api/actions/create-update-contact/create-update-contact.mjs (1)

9-9: LGTM!

Version bump aligns with the package version update to 0.5.0.

components/xero_accounting_api/actions/xero-accounting-create-employee/xero-accounting-create-employee.mjs (1)

9-9: LGTM!

Version bump aligns with the package version update to 0.5.0.

components/xero_accounting_api/actions/download-invoice/download-invoice.mjs (1)

9-9: LGTM!

Version bump aligns with the package version update to 0.5.0.

components/xero_accounting_api/package.json (1)

3-3: LGTM!

Minor version bump from 0.4.0 to 0.5.0 is appropriate for the addition of new functionality (new "New or Updated Quote" source, base-polling module, and listQuotes method) without breaking changes.

components/xero_accounting_api/actions/create-item/create-item.mjs (1)

8-8: Version bump only – action behavior unchanged.

The version increment is consistent with the rest of the Xero Accounting actions; runtime logic remains the same.

components/xero_accounting_api/actions/upload-file/upload-file.mjs (1)

8-8: Metadata version increment looks consistent.

No behavioral changes; upload and streaming logic remain as before.

components/xero_accounting_api/actions/get-bank-statements-report/get-bank-statements-report.mjs (1)

8-8: Bank statements report action version bump is safe.

Validation, params, and summary message are unchanged; only the version string is updated.

components/xero_accounting_api/actions/create-bank-transaction/create-bank-transaction.mjs (1)

8-8: LGTM! Version bump aligns with package release.

The version increment is appropriate as part of the broader package version update from 0.4.0 to 0.5.0.

components/xero_accounting_api/actions/list-tracking-categories/list-tracking-categories.mjs (1)

7-7: LGTM! Version bump aligns with package release.

The version increment is appropriate as part of the broader package version update from 0.4.0 to 0.5.0.

components/xero_accounting_api/actions/get-contact/get-contact.mjs (1)

7-7: LGTM! Version bump aligns with package release.

The version increment is appropriate as part of the broader package version update from 0.4.0 to 0.5.0.

components/xero_accounting_api/actions/delete-tracking-category-option/delete-tracking-category-option.mjs (1)

8-8: LGTM! Version bump aligns with package release.

The version increment is appropriate as part of the broader package version update from 0.4.0 to 0.5.0.

components/xero_accounting_api/sources/webhook-event-received/webhook-event-received.mjs (1)

8-8: LGTM! Version bump aligns with package release.

The version increment is appropriate as part of the broader package version update from 0.4.0 to 0.5.0.

components/xero_accounting_api/actions/find-or-create-contact/find-or-create-contact.mjs (1)

12-12: LGTM! Version bump aligns with package release.

The version increment is appropriate as part of the broader package version update from 0.4.0 to 0.5.0.

components/xero_accounting_api/actions/add-line-item-to-invoice/add-line-item-to-invoice.mjs (1)

11-11: LGTM! Version bump aligns with package release.

The version increment is appropriate as part of the broader package version update from 0.4.0 to 0.5.0.

components/xero_accounting_api/actions/list-manual-journals/list-manual-journals.mjs (1)

7-7: LGTM! Version bump aligns with package release.

The version increment is appropriate as part of the broader package version update from 0.4.0 to 0.5.0.

components/xero_accounting_api/actions/get-invoice-online-url/get-invoice-online-url.mjs (1)

7-7: LGTM!

Version bump is consistent with the broader package update in this PR.

components/xero_accounting_api/actions/get-tracking-category/get-tracking-category.mjs (1)

7-7: LGTM!

Version bump is consistent with the broader package update in this PR.

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

391-396: LGTM!

The new listQuotes method follows the established pattern of other list methods in this app client (e.g., listContacts, listInvoices). Clean and consistent implementation.

components/xero_accounting_api/actions/get-invoice/get-invoice.mjs (1)

7-7: LGTM!

Version bump is consistent with the broader package update in this PR.

components/xero_accounting_api/actions/xero-create-sales-invoice/xero-create-sales-invoice.mjs (1)

9-9: LGTM!

Version bump is consistent with the broader package update in this PR.

components/xero_accounting_api/sources/common/base-polling.mjs (1)

1-21: LGTM!

Good DRY refactoring. Extracting common polling props into a shared base module reduces duplication across sources and ensures consistent configuration (timer interval, tenant selection).

components/xero_accounting_api/sources/new-updated-invoice/new-updated-invoice.mjs (1)

2-5: LGTM!

Good refactoring to use the shared base polling module, reducing code duplication and ensuring consistent polling configuration across sources.

components/xero_accounting_api/sources/new-or-updated-quote/new-or-updated-quote.mjs (1)

12-38: Implementation follows the established pattern.

The polling logic correctly:

  • Initializes lastDateChecked on first run
  • Uses date-only slice for modifiedSince parameter
  • Processes quotes in reverse chronological order
  • Emits with unique ID combining QuoteID and timestamp
components/xero_accounting_api/sources/new-updated-contact/new-updated-contact.mjs (1)

1-9: Refactor to shared base-polling module looks good.

The changes correctly:

  • Import and spread the common base-polling module
  • Standardize the modifiedSince parameter handling
  • Add explicit Accept: application/json header
  • Bump version appropriately

lcaresia
lcaresia previously approved these changes Dec 9, 2025
Copy link
Collaborator

@lcaresia lcaresia left a comment

Choose a reason for hiding this comment

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

LGTM!

@vunguyenhung
Copy link
Collaborator

Hello everyone, I have tested this PR and there're some test cases failed or needed improvement.

Please check test reports below for more information:

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs (1)

95-117: Align Sent to Contact prop type and validation message with actual inputs

Two small inconsistencies worth fixing:

  1. sentToContact is described as a Boolean but declared as type: "string", which is confusing and may send a string to Xero where a boolean is expected.
  2. The configuration error message mentions a **Type** parameter that users don’t actually configure (it’s hard‑coded as "ACCPAY").

Consider this adjustment:

     sentToContact: {
       label: "Sent to Contact",
-      type: "string",
-      description: "Boolean to set whether the invoice in the Xero app should be marked as \"sent\". This can be set only on invoices that have been approved",
+      type: "boolean",
+      description: "Boolean to set whether the invoice in the Xero app should be marked as \"sent\". This can be set only on invoices that have been approved",
       optional: true,
     },
@@
   async run({ $ }) {
     if ((!this.contactId && !this.contactName) || !this.tenantId || !this.lineItems) {
-      throw new ConfigurationError("Must provide one of **Contact ID** or **Contact Name**, **Tenant ID**, **Type**, and **Line Items** parameters.");
+      throw new ConfigurationError("Must provide one of **Contact ID** or **Contact Name**, **Tenant ID**, and **Line Items** parameters.");
     }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89a2b2b and f35dfde.

📒 Files selected for processing (1)
  • components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs (2 hunks)
⏰ 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: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (1)
components/xero_accounting_api/actions/xero-create-purchase-bill/xero-create-purchase-bill.mjs (1)

9-9: Version bump is appropriate for this behavioral tweak

The version increment to 0.1.4 correctly reflects a small, backward‑compatible behavior change (success summary only). No issues here.

@vunguyenhung
Copy link
Collaborator

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.

Xero New or Updated Quote

4 participants