Skip to content

Conversation

jcortes
Copy link
Collaborator

@jcortes jcortes commented Sep 2, 2025

WHY

Resolves #18051

Summary by CodeRabbit

  • New Features
    • Full Paazl integration: added actions for checkout tokens/sessions, saving/modifying/deleting orders, creating shipments, retrieving shipments/returns/tracking, fetching home-delivery and pickup options, and downloading labels; expanded app-level API surface and request client.
  • Chores
    • Package version bumped to 0.1.0 and added @pipedream/platform dependency.
  • Other
    • Minor prop and input validations tightened for several actions (e.g., required postal code and adjusted shipping option resolution).

@jcortes jcortes self-assigned this Sep 2, 2025
Copy link

vercel bot commented Sep 2, 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 16, 2025 9:35pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Sep 16, 2025 9:35pm

Copy link
Contributor

coderabbitai bot commented Sep 2, 2025

Caution

Review failed

Failed to post review comments.

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df1102d and 74d9307.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • components/paazl/actions/create-checkout-token/create-checkout-token.mjs (1 hunks)
  • components/paazl/actions/create-shipment/create-shipment.mjs (1 hunks)
  • components/paazl/actions/delete-order/delete-order.mjs (1 hunks)
  • components/paazl/actions/get-checkout-session/get-checkout-session.mjs (1 hunks)
  • components/paazl/actions/get-order-labels/get-order-labels.mjs (1 hunks)
  • components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1 hunks)
  • components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1 hunks)
  • components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1 hunks)
  • components/paazl/actions/get-return-shipments/get-return-shipments.mjs (1 hunks)
  • components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1 hunks)
  • components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (1 hunks)
  • components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1 hunks)
  • components/paazl/actions/modify-order/modify-order.mjs (1 hunks)
  • components/paazl/actions/save-checkout-session/save-checkout-session.mjs (1 hunks)
  • components/paazl/actions/save-order/save-order.mjs (1 hunks)
  • components/paazl/paazl.app.mjs (1 hunks)
  • components/paazl/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (12)
  • components/paazl/package.json
  • components/paazl/actions/delete-order/delete-order.mjs
  • components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs
  • components/paazl/actions/get-shipping-options/get-shipping-options.mjs
  • components/paazl/actions/get-return-shipments/get-return-shipments.mjs
  • components/paazl/actions/get-order-shipments/get-order-shipments.mjs
  • components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs
  • components/paazl/actions/save-order/save-order.mjs
  • components/paazl/actions/get-order-labels/get-order-labels.mjs
  • components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs
  • components/paazl/actions/save-checkout-session/save-checkout-session.mjs
  • components/paazl/actions/modify-order/modify-order.mjs
🧰 Additional context used
🧬 Code graph analysis (4)
components/paazl/actions/create-checkout-token/create-checkout-token.mjs (3)
components/paazl/actions/delete-order/delete-order.mjs (1)
  • response (25-28)
components/paazl/actions/get-checkout-session/get-checkout-session.mjs (1)
  • response (25-30)
components/paazl/actions/save-checkout-session/save-checkout-session.mjs (1)
  • response (64-83)
components/paazl/paazl.app.mjs (15)
components/paazl/actions/create-checkout-token/create-checkout-token.mjs (1)
  • response (25-30)
components/paazl/actions/create-shipment/create-shipment.mjs (1)
  • response (131-191)
components/paazl/actions/delete-order/delete-order.mjs (1)
  • response (25-28)
components/paazl/actions/get-checkout-session/get-checkout-session.mjs (1)
  • response (25-30)
components/paazl/actions/get-order-labels/get-order-labels.mjs (1)
  • response (40-47)
components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1)
  • response (24-27)
components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1)
  • response (57-66)
components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1)
  • response (172-223)
components/paazl/actions/get-return-shipments/get-return-shipments.mjs (1)
  • response (24-27)
components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1)
  • response (50-58)
components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (1)
  • response (34-38)
components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1)
  • response (164-223)
components/paazl/actions/modify-order/modify-order.mjs (1)
  • response (212-258)
components/paazl/actions/save-checkout-session/save-checkout-session.mjs (1)
  • response (64-83)
components/paazl/actions/save-order/save-order.mjs (1)
  • response (212-258)
components/paazl/actions/get-parcel-label/get-parcel-label.mjs (2)
components/paazl/actions/get-order-labels/get-order-labels.mjs (1)
  • response (40-47)
components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1)
  • response (50-58)
components/paazl/actions/create-shipment/create-shipment.mjs (4)
components/paazl/actions/get-order-labels/get-order-labels.mjs (1)
  • response (40-47)
components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1)
  • response (24-27)
components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1)
  • response (57-66)
components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1)
  • response (50-58)

Walkthrough

Adds a complete Paazl integration: a populated app with extensive propDefinitions, an axios-based HTTP client and many endpoint wrappers, plus numerous new action modules for checkout, orders, shipments, shipping options, labels, and returns, and a package.json version/dependency bump.

Changes

Cohort / File(s) Summary
App core and HTTP client
components/paazl/paazl.app.mjs
Replaces empty propDefinitions with a large schema; adds axios import, HTTP client helpers (getUrl, getHeaders, makeRequest, post, put, delete) and many Paazl endpoint wrapper methods (checkout, orders, shipments, shipping options, labels, returns).
Checkout actions
components/paazl/actions/create-checkout-token/create-checkout-token.mjs, components/paazl/actions/get-checkout-session/get-checkout-session.mjs, components/paazl/actions/save-checkout-session/save-checkout-session.mjs
New actions: create checkout token, get checkout session, save checkout session; map props to app propDefinitions, call app methods with data/params, export summaries, return API responses.
Order actions
components/paazl/actions/save-order/save-order.mjs, components/paazl/actions/modify-order/modify-order.mjs, components/paazl/actions/delete-order/delete-order.mjs
New actions to save, modify, and delete orders. Build nested payloads (consignee, address, shipping, invoice), parse numeric fields, call corresponding app methods, export summaries, and return responses.
Shipping options actions
components/paazl/actions/get-shipping-options/get-shipping-options.mjs, components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs
New actions to fetch home-delivery and pickup-location shipping options with conditional payload sections (deliveryDateOptions, sortingModel, shipmentParameters) and numeric parsing; return results and summaries.
Shipments & labels
components/paazl/actions/create-shipment/create-shipment.mjs, components/paazl/actions/get-order-shipments/get-order-shipments.mjs, components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs, components/paazl/actions/get-order-labels/get-order-labels.mjs, components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs, components/paazl/actions/get-parcel-label/get-parcel-label.mjs, components/paazl/actions/get-return-shipments/get-return-shipments.mjs
New actions for creating shipments and retrieving shipments, tracking, order/shipment/parcel labels, and return shipments. Props updated to support dynamic option providers (e.g., shipmentId, parcelId); run methods call app wrappers and return responses with summaries.
Package metadata
components/paazl/package.json
Version bumped 0.0.10.1.0; adds dependency "@pipedream/platform": "^3.1.0".
Misc (small edits)
src/calculator.py
Added coderabbit_add method, updated coderabbit_formula signature, and renamed a global variable.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action
  participant App as Paazl App
  participant API as Paazl REST API

  User->>Action: Trigger action (e.g., Save Order, Get Shipping Options)
  Action->>App: app.<method>({ $, data/params })
  rect #CFEFF7
    App->>API: HTTP request (GET/POST/PUT/DELETE)
    API-->>App: Response / Error
  end
  App-->>Action: return response or throw
  Action-->>User: export $summary and return response
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Suggested reviewers

  • luancazarine

Pre-merge checks (2 passed, 2 warnings, 1 inconclusive)

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The diff includes unrelated changes in src/calculator.py (new coderabbit_add method, formula signature change, and global variable rename), which are outside the scope of the Paazl integration objectives defined in issue #18051. Please remove or isolate the calculator file modifications into a separate pull request so that this PR focuses exclusively on the Paazl integration changes.
Description Check ⚠️ Warning The description only contains the template header “## WHY” followed by “Resolves #18051” and lacks any explanation of the rationale, context, or motivation behind adding the Paazl integration components. Please complete the “## WHY” section by describing why the Paazl integration is being added, what problem it solves for users, and any relevant background that helps reviewers understand the change’s purpose.
Title Check ❓ Inconclusive The current title “[Components] Paazl new components” is overly generic and does not clearly highlight the primary change of integrating a full Paazl app client and implementing all associated action modules; it uses vague terminology like “new components” without indicating the scope or nature of the work. Consider renaming the pull request to something more descriptive, for example “Add Paazl app client and implement all Paazl API actions,” so that the title clearly communicates the main changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The pull request implements every action listed in linked issue #18051, including checkout token, session, order save/modify/delete, shipping options (pickup and home delivery), shipment creation and retrieval, labels and tracking endpoints, and return shipments, matching the specified API routes.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I hop through code with whiskers bright,
Tokens, labels, parcels take flight.
Endpoints stacked in tidy rows,
I burrow bytes where data flows.
A carrot nod — integration done 🥕

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch paazl-new-components

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.

@jcortes jcortes force-pushed the paazl-new-components branch from 4b141e6 to fecf177 Compare September 2, 2025 21:30
@luancazarine luancazarine mentioned this pull request Sep 2, 2025
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

🧹 Nitpick comments (6)
components/paazl/paazl.app.mjs (1)

671-686: Labels may require non-JSON Accept/responseType

If these endpoints return binary labels (PDF/PNG/ZPL), you may need Accept per type and responseType: "arraybuffer". Consider allowing callers to override via headers/responseType, or set automatically from params.type.

Please verify expected content-types for label endpoints in the latest Paazl reference before changing defaults. (support.paazl.com)

components/paazl/actions/delete-order/delete-order.mjs (1)

6-6: Doc link anchor refers to saveOrder

Nit: point to the DELETE order doc anchor instead of #/Order/saveOrderUsingPOST.

-  description: "Deletes an order. [See the documentation](https://support.paazl.com/hc/en-us/articles/360008633973-REST-API-reference#/Order/saveOrderUsingPOST)",
+  description: "Deletes an order. [See the documentation](https://support.paazl.com/hc/en-us/articles/360008633973-REST-API-reference#/Order/deleteOrderUsingDELETE)",
components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1)

39-61: Ensure Accept/responseType match requested label format

If Paazl returns binary for PDF/PNG/ZPL, pass appropriate headers and possibly responseType. Example: set headers: { Accept: "application/pdf" } when type === "PDF"; or expose a “download as file” toggle.

Confirm content-types for getShipmentLabels in the current REST reference. (support.paazl.com)

components/paazl/actions/get-shipping-options/get-shipping-options.mjs (3)

173-176: Parse integers for limit and numberOfProcessingDays.

Ensures correct types sent to the API.

-        limit,
-        numberOfProcessingDays,
+        limit: (limit === undefined || limit === null || limit === "") ? undefined : parseInt(limit, 10),
+        numberOfProcessingDays: (numberOfProcessingDays === undefined || numberOfProcessingDays === null || numberOfProcessingDays === "") ? undefined : parseInt(numberOfProcessingDays, 10),

139-146: Avoid shadowing the imported app with the prop app.

Small readability tweak: rename the destructured prop locally.

-    const {
-      app,
+    const {
+      app: paazl,
       consigneeCountryCode,
       consigneePostalCode,
       consignorCountryCode,
       consignorPostalCode,
       locale,
       timeZone,
       limit,
       numberOfProcessingDays,
       includeExternalDeliveryDates,
       token,
       tags,
       sortOrderBy,
       sortOrder,
       sortDistributor,
       totalWeight,
       totalPrice,
       totalVolume,
       numberOfGoods,
       startMatrix,
       deliveryDateStartDate,
       deliveryDateNumberOfDays,
     } = this;

-    const response = await app.getShippingOptions({
+    const response = await paazl.getShippingOptions({

Also applies to: 164-166


225-225: Use local var in summary for consistency.

-    $.export("$summary", `Successfully retrieved ${response.shippingOptions?.length || 0} shipping options for country: ${this.consigneeCountryCode}`);
+    $.export("$summary", `Successfully retrieved ${response.shippingOptions?.length || 0} shipping options for country: ${consigneeCountryCode}`);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4b141e6 and fecf177.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • components/paazl/actions/create-checkout-token/create-checkout-token.mjs (1 hunks)
  • components/paazl/actions/create-shipment/create-shipment.mjs (1 hunks)
  • components/paazl/actions/delete-order/delete-order.mjs (1 hunks)
  • components/paazl/actions/get-checkout-session/get-checkout-session.mjs (1 hunks)
  • components/paazl/actions/get-order-labels/get-order-labels.mjs (1 hunks)
  • components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1 hunks)
  • components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1 hunks)
  • components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1 hunks)
  • components/paazl/actions/get-return-shipments/get-return-shipments.mjs (1 hunks)
  • components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1 hunks)
  • components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (1 hunks)
  • components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1 hunks)
  • components/paazl/actions/modify-order/modify-order.mjs (1 hunks)
  • components/paazl/actions/save-checkout-session/save-checkout-session.mjs (1 hunks)
  • components/paazl/actions/save-order/save-order.mjs (1 hunks)
  • components/paazl/paazl.app.mjs (1 hunks)
  • components/paazl/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (11)
  • components/paazl/actions/get-parcel-label/get-parcel-label.mjs
  • components/paazl/actions/create-checkout-token/create-checkout-token.mjs
  • components/paazl/package.json
  • components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs
  • components/paazl/actions/get-checkout-session/get-checkout-session.mjs
  • components/paazl/actions/get-order-labels/get-order-labels.mjs
  • components/paazl/actions/save-order/save-order.mjs
  • components/paazl/actions/create-shipment/create-shipment.mjs
  • components/paazl/actions/save-checkout-session/save-checkout-session.mjs
  • components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs
  • components/paazl/actions/modify-order/modify-order.mjs
🧰 Additional context used
🧬 Code graph analysis (4)
components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (2)
components/paazl/actions/get-order-labels/get-order-labels.mjs (1)
  • response (40-51)
components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1)
  • response (54-67)
components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1)
components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1)
  • response (171-222)
components/paazl/actions/get-return-shipments/get-return-shipments.mjs (1)
components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1)
  • response (24-27)
components/paazl/actions/get-order-shipments/get-order-shipments.mjs (3)
components/paazl/actions/get-order-labels/get-order-labels.mjs (1)
  • response (40-51)
components/paazl/actions/get-return-shipments/get-return-shipments.mjs (1)
  • response (24-27)
components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (1)
  • response (31-35)
⏰ 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 (9)
components/paazl/paazl.app.mjs (3)

541-555: Auth header construction matches Paazl spec

Public calls use API key only; private calls use key:secret. Good.

Reference: Paazl docs outline which endpoints require API key vs key+secret. (support.paazl.com)


625-631: Correct use of public auth for shipping/pickup options

isPublic: true for /pickuplocations and /shippingoptions aligns with Paazl’s guidance.

(support.paazl.com)

Also applies to: 632-638


42-49: Map shipment options to use the shipment’s id rather than its trackingNumber
The picker feeds into /orders/{orderReference}/shipments/{shipmentId}, which expects the internal shipment id. Update to something like:

-      async options({ orderReference }) {
-        const { shipments } = await this.getOrderShipments({ orderReference });
-        return shipments.map(({ trackingNumber: value }) => value);
-      },
+      async options({ orderReference }) {
+        const { shipments } = await this.getOrderShipments({ orderReference });
+        return shipments.map(({ id, trackingNumber }) => ({
+          label: trackingNumber,
+          value: id,
+        }));
+      },

Please confirm the shipments response shape in Paazl’s REST API reference to ensure you’re using the correct property.

components/paazl/actions/delete-order/delete-order.mjs (1)

19-33: Action flow looks good

Reads props, calls app, exports summary, returns response.

components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1)

18-31: Solid wrapper for shipments retrieval

Props wiring and call to getOrderShipments are correct; summary is helpful.

components/paazl/actions/get-return-shipments/get-return-shipments.mjs (1)

18-31: LGTM

Consistent with other actions; uses getReturnShipments and sets a clear summary.

components/paazl/actions/get-shipping-options/get-shipping-options.mjs (3)

83-88: Verify tags shape matches API.

If Paazl expects an array of strings, ensure propDefinition enforces/normalizes it. Otherwise, coerce here.

Also applies to: 176-178


1-9: Solid action scaffold and prop wiring.

Naming, metadata, and conditional payload construction look consistent with other Paazl actions.


188-199: Confirm request body contract matches Paazl.

  • sortingModel: keys should be orderBy, sortOrder, distributor; ensure sortOrderBy/sortOrder/sortDistributor map to the allowed enums (orderBy: PRICE | DATE | CARRIER | DISTANCE; sortOrder: ASC | DESC; distributor: valid Paazl carrier code).
  • shipmentParameters: verify presence and types for totalWeight, totalVolume, totalPrice, numberOfGoods, startMatrix.
  • top-level: confirm fields and types for limit (or shippingOptionsLimit), numberOfProcessingDays, and tags align with the shippingOptionsUsingPOST schema.

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

♻️ Duplicate comments (5)
components/paazl/paazl.app.mjs (3)

542-544: LGTM! Path construction is correct.

The getUrl method properly constructs the full API URL by prepending the base URL with /v1 prefix, which correctly addresses the past review concerns about path construction.


556-567: LGTM! URL construction fixed.

The makeRequest method now correctly uses this.getUrl(path) instead of the undefined this.getBaseUrl(), which resolves the critical issue identified in the past review.


617-623: LGTM! Default parameter fixed.

The function now correctly uses } = {} as the default parameter instead of the undefined args, which resolves the issue from the past review.

components/paazl/actions/get-shipping-options/get-shipping-options.mjs (2)

164-166: Path correctly includes /v1 prefix.

The getShippingOptions method call is correct. The app's getUrl method already prepends /v1 to the path, so the endpoint will correctly resolve to /v1/shippingoptions.


206-218: Preserve valid zero values for numeric fields.

The current truthy checks will incorrectly exclude valid 0 values. Also, numberOfGoods should be parsed to ensure it's numeric.

Apply this fix to handle zero values correctly:

 shipmentParameters: {
-  totalWeight: totalWeight
-    ? parseFloat(totalWeight)
-    : undefined,
-  totalPrice: totalPrice
-    ? parseFloat(totalPrice)
-    : undefined,
-  totalVolume: totalVolume
-    ? parseFloat(totalVolume)
-    : undefined,
-  numberOfGoods,
+  totalWeight: (totalWeight === undefined || totalWeight === null || totalWeight === "")
+    ? undefined
+    : parseFloat(totalWeight),
+  totalPrice: (totalPrice === undefined || totalPrice === null || totalPrice === "")
+    ? undefined
+    : parseFloat(totalPrice),
+  totalVolume: (totalVolume === undefined || totalVolume === null || totalVolume === "")
+    ? undefined
+    : parseFloat(totalVolume),
+  numberOfGoods: (numberOfGoods === undefined || numberOfGoods === null || numberOfGoods === "")
+    ? undefined
+    : parseInt(numberOfGoods, 10),
   startMatrix: startMatrix,
 },
🧹 Nitpick comments (2)
components/paazl/paazl.app.mjs (2)

61-69: Consider error handling for async options.

The shippingOptionId prop's async options method doesn't handle potential API errors, which could cause the UI to fail when loading options.

Consider adding error handling:

 async options() {
-  const { shippingOptions } = await this.getShippingOptions();
-  return shippingOptions.map(({
-    identifier: value, name: label,
-  }) => ({
-    label,
-    value,
-  }));
+  try {
+    const { shippingOptions } = await this.getShippingOptions();
+    return shippingOptions?.map(({
+      identifier: value, name: label,
+    }) => ({
+      label,
+      value,
+    })) || [];
+  } catch (error) {
+    console.error("Failed to load shipping options:", error);
+    return [];
+  }
 }

76-84: Consider error handling for async options.

The pickupLocationCode prop's async options method doesn't handle potential API errors.

Consider adding error handling:

 async options() {
-  const { pickupLocations } = await this.getPickupLocationOptions();
-  return pickupLocations.map(({
-    code: value, name: label,
-  }) => ({
-    label,
-    value,
-  }));
+  try {
+    const { pickupLocations } = await this.getPickupLocationOptions();
+    return pickupLocations?.map(({
+      code: value, name: label,
+    }) => ({
+      label,
+      value,
+    })) || [];
+  } catch (error) {
+    console.error("Failed to load pickup locations:", error);
+    return [];
+  }
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fecf177 and 03e4c4d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • components/paazl/actions/create-checkout-token/create-checkout-token.mjs (1 hunks)
  • components/paazl/actions/create-shipment/create-shipment.mjs (1 hunks)
  • components/paazl/actions/delete-order/delete-order.mjs (1 hunks)
  • components/paazl/actions/get-checkout-session/get-checkout-session.mjs (1 hunks)
  • components/paazl/actions/get-order-labels/get-order-labels.mjs (1 hunks)
  • components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1 hunks)
  • components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1 hunks)
  • components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1 hunks)
  • components/paazl/actions/get-return-shipments/get-return-shipments.mjs (1 hunks)
  • components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1 hunks)
  • components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (1 hunks)
  • components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1 hunks)
  • components/paazl/actions/modify-order/modify-order.mjs (1 hunks)
  • components/paazl/actions/save-checkout-session/save-checkout-session.mjs (1 hunks)
  • components/paazl/actions/save-order/save-order.mjs (1 hunks)
  • components/paazl/paazl.app.mjs (1 hunks)
  • components/paazl/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (14)
  • components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs
  • components/paazl/actions/create-checkout-token/create-checkout-token.mjs
  • components/paazl/actions/get-return-shipments/get-return-shipments.mjs
  • components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs
  • components/paazl/actions/get-parcel-label/get-parcel-label.mjs
  • components/paazl/actions/delete-order/delete-order.mjs
  • components/paazl/package.json
  • components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs
  • components/paazl/actions/get-order-shipments/get-order-shipments.mjs
  • components/paazl/actions/get-order-labels/get-order-labels.mjs
  • components/paazl/actions/create-shipment/create-shipment.mjs
  • components/paazl/actions/save-order/save-order.mjs
  • components/paazl/actions/save-checkout-session/save-checkout-session.mjs
  • components/paazl/actions/modify-order/modify-order.mjs
🧰 Additional context used
🧬 Code graph analysis (2)
components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1)
components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1)
  • response (171-222)
components/paazl/actions/get-checkout-session/get-checkout-session.mjs (5)
components/paazl/actions/create-checkout-token/create-checkout-token.mjs (1)
  • response (25-30)
components/paazl/actions/delete-order/delete-order.mjs (1)
  • response (25-28)
components/paazl/actions/get-order-labels/get-order-labels.mjs (1)
  • response (40-51)
components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1)
  • response (54-67)
components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1)
  • response (47-59)
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
🔇 Additional comments (1)
components/paazl/actions/get-checkout-session/get-checkout-session.mjs (1)

19-34: LGTM! Clean implementation.

The action correctly retrieves checkout session data using the provided reference. The implementation is straightforward and follows the expected pattern.

luancazarine
luancazarine previously approved these changes Sep 3, 2025
Copy link
Collaborator

@luancazarine luancazarine left a comment

Choose a reason for hiding this comment

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

Hi @jcortes, LGTM! Ready for QA!

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: 6

♻️ Duplicate comments (2)
components/paazl/actions/get-shipping-options/get-shipping-options.mjs (2)

164-166: Verify client targets /v1/shippingoptions

Confirm paazl.app.mjs uses the v1 path (or base URL includes /v1) for getShippingOptions to avoid 404s.

#!/bin/bash
# Check Paazl client method and endpoint path
set -euo pipefail
fd -a 'paazl.app.mjs' | while read -r f; do
  echo "==> $f"
  rg -nP -C2 '\bgetShippingOptions\s*\(' "$f" || true
  rg -nP -C2 'path:\s*["'\'']/v1/shippingoptions["'\'']' "$f" || true
  rg -nP -C2 'baseUrl\s*:.*?/v1\b' "$f" || true
done

200-221: Bug: 0 values dropped and startMatrix=false can’t be sent

Truthiness drops 0 for totals and prevents sending startMatrix: false. Also numberOfGoods isn’t coerced.

-        ...(totalWeight
-          || totalPrice
-          || totalVolume
-          || numberOfGoods
-          || startMatrix
+        ...((totalWeight !== undefined && totalWeight !== null && totalWeight !== "")
+          || (totalPrice !== undefined && totalPrice !== null && totalPrice !== "")
+          || (totalVolume !== undefined && totalVolume !== null && totalVolume !== "")
+          || (numberOfGoods !== undefined && numberOfGoods !== null && numberOfGoods !== "")
+          || (startMatrix !== undefined)
           ? {
             shipmentParameters: {
-              totalWeight: totalWeight
-                ? parseFloat(totalWeight)
-                : undefined,
-              totalPrice: totalPrice
-                ? parseFloat(totalPrice)
-                : undefined,
-              totalVolume: totalVolume
-                ? parseFloat(totalVolume)
-                : undefined,
-              numberOfGoods,
-              startMatrix: startMatrix,
+              totalWeight: (totalWeight === undefined || totalWeight === null || totalWeight === "")
+                ? undefined
+                : Number(totalWeight),
+              totalPrice: (totalPrice === undefined || totalPrice === null || totalPrice === "")
+                ? undefined
+                : Number(totalPrice),
+              totalVolume: (totalVolume === undefined || totalVolume === null || totalVolume === "")
+                ? undefined
+                : Number(totalVolume),
+              numberOfGoods: (numberOfGoods === undefined || numberOfGoods === null || numberOfGoods === "")
+                ? undefined
+                : parseInt(numberOfGoods, 10),
+              ...(startMatrix !== undefined ? { startMatrix } : {}),
             },
           }
           : {}
         ),
🧹 Nitpick comments (5)
components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (1)

24-39: Alias app prop and add error context + return payload only

Prevents shadowing the imported app, adds actionable error context, and (optionally) returns the data payload instead of the raw response if the app client uses Axios-style responses.

   async run({ $ }) {
-    const {
-      app,
-      orderReference,
-      shipmentId,
-    } = this;
-
-    const response = await app.getShipmentById({
-      $,
-      orderReference,
-      shipmentId,
-    });
-
-    $.export("$summary", `Successfully retrieved tracking details for shipment: ${shipmentId} in order: ${orderReference}`);
-    return response;
+    const { app: paazl, orderReference, shipmentId } = this;
+    try {
+      const response = await paazl.getShipmentById({
+        $,
+        orderReference,
+        shipmentId,
+      });
+      $.export("$summary", "Successfully retrieved shipment tracking details.");
+      // If paazl.getShipmentById returns an Axios response, prefer `response.data`.
+      return response?.data ?? response;
+    } catch (err) {
+      err.message = `[Paazl] Failed to retrieve tracking for shipmentId=${shipmentId}, orderReference=${orderReference}: ${err.message}`;
+      throw err;
+    }
   },
components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1)

225-226: Minor: use local var in summary and safer count

Avoid this.* in favor of local destructured value; guard array shape.

-    $.export("$summary", `Successfully retrieved ${response.shippingOptions?.length || 0} shipping options for country: ${this.consigneeCountryCode}`);
+    $.export("$summary", `Retrieved ${Array.isArray(response?.shippingOptions) ? response.shippingOptions.length : 0} shipping options for country: ${consigneeCountryCode}`);
components/paazl/actions/create-shipment/create-shipment.mjs (3)

165-181: Normalize currency codes to uppercase

Ensures ISO 4217 format regardless of user input casing.

-                    codValue: {
-                      value: parseFloat(parcelCodValue),
-                      currency: parcelCodCurrency || "EUR",
-                    },
+                    codValue: {
+                      value: parseFloat(parcelCodValue),
+                      currency: (parcelCodCurrency || "EUR").toUpperCase(),
+                    },
                   }
                 : {}
               ),
               ...(parcelInsuredValue
                 ? {
                   insuredValue: {
-                    value: parseFloat(parcelInsuredValue),
-                    currency: parcelInsuredCurrency || "EUR",
+                    value: parseFloat(parcelInsuredValue),
+                    currency: (parcelInsuredCurrency || "EUR").toUpperCase(),
                   },
                 },

35-107: Consider supporting multiple parcels

Current UI props allow only a single parcel. The API supports multiple parcels; exposing an array input (JSON items or a dynamic fields array) would unlock multi-parcel shipments. Keep the single-parcel fields for convenience and prefer parcels when provided.

I can draft a parcels array prop and merge logic to use it when present.


191-193: Enrich summary with shipment identifier when available

Improves UX in runs list.

-    $.export("$summary", `Successfully created shipment for order: ${orderReference}`);
+    const shipmentId = response?.id ?? response?.shipmentId ?? response?.shipments?.[0]?.id;
+    $.export("$summary", `Successfully created shipment${shipmentId ? ` (${shipmentId})` : ""} for order: ${orderReference}`);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 03e4c4d and df1102d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • components/paazl/actions/create-checkout-token/create-checkout-token.mjs (1 hunks)
  • components/paazl/actions/create-shipment/create-shipment.mjs (1 hunks)
  • components/paazl/actions/delete-order/delete-order.mjs (1 hunks)
  • components/paazl/actions/get-checkout-session/get-checkout-session.mjs (1 hunks)
  • components/paazl/actions/get-order-labels/get-order-labels.mjs (1 hunks)
  • components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1 hunks)
  • components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1 hunks)
  • components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1 hunks)
  • components/paazl/actions/get-return-shipments/get-return-shipments.mjs (1 hunks)
  • components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1 hunks)
  • components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (1 hunks)
  • components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1 hunks)
  • components/paazl/actions/modify-order/modify-order.mjs (1 hunks)
  • components/paazl/actions/save-checkout-session/save-checkout-session.mjs (1 hunks)
  • components/paazl/actions/save-order/save-order.mjs (1 hunks)
  • components/paazl/paazl.app.mjs (1 hunks)
  • components/paazl/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (14)
  • components/paazl/actions/get-return-shipments/get-return-shipments.mjs
  • components/paazl/actions/get-parcel-label/get-parcel-label.mjs
  • components/paazl/actions/delete-order/delete-order.mjs
  • components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs
  • components/paazl/paazl.app.mjs
  • components/paazl/actions/create-checkout-token/create-checkout-token.mjs
  • components/paazl/actions/save-order/save-order.mjs
  • components/paazl/actions/get-order-shipments/get-order-shipments.mjs
  • components/paazl/actions/get-order-labels/get-order-labels.mjs
  • components/paazl/actions/modify-order/modify-order.mjs
  • components/paazl/actions/get-checkout-session/get-checkout-session.mjs
  • components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs
  • components/paazl/package.json
  • components/paazl/actions/save-checkout-session/save-checkout-session.mjs
🧰 Additional context used
🧬 Code graph analysis (3)
components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (3)
components/paazl/actions/get-order-shipments/get-order-shipments.mjs (1)
  • response (24-27)
components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1)
  • response (54-67)
components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1)
  • response (47-59)
components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1)
components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1)
  • response (171-222)
components/paazl/actions/create-shipment/create-shipment.mjs (7)
components/paazl/actions/get-order-labels/get-order-labels.mjs (1)
  • response (40-51)
components/paazl/actions/get-parcel-label/get-parcel-label.mjs (1)
  • response (54-67)
components/paazl/actions/get-pickup-location-options/get-pickup-location-options.mjs (1)
  • response (171-222)
components/paazl/actions/get-shipment-labels/get-shipment-labels.mjs (1)
  • response (47-59)
components/paazl/actions/get-shipping-options/get-shipping-options.mjs (1)
  • response (164-223)
components/paazl/actions/modify-order/modify-order.mjs (1)
  • response (208-254)
components/paazl/actions/save-order/save-order.mjs (1)
  • response (208-254)
⏰ 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: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (4)
components/paazl/actions/get-shipment-tracking/get-shipment-tracking.mjs (2)

9-23: Props look consistent with app propDefinitions

Using propDefinition: [app, "orderReference" | "shipmentId"] matches the pattern used elsewhere in this PR. No issues.


7-7: No version bump needed—versions are consistent
All Paazl actions under components/paazl/actions use version: "0.0.1", including this file, so no change required.

components/paazl/actions/create-shipment/create-shipment.mjs (2)

1-9: Module scaffold looks good

Import, key/name/description/version/type all align with Pipedream patterns.


129-189: Verify placement of type, size, and quantity in createShipment call
They’re currently passed under data, but if the Paazl API requires these as URL query parameters, move them into a params object in the createShipment invocation.

@jcortes jcortes force-pushed the paazl-new-components branch 2 times, most recently from 74d9307 to d629389 Compare September 10, 2025 21:13
@jcortes jcortes force-pushed the paazl-new-components branch from d629389 to 82bd0df Compare September 16, 2025 21:35
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.

Paazl
2 participants