@haus-storefront-react/vendure-plugin-configs 1.0.4-next.6 → 1.0.4-next.8

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/badge.js +1 -1
  3. package/badge.mjs +439 -424
  4. package/campaign.js +1 -1
  5. package/campaign.mjs +50 -106
  6. package/elastic.js +1 -1
  7. package/elastic.mjs +10 -26
  8. package/index.js +1 -1
  9. package/index.mjs +2 -4
  10. package/lib/configs/vendure-badge-plugin.d.ts +9 -1
  11. package/lib/configs/vendure-badge-plugin.types.d.ts +0 -1
  12. package/lib/configs/vendure-products-by-sku-plugin.d.ts +11 -0
  13. package/lib/configs/vendure-products-by-sku-plugin.types.d.ts +13 -0
  14. package/lib/configs/vendure-related-products-plugin.d.ts +39 -0
  15. package/lib/configs/vendure-related-products-plugin.types.d.ts +16 -0
  16. package/lib/exports/products-by-sku.d.ts +3 -0
  17. package/lib/exports/related-products.d.ts +3 -0
  18. package/lib/hooks/use-related-products.d.ts +2 -0
  19. package/lib/plugin-config.d.ts +1 -1
  20. package/lib/strategies/quick-order-variant-sku-validation-strategy.d.ts +6 -0
  21. package/package.json +19 -5
  22. package/packagesize.js +1 -1
  23. package/packagesize.mjs +15 -59
  24. package/plugin-config-DrQQb9Ry.js +1 -0
  25. package/plugin-config-DywohMgp.mjs +903 -0
  26. package/product-popularity.js +1 -1
  27. package/product-popularity.mjs +12 -22
  28. package/product-variant-specifications.js +1 -1
  29. package/product-variant-specifications.mjs +8 -18
  30. package/purchase-order-payment.js +5 -5
  31. package/purchase-order-payment.mjs +207 -631
  32. package/related-products.d.ts +2 -0
  33. package/related-products.js +1 -0
  34. package/related-products.mjs +36 -0
  35. package/src-BCHcjT-q.mjs +455 -0
  36. package/src-BqcrcEUL.mjs +2718 -0
  37. package/src-Cj3iGasO.js +6 -0
  38. package/src-CvZOxNaX.js +21 -0
  39. package/compiler-runtime-oPPev21o.js +0 -10
  40. package/compiler-runtime-qHgugrLy.mjs +0 -296
  41. package/index-BRlTlK6a.mjs +0 -3768
  42. package/index-BgBC_k8M.js +0 -1
  43. package/index-C0E-40z0.mjs +0 -19
  44. package/index-CgxqXyHf.js +0 -20
  45. package/useSdk-DOrZRSHz.mjs +0 -2634
  46. package/useSdk-YXpk8Wsi.js +0 -21
@@ -1,633 +1,209 @@
1
- import { u as O } from "./useSdk-DOrZRSHz.mjs";
2
- import { V as S } from "./index-BRlTlK6a.mjs";
3
- import { c as T } from "./compiler-runtime-qHgugrLy.mjs";
4
- import "react";
5
- import { useQueryClient as R, useMutation as _ } from "@tanstack/react-query";
6
- var p = /* @__PURE__ */ ((e) => (e.ACTIVE_ORDER = "activeOrder", e.ACTIVE_CHANNEL = "activeChannel", e.ACTIVE_CUSTOMER = "activeCustomer", e.ACTIVE_CUSTOMER_ORDERS = "activeCustomerOrders", e.AVAILABLE_COUNTRIES = "availableCountries", e.FACETS = "facets", e.ORDER_BY_CODE = "orderByCode", e.ORDER_STATES = "orderStates", e.PRODUCT = "product", e.PAYMENT_METHODS = "paymentMethods", e.SEARCH = "search", e.SEARCH_FIELD = "searchField", e.SHIPPING_METHODS = "shippingMethods", e))(p || {}), N = /* @__PURE__ */ ((e) => (e.AlreadyLoggedInError = "ALREADY_LOGGED_IN_ERROR", e.CouponCodeExpiredError = "COUPON_CODE_EXPIRED_ERROR", e.CouponCodeInvalidError = "COUPON_CODE_INVALID_ERROR", e.CouponCodeLimitError = "COUPON_CODE_LIMIT_ERROR", e.EmailAddressConflictError = "EMAIL_ADDRESS_CONFLICT_ERROR", e.GuestCheckoutError = "GUEST_CHECKOUT_ERROR", e.IdentifierChangeTokenExpiredError = "IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR", e.IdentifierChangeTokenInvalidError = "IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR", e.IneligiblePaymentMethodError = "INELIGIBLE_PAYMENT_METHOD_ERROR", e.IneligibleShippingMethodError = "INELIGIBLE_SHIPPING_METHOD_ERROR", e.InsufficientStockError = "INSUFFICIENT_STOCK_ERROR", e.InvalidCredentialsError = "INVALID_CREDENTIALS_ERROR", e.MissingPasswordError = "MISSING_PASSWORD_ERROR", e.NativeAuthStrategyError = "NATIVE_AUTH_STRATEGY_ERROR", e.NegativeQuantityError = "NEGATIVE_QUANTITY_ERROR", e.NotVerifiedError = "NOT_VERIFIED_ERROR", e.NoActiveOrderError = "NO_ACTIVE_ORDER_ERROR", e.OrderLimitError = "ORDER_LIMIT_ERROR", e.OrderModificationError = "ORDER_MODIFICATION_ERROR", e.OrderPaymentStateError = "ORDER_PAYMENT_STATE_ERROR", e.OrderStateTransitionError = "ORDER_STATE_TRANSITION_ERROR", e.PasswordAlreadySetError = "PASSWORD_ALREADY_SET_ERROR", e.PasswordResetTokenExpiredError = "PASSWORD_RESET_TOKEN_EXPIRED_ERROR", e.PasswordResetTokenInvalidError = "PASSWORD_RESET_TOKEN_INVALID_ERROR", e.PasswordValidationError = "PASSWORD_VALIDATION_ERROR", e.PaymentDeclinedError = "PAYMENT_DECLINED_ERROR", e.PaymentFailedError = "PAYMENT_FAILED_ERROR", e.UnknownError = "UNKNOWN_ERROR", e.VerificationTokenExpiredError = "VERIFICATION_TOKEN_EXPIRED_ERROR", e.VerificationTokenInvalidError = "VERIFICATION_TOKEN_INVALID_ERROR", e))(N || {});
7
- const g = (e, i) => {
8
- const d = R();
9
- return _(e, d);
10
- }, I = {
11
- kind: "Document",
12
- definitions: [{
13
- kind: "FragmentDefinition",
14
- name: {
15
- kind: "Name",
16
- value: "EligiblePaymentMethods"
17
- },
18
- typeCondition: {
19
- kind: "NamedType",
20
- name: {
21
- kind: "Name",
22
- value: "PaymentMethodQuote"
23
- }
24
- },
25
- selectionSet: {
26
- kind: "SelectionSet",
27
- selections: [{
28
- kind: "Field",
29
- name: {
30
- kind: "Name",
31
- value: "id"
32
- }
33
- }, {
34
- kind: "Field",
35
- name: {
36
- kind: "Name",
37
- value: "name"
38
- }
39
- }, {
40
- kind: "Field",
41
- name: {
42
- kind: "Name",
43
- value: "description"
44
- }
45
- }, {
46
- kind: "Field",
47
- name: {
48
- kind: "Name",
49
- value: "code"
50
- }
51
- }]
52
- }
53
- }]
54
- }, P = {
55
- kind: "Document",
56
- definitions: [{
57
- kind: "OperationDefinition",
58
- operation: "mutation",
59
- name: {
60
- kind: "Name",
61
- value: "login"
62
- },
63
- variableDefinitions: [{
64
- kind: "VariableDefinition",
65
- variable: {
66
- kind: "Variable",
67
- name: {
68
- kind: "Name",
69
- value: "email"
70
- }
71
- },
72
- type: {
73
- kind: "NonNullType",
74
- type: {
75
- kind: "NamedType",
76
- name: {
77
- kind: "Name",
78
- value: "String"
79
- }
80
- }
81
- }
82
- }, {
83
- kind: "VariableDefinition",
84
- variable: {
85
- kind: "Variable",
86
- name: {
87
- kind: "Name",
88
- value: "password"
89
- }
90
- },
91
- type: {
92
- kind: "NonNullType",
93
- type: {
94
- kind: "NamedType",
95
- name: {
96
- kind: "Name",
97
- value: "String"
98
- }
99
- }
100
- }
101
- }, {
102
- kind: "VariableDefinition",
103
- variable: {
104
- kind: "Variable",
105
- name: {
106
- kind: "Name",
107
- value: "rememberMe"
108
- }
109
- },
110
- type: {
111
- kind: "NamedType",
112
- name: {
113
- kind: "Name",
114
- value: "Boolean"
115
- }
116
- }
117
- }],
118
- selectionSet: {
119
- kind: "SelectionSet",
120
- selections: [{
121
- kind: "Field",
122
- name: {
123
- kind: "Name",
124
- value: "login"
125
- },
126
- arguments: [{
127
- kind: "Argument",
128
- name: {
129
- kind: "Name",
130
- value: "username"
131
- },
132
- value: {
133
- kind: "Variable",
134
- name: {
135
- kind: "Name",
136
- value: "email"
137
- }
138
- }
139
- }, {
140
- kind: "Argument",
141
- name: {
142
- kind: "Name",
143
- value: "password"
144
- },
145
- value: {
146
- kind: "Variable",
147
- name: {
148
- kind: "Name",
149
- value: "password"
150
- }
151
- }
152
- }, {
153
- kind: "Argument",
154
- name: {
155
- kind: "Name",
156
- value: "rememberMe"
157
- },
158
- value: {
159
- kind: "Variable",
160
- name: {
161
- kind: "Name",
162
- value: "rememberMe"
163
- }
164
- }
165
- }],
166
- selectionSet: {
167
- kind: "SelectionSet",
168
- selections: [{
169
- kind: "Field",
170
- name: {
171
- kind: "Name",
172
- value: "__typename"
173
- }
174
- }, {
175
- kind: "InlineFragment",
176
- typeCondition: {
177
- kind: "NamedType",
178
- name: {
179
- kind: "Name",
180
- value: "CurrentUser"
181
- }
182
- },
183
- selectionSet: {
184
- kind: "SelectionSet",
185
- selections: [{
186
- kind: "Field",
187
- name: {
188
- kind: "Name",
189
- value: "id"
190
- }
191
- }, {
192
- kind: "Field",
193
- name: {
194
- kind: "Name",
195
- value: "identifier"
196
- }
197
- }]
198
- }
199
- }, {
200
- kind: "InlineFragment",
201
- typeCondition: {
202
- kind: "NamedType",
203
- name: {
204
- kind: "Name",
205
- value: "ErrorResult"
206
- }
207
- },
208
- selectionSet: {
209
- kind: "SelectionSet",
210
- selections: [{
211
- kind: "Field",
212
- name: {
213
- kind: "Name",
214
- value: "errorCode"
215
- }
216
- }, {
217
- kind: "Field",
218
- name: {
219
- kind: "Name",
220
- value: "message"
221
- }
222
- }]
223
- }
224
- }]
225
- }
226
- }]
227
- }
228
- }]
229
- }, v = {
230
- kind: "Document",
231
- definitions: [{
232
- kind: "OperationDefinition",
233
- operation: "mutation",
234
- name: {
235
- kind: "Name",
236
- value: "logout"
237
- },
238
- selectionSet: {
239
- kind: "SelectionSet",
240
- selections: [{
241
- kind: "Field",
242
- name: {
243
- kind: "Name",
244
- value: "logout"
245
- },
246
- selectionSet: {
247
- kind: "SelectionSet",
248
- selections: [{
249
- kind: "Field",
250
- name: {
251
- kind: "Name",
252
- value: "success"
253
- }
254
- }]
255
- }
256
- }]
257
- }
258
- }]
259
- }, y = {
260
- kind: "Document",
261
- definitions: [{
262
- kind: "OperationDefinition",
263
- operation: "query",
264
- name: {
265
- kind: "Name",
266
- value: "me"
267
- },
268
- selectionSet: {
269
- kind: "SelectionSet",
270
- selections: [{
271
- kind: "Field",
272
- name: {
273
- kind: "Name",
274
- value: "me"
275
- },
276
- selectionSet: {
277
- kind: "SelectionSet",
278
- selections: [{
279
- kind: "Field",
280
- name: {
281
- kind: "Name",
282
- value: "id"
283
- }
284
- }]
285
- }
286
- }]
287
- }
288
- }]
289
- }, D = {
290
- kind: "Document",
291
- definitions: [{
292
- kind: "OperationDefinition",
293
- operation: "mutation",
294
- name: {
295
- kind: "Name",
296
- value: "transitionOrderToState"
297
- },
298
- variableDefinitions: [{
299
- kind: "VariableDefinition",
300
- variable: {
301
- kind: "Variable",
302
- name: {
303
- kind: "Name",
304
- value: "input"
305
- }
306
- },
307
- type: {
308
- kind: "NonNullType",
309
- type: {
310
- kind: "NamedType",
311
- name: {
312
- kind: "Name",
313
- value: "String"
314
- }
315
- }
316
- }
317
- }],
318
- selectionSet: {
319
- kind: "SelectionSet",
320
- selections: [{
321
- kind: "Field",
322
- name: {
323
- kind: "Name",
324
- value: "transitionOrderToState"
325
- },
326
- arguments: [{
327
- kind: "Argument",
328
- name: {
329
- kind: "Name",
330
- value: "state"
331
- },
332
- value: {
333
- kind: "Variable",
334
- name: {
335
- kind: "Name",
336
- value: "input"
337
- }
338
- }
339
- }],
340
- selectionSet: {
341
- kind: "SelectionSet",
342
- selections: [{
343
- kind: "InlineFragment",
344
- typeCondition: {
345
- kind: "NamedType",
346
- name: {
347
- kind: "Name",
348
- value: "ErrorResult"
349
- }
350
- },
351
- selectionSet: {
352
- kind: "SelectionSet",
353
- selections: [{
354
- kind: "Field",
355
- name: {
356
- kind: "Name",
357
- value: "errorCode"
358
- }
359
- }, {
360
- kind: "Field",
361
- name: {
362
- kind: "Name",
363
- value: "message"
364
- }
365
- }]
366
- }
367
- }]
368
- }
369
- }]
370
- }
371
- }]
372
- }, A = {
373
- kind: "Document",
374
- definitions: [{
375
- kind: "OperationDefinition",
376
- operation: "query",
377
- name: {
378
- kind: "Name",
379
- value: "nextOrderStates"
380
- },
381
- selectionSet: {
382
- kind: "SelectionSet",
383
- selections: [{
384
- kind: "Field",
385
- name: {
386
- kind: "Name",
387
- value: "nextOrderStates"
388
- }
389
- }]
390
- }
391
- }]
392
- }, h = {
393
- kind: "Document",
394
- definitions: [{
395
- kind: "OperationDefinition",
396
- operation: "query",
397
- name: {
398
- kind: "Name",
399
- value: "EligiblePaymentMethods"
400
- },
401
- selectionSet: {
402
- kind: "SelectionSet",
403
- selections: [{
404
- kind: "Field",
405
- name: {
406
- kind: "Name",
407
- value: "eligiblePaymentMethods"
408
- },
409
- selectionSet: {
410
- kind: "SelectionSet",
411
- selections: [{
412
- kind: "FragmentSpread",
413
- name: {
414
- kind: "Name",
415
- value: "EligiblePaymentMethods"
416
- }
417
- }]
418
- }
419
- }]
420
- }
421
- }, {
422
- kind: "FragmentDefinition",
423
- name: {
424
- kind: "Name",
425
- value: "EligiblePaymentMethods"
426
- },
427
- typeCondition: {
428
- kind: "NamedType",
429
- name: {
430
- kind: "Name",
431
- value: "PaymentMethodQuote"
432
- }
433
- },
434
- selectionSet: {
435
- kind: "SelectionSet",
436
- selections: [{
437
- kind: "Field",
438
- name: {
439
- kind: "Name",
440
- value: "id"
441
- }
442
- }, {
443
- kind: "Field",
444
- name: {
445
- kind: "Name",
446
- value: "name"
447
- }
448
- }, {
449
- kind: "Field",
450
- name: {
451
- kind: "Name",
452
- value: "description"
453
- }
454
- }, {
455
- kind: "Field",
456
- name: {
457
- kind: "Name",
458
- value: "code"
459
- }
460
- }]
461
- }
462
- }]
463
- }, f = {
464
- "\n mutation login($email: String!, $password: String!, $rememberMe: Boolean) {\n login(username: $email, password: $password, rememberMe: $rememberMe) {\n __typename\n ... on CurrentUser {\n id\n identifier\n }\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n": P,
465
- "\n mutation logout {\n logout {\n success\n }\n }\n": v,
466
- "\n query me {\n me {\n id\n }\n }\n": y,
467
- "\n mutation transitionOrderToState($input: String!) {\n transitionOrderToState(state: $input) {\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n": D,
468
- "\n query nextOrderStates {\n nextOrderStates\n }\n": A,
469
- "\n fragment EligiblePaymentMethods on PaymentMethodQuote {\n id\n name\n description\n code\n }\n": I,
470
- "\n query EligiblePaymentMethods {\n eligiblePaymentMethods {\n ...EligiblePaymentMethods\n }\n }\n": h
471
- };
472
- function l(e) {
473
- return f[e] ?? {};
474
- }
475
- const b = ["id", "code", "active", "createdAt", "updatedAt", "orderPlacedAt", "state", "totalQuantity", "currencyCode", "total", "totalWithTax", "subTotal", "subTotalWithTax", "shipping", {
476
- discounts: ["type", "description", "amount", "amountWithTax"]
477
- }, {
478
- promotions: ["couponCode", "description", "name", "enabled", "perCustomerUsageLimit", "perCustomerUsageLimit"]
479
- }, "couponCodes", "shippingWithTax", "currencyCode", {
480
- taxSummary: ["description", "taxRate", "taxBase", "taxTotal"]
481
- }, {
482
- customer: ["id", "firstName", "lastName", "emailAddress", "phoneNumber"]
483
- }, {
484
- billingAddress: ["fullName", "streetLine1", "streetLine2", "company", "city", "province", "postalCode", "countryCode", "phoneNumber"]
485
- }, {
486
- shippingAddress: ["fullName", "streetLine1", "streetLine2", "company", "city", "province", "postalCode", "countryCode", "phoneNumber"]
487
- }, {
488
- shippingLines: [{
489
- shippingMethod: ["id", "name"]
490
- }, "priceWithTax", "price"]
491
- }, {
492
- lines: ["id", "unitPrice", "unitPriceWithTax", "linePrice", "linePriceWithTax", "discountedUnitPrice", "discountedUnitPriceWithTax", "discountedLinePrice", "discountedLinePriceWithTax", "proratedUnitPrice", "proratedUnitPriceWithTax", "proratedLinePrice", "proratedLinePriceWithTax", "quantity", {
493
- featuredAsset: ["id", "preview"]
494
- }, {
495
- productVariant: ["id", "name", "sku", "price", "priceWithTax", "currencyCode", {
496
- facetValues: [{
497
- facet: ["id", "code", "name"]
498
- }, "id", "code", "name"]
499
- }, {
500
- featuredAsset: ["id", "preview"]
501
- }, {
502
- product: ["id", "slug", "description", {
503
- facetValues: [{
504
- facet: ["id", "code", "name"]
505
- }, "id", "code", "name"],
506
- collections: ["id", "name", "slug", "parentId", {
507
- breadcrumbs: ["id", "name", "slug"]
508
- }]
509
- }]
510
- }]
511
- }]
512
- }, {
513
- payments: ["id", "state", "method", "amount", "metadata"]
514
- }, {
515
- history: [{
516
- items: ["id", "type", "data", "createdAt", "updatedAt"]
517
- }, "totalItems"]
518
- }];
519
- l(
520
- /* GraphQL */
521
- `
522
- mutation transitionOrderToState($input: String!) {
523
- transitionOrderToState(state: $input) {
524
- ... on ErrorResult {
525
- errorCode
526
- message
527
- }
528
- }
529
- }
530
- `
531
- );
532
- l(
533
- /* GraphQL */
534
- `
535
- query nextOrderStates {
536
- nextOrderStates
537
- }
538
- `
539
- );
540
- l(
541
- /* GraphQL */
542
- `
543
- fragment EligiblePaymentMethods on PaymentMethodQuote {
544
- id
545
- name
546
- description
547
- code
548
- }
549
- `
550
- );
551
- l(
552
- /* GraphQL */
553
- `
554
- query EligiblePaymentMethods {
555
- eligiblePaymentMethods {
556
- ...EligiblePaymentMethods
557
- }
558
- }
559
- `
560
- );
561
- const E = new S({
562
- name: "purchase-order-payment",
563
- queryUpdates: {}
564
- });
565
- E.setRequests({
566
- addPurchaseOrderPaymentToOrder: async (e) => {
567
- try {
568
- return (await E.getSdk().createRequest({
569
- operation: "addPurchaseOrderPaymentToOrder",
570
- fields: [{
571
- operation: "Order",
572
- fields: b,
573
- fragment: !0
574
- }, {
575
- operation: "ErrorResult",
576
- fields: ["errorCode", "message"],
577
- fragment: !0
578
- }],
579
- variables: {
580
- input: {
581
- type: "AddPurchaseOrderPaymentToOrderInput!"
582
- }
583
- }
584
- }, {
585
- input: e
586
- }, !0)).data;
587
- } catch (i) {
588
- return {
589
- errorCode: N.UnknownError,
590
- message: i instanceof Error ? i.message : "Unknown payment error"
591
- };
592
- }
593
- }
1
+ import { l as e, u as t } from "./src-BCHcjT-q.mjs";
2
+ import { t as n } from "./plugin-config-DywohMgp.mjs";
3
+ import { a as r, n as i, r as a, t as o } from "./src-BqcrcEUL.mjs";
4
+ //#region ../../providers/src/vendure/queries/order/fragments/orderDetailFragment.ts
5
+ var s = [
6
+ "id",
7
+ "code",
8
+ "active",
9
+ "createdAt",
10
+ "updatedAt",
11
+ "orderPlacedAt",
12
+ "state",
13
+ "totalQuantity",
14
+ "currencyCode",
15
+ "total",
16
+ "totalWithTax",
17
+ "subTotal",
18
+ "subTotalWithTax",
19
+ "shipping",
20
+ { discounts: [
21
+ "type",
22
+ "description",
23
+ "amount",
24
+ "amountWithTax"
25
+ ] },
26
+ { promotions: [
27
+ "couponCode",
28
+ "description",
29
+ "name",
30
+ "enabled",
31
+ "perCustomerUsageLimit",
32
+ "perCustomerUsageLimit"
33
+ ] },
34
+ "couponCodes",
35
+ "shippingWithTax",
36
+ "currencyCode",
37
+ { taxSummary: [
38
+ "description",
39
+ "taxRate",
40
+ "taxBase",
41
+ "taxTotal"
42
+ ] },
43
+ { customer: [
44
+ "id",
45
+ "firstName",
46
+ "lastName",
47
+ "emailAddress",
48
+ "phoneNumber"
49
+ ] },
50
+ { billingAddress: [
51
+ "fullName",
52
+ "streetLine1",
53
+ "streetLine2",
54
+ "company",
55
+ "city",
56
+ "province",
57
+ "postalCode",
58
+ "countryCode",
59
+ "phoneNumber"
60
+ ] },
61
+ { shippingAddress: [
62
+ "fullName",
63
+ "streetLine1",
64
+ "streetLine2",
65
+ "company",
66
+ "city",
67
+ "province",
68
+ "postalCode",
69
+ "countryCode",
70
+ "phoneNumber"
71
+ ] },
72
+ { shippingLines: [
73
+ { shippingMethod: ["id", "name"] },
74
+ "priceWithTax",
75
+ "price"
76
+ ] },
77
+ { lines: [
78
+ "id",
79
+ "unitPrice",
80
+ "unitPriceWithTax",
81
+ "linePrice",
82
+ "linePriceWithTax",
83
+ "discountedUnitPrice",
84
+ "discountedUnitPriceWithTax",
85
+ "discountedLinePrice",
86
+ "discountedLinePriceWithTax",
87
+ "proratedUnitPrice",
88
+ "proratedUnitPriceWithTax",
89
+ "proratedLinePrice",
90
+ "proratedLinePriceWithTax",
91
+ "quantity",
92
+ { featuredAsset: ["id", "preview"] },
93
+ { productVariant: [
94
+ "id",
95
+ "name",
96
+ "sku",
97
+ "price",
98
+ "priceWithTax",
99
+ "currencyCode",
100
+ { facetValues: [
101
+ { facet: [
102
+ "id",
103
+ "code",
104
+ "name"
105
+ ] },
106
+ "id",
107
+ "code",
108
+ "name"
109
+ ] },
110
+ { featuredAsset: ["id", "preview"] },
111
+ { product: [
112
+ "id",
113
+ "slug",
114
+ "description",
115
+ {
116
+ facetValues: [
117
+ { facet: [
118
+ "id",
119
+ "code",
120
+ "name"
121
+ ] },
122
+ "id",
123
+ "code",
124
+ "name"
125
+ ],
126
+ collections: [
127
+ "id",
128
+ "name",
129
+ "slug",
130
+ "parentId",
131
+ { breadcrumbs: [
132
+ "id",
133
+ "name",
134
+ "slug"
135
+ ] }
136
+ ]
137
+ }
138
+ ] }
139
+ ] }
140
+ ] },
141
+ { payments: [
142
+ "id",
143
+ "state",
144
+ "method",
145
+ "amount",
146
+ "metadata"
147
+ ] },
148
+ { history: [{ items: [
149
+ "id",
150
+ "type",
151
+ "data",
152
+ "createdAt",
153
+ "updatedAt"
154
+ ] }, "totalItems"] }
155
+ ];
156
+ i("\n mutation transitionOrderToState($input: String!) {\n transitionOrderToState(state: $input) {\n ... on ErrorResult {\n errorCode\n message\n }\n }\n }\n"), i("\n query nextOrderStates {\n nextOrderStates\n }\n"), i("\n fragment EligiblePaymentMethods on PaymentMethodQuote {\n id\n name\n description\n code\n }\n"), i("\n query EligiblePaymentMethods {\n eligiblePaymentMethods {\n ...EligiblePaymentMethods\n }\n }\n");
157
+ //#endregion
158
+ //#region src/lib/configs/vendure-purchase-order-payment-plugin.ts
159
+ var c = new n({
160
+ name: "purchase-order-payment",
161
+ queryUpdates: {}
594
162
  });
595
- const x = () => {
596
- const e = T.c(17), i = O(), d = R();
597
- let t;
598
- e[0] !== i ? (t = async (r) => {
599
- const k = i.addPurchaseOrderPaymentToOrder;
600
- if (typeof k != "function")
601
- throw new Error("addPurchaseOrderPaymentToOrder is not available. Ensure VendurePurchaseOrderPaymentPlugin is registered.");
602
- return k(r);
603
- }, e[0] = i, e[1] = t) : t = e[1];
604
- let a;
605
- e[2] !== d ? (a = (r) => {
606
- r && !("errorCode" in r) && d.invalidateQueries({
607
- queryKey: [p.ACTIVE_ORDER]
608
- });
609
- }, e[2] = d, e[3] = a) : a = e[3];
610
- let o;
611
- e[4] !== t || e[5] !== a ? (o = {
612
- mutationFn: t,
613
- onSuccess: a
614
- }, e[4] = t, e[5] = a, e[6] = o) : o = e[6];
615
- const n = g(o);
616
- let s;
617
- e[7] !== n ? (s = async (r) => n.mutateAsync(r), e[7] = n, e[8] = s) : s = e[8];
618
- const u = s, c = n.error;
619
- let m;
620
- return e[9] !== u || e[10] !== n.data || e[11] !== n.isError || e[12] !== n.isPending || e[13] !== n.isSuccess || e[14] !== n.reset || e[15] !== c ? (m = {
621
- addPurchaseOrderPayment: u,
622
- error: c,
623
- isLoading: n.isPending,
624
- isError: n.isError,
625
- isSuccess: n.isSuccess,
626
- data: n.data,
627
- reset: n.reset
628
- }, e[9] = u, e[10] = n.data, e[11] = n.isError, e[12] = n.isPending, e[13] = n.isSuccess, e[14] = n.reset, e[15] = c, e[16] = m) : m = e[16], m;
629
- };
630
- export {
631
- E as VendurePurchaseOrderPaymentPlugin,
632
- x as useAddPurchaseOrderPayment
163
+ c.setRequests({ addPurchaseOrderPaymentToOrder: async (t) => {
164
+ try {
165
+ return (await c.getSdk().createRequest({
166
+ operation: "addPurchaseOrderPaymentToOrder",
167
+ fields: [{
168
+ operation: "Order",
169
+ fields: s,
170
+ fragment: !0
171
+ }, {
172
+ operation: "ErrorResult",
173
+ fields: ["errorCode", "message"],
174
+ fragment: !0
175
+ }],
176
+ variables: { input: { type: "AddPurchaseOrderPaymentToOrderInput!" } }
177
+ }, { input: t }, !0)).data;
178
+ } catch (t) {
179
+ return {
180
+ errorCode: e.UnknownError,
181
+ message: t instanceof Error ? t.message : "Unknown payment error"
182
+ };
183
+ }
184
+ } });
185
+ //#endregion
186
+ //#region src/lib/hooks/use-add-purchase-order-payment.ts
187
+ var l = () => {
188
+ let e = r(), n = o(), i = a({
189
+ mutationFn: async (t) => {
190
+ let n = e.addPurchaseOrderPaymentToOrder;
191
+ if (typeof n != "function") throw Error("addPurchaseOrderPaymentToOrder is not available. Ensure VendurePurchaseOrderPaymentPlugin is registered.");
192
+ return n(t);
193
+ },
194
+ onSuccess: (e) => {
195
+ e && !("errorCode" in e) && n.invalidateQueries({ queryKey: [t.ACTIVE_ORDER] });
196
+ }
197
+ });
198
+ return {
199
+ addPurchaseOrderPayment: async (e) => i.mutateAsync(e),
200
+ error: i.error,
201
+ isLoading: i.isPending,
202
+ isError: i.isError,
203
+ isSuccess: i.isSuccess,
204
+ data: i.data,
205
+ reset: i.reset
206
+ };
633
207
  };
208
+ //#endregion
209
+ export { c as VendurePurchaseOrderPaymentPlugin, l as useAddPurchaseOrderPayment };