@dropins/storefront-purchase-order 0.0.4-alpha3 → 0.0.5-alpha10
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/getPurchaseOrder/graphql/getPurchaseOrder.graphql.d.ts +1 -1
- package/api/graphql/PurchaseOrderQuoteFragment.d.ts +22 -0
- package/api/index.d.ts +1 -0
- package/api/initialize/initialize.d.ts +1 -0
- package/api/permissions.d.ts +11 -0
- package/api.js +406 -74
- package/api.js.map +1 -1
- package/chunks/currencyInfo.js +1 -1
- package/chunks/currencyInfo.js.map +1 -1
- package/chunks/getPurchaseOrders.js +3 -77
- package/chunks/getPurchaseOrders.js.map +1 -1
- package/chunks/pageSize.config.js +1 -1
- package/chunks/pageSize.config.js.map +1 -1
- package/chunks/permissions.js +4 -0
- package/chunks/permissions.js.map +1 -0
- package/chunks/placeOrderForPurchaseOrder.js +39 -0
- package/chunks/placeOrderForPurchaseOrder.js.map +1 -0
- package/chunks/rejectPurchaseOrders.js +78 -0
- package/chunks/rejectPurchaseOrders.js.map +1 -0
- package/chunks/useCustomerRolePermissions.js +1 -1
- package/chunks/useCustomerRolePermissions.js.map +1 -1
- package/chunks/usePurchaseOrders.js +1 -1
- package/chunks/usePurchaseOrders.js.map +1 -1
- package/components/PurchaseOrderStatusContent/PurchaseOrderStatusContent.d.ts +5 -0
- package/components/PurchaseOrderStatusContent/index.d.ts +19 -0
- package/components/index.d.ts +1 -0
- package/containers/ApprovalRuleDetails.js +1 -1
- package/containers/ApprovalRuleDetails.js.map +1 -1
- package/containers/ApprovalRuleForm.js +1 -1
- package/containers/ApprovalRuleForm.js.map +1 -1
- package/containers/ApprovalRulesList.js +1 -1
- package/containers/ApprovalRulesList.js.map +1 -1
- 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/PurchaseOrderStatus/PurchaseOrderStatus.d.ts +5 -0
- package/containers/PurchaseOrderStatus/index.d.ts +19 -0
- package/containers/PurchaseOrderStatus.d.ts +3 -0
- package/containers/PurchaseOrderStatus.js +4 -0
- package/containers/PurchaseOrderStatus.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/data/models/customer-order-model.d.ts +0 -1
- package/data/models/purchase-order-model.d.ts +228 -14
- package/hooks/index.d.ts +1 -0
- package/hooks/usePurchaseOrderStatus.d.ts +4 -0
- package/i18n/en_US.json.d.ts +64 -4
- package/mocks/storybook/events-data.d.ts +1 -5
- package/package.json +1 -1
- package/render.js +2 -2
- package/render.js.map +1 -1
- package/types/components/index.d.ts +1 -0
- package/types/components/purchaseOrderStatusContent.types.d.ts +17 -0
- package/types/containers/index.d.ts +1 -0
- package/types/containers/purchaseOrderStatus.types.d.ts +18 -0
- package/types/hooks/index.d.ts +1 -0
- package/types/hooks/usePurchaseOrderStatus.types.d.ts +19 -0
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export declare const GET_PURCHASE_ORDER
|
|
17
|
+
export declare const GET_PURCHASE_ORDER: string;
|
|
18
18
|
//# sourceMappingURL=getPurchaseOrder.graphql.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* Limited Quote fragment for Purchase Order context
|
|
19
|
+
* Some fields from full Cart type may not be available in purchase_order.quote
|
|
20
|
+
*/
|
|
21
|
+
export declare const PURCHASE_ORDER_QUOTE_FRAGMENT = "\n fragment PURCHASE_ORDER_QUOTE_FRAGMENT on Cart {\n __typename\n id\n email\n is_virtual\n total_quantity\n applied_coupons {\n code\n }\n applied_gift_cards {\n code\n applied_balance {\n value\n currency\n }\n current_balance {\n value\n currency\n }\n expiration_date\n }\n applied_reward_points {\n money {\n value\n currency\n }\n points\n }\n applied_store_credit {\n applied_balance {\n value\n currency\n }\n current_balance {\n value\n currency\n }\n }\n available_gift_wrappings {\n uid\n design\n price {\n value\n currency\n }\n image {\n url\n label\n }\n }\n gift_message {\n from\n to\n message\n }\n gift_receipt_included\n gift_wrapping {\n uid\n design\n price {\n value\n currency\n }\n image {\n url\n label\n }\n }\n printed_card_included\n available_payment_methods {\n code\n title\n is_deferred\n }\n selected_payment_method {\n code\n title\n }\n billing_address {\n city\n company\n country {\n code\n label\n }\n firstname\n lastname\n postcode\n region {\n code\n label\n }\n street\n telephone\n custom_attributes {\n code\n }\n fax\n id\n middlename\n prefix\n suffix\n uid\n vat_id\n }\n shipping_addresses {\n city\n company\n country {\n code\n label\n }\n firstname\n lastname\n postcode\n region {\n code\n label\n }\n street\n telephone\n custom_attributes {\n code\n }\n fax\n id\n middlename\n prefix\n suffix\n uid\n vat_id\n available_shipping_methods {\n amount {\n value\n currency\n }\n carrier_code\n carrier_title\n method_code\n method_title\n }\n selected_shipping_method {\n amount {\n value\n currency\n }\n carrier_code\n carrier_title\n method_code\n method_title\n }\n }\n rules {\n uid\n }\n itemsV2(pageSize: 100, currentPage: 1) {\n items {\n uid\n quantity\n product {\n __typename\n uid\n name\n sku\n url_key\n canonical_url\n stock_status\n only_x_left_in_stock\n image {\n url\n label\n }\n small_image {\n url\n label\n }\n thumbnail {\n url\n label\n }\n price_range {\n maximum_price {\n regular_price {\n value\n currency\n }\n final_price {\n value\n currency\n }\n }\n }\n }\n prices {\n price {\n value\n currency\n }\n price_including_tax {\n value\n currency\n }\n original_item_price {\n value\n currency\n }\n original_row_total {\n value\n currency\n }\n row_total {\n value\n currency\n }\n row_total_including_tax {\n value\n currency\n }\n total_item_discount {\n value\n currency\n }\n discounts {\n label\n amount {\n value\n currency\n }\n }\n fixed_product_taxes {\n label\n amount {\n value\n currency\n }\n }\n }\n ... on SimpleCartItem {\n customizable_options {\n label\n values {\n label\n value\n }\n }\n }\n ... on ConfigurableCartItem {\n configurable_options {\n option_label\n value_label\n }\n }\n ... on BundleCartItem {\n bundle_options {\n uid\n label\n type\n values {\n uid\n label\n quantity\n }\n }\n }\n ... on DownloadableCartItem {\n links {\n uid\n title\n }\n }\n ... on GiftCardCartItem {\n sender_name\n sender_email\n recipient_name\n recipient_email\n message\n amount {\n value\n currency\n }\n }\n errors {\n code\n message\n }\n is_available\n max_qty\n min_qty\n not_available_message\n note_from_buyer {\n note_uid\n note\n created_at\n }\n note_from_seller {\n note_uid\n note\n created_at\n }\n }\n page_info {\n current_page\n page_size\n total_pages\n }\n total_count\n }\n prices {\n grand_total {\n value\n currency\n }\n grand_total_excluding_tax {\n value\n currency\n }\n subtotal_excluding_tax {\n value\n currency\n }\n subtotal_including_tax {\n value\n currency\n }\n subtotal_with_discount_excluding_tax {\n value\n currency\n }\n applied_taxes {\n label\n amount {\n value\n currency\n }\n }\n discounts {\n label\n amount {\n value\n currency\n }\n }\n gift_options {\n gift_wrapping_for_items {\n value\n currency\n }\n gift_wrapping_for_items_incl_tax {\n value\n currency\n }\n gift_wrapping_for_order {\n value\n currency\n }\n gift_wrapping_for_order_incl_tax {\n value\n currency\n }\n printed_card {\n value\n currency\n }\n printed_card_incl_tax {\n value\n currency\n }\n }\n }\n }\n";
|
|
22
|
+
//# sourceMappingURL=PurchaseOrderQuoteFragment.d.ts.map
|
package/api/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Lang } from '@dropins/tools/types/elsie/src/i18n';
|
|
|
3
3
|
|
|
4
4
|
type ConfigProps = {
|
|
5
5
|
langDefinitions?: Lang;
|
|
6
|
+
poRef?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const initialize: Initializer<ConfigProps>;
|
|
8
9
|
export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const PO_PERMISSIONS: {
|
|
2
|
+
PO_ALL: string;
|
|
3
|
+
VIEW_CUSTOMER: string;
|
|
4
|
+
VIEW_SUBORDINATES: string;
|
|
5
|
+
VIEW_COMPANY: string;
|
|
6
|
+
AUTO_APPROVE: string;
|
|
7
|
+
SUPER_APPROVE: string;
|
|
8
|
+
VIEW_RULES: string;
|
|
9
|
+
MANAGE_RULES: string;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=permissions.d.ts.map
|
package/api.js
CHANGED
|
@@ -1,19 +1,409 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{Initializer as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import{Initializer as D}from"@dropins/tools/lib.js";import{f as y,h as O}from"./chunks/fetch-graphql.js";import{g as m,r as rr,s as er,a as ar,b as tr}from"./chunks/fetch-graphql.js";import{h as R}from"./chunks/fetch-error.js";import{t as v,P as A}from"./chunks/rejectPurchaseOrders.js";import{a as ur,r as sr}from"./chunks/rejectPurchaseOrders.js";import{events as C}from"@dropins/tools/event-bus.js";import{c as _r,p as cr}from"./chunks/placeOrderForPurchaseOrder.js";import{a as nr,c as dr,g as pr,u as hr}from"./chunks/currencyInfo.js";import{d as gr,g as yr}from"./chunks/getPurchaseOrderApprovalRules.js";import{g as Rr}from"./chunks/getPurchaseOrders.js";import{g as Er}from"./chunks/getPurchaseOrderApprovalRule.js";import{P as br}from"./chunks/permissions.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-purchase-order-approval-rule.js";import"./chunks/case-converter.js";const S=`
|
|
4
|
+
fragment PURCHASE_ORDER_QUOTE_FRAGMENT on Cart {
|
|
5
|
+
__typename
|
|
6
|
+
id
|
|
7
|
+
email
|
|
8
|
+
is_virtual
|
|
9
|
+
total_quantity
|
|
10
|
+
applied_coupons {
|
|
11
|
+
code
|
|
12
|
+
}
|
|
13
|
+
applied_gift_cards {
|
|
14
|
+
code
|
|
15
|
+
applied_balance {
|
|
16
|
+
value
|
|
17
|
+
currency
|
|
8
18
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
current_balance {
|
|
20
|
+
value
|
|
21
|
+
currency
|
|
22
|
+
}
|
|
23
|
+
expiration_date
|
|
24
|
+
}
|
|
25
|
+
applied_reward_points {
|
|
26
|
+
money {
|
|
27
|
+
value
|
|
28
|
+
currency
|
|
29
|
+
}
|
|
30
|
+
points
|
|
31
|
+
}
|
|
32
|
+
applied_store_credit {
|
|
33
|
+
applied_balance {
|
|
34
|
+
value
|
|
35
|
+
currency
|
|
36
|
+
}
|
|
37
|
+
current_balance {
|
|
38
|
+
value
|
|
39
|
+
currency
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
available_gift_wrappings {
|
|
43
|
+
uid
|
|
44
|
+
design
|
|
45
|
+
price {
|
|
46
|
+
value
|
|
47
|
+
currency
|
|
48
|
+
}
|
|
49
|
+
image {
|
|
50
|
+
url
|
|
51
|
+
label
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
gift_message {
|
|
55
|
+
from
|
|
56
|
+
to
|
|
57
|
+
message
|
|
58
|
+
}
|
|
59
|
+
gift_receipt_included
|
|
60
|
+
gift_wrapping {
|
|
61
|
+
uid
|
|
62
|
+
design
|
|
63
|
+
price {
|
|
64
|
+
value
|
|
65
|
+
currency
|
|
66
|
+
}
|
|
67
|
+
image {
|
|
68
|
+
url
|
|
69
|
+
label
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
printed_card_included
|
|
73
|
+
available_payment_methods {
|
|
74
|
+
code
|
|
75
|
+
title
|
|
76
|
+
is_deferred
|
|
77
|
+
}
|
|
78
|
+
selected_payment_method {
|
|
79
|
+
code
|
|
80
|
+
title
|
|
81
|
+
}
|
|
82
|
+
billing_address {
|
|
83
|
+
city
|
|
84
|
+
company
|
|
85
|
+
country {
|
|
86
|
+
code
|
|
87
|
+
label
|
|
88
|
+
}
|
|
89
|
+
firstname
|
|
90
|
+
lastname
|
|
91
|
+
postcode
|
|
92
|
+
region {
|
|
93
|
+
code
|
|
94
|
+
label
|
|
95
|
+
}
|
|
96
|
+
street
|
|
97
|
+
telephone
|
|
98
|
+
custom_attributes {
|
|
99
|
+
code
|
|
100
|
+
}
|
|
101
|
+
fax
|
|
102
|
+
id
|
|
103
|
+
middlename
|
|
104
|
+
prefix
|
|
105
|
+
suffix
|
|
106
|
+
uid
|
|
107
|
+
vat_id
|
|
108
|
+
}
|
|
109
|
+
shipping_addresses {
|
|
110
|
+
city
|
|
111
|
+
company
|
|
112
|
+
country {
|
|
113
|
+
code
|
|
114
|
+
label
|
|
115
|
+
}
|
|
116
|
+
firstname
|
|
117
|
+
lastname
|
|
118
|
+
postcode
|
|
119
|
+
region {
|
|
120
|
+
code
|
|
121
|
+
label
|
|
122
|
+
}
|
|
123
|
+
street
|
|
124
|
+
telephone
|
|
125
|
+
custom_attributes {
|
|
126
|
+
code
|
|
127
|
+
}
|
|
128
|
+
fax
|
|
129
|
+
id
|
|
130
|
+
middlename
|
|
131
|
+
prefix
|
|
132
|
+
suffix
|
|
133
|
+
uid
|
|
134
|
+
vat_id
|
|
135
|
+
available_shipping_methods {
|
|
136
|
+
amount {
|
|
137
|
+
value
|
|
138
|
+
currency
|
|
139
|
+
}
|
|
140
|
+
carrier_code
|
|
141
|
+
carrier_title
|
|
142
|
+
method_code
|
|
143
|
+
method_title
|
|
144
|
+
}
|
|
145
|
+
selected_shipping_method {
|
|
146
|
+
amount {
|
|
147
|
+
value
|
|
148
|
+
currency
|
|
149
|
+
}
|
|
150
|
+
carrier_code
|
|
151
|
+
carrier_title
|
|
152
|
+
method_code
|
|
153
|
+
method_title
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
rules {
|
|
157
|
+
uid
|
|
158
|
+
}
|
|
159
|
+
itemsV2(pageSize: 100, currentPage: 1) {
|
|
160
|
+
items {
|
|
161
|
+
uid
|
|
162
|
+
quantity
|
|
163
|
+
product {
|
|
164
|
+
__typename
|
|
165
|
+
uid
|
|
166
|
+
name
|
|
167
|
+
sku
|
|
168
|
+
url_key
|
|
169
|
+
canonical_url
|
|
170
|
+
stock_status
|
|
171
|
+
only_x_left_in_stock
|
|
172
|
+
image {
|
|
173
|
+
url
|
|
174
|
+
label
|
|
175
|
+
}
|
|
176
|
+
small_image {
|
|
177
|
+
url
|
|
178
|
+
label
|
|
179
|
+
}
|
|
180
|
+
thumbnail {
|
|
181
|
+
url
|
|
182
|
+
label
|
|
183
|
+
}
|
|
184
|
+
price_range {
|
|
185
|
+
maximum_price {
|
|
186
|
+
regular_price {
|
|
187
|
+
value
|
|
188
|
+
currency
|
|
189
|
+
}
|
|
190
|
+
final_price {
|
|
191
|
+
value
|
|
192
|
+
currency
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
prices {
|
|
198
|
+
price {
|
|
199
|
+
value
|
|
200
|
+
currency
|
|
201
|
+
}
|
|
202
|
+
price_including_tax {
|
|
203
|
+
value
|
|
204
|
+
currency
|
|
205
|
+
}
|
|
206
|
+
original_item_price {
|
|
207
|
+
value
|
|
208
|
+
currency
|
|
209
|
+
}
|
|
210
|
+
original_row_total {
|
|
211
|
+
value
|
|
212
|
+
currency
|
|
213
|
+
}
|
|
214
|
+
row_total {
|
|
215
|
+
value
|
|
216
|
+
currency
|
|
217
|
+
}
|
|
218
|
+
row_total_including_tax {
|
|
219
|
+
value
|
|
220
|
+
currency
|
|
221
|
+
}
|
|
222
|
+
total_item_discount {
|
|
223
|
+
value
|
|
224
|
+
currency
|
|
225
|
+
}
|
|
226
|
+
discounts {
|
|
227
|
+
label
|
|
228
|
+
amount {
|
|
229
|
+
value
|
|
230
|
+
currency
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
fixed_product_taxes {
|
|
234
|
+
label
|
|
235
|
+
amount {
|
|
236
|
+
value
|
|
237
|
+
currency
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
... on SimpleCartItem {
|
|
242
|
+
customizable_options {
|
|
243
|
+
label
|
|
244
|
+
values {
|
|
245
|
+
label
|
|
246
|
+
value
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
... on ConfigurableCartItem {
|
|
251
|
+
configurable_options {
|
|
252
|
+
option_label
|
|
253
|
+
value_label
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
... on BundleCartItem {
|
|
257
|
+
bundle_options {
|
|
258
|
+
uid
|
|
259
|
+
label
|
|
260
|
+
type
|
|
261
|
+
values {
|
|
262
|
+
uid
|
|
263
|
+
label
|
|
264
|
+
quantity
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
... on DownloadableCartItem {
|
|
269
|
+
links {
|
|
270
|
+
uid
|
|
271
|
+
title
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
... on GiftCardCartItem {
|
|
275
|
+
sender_name
|
|
276
|
+
sender_email
|
|
277
|
+
recipient_name
|
|
278
|
+
recipient_email
|
|
279
|
+
message
|
|
280
|
+
amount {
|
|
281
|
+
value
|
|
282
|
+
currency
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
errors {
|
|
286
|
+
code
|
|
287
|
+
message
|
|
288
|
+
}
|
|
289
|
+
is_available
|
|
290
|
+
max_qty
|
|
291
|
+
min_qty
|
|
292
|
+
not_available_message
|
|
293
|
+
note_from_buyer {
|
|
294
|
+
note_uid
|
|
295
|
+
note
|
|
296
|
+
created_at
|
|
297
|
+
}
|
|
298
|
+
note_from_seller {
|
|
299
|
+
note_uid
|
|
300
|
+
note
|
|
301
|
+
created_at
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
page_info {
|
|
305
|
+
current_page
|
|
306
|
+
page_size
|
|
307
|
+
total_pages
|
|
308
|
+
}
|
|
309
|
+
total_count
|
|
310
|
+
}
|
|
311
|
+
prices {
|
|
312
|
+
grand_total {
|
|
313
|
+
value
|
|
314
|
+
currency
|
|
315
|
+
}
|
|
316
|
+
grand_total_excluding_tax {
|
|
317
|
+
value
|
|
318
|
+
currency
|
|
319
|
+
}
|
|
320
|
+
subtotal_excluding_tax {
|
|
321
|
+
value
|
|
322
|
+
currency
|
|
323
|
+
}
|
|
324
|
+
subtotal_including_tax {
|
|
325
|
+
value
|
|
326
|
+
currency
|
|
327
|
+
}
|
|
328
|
+
subtotal_with_discount_excluding_tax {
|
|
329
|
+
value
|
|
330
|
+
currency
|
|
331
|
+
}
|
|
332
|
+
applied_taxes {
|
|
333
|
+
label
|
|
334
|
+
amount {
|
|
335
|
+
value
|
|
336
|
+
currency
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
discounts {
|
|
340
|
+
label
|
|
341
|
+
amount {
|
|
342
|
+
value
|
|
343
|
+
currency
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
gift_options {
|
|
347
|
+
gift_wrapping_for_items {
|
|
348
|
+
value
|
|
349
|
+
currency
|
|
350
|
+
}
|
|
351
|
+
gift_wrapping_for_items_incl_tax {
|
|
352
|
+
value
|
|
353
|
+
currency
|
|
354
|
+
}
|
|
355
|
+
gift_wrapping_for_order {
|
|
356
|
+
value
|
|
357
|
+
currency
|
|
358
|
+
}
|
|
359
|
+
gift_wrapping_for_order_incl_tax {
|
|
360
|
+
value
|
|
361
|
+
currency
|
|
362
|
+
}
|
|
363
|
+
printed_card {
|
|
364
|
+
value
|
|
365
|
+
currency
|
|
366
|
+
}
|
|
367
|
+
printed_card_incl_tax {
|
|
368
|
+
value
|
|
369
|
+
currency
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
`,I=`
|
|
375
|
+
query GET_PURCHASE_ORDER($uid: ID!) {
|
|
376
|
+
customer {
|
|
377
|
+
purchase_order(uid: $uid) {
|
|
378
|
+
uid
|
|
379
|
+
number
|
|
380
|
+
created_at
|
|
381
|
+
updated_at
|
|
382
|
+
status
|
|
383
|
+
available_actions
|
|
384
|
+
created_by {
|
|
385
|
+
firstname
|
|
386
|
+
lastname
|
|
387
|
+
email
|
|
388
|
+
}
|
|
389
|
+
order {
|
|
390
|
+
id
|
|
391
|
+
number
|
|
392
|
+
total {
|
|
393
|
+
grand_total {
|
|
394
|
+
value
|
|
395
|
+
currency
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
quote {
|
|
400
|
+
...PURCHASE_ORDER_QUOTE_FRAGMENT
|
|
401
|
+
}
|
|
12
402
|
}
|
|
13
403
|
}
|
|
14
404
|
}
|
|
15
|
-
${
|
|
16
|
-
`,
|
|
405
|
+
${S}
|
|
406
|
+
`,U=async r=>{if(!r||r.trim()==="")throw new Error("Purchase Order UID is required");return y(I,{variables:{uid:r}}).then(i=>{var t,a,e;(t=i.errors)!=null&&t.length&&R(i.errors);const l=(e=(a=i.data)==null?void 0:a.customer)==null?void 0:e.purchase_order;if(!l)throw new Error("Failed to get purchase order");return{purchaseOrder:v(l)}}).catch(O)},w=new D({init:async r=>{var t,a;const i={};if(w.config.setConfig({...i,...r}),typeof(r==null?void 0:r.poRef)=="string"&&r.poRef.trim()!==""){const e=await U(r.poRef);(t=e==null?void 0:e.purchaseOrder)!=null&&t.quote&&C.emit("order/data",{...e.purchaseOrder.quote,poNumber:(a=e==null?void 0:e.purchaseOrder)==null?void 0:a.number})}},listeners:()=>[]}),B=w.config,T=`
|
|
17
407
|
mutation VALIDATE_PURCHASE_ORDERS($input: ValidatePurchaseOrdersInput!) {
|
|
18
408
|
validatePurchaseOrders(input: $input) {
|
|
19
409
|
errors {
|
|
@@ -25,8 +415,8 @@ import{Initializer as y}from"@dropins/tools/lib.js";import{f as P,h as A}from"./
|
|
|
25
415
|
}
|
|
26
416
|
}
|
|
27
417
|
}
|
|
28
|
-
${
|
|
29
|
-
`,
|
|
418
|
+
${A}
|
|
419
|
+
`,J=async r=>{const i=Array.isArray(r)?r:[r];if(!i||i.length===0)throw new Error("Purchase Order UID(s) are required");if(i.some(t=>!t||t.trim()===""))throw new Error("All Purchase Order UIDs must be valid");return y(T,{variables:{input:{purchase_order_uids:i}}}).then(t=>{var e,_;(e=t.errors)!=null&&e.length&&R(t.errors);const a=(_=t.data)==null?void 0:_.validatePurchaseOrders;return{errors:((a==null?void 0:a.errors)??[]).map(s=>({message:(s==null?void 0:s.message)??"",type:(s==null?void 0:s.type)??""})),purchaseOrders:((a==null?void 0:a.purchase_orders)||[]).map(v)}}).catch(O)},q=`
|
|
30
420
|
mutation ADD_PURCHASE_ORDER_COMMENT(
|
|
31
421
|
$purchaseOrderUid: ID!
|
|
32
422
|
$comment: String!
|
|
@@ -58,7 +448,7 @@ import{Initializer as y}from"@dropins/tools/lib.js";import{f as P,h as A}from"./
|
|
|
58
448
|
}
|
|
59
449
|
}
|
|
60
450
|
}
|
|
61
|
-
|
|
451
|
+
`,H=r=>{var l,t,a,e,_,s,c,o,n,d,p,h,f,g,E;const i=((t=(l=r==null?void 0:r.cart)==null?void 0:l.itemsV2)==null?void 0:t.items)??[];return{cart:{id:((a=r==null?void 0:r.cart)==null?void 0:a.id)??"",items:i.map(u=>{var P,b,x;return{uid:(u==null?void 0:u.uid)??"",quantity:(u==null?void 0:u.quantity)??0,product:{uid:((P=u==null?void 0:u.product)==null?void 0:P.uid)??"",name:((b=u==null?void 0:u.product)==null?void 0:b.name)??"",sku:((x=u==null?void 0:u.product)==null?void 0:x.sku)??""}}}),pagination:{currentPage:((s=(_=(e=r==null?void 0:r.cart)==null?void 0:e.itemsV2)==null?void 0:_.page_info)==null?void 0:s.current_page)??1,pageSize:((n=(o=(c=r==null?void 0:r.cart)==null?void 0:c.itemsV2)==null?void 0:o.page_info)==null?void 0:n.page_size)??20,totalPages:((h=(p=(d=r==null?void 0:r.cart)==null?void 0:d.itemsV2)==null?void 0:p.page_info)==null?void 0:h.total_pages)??0,totalCount:((g=(f=r==null?void 0:r.cart)==null?void 0:f.itemsV2)==null?void 0:g.total_count)??0}},userErrors:((E=r==null?void 0:r.user_errors)==null?void 0:E.map(u=>({message:(u==null?void 0:u.message)??""})))??[]}},$=r=>{var i,l,t,a,e,_,s,c,o,n,d,p,h,f,g;return{createdAt:(r==null?void 0:r.created_at)??"",text:(r==null?void 0:r.text)??"",uid:(r==null?void 0:r.uid)??"",author:{allowRemoteShoppingAssistance:((i=r==null?void 0:r.author)==null?void 0:i.allow_remote_shopping_assistance)??!1,confirmationStatus:((l=r==null?void 0:r.author)==null?void 0:l.confirmation_status)??"",createdAt:((t=r==null?void 0:r.author)==null?void 0:t.created_at)??"",dateOfBirth:((a=r==null?void 0:r.author)==null?void 0:a.date_of_birth)??"",email:((e=r==null?void 0:r.author)==null?void 0:e.email)??"",firstname:((_=r==null?void 0:r.author)==null?void 0:_.firstname)??"",gender:((s=r==null?void 0:r.author)==null?void 0:s.gender)??0,jobTitle:((c=r==null?void 0:r.author)==null?void 0:c.job_title)??"",lastname:((o=r==null?void 0:r.author)==null?void 0:o.lastname)??"",middlename:((n=r==null?void 0:r.author)==null?void 0:n.middlename)??"",prefix:((d=r==null?void 0:r.author)==null?void 0:d.prefix)??"",status:((p=r==null?void 0:r.author)==null?void 0:p.status)??"",structureId:((h=r==null?void 0:r.author)==null?void 0:h.structure_id)??"",suffix:((f=r==null?void 0:r.author)==null?void 0:f.suffix)??"",telephone:((g=r==null?void 0:r.author)==null?void 0:g.telephone)??""}}},K=async(r,i)=>{if(!r)throw new Error("Purchase Order ID is required");if(!i)throw new Error("Comment text is required");return y(q,{variables:{purchaseOrderUid:r,comment:i}}).then(t=>{var a,e,_;return(a=t.errors)!=null&&a.length&&R(t.errors),$((_=(e=t.data)==null?void 0:e.addPurchaseOrderComment)==null?void 0:_.comment)}).catch(O)},M=`
|
|
62
452
|
mutation ADD_PURCHASE_ORDER_ITEMS_TO_CART(
|
|
63
453
|
$purchaseOrderUid: ID!
|
|
64
454
|
$cartId: String!
|
|
@@ -93,65 +483,7 @@ import{Initializer as y}from"@dropins/tools/lib.js";import{f as P,h as A}from"./
|
|
|
93
483
|
}
|
|
94
484
|
}
|
|
95
485
|
}
|
|
96
|
-
`,
|
|
97
|
-
query GET_PURCHASE_ORDER($uid: ID!) {
|
|
98
|
-
customer {
|
|
99
|
-
purchase_order(uid: $uid) {
|
|
100
|
-
uid
|
|
101
|
-
number
|
|
102
|
-
created_at
|
|
103
|
-
updated_at
|
|
104
|
-
status
|
|
105
|
-
available_actions
|
|
106
|
-
created_by {
|
|
107
|
-
firstname
|
|
108
|
-
lastname
|
|
109
|
-
email
|
|
110
|
-
}
|
|
111
|
-
order {
|
|
112
|
-
id
|
|
113
|
-
number
|
|
114
|
-
total {
|
|
115
|
-
grand_total {
|
|
116
|
-
value
|
|
117
|
-
currency
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
quote {
|
|
122
|
-
prices {
|
|
123
|
-
grand_total {
|
|
124
|
-
value
|
|
125
|
-
currency
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
`,Z=async e=>{if(!e||e.trim()==="")throw new Error("Purchase Order UID is required");return P(F,{variables:{uid:e}}).then(n=>{var s,i,l;(s=n.errors)!=null&&s.length&&a(n.errors);const u=(l=(i=n.data)==null?void 0:i.customer)==null?void 0:l.purchase_order;if(!u)throw new Error("Failed to get purchase order");return{purchaseOrder:D(u)}}).catch(A)},M=`
|
|
133
|
-
mutation PLACE_ORDER_FOR_PURCHASE_ORDER(
|
|
134
|
-
$input: PlaceOrderForPurchaseOrderInput!
|
|
135
|
-
) {
|
|
136
|
-
placeOrderForPurchaseOrder(input: $input) {
|
|
137
|
-
order {
|
|
138
|
-
available_actions
|
|
139
|
-
carrier
|
|
140
|
-
email
|
|
141
|
-
gift_receipt_included
|
|
142
|
-
id
|
|
143
|
-
is_virtual
|
|
144
|
-
number
|
|
145
|
-
order_date
|
|
146
|
-
order_status_change_date
|
|
147
|
-
printed_card_included
|
|
148
|
-
shipping_method
|
|
149
|
-
status
|
|
150
|
-
token
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
`,d=async e=>{var u;if(!e||e.trim()==="")throw new Error("Purchase Order UID is required");const n={purchase_order_uid:e};try{const s=await P(M,{variables:{input:n}});return(u=s.errors)!=null&&u.length&&a(s.errors),x(s)}catch(s){throw A(s)}},G=`
|
|
486
|
+
`,W=async(r,i,l=!1)=>{if(!r)throw new Error("Purchase Order UID is required");if(!i)throw new Error("Cart ID is required");return y(M,{variables:{purchaseOrderUid:r,cartId:i,replaceExistingCartItems:l}}).then(a=>{var _,s;(_=a.errors)!=null&&_.length&&R(a.errors);const e=(s=a.data)==null?void 0:s.addPurchaseOrderItemsToCart;if(!(e!=null&&e.cart))throw new Error("Failed to add purchase order items to cart");return H(e)}).catch(O)},F=`
|
|
155
487
|
mutation PLACE_PURCHASE_ORDER($input: PlacePurchaseOrderInput!) {
|
|
156
488
|
placePurchaseOrder(input: $input) {
|
|
157
489
|
purchase_order {
|
|
@@ -159,6 +491,6 @@ import{Initializer as y}from"@dropins/tools/lib.js";import{f as P,h as A}from"./
|
|
|
159
491
|
}
|
|
160
492
|
}
|
|
161
493
|
}
|
|
162
|
-
${
|
|
163
|
-
`,
|
|
494
|
+
${A}
|
|
495
|
+
`,X=async r=>{if(!r||r.trim()==="")throw new Error("Cart ID is required");return y(F,{variables:{input:{cart_id:r}}}).then(l=>{var e,_,s;(e=l.errors)!=null&&e.length&&R(l.errors);const t=(s=(_=l.data)==null?void 0:_.placePurchaseOrder)==null?void 0:s.purchase_order,a=v(t);return C.emit("purchase-order/placed",a),{purchaseOrder:a}}).catch(O)};export{br as PO_PERMISSIONS,K as addPurchaseOrderComment,W as addPurchaseOrderItemsToCart,ur as approvePurchaseOrders,_r as cancelPurchaseOrders,B as config,nr as createPurchaseOrderApprovalRule,dr as currencyInfo,gr as deletePurchaseOrderApprovalRule,y as fetchGraphQl,m as getConfig,U as getPurchaseOrder,Er as getPurchaseOrderApprovalRule,pr as getPurchaseOrderApprovalRuleMetadata,yr as getPurchaseOrderApprovalRules,Rr as getPurchaseOrders,w as initialize,cr as placeOrderForPurchaseOrder,X as placePurchaseOrder,sr as rejectPurchaseOrders,rr as removeFetchGraphQlHeader,er as setEndpoint,ar as setFetchGraphQlHeader,tr as setFetchGraphQlHeaders,hr as updatePurchaseOrderApprovalRule,J as validatePurchaseOrders};
|
|
164
496
|
//# sourceMappingURL=api.js.map
|