@vendure-platform/create 0.5.0 → 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 (463) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +53 -41
  3. package/dist/add-to-existing.d.ts +19 -13
  4. package/dist/add-to-existing.js +1 -1
  5. package/dist/assets/demo-data/assets/branding/logo.svg +4 -0
  6. package/dist/assets/demo-data/assets/images/absorbent-pad.webp +0 -0
  7. package/dist/assets/demo-data/assets/images/adjustable-wrench.webp +0 -0
  8. package/dist/assets/demo-data/assets/images/anchor-bolt.webp +0 -0
  9. package/dist/assets/demo-data/assets/images/angle-grinder.webp +0 -0
  10. package/dist/assets/demo-data/assets/images/barrier-tape.webp +0 -0
  11. package/dist/assets/demo-data/assets/images/bench-grinder.webp +0 -0
  12. package/dist/assets/demo-data/assets/images/bracket.webp +0 -0
  13. package/dist/assets/demo-data/assets/images/broom.webp +0 -0
  14. package/dist/assets/demo-data/assets/images/bucket.webp +0 -0
  15. package/dist/assets/demo-data/assets/images/cable-gland.webp +0 -0
  16. package/dist/assets/demo-data/assets/images/cable-tie.webp +0 -0
  17. package/dist/assets/demo-data/assets/images/cable-tray.webp +0 -0
  18. package/dist/assets/demo-data/assets/images/cable.webp +0 -0
  19. package/dist/assets/demo-data/assets/images/chimney-base-kit.webp +0 -0
  20. package/dist/assets/demo-data/assets/images/chimney-cowl-bird-guard.webp +0 -0
  21. package/dist/assets/demo-data/assets/images/chimney-cowl-open.webp +0 -0
  22. package/dist/assets/demo-data/assets/images/chimney-storm-collar.webp +0 -0
  23. package/dist/assets/demo-data/assets/images/chimney-wall-bracket.webp +0 -0
  24. package/dist/assets/demo-data/assets/images/circular-saw.webp +0 -0
  25. package/dist/assets/demo-data/assets/images/cleaning-spray.webp +0 -0
  26. package/dist/assets/demo-data/assets/images/conduit.webp +0 -0
  27. package/dist/assets/demo-data/assets/images/cordless-drill.webp +0 -0
  28. package/dist/assets/demo-data/assets/images/drill-bits.webp +0 -0
  29. package/dist/assets/demo-data/assets/images/dust-mask.webp +0 -0
  30. package/dist/assets/demo-data/assets/images/ear-defenders.webp +0 -0
  31. package/dist/assets/demo-data/assets/images/ear-plugs.webp +0 -0
  32. package/dist/assets/demo-data/assets/images/extension-lead.webp +0 -0
  33. package/dist/assets/demo-data/assets/images/eye-wash-station.webp +0 -0
  34. package/dist/assets/demo-data/assets/images/face-shield.webp +0 -0
  35. package/dist/assets/demo-data/assets/images/file-set.webp +0 -0
  36. package/dist/assets/demo-data/assets/images/first-aid-kit.webp +0 -0
  37. package/dist/assets/demo-data/assets/images/floor-sign.webp +0 -0
  38. package/dist/assets/demo-data/assets/images/flue-bend-45.webp +0 -0
  39. package/dist/assets/demo-data/assets/images/flue-bend-90.webp +0 -0
  40. package/dist/assets/demo-data/assets/images/flue-section-1000mm.webp +0 -0
  41. package/dist/assets/demo-data/assets/images/flue-section-250mm.webp +0 -0
  42. package/dist/assets/demo-data/assets/images/flue-section-500mm.webp +0 -0
  43. package/dist/assets/demo-data/assets/images/fuse.webp +0 -0
  44. package/dist/assets/demo-data/assets/images/glove-dispenser.webp +0 -0
  45. package/dist/assets/demo-data/assets/images/grinding-disc.webp +0 -0
  46. package/dist/assets/demo-data/assets/images/hacksaw.webp +0 -0
  47. package/dist/assets/demo-data/assets/images/hammer.webp +0 -0
  48. package/dist/assets/demo-data/assets/images/hand-sanitiser.webp +0 -0
  49. package/dist/assets/demo-data/assets/images/head-torch.webp +0 -0
  50. package/dist/assets/demo-data/assets/images/heat-gun.webp +0 -0
  51. package/dist/assets/demo-data/assets/images/hex-bolt.webp +0 -0
  52. package/dist/assets/demo-data/assets/images/hex-key-set.webp +0 -0
  53. package/dist/assets/demo-data/assets/images/hex-nut.webp +0 -0
  54. package/dist/assets/demo-data/assets/images/hi-vis-jacket.webp +0 -0
  55. package/dist/assets/demo-data/assets/images/hi-vis-vest.webp +0 -0
  56. package/dist/assets/demo-data/assets/images/hose-clamp.webp +0 -0
  57. package/dist/assets/demo-data/assets/images/impact-driver.webp +0 -0
  58. package/dist/assets/demo-data/assets/images/jigsaw.webp +0 -0
  59. package/dist/assets/demo-data/assets/images/junction-box.webp +0 -0
  60. package/dist/assets/demo-data/assets/images/knee-pads.webp +0 -0
  61. package/dist/assets/demo-data/assets/images/machine-screw.webp +0 -0
  62. package/dist/assets/demo-data/assets/images/made-to-order-configurable-chimney.webp +0 -0
  63. package/dist/assets/demo-data/assets/images/mallet.webp +0 -0
  64. package/dist/assets/demo-data/assets/images/mcb.webp +0 -0
  65. package/dist/assets/demo-data/assets/images/mop.webp +0 -0
  66. package/dist/assets/demo-data/assets/images/paper-towels.webp +0 -0
  67. package/dist/assets/demo-data/assets/images/pipe-wrench.webp +0 -0
  68. package/dist/assets/demo-data/assets/images/pliers-set.webp +0 -0
  69. package/dist/assets/demo-data/assets/images/pry-bar.webp +0 -0
  70. package/dist/assets/demo-data/assets/images/rcd.webp +0 -0
  71. package/dist/assets/demo-data/assets/images/reciprocating-saw.webp +0 -0
  72. package/dist/assets/demo-data/assets/images/rivet.webp +0 -0
  73. package/dist/assets/demo-data/assets/images/roof-flashing-high-pitch.webp +0 -0
  74. package/dist/assets/demo-data/assets/images/roof-flashing-low-pitch.webp +0 -0
  75. package/dist/assets/demo-data/assets/images/safety-boots.webp +0 -0
  76. package/dist/assets/demo-data/assets/images/safety-glasses.webp +0 -0
  77. package/dist/assets/demo-data/assets/images/safety-harness.webp +0 -0
  78. package/dist/assets/demo-data/assets/images/safety-helmet.webp +0 -0
  79. package/dist/assets/demo-data/assets/images/safety-sign.webp +0 -0
  80. package/dist/assets/demo-data/assets/images/sanding-disc.webp +0 -0
  81. package/dist/assets/demo-data/assets/images/saw-blade.webp +0 -0
  82. package/dist/assets/demo-data/assets/images/screwdriver-set.webp +0 -0
  83. package/dist/assets/demo-data/assets/images/screwdriver.webp +0 -0
  84. package/dist/assets/demo-data/assets/images/self-tapping-screw.webp +0 -0
  85. package/dist/assets/demo-data/assets/images/socket-set.webp +0 -0
  86. package/dist/assets/demo-data/assets/images/socket.webp +0 -0
  87. package/dist/assets/demo-data/assets/images/spanner-set.webp +0 -0
  88. package/dist/assets/demo-data/assets/images/spanner.webp +0 -0
  89. package/dist/assets/demo-data/assets/images/spill-kit.webp +0 -0
  90. package/dist/assets/demo-data/assets/images/spirit-level.webp +0 -0
  91. package/dist/assets/demo-data/assets/images/switch.webp +0 -0
  92. package/dist/assets/demo-data/assets/images/tape-measure.webp +0 -0
  93. package/dist/assets/demo-data/assets/images/terminal-block.webp +0 -0
  94. package/dist/assets/demo-data/assets/images/threaded-rod.webp +0 -0
  95. package/dist/assets/demo-data/assets/images/torque-wrench.webp +0 -0
  96. package/dist/assets/demo-data/assets/images/utility-knife.webp +0 -0
  97. package/dist/assets/demo-data/assets/images/wall-pass-sleeve.webp +0 -0
  98. package/dist/assets/demo-data/assets/images/wall-plug.webp +0 -0
  99. package/dist/assets/demo-data/assets/images/washer.webp +0 -0
  100. package/dist/assets/demo-data/assets/images/waste-bin.webp +0 -0
  101. package/dist/assets/demo-data/assets/images/wire-connector.webp +0 -0
  102. package/dist/assets/demo-data/assets/images/wire-cutters.webp +0 -0
  103. package/dist/assets/demo-data/assets/images/wood-screw.webp +0 -0
  104. package/dist/assets/demo-data/assets/images/work-gloves.webp +0 -0
  105. package/dist/assets/demo-data/assets/images/work-light.webp +0 -0
  106. package/dist/assets/demo-data/assets/initial-data.json +667 -0
  107. package/dist/assets/demo-data/assets/products.csv +779 -0
  108. package/dist/assets/demo-data/initial-data.json +663 -663
  109. package/dist/assets/storefront/components.json +20 -20
  110. package/dist/assets/storefront/eslint.config.mjs +10 -10
  111. package/dist/assets/storefront/graphql.config.yml +1 -1
  112. package/dist/assets/storefront/next-env.d.ts +2 -1
  113. package/dist/assets/storefront/next.config.ts +19 -17
  114. package/dist/assets/storefront/package.json +3 -2
  115. package/dist/assets/storefront/postcss.config.mjs +1 -1
  116. package/dist/assets/storefront/src/app/[locale]/(catalog)/catalog/page.tsx +17 -21
  117. package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/page.tsx +64 -42
  118. package/dist/assets/storefront/src/app/[locale]/(catalog)/layout.tsx +1 -5
  119. package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/actions.ts +69 -65
  120. package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +64 -38
  121. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/page.tsx +24 -27
  122. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-results.tsx +11 -9
  123. package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-term.tsx +4 -4
  124. package/dist/assets/storefront/src/app/[locale]/(scenario)/[...path]/page.tsx +1 -1
  125. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/accept-invitation-client.tsx +8 -13
  126. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/actions.ts +11 -14
  127. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/page.tsx +30 -33
  128. package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/sign-out-and-retry.tsx +6 -6
  129. package/dist/assets/storefront/src/app/[locale]/account/addresses/actions.ts +30 -45
  130. package/dist/assets/storefront/src/app/[locale]/account/addresses/address-form.tsx +166 -159
  131. package/dist/assets/storefront/src/app/[locale]/account/addresses/addresses-client.tsx +35 -26
  132. package/dist/assets/storefront/src/app/[locale]/account/addresses/loading.tsx +1 -3
  133. package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +18 -18
  134. package/dist/assets/storefront/src/app/[locale]/account/approvals/actions.ts +5 -8
  135. package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +79 -69
  136. package/dist/assets/storefront/src/app/[locale]/account/company/actions.ts +10 -11
  137. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/actions.ts +6 -15
  138. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/address-form.tsx +57 -49
  139. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/addresses-client.tsx +23 -25
  140. package/dist/assets/storefront/src/app/[locale]/account/company/addresses/page.tsx +30 -30
  141. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/actions.ts +20 -29
  142. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-unit-form.tsx +32 -37
  143. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-units-client.tsx +32 -25
  144. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +26 -24
  145. package/dist/assets/storefront/src/app/[locale]/account/company/business-units/types.ts +7 -4
  146. package/dist/assets/storefront/src/app/[locale]/account/company/edit-company-form.tsx +11 -21
  147. package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +25 -28
  148. package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +26 -24
  149. package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/payment-methods-client.tsx +5 -7
  150. package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +24 -25
  151. package/dist/assets/storefront/src/app/[locale]/account/company/roles/roles-client.tsx +11 -26
  152. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/actions.ts +6 -10
  153. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/page.tsx +18 -16
  154. package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/tax-ids-client.tsx +74 -67
  155. package/dist/assets/storefront/src/app/[locale]/account/company/users/actions.ts +16 -25
  156. package/dist/assets/storefront/src/app/[locale]/account/company/users/edit-user-form.tsx +27 -25
  157. package/dist/assets/storefront/src/app/[locale]/account/company/users/invite-user-form.tsx +27 -19
  158. package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +34 -29
  159. package/dist/assets/storefront/src/app/[locale]/account/company/users/users-client.tsx +35 -38
  160. package/dist/assets/storefront/src/app/[locale]/account/error.tsx +1 -3
  161. package/dist/assets/storefront/src/app/[locale]/account/layout.tsx +16 -22
  162. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/page.tsx +151 -103
  163. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-actions.ts +6 -7
  164. package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-dialog.tsx +22 -48
  165. package/dist/assets/storefront/src/app/[locale]/account/orders/loading.tsx +8 -8
  166. package/dist/assets/storefront/src/app/[locale]/account/orders/page.tsx +101 -61
  167. package/dist/assets/storefront/src/app/[locale]/account/profile/actions.ts +32 -23
  168. package/dist/assets/storefront/src/app/[locale]/account/profile/change-password-form.tsx +6 -16
  169. package/dist/assets/storefront/src/app/[locale]/account/profile/edit-email-form.tsx +7 -17
  170. package/dist/assets/storefront/src/app/[locale]/account/profile/edit-profile-form.tsx +6 -16
  171. package/dist/assets/storefront/src/app/[locale]/account/profile/loading.tsx +12 -18
  172. package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +17 -15
  173. package/dist/assets/storefront/src/app/[locale]/account/quick-order/file-upload-tab.tsx +2 -6
  174. package/dist/assets/storefront/src/app/[locale]/account/quick-order/manual-entry-tab.tsx +18 -15
  175. package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +5 -6
  176. package/dist/assets/storefront/src/app/[locale]/account/quick-order/preview-table.tsx +10 -2
  177. package/dist/assets/storefront/src/app/[locale]/account/quick-order/save-to-list-dialog.tsx +24 -26
  178. package/dist/assets/storefront/src/app/[locale]/account/quick-order/sku-autocomplete.tsx +19 -10
  179. package/dist/assets/storefront/src/app/[locale]/account/quick-order/text-input-tab.tsx +3 -8
  180. package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +93 -62
  181. package/dist/assets/storefront/src/app/[locale]/account/quotes/actions.ts +38 -45
  182. package/dist/assets/storefront/src/app/[locale]/account/quotes/new/new-quote-form.tsx +3 -5
  183. package/dist/assets/storefront/src/app/[locale]/account/quotes/new/page.tsx +6 -6
  184. package/dist/assets/storefront/src/app/[locale]/account/quotes/page.tsx +92 -59
  185. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-item-search.tsx +11 -9
  186. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/add-member-form.tsx +31 -15
  187. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/members-panel.tsx +52 -33
  188. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/page.tsx +22 -14
  189. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/[id]/rename-dialog.tsx +34 -13
  190. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/actions.ts +117 -72
  191. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/new-shared-cart-form.tsx +21 -14
  192. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/new/page.tsx +10 -10
  193. package/dist/assets/storefront/src/app/[locale]/account/shared-carts/page.tsx +54 -41
  194. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/page.tsx +22 -8
  195. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/shopping-list-detail-client.tsx +62 -49
  196. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/actions.ts +9 -4
  197. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/create-shopping-list-form.tsx +5 -11
  198. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/loading.tsx +1 -1
  199. package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/page.tsx +32 -42
  200. package/dist/assets/storefront/src/app/[locale]/account/store-credits/actions.ts +8 -8
  201. package/dist/assets/storefront/src/app/[locale]/account/store-credits/claim-form.tsx +6 -10
  202. package/dist/assets/storefront/src/app/[locale]/account/store-credits/page.tsx +76 -55
  203. package/dist/assets/storefront/src/app/[locale]/account/store-credits/reveal-code.tsx +10 -6
  204. package/dist/assets/storefront/src/app/[locale]/account/verify-email/page.tsx +32 -39
  205. package/dist/assets/storefront/src/app/[locale]/cart/actions.ts +29 -23
  206. package/dist/assets/storefront/src/app/[locale]/cart/cart-items.tsx +111 -40
  207. package/dist/assets/storefront/src/app/[locale]/cart/cart-line-actions.tsx +9 -9
  208. package/dist/assets/storefront/src/app/[locale]/cart/cart-quantity-control.tsx +61 -48
  209. package/dist/assets/storefront/src/app/[locale]/cart/cart-remove-button.tsx +15 -9
  210. package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +38 -41
  211. package/dist/assets/storefront/src/app/[locale]/cart/code-input.tsx +8 -8
  212. package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +56 -35
  213. package/dist/assets/storefront/src/app/[locale]/cart/page.tsx +11 -11
  214. package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +56 -47
  215. package/dist/assets/storefront/src/app/[locale]/cart/reapproval-confirm.tsx +22 -20
  216. package/dist/assets/storefront/src/app/[locale]/cart/request-quote-button.tsx +7 -16
  217. package/dist/assets/storefront/src/app/[locale]/checkout/actions.ts +39 -65
  218. package/dist/assets/storefront/src/app/[locale]/checkout/cancel-quote-checkout-button.tsx +5 -5
  219. package/dist/assets/storefront/src/app/[locale]/checkout/checkout-flow.tsx +202 -202
  220. package/dist/assets/storefront/src/app/[locale]/checkout/checkout-provider.tsx +142 -142
  221. package/dist/assets/storefront/src/app/[locale]/checkout/order-summary.tsx +158 -139
  222. package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +58 -47
  223. package/dist/assets/storefront/src/app/[locale]/checkout/steps/delivery-step.tsx +86 -88
  224. package/dist/assets/storefront/src/app/[locale]/checkout/steps/payment-step.tsx +90 -91
  225. package/dist/assets/storefront/src/app/[locale]/checkout/steps/review-step.tsx +166 -161
  226. package/dist/assets/storefront/src/app/[locale]/checkout/steps/shipping-address-step.tsx +573 -494
  227. package/dist/assets/storefront/src/app/[locale]/error.tsx +3 -5
  228. package/dist/assets/storefront/src/app/[locale]/forgot-password/actions.ts +10 -7
  229. package/dist/assets/storefront/src/app/[locale]/forgot-password/forgot-password-form.tsx +10 -25
  230. package/dist/assets/storefront/src/app/[locale]/forgot-password/page.tsx +5 -5
  231. package/dist/assets/storefront/src/app/[locale]/globals.css +48 -48
  232. package/dist/assets/storefront/src/app/[locale]/layout.tsx +56 -50
  233. package/dist/assets/storefront/src/app/[locale]/not-found.tsx +3 -5
  234. package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +71 -102
  235. package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/page.tsx +7 -5
  236. package/dist/assets/storefront/src/app/[locale]/page.tsx +33 -35
  237. package/dist/assets/storefront/src/app/[locale]/register/actions.ts +7 -7
  238. package/dist/assets/storefront/src/app/[locale]/register/page.tsx +22 -16
  239. package/dist/assets/storefront/src/app/[locale]/register/registration-form.tsx +22 -34
  240. package/dist/assets/storefront/src/app/[locale]/register-company/actions.ts +15 -19
  241. package/dist/assets/storefront/src/app/[locale]/register-company/page.tsx +17 -15
  242. package/dist/assets/storefront/src/app/[locale]/register-company/registration-form.tsx +9 -15
  243. package/dist/assets/storefront/src/app/[locale]/reset-password/actions.ts +7 -8
  244. package/dist/assets/storefront/src/app/[locale]/reset-password/page.tsx +18 -12
  245. package/dist/assets/storefront/src/app/[locale]/reset-password/reset-password-form.tsx +8 -16
  246. package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/add-to-cart-button.tsx +10 -4
  247. package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/page.tsx +62 -30
  248. package/dist/assets/storefront/src/app/[locale]/sign-in/actions.ts +14 -16
  249. package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +17 -30
  250. package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +35 -30
  251. package/dist/assets/storefront/src/app/[locale]/verify/actions.ts +8 -8
  252. package/dist/assets/storefront/src/app/[locale]/verify/page.tsx +18 -14
  253. package/dist/assets/storefront/src/app/[locale]/verify/verify-content.tsx +25 -27
  254. package/dist/assets/storefront/src/app/[locale]/verify-pending/page.tsx +23 -23
  255. package/dist/assets/storefront/src/app/api/clear-company-context/route.ts +6 -3
  256. package/dist/assets/storefront/src/app/api/revalidate/route.ts +19 -28
  257. package/dist/assets/storefront/src/app/api/search-analytics/route.ts +1 -1
  258. package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +43 -18
  259. package/dist/assets/storefront/src/components/commerce/account-sidebar.tsx +30 -22
  260. package/dist/assets/storefront/src/components/commerce/active-filters.tsx +1 -1
  261. package/dist/assets/storefront/src/components/commerce/add-to-shared-cart.tsx +49 -27
  262. package/dist/assets/storefront/src/components/commerce/approval-decision-form.tsx +9 -13
  263. package/dist/assets/storefront/src/components/commerce/approval-status-badge.tsx +23 -15
  264. package/dist/assets/storefront/src/components/commerce/business-unit-switcher.tsx +11 -11
  265. package/dist/assets/storefront/src/components/commerce/catalog-search-bar.tsx +2 -2
  266. package/dist/assets/storefront/src/components/commerce/category-product-section.tsx +28 -16
  267. package/dist/assets/storefront/src/components/commerce/category-sidebar.tsx +31 -18
  268. package/dist/assets/storefront/src/components/commerce/collection-hero-banner.tsx +2 -4
  269. package/dist/assets/storefront/src/components/commerce/company-state-badge.tsx +10 -16
  270. package/dist/assets/storefront/src/components/commerce/company-switcher.tsx +12 -12
  271. package/dist/assets/storefront/src/components/commerce/configurator-form.tsx +188 -79
  272. package/dist/assets/storefront/src/components/commerce/facet-filters.tsx +29 -49
  273. package/dist/assets/storefront/src/components/commerce/gift-card-pdp.tsx +4 -4
  274. package/dist/assets/storefront/src/components/commerce/gift-card-product-info.tsx +20 -30
  275. package/dist/assets/storefront/src/components/commerce/instant-search-dropdown.tsx +258 -227
  276. package/dist/assets/storefront/src/components/commerce/order-status-badge.tsx +27 -19
  277. package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +27 -26
  278. package/dist/assets/storefront/src/components/commerce/permission-gate.tsx +4 -4
  279. package/dist/assets/storefront/src/components/commerce/price-range-filter.tsx +5 -5
  280. package/dist/assets/storefront/src/components/commerce/price-tiers.tsx +38 -21
  281. package/dist/assets/storefront/src/components/commerce/price.tsx +3 -3
  282. package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +39 -16
  283. package/dist/assets/storefront/src/components/commerce/product-card.tsx +35 -18
  284. package/dist/assets/storefront/src/components/commerce/product-carousel.tsx +20 -12
  285. package/dist/assets/storefront/src/components/commerce/product-grid.tsx +14 -13
  286. package/dist/assets/storefront/src/components/commerce/product-image-carousel.tsx +10 -8
  287. package/dist/assets/storefront/src/components/commerce/product-info.tsx +118 -74
  288. package/dist/assets/storefront/src/components/commerce/product-list-expansion.tsx +102 -74
  289. package/dist/assets/storefront/src/components/commerce/product-list-view.tsx +1 -1
  290. package/dist/assets/storefront/src/components/commerce/product-sidebar.tsx +36 -11
  291. package/dist/assets/storefront/src/components/commerce/product-view-switcher.tsx +33 -21
  292. package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +80 -45
  293. package/dist/assets/storefront/src/components/commerce/quote-activity-timeline.tsx +126 -50
  294. package/dist/assets/storefront/src/components/commerce/quote-comment-form.tsx +9 -13
  295. package/dist/assets/storefront/src/components/commerce/quote-csv-export-button.tsx +6 -6
  296. package/dist/assets/storefront/src/components/commerce/quote-product-search.tsx +22 -18
  297. package/dist/assets/storefront/src/components/commerce/quote-request-form.tsx +28 -27
  298. package/dist/assets/storefront/src/components/commerce/quote-status-badge.tsx +26 -18
  299. package/dist/assets/storefront/src/components/commerce/quote-validity-indicator.tsx +7 -7
  300. package/dist/assets/storefront/src/components/commerce/quote-version-comparison.tsx +50 -30
  301. package/dist/assets/storefront/src/components/commerce/related-products.tsx +37 -28
  302. package/dist/assets/storefront/src/components/commerce/shared-cart-status-badge.tsx +12 -8
  303. package/dist/assets/storefront/src/components/commerce/shop-by-category.tsx +8 -7
  304. package/dist/assets/storefront/src/components/commerce/shopping-list-toggle.tsx +14 -20
  305. package/dist/assets/storefront/src/components/commerce/sort-dropdown.tsx +9 -16
  306. package/dist/assets/storefront/src/components/commerce/store-credit-summary.tsx +30 -32
  307. package/dist/assets/storefront/src/components/commerce/subcollection-tiles.tsx +11 -13
  308. package/dist/assets/storefront/src/components/layout/auth-page-shell.tsx +2 -2
  309. package/dist/assets/storefront/src/components/layout/draft-mode-indicator.tsx +2 -7
  310. package/dist/assets/storefront/src/components/layout/draft-mode-link.tsx +4 -2
  311. package/dist/assets/storefront/src/components/layout/footer.tsx +70 -28
  312. package/dist/assets/storefront/src/components/layout/navbar/actions.ts +9 -12
  313. package/dist/assets/storefront/src/components/layout/navbar/cart-icon.tsx +9 -9
  314. package/dist/assets/storefront/src/components/layout/navbar/channel-picker-wrapper.tsx +4 -9
  315. package/dist/assets/storefront/src/components/layout/navbar/channel-picker.tsx +13 -8
  316. package/dist/assets/storefront/src/components/layout/navbar/currency-picker-wrapper.tsx +4 -4
  317. package/dist/assets/storefront/src/components/layout/navbar/currency-picker.tsx +11 -6
  318. package/dist/assets/storefront/src/components/layout/navbar/language-picker.tsx +7 -7
  319. package/dist/assets/storefront/src/components/layout/navbar/login-button.tsx +24 -21
  320. package/dist/assets/storefront/src/components/layout/navbar/mobile-nav.tsx +8 -8
  321. package/dist/assets/storefront/src/components/layout/navbar/nav-menu-items.tsx +4 -6
  322. package/dist/assets/storefront/src/components/layout/navbar/navbar-cart.tsx +1 -1
  323. package/dist/assets/storefront/src/components/layout/navbar/navbar-collections.tsx +41 -42
  324. package/dist/assets/storefront/src/components/layout/navbar/navbar-link.tsx +7 -10
  325. package/dist/assets/storefront/src/components/layout/navbar/navbar-user.tsx +18 -23
  326. package/dist/assets/storefront/src/components/layout/navbar/theme-switcher.tsx +9 -9
  327. package/dist/assets/storefront/src/components/layout/navbar.tsx +36 -31
  328. package/dist/assets/storefront/src/components/layout/search-input.tsx +35 -32
  329. package/dist/assets/storefront/src/components/providers/awaiting-approval-banner.tsx +12 -10
  330. package/dist/assets/storefront/src/components/providers/cart-count-server.tsx +14 -12
  331. package/dist/assets/storefront/src/components/providers/company-context-guard.tsx +4 -4
  332. package/dist/assets/storefront/src/components/providers/company-permissions-server.tsx +2 -6
  333. package/dist/assets/storefront/src/components/providers/theme-provider.tsx +3 -3
  334. package/dist/assets/storefront/src/components/shared/breadcrumbs.tsx +4 -1
  335. package/dist/assets/storefront/src/components/shared/country-select.tsx +63 -67
  336. package/dist/assets/storefront/src/components/shared/pagination.tsx +15 -28
  337. package/dist/assets/storefront/src/components/shared/prefetch-link.tsx +1 -1
  338. package/dist/assets/storefront/src/components/shared/skeletons/search-input-skeleton.tsx +1 -3
  339. package/dist/assets/storefront/src/components/ui/accordion.tsx +46 -51
  340. package/dist/assets/storefront/src/components/ui/alert-dialog.tsx +94 -121
  341. package/dist/assets/storefront/src/components/ui/alert.tsx +48 -54
  342. package/dist/assets/storefront/src/components/ui/aspect-ratio.tsx +5 -7
  343. package/dist/assets/storefront/src/components/ui/avatar.tsx +29 -44
  344. package/dist/assets/storefront/src/components/ui/badge.tsx +28 -37
  345. package/dist/assets/storefront/src/components/ui/breadcrumb.tsx +82 -89
  346. package/dist/assets/storefront/src/components/ui/button.tsx +43 -49
  347. package/dist/assets/storefront/src/components/ui/calendar.tsx +157 -198
  348. package/dist/assets/storefront/src/components/ui/card.tsx +53 -76
  349. package/dist/assets/storefront/src/components/ui/carousel.tsx +194 -212
  350. package/dist/assets/storefront/src/components/ui/chart.tsx +274 -317
  351. package/dist/assets/storefront/src/components/ui/checkbox.tsx +24 -27
  352. package/dist/assets/storefront/src/components/ui/collapsible.tsx +9 -21
  353. package/dist/assets/storefront/src/components/ui/command.tsx +114 -159
  354. package/dist/assets/storefront/src/components/ui/context-menu.tsx +167 -199
  355. package/dist/assets/storefront/src/components/ui/dialog.tsx +97 -114
  356. package/dist/assets/storefront/src/components/ui/drawer.tsx +93 -107
  357. package/dist/assets/storefront/src/components/ui/dropdown-menu.tsx +171 -206
  358. package/dist/assets/storefront/src/components/ui/empty-state.tsx +5 -5
  359. package/dist/assets/storefront/src/components/ui/field.tsx +196 -208
  360. package/dist/assets/storefront/src/components/ui/form.tsx +115 -139
  361. package/dist/assets/storefront/src/components/ui/hover-card.tsx +27 -33
  362. package/dist/assets/storefront/src/components/ui/input-otp.tsx +50 -59
  363. package/dist/assets/storefront/src/components/ui/input.tsx +17 -17
  364. package/dist/assets/storefront/src/components/ui/kbd-shortcut.tsx +3 -1
  365. package/dist/assets/storefront/src/components/ui/label.tsx +16 -19
  366. package/dist/assets/storefront/src/components/ui/menubar.tsx +193 -223
  367. package/dist/assets/storefront/src/components/ui/navigation-menu.tsx +123 -130
  368. package/dist/assets/storefront/src/components/ui/pagination.tsx +87 -108
  369. package/dist/assets/storefront/src/components/ui/popover.tsx +29 -35
  370. package/dist/assets/storefront/src/components/ui/progress.tsx +19 -26
  371. package/dist/assets/storefront/src/components/ui/radio-group.tsx +32 -38
  372. package/dist/assets/storefront/src/components/ui/resizable.tsx +37 -42
  373. package/dist/assets/storefront/src/components/ui/scroll-area.tsx +41 -47
  374. package/dist/assets/storefront/src/components/ui/select.tsx +130 -152
  375. package/dist/assets/storefront/src/components/ui/separator.tsx +21 -21
  376. package/dist/assets/storefront/src/components/ui/sheet.tsx +90 -111
  377. package/dist/assets/storefront/src/components/ui/sidebar.tsx +611 -649
  378. package/dist/assets/storefront/src/components/ui/skeleton.tsx +10 -10
  379. package/dist/assets/storefront/src/components/ui/slider.tsx +50 -55
  380. package/dist/assets/storefront/src/components/ui/sonner.tsx +20 -20
  381. package/dist/assets/storefront/src/components/ui/switch.tsx +23 -26
  382. package/dist/assets/storefront/src/components/ui/table.tsx +65 -97
  383. package/dist/assets/storefront/src/components/ui/tabs.tsx +39 -55
  384. package/dist/assets/storefront/src/components/ui/textarea.tsx +14 -14
  385. package/dist/assets/storefront/src/components/ui/toggle-group.tsx +56 -62
  386. package/dist/assets/storefront/src/components/ui/toggle.tsx +37 -38
  387. package/dist/assets/storefront/src/components/ui/tooltip.tsx +38 -46
  388. package/dist/assets/storefront/src/config/capabilities.ts +41 -0
  389. package/dist/assets/storefront/src/config/scenario-meta.ts +2 -2
  390. package/dist/assets/storefront/src/config/scenario.ts +24 -16
  391. package/dist/assets/storefront/src/contexts/auth-context.tsx +5 -6
  392. package/dist/assets/storefront/src/graphql-env.d.ts +47 -41
  393. package/dist/assets/storefront/src/graphql.ts +5 -5
  394. package/dist/assets/storefront/src/hooks/use-mobile.ts +13 -13
  395. package/dist/assets/storefront/src/i18n/locale-utils.ts +3 -3
  396. package/dist/assets/storefront/src/i18n/navigation.ts +4 -4
  397. package/dist/assets/storefront/src/i18n/request.ts +4 -4
  398. package/dist/assets/storefront/src/i18n/routing.ts +5 -5
  399. package/dist/assets/storefront/src/i18n/server.ts +35 -7
  400. package/dist/assets/storefront/src/lib/actions/switch-channel.ts +9 -9
  401. package/dist/assets/storefront/src/lib/actions/switch-currency.ts +7 -7
  402. package/dist/assets/storefront/src/lib/auth.ts +1 -1
  403. package/dist/assets/storefront/src/lib/backend-health.ts +14 -6
  404. package/dist/assets/storefront/src/lib/cart-count-context.tsx +10 -4
  405. package/dist/assets/storefront/src/lib/cart-guard-utils.ts +2 -1
  406. package/dist/assets/storefront/src/lib/cart-guard.ts +7 -6
  407. package/dist/assets/storefront/src/lib/channel-server.ts +4 -4
  408. package/dist/assets/storefront/src/lib/company-context.ts +1 -1
  409. package/dist/assets/storefront/src/lib/company-permissions-context.tsx +1 -5
  410. package/dist/assets/storefront/src/lib/currency-server.ts +4 -4
  411. package/dist/assets/storefront/src/lib/format.ts +16 -7
  412. package/dist/assets/storefront/src/lib/metadata.ts +39 -44
  413. package/dist/assets/storefront/src/lib/quantity.ts +2 -4
  414. package/dist/assets/storefront/src/lib/search-bar-context.tsx +7 -4
  415. package/dist/assets/storefront/src/lib/use-recent-searches.ts +8 -6
  416. package/dist/assets/storefront/src/lib/utils.ts +3 -3
  417. package/dist/assets/storefront/src/lib/vendure/actions.ts +18 -16
  418. package/dist/assets/storefront/src/lib/vendure/api.ts +36 -23
  419. package/dist/assets/storefront/src/lib/vendure/approval-utils.ts +9 -8
  420. package/dist/assets/storefront/src/lib/vendure/cached.ts +20 -15
  421. package/dist/assets/storefront/src/lib/vendure/capability-documents.ts +246 -0
  422. package/dist/assets/storefront/src/lib/vendure/capability-schema.ts +358 -0
  423. package/dist/assets/storefront/src/lib/vendure/capability-ui.ts +15 -0
  424. package/dist/assets/storefront/src/lib/vendure/mutations.ts +835 -532
  425. package/dist/assets/storefront/src/lib/vendure/queries.ts +877 -524
  426. package/dist/assets/storefront/src/proxy.ts +11 -0
  427. package/dist/assets/storefront/src/scenarios/customer/hero.tsx +2 -2
  428. package/dist/assets/storefront/src/scenarios/customer/meta.ts +1 -1
  429. package/dist/assets/storefront/src/schema.graphql +337 -243
  430. package/dist/assets/templates/README.md.hbs +25 -1
  431. package/dist/assets/templates/docker-compose.yml.hbs +4 -0
  432. package/dist/assets/templates/env.hbs +34 -9
  433. package/dist/assets/templates/environment.d.ts.hbs +1 -0
  434. package/dist/assets/templates/gitignore.hbs +7 -4
  435. package/dist/assets/templates/migrate.ts.hbs +55 -0
  436. package/dist/assets/templates/npmrc.hbs +7 -2
  437. package/dist/assets/templates/platform-edition.ts.hbs +21 -0
  438. package/dist/assets/templates/server-package.json.hbs +15 -8
  439. package/dist/assets/templates/vendure-config.ts.hbs +18 -0
  440. package/dist/bin/run.js +1 -1
  441. package/dist/cli.d.ts +1 -1
  442. package/dist/cli.js +1 -1
  443. package/dist/console-onboarding.d.ts +44 -0
  444. package/dist/console-onboarding.js +1 -0
  445. package/dist/hub-projects.d.ts +48 -0
  446. package/dist/hub-projects.js +1 -0
  447. package/dist/index.d.ts +5 -5
  448. package/dist/index.js +1 -1
  449. package/dist/plugin-registry.d.ts +61 -2
  450. package/dist/plugin-registry.js +1 -1
  451. package/dist/registry.d.ts +16 -13
  452. package/dist/registry.js +1 -1
  453. package/dist/scaffold-shared.js +1 -1
  454. package/dist/scaffold-storefront-only.js +1 -1
  455. package/dist/scaffolder.d.ts +11 -0
  456. package/dist/scaffolder.js +1 -1
  457. package/dist/storefront-copier.d.ts +7 -2
  458. package/dist/storefront-copier.js +1 -1
  459. package/dist/template-renderer.d.ts +26 -5
  460. package/dist/template-renderer.js +1 -1
  461. package/dist/types.d.ts +54 -23
  462. package/package.json +14 -2
  463. package/dist/assets/storefront/src/middleware.ts +0 -11
@@ -1,5 +1,6 @@
1
1
  import { graphql, type ResultOf } from '@/graphql';
2
2
  import type { VendureResponse } from '@vendure-platform/storefront-client';
3
+ import { composeCapabilityDocument, forCapability } from './capability-documents';
3
4
  import {
4
5
  ActiveCustomerFragment,
5
6
  CompanyAddressFragment,
@@ -72,119 +73,162 @@ export const GetActiveCustomerQuery = graphql(
72
73
  [ActiveCustomerFragment],
73
74
  );
74
75
 
75
- export const SearchProductsQuery = graphql(
76
- `
77
- query SearchProducts($input: SearchInput!) {
78
- search(input: $input) {
79
- queryId
80
- totalItems
81
- items {
82
- ...ProductCard
83
- }
84
- facets {
85
- facet {
86
- id
87
- code
88
- name
76
+ export const SearchProductsQuery = composeCapabilityDocument(
77
+ graphql(
78
+ `
79
+ query SearchProducts($input: SearchInput!) {
80
+ search(input: $input) {
81
+ queryId
82
+ totalItems
83
+ items {
84
+ ...ProductCard
89
85
  }
90
- facetValueCounts {
91
- count
92
- facetValue {
86
+ facets {
87
+ facet {
93
88
  id
94
89
  code
95
90
  name
96
91
  }
92
+ facetValueCounts {
93
+ count
94
+ facetValue {
95
+ id
96
+ code
97
+ name
98
+ }
99
+ }
97
100
  }
98
- }
99
- prices {
100
- range {
101
- min
102
- max
103
- }
104
- rangeWithTax {
105
- min
106
- max
101
+ prices {
102
+ range {
103
+ min
104
+ max
105
+ }
106
+ rangeWithTax {
107
+ min
108
+ max
109
+ }
107
110
  }
108
111
  }
109
112
  }
110
- }
111
- `,
112
- [ProductCardFragment],
113
+ `,
114
+ [ProductCardFragment],
115
+ ),
116
+ [
117
+ {
118
+ capability: 'search.foundation',
119
+ paths: [['highlights']],
120
+ },
121
+ {
122
+ capability: 'search.analytics.clickhouse',
123
+ paths: [['search', 'queryId']],
124
+ },
125
+ ],
113
126
  );
114
127
 
115
- export const GetActiveUserShoppingListQuery = graphql(
116
- `
117
- query GetActiveUserShoppingList($id: ID) {
118
- activeUserShoppingList(id: $id) {
119
- ...ShoppingListFields
120
- items {
128
+ export const GetActiveUserShoppingListQuery = composeCapabilityDocument(
129
+ graphql(
130
+ `
131
+ query GetActiveUserShoppingList($id: ID) {
132
+ activeUserShoppingList(id: $id) {
133
+ ...ShoppingListFields
121
134
  items {
122
- ...ShoppingListItemFields
135
+ items {
136
+ ...ShoppingListItemFields
137
+ }
138
+ totalItems
123
139
  }
124
- totalItems
125
140
  }
126
141
  }
127
- }
128
- `,
129
- [ShoppingListFragment, ShoppingListItemFragment],
142
+ `,
143
+ [ShoppingListFragment, ShoppingListItemFragment],
144
+ ),
145
+ [
146
+ { capability: 'shopping-list.personal', paths: [['activeUserShoppingList']] },
147
+ {
148
+ capability: 'shopping-list.managed',
149
+ paths: [['isPublic'], ['publicCode'], ['customer'], ['purchased'], ['lastPurchasedAt']],
150
+ },
151
+ ],
130
152
  );
131
153
 
132
- export const GetActiveUserShoppingListsQuery = graphql(
133
- `
134
- query GetActiveUserShoppingLists {
135
- activeUserShoppingLists {
136
- ...ShoppingListFields
137
- items {
138
- totalItems
154
+ export const GetActiveUserShoppingListsQuery = composeCapabilityDocument(
155
+ graphql(
156
+ `
157
+ query GetActiveUserShoppingLists {
158
+ activeUserShoppingLists {
159
+ ...ShoppingListFields
160
+ items {
161
+ totalItems
162
+ }
139
163
  }
140
164
  }
141
- }
142
- `,
143
- [ShoppingListFragment],
165
+ `,
166
+ [ShoppingListFragment],
167
+ ),
168
+ [
169
+ { capability: 'shopping-list.personal', paths: [['activeUserShoppingLists']] },
170
+ {
171
+ capability: 'shopping-list.managed',
172
+ paths: [['isPublic'], ['publicCode'], ['customer']],
173
+ },
174
+ ],
144
175
  );
145
176
 
146
- export const GetShoppingListsWithItemVariantsQuery = graphql(`
147
- query GetShoppingListsWithItemVariants {
148
- activeCustomer {
149
- id
150
- }
151
- activeUserShoppingLists {
152
- id
153
- name
154
- isDefault
155
- customer {
177
+ export const GetShoppingListsWithItemVariantsQuery = composeCapabilityDocument(
178
+ graphql(`
179
+ query GetShoppingListsWithItemVariants {
180
+ activeCustomer {
156
181
  id
157
182
  }
158
- items(options: { take: 100 }) {
159
- items {
183
+ activeUserShoppingLists {
184
+ id
185
+ name
186
+ isDefault
187
+ customer {
160
188
  id
161
- productVariantId
189
+ }
190
+ items(options: { take: 100 }) {
191
+ items {
192
+ id
193
+ productVariantId
194
+ }
162
195
  }
163
196
  }
164
197
  }
165
- }
166
- `);
198
+ `),
199
+ [
200
+ { capability: 'shopping-list.personal', paths: [['activeUserShoppingLists']] },
201
+ {
202
+ capability: 'shopping-list.managed',
203
+ paths: [['activeUserShoppingLists', 'customer']],
204
+ },
205
+ ],
206
+ );
167
207
 
168
- export const GetPublicShoppingListQuery = graphql(
169
- `
170
- query GetPublicShoppingList($publicCode: String!) {
171
- publicShoppingList(publicCode: $publicCode) {
172
- ...ShoppingListFields
173
- items {
208
+ export const GetPublicShoppingListQuery = forCapability(
209
+ 'shopping-list.managed',
210
+ graphql(
211
+ `
212
+ query GetPublicShoppingList($publicCode: String!) {
213
+ publicShoppingList(publicCode: $publicCode) {
214
+ ...ShoppingListFields
174
215
  items {
175
- ...ShoppingListItemFields
216
+ items {
217
+ ...ShoppingListItemFields
218
+ }
219
+ totalItems
176
220
  }
177
- totalItems
178
221
  }
179
222
  }
180
- }
181
- `,
182
- [ShoppingListFragment, ShoppingListItemFragment],
223
+ `,
224
+ [ShoppingListFragment, ShoppingListItemFragment],
225
+ ),
226
+ [['publicShoppingList']],
183
227
  );
184
228
 
185
229
  export type SearchProductsResult = Promise<VendureResponse<ResultOf<typeof SearchProductsQuery>>>;
186
230
 
187
- export const GetProductDetailQuery = graphql(`
231
+ const GetProductDetailDocument = graphql(`
188
232
  query GetProductDetail($slug: String!) {
189
233
  product(slug: $slug) {
190
234
  id
@@ -273,23 +317,48 @@ export const GetProductDetailQuery = graphql(`
273
317
  }
274
318
  `);
275
319
 
320
+ /**
321
+ * `Product.customFields.configuratorSystemCode` is registered by
322
+ * `configurator.forms`, so it is absent from the schema of a deployment
323
+ * without that grant.
324
+ */
325
+ export const GetProductDetailQuery = composeCapabilityDocument(GetProductDetailDocument, [
326
+ {
327
+ capability: 'pricing.contract',
328
+ paths: [
329
+ ['product', 'variants', 'priceTiers'],
330
+ ['product', 'variants', 'packagingUnits', 'priceTiers'],
331
+ ],
332
+ },
333
+ { capability: 'packaging-units', paths: [['product', 'variants', 'packagingUnits']] },
334
+ { capability: 'store-credit.gift-cards', paths: [['product', 'customFields', 'isGiftCard']] },
335
+ {
336
+ capability: 'configurator.forms',
337
+ paths: [['product', 'customFields', 'configuratorSystemCode']],
338
+ },
339
+ ]);
340
+
276
341
  /** The full product object returned by GetProductDetailQuery. */
277
342
  export type ProductDetail = NonNullable<ResultOf<typeof GetProductDetailQuery>['product']>;
278
343
 
279
344
  /** A packaging unit option on a product variant. */
280
345
  export type PackagingUnitOption = NonNullable<ProductDetail['variants'][number]['packagingUnits']>[number];
281
346
 
282
- export const GetDraftVariantQuery = graphql(`
283
- query GetDraftVariant($id: ID!) {
284
- contentVersioningProductVariant(id: $id) {
285
- id
286
- name
287
- sku
347
+ export const GetDraftVariantQuery = forCapability(
348
+ 'content.history',
349
+ graphql(`
350
+ query GetDraftVariant($id: ID!) {
351
+ contentVersioningProductVariant(id: $id) {
352
+ id
353
+ name
354
+ sku
355
+ }
288
356
  }
289
- }
290
- `);
357
+ `),
358
+ [['contentVersioningProductVariant']],
359
+ );
291
360
 
292
- export const GetActiveOrderQuery = graphql(`
361
+ const GetActiveOrderDocument = graphql(`
293
362
  query GetActiveOrder {
294
363
  activeOrder {
295
364
  id
@@ -380,10 +449,42 @@ export const GetActiveOrderQuery = graphql(`
380
449
  }
381
450
  `);
382
451
 
452
+ /**
453
+ * Configurator order-line links are absent from the schema without the
454
+ * `configurator.forms` grant.
455
+ */
456
+ export const GetActiveOrderQuery = composeCapabilityDocument(GetActiveOrderDocument, [
457
+ {
458
+ capability: 'store-credit.balance',
459
+ paths: [
460
+ ['activeOrder', 'storeCreditsApplied'],
461
+ ['activeOrder', 'totalWithTaxAfterStoreCredit'],
462
+ ],
463
+ },
464
+ { capability: 'store-credit.gift-cards', paths: [['activeOrder', 'lines', 'giftCardInput']] },
465
+ {
466
+ capability: 'packaging-units',
467
+ paths: [
468
+ ['activeOrder', 'lines', 'customFields', 'packagingUnit'],
469
+ ['activeOrder', 'lines', 'customFields', 'packagingUnitConversionFactor'],
470
+ ],
471
+ },
472
+ {
473
+ capability: 'configurator.forms',
474
+ paths: [
475
+ ['activeOrder', 'lines', 'customFields', 'productConfiguration'],
476
+ ['activeOrder', 'lines', 'customFields', 'productConfigurationLine'],
477
+ ],
478
+ },
479
+ { capability: 'quote.requests', paths: [['activeOrder', 'customFields', 'sourceQuoteId']] },
480
+ ]);
481
+
383
482
  /** A store credit applied to the active order. */
384
- export type StoreCredit = NonNullable<ResultOf<typeof GetActiveOrderQuery>['activeOrder']>['storeCreditsApplied'][number];
483
+ export type StoreCredit = NonNullable<
484
+ ResultOf<typeof GetActiveOrderQuery>['activeOrder']
485
+ >['storeCreditsApplied'][number];
385
486
 
386
- export const GetActiveOrderForCheckoutQuery = graphql(`
487
+ const GetActiveOrderForCheckoutDocument = graphql(`
387
488
  query GetActiveOrderForCheckout {
388
489
  activeOrder {
389
490
  id
@@ -480,6 +581,17 @@ export const GetActiveOrderForCheckoutQuery = graphql(`
480
581
  }
481
582
  `);
482
583
 
584
+ export const GetActiveOrderForCheckoutQuery = composeCapabilityDocument(GetActiveOrderForCheckoutDocument, [
585
+ {
586
+ capability: 'store-credit.balance',
587
+ paths: [
588
+ ['activeOrder', 'storeCreditsApplied'],
589
+ ['activeOrder', 'totalWithTaxAfterStoreCredit'],
590
+ ],
591
+ },
592
+ { capability: 'quote.requests', paths: [['activeOrder', 'customFields', 'sourceQuoteId']] },
593
+ ]);
594
+
483
595
  export const GetCustomerAddressesQuery = graphql(`
484
596
  query GetCustomerAddresses {
485
597
  activeCustomer {
@@ -607,7 +719,7 @@ export const GetOrderSummaryQuery = graphql(`
607
719
  }
608
720
  `);
609
721
 
610
- export const GetOrderDetailQuery = graphql(`
722
+ const GetOrderDetailDocument = graphql(`
611
723
  query GetOrderDetail($code: String!) {
612
724
  orderByCode(code: $code) {
613
725
  id
@@ -726,22 +838,134 @@ export const GetOrderDetailQuery = graphql(`
726
838
  }
727
839
  `);
728
840
 
729
- export const GetMyApprovalRequestsQuery = graphql(`
730
- query GetMyApprovalRequests($options: ApprovalRequestListOptions) {
731
- myApprovalRequests(options: $options) {
732
- totalItems
733
- items {
841
+ export const GetOrderDetailQuery = composeCapabilityDocument(GetOrderDetailDocument, [
842
+ {
843
+ capability: 'store-credit.balance',
844
+ paths: [
845
+ ['orderByCode', 'storeCreditsApplied'],
846
+ ['orderByCode', 'totalWithTaxAfterStoreCredit'],
847
+ ],
848
+ },
849
+ { capability: 'store-credit.gift-cards', paths: [['orderByCode', 'lines', 'giftCardInput']] },
850
+ ]);
851
+
852
+ const GetOrderByCodeForConfirmationDocument = graphql(`
853
+ query GetOrderByCodeForConfirmation($code: String!) {
854
+ orderByCode(code: $code) {
855
+ id
856
+ code
857
+ state
858
+ subTotal
859
+ subTotalWithTax
860
+ shipping
861
+ shippingWithTax
862
+ total
863
+ totalWithTax
864
+ currencyCode
865
+ storeCreditsApplied {
866
+ code
867
+ balance
868
+ amountDeducted
869
+ }
870
+ totalWithTaxAfterStoreCredit
871
+ payments {
872
+ id
873
+ method
874
+ amount
875
+ state
876
+ metadata
877
+ }
878
+ lines {
879
+ id
880
+ productVariant {
881
+ id
882
+ name
883
+ product {
884
+ id
885
+ name
886
+ slug
887
+ featuredAsset {
888
+ id
889
+ preview
890
+ }
891
+ }
892
+ }
893
+ quantity
894
+ linePrice
895
+ linePriceWithTax
896
+ }
897
+ shippingAddress {
898
+ fullName
899
+ streetLine1
900
+ streetLine2
901
+ city
902
+ province
903
+ postalCode
904
+ country
905
+ }
906
+ }
907
+ }
908
+ `);
909
+
910
+ export const GetOrderByCodeForConfirmationQuery = composeCapabilityDocument(
911
+ GetOrderByCodeForConfirmationDocument,
912
+ [
913
+ {
914
+ capability: 'store-credit.balance',
915
+ paths: [
916
+ ['orderByCode', 'storeCreditsApplied'],
917
+ ['orderByCode', 'totalWithTaxAfterStoreCredit'],
918
+ ],
919
+ },
920
+ ],
921
+ );
922
+
923
+ export const GetMyApprovalRequestsQuery = forCapability(
924
+ 'approval.orders',
925
+ graphql(`
926
+ query GetMyApprovalRequests($options: ApprovalRequestListOptions) {
927
+ myApprovalRequests(options: $options) {
928
+ totalItems
929
+ items {
930
+ id
931
+ createdAt
932
+ entityType
933
+ entityId
934
+ status
935
+ summary
936
+ requestedByCustomer {
937
+ id
938
+ firstName
939
+ lastName
940
+ }
941
+ decisions {
942
+ id
943
+ level
944
+ decision
945
+ comment
946
+ decidedAt
947
+ customer {
948
+ id
949
+ firstName
950
+ lastName
951
+ }
952
+ }
953
+ }
954
+ }
955
+ }
956
+ `),
957
+ [['myApprovalRequests']],
958
+ );
959
+
960
+ export const GetApprovalHistoryForEntityQuery = forCapability(
961
+ 'approval.orders',
962
+ graphql(`
963
+ query GetApprovalHistoryForEntity($entityType: String!, $entityId: ID!) {
964
+ approvalHistoryForEntity(entityType: $entityType, entityId: $entityId) {
734
965
  id
735
966
  createdAt
736
- entityType
737
- entityId
738
967
  status
739
968
  summary
740
- requestedByCustomer {
741
- id
742
- firstName
743
- lastName
744
- }
745
969
  decisions {
746
970
  id
747
971
  level
@@ -756,52 +980,34 @@ export const GetMyApprovalRequestsQuery = graphql(`
756
980
  }
757
981
  }
758
982
  }
759
- }
760
- `);
761
-
762
- export const GetApprovalHistoryForEntityQuery = graphql(`
763
- query GetApprovalHistoryForEntity($entityType: String!, $entityId: ID!) {
764
- approvalHistoryForEntity(entityType: $entityType, entityId: $entityId) {
765
- id
766
- createdAt
767
- status
768
- summary
769
- decisions {
770
- id
771
- level
772
- decision
773
- comment
774
- decidedAt
775
- customer {
776
- id
777
- firstName
778
- lastName
779
- }
780
- }
781
- }
782
- }
783
- `);
983
+ `),
984
+ [['approvalHistoryForEntity']],
985
+ );
784
986
 
785
- export const GetCompanyOrdersQuery = graphql(`
786
- query GetCompanyOrders($options: OrderListOptions) {
787
- companyOrders(options: $options) {
788
- totalItems
789
- items {
790
- id
791
- code
792
- createdAt
793
- state
794
- totalWithTax
795
- currencyCode
796
- customer {
987
+ export const GetCompanyOrdersQuery = forCapability(
988
+ 'org.accounts',
989
+ graphql(`
990
+ query GetCompanyOrders($options: OrderListOptions) {
991
+ companyOrders(options: $options) {
992
+ totalItems
993
+ items {
797
994
  id
798
- firstName
799
- lastName
995
+ code
996
+ createdAt
997
+ state
998
+ totalWithTax
999
+ currencyCode
1000
+ customer {
1001
+ id
1002
+ firstName
1003
+ lastName
1004
+ }
800
1005
  }
801
1006
  }
802
1007
  }
803
- }
804
- `);
1008
+ `),
1009
+ [['companyOrders']],
1010
+ );
805
1011
 
806
1012
  export const GetActiveChannelQuery = graphql(`
807
1013
  query GetActiveChannel {
@@ -816,166 +1022,221 @@ export const GetActiveChannelQuery = graphql(`
816
1022
  }
817
1023
  `);
818
1024
 
819
- export const GetCollectionProductsQuery = graphql(
820
- `
821
- query GetCollectionProducts($slug: String!, $input: SearchInput!) {
822
- collection(slug: $slug) {
823
- id
824
- name
825
- slug
826
- description
827
- featuredAsset {
828
- id
829
- preview
830
- }
831
- breadcrumbs {
832
- id
833
- name
834
- slug
835
- }
836
- children {
1025
+ export const GetCollectionProductsQuery = forCapability(
1026
+ 'search.foundation',
1027
+ graphql(
1028
+ `
1029
+ query GetCollectionProducts($slug: String!, $input: SearchInput!) {
1030
+ collection(slug: $slug) {
837
1031
  id
838
1032
  name
839
1033
  slug
1034
+ description
840
1035
  featuredAsset {
841
1036
  id
842
1037
  preview
843
1038
  }
1039
+ breadcrumbs {
1040
+ id
1041
+ name
1042
+ slug
1043
+ }
1044
+ children {
1045
+ id
1046
+ name
1047
+ slug
1048
+ featuredAsset {
1049
+ id
1050
+ preview
1051
+ }
1052
+ }
844
1053
  }
845
- }
846
- search(input: $input) {
847
- totalItems
848
- items {
849
- ...ProductCard
1054
+ search(input: $input) {
1055
+ totalItems
1056
+ items {
1057
+ ...ProductCard
1058
+ }
850
1059
  }
851
1060
  }
852
- }
853
- `,
854
- [ProductCardFragment],
1061
+ `,
1062
+ [ProductCardFragment],
1063
+ ),
1064
+ [['highlights']],
855
1065
  );
856
1066
 
857
- export const GetMyCompaniesQuery = graphql(`
858
- query GetMyCompanies {
859
- activeCustomer {
860
- id
861
- companyUsers {
1067
+ export const GetMyCompaniesQuery = forCapability(
1068
+ 'org.accounts',
1069
+ graphql(`
1070
+ query GetMyCompanies {
1071
+ activeCustomer {
862
1072
  id
863
- state
864
- company {
1073
+ companyUsers {
865
1074
  id
866
- name
867
1075
  state
1076
+ company {
1077
+ id
1078
+ name
1079
+ state
1080
+ }
868
1081
  }
869
1082
  }
870
1083
  }
871
- }
872
- `);
1084
+ `),
1085
+ [['activeCustomer', 'companyUsers']],
1086
+ );
873
1087
 
874
- export type CompanyUserCompany = NonNullable<ResultOf<typeof GetMyCompaniesQuery>['activeCustomer']>['companyUsers'][number]['company'];
1088
+ export type CompanyUserCompany = NonNullable<
1089
+ ResultOf<typeof GetMyCompaniesQuery>['activeCustomer']
1090
+ >['companyUsers'][number]['company'];
875
1091
 
876
- export const GetActiveCustomerCompanyQuery = graphql(
877
- `
878
- query GetActiveCustomerCompany {
879
- activeCustomer {
880
- id
881
- companyUsers {
882
- ...CompanyUser
1092
+ export const GetActiveCustomerCompanyQuery = composeCapabilityDocument(
1093
+ graphql(
1094
+ `
1095
+ query GetActiveCustomerCompany {
1096
+ activeCustomer {
1097
+ id
1098
+ companyUsers {
1099
+ ...CompanyUser
1100
+ }
883
1101
  }
884
1102
  }
885
- }
886
- `,
887
- [CompanyUserFragment],
1103
+ `,
1104
+ [CompanyUserFragment],
1105
+ ),
1106
+ [
1107
+ { capability: 'org.accounts', paths: [['activeCustomer', 'companyUsers']] },
1108
+ { capability: 'org.hierarchy', paths: [['businessUnits']] },
1109
+ ],
888
1110
  );
889
1111
 
890
- export const GetCompanyAccountQuery = graphql(
891
- `
892
- query GetCompanyAccount {
893
- companyAccount {
894
- company {
895
- ...Company
896
- }
897
- companyUser {
898
- ...CompanyUser
899
- }
900
- activeBusinessUnit {
901
- ...CompanyBusinessUnit
902
- }
903
- permissions
904
- }
905
- }
906
- `,
907
- [CompanyFragment, CompanyUserFragment, CompanyBusinessUnitFragment],
1112
+ export const GetCompanyAccountQuery = composeCapabilityDocument(
1113
+ graphql(
1114
+ `
1115
+ query GetCompanyAccount {
1116
+ companyAccount {
1117
+ company {
1118
+ ...Company
1119
+ }
1120
+ companyUser {
1121
+ ...CompanyUser
1122
+ }
1123
+ activeBusinessUnit {
1124
+ ...CompanyBusinessUnit
1125
+ }
1126
+ permissions
1127
+ }
1128
+ }
1129
+ `,
1130
+ [CompanyFragment, CompanyUserFragment, CompanyBusinessUnitFragment],
1131
+ ),
1132
+ [
1133
+ { capability: 'org.accounts', paths: [['companyAccount']] },
1134
+ {
1135
+ capability: 'org.hierarchy',
1136
+ paths: [['companyAccount', 'activeBusinessUnit'], ['businessUnits']],
1137
+ },
1138
+ ],
908
1139
  );
909
1140
 
910
- export const GetCompanyBusinessUnitsQuery = graphql(
911
- `
912
- query GetCompanyBusinessUnits {
913
- companyBusinessUnits {
914
- ...CompanyBusinessUnit
1141
+ export const GetCompanyBusinessUnitsQuery = forCapability(
1142
+ 'org.hierarchy',
1143
+ graphql(
1144
+ `
1145
+ query GetCompanyBusinessUnits {
1146
+ companyBusinessUnits {
1147
+ ...CompanyBusinessUnit
1148
+ }
915
1149
  }
916
- }
917
- `,
918
- [CompanyBusinessUnitFragment],
1150
+ `,
1151
+ [CompanyBusinessUnitFragment],
1152
+ ),
1153
+ [['companyBusinessUnits']],
919
1154
  );
920
1155
 
921
- export const GetShopCompanyUsersQuery = graphql(
922
- `
923
- query GetShopCompanyUsers {
924
- shopCompanyUsers {
925
- ...CompanyUser
1156
+ export const GetShopCompanyUsersQuery = composeCapabilityDocument(
1157
+ graphql(
1158
+ `
1159
+ query GetShopCompanyUsers {
1160
+ shopCompanyUsers {
1161
+ ...CompanyUser
1162
+ }
926
1163
  }
927
- }
928
- `,
929
- [CompanyUserFragment],
1164
+ `,
1165
+ [CompanyUserFragment],
1166
+ ),
1167
+ [
1168
+ { capability: 'org.accounts', paths: [['shopCompanyUsers']] },
1169
+ { capability: 'org.hierarchy', paths: [['businessUnits']] },
1170
+ ],
930
1171
  );
931
1172
 
932
- export const GetCompanyRolesQuery = graphql(
933
- `
934
- query GetCompanyRoles {
935
- companyRoles {
936
- ...CompanyRole
1173
+ export const GetCompanyRolesQuery = forCapability(
1174
+ 'org.accounts',
1175
+ graphql(
1176
+ `
1177
+ query GetCompanyRoles {
1178
+ companyRoles {
1179
+ ...CompanyRole
1180
+ }
937
1181
  }
938
- }
939
- `,
940
- [CompanyRoleFragment],
1182
+ `,
1183
+ [CompanyRoleFragment],
1184
+ ),
1185
+ [['companyRoles']],
941
1186
  );
942
1187
 
943
- export const GetCompanyAddressesQuery = graphql(
944
- `
945
- query GetCompanyAddresses {
946
- companyAddresses {
947
- ...CompanyAddress
948
- }
949
- }
950
- `,
951
- [CompanyAddressFragment],
1188
+ export const GetCompanyAddressesQuery = composeCapabilityDocument(
1189
+ graphql(
1190
+ `
1191
+ query GetCompanyAddresses {
1192
+ companyAddresses {
1193
+ ...CompanyAddress
1194
+ }
1195
+ }
1196
+ `,
1197
+ [CompanyAddressFragment],
1198
+ ),
1199
+ [
1200
+ { capability: 'org.accounts', paths: [['companyAddresses']] },
1201
+ { capability: 'org.hierarchy', paths: [['businessUnit']] },
1202
+ ],
952
1203
  );
953
1204
 
954
- export const GetCompanyPaymentMethodsQuery = graphql(
955
- `
956
- query GetCompanyPaymentMethods {
957
- companyPaymentMethods {
958
- ...CompanyPaymentMethod
1205
+ export const GetCompanyPaymentMethodsQuery = forCapability(
1206
+ 'org.accounts',
1207
+ graphql(
1208
+ `
1209
+ query GetCompanyPaymentMethods {
1210
+ companyPaymentMethods {
1211
+ ...CompanyPaymentMethod
1212
+ }
959
1213
  }
960
- }
961
- `,
962
- [CompanyPaymentMethodFragment],
1214
+ `,
1215
+ [CompanyPaymentMethodFragment],
1216
+ ),
1217
+ [['companyPaymentMethods']],
963
1218
  );
964
1219
 
965
- export const GetCompanyInvitationQuery = graphql(
966
- `
967
- query GetCompanyInvitation($token: String!) {
968
- companyInvitation(token: $token) {
969
- companyUser {
970
- ...CompanyUser
971
- }
972
- company {
973
- ...Company
1220
+ export const GetCompanyInvitationQuery = composeCapabilityDocument(
1221
+ graphql(
1222
+ `
1223
+ query GetCompanyInvitation($token: String!) {
1224
+ companyInvitation(token: $token) {
1225
+ companyUser {
1226
+ ...CompanyUser
1227
+ }
1228
+ company {
1229
+ ...Company
1230
+ }
974
1231
  }
975
1232
  }
976
- }
977
- `,
978
- [CompanyUserFragment, CompanyFragment],
1233
+ `,
1234
+ [CompanyUserFragment, CompanyFragment],
1235
+ ),
1236
+ [
1237
+ { capability: 'org.accounts', paths: [['companyInvitation']] },
1238
+ { capability: 'org.hierarchy', paths: [['businessUnits']] },
1239
+ ],
979
1240
  );
980
1241
 
981
1242
  export const InstantSearchQuery = graphql(`
@@ -1018,20 +1279,24 @@ export const InstantSearchQuery = graphql(`
1018
1279
  }
1019
1280
  `);
1020
1281
 
1021
- export const CollectionSearchQuery = graphql(`
1022
- query CollectionSearch($input: ExternalSearchScopedInput!) {
1023
- searchCollections(input: $input) {
1024
- items {
1025
- id
1026
- name
1027
- slug
1028
- thumbnailUrl
1029
- score
1282
+ export const CollectionSearchQuery = forCapability(
1283
+ 'search.foundation',
1284
+ graphql(`
1285
+ query CollectionSearch($input: ExternalSearchScopedInput!) {
1286
+ searchCollections(input: $input) {
1287
+ items {
1288
+ id
1289
+ name
1290
+ slug
1291
+ thumbnailUrl
1292
+ score
1293
+ }
1294
+ totalItems
1030
1295
  }
1031
- totalItems
1032
1296
  }
1033
- }
1034
- `);
1297
+ `),
1298
+ [['searchCollections']],
1299
+ );
1035
1300
 
1036
1301
  export const SearchVariantsQuery = graphql(`
1037
1302
  query SearchVariants($input: SearchInput!) {
@@ -1061,92 +1326,110 @@ export const SearchVariantsQuery = graphql(`
1061
1326
  }
1062
1327
  `);
1063
1328
 
1064
- export const QuoteStockCheckQuery = graphql(`
1065
- query QuoteStockCheck($quoteId: ID!) {
1066
- quoteStockCheck(quoteId: $quoteId) {
1067
- allInStock
1068
- outOfStockItems {
1069
- sku
1070
- productName
1071
- requestedQuantity
1072
- availableStock
1329
+ export const QuoteStockCheckQuery = forCapability(
1330
+ 'quote.requests',
1331
+ graphql(`
1332
+ query QuoteStockCheck($quoteId: ID!) {
1333
+ quoteStockCheck(quoteId: $quoteId) {
1334
+ allInStock
1335
+ outOfStockItems {
1336
+ sku
1337
+ productName
1338
+ requestedQuantity
1339
+ availableStock
1340
+ }
1073
1341
  }
1074
1342
  }
1075
- }
1076
- `);
1343
+ `),
1344
+ [['quoteStockCheck']],
1345
+ );
1077
1346
 
1078
- export const GetMyQuotesQuery = graphql(`
1079
- query GetMyQuotes($options: QuoteListOptions) {
1080
- myQuotes(options: $options) {
1081
- totalItems
1082
- items {
1083
- id
1084
- quoteNumber
1085
- status
1086
- validUntil
1087
- createdAt
1088
- customer {
1347
+ export const GetMyQuotesQuery = forCapability(
1348
+ 'quote.requests',
1349
+ graphql(`
1350
+ query GetMyQuotes($options: QuoteListOptions) {
1351
+ myQuotes(options: $options) {
1352
+ totalItems
1353
+ items {
1089
1354
  id
1090
- firstName
1091
- lastName
1092
- }
1093
- currentVersion {
1094
- total
1095
- lineItems {
1096
- sku
1097
- productName
1098
- quantity
1099
- unitPrice
1355
+ quoteNumber
1356
+ status
1357
+ validUntil
1358
+ createdAt
1359
+ customer {
1360
+ id
1361
+ firstName
1362
+ lastName
1363
+ }
1364
+ currentVersion {
1365
+ total
1366
+ lineItems {
1367
+ sku
1368
+ productName
1369
+ quantity
1370
+ unitPrice
1371
+ }
1100
1372
  }
1101
1373
  }
1102
1374
  }
1103
1375
  }
1104
- }
1105
- `);
1376
+ `),
1377
+ [['myQuotes']],
1378
+ );
1106
1379
 
1107
- export const GetMyStoreCreditsQuery = graphql(`
1108
- query GetMyStoreCredits($options: StoreCreditListOptions) {
1109
- myStoreCredits(options: $options) {
1110
- totalItems
1111
- items {
1112
- id
1113
- code
1114
- type
1115
- initialValue
1116
- balance
1117
- currencyCode
1118
- expiryDate
1119
- issuedTo {
1380
+ export const GetMyStoreCreditsQuery = forCapability(
1381
+ 'store-credit.balance',
1382
+ graphql(`
1383
+ query GetMyStoreCredits($options: StoreCreditListOptions) {
1384
+ myStoreCredits(options: $options) {
1385
+ totalItems
1386
+ items {
1120
1387
  id
1121
- firstName
1122
- lastName
1388
+ code
1389
+ type
1390
+ initialValue
1391
+ balance
1392
+ currencyCode
1393
+ expiryDate
1394
+ issuedTo {
1395
+ id
1396
+ firstName
1397
+ lastName
1398
+ }
1123
1399
  }
1124
1400
  }
1125
1401
  }
1126
- }
1127
- `);
1402
+ `),
1403
+ [['myStoreCredits']],
1404
+ );
1128
1405
 
1129
- export const GetGiftCardTemplatesQuery = graphql(`
1130
- query GetGiftCardTemplates {
1131
- giftCardTemplates {
1132
- items {
1133
- id
1134
- name
1135
- image {
1406
+ export const GetGiftCardTemplatesQuery = forCapability(
1407
+ 'store-credit.gift-cards',
1408
+ graphql(`
1409
+ query GetGiftCardTemplates {
1410
+ giftCardTemplates {
1411
+ items {
1136
1412
  id
1137
- preview
1138
- source
1413
+ name
1414
+ image {
1415
+ id
1416
+ preview
1417
+ source
1418
+ }
1139
1419
  }
1420
+ totalItems
1140
1421
  }
1141
- totalItems
1142
1422
  }
1143
- }
1144
- `);
1423
+ `),
1424
+ [['giftCardTemplates']],
1425
+ );
1145
1426
 
1146
1427
  /** A gift card template. */
1147
- export type GiftCardTemplate = ResultOf<typeof GetGiftCardTemplatesQuery>['giftCardTemplates']['items'][number];
1428
+ export type GiftCardTemplate = ResultOf<
1429
+ typeof GetGiftCardTemplatesQuery
1430
+ >['giftCardTemplates']['items'][number];
1148
1431
 
1149
- export const GetMyQuoteDetailQuery = graphql(`
1432
+ const GetMyQuoteDetailDocument = graphql(`
1150
1433
  query GetMyQuoteDetail($id: ID!) {
1151
1434
  myQuote(id: $id) {
1152
1435
  id
@@ -1211,6 +1494,17 @@ export const GetMyQuoteDetailQuery = graphql(`
1211
1494
  }
1212
1495
  `);
1213
1496
 
1497
+ export const GetMyQuoteDetailQuery = composeCapabilityDocument(GetMyQuoteDetailDocument, [
1498
+ { capability: 'quote.requests', paths: [['myQuote']] },
1499
+ {
1500
+ capability: 'quote.negotiation',
1501
+ paths: [
1502
+ ['myQuote', 'versions'],
1503
+ ['myQuote', 'comments'],
1504
+ ],
1505
+ },
1506
+ ]);
1507
+
1214
1508
  /** A quote detail object. */
1215
1509
  export type QuoteDetail = NonNullable<ResultOf<typeof GetMyQuoteDetailQuery>['myQuote']>;
1216
1510
  /** A version in a quote. */
@@ -1232,60 +1526,70 @@ export const GetQuoteOrderEligibleShippingMethodsQuery = graphql(`
1232
1526
  }
1233
1527
  `);
1234
1528
 
1235
- export const GetTaxIdsQuery = graphql(
1236
- `
1237
- query GetTaxIds {
1238
- taxIds {
1239
- ...TaxIdFields
1529
+ export const GetTaxIdsQuery = forCapability(
1530
+ 'tax-id.validation',
1531
+ graphql(
1532
+ `
1533
+ query GetTaxIds {
1534
+ taxIds {
1535
+ ...TaxIdFields
1536
+ }
1240
1537
  }
1241
- }
1242
- `,
1243
- [TaxIdFragment],
1538
+ `,
1539
+ [TaxIdFragment],
1540
+ ),
1541
+ [['taxIds']],
1244
1542
  );
1245
1543
 
1246
1544
  // ── Configurator ─────────────────────────────────────────
1247
1545
 
1248
- export const GetConfiguratorSystemQuery = graphql(`
1249
- query GetConfiguratorSystem($code: String!) {
1250
- configuratorSystem(code: $code) {
1251
- id
1252
- code
1253
- name
1254
- description
1255
- modules {
1546
+ export const GetConfiguratorSystemQuery = forCapability(
1547
+ 'configurator.forms',
1548
+ graphql(`
1549
+ query GetConfiguratorSystem($code: String!) {
1550
+ configuratorSystem(code: $code) {
1256
1551
  id
1257
1552
  code
1258
1553
  name
1259
- optional
1260
- sortOrder
1261
- fields {
1554
+ description
1555
+ modules {
1262
1556
  id
1263
1557
  code
1264
- fieldType
1265
1558
  name
1266
- unit
1267
- defaultValue
1268
- required
1559
+ optional
1269
1560
  sortOrder
1270
- min
1271
- max
1272
- options {
1561
+ fields {
1273
1562
  id
1274
1563
  code
1275
- label
1564
+ fieldType
1565
+ name
1566
+ unit
1567
+ defaultValue
1568
+ required
1569
+ sortOrder
1570
+ min
1571
+ max
1572
+ options {
1573
+ id
1574
+ code
1575
+ label
1576
+ }
1577
+ dynamicOptionsSource
1276
1578
  }
1277
- dynamicOptionsSource
1278
1579
  }
1279
1580
  }
1280
1581
  }
1281
- }
1282
- `);
1582
+ `),
1583
+ [['configuratorSystem']],
1584
+ );
1283
1585
 
1284
- export type ConfiguratorSystem = NonNullable<ResultOf<typeof GetConfiguratorSystemQuery>['configuratorSystem']>;
1586
+ export type ConfiguratorSystem = NonNullable<
1587
+ ResultOf<typeof GetConfiguratorSystemQuery>['configuratorSystem']
1588
+ >;
1285
1589
  export type ConfiguratorModule = ConfiguratorSystem['modules'][number];
1286
1590
  export type ConfiguratorField = ConfiguratorModule['fields'][number];
1287
1591
 
1288
- export const EvaluateConfigurationQuery = graphql(`
1592
+ const EvaluateConfigurationDocument = graphql(`
1289
1593
  query EvaluateProductConfiguration($input: EvaluateProductConfigurationInput!) {
1290
1594
  evaluateProductConfiguration(input: $input) {
1291
1595
  fields {
@@ -1350,32 +1654,46 @@ export const EvaluateConfigurationQuery = graphql(`
1350
1654
  }
1351
1655
  `);
1352
1656
 
1353
- export type ConfigurationEvaluation = ResultOf<typeof EvaluateConfigurationQuery>['evaluateProductConfiguration'];
1657
+ /**
1658
+ * Configurator evaluation details only exist in the schema with
1659
+ * `configurator.forms`.
1660
+ */
1661
+ export const EvaluateConfigurationQuery = forCapability('configurator.forms', EvaluateConfigurationDocument, [
1662
+ ['evaluateProductConfiguration'],
1663
+ ]);
1664
+
1665
+ export type ConfigurationEvaluation = ResultOf<
1666
+ typeof EvaluateConfigurationQuery
1667
+ >['evaluateProductConfiguration'];
1354
1668
  export type EvaluatedField = ConfigurationEvaluation['fields'][number];
1355
1669
  export type EvaluatedLine = ConfigurationEvaluation['lines'][number];
1356
1670
  export type EvaluatedExecutedRule = ConfigurationEvaluation['executedRules'][number];
1357
1671
 
1358
- export const GetActiveOrderConfigurationsQuery = graphql(`
1359
- query GetActiveOrderConfigurations {
1360
- activeOrder {
1361
- id
1362
- productConfigurations {
1672
+ export const GetActiveOrderConfigurationsQuery = forCapability(
1673
+ 'configurator.forms',
1674
+ graphql(`
1675
+ query GetActiveOrderConfigurations {
1676
+ activeOrder {
1363
1677
  id
1364
- name
1365
- system {
1366
- id
1367
- code
1368
- }
1369
- fieldValues {
1678
+ productConfigurations {
1370
1679
  id
1371
- moduleCode
1372
- fieldCode
1373
- value
1680
+ name
1681
+ system {
1682
+ id
1683
+ code
1684
+ }
1685
+ fieldValues {
1686
+ id
1687
+ moduleCode
1688
+ fieldCode
1689
+ value
1690
+ }
1374
1691
  }
1375
1692
  }
1376
1693
  }
1377
- }
1378
- `);
1694
+ `),
1695
+ [['activeOrder', 'productConfigurations']],
1696
+ );
1379
1697
 
1380
1698
  export type ActiveOrderConfiguration = NonNullable<
1381
1699
  NonNullable<ResultOf<typeof GetActiveOrderConfigurationsQuery>['activeOrder']>['productConfigurations']
@@ -1383,59 +1701,67 @@ export type ActiveOrderConfiguration = NonNullable<
1383
1701
 
1384
1702
  // ── Quick Order ──
1385
1703
 
1386
- export const QuickOrderSearchQuery = graphql(`
1387
- query QuickOrderSearch($term: String!, $take: Int) {
1388
- quickOrderSearch(term: $term, take: $take) {
1389
- variantId
1390
- sku
1391
- productName
1392
- variantName
1393
- price
1394
- priceWithTax
1395
- currencyCode
1396
- inStock
1704
+ export const QuickOrderSearchQuery = forCapability(
1705
+ 'quick-order',
1706
+ graphql(`
1707
+ query QuickOrderSearch($term: String!, $take: Int) {
1708
+ quickOrderSearch(term: $term, take: $take) {
1709
+ variantId
1710
+ sku
1711
+ productName
1712
+ variantName
1713
+ price
1714
+ priceWithTax
1715
+ currencyCode
1716
+ inStock
1717
+ }
1397
1718
  }
1398
- }
1399
- `);
1719
+ `),
1720
+ [['quickOrderSearch']],
1721
+ );
1400
1722
 
1401
- export const PreviewReorderQuery = graphql(`
1402
- query PreviewReorder($input: ReorderPreviewInput!) {
1403
- previewReorder(input: $input) {
1404
- lines {
1405
- sourceLineId
1406
- productVariant {
1407
- id
1408
- name
1409
- sku
1410
- product {
1723
+ export const PreviewReorderQuery = forCapability(
1724
+ 'reorder',
1725
+ graphql(`
1726
+ query PreviewReorder($input: ReorderPreviewInput!) {
1727
+ previewReorder(input: $input) {
1728
+ lines {
1729
+ sourceLineId
1730
+ productVariant {
1731
+ id
1411
1732
  name
1412
- slug
1413
- featuredAsset {
1414
- id
1415
- preview
1733
+ sku
1734
+ product {
1735
+ name
1736
+ slug
1737
+ featuredAsset {
1738
+ id
1739
+ preview
1740
+ }
1416
1741
  }
1417
1742
  }
1743
+ quantity
1744
+ status
1745
+ originalUnitPrice
1746
+ originalUnitPriceWithTax
1747
+ currentCatalogUnitPrice
1748
+ currentCatalogUnitPriceWithTax
1749
+ messages {
1750
+ type
1751
+ message
1752
+ }
1418
1753
  }
1419
- quantity
1420
- status
1421
- originalUnitPrice
1422
- originalUnitPriceWithTax
1423
- currentCatalogUnitPrice
1424
- currentCatalogUnitPriceWithTax
1425
- messages {
1426
- type
1427
- message
1754
+ summary {
1755
+ availableCount
1756
+ unavailableCount
1757
+ indicativeTotal
1758
+ currencyCode
1428
1759
  }
1429
1760
  }
1430
- summary {
1431
- availableCount
1432
- unavailableCount
1433
- indicativeTotal
1434
- currencyCode
1435
- }
1436
1761
  }
1437
- }
1438
- `);
1762
+ `),
1763
+ [['previewReorder']],
1764
+ );
1439
1765
 
1440
1766
  // ---------------------------------------------------------------------------
1441
1767
  // Shared Carts (EE-13)
@@ -1445,136 +1771,163 @@ export const PreviewReorderQuery = graphql(`
1445
1771
  // fragments) to match the masking-on convention of the other list queries.
1446
1772
  // ---------------------------------------------------------------------------
1447
1773
 
1448
- export const GetMySharedCartsQuery = graphql(`
1449
- query GetMySharedCarts($options: SharedCartListOptions) {
1450
- mySharedCarts(options: $options) {
1451
- totalItems
1452
- items {
1453
- id
1454
- name
1455
- status
1456
- updatedAt
1457
- owner {
1774
+ export const GetMySharedCartsQuery = forCapability(
1775
+ 'shared-carts.collaboration',
1776
+ graphql(`
1777
+ query GetMySharedCarts($options: SharedCartListOptions) {
1778
+ mySharedCarts(options: $options) {
1779
+ totalItems
1780
+ items {
1458
1781
  id
1459
- firstName
1460
- lastName
1461
- }
1462
- members {
1463
- role
1464
- customer {
1782
+ name
1783
+ status
1784
+ updatedAt
1785
+ owner {
1465
1786
  id
1787
+ firstName
1788
+ lastName
1789
+ }
1790
+ members {
1791
+ role
1792
+ customer {
1793
+ id
1794
+ }
1795
+ }
1796
+ order {
1797
+ id
1798
+ currencyCode
1799
+ totalWithTax
1800
+ totalQuantity
1466
1801
  }
1467
- }
1468
- order {
1469
- id
1470
- currencyCode
1471
- totalWithTax
1472
- totalQuantity
1473
1802
  }
1474
1803
  }
1475
1804
  }
1476
- }
1477
- `);
1805
+ `),
1806
+ [['mySharedCarts']],
1807
+ );
1478
1808
 
1479
1809
  // Company-wide list for company admins (ManageSharedCarts): every cart in the company, including
1480
1810
  // ones the admin isn't a member of. Same shape as GetMySharedCarts so the list page can render
1481
1811
  // either result interchangeably.
1482
- export const GetCompanySharedCartsQuery = graphql(`
1483
- query GetCompanySharedCarts($options: SharedCartListOptions) {
1484
- companySharedCarts(options: $options) {
1485
- totalItems
1486
- items {
1812
+ export const GetCompanySharedCartsQuery = forCapability(
1813
+ 'shared-carts.collaboration',
1814
+ graphql(`
1815
+ query GetCompanySharedCarts($options: SharedCartListOptions) {
1816
+ companySharedCarts(options: $options) {
1817
+ totalItems
1818
+ items {
1819
+ id
1820
+ name
1821
+ status
1822
+ updatedAt
1823
+ owner {
1824
+ id
1825
+ firstName
1826
+ lastName
1827
+ }
1828
+ members {
1829
+ role
1830
+ customer {
1831
+ id
1832
+ }
1833
+ }
1834
+ order {
1835
+ id
1836
+ currencyCode
1837
+ totalWithTax
1838
+ totalQuantity
1839
+ }
1840
+ }
1841
+ }
1842
+ }
1843
+ `),
1844
+ [['companySharedCarts']],
1845
+ );
1846
+
1847
+ export const GetSharedCartQuery = forCapability(
1848
+ 'shared-carts.collaboration',
1849
+ graphql(`
1850
+ query GetSharedCart($id: ID!) {
1851
+ sharedCart(id: $id) {
1487
1852
  id
1488
1853
  name
1854
+ description
1489
1855
  status
1856
+ createdAt
1490
1857
  updatedAt
1858
+ companyId
1491
1859
  owner {
1492
1860
  id
1493
1861
  firstName
1494
1862
  lastName
1863
+ emailAddress
1495
1864
  }
1496
1865
  members {
1497
1866
  role
1498
1867
  customer {
1499
1868
  id
1869
+ firstName
1870
+ lastName
1871
+ emailAddress
1500
1872
  }
1501
1873
  }
1502
1874
  order {
1503
1875
  id
1876
+ code
1504
1877
  currencyCode
1878
+ subTotalWithTax
1505
1879
  totalWithTax
1506
1880
  totalQuantity
1881
+ customer {
1882
+ id
1883
+ firstName
1884
+ lastName
1885
+ }
1886
+ lines {
1887
+ id
1888
+ quantity
1889
+ unitPriceWithTax
1890
+ linePriceWithTax
1891
+ productVariant {
1892
+ id
1893
+ name
1894
+ sku
1895
+ }
1896
+ featuredAsset {
1897
+ preview
1898
+ }
1899
+ }
1507
1900
  }
1508
- }
1509
- }
1510
- }
1511
- `);
1512
-
1513
- export const GetSharedCartQuery = graphql(`
1514
- query GetSharedCart($id: ID!) {
1515
- sharedCart(id: $id) {
1516
- id
1517
- name
1518
- description
1519
- status
1520
- createdAt
1521
- updatedAt
1522
- companyId
1523
- owner {
1524
- id
1525
- firstName
1526
- lastName
1527
- emailAddress
1528
- }
1529
- members {
1530
- role
1531
- customer {
1532
- id
1533
- firstName
1534
- lastName
1535
- emailAddress
1536
- }
1537
- }
1538
- order {
1539
- id
1540
- code
1541
- currencyCode
1542
- subTotalWithTax
1543
- totalWithTax
1544
- totalQuantity
1545
- customer {
1546
- id
1547
- firstName
1548
- lastName
1549
- }
1550
- lines {
1901
+ activity {
1551
1902
  id
1552
- quantity
1553
- unitPriceWithTax
1554
- linePriceWithTax
1555
- productVariant {
1903
+ createdAt
1904
+ action
1905
+ targetLineId
1906
+ detail
1907
+ actorLabel
1908
+ targetCustomer {
1556
1909
  id
1557
- name
1558
- sku
1559
- }
1560
- featuredAsset {
1561
- preview
1910
+ firstName
1911
+ lastName
1562
1912
  }
1563
1913
  }
1564
1914
  }
1565
- activity {
1915
+ }
1916
+ `),
1917
+ [['sharedCart']],
1918
+ );
1919
+
1920
+ export const GetActivePunchoutSessionQuery = forCapability(
1921
+ 'punchout',
1922
+ graphql(`
1923
+ query GetActivePunchoutSession {
1924
+ activePunchoutSession {
1566
1925
  id
1567
- createdAt
1568
- action
1569
- targetLineId
1570
- detail
1571
- actorLabel
1572
- targetCustomer {
1573
- id
1574
- firstName
1575
- lastName
1576
- }
1926
+ buyerCookie
1927
+ tradingPartnerName
1928
+ expiresAt
1577
1929
  }
1578
1930
  }
1579
- }
1580
- `);
1931
+ `),
1932
+ [['activePunchoutSession']],
1933
+ );