@wix/agent-skills 1.21.0 → 1.23.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 (269) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +71 -7
  3. package/skills/wix-app/references/APP_VALIDATION.md +16 -10
  4. package/skills/wix-app/references/DASHBOARD_PAGE.md +11 -25
  5. package/skills/wix-app/references/DATA_COLLECTION.md +16 -219
  6. package/skills/wix-app/references/SDK_MODULE_MAP.md +2 -0
  7. package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +182 -0
  8. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +97 -0
  9. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +184 -0
  10. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +203 -0
  11. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +44 -0
  12. package/skills/wix-app/references/dashboard-page/QUERY_AND_PAGING.md +182 -0
  13. package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +133 -0
  14. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +10 -5
  15. package/skills/wix-app/references/data-collection/LIFECYCLE.md +68 -0
  16. package/skills/wix-app/references/data-collection/PERMISSIONS.md +47 -0
  17. package/skills/wix-app/references/data-collection/SCHEMA.md +181 -0
  18. package/skills/wix-app/references/data-collection/WIX_DATA.md +38 -66
  19. package/skills/wix-headless-fast/SKILL.md +95 -230
  20. package/skills/wix-headless-fast/cold-start/bootstrap.mjs +156 -0
  21. package/skills/wix-headless-fast/{entry/skill.md → cold-start/cold-start.md} +17 -14
  22. package/skills/wix-headless-fast/guides/existing-site.md +78 -0
  23. package/skills/wix-headless-fast/guides/migration.md +43 -0
  24. package/skills/wix-headless-fast/guides/reference-mode.md +100 -0
  25. package/skills/wix-headless-fast/install/AGENTS.md +9 -4
  26. package/skills/wix-headless-fast/install/agents-md.mjs +5 -1
  27. package/skills/wix-headless-fast/install/attach.mjs +25 -47
  28. package/skills/wix-headless-fast/install/check.mjs +87 -0
  29. package/skills/wix-headless-fast/install/context.mjs +126 -0
  30. package/skills/wix-headless-fast/install/deploy.mjs +106 -80
  31. package/skills/wix-headless-fast/install/lock.mjs +55 -0
  32. package/skills/wix-headless-fast/install/setup.mjs +83 -23
  33. package/skills/wix-headless-fast/install/templates.mjs +168 -0
  34. package/skills/wix-manage/SKILL.md +3 -3
  35. package/skills/wix-manage/references/app-installation/install-wix-apps.md +68 -2
  36. package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +37 -4
  37. package/skills/wix-manage/references/ecommerce/ecom-pricing.md +29 -3
  38. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +27 -0
  39. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +83 -37
  40. package/skills/wix-manage/references/sites/site-import.md +101 -37
  41. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +0 -303
  42. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +0 -136
  43. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +0 -112
  44. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +0 -42
  45. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +0 -31
  46. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +0 -22
  47. package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +0 -137
  48. package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +0 -78
  49. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +0 -117
  50. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +0 -52
  51. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +0 -47
  52. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +0 -58
  53. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +0 -62
  54. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +0 -40
  55. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +0 -97
  56. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +0 -24
  57. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +0 -16156
  58. package/skills/wix-headless-fast/references/blog/rest/posts.ts +0 -42
  59. package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +0 -62
  60. package/skills/wix-headless-fast/references/blog/seed/SEED.md +0 -81
  61. package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +0 -22
  62. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +0 -287
  63. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +0 -277
  64. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +0 -144
  65. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +0 -119
  66. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +0 -32
  67. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +0 -23
  68. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +0 -218
  69. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +0 -169
  70. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +0 -121
  71. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +0 -92
  72. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +0 -90
  73. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +0 -57
  74. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +0 -72
  75. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +0 -40
  76. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +0 -76
  77. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +0 -22
  78. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +0 -11962
  79. package/skills/wix-headless-fast/references/bookings/rest/booking.ts +0 -113
  80. package/skills/wix-headless-fast/references/bookings/rest/services.ts +0 -55
  81. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +0 -71
  82. package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +0 -28
  83. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +0 -302
  84. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +0 -355
  85. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +0 -50
  86. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +0 -37
  87. package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +0 -158
  88. package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +0 -93
  89. package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +0 -177
  90. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +0 -123
  91. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +0 -75
  92. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +0 -41
  93. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +0 -11262
  94. package/skills/wix-headless-fast/references/cms/rest/items.ts +0 -125
  95. package/skills/wix-headless-fast/references/cms/seed/SEED.md +0 -112
  96. package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +0 -20
  97. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +0 -324
  98. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +0 -307
  99. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +0 -66
  100. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +0 -178
  101. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +0 -118
  102. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +0 -35
  103. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +0 -24
  104. package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +0 -130
  105. package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +0 -97
  106. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +0 -55
  107. package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +0 -113
  108. package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +0 -156
  109. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +0 -97
  110. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +0 -61
  111. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +0 -40
  112. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +0 -12
  113. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +0 -80
  114. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +0 -21
  115. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +0 -11884
  116. package/skills/wix-headless-fast/references/events/rest/events.ts +0 -57
  117. package/skills/wix-headless-fast/references/events/rest/registration.ts +0 -83
  118. package/skills/wix-headless-fast/references/events/seed/SEED.md +0 -95
  119. package/skills/wix-headless-fast/references/events/seed/read-site.mjs +0 -26
  120. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +0 -276
  121. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +0 -340
  122. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +0 -85
  123. package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +0 -332
  124. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +0 -238
  125. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +0 -54
  126. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +0 -216
  127. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +0 -59
  128. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +0 -135
  129. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +0 -10593
  130. package/skills/wix-headless-fast/references/forms/rest/forms.ts +0 -34
  131. package/skills/wix-headless-fast/references/forms/rest/submissions.ts +0 -56
  132. package/skills/wix-headless-fast/references/forms/seed/SEED.md +0 -116
  133. package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +0 -20
  134. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +0 -327
  135. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +0 -316
  136. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +0 -60
  137. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +0 -155
  138. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +0 -78
  139. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +0 -47
  140. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +0 -66
  141. package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +0 -105
  142. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +0 -59
  143. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +0 -53
  144. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +0 -122
  145. package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +0 -43
  146. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +0 -29
  147. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +0 -21
  148. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +0 -42
  149. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +0 -10
  150. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +0 -11
  151. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +0 -10329
  152. package/skills/wix-headless-fast/references/members/rest/auth.ts +0 -215
  153. package/skills/wix-headless-fast/references/members/rest/members.ts +0 -26
  154. package/skills/wix-headless-fast/references/members/seed/SEED.md +0 -39
  155. package/skills/wix-headless-fast/references/members/seed/read-site.mjs +0 -15
  156. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +0 -94
  157. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +0 -315
  158. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +0 -110
  159. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +0 -90
  160. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +0 -35
  161. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +0 -85
  162. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +0 -32
  163. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +0 -21
  164. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +0 -31
  165. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +0 -82
  166. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +0 -58
  167. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +0 -177
  168. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +0 -78
  169. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +0 -81
  170. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +0 -55
  171. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +0 -40
  172. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +0 -30
  173. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +0 -21
  174. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +0 -29
  175. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +0 -10197
  176. package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +0 -75
  177. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +0 -86
  178. package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +0 -20
  179. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +0 -256
  180. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +0 -296
  181. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +0 -47
  182. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +0 -101
  183. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +0 -41
  184. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +0 -16
  185. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +0 -22
  186. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +0 -54
  187. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +0 -106
  188. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +0 -64
  189. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +0 -27
  190. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +0 -43
  191. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +0 -22
  192. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +0 -30
  193. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +0 -41
  194. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +0 -40
  195. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +0 -21
  196. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +0 -11226
  197. package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +0 -31
  198. package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +0 -20
  199. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +0 -79
  200. package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +0 -21
  201. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +0 -279
  202. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +0 -360
  203. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +0 -142
  204. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +0 -26
  205. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +0 -121
  206. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +0 -155
  207. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +0 -34
  208. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +0 -43
  209. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +0 -34
  210. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +0 -155
  211. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +0 -89
  212. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +0 -71
  213. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +0 -103
  214. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +0 -124
  215. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +0 -185
  216. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +0 -193
  217. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +0 -94
  218. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +0 -74
  219. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +0 -168
  220. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +0 -47
  221. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +0 -22
  222. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +0 -12
  223. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +0 -12560
  224. package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +0 -60
  225. package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +0 -169
  226. package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +0 -68
  227. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +0 -89
  228. package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +0 -25
  229. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +0 -499
  230. package/skills/wix-headless-fast/references/shared/CONTENT.md +0 -22
  231. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +0 -73
  232. package/skills/wix-headless-fast/references/shared/DESIGN.md +0 -26
  233. package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +0 -23
  234. package/skills/wix-headless-fast/references/shared/app/styles/global.css +0 -52
  235. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +0 -15
  236. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +0 -81
  237. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +0 -24
  238. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +0 -89
  239. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +0 -46
  240. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +0 -46
  241. package/skills/wix-headless-fast/references/shared/rest/client.ts +0 -155
  242. package/skills/wix-headless-fast/references/shared/rest/config.ts +0 -3
  243. package/skills/wix-headless-fast/references/shared/rest/media.ts +0 -65
  244. package/skills/wix-headless-fast/references/shared/seed/images.mjs +0 -145
  245. package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +0 -99
  246. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +0 -612
  247. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +0 -26
  248. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +0 -155
  249. package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +0 -266
  250. package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +0 -95
  251. package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +0 -136
  252. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +0 -48
  253. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +0 -39
  254. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +0 -34
  255. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +0 -121
  256. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +0 -107
  257. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +0 -138
  258. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +0 -314
  259. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +0 -133
  260. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +0 -147
  261. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +0 -289
  262. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +0 -169
  263. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +0 -65
  264. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +0 -12247
  265. package/skills/wix-headless-fast/references/storefront/rest/cart.ts +0 -132
  266. package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +0 -123
  267. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +0 -130
  268. package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +0 -38
  269. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +0 -561
@@ -1,60 +0,0 @@
1
- // Menu reads over REST (Wix Restaurants Menus V1) — the twin of app/wix/restaurants/menu.ts. Same
2
- // export, same MenuData tree; the rules and the id-array stitching come from menu-core (the SAME
3
- // file the SDK transport uses, deployed flat next to this one by deploy.mjs --stack static), so
4
- // this file is only the transport: one GET per list, literal paths and query params. Every call
5
- // here is safe from a browser with a visitor token. Porting: keep the paths, keep the params, port
6
- // the core once. Entities carry `id` here (the SDK spells it `_id`); the core accepts both.
7
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/menus/list-menus.md
8
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/items/items/list-items.md
9
- import { wixRequest } from "./client.js";
10
- import { imgSrc } from "./media.js";
11
- import { anyLabels, assembleMenus, collectGroupIds, collectModifierIds, collectVariantIds, type Raw } from "./menu-core.js";
12
- import type { MenuData } from "./types.js";
13
-
14
- const VISIBLE = { onlyVisible: "true" };
15
- const get = (path: string, query?: Record<string, string | readonly string[]>) => wixRequest<Raw>(path, { method: "GET", query });
16
-
17
- /**
18
- * The site's full menu tree, assembled and display-ordered — the one entry point for every menu
19
- * surface; [] when no menus exist. Three list reads, then the referenced variants, modifier groups,
20
- * and labels, then the groups' modifiers (an array query param repeats the key: ?variantIds=a&variantIds=b).
21
- * GET /restaurants/menus-menu/v1/menus?onlyVisible=true
22
- * GET /restaurants/menus-section/v1/sections?onlyVisible=true
23
- * GET /restaurants/menus-item/v1/items?onlyVisible=true
24
- * GET /restaurants/item-variants/v1/variants?variantIds=…
25
- * GET /restaurants/item-modifier-group/v1/modifier-groups?modifierGroupIds=…
26
- * GET /restaurants/item-modifiers/v1/modifiers?modifierIds=…
27
- * GET /restaurants/item-labels/v1/labels
28
- */
29
- export async function fetchMenus(): Promise<MenuData[]> {
30
- const [menusRes, sectionsRes, itemsRes] = await Promise.all([
31
- get("/restaurants/menus-menu/v1/menus", VISIBLE),
32
- get("/restaurants/menus-section/v1/sections", VISIBLE),
33
- get("/restaurants/menus-item/v1/items", VISIBLE),
34
- ]);
35
- const menus: Raw[] = menusRes?.menus ?? [];
36
- if (!menus.length) return [];
37
- const items: Raw[] = itemsRes?.items ?? [];
38
- const variantIds = collectVariantIds(items);
39
- const groupIds = collectGroupIds(items);
40
- const [variantsRes, groupsRes, labelsRes] = await Promise.all([
41
- variantIds.length ? get("/restaurants/item-variants/v1/variants", { variantIds }) : Promise.resolve({ variants: [] } as Raw),
42
- groupIds.length ? get("/restaurants/item-modifier-group/v1/modifier-groups", { modifierGroupIds: groupIds }) : Promise.resolve({ modifierGroups: [] } as Raw),
43
- anyLabels(items) ? get("/restaurants/item-labels/v1/labels") : Promise.resolve({ labels: [] } as Raw),
44
- ]);
45
- const groups: Raw[] = groupsRes?.modifierGroups ?? [];
46
- const modifierIds = collectModifierIds(groups);
47
- const modifiersRes: Raw = modifierIds.length ? await get("/restaurants/item-modifiers/v1/modifiers", { modifierIds }) : { modifiers: [] };
48
- return assembleMenus(
49
- {
50
- menus,
51
- sections: sectionsRes?.sections ?? [],
52
- items,
53
- variants: variantsRes?.variants ?? [],
54
- groups,
55
- modifiers: modifiersRes?.modifiers ?? [],
56
- labels: labelsRes?.labels ?? [],
57
- },
58
- imgSrc,
59
- );
60
- }
@@ -1,169 +0,0 @@
1
- // Online ordering over REST (Restaurants Orders + Wix eCom Cart V2) — the twin of
2
- // app/wix/restaurants/ordering.ts. Same exports, same OrderCart/OrderLine DTOs; rules and mappers
3
- // from ordering-core (the SAME file the SDK transport uses, deployed flat next to this one). The
4
- // request shapes are exact and rewriting them is how carts break: the Orders app id, and options
5
- // { operationId, menuId, sectionId } — all three, no variantId. Failures are loud: a missing
6
- // operation, an unavailable line, an empty order at checkout all throw — surface the message.
7
- // All calls run with the visitor token: the cart is the token's (see ./client).
8
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/list-operations.md
9
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/list-fulfillment-methods.md
10
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/add-line-items-to-current-cart.md
11
- // docs: https://dev.wix.com/docs/api-reference/business-management/headless/redirects/create-redirect-session.md
12
- import { WixApiError, wixRequest } from "./client.js";
13
- import { imgSrc } from "./media.js";
14
- import {
15
- RESTAURANTS_ORDERS_APP_ID,
16
- assertOrderAdded,
17
- assertOrderCheckoutable,
18
- assertOrderContext,
19
- estimateSubtotal,
20
- orderCatalogItem,
21
- pickOperationId,
22
- rawId,
23
- toFulfillmentMethods,
24
- toOrderCart,
25
- } from "./ordering-core.js";
26
- import type { Raw } from "./menu-core.js";
27
- import type { FulfillmentMethodInfo, OrderCart } from "./types.js";
28
-
29
- export { RESTAURANTS_ORDERS_APP_ID };
30
-
31
- const CART = "/ecom/v2/carts/current";
32
-
33
- // The ordering operation is site config — resolve once, reuse for every add.
34
- // GET /restaurants-operations/v1/operations
35
- let operationIdPromise: Promise<string | null> | null = null;
36
-
37
- /** The operation to order through (ENABLED, else default, else first) — null when the site has no online ordering. */
38
- export function resolveOperationId(): Promise<string | null> {
39
- operationIdPromise ??= wixRequest<Raw>("/restaurants-operations/v1/operations", { method: "GET" })
40
- .then((res) => pickOperationId(res?.operations ?? []))
41
- .catch(() => {
42
- operationIdPromise = null; // transient failure — allow a retry on the next call
43
- return null;
44
- });
45
- return operationIdPromise;
46
- }
47
-
48
- /** Enabled pickup/delivery methods, for display. GET /fulfillment-methods/v1/fulfillment-methods */
49
- export async function fetchFulfillmentMethods(): Promise<FulfillmentMethodInfo[]> {
50
- try {
51
- const res = await wixRequest<Raw>("/fulfillment-methods/v1/fulfillment-methods", { method: "GET" });
52
- return toFulfillmentMethods(res?.fulfillmentMethods ?? []);
53
- } catch {
54
- return []; // display nicety — ordering still works without the list
55
- }
56
- }
57
-
58
- // A line's attributes.image may come back absent — join the menu items' images by the line's
59
- // catalogItemId, once per item, cached for the session. GET /restaurants/menus-item/v1/items?itemIds=…
60
- const lineImageCache = new Map<string, string>();
61
- async function fillLineImages(cart: OrderCart, raws: Raw[]): Promise<void> {
62
- const wanted = new Map<string, number[]>();
63
- raws.forEach((raw, i) => {
64
- if (cart.lines[i].imageUrl) return;
65
- const itemId = raw.source?.catalogReference?.catalogItemId;
66
- if (!itemId) return;
67
- const cached = lineImageCache.get(itemId);
68
- if (cached !== undefined) { cart.lines[i].imageUrl = cached; return; }
69
- wanted.set(itemId, [...(wanted.get(itemId) ?? []), i]);
70
- });
71
- if (!wanted.size) return;
72
- try {
73
- const res = await wixRequest<Raw>("/restaurants/menus-item/v1/items", { method: "GET", query: { itemIds: [...wanted.keys()] } });
74
- for (const item of (res?.items ?? []) as Raw[]) {
75
- const url = imgSrc(item.image, 300, 300);
76
- lineImageCache.set(rawId(item), url);
77
- for (const i of wanted.get(rawId(item)) ?? []) cart.lines[i].imageUrl = url;
78
- }
79
- } catch {
80
- /* images are a nicety — the cart stays correct without them */
81
- }
82
- }
83
-
84
- async function readCartWithSubtotal(raw: Raw | null): Promise<OrderCart> {
85
- // Only estimate a cart WITH lines — on an absent/empty cart the endpoint returns 404.
86
- if (!raw?.lineItems?.length) return toOrderCart(raw, "", imgSrc);
87
- // The after-discount subtotal comes from the estimate, never from hand-summing lines; fees, tax,
88
- // and delivery resolve at checkout. POST /ecom/v2/carts/current/estimate {}
89
- let subtotal = "";
90
- try {
91
- subtotal = estimateSubtotal(await wixRequest<Raw>(`${CART}/estimate`, { body: {} }), raw);
92
- } catch {
93
- /* the estimate is a display nicety — the cart itself is still valid */
94
- }
95
- const cart = toOrderCart(raw, subtotal, imgSrc);
96
- await fillLineImages(cart, raw.lineItems as Raw[]);
97
- return cart;
98
- }
99
-
100
- // GET /ecom/v2/carts/current — a 404 means no cart yet.
101
- async function getCurrentCartRaw(): Promise<Raw | null> {
102
- try {
103
- return (await wixRequest<Raw>(CART, { method: "GET" }))?.cart ?? null;
104
- } catch (e) {
105
- if (e instanceof WixApiError && e.status === 404) return null;
106
- throw e;
107
- }
108
- }
109
-
110
- /** The visitor's current order cart. An empty cart (not an error) when none exists yet. */
111
- export async function fetchOrderCart(): Promise<OrderCart> {
112
- return readCartWithSubtotal(await getCurrentCartRaw());
113
- }
114
-
115
- /**
116
- * Add a menu item to the current order. `menuId` and `sectionId` are the ids of the menu and
117
- * section the item is RENDERED UNDER — thread them from the render context (the fetchMenus tree).
118
- * Throws when ordering isn't configured or the line is refused (a refused add still returns 200).
119
- * POST /ecom/v2/carts/current/add-line-items
120
- * { catalogItems: [{ quantity, catalogReference: { catalogItemId, appId: <Orders app>, options: { operationId, menuId, sectionId } } }] }
121
- */
122
- export async function addToOrder(
123
- itemId: string,
124
- { menuId, sectionId }: { menuId: string; sectionId: string },
125
- quantity = 1,
126
- ): Promise<OrderCart> {
127
- const operationId = await resolveOperationId();
128
- if (!operationId) throw new Error("Online ordering isn't available right now.");
129
- assertOrderContext(itemId, menuId, sectionId);
130
- const res = await wixRequest<Raw>(`${CART}/add-line-items`, {
131
- body: { catalogItems: [orderCatalogItem(itemId, { operationId, menuId, sectionId }, quantity)] },
132
- });
133
- assertOrderAdded(res?.cart, itemId);
134
- return readCartWithSubtotal(res?.cart ?? null);
135
- }
136
-
137
- /**
138
- * Change a line's quantity. `lineItemId` is OrderLine.lineItemId, never the menu item id.
139
- * POST /ecom/v2/carts/current/update-line-items { lineItems: [{ lineItemId, quantity: { newQuantity } }] }
140
- */
141
- export async function updateOrderQuantity(lineItemId: string, quantity: number): Promise<OrderCart> {
142
- const res = await wixRequest<Raw>(`${CART}/update-line-items`, { body: { lineItems: [{ lineItemId, quantity: { newQuantity: quantity } }] } });
143
- return readCartWithSubtotal(res?.cart ?? null);
144
- }
145
-
146
- /** Remove a line by OrderLine.lineItemId. POST /ecom/v2/carts/current/remove-line-items { lineItemIds } */
147
- export async function removeOrderLine(lineItemId: string): Promise<OrderCart> {
148
- const res = await wixRequest<Raw>(`${CART}/remove-line-items`, { body: { lineItemIds: [lineItemId] } });
149
- return readCartWithSubtotal(res?.cart ?? null);
150
- }
151
-
152
- /**
153
- * Start the Wix-hosted checkout for the current order and return the URL to navigate the FULL
154
- * document to. The cart's id IS the checkout id; fulfillment (pickup/delivery + time) and payment
155
- * are collected on the hosted page. `origin` must be the site's real https origin as registered on
156
- * the OAuth app's allowed domains (browser: window.location.origin) — an unlisted or http origin
157
- * 403s on return.
158
- * POST /headless/v1/redirect-session { ecomCheckout: { checkoutId }, callbacks: { postFlowUrl, thankYouPageUrl } }
159
- */
160
- export async function orderCheckoutUrl(origin: string = typeof window !== "undefined" ? window.location.origin : ""): Promise<string> {
161
- const raw = await getCurrentCartRaw();
162
- assertOrderCheckoutable(raw);
163
- const res = await wixRequest<Raw>("/headless/v1/redirect-session", {
164
- body: { ecomCheckout: { checkoutId: rawId(raw) }, callbacks: origin ? { postFlowUrl: `${origin}/`, thankYouPageUrl: `${origin}/` } : {} },
165
- });
166
- const url = res?.redirectSession?.fullUrl;
167
- if (!url) throw new Error("Checkout couldn't start: no redirect URL returned.");
168
- return url;
169
- }
@@ -1,68 +0,0 @@
1
- // Table reservations over REST — the twin of app/wix/restaurants/reservations.ts. Same exports,
2
- // same DTOs; rules and mappers from reservations-core (the SAME file the SDK transport uses,
3
- // deployed flat next to this one). The flow is location → AVAILABLE slots → hold → reserve; a
4
- // reservation is a hold, not a purchase — no cart, no checkout. Every call here is a visitor's own
5
- // action with the visitor token. The hold and reserve calls are premium-gated on the site: a
6
- // non-premium site answers 428 "site must be premium" — surface it, don't retry.
7
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/time-slots/get-time-slots.md
8
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/reservations/create-held-reservation.md
9
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/reservations/reserve-reservation.md
10
- import { wixRequest } from "./client.js";
11
- import { availableSlots, reserveeBody, toConfirmation, toHold, toLocations } from "./reservations-core.js";
12
- import type { Raw } from "./menu-core.js";
13
- import type { ReservationConfirmation, ReservationHold, ReservationLocationInfo, ReservationReservee, ReservationSlot } from "./types.js";
14
-
15
- const RESERVATIONS = "/table-reservations/reservations/v1";
16
-
17
- /**
18
- * Active (non-archived) locations, default first; [] when Table Reservations isn't set up.
19
- * `onlineReservationsEnabled: false` → the premium-gated toggle is off; render an honest notice.
20
- * GET /table-reservations/reservation-locations/v1/reservation-locations
21
- */
22
- export async function fetchReservationLocations(): Promise<ReservationLocationInfo[]> {
23
- const res = await wixRequest<Raw>("/table-reservations/reservation-locations/v1/reservation-locations", { method: "GET" });
24
- return toLocations(res?.reservationLocations ?? []);
25
- }
26
-
27
- /**
28
- * AVAILABLE slots around a moment for a party size (UNAVAILABLE / NON_WORKING_HOURS dropped).
29
- * POST /table-reservations/reservations/v1/time-slots { reservationLocationId, date, partySize, slotsBefore, slotsAfter }
30
- */
31
- export async function fetchReservationSlots(
32
- locationId: string,
33
- aroundIso: string,
34
- partySize: number,
35
- { slotsBefore = 6, slotsAfter = 6 }: { slotsBefore?: number; slotsAfter?: number } = {},
36
- ): Promise<ReservationSlot[]> {
37
- const res = await wixRequest<Raw>(`${RESERVATIONS}/time-slots`, {
38
- body: { reservationLocationId: locationId, date: new Date(aroundIso).toISOString(), partySize, slotsBefore, slotsAfter },
39
- });
40
- return availableSlots(res?.timeSlots ?? []);
41
- }
42
-
43
- /**
44
- * Hold a slot for 10 minutes while the visitor enters their details; the hold's { reservationId, revision } feed completeReservation.
45
- * POST /table-reservations/reservations/v1/reservations/hold { reservationDetails: { reservationLocationId, startDate, partySize } }
46
- */
47
- export async function holdReservation(locationId: string, startIso: string, partySize: number): Promise<ReservationHold> {
48
- const res = await wixRequest<Raw>(`${RESERVATIONS}/reservations/hold`, {
49
- body: { reservationDetails: { reservationLocationId: locationId, startDate: new Date(startIso).toISOString(), partySize } },
50
- });
51
- return toHold(res, startIso, partySize);
52
- }
53
-
54
- /**
55
- * Complete a held reservation. firstName and phone (E.164) are REQUIRED; an expired hold can't be
56
- * reserved — start a fresh hold.
57
- * POST /table-reservations/reservations/v1/reservations/{reservationId}/reserve { revision, reservee: { firstName, phone, lastName?, email? } }
58
- */
59
- export async function completeReservation(
60
- hold: Pick<ReservationHold, "reservationId" | "revision">,
61
- reservee: ReservationReservee,
62
- ): Promise<ReservationConfirmation> {
63
- const body = reserveeBody(reservee);
64
- const res = await wixRequest<Raw>(`${RESERVATIONS}/reservations/${encodeURIComponent(hold.reservationId)}/reserve`, {
65
- body: { revision: hold.revision, reservee: body },
66
- });
67
- return toConfirmation(res);
68
- }
@@ -1,89 +0,0 @@
1
- # Restaurants — seeding
2
-
3
- Seed by **running `seed-restaurants.mjs` with a plan file** — don't hand-write the REST calls.
4
- The script mints its own site token via the Wix CLI (logged-in session + `wix.config.json`
5
- required), installs the Restaurants apps, builds each menu bottom-up (items → sections →
6
- menu, all visible), imports+attaches images, and configures ordering/reservations.
7
-
8
- ```bash
9
- # from the project root (where wix.config.json lives):
10
- node <SKILL_ROOT>/references/restaurants/seed/seed-restaurants.mjs plan.json
11
- ```
12
-
13
- `plan.json` is plain data — write it from the brief. **Default to one menu with ~3 sections
14
- of 2–3 items each** (the seed shows the shape; the owner adds the rest in the dashboard),
15
- every item with an image (a menu without photos looks broken) — the default is an
16
- `imagePrompt` (AI-generated, ~1 Wix AI credit per image, account-billed): brand-contextual —
17
- subject, aesthetic/mood, palette, lighting — always ending "no text, no watermarks". At least one image in the set shows the real subject of the business — the actual product/space/service, not abstract decoration. For an asset the user actually
18
- supplied use `imagePath` (a file on this machine — uploaded to Wix Media) or `imageUrl`
19
- (their own hosted URL; verify it with `curl -sI` → 200) — never a stock-photo or guessed URL. Images resolve in parallel and never
20
- block the seed, a failed image leaves that item text-only — and both add-ons on for a
21
- restaurant that takes orders and reservations:
22
-
23
- ```json
24
- {
25
- "menus": [
26
- { "name": "Dinner", "description": "Evening menu", "sections": [
27
- { "name": "Antipasti", "description": "To start", "items": [
28
- { "name": "Bruschetta al Pomodoro", "description": "Grilled sourdough, San Marzano tomatoes, basil.",
29
- "price": 9.5, "imageUrl": "https://…" },
30
- { "name": "Burrata", "description": "Creamy burrata, heirloom tomatoes, olive oil.",
31
- "price": 14, "imageUrl": "https://…" }
32
- ] },
33
- { "name": "Mains", "items": [
34
- { "name": "Tagliatelle al Ragù", "description": "Slow-braised beef ragù, parmigiano.",
35
- "price": 22, "imageUrl": "https://…" },
36
- { "name": "Branzino", "description": "Whole roasted sea bass, lemon, herbs.",
37
- "price": 28, "imageUrl": "https://…" }
38
- ] },
39
- { "name": "Dolci", "items": [
40
- { "name": "Tiramisù", "description": "Espresso-soaked ladyfingers, mascarpone.",
41
- "price": 10, "imageUrl": "https://…" }
42
- ] }
43
- ] }
44
- ],
45
- "ordering": { "address": {
46
- "name": "Trattoria Lumina", "timeZone": "America/New_York",
47
- "address": { "country": "US", "subdivision": "US-NY", "city": "New York", "postalCode": "10012",
48
- "streetAddress": { "number": "18", "name": "Prince Street" },
49
- "formattedAddress": "18 Prince Street, New York, NY 10012" } } },
50
- "reservations": { "partySize": { "min": 1, "max": 10 } }
51
- }
52
- ```
53
-
54
- - `price` — a number; stored as a decimal string in the **site currency** (never send one).
55
- - `ordering` — installs the Orders app, which **auto-provisions** a working setup (ENABLED
56
- operation, Pickup + Delivery methods, every menu orderable); the seed verifies it. The
57
- `address` is **required for real ordering** — without one, ordering is "testing only" and
58
- checkout breaks. If the brief names no address, pass `"ordering": true` and the result
59
- carries a note to flag the owner. Completing a **paid** order additionally needs a premium
60
- plan + a connected payment method (dashboard) — mention it, don't treat it as a failure.
61
- - `reservations` — installs Table Reservations, which auto-provisions a default reservation
62
- location; `partySize` (or a full `configuration`) is a partial PATCH. The final
63
- **enable-online-reservations toggle is premium-only**: on a free site the result carries
64
- `reservations.premiumRequired: true` — expected, tell the owner, don't retry.
65
- - Fresh Menus installs ship a sample "Dinner Menu"; when THIS run installs the app the seed
66
- removes that sample (`sampleMenuRemoved: true`). On a site that already had the app,
67
- **seeding is strictly additive — never delete or overwrite existing content**; ask first
68
- if a cleanup seems needed.
69
-
70
- ## Supplied content
71
-
72
- The general rules are in `references/shared/SUPPLIED-CONTENT.md`. For a restaurant the user hands
73
- over the menu, often as a PDF or a photo. Each menu becomes an entry in `menus`, each heading a
74
- `section`, each dish an `item` with `name`, `description`, `price` and, when they supplied one, its
75
- photo as `imageUrl`. The restaurant's address, hours and party sizes go into `ordering` and
76
- `reservations` only when the user stated them; otherwise leave those out and say so.
77
-
78
- ## Escape hatch — individual functions
79
- `setupRestaurants` composes exported steps — `installMenusApp`, `installOrdersApp`,
80
- `installTableReservationsApp`, `removeSampleMenu`, `createMenu`, `importImage`,
81
- `attachItemImages`, `setBusinessLocation`, `listOperationsWithRetry`, `enableOperation`,
82
- `queryMenuOrderingSettings`, `updateMenuOrderingSettings`, `listReservationLocationsWithRetry`,
83
- `updateReservationLocation`, `enableOnlineReservations`, plus `makeCtx()` — import them only
84
- for a partial re-seed.
85
-
86
- ## Reference
87
- Unexpected shape or an uncovered operation → read the live Wix API reference; the
88
- authoritative source recipes are `wix-headless/references/inline-recipes/setup-restaurants.md`,
89
- `setup-restaurant-orders.md`, and `setup-restaurant-reservations.md`.
@@ -1,25 +0,0 @@
1
- // What the restaurant holds: menus, sections, items, locations.
2
- // node <SKILL_ROOT>/references/restaurants/seed/read-site.mjs [--site <siteId>] [--limit <n>]
3
- import { runReader } from "../../shared/seed/read-site.mjs";
4
-
5
- const MENUS_APP_ID = "b278a256-2757-4f19-9313-c05c783bec92";
6
- const D = "https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus";
7
- const DL = "https://dev.wix.com/docs/api-reference/business-management/locations";
8
-
9
- await runReader({
10
- vertical: "restaurants",
11
- appId: MENUS_APP_ID,
12
- async read(api, { limit }) {
13
- const menus = await api.call({ method: "GET", path: "/restaurants/menus/v1/menus", docs: `${D}/menus/list-menus` });
14
- const sections = await api.tryCall({ method: "GET", path: "/restaurants/menus/v1/sections", docs: `${D}/sections/list-sections` });
15
- const items = await api.tryCall({ method: "GET", path: "/restaurants/menus/v1/items", docs: `${D}/items/items/list-items` });
16
- const locs = await api.tryCall({ method: "GET", path: "/locations/v1/locations", docs: `${DL}/list-locations` });
17
- const secs = sections?.sections ?? []; const its = items?.items ?? [];
18
- return {
19
- menus: (menus.menus ?? []).map((m) => ({ name: m.name, visible: m.visible !== false, sections: (m.sectionIds ?? []).map((id) => secs.find((s) => s.id === id)?.name ?? id) })),
20
- sectionCount: secs.length, itemCount: its.length,
21
- items: its.slice(0, limit).map((i) => ({ name: i.name, price: i.priceInfo?.price ?? i.priceVariants ? "variants" : null, image: !!i.image, labels: (i.labels ?? []).length })),
22
- locations: (locs?.locations ?? []).map((l) => ({ name: l.name, default: !!l.default, address: l.address?.formattedAddress ?? null })),
23
- };
24
- },
25
- });