@vendure-platform/create 0.5.1 → 1.0.0-major.202609091053.0.0

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 (172) hide show
  1. package/README.md +48 -36
  2. package/dist/add-to-existing.d.ts +19 -13
  3. package/dist/add-to-existing.js +1 -1
  4. package/dist/assets/demo-data/assets/branding/logo.svg +4 -0
  5. package/dist/assets/demo-data/assets/images/absorbent-pad.webp +0 -0
  6. package/dist/assets/demo-data/assets/images/adjustable-wrench.webp +0 -0
  7. package/dist/assets/demo-data/assets/images/anchor-bolt.webp +0 -0
  8. package/dist/assets/demo-data/assets/images/angle-grinder.webp +0 -0
  9. package/dist/assets/demo-data/assets/images/barrier-tape.webp +0 -0
  10. package/dist/assets/demo-data/assets/images/bench-grinder.webp +0 -0
  11. package/dist/assets/demo-data/assets/images/bracket.webp +0 -0
  12. package/dist/assets/demo-data/assets/images/broom.webp +0 -0
  13. package/dist/assets/demo-data/assets/images/bucket.webp +0 -0
  14. package/dist/assets/demo-data/assets/images/cable-gland.webp +0 -0
  15. package/dist/assets/demo-data/assets/images/cable-tie.webp +0 -0
  16. package/dist/assets/demo-data/assets/images/cable-tray.webp +0 -0
  17. package/dist/assets/demo-data/assets/images/cable.webp +0 -0
  18. package/dist/assets/demo-data/assets/images/chimney-base-kit.webp +0 -0
  19. package/dist/assets/demo-data/assets/images/chimney-cowl-bird-guard.webp +0 -0
  20. package/dist/assets/demo-data/assets/images/chimney-cowl-open.webp +0 -0
  21. package/dist/assets/demo-data/assets/images/chimney-storm-collar.webp +0 -0
  22. package/dist/assets/demo-data/assets/images/chimney-wall-bracket.webp +0 -0
  23. package/dist/assets/demo-data/assets/images/circular-saw.webp +0 -0
  24. package/dist/assets/demo-data/assets/images/cleaning-spray.webp +0 -0
  25. package/dist/assets/demo-data/assets/images/conduit.webp +0 -0
  26. package/dist/assets/demo-data/assets/images/cordless-drill.webp +0 -0
  27. package/dist/assets/demo-data/assets/images/drill-bits.webp +0 -0
  28. package/dist/assets/demo-data/assets/images/dust-mask.webp +0 -0
  29. package/dist/assets/demo-data/assets/images/ear-defenders.webp +0 -0
  30. package/dist/assets/demo-data/assets/images/ear-plugs.webp +0 -0
  31. package/dist/assets/demo-data/assets/images/extension-lead.webp +0 -0
  32. package/dist/assets/demo-data/assets/images/eye-wash-station.webp +0 -0
  33. package/dist/assets/demo-data/assets/images/face-shield.webp +0 -0
  34. package/dist/assets/demo-data/assets/images/file-set.webp +0 -0
  35. package/dist/assets/demo-data/assets/images/first-aid-kit.webp +0 -0
  36. package/dist/assets/demo-data/assets/images/floor-sign.webp +0 -0
  37. package/dist/assets/demo-data/assets/images/flue-bend-45.webp +0 -0
  38. package/dist/assets/demo-data/assets/images/flue-bend-90.webp +0 -0
  39. package/dist/assets/demo-data/assets/images/flue-section-1000mm.webp +0 -0
  40. package/dist/assets/demo-data/assets/images/flue-section-250mm.webp +0 -0
  41. package/dist/assets/demo-data/assets/images/flue-section-500mm.webp +0 -0
  42. package/dist/assets/demo-data/assets/images/fuse.webp +0 -0
  43. package/dist/assets/demo-data/assets/images/glove-dispenser.webp +0 -0
  44. package/dist/assets/demo-data/assets/images/grinding-disc.webp +0 -0
  45. package/dist/assets/demo-data/assets/images/hacksaw.webp +0 -0
  46. package/dist/assets/demo-data/assets/images/hammer.webp +0 -0
  47. package/dist/assets/demo-data/assets/images/hand-sanitiser.webp +0 -0
  48. package/dist/assets/demo-data/assets/images/head-torch.webp +0 -0
  49. package/dist/assets/demo-data/assets/images/heat-gun.webp +0 -0
  50. package/dist/assets/demo-data/assets/images/hex-bolt.webp +0 -0
  51. package/dist/assets/demo-data/assets/images/hex-key-set.webp +0 -0
  52. package/dist/assets/demo-data/assets/images/hex-nut.webp +0 -0
  53. package/dist/assets/demo-data/assets/images/hi-vis-jacket.webp +0 -0
  54. package/dist/assets/demo-data/assets/images/hi-vis-vest.webp +0 -0
  55. package/dist/assets/demo-data/assets/images/hose-clamp.webp +0 -0
  56. package/dist/assets/demo-data/assets/images/impact-driver.webp +0 -0
  57. package/dist/assets/demo-data/assets/images/jigsaw.webp +0 -0
  58. package/dist/assets/demo-data/assets/images/junction-box.webp +0 -0
  59. package/dist/assets/demo-data/assets/images/knee-pads.webp +0 -0
  60. package/dist/assets/demo-data/assets/images/machine-screw.webp +0 -0
  61. package/dist/assets/demo-data/assets/images/made-to-order-configurable-chimney.webp +0 -0
  62. package/dist/assets/demo-data/assets/images/mallet.webp +0 -0
  63. package/dist/assets/demo-data/assets/images/mcb.webp +0 -0
  64. package/dist/assets/demo-data/assets/images/mop.webp +0 -0
  65. package/dist/assets/demo-data/assets/images/paper-towels.webp +0 -0
  66. package/dist/assets/demo-data/assets/images/pipe-wrench.webp +0 -0
  67. package/dist/assets/demo-data/assets/images/pliers-set.webp +0 -0
  68. package/dist/assets/demo-data/assets/images/pry-bar.webp +0 -0
  69. package/dist/assets/demo-data/assets/images/rcd.webp +0 -0
  70. package/dist/assets/demo-data/assets/images/reciprocating-saw.webp +0 -0
  71. package/dist/assets/demo-data/assets/images/rivet.webp +0 -0
  72. package/dist/assets/demo-data/assets/images/roof-flashing-high-pitch.webp +0 -0
  73. package/dist/assets/demo-data/assets/images/roof-flashing-low-pitch.webp +0 -0
  74. package/dist/assets/demo-data/assets/images/safety-boots.webp +0 -0
  75. package/dist/assets/demo-data/assets/images/safety-glasses.webp +0 -0
  76. package/dist/assets/demo-data/assets/images/safety-harness.webp +0 -0
  77. package/dist/assets/demo-data/assets/images/safety-helmet.webp +0 -0
  78. package/dist/assets/demo-data/assets/images/safety-sign.webp +0 -0
  79. package/dist/assets/demo-data/assets/images/sanding-disc.webp +0 -0
  80. package/dist/assets/demo-data/assets/images/saw-blade.webp +0 -0
  81. package/dist/assets/demo-data/assets/images/screwdriver-set.webp +0 -0
  82. package/dist/assets/demo-data/assets/images/screwdriver.webp +0 -0
  83. package/dist/assets/demo-data/assets/images/self-tapping-screw.webp +0 -0
  84. package/dist/assets/demo-data/assets/images/socket-set.webp +0 -0
  85. package/dist/assets/demo-data/assets/images/socket.webp +0 -0
  86. package/dist/assets/demo-data/assets/images/spanner-set.webp +0 -0
  87. package/dist/assets/demo-data/assets/images/spanner.webp +0 -0
  88. package/dist/assets/demo-data/assets/images/spill-kit.webp +0 -0
  89. package/dist/assets/demo-data/assets/images/spirit-level.webp +0 -0
  90. package/dist/assets/demo-data/assets/images/switch.webp +0 -0
  91. package/dist/assets/demo-data/assets/images/tape-measure.webp +0 -0
  92. package/dist/assets/demo-data/assets/images/terminal-block.webp +0 -0
  93. package/dist/assets/demo-data/assets/images/threaded-rod.webp +0 -0
  94. package/dist/assets/demo-data/assets/images/torque-wrench.webp +0 -0
  95. package/dist/assets/demo-data/assets/images/utility-knife.webp +0 -0
  96. package/dist/assets/demo-data/assets/images/wall-pass-sleeve.webp +0 -0
  97. package/dist/assets/demo-data/assets/images/wall-plug.webp +0 -0
  98. package/dist/assets/demo-data/assets/images/washer.webp +0 -0
  99. package/dist/assets/demo-data/assets/images/waste-bin.webp +0 -0
  100. package/dist/assets/demo-data/assets/images/wire-connector.webp +0 -0
  101. package/dist/assets/demo-data/assets/images/wire-cutters.webp +0 -0
  102. package/dist/assets/demo-data/assets/images/wood-screw.webp +0 -0
  103. package/dist/assets/demo-data/assets/images/work-gloves.webp +0 -0
  104. package/dist/assets/demo-data/assets/images/work-light.webp +0 -0
  105. package/dist/assets/demo-data/assets/initial-data.json +667 -0
  106. package/dist/assets/demo-data/assets/products.csv +779 -0
  107. package/dist/assets/storefront/next-env.d.ts +2 -1
  108. package/dist/assets/storefront/next.config.ts +14 -13
  109. package/dist/assets/storefront/package.json +3 -2
  110. package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +2 -0
  111. package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +2 -0
  112. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +2 -0
  113. package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +2 -0
  114. package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +2 -0
  115. package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +2 -0
  116. package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +2 -0
  117. package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +2 -0
  118. package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +2 -0
  119. package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +10 -6
  120. package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +8 -5
  121. package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +9 -6
  122. package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +2 -0
  123. package/dist/assets/storefront/src/app/[locale]/layout.tsx +3 -3
  124. package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +2 -60
  125. package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +4 -2
  126. package/dist/assets/storefront/src/components/commerce/product-card.tsx +4 -2
  127. package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +31 -14
  128. package/dist/assets/storefront/src/config/capabilities.ts +41 -0
  129. package/dist/assets/storefront/src/config/scenario.ts +10 -0
  130. package/dist/assets/storefront/src/graphql-env.d.ts +47 -41
  131. package/dist/assets/storefront/src/i18n/server.ts +33 -5
  132. package/dist/assets/storefront/src/lib/backend-health.ts +11 -3
  133. package/dist/assets/storefront/src/lib/vendure/capability-documents.ts +246 -0
  134. package/dist/assets/storefront/src/lib/vendure/capability-schema.ts +358 -0
  135. package/dist/assets/storefront/src/lib/vendure/capability-ui.ts +15 -0
  136. package/dist/assets/storefront/src/lib/vendure/mutations.ts +835 -532
  137. package/dist/assets/storefront/src/lib/vendure/queries.ts +862 -519
  138. package/dist/assets/storefront/src/proxy.ts +11 -0
  139. package/dist/assets/storefront/src/schema.graphql +337 -243
  140. package/dist/assets/templates/README.md.hbs +25 -1
  141. package/dist/assets/templates/docker-compose.yml.hbs +4 -0
  142. package/dist/assets/templates/env.hbs +34 -9
  143. package/dist/assets/templates/environment.d.ts.hbs +1 -0
  144. package/dist/assets/templates/gitignore.hbs +7 -4
  145. package/dist/assets/templates/migrate.ts.hbs +55 -0
  146. package/dist/assets/templates/npmrc.hbs +7 -2
  147. package/dist/assets/templates/platform-edition.ts.hbs +21 -0
  148. package/dist/assets/templates/server-package.json.hbs +15 -8
  149. package/dist/assets/templates/vendure-config.ts.hbs +18 -0
  150. package/dist/bin/run.js +1 -1
  151. package/dist/cli.js +1 -1
  152. package/dist/console-onboarding.d.ts +44 -0
  153. package/dist/console-onboarding.js +1 -0
  154. package/dist/hub-projects.d.ts +48 -0
  155. package/dist/hub-projects.js +1 -0
  156. package/dist/index.d.ts +1 -1
  157. package/dist/index.js +1 -1
  158. package/dist/plugin-registry.d.ts +61 -2
  159. package/dist/plugin-registry.js +1 -1
  160. package/dist/registry.d.ts +16 -13
  161. package/dist/registry.js +1 -1
  162. package/dist/scaffold-shared.js +1 -1
  163. package/dist/scaffold-storefront-only.js +1 -1
  164. package/dist/scaffolder.d.ts +11 -0
  165. package/dist/scaffolder.js +1 -1
  166. package/dist/storefront-copier.d.ts +7 -2
  167. package/dist/storefront-copier.js +1 -1
  168. package/dist/template-renderer.d.ts +26 -5
  169. package/dist/template-renderer.js +1 -1
  170. package/dist/types.d.ts +54 -23
  171. package/package.json +14 -2
  172. package/dist/assets/storefront/src/middleware.ts +0 -11
@@ -1,4 +1,5 @@
1
1
  import { graphql } from '@/graphql';
2
+ import { composeCapabilityDocument, forCapability } from './capability-documents';
2
3
  import {
3
4
  CompanyAddressFragment,
4
5
  CompanyBusinessUnitFragment,
@@ -401,21 +402,25 @@ export const LogoutMutation = graphql(`
401
402
  }
402
403
  `);
403
404
 
404
- export const SubmitApprovalDecisionMutation = graphql(`
405
- mutation SubmitApprovalDecision($input: SubmitApprovalDecisionInput!) {
406
- submitApprovalDecision(input: $input) {
407
- id
408
- status
409
- decisions {
405
+ export const SubmitApprovalDecisionMutation = forCapability(
406
+ 'approval.orders',
407
+ graphql(`
408
+ mutation SubmitApprovalDecision($input: SubmitApprovalDecisionInput!) {
409
+ submitApprovalDecision(input: $input) {
410
410
  id
411
- level
412
- decision
413
- comment
414
- decidedAt
411
+ status
412
+ decisions {
413
+ id
414
+ level
415
+ decision
416
+ comment
417
+ decidedAt
418
+ }
415
419
  }
416
420
  }
417
- }
418
- `);
421
+ `),
422
+ [['submitApprovalDecision']],
423
+ );
419
424
 
420
425
  export const UpdateCustomerMutation = graphql(`
421
426
  mutation UpdateCustomer($input: UpdateCustomerInput!) {
@@ -459,306 +464,492 @@ export const UpdateCustomerEmailAddressMutation = graphql(`
459
464
  }
460
465
  `);
461
466
 
462
- export const RegisterCompanyMutation = graphql(
463
- `
464
- mutation RegisterCompany($input: RegisterCompanyInput!) {
465
- registerCompany(input: $input) {
466
- company {
467
- ...Company
468
- }
469
- companyUser {
470
- ...CompanyUser
467
+ export const RegisterCompanyMutation = composeCapabilityDocument(
468
+ graphql(
469
+ `
470
+ mutation RegisterCompany($input: RegisterCompanyInput!) {
471
+ registerCompany(input: $input) {
472
+ company {
473
+ ...Company
474
+ }
475
+ companyUser {
476
+ ...CompanyUser
477
+ }
478
+ permissions
471
479
  }
472
- permissions
473
480
  }
474
- }
475
- `,
476
- [CompanyFragment, CompanyUserFragment],
481
+ `,
482
+ [CompanyFragment, CompanyUserFragment],
483
+ ),
484
+ [
485
+ { capability: 'org.accounts', paths: [['registerCompany']] },
486
+ { capability: 'org.hierarchy', paths: [['businessUnits']] },
487
+ ],
477
488
  );
478
489
 
479
- export const UpdateCompanyAccountMutation = graphql(
480
- `
481
- mutation UpdateCompanyAccount($input: UpdateCompanyAccountInput!) {
482
- updateCompanyAccount(input: $input) {
483
- company {
484
- ...Company
485
- }
486
- companyUser {
487
- ...CompanyUser
490
+ export const UpdateCompanyAccountMutation = composeCapabilityDocument(
491
+ graphql(
492
+ `
493
+ mutation UpdateCompanyAccount($input: UpdateCompanyAccountInput!) {
494
+ updateCompanyAccount(input: $input) {
495
+ company {
496
+ ...Company
497
+ }
498
+ companyUser {
499
+ ...CompanyUser
500
+ }
501
+ permissions
488
502
  }
489
- permissions
490
503
  }
491
- }
492
- `,
493
- [CompanyFragment, CompanyUserFragment],
504
+ `,
505
+ [CompanyFragment, CompanyUserFragment],
506
+ ),
507
+ [
508
+ { capability: 'org.accounts', paths: [['updateCompanyAccount']] },
509
+ { capability: 'org.hierarchy', paths: [['businessUnits']] },
510
+ ],
494
511
  );
495
512
 
496
- export const CreateCompanyBusinessUnitMutation = graphql(
497
- `
498
- mutation CreateCompanyBusinessUnit($input: CreateCompanyBusinessUnitShopInput!) {
499
- createCompanyBusinessUnit(input: $input) {
500
- ...CompanyBusinessUnit
513
+ export const CreateCompanyBusinessUnitMutation = forCapability(
514
+ 'org.hierarchy',
515
+ graphql(
516
+ `
517
+ mutation CreateCompanyBusinessUnit($input: CreateCompanyBusinessUnitShopInput!) {
518
+ createCompanyBusinessUnit(input: $input) {
519
+ ...CompanyBusinessUnit
520
+ }
501
521
  }
502
- }
503
- `,
504
- [CompanyBusinessUnitFragment],
522
+ `,
523
+ [CompanyBusinessUnitFragment],
524
+ ),
525
+ [['createCompanyBusinessUnit']],
505
526
  );
506
527
 
507
- export const UpdateCompanyBusinessUnitMutation = graphql(
508
- `
509
- mutation UpdateCompanyBusinessUnit($input: UpdateCompanyBusinessUnitShopInput!) {
510
- updateCompanyBusinessUnit(input: $input) {
511
- ...CompanyBusinessUnit
528
+ export const UpdateCompanyBusinessUnitMutation = forCapability(
529
+ 'org.hierarchy',
530
+ graphql(
531
+ `
532
+ mutation UpdateCompanyBusinessUnit($input: UpdateCompanyBusinessUnitShopInput!) {
533
+ updateCompanyBusinessUnit(input: $input) {
534
+ ...CompanyBusinessUnit
535
+ }
512
536
  }
513
- }
514
- `,
515
- [CompanyBusinessUnitFragment],
537
+ `,
538
+ [CompanyBusinessUnitFragment],
539
+ ),
540
+ [['updateCompanyBusinessUnit']],
516
541
  );
517
542
 
518
- export const DeleteCompanyBusinessUnitMutation = graphql(`
519
- mutation DeleteCompanyBusinessUnit($id: ID!) {
520
- deleteCompanyBusinessUnit(id: $id) {
521
- result
522
- message
523
- }
524
- }
525
- `);
526
-
527
- export const CreateCompanyAddressMutation = graphql(
528
- `
529
- mutation CreateCompanyAddress($input: CreateCompanyAddressShopInput!) {
530
- createCompanyAddress(input: $input) {
531
- ...CompanyAddress
543
+ export const DeleteCompanyBusinessUnitMutation = forCapability(
544
+ 'org.hierarchy',
545
+ graphql(`
546
+ mutation DeleteCompanyBusinessUnit($id: ID!) {
547
+ deleteCompanyBusinessUnit(id: $id) {
548
+ result
549
+ message
532
550
  }
533
551
  }
534
- `,
535
- [CompanyAddressFragment],
552
+ `),
553
+ [['deleteCompanyBusinessUnit']],
536
554
  );
537
555
 
538
- export const UpdateCompanyAddressMutation = graphql(
539
- `
540
- mutation UpdateCompanyAddress($input: UpdateCompanyAddressShopInput!) {
541
- updateCompanyAddress(input: $input) {
542
- ...CompanyAddress
556
+ export const CreateCompanyAddressMutation = composeCapabilityDocument(
557
+ graphql(
558
+ `
559
+ mutation CreateCompanyAddress($input: CreateCompanyAddressShopInput!) {
560
+ createCompanyAddress(input: $input) {
561
+ ...CompanyAddress
562
+ }
543
563
  }
544
- }
545
- `,
546
- [CompanyAddressFragment],
564
+ `,
565
+ [CompanyAddressFragment],
566
+ ),
567
+ [
568
+ { capability: 'org.accounts', paths: [['createCompanyAddress']] },
569
+ { capability: 'org.hierarchy', paths: [['businessUnit']] },
570
+ ],
547
571
  );
548
572
 
549
- export const DeleteCompanyAddressMutation = graphql(`
550
- mutation DeleteCompanyAddress($id: ID!) {
551
- deleteCompanyAddress(id: $id) {
552
- result
553
- message
554
- }
555
- }
556
- `);
557
-
558
- export const InviteCompanyUserMutation = graphql(`
559
- mutation InviteCompanyUser($input: InviteCompanyUserInput!) {
560
- inviteCompanyUser(input: $input)
561
- }
562
- `);
573
+ export const UpdateCompanyAddressMutation = composeCapabilityDocument(
574
+ graphql(
575
+ `
576
+ mutation UpdateCompanyAddress($input: UpdateCompanyAddressShopInput!) {
577
+ updateCompanyAddress(input: $input) {
578
+ ...CompanyAddress
579
+ }
580
+ }
581
+ `,
582
+ [CompanyAddressFragment],
583
+ ),
584
+ [
585
+ { capability: 'org.accounts', paths: [['updateCompanyAddress']] },
586
+ { capability: 'org.hierarchy', paths: [['businessUnit']] },
587
+ ],
588
+ );
563
589
 
564
- export const UpdateCompanyUserMutation = graphql(
565
- `
566
- mutation UpdateCompanyUser($input: UpdateCompanyUserShopInput!) {
567
- updateCompanyUser(input: $input) {
568
- ...CompanyUser
590
+ export const DeleteCompanyAddressMutation = forCapability(
591
+ 'org.accounts',
592
+ graphql(`
593
+ mutation DeleteCompanyAddress($id: ID!) {
594
+ deleteCompanyAddress(id: $id) {
595
+ result
596
+ message
569
597
  }
570
598
  }
571
- `,
572
- [CompanyUserFragment],
599
+ `),
600
+ [['deleteCompanyAddress']],
573
601
  );
574
602
 
575
- export const RemoveCompanyUserMutation = graphql(`
576
- mutation RemoveCompanyUser($id: ID!) {
577
- removeCompanyUser(id: $id) {
578
- result
579
- message
603
+ export const InviteCompanyUserMutation = forCapability(
604
+ 'org.accounts',
605
+ graphql(`
606
+ mutation InviteCompanyUser($input: InviteCompanyUserInput!) {
607
+ inviteCompanyUser(input: $input)
580
608
  }
581
- }
582
- `);
609
+ `),
610
+ [['inviteCompanyUser']],
611
+ );
583
612
 
584
- export const SwitchBusinessUnitMutation = graphql(
585
- `
586
- mutation SwitchBusinessUnit($businessUnitId: ID!) {
587
- switchBusinessUnit(businessUnitId: $businessUnitId) {
588
- company {
589
- ...Company
590
- }
591
- companyUser {
613
+ export const UpdateCompanyUserMutation = composeCapabilityDocument(
614
+ graphql(
615
+ `
616
+ mutation UpdateCompanyUser($input: UpdateCompanyUserShopInput!) {
617
+ updateCompanyUser(input: $input) {
592
618
  ...CompanyUser
593
619
  }
594
- activeBusinessUnit {
595
- ...CompanyBusinessUnit
596
- }
597
- permissions
598
620
  }
599
- }
600
- `,
601
- [CompanyFragment, CompanyUserFragment, CompanyBusinessUnitFragment],
621
+ `,
622
+ [CompanyUserFragment],
623
+ ),
624
+ [
625
+ { capability: 'org.accounts', paths: [['updateCompanyUser']] },
626
+ { capability: 'org.hierarchy', paths: [['businessUnits']] },
627
+ ],
602
628
  );
603
629
 
604
- export const LogSearchListViewedMutation = graphql(`
605
- mutation LogSearchListViewed($input: SearchListViewedEventInput!) {
606
- logSearchListViewed(input: $input)
607
- }
608
- `);
609
-
610
- export const LogSearchResultClickedMutation = graphql(`
611
- mutation LogSearchResultClicked($input: SearchResultClickedEventInput!) {
612
- logSearchResultClicked(input: $input)
613
- }
614
- `);
630
+ export const RemoveCompanyUserMutation = forCapability(
631
+ 'org.accounts',
632
+ graphql(`
633
+ mutation RemoveCompanyUser($id: ID!) {
634
+ removeCompanyUser(id: $id) {
635
+ result
636
+ message
637
+ }
638
+ }
639
+ `),
640
+ [['removeCompanyUser']],
641
+ );
615
642
 
616
- export const AcceptCompanyInvitationMutation = graphql(
617
- `
618
- mutation AcceptCompanyInvitation($token: String!) {
619
- acceptCompanyInvitation(token: $token) {
620
- __typename
621
- ... on CompanyAccount {
643
+ export const SwitchBusinessUnitMutation = forCapability(
644
+ 'org.hierarchy',
645
+ graphql(
646
+ `
647
+ mutation SwitchBusinessUnit($businessUnitId: ID!) {
648
+ switchBusinessUnit(businessUnitId: $businessUnitId) {
622
649
  company {
623
650
  ...Company
624
651
  }
625
652
  companyUser {
626
653
  ...CompanyUser
627
654
  }
655
+ activeBusinessUnit {
656
+ ...CompanyBusinessUnit
657
+ }
628
658
  permissions
629
659
  }
630
- ... on InvitationTokenError {
631
- errorCode
632
- message
633
- }
634
660
  }
661
+ `,
662
+ [CompanyFragment, CompanyUserFragment, CompanyBusinessUnitFragment],
663
+ ),
664
+ [['switchBusinessUnit']],
665
+ );
666
+
667
+ export const LogSearchListViewedMutation = forCapability(
668
+ 'search.analytics.clickhouse',
669
+ graphql(`
670
+ mutation LogSearchListViewed($input: SearchListViewedEventInput!) {
671
+ logSearchListViewed(input: $input)
635
672
  }
636
- `,
637
- [CompanyFragment, CompanyUserFragment],
673
+ `),
674
+ [['logSearchListViewed']],
638
675
  );
639
676
 
640
- export const MoveShoppingListItemsMutation = graphql(
641
- `
642
- mutation MoveShoppingListItems($itemIds: [ID!]!, $targetShoppingListId: ID!) {
643
- moveShoppingListItems(itemIds: $itemIds, targetShoppingListId: $targetShoppingListId) {
644
- ...ShoppingListFields
645
- }
677
+ export const LogSearchResultClickedMutation = forCapability(
678
+ 'search.analytics.clickhouse',
679
+ graphql(`
680
+ mutation LogSearchResultClicked($input: SearchResultClickedEventInput!) {
681
+ logSearchResultClicked(input: $input)
646
682
  }
647
- `,
648
- [ShoppingListFragment],
683
+ `),
684
+ [['logSearchResultClicked']],
649
685
  );
650
686
 
651
- export const AddToShoppingListMutation = graphql(
652
- `
653
- mutation AddToShoppingList($input: CreateShoppingListItemInput!) {
654
- addToShoppingList(input: $input) {
655
- ...ShoppingListFields
656
- items {
687
+ export const AcceptCompanyInvitationMutation = composeCapabilityDocument(
688
+ graphql(
689
+ `
690
+ mutation AcceptCompanyInvitation($token: String!) {
691
+ acceptCompanyInvitation(token: $token) {
692
+ __typename
693
+ ... on CompanyAccount {
694
+ company {
695
+ ...Company
696
+ }
697
+ companyUser {
698
+ ...CompanyUser
699
+ }
700
+ permissions
701
+ }
702
+ ... on InvitationTokenError {
703
+ errorCode
704
+ message
705
+ }
706
+ }
707
+ }
708
+ `,
709
+ [CompanyFragment, CompanyUserFragment],
710
+ ),
711
+ [
712
+ { capability: 'org.accounts', paths: [['acceptCompanyInvitation']] },
713
+ { capability: 'org.hierarchy', paths: [['businessUnits']] },
714
+ ],
715
+ );
716
+
717
+ export const MoveShoppingListItemsMutation = composeCapabilityDocument(
718
+ graphql(
719
+ `
720
+ mutation MoveShoppingListItems($itemIds: [ID!]!, $targetShoppingListId: ID!) {
721
+ moveShoppingListItems(itemIds: $itemIds, targetShoppingListId: $targetShoppingListId) {
722
+ ...ShoppingListFields
723
+ }
724
+ }
725
+ `,
726
+ [ShoppingListFragment],
727
+ ),
728
+ [
729
+ { capability: 'shopping-list.personal', paths: [['moveShoppingListItems']] },
730
+ {
731
+ capability: 'shopping-list.managed',
732
+ paths: [['isPublic'], ['publicCode'], ['customer']],
733
+ },
734
+ ],
735
+ );
736
+
737
+ export const AddToShoppingListMutation = composeCapabilityDocument(
738
+ graphql(
739
+ `
740
+ mutation AddToShoppingList($input: CreateShoppingListItemInput!) {
741
+ addToShoppingList(input: $input) {
742
+ ...ShoppingListFields
657
743
  items {
658
- id
659
- productVariant {
744
+ items {
660
745
  id
746
+ productVariant {
747
+ id
748
+ }
661
749
  }
750
+ totalItems
662
751
  }
663
- totalItems
664
752
  }
665
753
  }
666
- }
667
- `,
668
- [ShoppingListFragment],
754
+ `,
755
+ [ShoppingListFragment],
756
+ ),
757
+ [
758
+ { capability: 'shopping-list.personal', paths: [['addToShoppingList']] },
759
+ {
760
+ capability: 'shopping-list.managed',
761
+ paths: [['isPublic'], ['publicCode'], ['customer']],
762
+ },
763
+ ],
669
764
  );
670
765
 
671
- export const RemoveFromShoppingListMutation = graphql(
672
- `
673
- mutation RemoveFromShoppingList($itemIds: [ID!]!, $shoppingListId: ID) {
674
- removeFromShoppingList(itemIds: $itemIds, shoppingListId: $shoppingListId) {
675
- ...ShoppingListFields
766
+ export const RemoveFromShoppingListMutation = composeCapabilityDocument(
767
+ graphql(
768
+ `
769
+ mutation RemoveFromShoppingList($itemIds: [ID!]!, $shoppingListId: ID) {
770
+ removeFromShoppingList(itemIds: $itemIds, shoppingListId: $shoppingListId) {
771
+ ...ShoppingListFields
772
+ }
676
773
  }
677
- }
678
- `,
679
- [ShoppingListFragment],
774
+ `,
775
+ [ShoppingListFragment],
776
+ ),
777
+ [
778
+ { capability: 'shopping-list.personal', paths: [['removeFromShoppingList']] },
779
+ {
780
+ capability: 'shopping-list.managed',
781
+ paths: [['isPublic'], ['publicCode'], ['customer']],
782
+ },
783
+ ],
680
784
  );
681
785
 
682
- export const UpdateShoppingListItemMutation = graphql(
683
- `
684
- mutation UpdateShoppingListItem($input: UpdateShoppingListItemInput!) {
685
- updateShoppingListItem(input: $input) {
686
- ...ShoppingListItemFields
786
+ export const UpdateShoppingListItemMutation = composeCapabilityDocument(
787
+ graphql(
788
+ `
789
+ mutation UpdateShoppingListItem($input: UpdateShoppingListItemInput!) {
790
+ updateShoppingListItem(input: $input) {
791
+ ...ShoppingListItemFields
792
+ }
687
793
  }
688
- }
689
- `,
690
- [ShoppingListItemFragment],
794
+ `,
795
+ [ShoppingListItemFragment],
796
+ ),
797
+ [
798
+ { capability: 'shopping-list.personal', paths: [['updateShoppingListItem']] },
799
+ {
800
+ capability: 'shopping-list.managed',
801
+ paths: [['purchased'], ['lastPurchasedAt']],
802
+ },
803
+ ],
691
804
  );
692
805
 
693
- export const CreateShoppingListMutation = graphql(
694
- `
695
- mutation CreateShoppingList($input: CreateShoppingListInput!) {
696
- createShoppingList(input: $input) {
697
- ...ShoppingListFields
806
+ export const CreateShoppingListMutation = composeCapabilityDocument(
807
+ graphql(
808
+ `
809
+ mutation CreateShoppingList($input: CreateShoppingListInput!) {
810
+ createShoppingList(input: $input) {
811
+ ...ShoppingListFields
812
+ }
698
813
  }
699
- }
700
- `,
701
- [ShoppingListFragment],
814
+ `,
815
+ [ShoppingListFragment],
816
+ ),
817
+ [
818
+ { capability: 'shopping-list.personal', paths: [['createShoppingList']] },
819
+ {
820
+ capability: 'shopping-list.managed',
821
+ paths: [['isPublic'], ['publicCode'], ['customer']],
822
+ },
823
+ ],
702
824
  );
703
825
 
704
- export const UpdateShoppingListMutation = graphql(
705
- `
706
- mutation UpdateShoppingList($input: UpdateShoppingListInput!) {
707
- updateShoppingList(input: $input) {
708
- ...ShoppingListFields
826
+ export const UpdateShoppingListMutation = composeCapabilityDocument(
827
+ graphql(
828
+ `
829
+ mutation UpdateShoppingList($input: UpdateShoppingListInput!) {
830
+ updateShoppingList(input: $input) {
831
+ ...ShoppingListFields
832
+ }
709
833
  }
710
- }
711
- `,
712
- [ShoppingListFragment],
834
+ `,
835
+ [ShoppingListFragment],
836
+ ),
837
+ [
838
+ { capability: 'shopping-list.personal', paths: [['updateShoppingList']] },
839
+ {
840
+ capability: 'shopping-list.managed',
841
+ paths: [['isPublic'], ['publicCode'], ['customer']],
842
+ },
843
+ ],
713
844
  );
714
845
 
715
- export const DeleteShoppingListMutation = graphql(`
716
- mutation DeleteShoppingList($id: ID!) {
717
- deleteShoppingList(id: $id) {
718
- result
719
- message
846
+ export const DeleteShoppingListMutation = forCapability(
847
+ 'shopping-list.personal',
848
+ graphql(`
849
+ mutation DeleteShoppingList($id: ID!) {
850
+ deleteShoppingList(id: $id) {
851
+ result
852
+ message
853
+ }
720
854
  }
721
- }
722
- `);
855
+ `),
856
+ [['deleteShoppingList']],
857
+ );
723
858
 
724
- export const SetShoppingListVisibilityMutation = graphql(
725
- `
726
- mutation SetShoppingListVisibility($id: ID!, $isPublic: Boolean!) {
727
- setShoppingListVisibility(id: $id, isPublic: $isPublic) {
728
- ...ShoppingListFields
859
+ export const SetShoppingListVisibilityMutation = forCapability(
860
+ 'shopping-list.managed',
861
+ graphql(
862
+ `
863
+ mutation SetShoppingListVisibility($id: ID!, $isPublic: Boolean!) {
864
+ setShoppingListVisibility(id: $id, isPublic: $isPublic) {
865
+ ...ShoppingListFields
866
+ }
729
867
  }
730
- }
731
- `,
732
- [ShoppingListFragment],
868
+ `,
869
+ [ShoppingListFragment],
870
+ ),
871
+ [['setShoppingListVisibility']],
733
872
  );
734
873
 
735
- export const AddShoppingListItemsToOrderMutation = graphql(`
736
- mutation AddShoppingListItemsToOrder($itemIds: [ID!]!) {
737
- addShoppingListItemsToOrder(itemIds: $itemIds) {
738
- __typename
739
- ... on Order {
740
- id
741
- code
742
- totalQuantity
874
+ export const AddShoppingListItemsToOrderMutation = forCapability(
875
+ 'shopping-list.personal',
876
+ graphql(`
877
+ mutation AddShoppingListItemsToOrder($itemIds: [ID!]!) {
878
+ addShoppingListItemsToOrder(itemIds: $itemIds) {
879
+ __typename
880
+ ... on Order {
881
+ id
882
+ code
883
+ totalQuantity
884
+ }
885
+ ... on ErrorResult {
886
+ errorCode
887
+ message
888
+ }
889
+ ... on OrderInterceptorError {
890
+ errorCode
891
+ message
892
+ interceptorError
893
+ }
743
894
  }
744
- ... on ErrorResult {
745
- errorCode
746
- message
895
+ }
896
+ `),
897
+ [['addShoppingListItemsToOrder']],
898
+ );
899
+
900
+ export const ApplyStoreCreditToOrderMutation = forCapability(
901
+ 'store-credit.balance',
902
+ graphql(`
903
+ mutation ApplyStoreCreditToOrder($code: String!) {
904
+ applyStoreCreditToOrder(code: $code) {
905
+ __typename
906
+ ... on Order {
907
+ id
908
+ code
909
+ totalWithTax
910
+ storeCreditsApplied {
911
+ code
912
+ balance
913
+ amountDeducted
914
+ }
915
+ totalWithTaxAfterStoreCredit
916
+ }
917
+ ... on ErrorResult {
918
+ errorCode
919
+ message
920
+ }
747
921
  }
748
- ... on OrderInterceptorError {
749
- errorCode
750
- message
751
- interceptorError
922
+ }
923
+ `),
924
+ [['applyStoreCreditToOrder']],
925
+ );
926
+
927
+ export const AddPaymentToOrderWithStoreCreditMutation = forCapability(
928
+ 'store-credit.balance',
929
+ graphql(`
930
+ mutation AddPaymentToOrderWithStoreCredit($input: PaymentInput) {
931
+ addPaymentToOrderWithStoreCredit(input: $input) {
932
+ __typename
933
+ ... on Order {
934
+ id
935
+ code
936
+ state
937
+ }
938
+ ... on ErrorResult {
939
+ errorCode
940
+ message
941
+ }
752
942
  }
753
943
  }
754
- }
755
- `);
944
+ `),
945
+ [['addPaymentToOrderWithStoreCredit']],
946
+ );
756
947
 
757
- export const ApplyStoreCreditToOrderMutation = graphql(`
758
- mutation ApplyStoreCreditToOrder($code: String!) {
759
- applyStoreCreditToOrder(code: $code) {
760
- __typename
761
- ... on Order {
948
+ export const RemoveStoreCreditFromOrderMutation = forCapability(
949
+ 'store-credit.balance',
950
+ graphql(`
951
+ mutation RemoveStoreCreditFromOrder($code: String!) {
952
+ removeStoreCreditFromOrder(code: $code) {
762
953
  id
763
954
  code
764
955
  totalWithTax
@@ -769,164 +960,172 @@ export const ApplyStoreCreditToOrderMutation = graphql(`
769
960
  }
770
961
  totalWithTaxAfterStoreCredit
771
962
  }
772
- ... on ErrorResult {
773
- errorCode
774
- message
775
- }
776
963
  }
777
- }
778
- `);
964
+ `),
965
+ [['removeStoreCreditFromOrder']],
966
+ );
779
967
 
780
- export const AddPaymentToOrderWithStoreCreditMutation = graphql(`
781
- mutation AddPaymentToOrderWithStoreCredit($input: PaymentInput) {
782
- addPaymentToOrderWithStoreCredit(input: $input) {
783
- __typename
784
- ... on Order {
785
- id
786
- code
787
- state
788
- }
789
- ... on ErrorResult {
790
- errorCode
791
- message
968
+ export const ClaimStoreCreditMutation = forCapability(
969
+ 'store-credit.balance',
970
+ graphql(`
971
+ mutation ClaimStoreCredit($code: String!) {
972
+ claimStoreCredit(code: $code) {
973
+ __typename
974
+ ... on StoreCredit {
975
+ id
976
+ type
977
+ code
978
+ balance
979
+ currencyCode
980
+ }
981
+ ... on ErrorResult {
982
+ errorCode
983
+ message
984
+ }
792
985
  }
793
986
  }
794
- }
795
- `);
987
+ `),
988
+ [['claimStoreCredit']],
989
+ );
796
990
 
797
- export const RemoveStoreCreditFromOrderMutation = graphql(`
798
- mutation RemoveStoreCreditFromOrder($code: String!) {
799
- removeStoreCreditFromOrder(code: $code) {
800
- id
801
- code
802
- totalWithTax
803
- storeCreditsApplied {
804
- code
805
- balance
806
- amountDeducted
991
+ export const AddGiftCardToOrderMutation = forCapability(
992
+ 'store-credit.gift-cards',
993
+ graphql(`
994
+ mutation AddGiftCardToOrder($input: AddGiftCardToOrderInput!) {
995
+ addGiftCardToOrder(input: $input) {
996
+ __typename
997
+ ... on Order {
998
+ id
999
+ code
1000
+ totalQuantity
1001
+ }
1002
+ ... on ErrorResult {
1003
+ errorCode
1004
+ message
1005
+ }
807
1006
  }
808
- totalWithTaxAfterStoreCredit
809
1007
  }
810
- }
811
- `);
1008
+ `),
1009
+ [['addGiftCardToOrder']],
1010
+ );
812
1011
 
813
- export const ClaimStoreCreditMutation = graphql(`
814
- mutation ClaimStoreCredit($code: String!) {
815
- claimStoreCredit(code: $code) {
816
- __typename
817
- ... on StoreCredit {
1012
+ export const RequestQuoteFromCartMutation = forCapability(
1013
+ 'quote.requests',
1014
+ graphql(`
1015
+ mutation RequestQuoteFromCart {
1016
+ requestQuoteFromCart {
818
1017
  id
819
- type
820
- code
821
- balance
822
- currencyCode
823
- }
824
- ... on ErrorResult {
825
- errorCode
826
- message
1018
+ quoteNumber
1019
+ status
827
1020
  }
828
1021
  }
829
- }
830
- `);
1022
+ `),
1023
+ [['requestQuoteFromCart']],
1024
+ );
831
1025
 
832
- export const AddGiftCardToOrderMutation = graphql(`
833
- mutation AddGiftCardToOrder($input: AddGiftCardToOrderInput!) {
834
- addGiftCardToOrder(input: $input) {
835
- __typename
836
- ... on Order {
1026
+ export const SubmitQuoteMutation = forCapability(
1027
+ 'quote.requests',
1028
+ graphql(`
1029
+ mutation SubmitQuote($quoteId: ID!) {
1030
+ submitQuoteRequest(quoteId: $quoteId) {
837
1031
  id
838
- code
839
- totalQuantity
840
- }
841
- ... on ErrorResult {
842
- errorCode
843
- message
1032
+ status
844
1033
  }
845
1034
  }
846
- }
847
- `);
848
-
849
- export const RequestQuoteFromCartMutation = graphql(`
850
- mutation RequestQuoteFromCart {
851
- requestQuoteFromCart {
852
- id
853
- quoteNumber
854
- status
855
- }
856
- }
857
- `);
1035
+ `),
1036
+ [['submitQuoteRequest']],
1037
+ );
858
1038
 
859
- export const SubmitQuoteMutation = graphql(`
860
- mutation SubmitQuote($quoteId: ID!) {
861
- submitQuoteRequest(quoteId: $quoteId) {
862
- id
863
- status
1039
+ export const AcceptQuoteMutation = forCapability(
1040
+ 'quote.requests',
1041
+ graphql(`
1042
+ mutation AcceptQuote($quoteId: ID!) {
1043
+ acceptQuote(quoteId: $quoteId) {
1044
+ id
1045
+ status
1046
+ }
864
1047
  }
865
- }
866
- `);
1048
+ `),
1049
+ [['acceptQuote']],
1050
+ );
867
1051
 
868
- export const AcceptQuoteMutation = graphql(`
869
- mutation AcceptQuote($quoteId: ID!) {
870
- acceptQuote(quoteId: $quoteId) {
871
- id
872
- status
1052
+ export const RejectQuoteMutation = forCapability(
1053
+ 'quote.requests',
1054
+ graphql(`
1055
+ mutation RejectQuote($quoteId: ID!, $reason: String) {
1056
+ rejectQuote(quoteId: $quoteId, reason: $reason) {
1057
+ id
1058
+ status
1059
+ }
873
1060
  }
874
- }
875
- `);
1061
+ `),
1062
+ [['rejectQuote']],
1063
+ );
876
1064
 
877
- export const RejectQuoteMutation = graphql(`
878
- mutation RejectQuote($quoteId: ID!, $reason: String) {
879
- rejectQuote(quoteId: $quoteId, reason: $reason) {
880
- id
881
- status
1065
+ export const RequestQuoteChangesMutation = forCapability(
1066
+ 'quote.negotiation',
1067
+ graphql(`
1068
+ mutation RequestQuoteChanges($quoteId: ID!, $reason: String) {
1069
+ requestQuoteChanges(quoteId: $quoteId, reason: $reason) {
1070
+ id
1071
+ status
1072
+ }
882
1073
  }
883
- }
884
- `);
1074
+ `),
1075
+ [['requestQuoteChanges']],
1076
+ );
885
1077
 
886
- export const RequestQuoteChangesMutation = graphql(`
887
- mutation RequestQuoteChanges($quoteId: ID!, $reason: String) {
888
- requestQuoteChanges(quoteId: $quoteId, reason: $reason) {
889
- id
890
- status
1078
+ export const AcceptAndConvertQuoteMutation = forCapability(
1079
+ 'quote.requests',
1080
+ graphql(`
1081
+ mutation AcceptAndConvertQuote($quoteId: ID!) {
1082
+ acceptAndConvertQuote(quoteId: $quoteId) {
1083
+ id
1084
+ code
1085
+ totalWithTax
1086
+ }
891
1087
  }
892
- }
893
- `);
1088
+ `),
1089
+ [['acceptAndConvertQuote']],
1090
+ );
894
1091
 
895
- export const AcceptAndConvertQuoteMutation = graphql(`
896
- mutation AcceptAndConvertQuote($quoteId: ID!) {
897
- acceptAndConvertQuote(quoteId: $quoteId) {
898
- id
899
- code
900
- totalWithTax
1092
+ export const AddQuoteCommentMutation = forCapability(
1093
+ 'quote.negotiation',
1094
+ graphql(`
1095
+ mutation AddQuoteComment($quoteId: ID!, $text: String!) {
1096
+ addQuoteComment(quoteId: $quoteId, text: $text) {
1097
+ id
1098
+ text
1099
+ createdAt
1100
+ }
901
1101
  }
902
- }
903
- `);
1102
+ `),
1103
+ [['addQuoteComment']],
1104
+ );
904
1105
 
905
- export const AddQuoteCommentMutation = graphql(`
906
- mutation AddQuoteComment($quoteId: ID!, $text: String!) {
907
- addQuoteComment(quoteId: $quoteId, text: $text) {
908
- id
909
- text
910
- createdAt
1106
+ export const CancelQuoteCheckoutMutation = forCapability(
1107
+ 'quote.requests',
1108
+ graphql(`
1109
+ mutation CancelQuoteCheckout {
1110
+ cancelQuoteCheckout
911
1111
  }
912
- }
913
- `);
914
-
915
- export const CancelQuoteCheckoutMutation = graphql(`
916
- mutation CancelQuoteCheckout {
917
- cancelQuoteCheckout
918
- }
919
- `);
1112
+ `),
1113
+ [['cancelQuoteCheckout']],
1114
+ );
920
1115
 
921
- export const RequestQuoteMutation = graphql(`
922
- mutation RequestQuote($input: RequestQuoteInput!) {
923
- requestQuote(input: $input) {
924
- id
925
- quoteNumber
926
- status
1116
+ export const RequestQuoteMutation = forCapability(
1117
+ 'quote.requests',
1118
+ graphql(`
1119
+ mutation RequestQuote($input: RequestQuoteInput!) {
1120
+ requestQuote(input: $input) {
1121
+ id
1122
+ quoteNumber
1123
+ status
1124
+ }
927
1125
  }
928
- }
929
- `);
1126
+ `),
1127
+ [['requestQuote']],
1128
+ );
930
1129
 
931
1130
  export const RemoveAllOrderLinesMutation = graphql(`
932
1131
  mutation RemoveAllOrderLines {
@@ -975,38 +1174,50 @@ export const CompleteQuoteOrderMutation = graphql(`
975
1174
 
976
1175
  // ── Tax ID mutations ──
977
1176
 
978
- export const AddTaxIdMutation = graphql(
979
- `
980
- mutation AddTaxId($input: AddTaxIdInput!) {
981
- addTaxId(input: $input) {
982
- ...TaxIdFields
1177
+ export const AddTaxIdMutation = forCapability(
1178
+ 'tax-id.validation',
1179
+ graphql(
1180
+ `
1181
+ mutation AddTaxId($input: AddTaxIdInput!) {
1182
+ addTaxId(input: $input) {
1183
+ ...TaxIdFields
1184
+ }
983
1185
  }
984
- }
985
- `,
986
- [TaxIdFragment],
1186
+ `,
1187
+ [TaxIdFragment],
1188
+ ),
1189
+ [['addTaxId']],
987
1190
  );
988
1191
 
989
- export const RemoveTaxIdMutation = graphql(`
990
- mutation RemoveTaxId($id: ID!) {
991
- removeTaxId(id: $id) {
992
- result
993
- message
1192
+ export const RemoveTaxIdMutation = forCapability(
1193
+ 'tax-id.validation',
1194
+ graphql(`
1195
+ mutation RemoveTaxId($id: ID!) {
1196
+ removeTaxId(id: $id) {
1197
+ result
1198
+ message
1199
+ }
994
1200
  }
995
- }
996
- `);
1201
+ `),
1202
+ [['removeTaxId']],
1203
+ );
997
1204
 
998
- export const SetDefaultTaxIdMutation = graphql(
999
- `
1000
- mutation SetDefaultTaxId($id: ID!) {
1001
- setDefaultTaxId(id: $id) {
1002
- ...TaxIdFields
1205
+ export const SetDefaultTaxIdMutation = forCapability(
1206
+ 'tax-id.validation',
1207
+ graphql(
1208
+ `
1209
+ mutation SetDefaultTaxId($id: ID!) {
1210
+ setDefaultTaxId(id: $id) {
1211
+ ...TaxIdFields
1212
+ }
1003
1213
  }
1004
- }
1005
- `,
1006
- [TaxIdFragment],
1214
+ `,
1215
+ [TaxIdFragment],
1216
+ ),
1217
+ [['setDefaultTaxId']],
1007
1218
  );
1008
1219
 
1009
- export const AddConfigurationToOrderMutation = graphql(`
1220
+ const AddConfigurationToOrderDocument = graphql(`
1010
1221
  mutation AddProductConfigurationToOrder($input: AddProductConfigurationToOrderInput!) {
1011
1222
  addProductConfigurationToOrder(input: $input) {
1012
1223
  id
@@ -1026,7 +1237,7 @@ export const AddConfigurationToOrderMutation = graphql(`
1026
1237
  }
1027
1238
  `);
1028
1239
 
1029
- export const UpdateConfigurationOnOrderMutation = graphql(`
1240
+ const UpdateConfigurationOnOrderDocument = graphql(`
1030
1241
  mutation UpdateProductConfigurationOnOrder($input: UpdateProductConfigurationOnOrderInput!) {
1031
1242
  updateProductConfigurationOnOrder(input: $input) {
1032
1243
  id
@@ -1046,197 +1257,289 @@ export const UpdateConfigurationOnOrderMutation = graphql(`
1046
1257
  }
1047
1258
  `);
1048
1259
 
1049
- export const RemoveConfigurationFromOrderMutation = graphql(`
1050
- mutation RemoveProductConfigurationFromOrder($productConfigurationId: ID!) {
1051
- removeProductConfigurationFromOrder(productConfigurationId: $productConfigurationId) {
1052
- id
1053
- code
1054
- totalQuantity
1260
+ /**
1261
+ * Configurator mutations are pruned from the storefront documents when the
1262
+ * `configurator.forms` grant is absent.
1263
+ */
1264
+ export const AddConfigurationToOrderMutation = forCapability(
1265
+ 'configurator.forms',
1266
+ AddConfigurationToOrderDocument,
1267
+ [['addProductConfigurationToOrder']],
1268
+ );
1269
+
1270
+ export const UpdateConfigurationOnOrderMutation = forCapability(
1271
+ 'configurator.forms',
1272
+ UpdateConfigurationOnOrderDocument,
1273
+ [['updateProductConfigurationOnOrder']],
1274
+ );
1275
+
1276
+ export const RemoveConfigurationFromOrderMutation = forCapability(
1277
+ 'configurator.forms',
1278
+ graphql(`
1279
+ mutation RemoveProductConfigurationFromOrder($productConfigurationId: ID!) {
1280
+ removeProductConfigurationFromOrder(productConfigurationId: $productConfigurationId) {
1281
+ id
1282
+ code
1283
+ totalQuantity
1284
+ }
1055
1285
  }
1056
- }
1057
- `);
1286
+ `),
1287
+ [['removeProductConfigurationFromOrder']],
1288
+ );
1058
1289
 
1059
1290
  // ── Quick Order ──
1060
1291
 
1061
- export const ValidateQuickOrderMutation = graphql(`
1062
- mutation ValidateQuickOrder($input: QuickOrderInput!) {
1063
- validateQuickOrderItems(input: $input) {
1064
- items {
1065
- sku
1066
- quantity
1067
- status
1068
- productVariant {
1069
- id
1070
- name
1292
+ export const ValidateQuickOrderMutation = forCapability(
1293
+ 'quick-order',
1294
+ graphql(`
1295
+ mutation ValidateQuickOrder($input: QuickOrderInput!) {
1296
+ validateQuickOrderItems(input: $input) {
1297
+ items {
1071
1298
  sku
1299
+ quantity
1300
+ status
1301
+ productVariant {
1302
+ id
1303
+ name
1304
+ sku
1305
+ }
1306
+ unitPriceWithTax
1307
+ lineTotalWithTax
1308
+ currencyCode
1309
+ stockStatus
1310
+ messages {
1311
+ type
1312
+ message
1313
+ }
1314
+ originalLineNumber
1072
1315
  }
1073
- unitPriceWithTax
1074
- lineTotalWithTax
1075
- currencyCode
1076
- stockStatus
1077
- messages {
1078
- type
1316
+ summary {
1317
+ totalItems
1318
+ validCount
1319
+ invalidCount
1320
+ warningCount
1321
+ }
1322
+ parseErrors {
1323
+ lineNumber
1079
1324
  message
1080
1325
  }
1081
- originalLineNumber
1082
- }
1083
- summary {
1084
- totalItems
1085
- validCount
1086
- invalidCount
1087
- warningCount
1088
1326
  }
1089
- parseErrors {
1090
- lineNumber
1091
- message
1327
+ }
1328
+ `),
1329
+ [['validateQuickOrderItems']],
1330
+ );
1331
+
1332
+ export const AddQuickOrderToCartMutation = forCapability(
1333
+ 'quick-order',
1334
+ graphql(`
1335
+ mutation AddQuickOrderToCart($input: QuickOrderInput!) {
1336
+ addQuickOrderItemsToOrder(input: $input) {
1337
+ __typename
1338
+ ... on QuickOrderAddToOrderSuccess {
1339
+ order {
1340
+ id
1341
+ code
1342
+ totalQuantity
1343
+ }
1344
+ addedCount
1345
+ skippedCount
1346
+ messages {
1347
+ type
1348
+ message
1349
+ }
1350
+ }
1351
+ ... on QuickOrderAddToOrderError {
1352
+ errorCode
1353
+ message
1354
+ }
1092
1355
  }
1093
1356
  }
1094
- }
1095
- `);
1357
+ `),
1358
+ [['addQuickOrderItemsToOrder']],
1359
+ );
1096
1360
 
1097
- export const AddQuickOrderToCartMutation = graphql(`
1098
- mutation AddQuickOrderToCart($input: QuickOrderInput!) {
1099
- addQuickOrderItemsToOrder(input: $input) {
1100
- __typename
1101
- ... on QuickOrderAddToOrderSuccess {
1361
+ export const AddReorderToActiveOrderMutation = forCapability(
1362
+ 'reorder',
1363
+ graphql(`
1364
+ mutation AddReorderToActiveOrder($input: ReorderCommitInput!) {
1365
+ addReorderToActiveOrder(input: $input) {
1102
1366
  order {
1103
1367
  id
1104
1368
  code
1105
1369
  totalQuantity
1106
1370
  }
1107
- addedCount
1108
- skippedCount
1371
+ lines {
1372
+ sourceLineId
1373
+ productVariantId
1374
+ quantity
1375
+ status
1376
+ message
1377
+ }
1109
1378
  messages {
1110
1379
  type
1111
1380
  message
1112
1381
  }
1113
- }
1114
- ... on QuickOrderAddToOrderError {
1115
- errorCode
1116
- message
1382
+ addedCount
1383
+ filteredCount
1384
+ failedCount
1117
1385
  }
1118
1386
  }
1119
- }
1120
- `);
1387
+ `),
1388
+ [['addReorderToActiveOrder']],
1389
+ );
1121
1390
 
1122
- export const AddReorderToActiveOrderMutation = graphql(`
1123
- mutation AddReorderToActiveOrder($input: ReorderCommitInput!) {
1124
- addReorderToActiveOrder(input: $input) {
1125
- order {
1391
+ export const CreateSharedCartMutation = forCapability(
1392
+ 'shared-carts.collaboration',
1393
+ graphql(`
1394
+ mutation CreateSharedCart($input: CreateSharedCartInput!) {
1395
+ createSharedCart(input: $input) {
1126
1396
  id
1127
- code
1128
- totalQuantity
1129
1397
  }
1130
- lines {
1131
- sourceLineId
1132
- productVariantId
1133
- quantity
1134
- status
1135
- message
1136
- }
1137
- messages {
1138
- type
1139
- message
1140
- }
1141
- addedCount
1142
- filteredCount
1143
- failedCount
1144
1398
  }
1145
- }
1146
- `);
1399
+ `),
1400
+ [['createSharedCart']],
1401
+ );
1147
1402
 
1148
- export const CreateSharedCartMutation = graphql(`
1149
- mutation CreateSharedCart($input: CreateSharedCartInput!) {
1150
- createSharedCart(input: $input) {
1151
- id
1403
+ export const UpdateSharedCartMutation = forCapability(
1404
+ 'shared-carts.collaboration',
1405
+ graphql(`
1406
+ mutation UpdateSharedCart($input: UpdateSharedCartInput!) {
1407
+ updateSharedCart(input: $input) {
1408
+ id
1409
+ name
1410
+ description
1411
+ }
1152
1412
  }
1153
- }
1154
- `);
1413
+ `),
1414
+ [['updateSharedCart']],
1415
+ );
1155
1416
 
1156
- export const UpdateSharedCartMutation = graphql(`
1157
- mutation UpdateSharedCart($input: UpdateSharedCartInput!) {
1158
- updateSharedCart(input: $input) {
1159
- id
1160
- name
1161
- description
1417
+ export const DeleteSharedCartMutation = forCapability(
1418
+ 'shared-carts.collaboration',
1419
+ graphql(`
1420
+ mutation DeleteSharedCart($id: ID!) {
1421
+ deleteSharedCart(id: $id) {
1422
+ result
1423
+ message
1424
+ }
1162
1425
  }
1163
- }
1164
- `);
1426
+ `),
1427
+ [['deleteSharedCart']],
1428
+ );
1165
1429
 
1166
- export const DeleteSharedCartMutation = graphql(`
1167
- mutation DeleteSharedCart($id: ID!) {
1168
- deleteSharedCart(id: $id) {
1169
- result
1170
- message
1430
+ export const AddItemToSharedCartMutation = forCapability(
1431
+ 'shared-carts.collaboration',
1432
+ graphql(`
1433
+ mutation AddItemToSharedCart($sharedCartId: ID!, $productVariantId: ID!, $quantity: Int!) {
1434
+ addItemToSharedCart(
1435
+ sharedCartId: $sharedCartId
1436
+ productVariantId: $productVariantId
1437
+ quantity: $quantity
1438
+ ) {
1439
+ id
1440
+ }
1171
1441
  }
1172
- }
1173
- `);
1442
+ `),
1443
+ [['addItemToSharedCart']],
1444
+ );
1174
1445
 
1175
- export const AddItemToSharedCartMutation = graphql(`
1176
- mutation AddItemToSharedCart($sharedCartId: ID!, $productVariantId: ID!, $quantity: Int!) {
1177
- addItemToSharedCart(
1178
- sharedCartId: $sharedCartId
1179
- productVariantId: $productVariantId
1180
- quantity: $quantity
1181
- ) {
1182
- id
1446
+ export const AdjustSharedCartLineMutation = forCapability(
1447
+ 'shared-carts.collaboration',
1448
+ graphql(`
1449
+ mutation AdjustSharedCartLine($sharedCartId: ID!, $lineId: ID!, $quantity: Int!) {
1450
+ adjustSharedCartLine(sharedCartId: $sharedCartId, lineId: $lineId, quantity: $quantity) {
1451
+ id
1452
+ }
1183
1453
  }
1184
- }
1185
- `);
1454
+ `),
1455
+ [['adjustSharedCartLine']],
1456
+ );
1186
1457
 
1187
- export const AdjustSharedCartLineMutation = graphql(`
1188
- mutation AdjustSharedCartLine($sharedCartId: ID!, $lineId: ID!, $quantity: Int!) {
1189
- adjustSharedCartLine(sharedCartId: $sharedCartId, lineId: $lineId, quantity: $quantity) {
1190
- id
1458
+ export const RemoveSharedCartLineMutation = forCapability(
1459
+ 'shared-carts.collaboration',
1460
+ graphql(`
1461
+ mutation RemoveSharedCartLine($sharedCartId: ID!, $lineId: ID!) {
1462
+ removeSharedCartLine(sharedCartId: $sharedCartId, lineId: $lineId) {
1463
+ id
1464
+ }
1191
1465
  }
1192
- }
1193
- `);
1466
+ `),
1467
+ [['removeSharedCartLine']],
1468
+ );
1194
1469
 
1195
- export const RemoveSharedCartLineMutation = graphql(`
1196
- mutation RemoveSharedCartLine($sharedCartId: ID!, $lineId: ID!) {
1197
- removeSharedCartLine(sharedCartId: $sharedCartId, lineId: $lineId) {
1198
- id
1470
+ export const AddSharedCartMemberMutation = forCapability(
1471
+ 'shared-carts.collaboration',
1472
+ graphql(`
1473
+ mutation AddSharedCartMember($input: CreateSharedCartMemberInput!) {
1474
+ addSharedCartMember(input: $input) {
1475
+ id
1476
+ }
1199
1477
  }
1200
- }
1201
- `);
1478
+ `),
1479
+ [['addSharedCartMember']],
1480
+ );
1202
1481
 
1203
- export const AddSharedCartMemberMutation = graphql(`
1204
- mutation AddSharedCartMember($input: CreateSharedCartMemberInput!) {
1205
- addSharedCartMember(input: $input) {
1206
- id
1482
+ export const RemoveSharedCartMemberMutation = forCapability(
1483
+ 'shared-carts.collaboration',
1484
+ graphql(`
1485
+ mutation RemoveSharedCartMember($sharedCartId: ID!, $customerId: ID!) {
1486
+ removeSharedCartMember(sharedCartId: $sharedCartId, customerId: $customerId) {
1487
+ id
1488
+ }
1207
1489
  }
1208
- }
1209
- `);
1490
+ `),
1491
+ [['removeSharedCartMember']],
1492
+ );
1210
1493
 
1211
- export const RemoveSharedCartMemberMutation = graphql(`
1212
- mutation RemoveSharedCartMember($sharedCartId: ID!, $customerId: ID!) {
1213
- removeSharedCartMember(sharedCartId: $sharedCartId, customerId: $customerId) {
1214
- id
1494
+ export const SetSharedCartMemberRoleMutation = forCapability(
1495
+ 'shared-carts.collaboration',
1496
+ graphql(`
1497
+ mutation SetSharedCartMemberRole($input: UpdateSharedCartMemberInput!) {
1498
+ setSharedCartMemberRole(input: $input) {
1499
+ id
1500
+ }
1215
1501
  }
1216
- }
1217
- `);
1502
+ `),
1503
+ [['setSharedCartMemberRole']],
1504
+ );
1218
1505
 
1219
- export const SetSharedCartMemberRoleMutation = graphql(`
1220
- mutation SetSharedCartMemberRole($input: UpdateSharedCartMemberInput!) {
1221
- setSharedCartMemberRole(input: $input) {
1222
- id
1506
+ export const TransferSharedCartOwnershipMutation = forCapability(
1507
+ 'shared-carts.collaboration',
1508
+ graphql(`
1509
+ mutation TransferSharedCartOwnership($sharedCartId: ID!, $newOwnerCustomerId: ID!) {
1510
+ transferSharedCartOwnership(
1511
+ sharedCartId: $sharedCartId
1512
+ newOwnerCustomerId: $newOwnerCustomerId
1513
+ ) {
1514
+ id
1515
+ }
1223
1516
  }
1224
- }
1225
- `);
1517
+ `),
1518
+ [['transferSharedCartOwnership']],
1519
+ );
1226
1520
 
1227
- export const TransferSharedCartOwnershipMutation = graphql(`
1228
- mutation TransferSharedCartOwnership($sharedCartId: ID!, $newOwnerCustomerId: ID!) {
1229
- transferSharedCartOwnership(sharedCartId: $sharedCartId, newOwnerCustomerId: $newOwnerCustomerId) {
1230
- id
1521
+ export const InitiateSharedCartCheckoutMutation = forCapability(
1522
+ 'shared-carts.collaboration',
1523
+ graphql(`
1524
+ mutation InitiateSharedCartCheckout($sharedCartId: ID!) {
1525
+ initiateSharedCartCheckout(sharedCartId: $sharedCartId) {
1526
+ id
1527
+ status
1528
+ }
1231
1529
  }
1232
- }
1233
- `);
1530
+ `),
1531
+ [['initiateSharedCartCheckout']],
1532
+ );
1234
1533
 
1235
- export const InitiateSharedCartCheckoutMutation = graphql(`
1236
- mutation InitiateSharedCartCheckout($sharedCartId: ID!) {
1237
- initiateSharedCartCheckout(sharedCartId: $sharedCartId) {
1238
- id
1239
- status
1534
+ export const TransferPunchoutCartMutation = forCapability(
1535
+ 'punchout',
1536
+ graphql(`
1537
+ mutation TransferPunchoutCart {
1538
+ transferPunchoutCart {
1539
+ browserFormPostUrl
1540
+ cxmlPayload
1541
+ }
1240
1542
  }
1241
- }
1242
- `);
1543
+ `),
1544
+ [['transferPunchoutCart']],
1545
+ );