Skip to content

Stripe(new) #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 14, 2025
Merged

Stripe(new) #583

merged 22 commits into from
Jul 14, 2025

Conversation

sayam-nasir
Copy link
Contributor

@sayam-nasir sayam-nasir commented Jun 19, 2025

Summary by CodeRabbit

  • New Features
    • Introduced Stripe integration with comprehensive support for managing payments, customers, refunds, invoices, and payment methods.
    • Added components for creating, updating, retrieving, and deleting Stripe customers.
    • Enabled creation, confirmation, capture, and cancellation of payment intents.
    • Added invoice management, including creating, retrieving, finalizing, and searching invoices.
    • Implemented refund creation and retrieval, as well as searching for refunds and charges.
    • Provided components for finding payment methods and payment intents.
    • Included a flexible component for making arbitrary Stripe API calls.
    • Added authentication setup, quota management, and service metadata for Stripe integration.
    • Enhanced user interface with detailed input/output schemas and embedded icons for all components.

Copy link
Contributor

coderabbitai bot commented Jun 19, 2025

Walkthrough

This change introduces a comprehensive Stripe integration for the Appmixer platform. It adds authentication, rate limiting, and a suite of components and modules for managing Stripe entities such as customers, payment intents, refunds, invoices, and payment methods. Each operation is encapsulated as a component with corresponding implementation logic and configuration.

Changes

Files/Paths Change Summary
src/appmixer/stripe/auth.js
src/appmixer/stripe/quota.js
New modules for Stripe API key authentication and rate limiting configuration.
src/appmixer/stripe/bundle.json
src/appmixer/stripe/service.json
New JSON descriptors for Stripe bundle and service metadata, including embedded icons.
src/appmixer/stripe/lib.generated.js New utility module for formatting and exporting data in various output types (array, object, CSV file, etc.).
src/appmixer/stripe/core/CancelPaymentIntent/CancelPaymentIntent.js
.../component.json
New component and implementation for canceling Stripe Payment Intents.
src/appmixer/stripe/core/CapturePaymentIntent/CapturePaymentIntent.js
.../component.json
New component and implementation for capturing Stripe Payment Intents.
src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js
.../component.json
New component and implementation for confirming Stripe Payment Intents.
src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js
.../component.json
New component and implementation for creating Stripe Customers.
src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js
.../component.json
New component and implementation for creating Stripe Invoices.
src/appmixer/stripe/core/CreatePaymentIntent/CreatePaymentIntent.js
.../component.json
New component and implementation for creating Stripe Payment Intents.
src/appmixer/stripe/core/CreateRefund/CreateRefund.js
.../component.json
New component and implementation for creating Stripe Refunds.
src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js
.../component.json
New component and implementation for deleting Stripe Customers.
src/appmixer/stripe/core/FinalizeDraftInvoice/FinalizeDraftInvoice.js
.../component.json
New component and implementation for finalizing draft Stripe Invoices.
src/appmixer/stripe/core/FindCharges/FindCharges.js
.../component.json
New component and implementation for retrieving Stripe Charges with output formatting options.
src/appmixer/stripe/core/FindCustomers/FindCustomers.js
.../component.json
New component and implementation for searching Stripe Customers with query and output type options.
src/appmixer/stripe/core/FindInvoices/FindInvoices.js
.../component.json
New component and implementation for searching Stripe Invoices with query and output type options.
src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
.../component.json
New component and implementation for searching Stripe Payment Intents with query and output type options.
src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js
.../component.json
New component and implementation for retrieving Stripe Payment Methods with output formatting options.
src/appmixer/stripe/core/FindRefunds/FindRefunds.js
.../component.json
New component and implementation for retrieving Stripe Refunds with output formatting options.
src/appmixer/stripe/core/MakeAPICall/MakeAPICall.js
.../component.json
New component and implementation for making arbitrary API calls to Stripe endpoints.
src/appmixer/stripe/core/RetrieveCustomer/RetrieveCustomer.js
.../component.json
New component and implementation for retrieving details of a Stripe Customer.
src/appmixer/stripe/core/RetrieveInvoice/RetrieveInvoice.js
.../component.json
New component and implementation for retrieving details of a Stripe Invoice.
src/appmixer/stripe/core/RetrievePaymentIntent/RetrievePaymentIntent.js
.../component.json
New component and implementation for retrieving details of a Stripe Payment Intent.
src/appmixer/stripe/core/RetrieveRefund/RetrieveRefund.js
.../component.json
New component and implementation for retrieving details of a Stripe Refund.
src/appmixer/stripe/core/UpdateCustomer/UpdateCustomer.js
.../component.json
New component and implementation for updating Stripe Customer properties.

Suggested reviewers

  • vtalas

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-08T14_53_04_420Z-debug-0.log


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🧹 Nitpick comments (35)
src/appmixer/stripe/lib.generated.js (1)

24-26: Remove duplicate comment.

There's a redundant "One by one." comment on line 25.

         } else if (outputType === 'object') {
             // One by one.
-            // One by one.
             for (let index = 0; index < records.length; index++) {
src/appmixer/stripe/core/CancelPaymentIntent/CancelPaymentIntent.js (1)

6-6: Consider input validation for payment_intent_id.

The code directly uses the payment_intent_id without validation. While Stripe API will handle invalid IDs, early validation could provide better error messages.

         const id = context.messages.in.content.payment_intent_id;
+        
+        if (!id) {
+            throw new context.CancelError('payment_intent_id is required');
+        }
src/appmixer/stripe/core/FinalizeDraftInvoice/FinalizeDraftInvoice.js (1)

6-6: Consider input validation for invoiceId.

Similar to the payment intent component, adding validation could improve error handling.

         const { invoiceId } = context.messages.in.content;
+        
+        if (!invoiceId) {
+            throw new context.CancelError('invoiceId is required');
+        }
src/appmixer/stripe/core/RetrieveCustomer/RetrieveCustomer.js (1)

1-3: Minor formatting improvement: Remove empty line at start.

Consider removing the empty line at the beginning of the file for consistency.

-
-'use strict';
+'use strict';

Note: The "use strict" directive is correctly included per the coding guidelines for Appmixer files, despite the static analysis hint suggesting otherwise.

src/appmixer/stripe/core/CreatePaymentIntent/CreatePaymentIntent.js (1)

16-23: Consider using ES6 shorthand property notation for cleaner code.

The data object can be simplified using shorthand property notation where the property names match the variable names.

             data: {
-                amount: amount,
-                currency: currency,
-                payment_method: paymentMethod,
-                description: description,
-                customer: customer
+                amount,
+                currency,
+                payment_method: paymentMethod,
+                description,
+                customer
             }
src/appmixer/stripe/core/RetrievePaymentIntent/RetrievePaymentIntent.js (1)

1-3: Minor formatting improvement: Remove empty line at start.

Consider removing the empty line at the beginning of the file for consistency.

-
-'use strict';
+'use strict';

Note: The "use strict" directive is correctly included per the coding guidelines for Appmixer files.

src/appmixer/stripe/core/RetrieveInvoice/RetrieveInvoice.js (1)

1-3: Minor formatting improvement: Remove empty line at start.

Consider removing the empty line at the beginning of the file for consistency.

-
-'use strict';
+'use strict';

Note: The "use strict" directive is correctly included per the coding guidelines for Appmixer files.

src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js (1)

4-4: Remove unused import.

The lib module is imported but never used in this file.

-const lib = require('../../lib.generated');
src/appmixer/stripe/core/CreateRefund/CreateRefund.js (1)

4-4: Remove unused import.

The lib module is imported but never used in this file.

-const lib = require('../../lib.generated');
src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js (3)

3-3: Remove unused import.

The lib module is imported but never used in this file.

-const lib = require('../../lib.generated');

29-42: Consider filtering out undefined values in address object.

While the conditional creation of the address object is good, it may still include undefined values for individual address fields, which could be sent to the Stripe API unnecessarily.

Consider filtering out undefined values:

  if (
    address_line1 || address_line2 || address_city ||
    address_state || address_postal_code || address_country
  ) {
-   address = {
-     line1: address_line1,
-     line2: address_line2,
-     city: address_city,
-     state: address_state,
-     postal_code: address_postal_code,
-     country: address_country
-   };
+   address = {};
+   if (address_line1) address.line1 = address_line1;
+   if (address_line2) address.line2 = address_line2;
+   if (address_city) address.city = address_city;
+   if (address_state) address.state = address_state;
+   if (address_postal_code) address.postal_code = address_postal_code;
+   if (address_country) address.country = address_country;
  }

44-63: Consider filtering out undefined values in shipping object.

Similar to the address object, the shipping object may include undefined values for individual fields.

Consider filtering out undefined values:

  if (
    shipping_name || shipping_phone ||
    shipping_address_line1 || shipping_address_line2 ||
    shipping_address_city || shipping_address_state ||
    shipping_address_postal_code || shipping_address_country
  ) {
-   shipping = {
-     name: shipping_name,
-     phone: shipping_phone,
-     address: {
-       line1: shipping_address_line1,
-       line2: shipping_address_line2,
-       city: shipping_address_city,
-       state: shipping_address_state,
-       postal_code: shipping_address_postal_code,
-       country: shipping_address_country
-     }
-   };
+   shipping = {};
+   if (shipping_name) shipping.name = shipping_name;
+   if (shipping_phone) shipping.phone = shipping_phone;
+   
+   const shippingAddress = {};
+   if (shipping_address_line1) shippingAddress.line1 = shipping_address_line1;
+   if (shipping_address_line2) shippingAddress.line2 = shipping_address_line2;
+   if (shipping_address_city) shippingAddress.city = shipping_address_city;
+   if (shipping_address_state) shippingAddress.state = shipping_address_state;
+   if (shipping_address_postal_code) shippingAddress.postal_code = shipping_address_postal_code;
+   if (shipping_address_country) shippingAddress.country = shipping_address_country;
+   
+   if (Object.keys(shippingAddress).length > 0) {
+     shipping.address = shippingAddress;
+   }
  }
src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js (1)

4-4: Remove unused import.

The lib module is imported but never used in this file.

-const lib = require('../../lib.generated');
src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js (1)

18-19: Fix indentation for consistency.

The authorization and content-type headers have inconsistent indentation compared to the rest of the codebase.

Apply this diff to fix the indentation:

             headers: {
-            'Authorization': `Bearer ${context.auth.apiKey}`,
-            'Content-Type': 'application/x-www-form-urlencoded'
+                'Authorization': `Bearer ${context.auth.apiKey}`,
+                'Content-Type': 'application/x-www-form-urlencoded'
             },
src/appmixer/stripe/auth.js (1)

32-36: Improve code quality with optional chaining.

The conditional checks can be simplified using optional chaining for better readability and safety.

-            if (data && data.fullName) {
+            if (data?.fullName) {
                 return { name: data.fullName };
-            } else if (data && data.email) {
+            } else if (data?.email) {
                 return { name: data.email };
             }
src/appmixer/stripe/core/FindRefunds/FindRefunds.js (1)

2-2: Remove redundant 'use strict' directive.

ES6 modules are automatically in strict mode, making this directive unnecessary.

-'use strict';
src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js (1)

2-2: Remove redundant 'use strict' directive.

ES6 modules are automatically in strict mode, making this directive unnecessary.

-'use strict';
src/appmixer/stripe/core/ConfirmPaymentIntent/component.json (2)

20-26: Inconsistent naming style in input schema keys
This component uses snake_case for input properties (payment_intent_id, payment_method), whereas other Stripe components in this PR adopt camelCase. Standardize on one naming convention across all components for consistency.


77-78: Extract large base64 icon to external asset
Embedding the entire base64-encoded image inflates the JSON and hampers readability. Move the icon to a separate file (e.g., ConfirmPaymentIntent.jpg/.svg) and reference its path instead.

src/appmixer/stripe/core/FindPaymentMethods/component.json (1)

20-28: Align naming style with other components
Inputs use camelCase (customerId, outputType), while some other components use snake_case. Decide on one convention for all Stripe core components and update accordingly.

src/appmixer/stripe/core/CreatePaymentIntent/component.json (2)

26-34: Align naming style for paymentMethod property
This schema uses camelCase (paymentMethod), but ConfirmPaymentIntent uses snake_case for similar fields. Unify naming across all payment‐intent components.


116-116: Extract base64 icon to external file
The embedded JPEG base64 is extremely long. Place the icon in a separate asset file and reference its URL or path here.

src/appmixer/stripe/core/FindRefunds/component.json (2)

23-25: Inconsistent property naming
The schema mixes paymentIntent (camelCase) alongside snake_case fields elsewhere. Standardize property names across all retrieval components.


90-90: Move large icon to external asset
Replace the inline base64 blob with a reference to an external icon file to reduce JSON size and improve maintainability.

src/appmixer/stripe/core/CreateCustomer/component.json (2)

26-28: Inconsistent naming for payment method field
This component uses payment_method (snake_case) while other components use camelCase for similar fields. Harmonize naming conventions across the Stripe modules.


230-231: Extract embedded icon to external file
This JSON includes a very large base64 icon. Offload it to a separate asset and reference its path here for better readability and repo upkeep.

src/appmixer/stripe/core/RetrieveRefund/component.json (2)

93-127: Consider adding a title for the parent destination_details object
Nested schemas for "destination_details" include titles at the card and type levels but omit one at the parent. Adding a "title": "Destination Details" may improve UI clarity.


181-182: Extract inlined icon to reduce file size
The base64‐encoded JPEG inflates this JSON. Consider referencing an external asset or a shared icon file.

src/appmixer/stripe/core/RetrievePaymentIntent/component.json (1)

128-136: Schema for nested objects may need titles
For consistency, consider adding "title" to the top-level amount_details and automatic_payment_methods objects.

src/appmixer/stripe/core/CreateRefund/component.json (1)

14-31: Input schema covers required fields
charge and amount are required; reason is optional. Consider adding an enum constraint for reason.

src/appmixer/stripe/core/SearchPaymentIntent/component.json (1)

31-64: Inspector index misalignment.
Change index: 2 for outputType to index: 1 to reflect its position.

                     "outputType": {
-                        "type": "select",
-                        "label": "Output Type",
-                        "index": 2,
+                        "type": "select",
+                        "label": "Output Type",
+                        "index": 1,
                         "defaultValue": "array",
                         "tooltip": "…",
                         "options": [ … ]
                     }
src/appmixer/stripe/core/RetrieveCustomer/component.json (3)

154-159: Enhance dynamic metadata schema.

metadata may contain arbitrary key/value pairs. Replace empty properties with:

"properties": {},
"additionalProperties": true

to allow dynamic metadata entries.


32-35: Standardize label casing for Customer ID.

Use "label": "Customer ID" (uppercase “ID”) for consistency with other components and common conventions.


206-206: Extract large icon data.

Embedding a huge base64 reduces readability. Consider moving the icon to a separate asset (e.g., icon.jpg) and referencing it via an iconPath field.

src/appmixer/stripe/core/RetrieveInvoice/component.json (1)

542-542: Externalize inline icon.

This component’s icon is a huge Base64 blob. Extract it to a separate image file (e.g., RetrieveInvoice.jpg) and reference via iconPath.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87661e9 and 34ea8bb.

📒 Files selected for processing (47)
  • src/appmixer/stripe/auth.js (1 hunks)
  • src/appmixer/stripe/bundle.json (1 hunks)
  • src/appmixer/stripe/core/CancelPaymentIntent/CancelPaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/CancelPaymentIntent/component.json (1 hunks)
  • src/appmixer/stripe/core/CapturePaymentIntent/CapturePaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/CapturePaymentIntent/component.json (1 hunks)
  • src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/ConfirmPaymentIntent/component.json (1 hunks)
  • src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js (1 hunks)
  • src/appmixer/stripe/core/CreateCustomer/component.json (1 hunks)
  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js (1 hunks)
  • src/appmixer/stripe/core/CreateInvoice/component.json (1 hunks)
  • src/appmixer/stripe/core/CreatePaymentIntent/CreatePaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/CreatePaymentIntent/component.json (1 hunks)
  • src/appmixer/stripe/core/CreateRefund/CreateRefund.js (1 hunks)
  • src/appmixer/stripe/core/CreateRefund/component.json (1 hunks)
  • src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js (1 hunks)
  • src/appmixer/stripe/core/DeleteCustomer/component.json (1 hunks)
  • src/appmixer/stripe/core/FinalizeDraftInvoice/FinalizeDraftInvoice.js (1 hunks)
  • src/appmixer/stripe/core/FinalizeDraftInvoice/component.json (1 hunks)
  • src/appmixer/stripe/core/FindCharges/FindCharges.js (1 hunks)
  • src/appmixer/stripe/core/FindCharges/component.json (1 hunks)
  • src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js (1 hunks)
  • src/appmixer/stripe/core/FindPaymentMethods/component.json (1 hunks)
  • src/appmixer/stripe/core/FindRefunds/FindRefunds.js (1 hunks)
  • src/appmixer/stripe/core/FindRefunds/component.json (1 hunks)
  • src/appmixer/stripe/core/MakeAPICall/MakeAPICall.js (1 hunks)
  • src/appmixer/stripe/core/MakeAPICall/component.json (1 hunks)
  • src/appmixer/stripe/core/RetrieveCustomer/RetrieveCustomer.js (1 hunks)
  • src/appmixer/stripe/core/RetrieveCustomer/component.json (1 hunks)
  • src/appmixer/stripe/core/RetrieveInvoice/RetrieveInvoice.js (1 hunks)
  • src/appmixer/stripe/core/RetrieveInvoice/component.json (1 hunks)
  • src/appmixer/stripe/core/RetrievePaymentIntent/RetrievePaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/RetrievePaymentIntent/component.json (1 hunks)
  • src/appmixer/stripe/core/RetrieveRefund/RetrieveRefund.js (1 hunks)
  • src/appmixer/stripe/core/RetrieveRefund/component.json (1 hunks)
  • src/appmixer/stripe/core/SearchCustomers/SearchCustomers.js (1 hunks)
  • src/appmixer/stripe/core/SearchCustomers/component.json (1 hunks)
  • src/appmixer/stripe/core/SearchInvoices/SearchInvoices.js (1 hunks)
  • src/appmixer/stripe/core/SearchInvoices/component.json (1 hunks)
  • src/appmixer/stripe/core/SearchPaymentIntent/SearchPaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/SearchPaymentIntent/component.json (1 hunks)
  • src/appmixer/stripe/core/UpdateCustomer/UpdateCustomer.js (1 hunks)
  • src/appmixer/stripe/core/UpdateCustomer/component.json (1 hunks)
  • src/appmixer/stripe/lib.generated.js (1 hunks)
  • src/appmixer/stripe/quota.js (1 hunks)
  • src/appmixer/stripe/service.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*/bundle.json`: Make sure `version` also matches the last entry in `changelog`

**/*/bundle.json: Make sure version also matches the last entry in changelog

  • src/appmixer/stripe/bundle.json
`src/appmixer/**/*.js`: Not necessary to add try/catch blocks in their `receive` function. Appmixer engine automatically handles any exceptions that originate in these async functi...

src/appmixer/**/*.js: Not necessary to add try/catch blocks in their receive function. Appmixer engine automatically handles any exceptions that originate in these async functions.

The directive "use strict"; is desirable here

  • src/appmixer/stripe/core/RetrieveCustomer/RetrieveCustomer.js
  • src/appmixer/stripe/core/RetrieveInvoice/RetrieveInvoice.js
  • src/appmixer/stripe/quota.js
  • src/appmixer/stripe/core/FinalizeDraftInvoice/FinalizeDraftInvoice.js
  • src/appmixer/stripe/core/RetrievePaymentIntent/RetrievePaymentIntent.js
  • src/appmixer/stripe/core/RetrieveRefund/RetrieveRefund.js
  • src/appmixer/stripe/core/CreatePaymentIntent/CreatePaymentIntent.js
  • src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js
  • src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js
  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js
  • src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js
  • src/appmixer/stripe/core/CreateRefund/CreateRefund.js
  • src/appmixer/stripe/core/UpdateCustomer/UpdateCustomer.js
  • src/appmixer/stripe/core/CancelPaymentIntent/CancelPaymentIntent.js
  • src/appmixer/stripe/core/CapturePaymentIntent/CapturePaymentIntent.js
  • src/appmixer/stripe/core/MakeAPICall/MakeAPICall.js
  • src/appmixer/stripe/core/FindCharges/FindCharges.js
  • src/appmixer/stripe/core/SearchPaymentIntent/SearchPaymentIntent.js
  • src/appmixer/stripe/core/SearchCustomers/SearchCustomers.js
  • src/appmixer/stripe/core/SearchInvoices/SearchInvoices.js
  • src/appmixer/stripe/auth.js
  • src/appmixer/stripe/core/FindRefunds/FindRefunds.js
  • src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js
  • src/appmixer/stripe/lib.generated.js
🪛 Biome (1.9.4)
src/appmixer/stripe/core/RetrieveCustomer/RetrieveCustomer.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/RetrieveInvoice/RetrieveInvoice.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/quota.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/FinalizeDraftInvoice/FinalizeDraftInvoice.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/RetrievePaymentIntent/RetrievePaymentIntent.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/RetrieveRefund/RetrieveRefund.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CreatePaymentIntent/CreatePaymentIntent.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CreateRefund/CreateRefund.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/UpdateCustomer/UpdateCustomer.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CancelPaymentIntent/CancelPaymentIntent.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CapturePaymentIntent/CapturePaymentIntent.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/MakeAPICall/MakeAPICall.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/FindCharges/FindCharges.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/SearchPaymentIntent/SearchPaymentIntent.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/SearchCustomers/SearchCustomers.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/SearchInvoices/SearchInvoices.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/auth.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


[error] 32-32: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 34-34: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/appmixer/stripe/core/FindRefunds/FindRefunds.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

🪛 GitHub Check: build
src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js

[failure] 10-10:
Identifier 'payment_method' is not in camel case


[failure] 10-10:
Expected indentation of 12 spaces but found 6


[failure] 9-9:
Expected indentation of 12 spaces but found 6


[failure] 8-8:
Expected indentation of 12 spaces but found 6


[failure] 7-7:
Expected indentation of 8 spaces but found 4


[failure] 6-6:
Expected indentation of 4 spaces but found 2


[failure] 3-3:
'lib' is assigned a value but never used

src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js

[failure] 19-19:
Expected indentation of 16 spaces but found 12


[failure] 18-18:
Expected indentation of 16 spaces but found 12

src/appmixer/stripe/auth.js

[failure] 47-47:
Newline required at end of file but not found

🪛 GitHub Actions: Node.js CI
src/appmixer/stripe/auth.js

[error] 47-47: ESLint: Newline required at end of file but not found (eol-last)

🔇 Additional comments (69)
src/appmixer/stripe/quota.js (2)

1-1: "use strict" directive is correct per coding guidelines.

The static analysis tool flagged this as redundant, but the coding guidelines explicitly state that "use strict" is desirable for src/appmixer/**/*.js files. Keep the directive as it aligns with project standards.


5-12: Rate limiting configuration looks appropriate.

The 5 requests per second limit with FIFO queueing is reasonable for Stripe API usage and aligns with typical rate limiting best practices.

src/appmixer/stripe/lib.generated.js (2)

14-22: Good error handling for empty records.

The check for empty records when outputType is 'first' prevents runtime errors and provides clear feedback.


52-54: Excellent use of optional chaining for safe property access.

The getProperty function uses optional chaining correctly to prevent errors when accessing nested properties.

src/appmixer/stripe/bundle.json (1)

1-9: Bundle configuration is correct.

The version "1.0.0" properly matches the last entry in the changelog, satisfying the coding guidelines requirement.

src/appmixer/stripe/core/CancelPaymentIntent/CancelPaymentIntent.js (2)

1-1: "use strict" directive is correct per coding guidelines.

As with other files, the static analysis tool flagged this as redundant, but the coding guidelines explicitly state that "use strict" is desirable for src/appmixer/**/*.js files.


9-16: HTTP request implementation looks correct.

The API call follows Stripe's documentation correctly with proper authentication headers and endpoint.

src/appmixer/stripe/core/FinalizeDraftInvoice/FinalizeDraftInvoice.js (3)

1-1: "use strict" directive is correct per coding guidelines.

Consistent with project standards for src/appmixer/**/*.js files.


6-6: Good use of destructuring for parameter extraction.

The destructuring approach for extracting invoiceId is clean and readable.


9-16: API request implementation is correct.

The HTTP request follows Stripe's API documentation correctly for finalizing invoices.

src/appmixer/stripe/core/RetrieveCustomer/RetrieveCustomer.js (1)

4-21: LGTM! Proper Stripe API integration implementation.

The module correctly implements the customer retrieval functionality with proper authentication, HTTP method, and response handling.

src/appmixer/stripe/core/CreatePaymentIntent/CreatePaymentIntent.js (1)

1-27: LGTM! Solid payment intent creation implementation.

The module correctly implements payment intent creation with proper HTTP method, authentication, data serialization, and response handling.

src/appmixer/stripe/core/RetrievePaymentIntent/RetrievePaymentIntent.js (1)

4-21: LGTM! Proper payment intent retrieval implementation.

The module correctly implements the payment intent retrieval functionality with appropriate API endpoint, authentication, and response handling.

src/appmixer/stripe/core/RetrieveInvoice/RetrieveInvoice.js (1)

4-21: LGTM! Proper invoice retrieval implementation.

The module correctly implements the invoice retrieval functionality with appropriate Stripe API endpoint, authentication, and response handling.

src/appmixer/stripe/core/RetrieveRefund/RetrieveRefund.js (1)

1-20: LGTM! Excellent refund retrieval implementation.

The module correctly implements the refund retrieval functionality with proper formatting, appropriate Stripe API endpoint, authentication, and response handling. This file serves as a good example with clean formatting.

src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js (1)

8-21: LGTM! Clean Stripe customer deletion implementation.

The logic correctly extracts the customer ID, makes an authenticated DELETE request to the Stripe API, and returns the response data. The implementation follows Stripe's API documentation and matches the established patterns in this integration.

src/appmixer/stripe/core/CreateRefund/CreateRefund.js (1)

8-27: LGTM! Robust refund creation implementation.

The implementation correctly handles optional parameters by conditionally including them in the form data only when they have valid values. The thorough validation for amount (checking both undefined and empty string) is particularly good practice. The Stripe API call follows proper authentication patterns.

src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js (1)

65-84: LGTM! Well-structured customer creation logic.

The core implementation correctly handles the complex customer creation scenario with conditional address and shipping information. The spread operator usage for conditionally including address and shipping objects is clean and effective.

src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js (1)

8-28: LGTM! Proper invoice creation with field validation.

The implementation correctly handles optional invoice parameters with thorough validation (checking both undefined and empty string). The transformation from camelCase JavaScript variables to snake_case Stripe API fields (collectionMethodcollection_method, autoAdvanceauto_advance) is appropriate for API compatibility.

src/appmixer/stripe/core/MakeAPICall/MakeAPICall.js (1)

7-23: LGTM! Flexible API call implementation with security consideration.

The generic API call functionality is well-implemented and provides good flexibility. The customEndpoint parameter is directly interpolated into the URL, which is acceptable within the authenticated Appmixer context, but ensure that upstream validation prevents any potential path traversal or injection attacks.

Consider verifying that the component definition properly validates the customEndpoint parameter to prevent potential security issues.

src/appmixer/stripe/service.json (1)

1-8: Well-structured service configuration.

The JSON service descriptor is properly formatted and contains all necessary metadata fields for the Stripe integration. The service definition includes appropriate categorization and version information.

src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js (2)

1-1: Keep the "use strict" directive as per coding guidelines.

The static analysis tool suggests removing "use strict", but the coding guidelines explicitly state that this directive is desirable for src/appmixer/**/*.js files. The guidelines take precedence over the static analysis suggestion.


4-26: Solid implementation of payment intent confirmation.

The function correctly handles the required payment_intent_id and optional payment_method parameters, constructs the request payload appropriately, and makes the authenticated API call to Stripe. The response handling is clean and follows the expected pattern.

src/appmixer/stripe/core/CapturePaymentIntent/CapturePaymentIntent.js (3)

1-1: Keep the "use strict" directive as per coding guidelines.

The static analysis tool suggests removing "use strict", but the coding guidelines explicitly state that this directive is desirable for src/appmixer/**/*.js files.


11-13: Appropriate conditional logic for optional amount parameter.

The condition correctly checks for both empty string and undefined values before including the amount_to_capture parameter, which aligns with Stripe's API expectations where this field is optional.


4-27: Well-implemented payment intent capture functionality.

The function properly extracts the required payment intent ID and optional amount, constructs the request data conditionally, and makes the authenticated API call to Stripe's capture endpoint. The implementation follows established patterns and handles the API response appropriately.

src/appmixer/stripe/core/SearchInvoices/SearchInvoices.js (5)

1-1: Keep the "use strict" directive as per coding guidelines.

The static analysis tool suggests removing "use strict", but the coding guidelines explicitly state that this directive is desirable for src/appmixer/**/*.js files.


5-26: Comprehensive and well-typed invoice schema definition.

The schema covers essential invoice fields with appropriate types, including nullable fields for optional data like customer_email and hosted_invoice_url. The field titles are descriptive and user-friendly.


32-37: Clean handling of output port options generation.

The conditional check for generateOutputPortOptions properly delegates to the library function with the correct schema and default port configuration.


40-51: Appropriate Stripe API integration for invoice search.

The GET request to the search endpoint includes proper authentication, query parameters, and a reasonable default limit of 100 results. The API URL and parameters align with Stripe's documentation.


53-58: Consistent array output handling.

The use of lib.sendArrayOutput with the data records and output type configuration ensures consistent response formatting across the Stripe integration.

src/appmixer/stripe/core/UpdateCustomer/UpdateCustomer.js (5)

1-1: Keep the "use strict" directive as per coding guidelines.

The static analysis tool suggests removing "use strict", but the coding guidelines explicitly state that this directive is desirable for src/appmixer/**/*.js files.


28-41: Elegant conditional address object construction.

The logic correctly builds the address object only when relevant fields are present, avoiding sending empty or null address data to the Stripe API. This approach is more efficient and cleaner than always including the address object.


43-62: Well-structured shipping object with nested address.

The conditional shipping object construction properly handles both shipping contact details and nested address information, following Stripe's expected data structure for shipping information.


77-78: Clean use of spread operator for conditional object inclusion.

The spread operator syntax elegantly includes the address and shipping objects only when they exist, resulting in clean request payloads without unnecessary null or undefined fields.


64-84: Robust customer update implementation.

The function comprehensively handles customer data updates including contact details, billing address, and shipping information. The API call structure is correct with proper authentication and the response handling follows established patterns.

src/appmixer/stripe/core/FindCharges/FindCharges.js (1)

1-2: 'use strict' directive is appropriate here.

The static analysis tool flagged this as redundant, but according to the coding guidelines for src/appmixer/**/*.js files, the directive "use strict"; is desirable here.

src/appmixer/stripe/auth.js (1)

1-1: 'use strict' directive is appropriate here.

The static analysis tool flagged this as redundant, but according to the coding guidelines for src/appmixer/**/*.js files, the directive "use strict"; is desirable here.

src/appmixer/stripe/core/SearchPaymentIntent/SearchPaymentIntent.js (2)

1-51: Implementation looks correct.

The module correctly implements payment intent search functionality with proper API endpoint, schema definition, and output handling. The code follows the established patterns for the Stripe integration.


1-1: 'use strict' directive is appropriate here.

The static analysis tool flagged this as redundant, but according to the coding guidelines for src/appmixer/**/*.js files, the directive "use strict"; is desirable here.

src/appmixer/stripe/core/SearchCustomers/SearchCustomers.js (2)

5-67: Implementation looks correct.

The module correctly implements customer search functionality with a comprehensive schema that includes all relevant customer fields and the nested address object. The API endpoint and output handling are properly implemented.


1-1: 'use strict' directive is appropriate here.

The static analysis tool flagged this as redundant, but according to the coding guidelines for src/appmixer/**/*.js files, the directive "use strict"; is desirable here.

src/appmixer/stripe/core/FinalizeDraftInvoice/component.json (1)

1-66: LGTM! Well-structured component configuration.

The component definition follows the established patterns correctly with proper input validation, authentication setup, quota management, and clear inspector metadata for user guidance.

src/appmixer/stripe/core/FindRefunds/FindRefunds.js (1)

7-34: LGTM! Well-implemented Stripe API integration.

The module correctly handles parameter extraction, API authentication, request formation, and output formatting. The logic follows the established patterns for Stripe components.

src/appmixer/stripe/core/SearchCustomers/component.json (1)

1-85: LGTM! Comprehensive customer search component configuration.

The configuration properly defines input validation, dynamic output port generation, multiple output format options, and clear UI metadata. The authentication and quota management are correctly configured.

src/appmixer/stripe/core/MakeAPICall/component.json (1)

14-80: LGTM! Flexible API call component design.

The component provides a clean interface for arbitrary Stripe API calls with proper parameter handling and multiple output options (aside from the naming inconsistency noted above).

src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js (1)

5-62: LGTM! Comprehensive payment methods integration.

The module provides a well-structured schema definition for payment method objects and implements proper API interaction patterns. The parameter handling and output formatting are consistent with other Stripe components.

src/appmixer/stripe/core/RetrieveRefund/component.json (3)

1-13: Top-level metadata looks correct
Component name, version, auth and quota settings align with other Stripe core components.


14-38: Input port schema is valid
The inPorts block correctly enforces a required refundId string and provides proper inspector metadata.


40-59: Basic output port options are defined properly
The scalar fields id, object, amount, etc. are exposed with correct types.

src/appmixer/stripe/core/RetrievePaymentIntent/component.json (2)

1-13: Top-level metadata alignment
Name, version, auth, and quota sections match other retrieve components.


14-38: Input port uses consistent camelCase
The paymentIntentId property aligns with naming in other components.

src/appmixer/stripe/core/CancelPaymentIntent/component.json (1)

1-13: Metadata is correct
Component name, description, auth, and quota settings are in line with the PR’s standards.

src/appmixer/stripe/core/SearchInvoices/component.json (3)

1-13: Component definition is sound
Name, auth, version, and quota settings mirror the pattern of other search components.


14-39: Input port configuration is complete
query is required, outputType is optional with correct default and options.


69-83: Dynamic output port mapping is correct
Using a source URL with generateOutputPortOptions follows the established dynamic pattern.

src/appmixer/stripe/core/CreateRefund/component.json (2)

1-13: Metadata definitions are accurate
Component metadata is consistent with other Create* components.


56-90: Output port options are well-defined
Exposes id, object, amount, and status as expected.

src/appmixer/stripe/core/DeleteCustomer/component.json (3)

1-5: Metadata looks correct.
Good component naming, versioning, and description.


7-13: Auth and quota configuration is consistent.
The auth.service and quota.manager correctly reference appmixer:stripe.


37-63: Output port schema is correct.
The options for id, object, and deleted are well defined.

src/appmixer/stripe/core/CapturePaymentIntent/component.json (2)

1-6: Component metadata is well defined.
Name, description, and version follow the established pattern.


50-74: Output port options are accurate.
Exposing id, object, and status aligns with response fields.

src/appmixer/stripe/core/CreateInvoice/component.json (1)

69-97: Output port schema is consistent.
Fields id, object, customer, and status are correctly defined.

src/appmixer/stripe/core/UpdateCustomer/component.json (3)

1-13: Metadata, auth, and quota are correct.
Component name, version, auth, and quota align with standards.


14-84: Input schema is comprehensive and correctly required.
All optional fields are defined and only customerId is marked as required.


211-238: Output port options are appropriate.
Exposing id, object, and email matches the update response.

src/appmixer/stripe/core/SearchPaymentIntent/component.json (1)

69-83: Dynamic outPort mapping is well configured.
The generateOutputPortOptions and message mappings are correct.

src/appmixer/stripe/core/RetrieveInvoice/component.json (1)

198-202: Fix custom_fields schema.

Invoice custom_fields is an array of objects, not a string. Change schema to:

-"type": "string"
+"type": "array",
+"items": { "type": "object", /* custom field props */ }

Likely an incorrect or invalid review comment.

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

♻️ Duplicate comments (2)
src/appmixer/stripe/core/FindCharges/FindCharges.js (1)

23-31: Previous issues with API endpoint and schema have been resolved.

The past review comments about using the wrong API endpoint (/v1/refunds instead of /v1/charges) and the typo in the schema ('curency' instead of 'currency') have both been fixed correctly.

src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js (1)

1-1: 'use strict' directive conflicts with static analysis.

Same issue as in DeleteCustomer.js - the static analysis tool flags this as redundant, but your coding guidelines specify it's "desirable" for appmixer files.

🧹 Nitpick comments (1)
src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js (1)

6-6: Consider input validation for customerId.

The customerId is directly interpolated into the URL without validation, which could potentially lead to path traversal issues if malicious input is provided.

 const { customerId } = context.messages.in.content;
+
+if (!customerId || typeof customerId !== 'string') {
+    throw new Error('Invalid customerId provided');
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34ea8bb and 08872b6.

📒 Files selected for processing (10)
  • src/appmixer/stripe/auth.js (1 hunks)
  • src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js (1 hunks)
  • src/appmixer/stripe/core/CreateCustomer/component.json (1 hunks)
  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js (1 hunks)
  • src/appmixer/stripe/core/CreateRefund/CreateRefund.js (1 hunks)
  • src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js (1 hunks)
  • src/appmixer/stripe/core/FindCharges/FindCharges.js (1 hunks)
  • src/appmixer/stripe/core/RetrieveCustomer/component.json (1 hunks)
  • src/appmixer/stripe/core/RetrieveInvoice/component.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/appmixer/stripe/core/CreateCustomer/component.json
  • src/appmixer/stripe/core/RetrieveCustomer/component.json
  • src/appmixer/stripe/core/RetrieveInvoice/component.json
🧰 Additional context used
📓 Path-based instructions (1)
`src/appmixer/**/*.js`: Not necessary to add try/catch blocks in their `receive` function. Appmixer engine automatically handles any exceptions that originate in these async functi...

src/appmixer/**/*.js: Not necessary to add try/catch blocks in their receive function. Appmixer engine automatically handles any exceptions that originate in these async functions.

The directive "use strict"; is desirable here

  • src/appmixer/stripe/core/FindCharges/FindCharges.js
  • src/appmixer/stripe/auth.js
  • src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js
  • src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js
  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js
  • src/appmixer/stripe/core/CreateRefund/CreateRefund.js
  • src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js
🪛 Biome (1.9.4)
src/appmixer/stripe/core/FindCharges/FindCharges.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/auth.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


[error] 32-32: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 34-34: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/CreateRefund/CreateRefund.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

🔇 Additional comments (8)
src/appmixer/stripe/core/CreateRefund/CreateRefund.js (1)

11-11: Fix amount validation to handle zero values correctly.

The current validation amount !== undefined && amount !== '' will exclude valid zero amounts. Zero is a legitimate refund amount in Stripe.

-        if (amount !== undefined && amount !== '') formData.amount = amount;
+        if (amount !== undefined && amount !== null && amount !== '') {
+            const numericAmount = parseInt(amount, 10);
+            if (!isNaN(numericAmount) && numericAmount >= 0) {
+                formData.amount = numericAmount;
+            }
+        }

Likely an incorrect or invalid review comment.

src/appmixer/stripe/core/DeleteCustomer/DeleteCustomer.js (2)

1-1: 'use strict' directive conflicts with static analysis.

The static analysis tool flags this as redundant since JavaScript modules are automatically in strict mode. However, your coding guidelines specify that this directive is "desirable" for src/appmixer/**/*.js files. Consider clarifying the coding guidelines to resolve this conflict.


9-18: API call implementation looks correct.

The HTTP DELETE request is properly structured with correct headers, authentication, and response handling. The use of application/x-www-form-urlencoded content type is appropriate for Stripe API calls.

src/appmixer/stripe/core/CreateCustomer/CreateCustomer.js (5)

5-25: Input parameter destructuring is comprehensive.

Good coverage of all customer-related fields including billing and shipping address components. The destructuring approach is clean and maintainable.


27-40: Address object construction logic is correct.

The conditional logic properly checks for any address field presence before creating the address object. This prevents sending empty address objects to the Stripe API.


42-61: Shipping object construction follows good pattern.

The conditional logic mirrors the address construction pattern and properly nests the shipping address within the shipping object, matching Stripe's API expectations.


70-78: Excellent use of conditional spread operator.

The spread operator usage ...(address && { address }) and ...(shipping && { shipping }) elegantly handles optional fields without cluttering the data object with undefined values.


63-81: API call implementation is well-structured.

The HTTP POST request properly formats the data, uses correct authentication, and handles the response appropriately. The parameter mapping (e.g., paymentMethod to payment_method) follows Stripe's API conventions.

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)
src/appmixer/stripe/core/CreateInvoice/component.json (1)

109-110: Optimize embedding of the component icon.
Embedding a large Base64 string can significantly bloat the JSON and impact performance. Consider externalizing this icon into an asset file or switching to a lightweight SVG.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08872b6 and 2883510.

📒 Files selected for processing (5)
  • src/appmixer/stripe/core/CreateInvoice/component.json (1 hunks)
  • src/appmixer/stripe/core/DeleteCustomer/component.json (1 hunks)
  • src/appmixer/stripe/core/FindCharges/component.json (1 hunks)
  • src/appmixer/stripe/core/MakeAPICall/component.json (1 hunks)
  • src/appmixer/stripe/core/RetrievePaymentIntent/component.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/appmixer/stripe/core/FindCharges/component.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/appmixer/stripe/core/RetrievePaymentIntent/component.json
  • src/appmixer/stripe/core/DeleteCustomer/component.json
  • src/appmixer/stripe/core/MakeAPICall/component.json
🧰 Additional context used
🪛 Biome (1.9.4)
src/appmixer/stripe/core/CreateInvoice/component.json

[error] 43-43: expected , but instead found :

Remove :

(parse)


[error] 43-43: expected , but instead found {

Remove {

(parse)


[error] 72-72: expected , but instead found }

Remove }

(parse)


[error] 73-73: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 74-74: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 74-74: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 74-108: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 108-108: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 109-109: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 109-109: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 109-109: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 109-110: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

🔇 Additional comments (4)
src/appmixer/stripe/core/CreateInvoice/component.json (4)

1-6: Approve metadata and component definition.
The name, author, description, and version fields follow conventions and align with the integration’s naming scheme.


7-13: Approve auth and quota configuration.
The component correctly references the Stripe auth service and enforces request quotas as expected.


43-71: Approve inspector metadata.
The input port inspector configuration is clear and provides appropriate labels, tooltips, indexes, and default values.


75-107: Approve output port definitions.
The outPorts correctly expose id, object, customer, and status with accurate schemas and labels.

@sayam-nasir sayam-nasir changed the title Stripe1 Stripe(new) Jun 19, 2025
@vtalas vtalas marked this pull request as draft June 25, 2025 09:22
@sayam-nasir sayam-nasir marked this pull request as ready for review June 25, 2025 11:12
@sayam-nasir sayam-nasir requested a review from vtalas June 25, 2025 11:12
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: 0

🧹 Nitpick comments (4)
src/appmixer/stripe/core/FindCustomers/FindCustomers.js (2)

1-1: Remove redundant 'use strict' directive.

ES6 modules are automatically in strict mode, making this directive unnecessary.

-'use strict';

36-36: Add empty line after function definition.

According to the coding guidelines, there should be an empty line after function definitions.

 module.exports = {
     async receive(context) {
+
         const { query, outputType } = context.messages.in.content;
src/appmixer/stripe/core/FindInvoices/FindInvoices.js (1)

29-29: Add empty line after function definition.

Per coding guidelines, add one empty line after function definitions.

 module.exports = {
     async receive(context) {
+
         const { query, outputType } = context.messages.in.content;
src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js (1)

1-1: Remove redundant 'use strict' directive.

JavaScript modules are automatically in strict mode, making this directive redundant. While the coding guidelines mention it's "desirable," modern best practice is to omit it in ES6 modules.

-'use strict';
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a5898b and be5900d.

📒 Files selected for processing (6)
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js (1 hunks)
  • src/appmixer/stripe/core/FindCustomers/component.json (1 hunks)
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js (1 hunks)
  • src/appmixer/stripe/core/FindInvoices/component.json (1 hunks)
  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/FindPaymentIntent/component.json (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/appmixer/stripe/core/FindCustomers/component.json
  • src/appmixer/stripe/core/FindPaymentIntent/component.json
  • src/appmixer/stripe/core/FindInvoices/component.json
🧰 Additional context used
📓 Path-based instructions (4)
`src/appmixer/**`: Use `src/appmixer` for source code of connectors.

src/appmixer/**: Use src/appmixer for source code of connectors.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js
`src/appmixer/*/core/*/*.js`: Behavior files for components must be JavaScript f...

src/appmixer/*/core/*/*.js: Behavior files for components must be JavaScript files named after the component and located in the corresponding component folder under core.
When adding a new field to a component, update the corresponding behavior JS file to handle the new field, especially in context.httpRequest calls.
Do not check for required properties in the receive function of behavior files; required properties are validated by the input schema in component.json.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js
`**/*.js`: Add one empty line after function definition. Use 4 spaces for indentation.

**/*.js: Add one empty line after function definition.
Use 4 spaces for indentation.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js
`src/appmixer/**/*.js`: Not necessary to add try/catch blocks in their `receive`...

src/appmixer/**/*.js: Not necessary to add try/catch blocks in their receive function. Appmixer engine automatically handles any exceptions that originate in these async functions.

The directive "use strict"; is desirable here

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js
🧠 Learnings (3)
📓 Common learnings
Learnt from: vtalas
PR: clientIO/appmixer-connectors#540
File: src/appmixer/google/blogger/auth.js:14-14
Timestamp: 2025-06-05T07:58:25.099Z
Learning: In Appmixer connectors, OAuth scopes are defined per component in their component.json files, not centrally in the auth.js file. The auth.js file handles basic OAuth flow with profile/email scopes, while individual components specify their own required API scopes.
src/appmixer/stripe/core/FindInvoices/FindInvoices.js (1)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
src/appmixer/stripe/core/FindCustomers/FindCustomers.js (2)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : When adding a new field to a component, update the corresponding behavior JS file to handle the new field, especially in `context.httpRequest` calls.
🧬 Code Graph Analysis (1)
src/appmixer/stripe/core/FindInvoices/FindInvoices.js (2)
src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js (4)
  • lib (3-3)
  • schema (5-17)
  • context (21-21)
  • context (31-42)
src/appmixer/stripe/core/FindCustomers/FindCustomers.js (4)
  • lib (3-3)
  • schema (5-33)
  • context (37-37)
  • context (47-58)
🪛 Biome (1.9.4)
src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/FindInvoices/FindInvoices.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/FindCustomers/FindCustomers.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

🔇 Additional comments (9)
src/appmixer/stripe/core/FindCustomers/FindCustomers.js (2)

5-33: Well-structured schema definition.

The schema comprehensively covers Stripe customer properties with appropriate types and nullable fields. Good use of nested object structure for the address field.


35-67: Solid implementation following Appmixer patterns.

The receive function correctly:

  • Handles output port options generation
  • Makes authenticated HTTP requests to Stripe API
  • Uses proper error handling (letting the engine handle exceptions)
  • Leverages the generated library for consistent output formatting

The API call follows Stripe's documentation and includes appropriate headers and parameters.

src/appmixer/stripe/core/FindInvoices/FindInvoices.js (3)

5-26: Well-structured invoice schema definition.

The schema comprehensively covers the essential invoice fields from Stripe's API, including financial details, customer information, and metadata. The field types and titles are appropriate for the invoice data structure.


28-60: Solid implementation following established patterns.

The implementation correctly follows the pattern established by other Stripe search modules in the codebase:

  • Proper handling of output port options generation
  • Correct API endpoint usage (/v1/invoices/search)
  • Appropriate authorization headers and query parameters
  • Consistent use of lib.sendArrayOutput for response handling

The 100-item limit is reasonable for search operations and matches other modules.


1-1: Remove redundant 'use strict' directive.

Static analysis correctly identifies that the 'use strict' directive is redundant in ES6 modules, as they are automatically in strict mode.

-'use strict';
⛔ Skipped due to learnings
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to test/utils.js : Use `test/utils.js` for Appmixer stub.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js (4)

3-17: Well-structured schema definition.

The import statement and schema definition are properly implemented. The schema comprehensively covers the essential payment intent fields with appropriate types and descriptive titles.


19-28: Correct implementation of output port options generation.

The receive function and generateOutputPortOptions handling follow the established pattern correctly. The parameter destructuring and lib function usage are appropriate.


30-42: Proper Stripe API integration.

The HTTP request implementation is correct with proper authentication, endpoint URL, and parameter handling. The default limit of 100 is reasonable for search operations.


44-50: Correct output handling implementation.

The lib.sendArrayOutput usage is proper with appropriate parameters. The records parameter correctly references the nested data structure from Stripe's API response.

module.exports = {
async receive(context) {

const { customer, collectionMethod, description, autoAdvance } = context.messages.in.content;
Copy link
Contributor

Choose a reason for hiding this comment

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

inputs:
image

causing error
error": {
"message": "If invoice collection method is 'send_invoice', you must specify 'due_date' or 'days_until_due'.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_q7w40sVFJHkXjn?t=1751963425",
"type": "invalid_request_error"
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added conditional required fields, due_date, days_until_due

}
}
],
"outPorts": [
Copy link
Contributor

Choose a reason for hiding this comment

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

missing the notFound output port. It's missing on all Find<XXX> components. It's crucial to send a message to this output port when no results are found..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added notFound ports in all Find components (6)

  • FindCustomers
  • FindCharges
  • FindInvoices
  • FindPaymentIntent
  • FindPaymentMethods
  • FindRefunds

}

// Stripe: https://stripe.com/docs/api/customers/search
const { data } = await context.httpRequest({
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use another endpoint for listing to make the query optional, something like

       }

        let url, params;
        
        if (query) {
            // Use search endpoint if query is provided
            url = 'https://api.stripe.com/v1/customers/search';
            params = { query, limit: 100 };
        } else {
            // Use list endpoint if no query is provided
            url = 'https://api.stripe.com/v1/customers';
            params = { limit: 100 };
        }

Copy link
Contributor

Choose a reason for hiding this comment

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

this approach might be used also for the FindPaymentIntent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vtalas Yes, I have implemented this in FindPaymentIntents. FindCustomers and FindInvoices

@vtalas vtalas marked this pull request as draft July 8, 2025 09:17
@sayam-nasir sayam-nasir marked this pull request as ready for review July 8, 2025 14:51
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 (3)
src/appmixer/stripe/core/FindCharges/FindCharges.js (1)

29-37: Verify HTTP request parameter structure for GET method.

Based on past review comments, there was a concern about using data field for GET request parameters instead of params. Please confirm if this structure is correct for the context.httpRequest implementation in this codebase.

Looking at the relevant code snippets from other Stripe components, they all use the same pattern with data field for parameters. However, a previous review specifically flagged this as incorrect for GET requests. Let me verify the correct usage:

#!/bin/bash
# Check how other components in the codebase handle GET request parameters
rg -A 10 -B 5 "method: 'GET'" src/appmixer/stripe/core/*/
src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js (1)

19-19: Boolean field validation pattern is inconsistent with field type.

The autoAdvance field is a boolean in Stripe's API, but the validation pattern treats it like a string field by checking against empty string. For boolean fields, this check is unnecessary and inconsistent.

Apply this diff to align with proper boolean field handling:

-        if (autoAdvance !== undefined && autoAdvance !== '') invoiceData.auto_advance = Boolean(autoAdvance);
+        if (autoAdvance !== undefined && autoAdvance !== null) {
+            invoiceData.auto_advance = Boolean(autoAdvance);
+        }
src/appmixer/stripe/core/FindPaymentMethods/component.json (1)

18-30: Missing required fields in input schema needs to be addressed.

This is the same issue identified in previous reviews - the input schema lacks a required array to specify mandatory fields like customerId and type.

🧹 Nitpick comments (16)
src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js (3)

1-1: Consider the static analysis recommendation but keep the directive.

While static analysis suggests removing the redundant use strict directive (as ES6 modules are automatically in strict mode), the coding guidelines specifically state that "The directive "use strict"; is desirable here" for Appmixer files.


30-60: Consider using optional chaining for safer property access.

The conditional logic for search vs list endpoints is well-structured. However, consider using optional chaining for safer property access as suggested by static analysis.

Apply this diff to improve the query check:

-        if (query && query.trim()) {
+        if (query?.trim()) {

The HTTP request configuration is correct with proper authorization headers and Stripe API endpoints.


62-68: Improve response data extraction with optional chaining.

The response processing logic is correct but can be improved for safety and readability.

Apply this diff to use optional chaining:

-        const paymentIntents = response.data && response.data.data ? response.data.data : [];
+        const paymentIntents = response.data?.data ?? [];

The empty result handling with the notFound port is implemented correctly.

src/appmixer/stripe/core/FindCustomers/FindCustomers.js (3)

1-1: Remove redundant 'use strict' directive.

JavaScript modules are automatically in strict mode, making this directive unnecessary.

-'use strict';

47-47: Consider using optional chaining for cleaner code.

The condition can be simplified using optional chaining.

-        if (query && query.trim()) {
+        if (query?.trim()) {

79-79: Consider using optional chaining for response data access.

The nested property access can be simplified using optional chaining.

-        const customers = response.data && response.data.data ? response.data.data : [];
+        const customers = response.data?.data ?? [];
src/appmixer/stripe/core/FindInvoices/FindInvoices.js (3)

1-1: Remove redundant "use strict" directive.

The "use strict" directive is redundant in JavaScript modules as they are automatically in strict mode.

-'use strict';
-

40-40: Consider using optional chaining for better readability.

The conditional check could be simplified using optional chaining.

-        if (query && query.trim()) {
+        if (query?.trim()) {

72-72: Consider using optional chaining for safer property access.

The nested property access could be simplified and made safer using optional chaining.

-        const invoices = response.data && response.data.data ? response.data.data : [];
+        const invoices = response.data?.data ?? [];
src/appmixer/stripe/core/FindCharges/FindCharges.js (2)

1-2: Remove redundant 'use strict' directive.

ES6 modules are automatically in strict mode, making this directive unnecessary.

-
-'use strict';
-
+

15-16: Add missing empty line after function definition.

According to coding guidelines, there should be an empty line after function definitions.

 module.exports = {
     async receive(context) {
+
         const { customerId, outputType, paymentIntent } = context.messages.in.content;
src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js (3)

2-2: Remove redundant 'use strict' directive.

In ES6 modules, the entire contents are automatically in strict mode, making the explicit directive unnecessary.

-'use strict';

36-37: Add empty line after function definition.

According to the coding guidelines, there should be an empty line after function definitions.

 async receive(context) {
+
     const { customerId, type, outputType } = context.messages.in.content;

50-58: Consider removing unnecessary Content-Type header for GET request.

The Content-Type: application/x-www-form-urlencoded header is typically used for POST requests with form data. For GET requests, parameters are usually passed as query parameters, making this header unnecessary.

 const { data } = await context.httpRequest({
     method: 'GET',
     url: 'https://api.stripe.com/v1/payment_methods',
     headers: {
-        'Authorization': `Bearer ${context.auth.apiKey}`,
-        'Content-Type': 'application/x-www-form-urlencoded'
+        'Authorization': `Bearer ${context.auth.apiKey}`
     },
     data: params
 });
src/appmixer/stripe/core/FindRefunds/FindRefunds.js (2)

1-2: Remove redundant 'use strict' directive.

The static analysis correctly identifies that the 'use strict' directive is redundant in JavaScript modules, as they are automatically in strict mode.

Apply this diff to remove the redundant directive:

-
-'use strict';
+

5-5: Consider improving schema definition readability.

The schema object is defined as a long single line, which affects readability and maintainability.

Apply this diff to improve readability:

-const schema = { 'id':{ 'type':'string','title':'Id' },'object':{ 'type':'string','title':'Object' },'amount':{ 'type':'number','title':'Amount' },'status':{ 'type':'string','title':'Status' } };
+const schema = {
+    'id': { 'type': 'string', 'title': 'Id' },
+    'object': { 'type': 'string', 'title': 'Object' },
+    'amount': { 'type': 'number', 'title': 'Amount' },
+    'status': { 'type': 'string', 'title': 'Status' }
+};
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be5900d and b31091d.

📒 Files selected for processing (16)
  • src/appmixer/stripe/core/CreateCustomer/component.json (1 hunks)
  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js (1 hunks)
  • src/appmixer/stripe/core/CreateInvoice/component.json (1 hunks)
  • src/appmixer/stripe/core/FindCharges/FindCharges.js (1 hunks)
  • src/appmixer/stripe/core/FindCharges/component.json (1 hunks)
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js (1 hunks)
  • src/appmixer/stripe/core/FindCustomers/component.json (1 hunks)
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js (1 hunks)
  • src/appmixer/stripe/core/FindInvoices/component.json (1 hunks)
  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js (1 hunks)
  • src/appmixer/stripe/core/FindPaymentIntent/component.json (1 hunks)
  • src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js (1 hunks)
  • src/appmixer/stripe/core/FindPaymentMethods/component.json (1 hunks)
  • src/appmixer/stripe/core/FindRefunds/FindRefunds.js (1 hunks)
  • src/appmixer/stripe/core/FindRefunds/component.json (1 hunks)
  • src/appmixer/stripe/core/UpdateCustomer/component.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/appmixer/stripe/core/UpdateCustomer/component.json
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/appmixer/stripe/core/FindCustomers/component.json
  • src/appmixer/stripe/core/FindInvoices/component.json
  • src/appmixer/stripe/core/FindRefunds/component.json
  • src/appmixer/stripe/core/FindCharges/component.json
  • src/appmixer/stripe/core/FindPaymentIntent/component.json
  • src/appmixer/stripe/core/CreateCustomer/component.json
  • src/appmixer/stripe/core/CreateInvoice/component.json
🧰 Additional context used
📓 Path-based instructions (5)
`src/appmixer/**`: Use `src/appmixer` for source code of connectors.

src/appmixer/**: Use src/appmixer for source code of connectors.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js
  • src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js
  • src/appmixer/stripe/core/FindPaymentMethods/component.json
  • src/appmixer/stripe/core/FindCharges/FindCharges.js
  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
  • src/appmixer/stripe/core/FindRefunds/FindRefunds.js
`src/appmixer/*/core/*/*.js`: Behavior files for components must be JavaScript f...

src/appmixer/*/core/*/*.js: Behavior files for components must be JavaScript files named after the component and located in the corresponding component folder under core.
When adding a new field to a component, update the corresponding behavior JS file to handle the new field, especially in context.httpRequest calls.
Do not check for required properties in the receive function of behavior files; required properties are validated by the input schema in component.json.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js
  • src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js
  • src/appmixer/stripe/core/FindCharges/FindCharges.js
  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
  • src/appmixer/stripe/core/FindRefunds/FindRefunds.js
`**/*.js`: Add one empty line after function definition. Use 4 spaces for indentation.

**/*.js: Add one empty line after function definition.
Use 4 spaces for indentation.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js
  • src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js
  • src/appmixer/stripe/core/FindCharges/FindCharges.js
  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
  • src/appmixer/stripe/core/FindRefunds/FindRefunds.js
`src/appmixer/**/*.js`: Not necessary to add try/catch blocks in their `receive`...

src/appmixer/**/*.js: Not necessary to add try/catch blocks in their receive function. Appmixer engine automatically handles any exceptions that originate in these async functions.

The directive "use strict"; is desirable here

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js
  • src/appmixer/stripe/core/FindCustomers/FindCustomers.js
  • src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js
  • src/appmixer/stripe/core/FindInvoices/FindInvoices.js
  • src/appmixer/stripe/core/FindCharges/FindCharges.js
  • src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js
  • src/appmixer/stripe/core/FindRefunds/FindRefunds.js
`src/appmixer/*/core/*/component.json`: Each component must have a `component.js...

src/appmixer/*/core/*/component.json: Each component must have a component.json file in its folder under core.
If adding a new field to component.json, add the field to both schema and inspector sections in the inPorts array, following JSON schema format.
The component.json file must have a name property in the format 'vendor.connectorName.core.componentName'.
The component.json file must define the label, description, and author properties as described in the schema.
The component.json file must define inPorts and outPorts arrays according to the schema, with each port having the required structure.
The component.json file must not have additional properties beyond those defined in the schema.
The component.json file must define the version property, e.g., '1.0.0'.
The component.json file's auth property, if present, must have a service property in the format [vendor]:[service].
The component.json file's quota property, if present, must reference a quota manager and resources as described in the schema.
The component.json file's properties object, if present, must define schema and inspector according to the definitions.
The component.json file's inPorts array must define each input port with a name and configuration, allowing placeholders for variables.
The component.json file's outPorts array must define each output port with a name and optionally an options array describing output structure.
The component.json file's inspector property, if present, must follow the Rappid Inspector definition format or use a dynamic source.
The component.json file's name property must match the pattern ^[\w]+.[\w]+.[\w]+.[\w]+$.
The component.json file's icon property, if present, must be a link to an SVG icon.
The component.json file's tick property, if present and true, indicates the component will receive signals at regular intervals.
The component.json file's webhook property, if present and true, enables webhook functionality for the component.
The component.json file's state property, if present, must define a persistent boolean.
The component.json file's options property, if present, must be an array of unique objects or strings.
The component.json file's inspectorInput property, if present, must follow the defined schema for inspector inputs.

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • src/appmixer/stripe/core/FindPaymentMethods/component.json
🧠 Learnings (8)
📓 Common learnings
Learnt from: vtalas
PR: clientIO/appmixer-connectors#540
File: src/appmixer/google/blogger/auth.js:14-14
Timestamp: 2025-06-05T07:58:25.099Z
Learning: In Appmixer connectors, OAuth scopes are defined per component in their component.json files, not centrally in the auth.js file. The auth.js file handles basic OAuth flow with profile/email scopes, while individual components specify their own required API scopes.
src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js (2)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : When adding a new field to a component, update the corresponding behavior JS file to handle the new field, especially in `context.httpRequest` calls.
src/appmixer/stripe/core/FindCustomers/FindCustomers.js (4)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : When adding a new field to a component, update the corresponding behavior JS file to handle the new field, especially in `context.httpRequest` calls.
Learnt from: ZbynekPelunek
PR: clientIO/appmixer-connectors#461
File: src/appmixer/microsoft/sharepoint/FindFilesOrFolders/FindFilesOrFolders.js:23-27
Timestamp: 2025-04-22T10:37:04.811Z
Learning: For the Microsoft SharePoint connector, the `/search/query` endpoint in Microsoft Graph API requires a queryString parameter, making it unsuitable for cases where the query string needs to be optional. The current implementation uses the `/delta` endpoint for parent paths and `/search` for root paths as a practical workaround.
Learnt from: ZbynekPelunek
PR: clientIO/appmixer-connectors#461
File: src/appmixer/microsoft/sharepoint/FindFilesOrFolders/FindFilesOrFolders.js:23-27
Timestamp: 2025-04-22T10:37:04.811Z
Learning: For the Microsoft SharePoint connector, the `/search/query` endpoint in Microsoft Graph API requires a queryString parameter, which makes it unsuitable for cases where the query string needs to be optional. The current implementation uses `/delta` endpoint for parent paths and `/search` for root paths as a workaround.
src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js (2)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : When adding a new field to a component, update the corresponding behavior JS file to handle the new field, especially in `context.httpRequest` calls.
src/appmixer/stripe/core/FindInvoices/FindInvoices.js (1)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
src/appmixer/stripe/core/FindPaymentMethods/component.json (16)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : If adding a new field to component.json, add the field to both `schema` and `inspector` sections in the `inPorts` array, following JSON schema format.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : The `component.json` file's `outPorts` array must define each output port with a name and optionally an options array describing output structure.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : The `component.json` file must define `inPorts` and `outPorts` arrays according to the schema, with each port having the required structure.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : The `component.json` file's `inPorts` array must define each input port with a name and configuration, allowing placeholders for variables.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : The `component.json` file's `auth` property, if present, must have a `service` property in the format [vendor]:[service].
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : The `component.json` file must have a `name` property in the format 'vendor.connectorName.core.componentName'.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : Each component must have a `component.json` file in its folder under core.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : When adding a new field to a component, update the corresponding behavior JS file to handle the new field, especially in `context.httpRequest` calls.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : The `component.json` file must define the `version` property, e.g., '1.0.0'.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : The `component.json` file must not have additional properties beyond those defined in the schema.
Learnt from: sayam-nasir
PR: clientIO/appmixer-connectors#448
File: src/appmixer/github/list/UpdatePullRequest/UpdatePullRequest.js:11-11
Timestamp: 2025-04-28T11:28:32.339Z
Learning: In Appmixer GitHub connector components, when properties are defined as required in the component.json schema, additional validation in the component implementation JS file is unnecessary as the platform enforces these requirements before execution.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
Learnt from: sayam-nasir
PR: clientIO/appmixer-connectors#554
File: src/appmixer/pinterest/core/GetPin/GetPin.js:6-7
Timestamp: 2025-06-13T12:34:10.163Z
Learning: In Appmixer components, input properties marked as "required" in the component.json schema are guaranteed to be present at runtime, so explicit presence checks inside `receive` functions are unnecessary.
Learnt from: sayam-nasir
PR: clientIO/appmixer-connectors#448
File: src/appmixer/github/list/FindRepository/FindRepository.js:10-21
Timestamp: 2025-04-28T12:20:39.385Z
Learning: In the Appmixer platform, input validation is primarily handled through the component.json schema where inputs are marked as required/non-required, making additional validation in the JavaScript implementation files unnecessary as the platform enforces these requirements before execution.
Learnt from: sayam-nasir
PR: clientIO/appmixer-connectors#518
File: src/appmixer/canva/core/CreateDesign/CreateDesign.js:17-20
Timestamp: 2025-06-05T13:14:01.759Z
Learning: In Appmixer components, required properties defined in the component.json schema are validated by the platform before the component code executes, so additional runtime validation for schema-required properties is typically unnecessary.
Learnt from: sayam-nasir
PR: clientIO/appmixer-connectors#448
File: src/appmixer/github/list/GetOrganizationByName/GetOrganizationByName.js:11-11
Timestamp: 2025-04-28T12:21:25.195Z
Learning: For GitHub components in the Appmixer platform, properties defined as "required" in the component.json schema don't need additional validation in the component code as the framework ensures these properties exist before the component methods are called.
src/appmixer/stripe/core/FindCharges/FindCharges.js (6)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : When adding a new field to a component, update the corresponding behavior JS file to handle the new field, especially in `context.httpRequest` calls.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
Learnt from: sayam-nasir
PR: clientIO/appmixer-connectors#448
File: src/appmixer/github/list/FindIssue/FindIssue.js:14-18
Timestamp: 2025-04-28T11:43:24.482Z
Learning: The FindIssue.js component in the GitHub connector should use encodeURIComponent when constructing search query strings to ensure special characters in repositoryId, title, and labels don't break the URL structure when making API requests.
Learnt from: jirihofman
PR: clientIO/appmixer-connectors#494
File: src/appmixer/ai/voyageai/CreateTextEmbeddingsFromFile/CreateTextEmbeddingsFromFile.js:36-40
Timestamp: 2025-04-30T12:27:08.628Z
Learning: In the appmixer-connectors codebase, `context.httpRequest` is an axios instance, so error handling should follow axios patterns (using try/catch blocks) rather than checking for `response.ok` which is a Fetch API pattern.
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/component.json : If adding a new field to component.json, add the field to both `schema` and `inspector` sections in the `inPorts` array, following JSON schema format.
Learnt from: vtalas
PR: clientIO/appmixer-connectors#424
File: src/appmixer/jira/package.json:6-8
Timestamp: 2025-03-17T09:26:28.766Z
Learning: "request-promise" dependency is widely used across the appmixer-connectors codebase, including in commons components of multiple connectors. While some files are being updated to use context.httpRequest instead, the dependency needs to remain in package.json files for components that still use it.
src/appmixer/stripe/core/FindRefunds/FindRefunds.js (1)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T09:09:52.832Z
Learning: Applies to src/appmixer/*/core/*/*.js : Do not check for required properties in the `receive` function of behavior files; required properties are validated by the input schema in component.json.
🧬 Code Graph Analysis (2)
src/appmixer/stripe/core/FindCustomers/FindCustomers.js (5)
src/appmixer/stripe/core/FindCharges/FindCharges.js (4)
  • lib (4-4)
  • schema (5-12)
  • context (17-17)
  • context (29-37)
src/appmixer/stripe/core/FindInvoices/FindInvoices.js (4)
  • lib (3-3)
  • schema (5-26)
  • context (30-30)
  • response (39-39)
src/appmixer/stripe/core/FindRefunds/FindRefunds.js (4)
  • lib (4-4)
  • schema (5-5)
  • context (10-10)
  • context (22-30)
src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js (4)
  • lib (4-4)
  • schema (5-33)
  • context (38-38)
  • context (50-58)
src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js (4)
  • lib (3-3)
  • schema (5-17)
  • context (21-21)
  • response (30-30)
src/appmixer/stripe/core/FindCharges/FindCharges.js (4)
src/appmixer/stripe/core/FindCustomers/FindCustomers.js (3)
  • lib (3-3)
  • schema (5-33)
  • context (37-37)
src/appmixer/stripe/core/FindRefunds/FindRefunds.js (5)
  • lib (4-4)
  • schema (5-5)
  • context (10-10)
  • context (22-30)
  • params (17-17)
src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js (5)
  • lib (4-4)
  • schema (5-33)
  • context (38-38)
  • context (50-58)
  • params (45-45)
src/appmixer/stripe/core/ConfirmPaymentIntent/ConfirmPaymentIntent.js (1)
  • context (14-22)
🪛 Biome (1.9.4)
src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/FindCustomers/FindCustomers.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


[error] 47-47: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 79-79: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/appmixer/stripe/core/FindPaymentMethods/FindPaymentMethods.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/FindInvoices/FindInvoices.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


[error] 40-40: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 72-72: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/appmixer/stripe/core/FindCharges/FindCharges.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js

[error] 1-1: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)


[error] 31-31: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 63-63: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/appmixer/stripe/core/FindRefunds/FindRefunds.js

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

🔇 Additional comments (26)
src/appmixer/stripe/core/FindPaymentIntent/FindPaymentIntent.js (4)

3-3: LGTM!

The import statement correctly references the shared library for Stripe integration utilities.


5-17: LGTM!

The schema definition accurately reflects the Stripe Payment Intent object structure with appropriate types and titles. The nullable fields (customer, description) are correctly defined with union types.


19-28: LGTM!

The module export structure and generateOutputPortOptions handling follows the standard Appmixer pattern correctly. The function definition properly has an empty line after it as required by the coding guidelines.


70-76: LGTM!

The output formatting using the shared library function is implemented correctly with proper parameters for array output handling.

src/appmixer/stripe/core/FindCustomers/FindCustomers.js (5)

5-33: Well-structured schema definition for Stripe customer objects.

The schema comprehensively covers all relevant Stripe customer fields including nested address properties with appropriate type definitions and nullable fields.


39-44: Proper handling of output port options generation.

The implementation correctly uses the shared library function with appropriate parameters for generating output port options.


47-76: Effective implementation of conditional API endpoint selection.

The logic correctly uses different Stripe endpoints based on query presence - search endpoint for queries and list endpoint for general listing. Both requests include proper authentication and consistent limit parameters.


82-84: Appropriate handling of empty results.

The implementation correctly sends empty results to the notFound port, which aligns with the component's design pattern.


86-92: Proper output handling using shared library function.

The code correctly uses lib.sendArrayOutput with appropriate parameters for handling array output and output type formatting.

src/appmixer/stripe/core/FindInvoices/FindInvoices.js (6)

5-26: Well-structured schema definition.

The schema comprehensively covers the key invoice fields from Stripe's API, including proper type definitions for nullable fields like customer_email and customer_name.


32-37: Proper handling of output port options.

The implementation correctly uses the library function to generate output port options when requested, following the established Appmixer pattern.


43-54: Correct implementation of Stripe invoice search.

The search endpoint usage aligns with Stripe's API documentation, with proper authorization and reasonable default limit.


58-69: Correct implementation of Stripe invoice listing.

The list endpoint usage follows Stripe's API patterns consistently with the search implementation.


75-77: Proper handling of empty results.

The implementation correctly routes empty results to the notFound output port, following the established pattern for "Find" components.


79-84: Correct usage of library output formatting.

The sendArrayOutput function call properly handles different output types and follows the established pattern for array-based results.

src/appmixer/stripe/core/FindCharges/FindCharges.js (3)

5-12: Schema definition looks good.

The schema correctly defines the structure for Stripe charge objects with proper field types and titles.


23-27: Parameter construction follows Stripe API correctly.

The parameter building logic properly handles optional customer and payment intent filters, with a reasonable default limit.


39-44: Error handling and output processing implemented correctly.

The component properly handles empty results by sending to the 'notFound' port and uses the standard library function for array output formatting.

src/appmixer/stripe/core/CreateInvoice/CreateInvoice.js (5)

1-1: Static analysis suggests removing 'use strict' but coding guidelines require it.

The static analysis tool flags the 'use strict'; directive as redundant in ES modules. However, the coding guidelines specifically state that this directive is "desirable" for src/appmixer/**/*.js files. Following the established coding guidelines is appropriate here.


3-12: LGTM: Function structure follows Appmixer connector pattern.

The module exports and async receive function structure correctly follows the expected pattern for Appmixer connectors. The parameter destructuring from context.messages.in.content is clean and appropriate.


21-28: LGTM: Conditional field logic addresses Stripe API requirements.

The conditional logic correctly handles the Stripe API requirement that when collection_method is 'send_invoice', either due_date or days_until_due must be specified. The Unix timestamp conversion for due_date is properly implemented.


30-38: LGTM: HTTP request configuration is correct.

The HTTP request to Stripe's API is properly configured with the correct method, URL, headers, and data format. The authorization header correctly uses the context's API key.


40-41: LGTM: Response handling follows expected pattern.

The response is correctly sent through the context's output channel using sendJson.

src/appmixer/stripe/core/FindRefunds/FindRefunds.js (3)

8-14: LGTM: Input handling and output port options.

The input parameter destructuring and conditional output port options generation follow the established pattern correctly.


16-21: LGTM: Parameter construction logic.

The parameter construction correctly handles optional charge and paymentIntent filters and sets a reasonable default limit.


32-38: LGTM: Response handling and output formatting.

The response handling correctly checks for empty results and uses the library function for array output formatting.

@vtalas vtalas merged commit d075d4b into clientIO:dev Jul 14, 2025
2 checks passed
@sayam-nasir sayam-nasir deleted the stripe1 branch July 14, 2025 14:03
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy