@commercelayer/react-components 4.11.2-beta.1 → 4.11.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.updateSubscriptionCustomerPaymentSource=exports.hasSubscriptions=void 0;function hasSubscriptions(order){var _a;return((_a=order?.line_items)===null||_a===void 0?void 0:_a.some(li=>li.frequency!=null))!=null}exports.hasSubscriptions=hasSubscriptions;function updateSubscriptionCustomerPaymentSource(order,sdk){order.subscription_created_at!=null&&sdk.orders.retrieve(order.id,{include:["payment_source","order_subscription","order_subscription.customer_payment_source"]}).then(order2=>{order2.payment_source!=null&&order2.order_subscription!=null&&sdk.customer_payment_sources.list({filters:{payment_source_id_eq:order2.payment_source.id}}).then(customerPaymentSources=>{var _a;if(customerPaymentSources.length>0&&order2.order_subscription!=null){const customerPaymentSource=customerPaymentSources[0];customerPaymentSource!=null&&sdk.order_subscriptions.update({id:(_a=order2.order_subscription)===null||_a===void 0?void 0:_a.id,customer_payment_source:sdk.customer_payment_sources.relationship(customerPaymentSource.id)})}})})}exports.updateSubscriptionCustomerPaymentSource=updateSubscriptionCustomerPaymentSource;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.updateSubscriptionCustomerPaymentSource=exports.hasSubscriptions=void 0;function hasSubscriptions(order){var _a;return((_a=order?.line_items)===null||_a===void 0?void 0:_a.some(li=>li.frequency!=null))!=null}exports.hasSubscriptions=hasSubscriptions;function updateSubscriptionCustomerPaymentSource(order,sdk){order.subscription_created_at!=null&&sdk.orders.retrieve(order.id,{include:["order_subscription","order_subscription.customer_payment_source"]}).then(order2=>{order2.payment_source_details!=null&&order2.order_subscription!=null&&sdk.customer_payment_sources.list({pageSize:25}).then(customerPaymentSources2=>{var _a;if(customerPaymentSources2.length>0&&order2.payment_source_details!=null&&order2.order_subscription!=null){const details=order2.payment_source_details,customerPaymentSource=customerPaymentSources2.find(cps=>cps.payment_source_token===details.payment_method_id);customerPaymentSource!=null&&sdk.order_subscriptions.update({id:(_a=order2.order_subscription)===null||_a===void 0?void 0:_a.id,customer_payment_source:sdk.customer_payment_sources.relationship(customerPaymentSource?.id)})}})})}exports.updateSubscriptionCustomerPaymentSource=updateSubscriptionCustomerPaymentSource;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export function hasSubscriptions(order){return order?.line_items?.some(li=>li.frequency!=null)!=null}export function updateSubscriptionCustomerPaymentSource(order,sdk){order.subscription_created_at!=null&&sdk.orders.retrieve(order.id,{include:["payment_source","order_subscription","order_subscription.customer_payment_source"]}).then(order2=>{order2.payment_source!=null&&order2.order_subscription!=null&&sdk.customer_payment_sources.list({filters:{payment_source_id_eq:order2.payment_source.id}}).then(customerPaymentSources=>{if(customerPaymentSources.length>0&&order2.order_subscription!=null){const customerPaymentSource=customerPaymentSources[0];customerPaymentSource!=null&&sdk.order_subscriptions.update({id:order2.order_subscription?.id,customer_payment_source:sdk.customer_payment_sources.relationship(customerPaymentSource.id)})}})})}
2
+ export function hasSubscriptions(order){return order?.line_items?.some(li=>li.frequency!=null)!=null}export function updateSubscriptionCustomerPaymentSource(order,sdk){order.subscription_created_at!=null&&sdk.orders.retrieve(order.id,{include:["order_subscription","order_subscription.customer_payment_source"]}).then(order2=>{order2.payment_source_details!=null&&order2.order_subscription!=null&&sdk.customer_payment_sources.list({pageSize:25}).then(customerPaymentSources2=>{if(customerPaymentSources2.length>0&&order2.payment_source_details!=null&&order2.order_subscription!=null){const details=order2.payment_source_details,customerPaymentSource=customerPaymentSources2.find(cps=>cps.payment_source_token===details.payment_method_id);customerPaymentSource!=null&&sdk.order_subscriptions.update({id:order2.order_subscription?.id,customer_payment_source:sdk.customer_payment_sources.relationship(customerPaymentSource?.id)})}})})}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/react-components",
3
- "version": "4.11.2-beta.1",
3
+ "version": "4.11.2-beta.2",
4
4
  "description": "The Official Commerce Layer React Components",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",