@dropins/storefront-purchase-order 0.0.5-alpha10 → 0.0.5-alpha11
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/fetch-graphql/fetch-graphql.d.ts +16 -0
- package/api/fetch-graphql/index.d.ts +16 -0
- package/api/graphql/PurchaseOrdersFragment.graphql.d.ts +1 -1
- package/api/initialize/index.d.ts +16 -0
- package/api/permissions.d.ts +16 -0
- package/api.js +10 -404
- package/api.js.map +1 -1
- package/chunks/FormLoader.js +1 -1
- package/chunks/FormLoader.js.map +1 -1
- package/chunks/PurchaseOrderHistoryLogContent.js +4 -0
- package/chunks/PurchaseOrderHistoryLogContent.js.map +1 -0
- package/chunks/PurchaseOrdersHeader.js +1 -1
- package/chunks/PurchaseOrdersHeader.js.map +1 -1
- package/chunks/PurchaseOrdersTableActions.js +1 -1
- package/chunks/PurchaseOrdersTableActions.js.map +1 -1
- package/chunks/fetch-graphql.js.map +1 -1
- package/chunks/formatDate.js +4 -0
- package/chunks/formatDate.js.map +1 -0
- package/chunks/pageSize.config.js +1 -1
- package/chunks/pageSize.config.js.map +1 -1
- package/chunks/permissions.js.map +1 -1
- package/chunks/rejectPurchaseOrders.js +382 -21
- package/chunks/rejectPurchaseOrders.js.map +1 -1
- package/chunks/transform-purchase-order-approval-rule.js.map +1 -1
- package/chunks/usePurchaseOrders.js +1 -1
- package/chunks/usePurchaseOrders.js.map +1 -1
- package/components/ApprovalRuleDetailsContent/index.d.ts +11 -3
- package/components/ApprovalRuleForm/index.d.ts +11 -3
- package/components/PurchaseOrderHistoryLogContent/PurchaseOrderHistoryLogContent.d.ts +5 -0
- package/components/PurchaseOrderHistoryLogContent/index.d.ts +19 -0
- package/components/index.d.ts +1 -0
- package/containers/ApprovalRuleDetails/index.d.ts +11 -3
- package/containers/ApprovalRuleDetails.js +1 -1
- package/containers/ApprovalRuleDetails.js.map +1 -1
- package/containers/ApprovalRuleForm/index.d.ts +11 -3
- 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/PurchaseOrderConfirmation.js +1 -1
- package/containers/PurchaseOrderConfirmation.js.map +1 -1
- package/containers/PurchaseOrderHistoryLog/PurchaseOrderHistoryLog.d.ts +5 -0
- package/containers/PurchaseOrderHistoryLog/index.d.ts +19 -0
- package/containers/PurchaseOrderHistoryLog.d.ts +3 -0
- package/containers/PurchaseOrderHistoryLog.js +4 -0
- package/containers/PurchaseOrderHistoryLog.js.map +1 -0
- package/containers/PurchaseOrderStatus.js +1 -1
- package/containers/PurchaseOrderStatus.js.map +1 -1
- 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/usePurchaseOrderData.d.ts +7 -0
- package/i18n/en_US.json.d.ts +18 -0
- package/lib/cleanAndDeep.d.ts +16 -0
- package/lib/getRange.d.ts +16 -0
- package/lib/index.d.ts +16 -0
- package/lib/isValidUrl.d.ts +16 -0
- package/mocks/index.d.ts +16 -0
- package/mocks/storybook/events-data.d.ts +16 -0
- package/package.json +1 -1
- package/render/index.d.ts +16 -0
- package/render.js +2 -2
- package/render.js.map +1 -1
- package/types/api/api.enums.types.d.ts +16 -0
- package/types/api/index.d.ts +16 -0
- package/types/components/index.d.ts +17 -0
- package/types/components/purchaseOrderHistoryLogContent.types.d.ts +7 -0
- package/types/components/purchaseOrdersTableActions.d.ts +16 -0
- package/types/containers/approvalRuleDetailsProps.types.d.ts +16 -0
- package/types/containers/index.d.ts +17 -0
- package/types/containers/purchaseOrderHistoryLog.types.d.ts +23 -0
- package/types/hooks/index.d.ts +16 -0
- package/types/hooks/useApprovalRuleDetails.types.d.ts +16 -0
- package/chunks/FormLoader2.js +0 -4
- package/chunks/FormLoader2.js.map +0 -1
|
@@ -1,3 +1,19 @@
|
|
|
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
|
+
*******************************************************************/
|
|
1
17
|
export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, setFetchGraphQlHeaders: (header: import('@adobe-commerce/fetch-graphql').Header | ((prev: import('@adobe-commerce/fetch-graphql').Header) => import('@adobe-commerce/fetch-graphql').Header)) => void, fetchGraphQl: <T = any>(query: string, options?: import('@adobe-commerce/fetch-graphql').FetchOptions | undefined) => Promise<{
|
|
2
18
|
errors?: import('@adobe-commerce/fetch-graphql').FetchQueryError | undefined;
|
|
3
19
|
data: T;
|
|
@@ -1,2 +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
|
+
*******************************************************************/
|
|
1
17
|
export * from './fetch-graphql';
|
|
2
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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 PURCHASE_ORDERS_FRAGMENT
|
|
17
|
+
export declare const PURCHASE_ORDERS_FRAGMENT: string;
|
|
18
18
|
//# sourceMappingURL=PurchaseOrdersFragment.graphql.d.ts.map
|
|
@@ -1,2 +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
|
+
*******************************************************************/
|
|
1
17
|
export * from './initialize';
|
|
2
18
|
//# sourceMappingURL=index.d.ts.map
|
package/api/permissions.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
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
|
+
*******************************************************************/
|
|
1
17
|
export declare const PO_PERMISSIONS: {
|
|
2
18
|
PO_ALL: string;
|
|
3
19
|
VIEW_CUSTOMER: string;
|
package/api.js
CHANGED
|
@@ -1,409 +1,15 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{Initializer as
|
|
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
|
|
18
|
-
}
|
|
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=`
|
|
3
|
+
import{Initializer as U}from"@dropins/tools/lib.js";import{f as R,h as E}from"./chunks/fetch-graphql.js";import{g as Z,r as m,s as rr,a as er,b as ar}from"./chunks/fetch-graphql.js";import{h as P}from"./chunks/fetch-error.js";import{P as g,t as A}from"./chunks/rejectPurchaseOrders.js";import{a as tr,r as ur}from"./chunks/rejectPurchaseOrders.js";import{events as I}from"@dropins/tools/event-bus.js";import{c as hr,p as dr}from"./chunks/placeOrderForPurchaseOrder.js";import{a as or,c as _r,g as lr,u as cr}from"./chunks/currencyInfo.js";import{d as Or,g as nr}from"./chunks/getPurchaseOrderApprovalRules.js";import{g as Er}from"./chunks/getPurchaseOrders.js";import{g as gr}from"./chunks/getPurchaseOrderApprovalRule.js";import{P as Cr}from"./chunks/permissions.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-purchase-order-approval-rule.js";import"./chunks/case-converter.js";const v=`
|
|
375
4
|
query GET_PURCHASE_ORDER($uid: ID!) {
|
|
376
5
|
customer {
|
|
377
6
|
purchase_order(uid: $uid) {
|
|
378
|
-
|
|
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
|
-
}
|
|
7
|
+
...PURCHASE_ORDERS_FRAGMENT
|
|
402
8
|
}
|
|
403
9
|
}
|
|
404
10
|
}
|
|
405
|
-
${
|
|
406
|
-
`,
|
|
11
|
+
${g}
|
|
12
|
+
`,T=async r=>{if(!r||r.trim()==="")throw new Error("Purchase Order UID is required");return R(v,{variables:{uid:r}}).then(t=>{var s,a,e;(s=t.errors)!=null&&s.length&&P(t.errors);const h=(e=(a=t.data)==null?void 0:a.customer)==null?void 0:e.purchase_order;if(!h)throw new Error("Failed to get purchase order");return{purchaseOrder:A(h)}}).catch(E)},x=new U({init:async r=>{var s,a;const t={};if(x.config.setConfig({...t,...r}),typeof(r==null?void 0:r.poRef)=="string"&&r.poRef.trim()!==""){const e=await T(r.poRef);(s=e==null?void 0:e.purchaseOrder)!=null&&s.quote&&I.emit("order/data",{...e.purchaseOrder.quote,poNumber:(a=e==null?void 0:e.purchaseOrder)==null?void 0:a.number})}},listeners:()=>[]}),Q=x.config,$=`
|
|
407
13
|
mutation VALIDATE_PURCHASE_ORDERS($input: ValidatePurchaseOrdersInput!) {
|
|
408
14
|
validatePurchaseOrders(input: $input) {
|
|
409
15
|
errors {
|
|
@@ -415,8 +21,8 @@ import{Initializer as D}from"@dropins/tools/lib.js";import{f as y,h as O}from"./
|
|
|
415
21
|
}
|
|
416
22
|
}
|
|
417
23
|
}
|
|
418
|
-
${
|
|
419
|
-
`,
|
|
24
|
+
${g}
|
|
25
|
+
`,B=async r=>{const t=Array.isArray(r)?r:[r];if(!t||t.length===0)throw new Error("Purchase Order UID(s) are required");if(t.some(s=>!s||s.trim()===""))throw new Error("All Purchase Order UIDs must be valid");return R($,{variables:{input:{purchase_order_uids:t}}}).then(s=>{var e,d;(e=s.errors)!=null&&e.length&&P(s.errors);const a=(d=s.data)==null?void 0:d.validatePurchaseOrders;return{errors:((a==null?void 0:a.errors)??[]).map(i=>({message:(i==null?void 0:i.message)??"",type:(i==null?void 0:i.type)??""})),purchaseOrders:((a==null?void 0:a.purchase_orders)||[]).map(A)}}).catch(E)},y=`
|
|
420
26
|
mutation ADD_PURCHASE_ORDER_COMMENT(
|
|
421
27
|
$purchaseOrderUid: ID!
|
|
422
28
|
$comment: String!
|
|
@@ -448,7 +54,7 @@ import{Initializer as D}from"@dropins/tools/lib.js";import{f as y,h as O}from"./
|
|
|
448
54
|
}
|
|
449
55
|
}
|
|
450
56
|
}
|
|
451
|
-
`,H=r=>{var
|
|
57
|
+
`,H=r=>{var h,s,a,e,d,i,p,o,_,l,c,f,O,n,C;const t=((s=(h=r==null?void 0:r.cart)==null?void 0:h.itemsV2)==null?void 0:s.items)??[];return{cart:{id:((a=r==null?void 0:r.cart)==null?void 0:a.id)??"",items:t.map(u=>{var D,S,w;return{uid:(u==null?void 0:u.uid)??"",quantity:(u==null?void 0:u.quantity)??0,product:{uid:((D=u==null?void 0:u.product)==null?void 0:D.uid)??"",name:((S=u==null?void 0:u.product)==null?void 0:S.name)??"",sku:((w=u==null?void 0:u.product)==null?void 0:w.sku)??""}}}),pagination:{currentPage:((i=(d=(e=r==null?void 0:r.cart)==null?void 0:e.itemsV2)==null?void 0:d.page_info)==null?void 0:i.current_page)??1,pageSize:((_=(o=(p=r==null?void 0:r.cart)==null?void 0:p.itemsV2)==null?void 0:o.page_info)==null?void 0:_.page_size)??20,totalPages:((f=(c=(l=r==null?void 0:r.cart)==null?void 0:l.itemsV2)==null?void 0:c.page_info)==null?void 0:f.total_pages)??0,totalCount:((n=(O=r==null?void 0:r.cart)==null?void 0:O.itemsV2)==null?void 0:n.total_count)??0}},userErrors:((C=r==null?void 0:r.user_errors)==null?void 0:C.map(u=>({message:(u==null?void 0:u.message)??""})))??[]}},b=r=>{var t,h,s,a,e,d,i,p,o,_,l,c,f,O,n;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:((t=r==null?void 0:r.author)==null?void 0:t.allow_remote_shopping_assistance)??!1,confirmationStatus:((h=r==null?void 0:r.author)==null?void 0:h.confirmation_status)??"",createdAt:((s=r==null?void 0:r.author)==null?void 0:s.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:((d=r==null?void 0:r.author)==null?void 0:d.firstname)??"",gender:((i=r==null?void 0:r.author)==null?void 0:i.gender)??0,jobTitle:((p=r==null?void 0:r.author)==null?void 0:p.job_title)??"",lastname:((o=r==null?void 0:r.author)==null?void 0:o.lastname)??"",middlename:((_=r==null?void 0:r.author)==null?void 0:_.middlename)??"",prefix:((l=r==null?void 0:r.author)==null?void 0:l.prefix)??"",status:((c=r==null?void 0:r.author)==null?void 0:c.status)??"",structureId:((f=r==null?void 0:r.author)==null?void 0:f.structure_id)??"",suffix:((O=r==null?void 0:r.author)==null?void 0:O.suffix)??"",telephone:((n=r==null?void 0:r.author)==null?void 0:n.telephone)??""}}},J=async(r,t)=>{if(!r)throw new Error("Purchase Order ID is required");if(!t)throw new Error("Comment text is required");return R(y,{variables:{purchaseOrderUid:r,comment:t}}).then(s=>{var a,e,d;return(a=s.errors)!=null&&a.length&&P(s.errors),b((d=(e=s.data)==null?void 0:e.addPurchaseOrderComment)==null?void 0:d.comment)}).catch(E)},q=`
|
|
452
58
|
mutation ADD_PURCHASE_ORDER_ITEMS_TO_CART(
|
|
453
59
|
$purchaseOrderUid: ID!
|
|
454
60
|
$cartId: String!
|
|
@@ -483,7 +89,7 @@ import{Initializer as D}from"@dropins/tools/lib.js";import{f as y,h as O}from"./
|
|
|
483
89
|
}
|
|
484
90
|
}
|
|
485
91
|
}
|
|
486
|
-
`,
|
|
92
|
+
`,K=async(r,t,h=!1)=>{if(!r)throw new Error("Purchase Order UID is required");if(!t)throw new Error("Cart ID is required");return R(q,{variables:{purchaseOrderUid:r,cartId:t,replaceExistingCartItems:h}}).then(a=>{var d,i;(d=a.errors)!=null&&d.length&&P(a.errors);const e=(i=a.data)==null?void 0:i.addPurchaseOrderItemsToCart;if(!(e!=null&&e.cart))throw new Error("Failed to add purchase order items to cart");return H(e)}).catch(E)},M=`
|
|
487
93
|
mutation PLACE_PURCHASE_ORDER($input: PlacePurchaseOrderInput!) {
|
|
488
94
|
placePurchaseOrder(input: $input) {
|
|
489
95
|
purchase_order {
|
|
@@ -491,6 +97,6 @@ import{Initializer as D}from"@dropins/tools/lib.js";import{f as y,h as O}from"./
|
|
|
491
97
|
}
|
|
492
98
|
}
|
|
493
99
|
}
|
|
494
|
-
${
|
|
495
|
-
`,
|
|
100
|
+
${g}
|
|
101
|
+
`,W=async r=>{if(!r||r.trim()==="")throw new Error("Cart ID is required");return R(M,{variables:{input:{cart_id:r}}}).then(h=>{var e,d,i;(e=h.errors)!=null&&e.length&&P(h.errors);const s=(i=(d=h.data)==null?void 0:d.placePurchaseOrder)==null?void 0:i.purchase_order,a=A(s);return I.emit("purchase-order/placed",a),{purchaseOrder:a}}).catch(E)};export{Cr as PO_PERMISSIONS,J as addPurchaseOrderComment,K as addPurchaseOrderItemsToCart,tr as approvePurchaseOrders,hr as cancelPurchaseOrders,Q as config,or as createPurchaseOrderApprovalRule,_r as currencyInfo,Or as deletePurchaseOrderApprovalRule,R as fetchGraphQl,Z as getConfig,T as getPurchaseOrder,gr as getPurchaseOrderApprovalRule,lr as getPurchaseOrderApprovalRuleMetadata,nr as getPurchaseOrderApprovalRules,Er as getPurchaseOrders,x as initialize,dr as placeOrderForPurchaseOrder,W as placePurchaseOrder,ur as rejectPurchaseOrders,m as removeFetchGraphQlHeader,rr as setEndpoint,er as setFetchGraphQlHeader,ar as setFetchGraphQlHeaders,cr as updatePurchaseOrderApprovalRule,B as validatePurchaseOrders};
|
|
496
102
|
//# sourceMappingURL=api.js.map
|