@dropins/storefront-purchase-order 0.0.3-alpha2 → 0.0.4-alpha1
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.
- package/api/getPurchaseOrderApprovalRules/getPurchaseOrderApprovalRules.d.ts +12 -0
- package/api/getPurchaseOrderApprovalRules/graphql/getPurchaseOrderApprovalRules.graphql.d.ts +18 -0
- package/api/getPurchaseOrderApprovalRules/index.d.ts +18 -0
- package/api/index.d.ts +1 -0
- package/api.js +14 -25
- package/api.js.map +1 -1
- package/chunks/fetch-graphql.js +4 -0
- package/chunks/fetch-graphql.js.map +1 -0
- package/chunks/getPurchaseOrderApprovalRules.js +75 -0
- package/chunks/getPurchaseOrderApprovalRules.js.map +1 -0
- package/chunks/getPurchaseOrders.js +8 -8
- package/chunks/getPurchaseOrders.js.map +1 -1
- package/chunks/useCustomerRolePermissions.js +1 -1
- package/chunks/useCustomerRolePermissions.js.map +1 -1
- package/chunks/usePurchaseOrders.js +4 -0
- package/chunks/usePurchaseOrders.js.map +1 -0
- package/containers/CompanyPurchaseOrders.js +1 -1
- package/containers/CompanyPurchaseOrders.js.map +1 -1
- package/containers/CustomerPurchaseOrders.js +1 -1
- package/containers/CustomerPurchaseOrders.js.map +1 -1
- package/containers/PurchaseOrderApprovalRulesList/PurchaseOrderApprovalRulesList.d.ts +5 -0
- package/containers/PurchaseOrderApprovalRulesList/index.d.ts +19 -0
- package/containers/PurchaseOrderApprovalRulesList.d.ts +3 -0
- package/containers/PurchaseOrderApprovalRulesList.js +4 -0
- package/containers/PurchaseOrderApprovalRulesList.js.map +1 -0
- package/containers/RequireApprovalPurchaseOrders.js +1 -1
- package/containers/RequireApprovalPurchaseOrders.js.map +1 -1
- package/containers/index.d.ts +1 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/useApprovalRulesList.d.ts +4 -0
- package/i18n/en_US.json.d.ts +7 -1
- package/mocks/index.d.ts +124 -0
- package/mocks/storybook/index.d.ts +1 -0
- package/package.json +1 -1
- package/render.js +1 -1
- package/render.js.map +1 -1
- package/types/components/purchaseOrdersTable.types.d.ts +6 -1
- package/types/containers/index.d.ts +1 -0
- package/types/containers/purchaseOrderApprovalRulesList.types.d.ts +15 -0
- package/types/hooks/index.d.ts +1 -0
- package/types/hooks/useApprovalRulesList.types.d.ts +29 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PurchaseOrderApprovalRuleModel } from '../../data/models';
|
|
2
|
+
|
|
3
|
+
export declare const getPurchaseOrderApprovalRules: (currentPage?: number, pageSize?: number) => Promise<{
|
|
4
|
+
totalCount: number;
|
|
5
|
+
pageInfo: {
|
|
6
|
+
currentPage: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
totalPages: number;
|
|
9
|
+
};
|
|
10
|
+
items: PurchaseOrderApprovalRuleModel[];
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=getPurchaseOrderApprovalRules.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export declare const GET_PURCHASE_ORDER_APPROVAL_RULES = "\n query GET_PURCHASE_ORDER_APPROVAL_RULES($currentPage: Int!, $pageSize: Int!) {\n customer {\n email\n purchase_order_approval_rules(\n currentPage: $currentPage\n pageSize: $pageSize\n ) {\n items {\n applies_to_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n children {\n id\n sort_order\n text\n }\n }\n }\n approver_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n children {\n id\n sort_order\n text\n }\n }\n }\n condition {\n attribute\n operator\n }\n created_at\n created_by\n description\n name\n status\n uid\n updated_at\n }\n total_count\n page_info {\n page_size\n current_page\n total_pages\n }\n }\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=getPurchaseOrderApprovalRules.graphql.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2025 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export * from './getPurchaseOrderApprovalRules';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
package/api/index.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ export * from './getPurchaseOrders';
|
|
|
30
30
|
export * from './placeOrderForPurchaseOrder';
|
|
31
31
|
export * from './placePurchaseOrder';
|
|
32
32
|
export * from './getPurchaseOrderApprovalRuleMetadata';
|
|
33
|
+
export * from './getPurchaseOrderApprovalRules';
|
|
33
34
|
//# sourceMappingURL=index.d.ts.map
|
package/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{Initializer as
|
|
3
|
+
import{Initializer as y}from"@dropins/tools/lib.js";import{f as a,h,a as R}from"./chunks/fetch-graphql.js";import{g as or,r as lr,s as cr,b as pr,c as ar}from"./chunks/fetch-graphql.js";import{P as d,t as v}from"./chunks/getPurchaseOrders.js";import{a as Rr,g as Er,r as Or}from"./chunks/getPurchaseOrders.js";import{t as S}from"./chunks/getPurchaseOrderApprovalRules.js";import{d as Pr,g as fr}from"./chunks/getPurchaseOrderApprovalRules.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/fetch-graphql.js";const w=new y({init:async e=>{const s={};w.config.setConfig({...s,...e})},listeners:()=>[]}),K=w.config,U=`
|
|
4
4
|
mutation CANCEL_PURCHASE_ORDERS($input: PurchaseOrdersActionInput!) {
|
|
5
5
|
cancelPurchaseOrders(input: $input) {
|
|
6
6
|
purchase_orders {
|
|
@@ -12,8 +12,8 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
${
|
|
16
|
-
`,
|
|
15
|
+
${d}
|
|
16
|
+
`,X=async e=>{const s=Array.isArray(e)?e:[e];if(!s||s.length===0)throw new Error("Purchase Order UID(s) are required");if(s.some(u=>!u||u.trim()===""))throw new Error("All Purchase Order UIDs must be valid");return a(U,{variables:{input:{purchase_order_uids:s}}}).then(u=>{var t,o,l;(t=u.errors)!=null&&t.length&&h(u.errors);const _=(o=u.data)==null?void 0:o.cancelPurchaseOrders;if(!_)throw new Error("Failed to cancel purchase orders");return{errors:((_==null?void 0:_.errors)??[]).map(n=>({message:(n==null?void 0:n.message)??"",type:(n==null?void 0:n.type)??""})),purchaseOrders:((l=_==null?void 0:_.purchase_orders)==null?void 0:l.map(n=>v(n)))??[]}}).catch(R)},T=`
|
|
17
17
|
mutation VALIDATE_PURCHASE_ORDERS($input: ValidatePurchaseOrdersInput!) {
|
|
18
18
|
validatePurchaseOrders(input: $input) {
|
|
19
19
|
errors {
|
|
@@ -25,8 +25,8 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
${
|
|
29
|
-
`,
|
|
28
|
+
${d}
|
|
29
|
+
`,Y=async e=>{const s=Array.isArray(e)?e:[e];if(!s||s.length===0)throw new Error("Purchase Order UID(s) are required");if(s.some(u=>!u||u.trim()===""))throw new Error("All Purchase Order UIDs must be valid");return a(T,{variables:{input:{purchase_order_uids:s}}}).then(u=>{var t,o;(t=u.errors)!=null&&t.length&&h(u.errors);const _=(o=u.data)==null?void 0:o.validatePurchaseOrders;return{errors:((_==null?void 0:_.errors)??[]).map(l=>({message:(l==null?void 0:l.message)??"",type:(l==null?void 0:l.type)??""})),purchaseOrders:((_==null?void 0:_.purchase_orders)||[]).map(v)}}).catch(R)},q=`
|
|
30
30
|
mutation ADD_PURCHASE_ORDER_COMMENT(
|
|
31
31
|
$purchaseOrderUid: ID!
|
|
32
32
|
$comment: String!
|
|
@@ -58,7 +58,7 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`,x=e=>{var i,u,_,t,o,l,n,p,O,A,P,f,g,E,b;const s=((u=(i=e==null?void 0:e.cart)==null?void 0:i.itemsV2)==null?void 0:u.items)??[];return{cart:{id:((_=e==null?void 0:e.cart)==null?void 0:_.id)??"",items:s.map(c=>{var r,D,C;return{uid:(c==null?void 0:c.uid)??"",quantity:(c==null?void 0:c.quantity)??0,product:{uid:((r=c==null?void 0:c.product)==null?void 0:r.uid)??"",name:((D=c==null?void 0:c.product)==null?void 0:D.name)??"",sku:((C=c==null?void 0:c.product)==null?void 0:C.sku)??""}}}),pagination:{currentPage:((l=(o=(t=e==null?void 0:e.cart)==null?void 0:t.itemsV2)==null?void 0:o.page_info)==null?void 0:l.current_page)??1,pageSize:((O=(p=(n=e==null?void 0:e.cart)==null?void 0:n.itemsV2)==null?void 0:p.page_info)==null?void 0:O.page_size)??20,totalPages:((f=(P=(A=e==null?void 0:e.cart)==null?void 0:A.itemsV2)==null?void 0:P.page_info)==null?void 0:f.total_pages)??0,totalCount:((E=(g=e==null?void 0:e.cart)==null?void 0:g.itemsV2)==null?void 0:E.total_count)??0}},userErrors:((b=e==null?void 0:e.user_errors)==null?void 0:b.map(c=>({message:(c==null?void 0:c.message)??""})))??[]}},H=e=>{var b,c;const s=(c=(b=e.data)==null?void 0:b.placeOrderForPurchaseOrder)==null?void 0:c.order,i=r=>({value:(r==null?void 0:r.value)||0,currency:(r==null?void 0:r.currency)||""}),u=r=>({code:(r==null?void 0:r.code)||"",label:(r==null?void 0:r.label)||""}),_=r=>({code:(r==null?void 0:r.code)||"",appliedBalance:i(r==null?void 0:r.applied_balance),currentBalance:i(r==null?void 0:r.current_balance)}),t=r=>({firstname:(r==null?void 0:r.firstname)||"",lastname:(r==null?void 0:r.lastname)||"",street:(r==null?void 0:r.street)||[],city:(r==null?void 0:r.city)||"",region:(r==null?void 0:r.region)||"",postcode:(r==null?void 0:r.postcode)||"",countryCode:(r==null?void 0:r.country_code)||"",telephone:(r==null?void 0:r.telephone)||"",company:(r==null?void 0:r.company)||""}),o=r=>({name:(r==null?void 0:r.name)||"",type:(r==null?void 0:r.type)||"",additionalData:(r==null?void 0:r.additional_data)||{}}),l=r=>({id:(r==null?void 0:r.id)||"",productName:(r==null?void 0:r.product_name)||"",productSku:(r==null?void 0:r.product_sku)||"",quantityOrdered:(r==null?void 0:r.quantity_ordered)||0,quantityShipped:(r==null?void 0:r.quantity_shipped)||0,quantityInvoiced:(r==null?void 0:r.quantity_invoiced)||0,quantityRefunded:(r==null?void 0:r.quantity_refunded)||0,price:i(r==null?void 0:r.price),total:i(r==null?void 0:r.total)}),n=r=>({number:(r==null?void 0:r.number)||"",carrier:(r==null?void 0:r.carrier)||"",title:(r==null?void 0:r.title)||""}),p=r=>({message:(r==null?void 0:r.message)||"",timestamp:(r==null?void 0:r.timestamp)||""}),O=r=>({id:(r==null?void 0:r.id)||"",productName:(r==null?void 0:r.product_name)||"",productSku:(r==null?void 0:r.product_sku)||"",quantityShipped:(r==null?void 0:r.quantity_shipped)||0}),A=r=>({id:(r==null?void 0:r.id)||"",number:(r==null?void 0:r.number)||"",tracking:((r==null?void 0:r.tracking)||[]).map(n),comments:((r==null?void 0:r.comments)||[]).map(p),items:((r==null?void 0:r.items)||[]).map(O)}),P=r=>({firstname:(r==null?void 0:r.firstname)||"",lastname:(r==null?void 0:r.lastname)||"",email:(r==null?void 0:r.email)||""}),f=r=>({label:(r==null?void 0:r.label)||"",amount:i(r==null?void 0:r.amount)}),g=r=>({baseGrandTotal:i(r==null?void 0:r.base_grand_total),grandTotal:i(r==null?void 0:r.grand_total),subtotal:i(r==null?void 0:r.subtotal),totalTax:i(r==null?void 0:r.total_tax),totalShipping:i(r==null?void 0:r.total_shipping),discounts:((r==null?void 0:r.discounts)||[]).map(f)}),E=r=>({appliedCoupons:((r==null?void 0:r.applied_coupons)||[]).map(u),appliedGiftCards:((r==null?void 0:r.applied_gift_cards)||[]).map(_),availableActions:(r==null?void 0:r.available_actions)||[],billingAddress:r!=null&&r.billing_address?t(r.billing_address):{firstname:"",lastname:"",street:[],city:"",region:"",postcode:"",countryCode:"",telephone:"",company:""},carrier:(r==null?void 0:r.carrier)||"",comments:(r==null?void 0:r.comments)||[],creditMemos:(r==null?void 0:r.credit_memos)||[],customAttributes:(r==null?void 0:r.custom_attributes)||[],customerInfo:r!=null&&r.customer_info?P(r.customer_info):{firstname:"",lastname:"",email:""},email:(r==null?void 0:r.email)||"",giftMessage:(r==null?void 0:r.gift_message)||"",giftReceiptIncluded:(r==null?void 0:r.gift_receipt_included)||!1,giftWrapping:(r==null?void 0:r.gift_wrapping)||null,id:(r==null?void 0:r.id)||"",invoices:(r==null?void 0:r.invoices)||[],isVirtual:(r==null?void 0:r.is_virtual)||!1,items:((r==null?void 0:r.items)||[]).map(l),itemsEligibleForReturn:(r==null?void 0:r.items_eligible_for_return)||[],number:(r==null?void 0:r.number)||"",orderDate:(r==null?void 0:r.order_date)||"",orderStatusChangeDate:(r==null?void 0:r.order_status_change_date)||"",paymentMethods:((r==null?void 0:r.payment_methods)||[]).map(o),printedCardIncluded:(r==null?void 0:r.printed_card_included)||!1,returns:(r==null?void 0:r.returns)||null,shipments:((r==null?void 0:r.shipments)||[]).map(A),shippingAddress:r!=null&&r.shipping_address?t(r.shipping_address):{firstname:"",lastname:"",street:[],city:"",region:"",postcode:"",countryCode:"",telephone:"",company:""},shippingMethod:(r==null?void 0:r.shipping_method)||"",status:(r==null?void 0:r.status)||"",token:(r==null?void 0:r.token)||"",total:r!=null&&r.total?g(r.total):{baseGrandTotal:i(null),grandTotal:i(null),subtotal:i(null),totalTax:i(null),totalShipping:i(null),discounts:[]}});return E(s||null)},$=e=>{var o,l;const s=(l=(o=e==null?void 0:e.data)==null?void 0:o.customer)==null?void 0:l.purchase_order_approval_rule_metadata,i=n=>{var p;return{id:(n==null?void 0:n.id)||"",sortOrder:(n==null?void 0:n.sort_order)||0,text:(n==null?void 0:n.text)||"",children:((p=n==null?void 0:n.children)==null?void 0:p.map(i))||void 0}},u=n=>({id:(n==null?void 0:n.id)||"",name:(n==null?void 0:n.name)||"",usersCount:(n==null?void 0:n.users_count)||0,permissions:((n==null?void 0:n.permissions)||[]).map(i)}),_=((s==null?void 0:s.available_applies_to)||[]).map(u),t=((s==null?void 0:s.available_requires_approval_from)||[]).map(u);return{availableAppliesTo:_,availableRequiresApprovalFrom:t}},I=e=>{var s,i,u,_,t,o,l,n,p,O,A,P,f,g,E;return{createdAt:(e==null?void 0:e.created_at)??"",text:(e==null?void 0:e.text)??"",uid:(e==null?void 0:e.uid)??"",author:{allowRemoteShoppingAssistance:((s=e==null?void 0:e.author)==null?void 0:s.allow_remote_shopping_assistance)??!1,confirmationStatus:((i=e==null?void 0:e.author)==null?void 0:i.confirmation_status)??"",createdAt:((u=e==null?void 0:e.author)==null?void 0:u.created_at)??"",dateOfBirth:((_=e==null?void 0:e.author)==null?void 0:_.date_of_birth)??"",email:((t=e==null?void 0:e.author)==null?void 0:t.email)??"",firstname:((o=e==null?void 0:e.author)==null?void 0:o.firstname)??"",gender:((l=e==null?void 0:e.author)==null?void 0:l.gender)??0,jobTitle:((n=e==null?void 0:e.author)==null?void 0:n.job_title)??"",lastname:((p=e==null?void 0:e.author)==null?void 0:p.lastname)??"",middlename:((O=e==null?void 0:e.author)==null?void 0:O.middlename)??"",prefix:((A=e==null?void 0:e.author)==null?void 0:A.prefix)??"",status:((P=e==null?void 0:e.author)==null?void 0:P.status)??"",structureId:((f=e==null?void 0:e.author)==null?void 0:f.structure_id)??"",suffix:((g=e==null?void 0:e.author)==null?void 0:g.suffix)??"",telephone:((E=e==null?void 0:e.author)==null?void 0:E.telephone)??""}}},Z=async(e,s)=>{if(!e)throw new Error("Purchase Order ID is required");if(!s)throw new Error("Comment text is required");return a(q,{variables:{purchaseOrderUid:e,comment:s}}).then(u=>{var _,t,o;return(_=u.errors)!=null&&_.length&&h(u.errors),I((o=(t=u.data)==null?void 0:t.addPurchaseOrderComment)==null?void 0:o.comment)}).catch(R)},F=`
|
|
62
62
|
mutation ADD_PURCHASE_ORDER_ITEMS_TO_CART(
|
|
63
63
|
$purchaseOrderUid: ID!
|
|
64
64
|
$cartId: String!
|
|
@@ -93,7 +93,7 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`,
|
|
96
|
+
`,m=async(e,s,i=!1)=>{if(!e)throw new Error("Purchase Order UID is required");if(!s)throw new Error("Cart ID is required");return a(F,{variables:{purchaseOrderUid:e,cartId:s,replaceExistingCartItems:i}}).then(_=>{var o,l;(o=_.errors)!=null&&o.length&&h(_.errors);const t=(l=_.data)==null?void 0:l.addPurchaseOrderItemsToCart;if(!(t!=null&&t.cart))throw new Error("Failed to add purchase order items to cart");return x(t)}).catch(R)},L=`
|
|
97
97
|
mutation CREATE_PURCHASE_ORDER_APPROVAL_RULE(
|
|
98
98
|
$input: PurchaseOrderApprovalRuleInput!
|
|
99
99
|
) {
|
|
@@ -131,18 +131,7 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
`,
|
|
135
|
-
mutation DELETE_PURCHASE_ORDER_APPROVAL_RULE(
|
|
136
|
-
$input: DeletePurchaseOrderApprovalRuleInput!
|
|
137
|
-
) {
|
|
138
|
-
deletePurchaseOrderApprovalRule(input: $input) {
|
|
139
|
-
errors {
|
|
140
|
-
message
|
|
141
|
-
type
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
`,rr=async e=>{const u=Array.isArray(e)?e:[e];if(!u||u.length===0)throw new Error("Approval Rule UID(s) are required");if(u.some(s=>!s||s.trim()===""))throw new Error("All Approval Rule UIDs must be valid");return a(M,{variables:{input:{approval_rule_uids:u}}}).then(s=>{var c,h,_;if((c=s.errors)!=null&&c.length&&p(s.errors),!((h=s.data)==null?void 0:h.deletePurchaseOrderApprovalRule))throw new Error("Failed to delete purchase order approval rule");const n=(_=s==null?void 0:s.data)==null?void 0:_.deletePurchaseOrderApprovalRule;return{deletePurchaseOrderApprovalRule:{errors:((n==null?void 0:n.errors)??[]).map(l=>({message:l==null?void 0:l.message,type:l==null?void 0:l.type}))}}}).catch(E)},V=`
|
|
134
|
+
`,rr=async e=>{if(!e.name||e.name.trim()==="")throw new Error("Rule name is required");return a(L,{variables:{input:e}}).then(s=>{var u,_;if((u=s.errors)!=null&&u.length&&h(s.errors),!((_=s.data)==null?void 0:_.createPurchaseOrderApprovalRule))throw new Error("Failed to create purchase order approval rule");return S(s.data.createPurchaseOrderApprovalRule)}).catch(R)},M=`
|
|
146
135
|
mutation UPDATE_PURCHASE_ORDER_APPROVAL_RULE(
|
|
147
136
|
$input: UpdatePurchaseOrderApprovalRuleInput!
|
|
148
137
|
) {
|
|
@@ -180,7 +169,7 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
180
169
|
}
|
|
181
170
|
}
|
|
182
171
|
}
|
|
183
|
-
`,er=async e=>{if(!e.uid||e.uid.trim()==="")throw new Error("Approval Rule UID is required");return a(
|
|
172
|
+
`,er=async e=>{if(!e.uid||e.uid.trim()==="")throw new Error("Approval Rule UID is required");return a(M,{variables:{input:e}}).then(s=>{var i,u;return(i=s.errors)!=null&&i.length&&h(s.errors),S(((u=s.data)==null?void 0:u.updatePurchaseOrderApprovalRule)||{})}).catch(R)},G=`
|
|
184
173
|
query GET_PURCHASE_ORDER($uid: ID!) {
|
|
185
174
|
customer {
|
|
186
175
|
purchase_order(uid: $uid) {
|
|
@@ -216,7 +205,7 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
216
205
|
}
|
|
217
206
|
}
|
|
218
207
|
}
|
|
219
|
-
`,sr=async e=>{if(!e||e.trim()==="")throw new Error("Purchase Order UID is required");return a(G,{variables:{uid:e}}).then(
|
|
208
|
+
`,sr=async e=>{if(!e||e.trim()==="")throw new Error("Purchase Order UID is required");return a(G,{variables:{uid:e}}).then(s=>{var u,_,t;(u=s.errors)!=null&&u.length&&h(s.errors);const i=(t=(_=s.data)==null?void 0:_.customer)==null?void 0:t.purchase_order;if(!i)throw new Error("Failed to get purchase order");return{purchaseOrder:v(i)}}).catch(R)},V=`
|
|
220
209
|
mutation PLACE_ORDER_FOR_PURCHASE_ORDER(
|
|
221
210
|
$input: PlaceOrderForPurchaseOrderInput!
|
|
222
211
|
) {
|
|
@@ -238,7 +227,7 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
238
227
|
}
|
|
239
228
|
}
|
|
240
229
|
}
|
|
241
|
-
`,ur=async e=>{var i;if(!e||e.trim()==="")throw new Error("Purchase Order UID is required");const
|
|
230
|
+
`,ur=async e=>{var i;if(!e||e.trim()==="")throw new Error("Purchase Order UID is required");const s={purchase_order_uid:e};try{const u=await a(V,{variables:{input:s}});return(i=u.errors)!=null&&i.length&&h(u.errors),H(u)}catch(u){throw R(u)}},N=`
|
|
242
231
|
mutation PLACE_PURCHASE_ORDER($input: PlacePurchaseOrderInput!) {
|
|
243
232
|
placePurchaseOrder(input: $input) {
|
|
244
233
|
purchase_order {
|
|
@@ -246,8 +235,8 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
246
235
|
}
|
|
247
236
|
}
|
|
248
237
|
}
|
|
249
|
-
${
|
|
250
|
-
`,
|
|
238
|
+
${d}
|
|
239
|
+
`,ir=async e=>{if(!e||e.trim()==="")throw new Error("Cart ID is required");return a(N,{variables:{input:{cart_id:e}}}).then(i=>{var _,t,o;(_=i.errors)!=null&&_.length&&h(i.errors);const u=(o=(t=i.data)==null?void 0:t.placePurchaseOrder)==null?void 0:o.purchase_order;return{purchaseOrder:v(u)}}).catch(R)},z=`
|
|
251
240
|
query GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA {
|
|
252
241
|
customer {
|
|
253
242
|
purchase_order_approval_rule_metadata {
|
|
@@ -284,5 +273,5 @@ import{Initializer as U}from"@dropins/tools/lib.js";import{P as D,f as a,h as p,
|
|
|
284
273
|
}
|
|
285
274
|
}
|
|
286
275
|
}
|
|
287
|
-
`,
|
|
276
|
+
`,nr=async()=>a(z,{variables:{}}).then(e=>{var s;return(s=e.errors)!=null&&s.length&&h(e.errors),$(e)}).catch(R);export{Z as addPurchaseOrderComment,m as addPurchaseOrderItemsToCart,Rr as approvePurchaseOrders,X as cancelPurchaseOrders,K as config,rr as createPurchaseOrderApprovalRule,Pr as deletePurchaseOrderApprovalRule,a as fetchGraphQl,or as getConfig,sr as getPurchaseOrder,nr as getPurchaseOrderApprovalRuleMetadata,fr as getPurchaseOrderApprovalRules,Er as getPurchaseOrders,w as initialize,ur as placeOrderForPurchaseOrder,ir as placePurchaseOrder,Or as rejectPurchaseOrders,lr as removeFetchGraphQlHeader,cr as setEndpoint,pr as setFetchGraphQlHeader,ar as setFetchGraphQlHeaders,er as updatePurchaseOrderApprovalRule,Y as validatePurchaseOrders};
|
|
288
277
|
//# sourceMappingURL=api.js.map
|
package/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["/@dropins/storefront-purchase-order/src/api/initialize/initialize.ts","/@dropins/storefront-purchase-order/src/api/cancelPurchaseOrders/graphql/cancelPurchaseOrders.graphql.ts","/@dropins/storefront-purchase-order/src/api/cancelPurchaseOrders/cancelPurchaseOrders.ts","/@dropins/storefront-purchase-order/src/api/validatePurchaseOrders/graphql/validatePurchaseOrders.graphql.ts","/@dropins/storefront-purchase-order/src/api/validatePurchaseOrders/validatePurchaseOrders.ts","/@dropins/storefront-purchase-order/src/api/addPurchaseOrderComment/graphql/addPurchaseOrderComment.graphql.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-cart.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-customer-order.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-purchase-order-approval-rule-metadata.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-purchase-order-approval-rule.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-purchase-order-comment.ts","/@dropins/storefront-purchase-order/src/api/addPurchaseOrderComment/addPurchaseOrderComment.ts","/@dropins/storefront-purchase-order/src/api/addPurchaseOrderItemsToCart/graphql/addPurchaseOrderItemsToCart.graphql.ts","/@dropins/storefront-purchase-order/src/api/addPurchaseOrderItemsToCart/addPurchaseOrderItemsToCart.ts","/@dropins/storefront-purchase-order/src/api/createPurchaseOrderApprovalRule/graphql/createPurchaseOrderApprovalRule.graphql.ts","/@dropins/storefront-purchase-order/src/api/createPurchaseOrderApprovalRule/createPurchaseOrderApprovalRule.ts","/@dropins/storefront-purchase-order/src/api/deletePurchaseOrderApprovalRule/graphql/deletePurchaseOrderApprovalRule.graphql.ts","/@dropins/storefront-purchase-order/src/api/deletePurchaseOrderApprovalRule/deletePurchaseOrderApprovalRule.ts","/@dropins/storefront-purchase-order/src/api/updatePurchaseOrderApprovalRule/graphql/updatePurchaseOrderApprovalRule.graphql.ts","/@dropins/storefront-purchase-order/src/api/updatePurchaseOrderApprovalRule/updatePurchaseOrderApprovalRule.ts","/@dropins/storefront-purchase-order/src/api/getPurchaseOrder/graphql/getPurchaseOrder.graphql.ts","/@dropins/storefront-purchase-order/src/api/getPurchaseOrder/getPurchaseOrder.ts","/@dropins/storefront-purchase-order/src/api/placeOrderForPurchaseOrder/graphql/placeOrderForPurchaseOrder.graphql.ts","/@dropins/storefront-purchase-order/src/api/placeOrderForPurchaseOrder/placeOrderForPurchaseOrder.ts","/@dropins/storefront-purchase-order/src/api/placePurchaseOrder/graphql/placePurchaseOrder.graphql.ts","/@dropins/storefront-purchase-order/src/api/placePurchaseOrder/placePurchaseOrder.ts","/@dropins/storefront-purchase-order/src/api/getPurchaseOrderApprovalRuleMetadata/graphql/getPurchaseOrderApprovalRuleMetadata.graphql.ts","/@dropins/storefront-purchase-order/src/api/getPurchaseOrderApprovalRuleMetadata/getPurchaseOrderApprovalRuleMetadata.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PURCHASE_ORDERS_FRAGMENT } from '@/b2b-purchase-order/api/graphql/PurchaseOrdersFragment.graphql';\n\nexport const CANCEL_PURCHASE_ORDERS = /* GraphQL */ `\n mutation CANCEL_PURCHASE_ORDERS($input: PurchaseOrdersActionInput!) {\n cancelPurchaseOrders(input: $input) {\n purchase_orders {\n ...PURCHASE_ORDERS_FRAGMENT\n }\n errors {\n message\n type\n }\n }\n }\n ${PURCHASE_ORDERS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { CANCEL_PURCHASE_ORDERS } from '@/b2b-purchase-order/api/cancelPurchaseOrders/graphql/cancelPurchaseOrders.graphql';\nimport { transformPurchaseOrder } from '@/b2b-purchase-order/data/transforms/transform-purchase-order';\nimport { PurchaseOrderModel } from '@/b2b-purchase-order/data/models';\n\nexport const cancelPurchaseOrders = async (\n uids: string | string[]\n): Promise<{\n errors: { message: string; type: string }[];\n purchaseOrders: PurchaseOrderModel[];\n}> => {\n const uidArray = Array.isArray(uids) ? uids : [uids];\n\n if (!uidArray || uidArray.length === 0) {\n throw new Error('Purchase Order UID(s) are required');\n }\n\n if (uidArray.some((uid) => !uid || uid.trim() === '')) {\n throw new Error('All Purchase Order UIDs must be valid');\n }\n\n const input = {\n purchase_order_uids: uidArray,\n };\n\n return fetchGraphQl(CANCEL_PURCHASE_ORDERS, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const data = response.data?.cancelPurchaseOrders;\n if (!data) {\n throw new Error('Failed to cancel purchase orders');\n }\n\n return {\n errors: (data?.errors ?? []).map((error: any) => ({\n message: error?.message ?? '',\n type: error?.type ?? '',\n })),\n purchaseOrders:\n data?.purchase_orders?.map((order: any) =>\n transformPurchaseOrder(order)\n ) ?? [],\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PURCHASE_ORDERS_FRAGMENT } from '@/b2b-purchase-order/api/graphql/PurchaseOrdersFragment.graphql';\n\nexport const VALIDATE_PURCHASE_ORDERS = /* GraphQL */ `\n mutation VALIDATE_PURCHASE_ORDERS($input: ValidatePurchaseOrdersInput!) {\n validatePurchaseOrders(input: $input) {\n errors {\n message\n type\n }\n purchase_orders {\n ...PURCHASE_ORDERS_FRAGMENT\n }\n }\n }\n ${PURCHASE_ORDERS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { VALIDATE_PURCHASE_ORDERS } from '@/b2b-purchase-order/api/validatePurchaseOrders/graphql/validatePurchaseOrders.graphql';\nimport { PurchaseOrderModel } from '@/b2b-purchase-order/data/models';\nimport { transformPurchaseOrder } from '@/b2b-purchase-order/data/transforms/transform-purchase-order';\n\nexport const validatePurchaseOrders = async (\n uids: string | string[]\n): Promise<{\n errors: { message: string; type: string }[];\n purchaseOrders: PurchaseOrderModel[];\n}> => {\n const uidArray = Array.isArray(uids) ? uids : [uids];\n\n if (!uidArray || uidArray.length === 0) {\n throw new Error('Purchase Order UID(s) are required');\n }\n\n if (uidArray.some((uid) => !uid || uid.trim() === '')) {\n throw new Error('All Purchase Order UIDs must be valid');\n }\n\n const input = {\n purchase_order_uids: uidArray,\n };\n\n return fetchGraphQl(VALIDATE_PURCHASE_ORDERS, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const data = response.data?.validatePurchaseOrders;\n\n return {\n errors: (data?.errors ?? []).map((error: any) => ({\n message: error?.message ?? '',\n type: error?.type ?? '',\n })),\n purchaseOrders: (data?.purchase_orders || []).map(\n transformPurchaseOrder\n ),\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_PURCHASE_ORDER_COMMENT = /* GraphQL */ `\n mutation ADD_PURCHASE_ORDER_COMMENT(\n $purchaseOrderUid: ID!\n $comment: String!\n ) {\n addPurchaseOrderComment(\n input: { purchase_order_uid: $purchaseOrderUid, comment: $comment }\n ) {\n comment {\n created_at\n text\n uid\n author {\n allow_remote_shopping_assistance\n confirmation_status\n created_at\n date_of_birth\n email\n firstname\n gender\n job_title\n lastname\n middlename\n prefix\n status\n structure_id\n suffix\n telephone\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CartModel } from '@/b2b-purchase-order/data/models';\n\nexport const transformCart = (data: any): CartModel => {\n const cartItems = data?.cart?.itemsV2?.items ?? [];\n\n return {\n cart: {\n id: data?.cart?.id ?? '',\n items: cartItems.map((item: any) => ({\n uid: item?.uid ?? '',\n quantity: item?.quantity ?? 0,\n product: {\n uid: item?.product?.uid ?? '',\n name: item?.product?.name ?? '',\n sku: item?.product?.sku ?? '',\n },\n })),\n pagination: {\n currentPage: data?.cart?.itemsV2?.page_info?.current_page ?? 1,\n pageSize: data?.cart?.itemsV2?.page_info?.page_size ?? 20,\n totalPages: data?.cart?.itemsV2?.page_info?.total_pages ?? 0,\n totalCount: data?.cart?.itemsV2?.total_count ?? 0,\n },\n },\n userErrors:\n data?.user_errors?.map((error: any) => ({\n message: error?.message ?? '',\n })) ?? [],\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n CustomerOrderModel,\n Money,\n Coupon,\n GiftCard,\n CustomerAddress,\n PaymentMethod,\n OrderItem,\n Shipment,\n ShipmentTracking,\n ShipmentComment,\n ShipmentItem,\n CustomerInfo,\n OrderTotal,\n OrderDiscount,\n} from '@/b2b-purchase-order/data/models/customer-order-model';\n\nexport const transformCustomerOrder = (response: any): CustomerOrderModel => {\n const orderData = response.data?.placeOrderForPurchaseOrder?.order;\n\n const transformMoney = (money: any): Money => ({\n value: money?.value || 0,\n currency: money?.currency || '',\n });\n\n const transformCoupon = (coupon: any): Coupon => ({\n code: coupon?.code || '',\n label: coupon?.label || '',\n });\n\n const transformGiftCard = (giftCard: any): GiftCard => ({\n code: giftCard?.code || '',\n appliedBalance: transformMoney(giftCard?.applied_balance),\n currentBalance: transformMoney(giftCard?.current_balance),\n });\n\n const transformAddress = (address: any): CustomerAddress => ({\n firstname: address?.firstname || '',\n lastname: address?.lastname || '',\n street: address?.street || [],\n city: address?.city || '',\n region: address?.region || '',\n postcode: address?.postcode || '',\n countryCode: address?.country_code || '',\n telephone: address?.telephone || '',\n company: address?.company || '',\n });\n\n const transformPaymentMethod = (payment: any): PaymentMethod => ({\n name: payment?.name || '',\n type: payment?.type || '',\n additionalData: payment?.additional_data || {},\n });\n\n const transformOrderItem = (item: any): OrderItem => ({\n id: item?.id || '',\n productName: item?.product_name || '',\n productSku: item?.product_sku || '',\n quantityOrdered: item?.quantity_ordered || 0,\n quantityShipped: item?.quantity_shipped || 0,\n quantityInvoiced: item?.quantity_invoiced || 0,\n quantityRefunded: item?.quantity_refunded || 0,\n price: transformMoney(item?.price),\n total: transformMoney(item?.total),\n });\n\n const transformShipmentTracking = (tracking: any): ShipmentTracking => ({\n number: tracking?.number || '',\n carrier: tracking?.carrier || '',\n title: tracking?.title || '',\n });\n\n const transformShipmentComment = (comment: any): ShipmentComment => ({\n message: comment?.message || '',\n timestamp: comment?.timestamp || '',\n });\n\n const transformShipmentItem = (item: any): ShipmentItem => ({\n id: item?.id || '',\n productName: item?.product_name || '',\n productSku: item?.product_sku || '',\n quantityShipped: item?.quantity_shipped || 0,\n });\n\n const transformShipment = (shipment: any): Shipment => ({\n id: shipment?.id || '',\n number: shipment?.number || '',\n tracking: (shipment?.tracking || []).map(transformShipmentTracking),\n comments: (shipment?.comments || []).map(transformShipmentComment),\n items: (shipment?.items || []).map(transformShipmentItem),\n });\n\n const transformCustomerInfo = (customerInfo: any): CustomerInfo => ({\n firstname: customerInfo?.firstname || '',\n lastname: customerInfo?.lastname || '',\n email: customerInfo?.email || '',\n });\n\n const transformOrderDiscount = (discount: any): OrderDiscount => ({\n label: discount?.label || '',\n amount: transformMoney(discount?.amount),\n });\n\n const transformOrderTotal = (total: any): OrderTotal => ({\n baseGrandTotal: transformMoney(total?.base_grand_total),\n grandTotal: transformMoney(total?.grand_total),\n subtotal: transformMoney(total?.subtotal),\n totalTax: transformMoney(total?.total_tax),\n totalShipping: transformMoney(total?.total_shipping),\n discounts: (total?.discounts || []).map(transformOrderDiscount),\n });\n\n const transformOrderData = (data: any): CustomerOrderModel => ({\n appliedCoupons: (data?.applied_coupons || []).map(transformCoupon),\n appliedGiftCards: (data?.applied_gift_cards || []).map(transformGiftCard),\n availableActions: data?.available_actions || [],\n billingAddress: data?.billing_address\n ? transformAddress(data.billing_address)\n : {\n firstname: '',\n lastname: '',\n street: [],\n city: '',\n region: '',\n postcode: '',\n countryCode: '',\n telephone: '',\n company: '',\n },\n carrier: data?.carrier || '',\n comments: data?.comments || [],\n creditMemos: data?.credit_memos || [],\n customAttributes: data?.custom_attributes || [],\n customerInfo: data?.customer_info\n ? transformCustomerInfo(data.customer_info)\n : {\n firstname: '',\n lastname: '',\n email: '',\n },\n email: data?.email || '',\n giftMessage: data?.gift_message || '',\n giftReceiptIncluded: data?.gift_receipt_included || false,\n giftWrapping: data?.gift_wrapping || null,\n id: data?.id || '',\n invoices: data?.invoices || [],\n isVirtual: data?.is_virtual || false,\n items: (data?.items || []).map(transformOrderItem),\n itemsEligibleForReturn: data?.items_eligible_for_return || [],\n number: data?.number || '',\n orderDate: data?.order_date || '',\n orderStatusChangeDate: data?.order_status_change_date || '',\n paymentMethods: (data?.payment_methods || []).map(transformPaymentMethod),\n printedCardIncluded: data?.printed_card_included || false,\n returns: data?.returns || null,\n shipments: (data?.shipments || []).map(transformShipment),\n shippingAddress: data?.shipping_address\n ? transformAddress(data.shipping_address)\n : {\n firstname: '',\n lastname: '',\n street: [],\n city: '',\n region: '',\n postcode: '',\n countryCode: '',\n telephone: '',\n company: '',\n },\n shippingMethod: data?.shipping_method || '',\n status: data?.status || '',\n token: data?.token || '',\n total: data?.total\n ? transformOrderTotal(data.total)\n : {\n baseGrandTotal: transformMoney(null),\n grandTotal: transformMoney(null),\n subtotal: transformMoney(null),\n totalTax: transformMoney(null),\n totalShipping: transformMoney(null),\n discounts: [],\n },\n });\n\n return orderData ? transformOrderData(orderData) : transformOrderData(null);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n PurchaseOrderApprovalRuleMetadataModel,\n CompanyRolePermissionsTree,\n CompanyRole,\n} from '@/b2b-purchase-order/data/models/purchase-order-approval-rule-metadata-model';\n\nexport const transformPurchaseOrderApprovalRuleMetadata = (\n response: any\n): PurchaseOrderApprovalRuleMetadataModel => {\n const metadata =\n response?.data?.customer?.purchase_order_approval_rule_metadata;\n\n const transformCompanyRolePermission = (\n permission: any\n ): CompanyRolePermissionsTree => ({\n id: permission?.id || '',\n sortOrder: permission?.sort_order || 0,\n text: permission?.text || '',\n children:\n permission?.children?.map(transformCompanyRolePermission) || undefined,\n });\n\n const transformCompanyRole = (role: any): CompanyRole => ({\n id: role?.id || '',\n name: role?.name || '',\n usersCount: role?.users_count || 0,\n permissions: (role?.permissions || []).map(transformCompanyRolePermission),\n });\n\n const availableAppliesTo = (metadata?.available_applies_to || []).map(\n transformCompanyRole\n );\n\n const availableRequiresApprovalFrom = (\n metadata?.available_requires_approval_from || []\n ).map(transformCompanyRole);\n\n return {\n availableAppliesTo,\n availableRequiresApprovalFrom,\n };\n};\n","import { PurchaseOrderApprovalRuleModel } from '../models/purchase-order-approval-rule-model';\n\nexport const transformPurchaseOrderApprovalRule = (\n approvalRule: any\n): PurchaseOrderApprovalRuleModel => {\n // Transform company role helper function\n const transformCompanyRole = (role: any) => ({\n id: role?.id || '',\n name: role?.name || '',\n usersCount: role?.users_count || 0,\n permissions: (role?.permissions || []).map((permission: any) => ({\n id: permission?.id || '',\n sortOrder: permission?.sort_order || 0,\n text: permission?.text || '',\n })),\n });\n\n // Transform condition helper function\n const transformCondition = (condition: any) => ({\n attribute: condition?.attribute,\n operator: condition?.operator,\n });\n\n return {\n uid: approvalRule?.uid || '',\n name: approvalRule?.name || '',\n description: approvalRule?.description || '',\n status: approvalRule?.status,\n createdAt: approvalRule?.created_at || '',\n updatedAt: approvalRule?.updated_at || '',\n createdBy: approvalRule?.created_by,\n appliesToRoles: (approvalRule?.applies_to_roles || []).map(\n transformCompanyRole\n ),\n approverRoles: (approvalRule?.approver_roles || []).map(\n transformCompanyRole\n ),\n condition: transformCondition(approvalRule?.condition || {}),\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PurchaseOrderCommentModel } from '@/b2b-purchase-order/data/models';\n\nexport const transformPurchaseOrderComment = (\n comment: any\n): PurchaseOrderCommentModel => {\n return {\n createdAt: comment?.created_at ?? '',\n text: comment?.text ?? '',\n uid: comment?.uid ?? '',\n author: {\n allowRemoteShoppingAssistance:\n comment?.author?.allow_remote_shopping_assistance ?? false,\n confirmationStatus: comment?.author?.confirmation_status ?? '',\n createdAt: comment?.author?.created_at ?? '',\n dateOfBirth: comment?.author?.date_of_birth ?? '',\n email: comment?.author?.email ?? '',\n firstname: comment?.author?.firstname ?? '',\n gender: comment?.author?.gender ?? 0,\n jobTitle: comment?.author?.job_title ?? '',\n lastname: comment?.author?.lastname ?? '',\n middlename: comment?.author?.middlename ?? '',\n prefix: comment?.author?.prefix ?? '',\n status: comment?.author?.status ?? '',\n structureId: comment?.author?.structure_id ?? '',\n suffix: comment?.author?.suffix ?? '',\n telephone: comment?.author?.telephone ?? '',\n },\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { ADD_PURCHASE_ORDER_COMMENT } from '@/b2b-purchase-order/api/addPurchaseOrderComment/graphql/addPurchaseOrderComment.graphql';\nimport { transformPurchaseOrderComment } from '@/b2b-purchase-order/data/transforms';\nimport { PurchaseOrderCommentModel } from '@/b2b-purchase-order/data/models';\n\nexport const addPurchaseOrderComment = async (\n uid: string,\n comment: string\n): Promise<PurchaseOrderCommentModel> => {\n if (!uid) {\n throw new Error('Purchase Order ID is required');\n }\n\n if (!comment) {\n throw new Error('Comment text is required');\n }\n\n const variables = {\n purchaseOrderUid: uid,\n comment,\n };\n\n return fetchGraphQl(ADD_PURCHASE_ORDER_COMMENT, {\n variables,\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n return transformPurchaseOrderComment(\n response.data?.addPurchaseOrderComment?.comment\n );\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_PURCHASE_ORDER_ITEMS_TO_CART = /* GraphQL */ `\n mutation ADD_PURCHASE_ORDER_ITEMS_TO_CART(\n $purchaseOrderUid: ID!\n $cartId: String!\n $replaceExistingCartItems: Boolean!\n ) {\n addPurchaseOrderItemsToCart(\n input: {\n purchase_order_uid: $purchaseOrderUid\n cart_id: $cartId\n replace_existing_cart_items: $replaceExistingCartItems\n }\n ) {\n cart {\n id\n itemsV2 {\n items {\n uid\n quantity\n product {\n uid\n name\n sku\n }\n }\n page_info {\n current_page\n page_size\n total_pages\n }\n total_count\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { transformCart } from '@/b2b-purchase-order/data/transforms';\nimport { ADD_PURCHASE_ORDER_ITEMS_TO_CART } from '@/b2b-purchase-order/api/addPurchaseOrderItemsToCart/graphql/addPurchaseOrderItemsToCart.graphql';\nimport { CartModel } from '@/b2b-purchase-order/data/models';\n\nexport const addPurchaseOrderItemsToCart = async (\n purchaseOrderUid: string,\n cartId: string,\n replaceExistingCartItems: boolean = false\n): Promise<CartModel> => {\n if (!purchaseOrderUid) {\n throw new Error('Purchase Order UID is required');\n }\n\n if (!cartId) {\n throw new Error('Cart ID is required');\n }\n\n const variables = {\n purchaseOrderUid,\n cartId,\n replaceExistingCartItems,\n };\n\n return fetchGraphQl(ADD_PURCHASE_ORDER_ITEMS_TO_CART, {\n variables,\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const cartData = response.data?.addPurchaseOrderItemsToCart;\n if (!cartData?.cart) {\n throw new Error('Failed to add purchase order items to cart');\n }\n\n return transformCart(cartData);\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CREATE_PURCHASE_ORDER_APPROVAL_RULE = /* GraphQL */ `\n mutation CREATE_PURCHASE_ORDER_APPROVAL_RULE(\n $input: PurchaseOrderApprovalRuleInput!\n ) {\n createPurchaseOrderApprovalRule(input: $input) {\n created_at\n created_by\n description\n name\n status\n uid\n updated_at\n applies_to_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n }\n }\n condition {\n attribute\n operator\n }\n approver_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { CREATE_PURCHASE_ORDER_APPROVAL_RULE } from '@/b2b-purchase-order/api/createPurchaseOrderApprovalRule/graphql/createPurchaseOrderApprovalRule.graphql';\nimport { PurchaseOrderApprovalRuleModel } from '@/b2b-purchase-order/data/models/purchase-order-approval-rule-model';\nimport { transformPurchaseOrderApprovalRule } from '@/b2b-purchase-order/data/transforms';\n\nexport const createPurchaseOrderApprovalRule = async (\n input: any\n): Promise<PurchaseOrderApprovalRuleModel> => {\n if (!input.name || input.name.trim() === '') {\n throw new Error('Rule name is required');\n }\n\n return fetchGraphQl(CREATE_PURCHASE_ORDER_APPROVAL_RULE, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const result = response.data?.createPurchaseOrderApprovalRule;\n if (!result) {\n throw new Error('Failed to create purchase order approval rule');\n }\n\n return transformPurchaseOrderApprovalRule(\n response.data.createPurchaseOrderApprovalRule\n );\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const DELETE_PURCHASE_ORDER_APPROVAL_RULE = /* GraphQL */ `\n mutation DELETE_PURCHASE_ORDER_APPROVAL_RULE(\n $input: DeletePurchaseOrderApprovalRuleInput!\n ) {\n deletePurchaseOrderApprovalRule(input: $input) {\n errors {\n message\n type\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { DELETE_PURCHASE_ORDER_APPROVAL_RULE } from '@/b2b-purchase-order/api/deletePurchaseOrderApprovalRule/graphql/deletePurchaseOrderApprovalRule.graphql';\n\nexport const deletePurchaseOrderApprovalRule = async (\n uids: string | string[]\n): Promise<{\n deletePurchaseOrderApprovalRule: {\n errors: { message?: string; type?: string }[];\n };\n}> => {\n const uidArray = Array.isArray(uids) ? uids : [uids];\n\n if (!uidArray || uidArray.length === 0) {\n throw new Error('Approval Rule UID(s) are required');\n }\n\n if (uidArray.some((uid) => !uid || uid.trim() === '')) {\n throw new Error('All Approval Rule UIDs must be valid');\n }\n\n const input = {\n approval_rule_uids: uidArray,\n };\n\n return fetchGraphQl(DELETE_PURCHASE_ORDER_APPROVAL_RULE, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const result = response.data?.deletePurchaseOrderApprovalRule;\n if (!result) {\n throw new Error('Failed to delete purchase order approval rule');\n }\n\n const data = response?.data?.deletePurchaseOrderApprovalRule;\n\n return {\n deletePurchaseOrderApprovalRule: {\n errors: (data?.errors ?? []).map((error: any) => ({\n message: error?.message,\n type: error?.type,\n })),\n },\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const UPDATE_PURCHASE_ORDER_APPROVAL_RULE = /* GraphQL */ `\n mutation UPDATE_PURCHASE_ORDER_APPROVAL_RULE(\n $input: UpdatePurchaseOrderApprovalRuleInput!\n ) {\n updatePurchaseOrderApprovalRule(input: $input) {\n created_at\n created_by\n description\n name\n status\n uid\n updated_at\n applies_to_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n }\n }\n condition {\n attribute\n operator\n }\n approver_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { UPDATE_PURCHASE_ORDER_APPROVAL_RULE } from '@/b2b-purchase-order/api/updatePurchaseOrderApprovalRule/graphql/updatePurchaseOrderApprovalRule.graphql';\nimport { transformPurchaseOrderApprovalRule } from '@/b2b-purchase-order/data/transforms';\nimport { PurchaseOrderApprovalRuleModel } from '@/b2b-purchase-order/data/models/purchase-order-approval-rule-model';\n\nexport const updatePurchaseOrderApprovalRule = async (\n input: any\n): Promise<PurchaseOrderApprovalRuleModel> => {\n if (!input.uid || input.uid.trim() === '') {\n throw new Error('Approval Rule UID is required');\n }\n\n return fetchGraphQl(UPDATE_PURCHASE_ORDER_APPROVAL_RULE, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n return transformPurchaseOrderApprovalRule(\n response.data?.updatePurchaseOrderApprovalRule || {}\n );\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_PURCHASE_ORDER = /* GraphQL */ `\n query GET_PURCHASE_ORDER($uid: ID!) {\n customer {\n purchase_order(uid: $uid) {\n uid\n number\n created_at\n updated_at\n status\n available_actions\n created_by {\n firstname\n lastname\n email\n }\n order {\n id\n number\n total {\n grand_total {\n value\n currency\n }\n }\n }\n quote {\n prices {\n grand_total {\n value\n currency\n }\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { GET_PURCHASE_ORDER } from '@/b2b-purchase-order/api/getPurchaseOrder/graphql/getPurchaseOrder.graphql';\nimport { transformPurchaseOrder } from '@/b2b-purchase-order/data/transforms/transform-purchase-order';\nimport { PurchaseOrderModel } from '@/b2b-purchase-order/data/models';\n\nexport const getPurchaseOrder = async (\n uid: string\n): Promise<{\n purchaseOrder: PurchaseOrderModel;\n}> => {\n if (!uid || uid.trim() === '') {\n throw new Error('Purchase Order UID is required');\n }\n\n return fetchGraphQl(GET_PURCHASE_ORDER, {\n variables: { uid },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const result = response.data?.customer?.purchase_order;\n if (!result) {\n throw new Error('Failed to get purchase order');\n }\n\n return {\n purchaseOrder: transformPurchaseOrder(result),\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const PLACE_ORDER_FOR_PURCHASE_ORDER = /* GraphQL */ `\n mutation PLACE_ORDER_FOR_PURCHASE_ORDER(\n $input: PlaceOrderForPurchaseOrderInput!\n ) {\n placeOrderForPurchaseOrder(input: $input) {\n order {\n available_actions\n carrier\n email\n gift_receipt_included\n id\n is_virtual\n number\n order_date\n order_status_change_date\n printed_card_included\n shipping_method\n status\n token\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { PLACE_ORDER_FOR_PURCHASE_ORDER } from '@/b2b-purchase-order/api/placeOrderForPurchaseOrder/graphql/placeOrderForPurchaseOrder.graphql';\nimport { transformCustomerOrder } from '@/b2b-purchase-order/data/transforms/transform-customer-order';\nimport { CustomerOrderModel } from '@/b2b-purchase-order/data/models';\n\nexport const placeOrderForPurchaseOrder = async (\n purchaseOrderUid: string\n): Promise<CustomerOrderModel> => {\n if (!purchaseOrderUid || purchaseOrderUid.trim() === '') {\n throw new Error('Purchase Order UID is required');\n }\n\n const input = {\n purchase_order_uid: purchaseOrderUid,\n };\n\n try {\n const response: any = await fetchGraphQl(PLACE_ORDER_FOR_PURCHASE_ORDER, {\n variables: { input },\n });\n\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n return transformCustomerOrder(response);\n } catch (error) {\n throw handleNetworkError(error as Error);\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PURCHASE_ORDERS_FRAGMENT } from '@/b2b-purchase-order/api/graphql/PurchaseOrdersFragment.graphql';\n\nexport const PLACE_PURCHASE_ORDER = /* GraphQL */ `\n mutation PLACE_PURCHASE_ORDER($input: PlacePurchaseOrderInput!) {\n placePurchaseOrder(input: $input) {\n purchase_order {\n ...PURCHASE_ORDERS_FRAGMENT\n }\n }\n }\n ${PURCHASE_ORDERS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { PLACE_PURCHASE_ORDER } from '@/b2b-purchase-order/api/placePurchaseOrder/graphql/placePurchaseOrder.graphql';\nimport { transformPurchaseOrder } from '@/b2b-purchase-order/data/transforms/transform-purchase-order';\nimport { PurchaseOrderModel } from '@/b2b-purchase-order/data/models';\n\nexport const placePurchaseOrder = async (\n cartId: string\n): Promise<{ purchaseOrder: PurchaseOrderModel }> => {\n if (!cartId || cartId.trim() === '') {\n throw new Error('Cart ID is required');\n }\n\n const input = {\n cart_id: cartId,\n };\n\n return fetchGraphQl(PLACE_PURCHASE_ORDER, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const rawPurchaseOrder =\n response.data?.placePurchaseOrder?.purchase_order;\n return {\n purchaseOrder: transformPurchaseOrder(rawPurchaseOrder),\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA = /* GraphQL */ `\n query GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA {\n customer {\n purchase_order_approval_rule_metadata {\n available_applies_to {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n children {\n id\n sort_order\n text\n }\n }\n }\n available_requires_approval_from {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n children {\n id\n sort_order\n text\n }\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA } from '@/b2b-purchase-order/api/getPurchaseOrderApprovalRuleMetadata/graphql/getPurchaseOrderApprovalRuleMetadata.graphql';\nimport { transformPurchaseOrderApprovalRuleMetadata } from '@/b2b-purchase-order/data/transforms/transform-purchase-order-approval-rule-metadata';\nimport { PurchaseOrderApprovalRuleMetadataModel } from '@/b2b-purchase-order/data/models';\n\nexport const getPurchaseOrderApprovalRuleMetadata =\n async (): Promise<PurchaseOrderApprovalRuleMetadataModel> => {\n return fetchGraphQl(GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA, {\n variables: {},\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n return transformPurchaseOrderApprovalRuleMetadata(response);\n })\n .catch(handleNetworkError);\n };\n"],"names":["initialize","Initializer","config","defaultConfig","CANCEL_PURCHASE_ORDERS","PURCHASE_ORDERS_FRAGMENT","cancelPurchaseOrders","uids","uidArray","uid","fetchGraphQl","response","_a","handleFetchError","data","_b","error","_c","order","transformPurchaseOrder","handleNetworkError","VALIDATE_PURCHASE_ORDERS","validatePurchaseOrders","ADD_PURCHASE_ORDER_COMMENT","transformCart","cartItems","item","_f","_e","_d","_i","_h","_g","_l","_k","_j","_n","_m","_o","transformCustomerOrder","orderData","transformMoney","money","transformCoupon","coupon","transformGiftCard","giftCard","transformAddress","address","transformPaymentMethod","payment","transformOrderItem","transformShipmentTracking","tracking","transformShipmentComment","comment","transformShipmentItem","transformShipment","shipment","transformCustomerInfo","customerInfo","transformOrderDiscount","discount","transformOrderTotal","total","transformOrderData","transformPurchaseOrderApprovalRuleMetadata","metadata","transformCompanyRolePermission","permission","transformCompanyRole","role","availableAppliesTo","availableRequiresApprovalFrom","transformPurchaseOrderApprovalRule","approvalRule","transformCondition","condition","transformPurchaseOrderComment","addPurchaseOrderComment","ADD_PURCHASE_ORDER_ITEMS_TO_CART","addPurchaseOrderItemsToCart","purchaseOrderUid","cartId","replaceExistingCartItems","cartData","CREATE_PURCHASE_ORDER_APPROVAL_RULE","createPurchaseOrderApprovalRule","input","DELETE_PURCHASE_ORDER_APPROVAL_RULE","deletePurchaseOrderApprovalRule","UPDATE_PURCHASE_ORDER_APPROVAL_RULE","updatePurchaseOrderApprovalRule","GET_PURCHASE_ORDER","getPurchaseOrder","result","PLACE_ORDER_FOR_PURCHASE_ORDER","placeOrderForPurchaseOrder","PLACE_PURCHASE_ORDER","placePurchaseOrder","rawPurchaseOrder","GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA","getPurchaseOrderApprovalRuleMetadata"],"mappings":"yTAwBO,MAAMA,EAAa,IAAIC,EAAyB,CACrD,KAAM,MAAOC,GAAW,CACtB,MAAMC,EAAgB,CAAA,EAEtBH,EAAW,OAAO,UAAU,CAAE,GAAGG,EAAe,GAAGD,EAAQ,CAC7D,EAEA,UAAW,IAAM,CAAA,CACnB,CAAC,EAEYA,EAASF,EAAW,OCfpBI,EAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYhDC,CAAwB;AAAA,ECRfC,EAAuB,MAClCC,GAII,CACJ,MA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GACJnF,GAAAF,EAAAJ,EAAS,OAAT,YAAAI,EAAe,qBAAf,YAAAE,EAAmC,eACrC,MAAO,CACL,cAAeE,EAAuBiF,CAAgB,CAAA,CAE1D,CAAC,EACA,MAAMhF,CAAkB,CAC7B,ECjCaiF,EAA0D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ECO1DC,GACX,SACS5F,EAAa2F,EAA2C,CAC7D,UAAW,CAAA,CAAC,CACb,EACE,KAAM1F,GAAkB,OACvB,OAAIC,EAAAD,EAAS,SAAT,MAAAC,EAAiB,QACnBC,EAAiBF,EAAS,MAAM,EAG3BuD,EAA2CvD,CAAQ,CAC5D,CAAC,EACA,MAAMS,CAAkB"}
|
|
1
|
+
{"version":3,"file":"api.js","sources":["/@dropins/storefront-purchase-order/src/api/initialize/initialize.ts","/@dropins/storefront-purchase-order/src/api/cancelPurchaseOrders/graphql/cancelPurchaseOrders.graphql.ts","/@dropins/storefront-purchase-order/src/api/cancelPurchaseOrders/cancelPurchaseOrders.ts","/@dropins/storefront-purchase-order/src/api/validatePurchaseOrders/graphql/validatePurchaseOrders.graphql.ts","/@dropins/storefront-purchase-order/src/api/validatePurchaseOrders/validatePurchaseOrders.ts","/@dropins/storefront-purchase-order/src/api/addPurchaseOrderComment/graphql/addPurchaseOrderComment.graphql.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-cart.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-customer-order.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-purchase-order-approval-rule-metadata.ts","/@dropins/storefront-purchase-order/src/data/transforms/transform-purchase-order-comment.ts","/@dropins/storefront-purchase-order/src/api/addPurchaseOrderComment/addPurchaseOrderComment.ts","/@dropins/storefront-purchase-order/src/api/addPurchaseOrderItemsToCart/graphql/addPurchaseOrderItemsToCart.graphql.ts","/@dropins/storefront-purchase-order/src/api/addPurchaseOrderItemsToCart/addPurchaseOrderItemsToCart.ts","/@dropins/storefront-purchase-order/src/api/createPurchaseOrderApprovalRule/graphql/createPurchaseOrderApprovalRule.graphql.ts","/@dropins/storefront-purchase-order/src/api/createPurchaseOrderApprovalRule/createPurchaseOrderApprovalRule.ts","/@dropins/storefront-purchase-order/src/api/updatePurchaseOrderApprovalRule/graphql/updatePurchaseOrderApprovalRule.graphql.ts","/@dropins/storefront-purchase-order/src/api/updatePurchaseOrderApprovalRule/updatePurchaseOrderApprovalRule.ts","/@dropins/storefront-purchase-order/src/api/getPurchaseOrder/graphql/getPurchaseOrder.graphql.ts","/@dropins/storefront-purchase-order/src/api/getPurchaseOrder/getPurchaseOrder.ts","/@dropins/storefront-purchase-order/src/api/placeOrderForPurchaseOrder/graphql/placeOrderForPurchaseOrder.graphql.ts","/@dropins/storefront-purchase-order/src/api/placeOrderForPurchaseOrder/placeOrderForPurchaseOrder.ts","/@dropins/storefront-purchase-order/src/api/placePurchaseOrder/graphql/placePurchaseOrder.graphql.ts","/@dropins/storefront-purchase-order/src/api/placePurchaseOrder/placePurchaseOrder.ts","/@dropins/storefront-purchase-order/src/api/getPurchaseOrderApprovalRuleMetadata/graphql/getPurchaseOrderApprovalRuleMetadata.graphql.ts","/@dropins/storefront-purchase-order/src/api/getPurchaseOrderApprovalRuleMetadata/getPurchaseOrderApprovalRuleMetadata.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Initializer } from '@adobe-commerce/elsie/lib';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\n\ntype ConfigProps = {\n langDefinitions?: Lang;\n};\n\nexport const initialize = new Initializer<ConfigProps>({\n init: async (config) => {\n const defaultConfig = {};\n\n initialize.config.setConfig({ ...defaultConfig, ...config });\n },\n\n listeners: () => [],\n});\n\nexport const config = initialize.config;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PURCHASE_ORDERS_FRAGMENT } from '@/b2b-purchase-order/api/graphql/PurchaseOrdersFragment.graphql';\n\nexport const CANCEL_PURCHASE_ORDERS = /* GraphQL */ `\n mutation CANCEL_PURCHASE_ORDERS($input: PurchaseOrdersActionInput!) {\n cancelPurchaseOrders(input: $input) {\n purchase_orders {\n ...PURCHASE_ORDERS_FRAGMENT\n }\n errors {\n message\n type\n }\n }\n }\n ${PURCHASE_ORDERS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { CANCEL_PURCHASE_ORDERS } from '@/b2b-purchase-order/api/cancelPurchaseOrders/graphql/cancelPurchaseOrders.graphql';\nimport { transformPurchaseOrder } from '@/b2b-purchase-order/data/transforms/transform-purchase-order';\nimport { PurchaseOrderModel } from '@/b2b-purchase-order/data/models';\n\nexport const cancelPurchaseOrders = async (\n uids: string | string[]\n): Promise<{\n errors: { message: string; type: string }[];\n purchaseOrders: PurchaseOrderModel[];\n}> => {\n const uidArray = Array.isArray(uids) ? uids : [uids];\n\n if (!uidArray || uidArray.length === 0) {\n throw new Error('Purchase Order UID(s) are required');\n }\n\n if (uidArray.some((uid) => !uid || uid.trim() === '')) {\n throw new Error('All Purchase Order UIDs must be valid');\n }\n\n const input = {\n purchase_order_uids: uidArray,\n };\n\n return fetchGraphQl(CANCEL_PURCHASE_ORDERS, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const data = response.data?.cancelPurchaseOrders;\n if (!data) {\n throw new Error('Failed to cancel purchase orders');\n }\n\n return {\n errors: (data?.errors ?? []).map((error: any) => ({\n message: error?.message ?? '',\n type: error?.type ?? '',\n })),\n purchaseOrders:\n data?.purchase_orders?.map((order: any) =>\n transformPurchaseOrder(order)\n ) ?? [],\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PURCHASE_ORDERS_FRAGMENT } from '@/b2b-purchase-order/api/graphql/PurchaseOrdersFragment.graphql';\n\nexport const VALIDATE_PURCHASE_ORDERS = /* GraphQL */ `\n mutation VALIDATE_PURCHASE_ORDERS($input: ValidatePurchaseOrdersInput!) {\n validatePurchaseOrders(input: $input) {\n errors {\n message\n type\n }\n purchase_orders {\n ...PURCHASE_ORDERS_FRAGMENT\n }\n }\n }\n ${PURCHASE_ORDERS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { VALIDATE_PURCHASE_ORDERS } from '@/b2b-purchase-order/api/validatePurchaseOrders/graphql/validatePurchaseOrders.graphql';\nimport { PurchaseOrderModel } from '@/b2b-purchase-order/data/models';\nimport { transformPurchaseOrder } from '@/b2b-purchase-order/data/transforms/transform-purchase-order';\n\nexport const validatePurchaseOrders = async (\n uids: string | string[]\n): Promise<{\n errors: { message: string; type: string }[];\n purchaseOrders: PurchaseOrderModel[];\n}> => {\n const uidArray = Array.isArray(uids) ? uids : [uids];\n\n if (!uidArray || uidArray.length === 0) {\n throw new Error('Purchase Order UID(s) are required');\n }\n\n if (uidArray.some((uid) => !uid || uid.trim() === '')) {\n throw new Error('All Purchase Order UIDs must be valid');\n }\n\n const input = {\n purchase_order_uids: uidArray,\n };\n\n return fetchGraphQl(VALIDATE_PURCHASE_ORDERS, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const data = response.data?.validatePurchaseOrders;\n\n return {\n errors: (data?.errors ?? []).map((error: any) => ({\n message: error?.message ?? '',\n type: error?.type ?? '',\n })),\n purchaseOrders: (data?.purchase_orders || []).map(\n transformPurchaseOrder\n ),\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_PURCHASE_ORDER_COMMENT = /* GraphQL */ `\n mutation ADD_PURCHASE_ORDER_COMMENT(\n $purchaseOrderUid: ID!\n $comment: String!\n ) {\n addPurchaseOrderComment(\n input: { purchase_order_uid: $purchaseOrderUid, comment: $comment }\n ) {\n comment {\n created_at\n text\n uid\n author {\n allow_remote_shopping_assistance\n confirmation_status\n created_at\n date_of_birth\n email\n firstname\n gender\n job_title\n lastname\n middlename\n prefix\n status\n structure_id\n suffix\n telephone\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { CartModel } from '@/b2b-purchase-order/data/models';\n\nexport const transformCart = (data: any): CartModel => {\n const cartItems = data?.cart?.itemsV2?.items ?? [];\n\n return {\n cart: {\n id: data?.cart?.id ?? '',\n items: cartItems.map((item: any) => ({\n uid: item?.uid ?? '',\n quantity: item?.quantity ?? 0,\n product: {\n uid: item?.product?.uid ?? '',\n name: item?.product?.name ?? '',\n sku: item?.product?.sku ?? '',\n },\n })),\n pagination: {\n currentPage: data?.cart?.itemsV2?.page_info?.current_page ?? 1,\n pageSize: data?.cart?.itemsV2?.page_info?.page_size ?? 20,\n totalPages: data?.cart?.itemsV2?.page_info?.total_pages ?? 0,\n totalCount: data?.cart?.itemsV2?.total_count ?? 0,\n },\n },\n userErrors:\n data?.user_errors?.map((error: any) => ({\n message: error?.message ?? '',\n })) ?? [],\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n CustomerOrderModel,\n Money,\n Coupon,\n GiftCard,\n CustomerAddress,\n PaymentMethod,\n OrderItem,\n Shipment,\n ShipmentTracking,\n ShipmentComment,\n ShipmentItem,\n CustomerInfo,\n OrderTotal,\n OrderDiscount,\n} from '@/b2b-purchase-order/data/models/customer-order-model';\n\nexport const transformCustomerOrder = (response: any): CustomerOrderModel => {\n const orderData = response.data?.placeOrderForPurchaseOrder?.order;\n\n const transformMoney = (money: any): Money => ({\n value: money?.value || 0,\n currency: money?.currency || '',\n });\n\n const transformCoupon = (coupon: any): Coupon => ({\n code: coupon?.code || '',\n label: coupon?.label || '',\n });\n\n const transformGiftCard = (giftCard: any): GiftCard => ({\n code: giftCard?.code || '',\n appliedBalance: transformMoney(giftCard?.applied_balance),\n currentBalance: transformMoney(giftCard?.current_balance),\n });\n\n const transformAddress = (address: any): CustomerAddress => ({\n firstname: address?.firstname || '',\n lastname: address?.lastname || '',\n street: address?.street || [],\n city: address?.city || '',\n region: address?.region || '',\n postcode: address?.postcode || '',\n countryCode: address?.country_code || '',\n telephone: address?.telephone || '',\n company: address?.company || '',\n });\n\n const transformPaymentMethod = (payment: any): PaymentMethod => ({\n name: payment?.name || '',\n type: payment?.type || '',\n additionalData: payment?.additional_data || {},\n });\n\n const transformOrderItem = (item: any): OrderItem => ({\n id: item?.id || '',\n productName: item?.product_name || '',\n productSku: item?.product_sku || '',\n quantityOrdered: item?.quantity_ordered || 0,\n quantityShipped: item?.quantity_shipped || 0,\n quantityInvoiced: item?.quantity_invoiced || 0,\n quantityRefunded: item?.quantity_refunded || 0,\n price: transformMoney(item?.price),\n total: transformMoney(item?.total),\n });\n\n const transformShipmentTracking = (tracking: any): ShipmentTracking => ({\n number: tracking?.number || '',\n carrier: tracking?.carrier || '',\n title: tracking?.title || '',\n });\n\n const transformShipmentComment = (comment: any): ShipmentComment => ({\n message: comment?.message || '',\n timestamp: comment?.timestamp || '',\n });\n\n const transformShipmentItem = (item: any): ShipmentItem => ({\n id: item?.id || '',\n productName: item?.product_name || '',\n productSku: item?.product_sku || '',\n quantityShipped: item?.quantity_shipped || 0,\n });\n\n const transformShipment = (shipment: any): Shipment => ({\n id: shipment?.id || '',\n number: shipment?.number || '',\n tracking: (shipment?.tracking || []).map(transformShipmentTracking),\n comments: (shipment?.comments || []).map(transformShipmentComment),\n items: (shipment?.items || []).map(transformShipmentItem),\n });\n\n const transformCustomerInfo = (customerInfo: any): CustomerInfo => ({\n firstname: customerInfo?.firstname || '',\n lastname: customerInfo?.lastname || '',\n email: customerInfo?.email || '',\n });\n\n const transformOrderDiscount = (discount: any): OrderDiscount => ({\n label: discount?.label || '',\n amount: transformMoney(discount?.amount),\n });\n\n const transformOrderTotal = (total: any): OrderTotal => ({\n baseGrandTotal: transformMoney(total?.base_grand_total),\n grandTotal: transformMoney(total?.grand_total),\n subtotal: transformMoney(total?.subtotal),\n totalTax: transformMoney(total?.total_tax),\n totalShipping: transformMoney(total?.total_shipping),\n discounts: (total?.discounts || []).map(transformOrderDiscount),\n });\n\n const transformOrderData = (data: any): CustomerOrderModel => ({\n appliedCoupons: (data?.applied_coupons || []).map(transformCoupon),\n appliedGiftCards: (data?.applied_gift_cards || []).map(transformGiftCard),\n availableActions: data?.available_actions || [],\n billingAddress: data?.billing_address\n ? transformAddress(data.billing_address)\n : {\n firstname: '',\n lastname: '',\n street: [],\n city: '',\n region: '',\n postcode: '',\n countryCode: '',\n telephone: '',\n company: '',\n },\n carrier: data?.carrier || '',\n comments: data?.comments || [],\n creditMemos: data?.credit_memos || [],\n customAttributes: data?.custom_attributes || [],\n customerInfo: data?.customer_info\n ? transformCustomerInfo(data.customer_info)\n : {\n firstname: '',\n lastname: '',\n email: '',\n },\n email: data?.email || '',\n giftMessage: data?.gift_message || '',\n giftReceiptIncluded: data?.gift_receipt_included || false,\n giftWrapping: data?.gift_wrapping || null,\n id: data?.id || '',\n invoices: data?.invoices || [],\n isVirtual: data?.is_virtual || false,\n items: (data?.items || []).map(transformOrderItem),\n itemsEligibleForReturn: data?.items_eligible_for_return || [],\n number: data?.number || '',\n orderDate: data?.order_date || '',\n orderStatusChangeDate: data?.order_status_change_date || '',\n paymentMethods: (data?.payment_methods || []).map(transformPaymentMethod),\n printedCardIncluded: data?.printed_card_included || false,\n returns: data?.returns || null,\n shipments: (data?.shipments || []).map(transformShipment),\n shippingAddress: data?.shipping_address\n ? transformAddress(data.shipping_address)\n : {\n firstname: '',\n lastname: '',\n street: [],\n city: '',\n region: '',\n postcode: '',\n countryCode: '',\n telephone: '',\n company: '',\n },\n shippingMethod: data?.shipping_method || '',\n status: data?.status || '',\n token: data?.token || '',\n total: data?.total\n ? transformOrderTotal(data.total)\n : {\n baseGrandTotal: transformMoney(null),\n grandTotal: transformMoney(null),\n subtotal: transformMoney(null),\n totalTax: transformMoney(null),\n totalShipping: transformMoney(null),\n discounts: [],\n },\n });\n\n return orderData ? transformOrderData(orderData) : transformOrderData(null);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n PurchaseOrderApprovalRuleMetadataModel,\n CompanyRolePermissionsTree,\n CompanyRole,\n} from '@/b2b-purchase-order/data/models/purchase-order-approval-rule-metadata-model';\n\nexport const transformPurchaseOrderApprovalRuleMetadata = (\n response: any\n): PurchaseOrderApprovalRuleMetadataModel => {\n const metadata =\n response?.data?.customer?.purchase_order_approval_rule_metadata;\n\n const transformCompanyRolePermission = (\n permission: any\n ): CompanyRolePermissionsTree => ({\n id: permission?.id || '',\n sortOrder: permission?.sort_order || 0,\n text: permission?.text || '',\n children:\n permission?.children?.map(transformCompanyRolePermission) || undefined,\n });\n\n const transformCompanyRole = (role: any): CompanyRole => ({\n id: role?.id || '',\n name: role?.name || '',\n usersCount: role?.users_count || 0,\n permissions: (role?.permissions || []).map(transformCompanyRolePermission),\n });\n\n const availableAppliesTo = (metadata?.available_applies_to || []).map(\n transformCompanyRole\n );\n\n const availableRequiresApprovalFrom = (\n metadata?.available_requires_approval_from || []\n ).map(transformCompanyRole);\n\n return {\n availableAppliesTo,\n availableRequiresApprovalFrom,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PurchaseOrderCommentModel } from '@/b2b-purchase-order/data/models';\n\nexport const transformPurchaseOrderComment = (\n comment: any\n): PurchaseOrderCommentModel => {\n return {\n createdAt: comment?.created_at ?? '',\n text: comment?.text ?? '',\n uid: comment?.uid ?? '',\n author: {\n allowRemoteShoppingAssistance:\n comment?.author?.allow_remote_shopping_assistance ?? false,\n confirmationStatus: comment?.author?.confirmation_status ?? '',\n createdAt: comment?.author?.created_at ?? '',\n dateOfBirth: comment?.author?.date_of_birth ?? '',\n email: comment?.author?.email ?? '',\n firstname: comment?.author?.firstname ?? '',\n gender: comment?.author?.gender ?? 0,\n jobTitle: comment?.author?.job_title ?? '',\n lastname: comment?.author?.lastname ?? '',\n middlename: comment?.author?.middlename ?? '',\n prefix: comment?.author?.prefix ?? '',\n status: comment?.author?.status ?? '',\n structureId: comment?.author?.structure_id ?? '',\n suffix: comment?.author?.suffix ?? '',\n telephone: comment?.author?.telephone ?? '',\n },\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { ADD_PURCHASE_ORDER_COMMENT } from '@/b2b-purchase-order/api/addPurchaseOrderComment/graphql/addPurchaseOrderComment.graphql';\nimport { transformPurchaseOrderComment } from '@/b2b-purchase-order/data/transforms';\nimport { PurchaseOrderCommentModel } from '@/b2b-purchase-order/data/models';\n\nexport const addPurchaseOrderComment = async (\n uid: string,\n comment: string\n): Promise<PurchaseOrderCommentModel> => {\n if (!uid) {\n throw new Error('Purchase Order ID is required');\n }\n\n if (!comment) {\n throw new Error('Comment text is required');\n }\n\n const variables = {\n purchaseOrderUid: uid,\n comment,\n };\n\n return fetchGraphQl(ADD_PURCHASE_ORDER_COMMENT, {\n variables,\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n return transformPurchaseOrderComment(\n response.data?.addPurchaseOrderComment?.comment\n );\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const ADD_PURCHASE_ORDER_ITEMS_TO_CART = /* GraphQL */ `\n mutation ADD_PURCHASE_ORDER_ITEMS_TO_CART(\n $purchaseOrderUid: ID!\n $cartId: String!\n $replaceExistingCartItems: Boolean!\n ) {\n addPurchaseOrderItemsToCart(\n input: {\n purchase_order_uid: $purchaseOrderUid\n cart_id: $cartId\n replace_existing_cart_items: $replaceExistingCartItems\n }\n ) {\n cart {\n id\n itemsV2 {\n items {\n uid\n quantity\n product {\n uid\n name\n sku\n }\n }\n page_info {\n current_page\n page_size\n total_pages\n }\n total_count\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { transformCart } from '@/b2b-purchase-order/data/transforms';\nimport { ADD_PURCHASE_ORDER_ITEMS_TO_CART } from '@/b2b-purchase-order/api/addPurchaseOrderItemsToCart/graphql/addPurchaseOrderItemsToCart.graphql';\nimport { CartModel } from '@/b2b-purchase-order/data/models';\n\nexport const addPurchaseOrderItemsToCart = async (\n purchaseOrderUid: string,\n cartId: string,\n replaceExistingCartItems: boolean = false\n): Promise<CartModel> => {\n if (!purchaseOrderUid) {\n throw new Error('Purchase Order UID is required');\n }\n\n if (!cartId) {\n throw new Error('Cart ID is required');\n }\n\n const variables = {\n purchaseOrderUid,\n cartId,\n replaceExistingCartItems,\n };\n\n return fetchGraphQl(ADD_PURCHASE_ORDER_ITEMS_TO_CART, {\n variables,\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const cartData = response.data?.addPurchaseOrderItemsToCart;\n if (!cartData?.cart) {\n throw new Error('Failed to add purchase order items to cart');\n }\n\n return transformCart(cartData);\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CREATE_PURCHASE_ORDER_APPROVAL_RULE = /* GraphQL */ `\n mutation CREATE_PURCHASE_ORDER_APPROVAL_RULE(\n $input: PurchaseOrderApprovalRuleInput!\n ) {\n createPurchaseOrderApprovalRule(input: $input) {\n created_at\n created_by\n description\n name\n status\n uid\n updated_at\n applies_to_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n }\n }\n condition {\n attribute\n operator\n }\n approver_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { CREATE_PURCHASE_ORDER_APPROVAL_RULE } from '@/b2b-purchase-order/api/createPurchaseOrderApprovalRule/graphql/createPurchaseOrderApprovalRule.graphql';\nimport { PurchaseOrderApprovalRuleModel } from '@/b2b-purchase-order/data/models/purchase-order-approval-rule-model';\nimport { transformPurchaseOrderApprovalRule } from '@/b2b-purchase-order/data/transforms';\n\nexport const createPurchaseOrderApprovalRule = async (\n input: any\n): Promise<PurchaseOrderApprovalRuleModel> => {\n if (!input.name || input.name.trim() === '') {\n throw new Error('Rule name is required');\n }\n\n return fetchGraphQl(CREATE_PURCHASE_ORDER_APPROVAL_RULE, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const result = response.data?.createPurchaseOrderApprovalRule;\n if (!result) {\n throw new Error('Failed to create purchase order approval rule');\n }\n\n return transformPurchaseOrderApprovalRule(\n response.data.createPurchaseOrderApprovalRule\n );\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const UPDATE_PURCHASE_ORDER_APPROVAL_RULE = /* GraphQL */ `\n mutation UPDATE_PURCHASE_ORDER_APPROVAL_RULE(\n $input: UpdatePurchaseOrderApprovalRuleInput!\n ) {\n updatePurchaseOrderApprovalRule(input: $input) {\n created_at\n created_by\n description\n name\n status\n uid\n updated_at\n applies_to_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n }\n }\n condition {\n attribute\n operator\n }\n approver_roles {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { UPDATE_PURCHASE_ORDER_APPROVAL_RULE } from '@/b2b-purchase-order/api/updatePurchaseOrderApprovalRule/graphql/updatePurchaseOrderApprovalRule.graphql';\nimport { transformPurchaseOrderApprovalRule } from '@/b2b-purchase-order/data/transforms';\nimport { PurchaseOrderApprovalRuleModel } from '@/b2b-purchase-order/data/models/purchase-order-approval-rule-model';\n\nexport const updatePurchaseOrderApprovalRule = async (\n input: any\n): Promise<PurchaseOrderApprovalRuleModel> => {\n if (!input.uid || input.uid.trim() === '') {\n throw new Error('Approval Rule UID is required');\n }\n\n return fetchGraphQl(UPDATE_PURCHASE_ORDER_APPROVAL_RULE, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n return transformPurchaseOrderApprovalRule(\n response.data?.updatePurchaseOrderApprovalRule || {}\n );\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_PURCHASE_ORDER = /* GraphQL */ `\n query GET_PURCHASE_ORDER($uid: ID!) {\n customer {\n purchase_order(uid: $uid) {\n uid\n number\n created_at\n updated_at\n status\n available_actions\n created_by {\n firstname\n lastname\n email\n }\n order {\n id\n number\n total {\n grand_total {\n value\n currency\n }\n }\n }\n quote {\n prices {\n grand_total {\n value\n currency\n }\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { GET_PURCHASE_ORDER } from '@/b2b-purchase-order/api/getPurchaseOrder/graphql/getPurchaseOrder.graphql';\nimport { transformPurchaseOrder } from '@/b2b-purchase-order/data/transforms/transform-purchase-order';\nimport { PurchaseOrderModel } from '@/b2b-purchase-order/data/models';\n\nexport const getPurchaseOrder = async (\n uid: string\n): Promise<{\n purchaseOrder: PurchaseOrderModel;\n}> => {\n if (!uid || uid.trim() === '') {\n throw new Error('Purchase Order UID is required');\n }\n\n return fetchGraphQl(GET_PURCHASE_ORDER, {\n variables: { uid },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const result = response.data?.customer?.purchase_order;\n if (!result) {\n throw new Error('Failed to get purchase order');\n }\n\n return {\n purchaseOrder: transformPurchaseOrder(result),\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const PLACE_ORDER_FOR_PURCHASE_ORDER = /* GraphQL */ `\n mutation PLACE_ORDER_FOR_PURCHASE_ORDER(\n $input: PlaceOrderForPurchaseOrderInput!\n ) {\n placeOrderForPurchaseOrder(input: $input) {\n order {\n available_actions\n carrier\n email\n gift_receipt_included\n id\n is_virtual\n number\n order_date\n order_status_change_date\n printed_card_included\n shipping_method\n status\n token\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { PLACE_ORDER_FOR_PURCHASE_ORDER } from '@/b2b-purchase-order/api/placeOrderForPurchaseOrder/graphql/placeOrderForPurchaseOrder.graphql';\nimport { transformCustomerOrder } from '@/b2b-purchase-order/data/transforms/transform-customer-order';\nimport { CustomerOrderModel } from '@/b2b-purchase-order/data/models';\n\nexport const placeOrderForPurchaseOrder = async (\n purchaseOrderUid: string\n): Promise<CustomerOrderModel> => {\n if (!purchaseOrderUid || purchaseOrderUid.trim() === '') {\n throw new Error('Purchase Order UID is required');\n }\n\n const input = {\n purchase_order_uid: purchaseOrderUid,\n };\n\n try {\n const response: any = await fetchGraphQl(PLACE_ORDER_FOR_PURCHASE_ORDER, {\n variables: { input },\n });\n\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n return transformCustomerOrder(response);\n } catch (error) {\n throw handleNetworkError(error as Error);\n }\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { PURCHASE_ORDERS_FRAGMENT } from '@/b2b-purchase-order/api/graphql/PurchaseOrdersFragment.graphql';\n\nexport const PLACE_PURCHASE_ORDER = /* GraphQL */ `\n mutation PLACE_PURCHASE_ORDER($input: PlacePurchaseOrderInput!) {\n placePurchaseOrder(input: $input) {\n purchase_order {\n ...PURCHASE_ORDERS_FRAGMENT\n }\n }\n }\n ${PURCHASE_ORDERS_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { PLACE_PURCHASE_ORDER } from '@/b2b-purchase-order/api/placePurchaseOrder/graphql/placePurchaseOrder.graphql';\nimport { transformPurchaseOrder } from '@/b2b-purchase-order/data/transforms/transform-purchase-order';\nimport { PurchaseOrderModel } from '@/b2b-purchase-order/data/models';\n\nexport const placePurchaseOrder = async (\n cartId: string\n): Promise<{ purchaseOrder: PurchaseOrderModel }> => {\n if (!cartId || cartId.trim() === '') {\n throw new Error('Cart ID is required');\n }\n\n const input = {\n cart_id: cartId,\n };\n\n return fetchGraphQl(PLACE_PURCHASE_ORDER, {\n variables: { input },\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n const rawPurchaseOrder =\n response.data?.placePurchaseOrder?.purchase_order;\n return {\n purchaseOrder: transformPurchaseOrder(rawPurchaseOrder),\n };\n })\n .catch(handleNetworkError);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA = /* GraphQL */ `\n query GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA {\n customer {\n purchase_order_approval_rule_metadata {\n available_applies_to {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n children {\n id\n sort_order\n text\n }\n }\n }\n available_requires_approval_from {\n id\n name\n users_count\n permissions {\n id\n sort_order\n text\n children {\n id\n sort_order\n text\n }\n }\n }\n }\n }\n }\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/b2b-purchase-order/api/fetch-graphql';\nimport { handleNetworkError } from '@/b2b-purchase-order/lib/network-error';\nimport { handleFetchError } from '@/b2b-purchase-order/lib/fetch-error';\nimport { GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA } from '@/b2b-purchase-order/api/getPurchaseOrderApprovalRuleMetadata/graphql/getPurchaseOrderApprovalRuleMetadata.graphql';\nimport { transformPurchaseOrderApprovalRuleMetadata } from '@/b2b-purchase-order/data/transforms/transform-purchase-order-approval-rule-metadata';\nimport { PurchaseOrderApprovalRuleMetadataModel } from '@/b2b-purchase-order/data/models';\n\nexport const getPurchaseOrderApprovalRuleMetadata =\n async (): Promise<PurchaseOrderApprovalRuleMetadataModel> => {\n return fetchGraphQl(GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA, {\n variables: {},\n })\n .then((response: any) => {\n if (response.errors?.length) {\n handleFetchError(response.errors);\n }\n\n return transformPurchaseOrderApprovalRuleMetadata(response);\n })\n .catch(handleNetworkError);\n };\n"],"names":["initialize","Initializer","config","defaultConfig","CANCEL_PURCHASE_ORDERS","PURCHASE_ORDERS_FRAGMENT","cancelPurchaseOrders","uids","uidArray","uid","fetchGraphQl","response","_a","handleFetchError","data","_b","error","_c","order","transformPurchaseOrder","handleNetworkError","VALIDATE_PURCHASE_ORDERS","validatePurchaseOrders","ADD_PURCHASE_ORDER_COMMENT","transformCart","cartItems","item","_f","_e","_d","_i","_h","_g","_l","_k","_j","_n","_m","_o","transformCustomerOrder","orderData","transformMoney","money","transformCoupon","coupon","transformGiftCard","giftCard","transformAddress","address","transformPaymentMethod","payment","transformOrderItem","transformShipmentTracking","tracking","transformShipmentComment","comment","transformShipmentItem","transformShipment","shipment","transformCustomerInfo","customerInfo","transformOrderDiscount","discount","transformOrderTotal","total","transformOrderData","transformPurchaseOrderApprovalRuleMetadata","metadata","transformCompanyRolePermission","permission","transformCompanyRole","role","availableAppliesTo","availableRequiresApprovalFrom","transformPurchaseOrderComment","addPurchaseOrderComment","ADD_PURCHASE_ORDER_ITEMS_TO_CART","addPurchaseOrderItemsToCart","purchaseOrderUid","cartId","replaceExistingCartItems","cartData","CREATE_PURCHASE_ORDER_APPROVAL_RULE","createPurchaseOrderApprovalRule","input","transformPurchaseOrderApprovalRule","UPDATE_PURCHASE_ORDER_APPROVAL_RULE","updatePurchaseOrderApprovalRule","GET_PURCHASE_ORDER","getPurchaseOrder","result","PLACE_ORDER_FOR_PURCHASE_ORDER","placeOrderForPurchaseOrder","PLACE_PURCHASE_ORDER","placePurchaseOrder","rawPurchaseOrder","GET_PURCHASE_ORDER_APPROVAL_RULE_METADATA","getPurchaseOrderApprovalRuleMetadata"],"mappings":"ugBAwBO,MAAMA,EAAa,IAAIC,EAAyB,CACrD,KAAM,MAAOC,GAAW,CACtB,MAAMC,EAAgB,CAAA,EAEtBH,EAAW,OAAO,UAAU,CAAE,GAAGG,EAAe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AA,ECO1DC,GACX,SACSvF,EAAasF,EAA2C,CAC7D,UAAW,CAAA,CAAC,CACb,EACE,KAAMrF,GAAkB,OACvB,OAAIC,EAAAD,EAAS,SAAT,MAAAC,EAAiB,QACnBC,EAAiBF,EAAS,MAAM,EAG3BuD,EAA2CvD,CAAQ,CAC5D,CAAC,EACA,MAAMS,CAAkB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{events as s}from"@dropins/tools/event-bus.js";import{FetchGraphQL as t}from"@dropins/tools/fetch-graphql.js";const n=r=>{const e=r.map(o=>o.message).join(" ");throw Error(e)},h=r=>{const e=r instanceof DOMException&&r.name==="AbortError",o=r.name==="PlaceOrderError";throw!e&&!o&&s.emit("purchase-order/error",{source:"purchase-order",type:"network",error:r.message}),r},{setEndpoint:p,setFetchGraphQlHeader:d,removeFetchGraphQlHeader:i,setFetchGraphQlHeaders:m,fetchGraphQl:E,getConfig:l}=new t().getMethods();export{h as a,d as b,m as c,E as f,l as g,n as h,i as r,p as s};
|
|
4
|
+
//# sourceMappingURL=fetch-graphql.js.map
|