@wix/agent-skills 1.21.0 → 1.22.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 (258) hide show
  1. package/package.json +1 -1
  2. package/skills/wix-app/SKILL.md +60 -4
  3. package/skills/wix-app/references/DASHBOARD_PAGE.md +11 -25
  4. package/skills/wix-app/references/DATA_COLLECTION.md +16 -219
  5. package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +182 -0
  6. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +97 -0
  7. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_COLLECTION.md +184 -0
  8. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_ROUTER.md +203 -0
  9. package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE_SETTINGS.md +44 -0
  10. package/skills/wix-app/references/dashboard-page/QUERY_AND_PAGING.md +182 -0
  11. package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +133 -0
  12. package/skills/wix-app/references/dashboard-page/UX_SUCCESS_MODEL.md +10 -5
  13. package/skills/wix-app/references/data-collection/LIFECYCLE.md +68 -0
  14. package/skills/wix-app/references/data-collection/PERMISSIONS.md +47 -0
  15. package/skills/wix-app/references/data-collection/SCHEMA.md +181 -0
  16. package/skills/wix-app/references/data-collection/WIX_DATA.md +38 -66
  17. package/skills/wix-headless-fast/SKILL.md +61 -223
  18. package/skills/wix-headless-fast/cold-start/bootstrap.mjs +156 -0
  19. package/skills/wix-headless-fast/{entry/skill.md → cold-start/cold-start.md} +11 -12
  20. package/skills/wix-headless-fast/guides/existing-site.md +76 -0
  21. package/skills/wix-headless-fast/guides/reference-mode.md +97 -0
  22. package/skills/wix-headless-fast/install/AGENTS.md +6 -3
  23. package/skills/wix-headless-fast/install/attach.mjs +15 -47
  24. package/skills/wix-headless-fast/install/deploy.mjs +21 -60
  25. package/skills/wix-headless-fast/install/lock.mjs +55 -0
  26. package/skills/wix-headless-fast/install/setup.mjs +32 -12
  27. package/skills/wix-headless-fast/install/templates.mjs +168 -0
  28. package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +27 -0
  29. package/skills/wix-manage/references/google-ads/manage-campaign-success-guide.md +83 -37
  30. package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +0 -303
  31. package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +0 -136
  32. package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +0 -112
  33. package/skills/wix-headless-fast/references/blog/app/components/blog/RichContent.tsx +0 -42
  34. package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +0 -31
  35. package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +0 -22
  36. package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +0 -137
  37. package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +0 -78
  38. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +0 -117
  39. package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +0 -52
  40. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +0 -47
  41. package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +0 -58
  42. package/skills/wix-headless-fast/references/blog/app/wix/blog/types.ts +0 -62
  43. package/skills/wix-headless-fast/references/blog/app-astro/layouts/SiteLayout.astro +0 -40
  44. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +0 -97
  45. package/skills/wix-headless-fast/references/blog/app-astro/pages/blog.astro +0 -24
  46. package/skills/wix-headless-fast/references/blog/lock/astro/package-lock.json +0 -16156
  47. package/skills/wix-headless-fast/references/blog/rest/posts.ts +0 -42
  48. package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +0 -62
  49. package/skills/wix-headless-fast/references/blog/seed/SEED.md +0 -81
  50. package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +0 -22
  51. package/skills/wix-headless-fast/references/blog/seed/seed-blog.mjs +0 -287
  52. package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +0 -277
  53. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +0 -144
  54. package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServicesView.tsx +0 -119
  55. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +0 -32
  56. package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +0 -23
  57. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +0 -218
  58. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +0 -169
  59. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +0 -121
  60. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +0 -92
  61. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +0 -90
  62. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +0 -57
  63. package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +0 -72
  64. package/skills/wix-headless-fast/references/bookings/app-astro/layouts/SiteLayout.astro +0 -40
  65. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services/[slug].astro +0 -76
  66. package/skills/wix-headless-fast/references/bookings/app-astro/pages/services.astro +0 -22
  67. package/skills/wix-headless-fast/references/bookings/lock/astro/package-lock.json +0 -11962
  68. package/skills/wix-headless-fast/references/bookings/rest/booking.ts +0 -113
  69. package/skills/wix-headless-fast/references/bookings/rest/services.ts +0 -55
  70. package/skills/wix-headless-fast/references/bookings/seed/SEED.md +0 -71
  71. package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +0 -28
  72. package/skills/wix-headless-fast/references/bookings/seed/seed-bookings.mjs +0 -302
  73. package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +0 -355
  74. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +0 -50
  75. package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +0 -37
  76. package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +0 -158
  77. package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +0 -93
  78. package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +0 -177
  79. package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +0 -123
  80. package/skills/wix-headless-fast/references/cms/app/wix/cms/types.ts +0 -75
  81. package/skills/wix-headless-fast/references/cms/app-astro/layouts/SiteLayout.astro +0 -41
  82. package/skills/wix-headless-fast/references/cms/lock/astro/package-lock.json +0 -11262
  83. package/skills/wix-headless-fast/references/cms/rest/items.ts +0 -125
  84. package/skills/wix-headless-fast/references/cms/seed/SEED.md +0 -112
  85. package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +0 -20
  86. package/skills/wix-headless-fast/references/cms/seed/seed-cms.mjs +0 -324
  87. package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +0 -307
  88. package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +0 -66
  89. package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +0 -178
  90. package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +0 -118
  91. package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +0 -35
  92. package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +0 -24
  93. package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +0 -130
  94. package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +0 -97
  95. package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +0 -55
  96. package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +0 -113
  97. package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +0 -156
  98. package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +0 -97
  99. package/skills/wix-headless-fast/references/events/app/wix/events/types.ts +0 -61
  100. package/skills/wix-headless-fast/references/events/app-astro/layouts/SiteLayout.astro +0 -40
  101. package/skills/wix-headless-fast/references/events/app-astro/pages/event-confirmation.astro +0 -12
  102. package/skills/wix-headless-fast/references/events/app-astro/pages/events/[slug].astro +0 -80
  103. package/skills/wix-headless-fast/references/events/app-astro/pages/events.astro +0 -21
  104. package/skills/wix-headless-fast/references/events/lock/astro/package-lock.json +0 -11884
  105. package/skills/wix-headless-fast/references/events/rest/events.ts +0 -57
  106. package/skills/wix-headless-fast/references/events/rest/registration.ts +0 -83
  107. package/skills/wix-headless-fast/references/events/seed/SEED.md +0 -95
  108. package/skills/wix-headless-fast/references/events/seed/read-site.mjs +0 -26
  109. package/skills/wix-headless-fast/references/events/seed/seed-events.mjs +0 -276
  110. package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +0 -340
  111. package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +0 -85
  112. package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +0 -332
  113. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +0 -238
  114. package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +0 -54
  115. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +0 -216
  116. package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +0 -59
  117. package/skills/wix-headless-fast/references/forms/app/wix/forms/types.ts +0 -135
  118. package/skills/wix-headless-fast/references/forms/lock/astro/package-lock.json +0 -10593
  119. package/skills/wix-headless-fast/references/forms/rest/forms.ts +0 -34
  120. package/skills/wix-headless-fast/references/forms/rest/submissions.ts +0 -56
  121. package/skills/wix-headless-fast/references/forms/seed/SEED.md +0 -116
  122. package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +0 -20
  123. package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +0 -327
  124. package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +0 -316
  125. package/skills/wix-headless-fast/references/members/app/components/members/AccountView.tsx +0 -60
  126. package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +0 -155
  127. package/skills/wix-headless-fast/references/members/app/components/members/MemberMenu.tsx +0 -78
  128. package/skills/wix-headless-fast/references/members/app/components/members/RequireAuth.tsx +0 -47
  129. package/skills/wix-headless-fast/references/members/app/hooks/members/useMember.ts +0 -66
  130. package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +0 -105
  131. package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +0 -59
  132. package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +0 -53
  133. package/skills/wix-headless-fast/references/members/app/wix/members/member-store.ts +0 -122
  134. package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +0 -43
  135. package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +0 -29
  136. package/skills/wix-headless-fast/references/members/app/wix/members/types.ts +0 -21
  137. package/skills/wix-headless-fast/references/members/app-astro/layouts/SiteLayout.astro +0 -42
  138. package/skills/wix-headless-fast/references/members/app-astro/pages/account.astro +0 -10
  139. package/skills/wix-headless-fast/references/members/app-astro/pages/login.astro +0 -11
  140. package/skills/wix-headless-fast/references/members/lock/astro/package-lock.json +0 -10329
  141. package/skills/wix-headless-fast/references/members/rest/auth.ts +0 -215
  142. package/skills/wix-headless-fast/references/members/rest/members.ts +0 -26
  143. package/skills/wix-headless-fast/references/members/seed/SEED.md +0 -39
  144. package/skills/wix-headless-fast/references/members/seed/read-site.mjs +0 -15
  145. package/skills/wix-headless-fast/references/members/seed/seed-members.mjs +0 -94
  146. package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +0 -315
  147. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +0 -110
  148. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +0 -90
  149. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +0 -35
  150. package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +0 -85
  151. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +0 -32
  152. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +0 -21
  153. package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +0 -31
  154. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +0 -82
  155. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +0 -58
  156. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +0 -177
  157. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +0 -78
  158. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +0 -81
  159. package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/types.ts +0 -55
  160. package/skills/wix-headless-fast/references/portfolio/app-astro/layouts/SiteLayout.astro +0 -40
  161. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio/[slug].astro +0 -30
  162. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/portfolio.astro +0 -21
  163. package/skills/wix-headless-fast/references/portfolio/app-astro/pages/projects/[slug].astro +0 -29
  164. package/skills/wix-headless-fast/references/portfolio/lock/astro/package-lock.json +0 -10197
  165. package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +0 -75
  166. package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +0 -86
  167. package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +0 -20
  168. package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +0 -256
  169. package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +0 -296
  170. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +0 -47
  171. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +0 -101
  172. package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +0 -41
  173. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +0 -16
  174. package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +0 -22
  175. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +0 -54
  176. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +0 -106
  177. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +0 -64
  178. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +0 -27
  179. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +0 -43
  180. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +0 -22
  181. package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/types.ts +0 -30
  182. package/skills/wix-headless-fast/references/pricing-plans/app-astro/layouts/SiteLayout.astro +0 -41
  183. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans/[slug].astro +0 -40
  184. package/skills/wix-headless-fast/references/pricing-plans/app-astro/pages/plans.astro +0 -21
  185. package/skills/wix-headless-fast/references/pricing-plans/lock/astro/package-lock.json +0 -11226
  186. package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +0 -31
  187. package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +0 -20
  188. package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +0 -79
  189. package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +0 -21
  190. package/skills/wix-headless-fast/references/pricing-plans/seed/seed-pricing-plans.mjs +0 -279
  191. package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +0 -360
  192. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +0 -142
  193. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartButton.tsx +0 -26
  194. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +0 -121
  195. package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/ReservationView.tsx +0 -155
  196. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +0 -34
  197. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useOrderCart.ts +0 -43
  198. package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +0 -34
  199. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +0 -155
  200. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +0 -89
  201. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +0 -71
  202. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/order-store.ts +0 -103
  203. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +0 -124
  204. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +0 -185
  205. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +0 -193
  206. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +0 -94
  207. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +0 -74
  208. package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/types.ts +0 -168
  209. package/skills/wix-headless-fast/references/restaurants/app-astro/layouts/SiteLayout.astro +0 -47
  210. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/menu.astro +0 -22
  211. package/skills/wix-headless-fast/references/restaurants/app-astro/pages/reservations.astro +0 -12
  212. package/skills/wix-headless-fast/references/restaurants/lock/astro/package-lock.json +0 -12560
  213. package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +0 -60
  214. package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +0 -169
  215. package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +0 -68
  216. package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +0 -89
  217. package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +0 -25
  218. package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +0 -499
  219. package/skills/wix-headless-fast/references/shared/CONTENT.md +0 -22
  220. package/skills/wix-headless-fast/references/shared/CUSTOM_OPERATIONS.md +0 -73
  221. package/skills/wix-headless-fast/references/shared/DESIGN.md +0 -26
  222. package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +0 -23
  223. package/skills/wix-headless-fast/references/shared/app/styles/global.css +0 -52
  224. package/skills/wix-headless-fast/references/shared/app/wix/config.ts +0 -15
  225. package/skills/wix-headless-fast/references/shared/app/wix/media.ts +0 -81
  226. package/skills/wix-headless-fast/references/shared/app/wix/money.ts +0 -24
  227. package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +0 -89
  228. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app/wix/media-upload/client.ts +0 -46
  229. package/skills/wix-headless-fast/references/shared/capabilities/media-upload/app-astro/pages/api/wix/media-upload.ts +0 -46
  230. package/skills/wix-headless-fast/references/shared/rest/client.ts +0 -155
  231. package/skills/wix-headless-fast/references/shared/rest/config.ts +0 -3
  232. package/skills/wix-headless-fast/references/shared/rest/media.ts +0 -65
  233. package/skills/wix-headless-fast/references/shared/seed/images.mjs +0 -145
  234. package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +0 -99
  235. package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +0 -612
  236. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartButton.tsx +0 -26
  237. package/skills/wix-headless-fast/references/storefront/app/components/storefront/CartDrawer.tsx +0 -155
  238. package/skills/wix-headless-fast/references/storefront/app/components/storefront/FilterPanel.tsx +0 -266
  239. package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +0 -95
  240. package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +0 -136
  241. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useCart.ts +0 -48
  242. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +0 -39
  243. package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +0 -34
  244. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +0 -121
  245. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-store.ts +0 -107
  246. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +0 -138
  247. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +0 -314
  248. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +0 -133
  249. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +0 -147
  250. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +0 -289
  251. package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +0 -169
  252. package/skills/wix-headless-fast/references/storefront/app-astro/layouts/SiteLayout.astro +0 -65
  253. package/skills/wix-headless-fast/references/storefront/lock/astro/package-lock.json +0 -12247
  254. package/skills/wix-headless-fast/references/storefront/rest/cart.ts +0 -132
  255. package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +0 -123
  256. package/skills/wix-headless-fast/references/storefront/seed/SEED.md +0 -130
  257. package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +0 -38
  258. package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +0 -561
@@ -1,499 +0,0 @@
1
- // Restaurants seed — a BUILD-TIME script, never shipped in the app. Run from the project
2
- // root (where wix.config.json lives) with a plan file:
3
- //
4
- // node <SKILL_ROOT>/references/restaurants/seed/seed-restaurants.mjs plan.json
5
- //
6
- // It mints its own site token via the Wix CLI, installs the Wix Restaurants Menus app (plus
7
- // Orders / Table Reservations when the plan asks), builds each menu BOTTOM-UP (bulk items →
8
- // bulk sections → menu — every child exists before its parent, visible:true at every level),
9
- // imports+attaches item images, and configures the add-ons. Prints a JSON result to stdout.
10
- //
11
- // Plan shape (see SEED.md):
12
- // { "menus": [{ "name", "description"?, "sections": [{ "name", "description"?,
13
- // "items": [{ "name", "description"?, "price", "imageUrl"? | "imagePrompt"? }] }] }],
14
- // "ordering"?: true | { "address"? }, // menu-first add-on; address is STEP 0
15
- // "reservations"?: true | { "partySize"? { "min","max" }, "address"? } }
16
- //
17
- // Seeding is ADDITIVE — with ONE recipe-sanctioned exception: when THIS run installs the
18
- // Menus app onto a site that didn't have it, the install's own sample "Dinner Menu" is
19
- // removed (it's provably not owner content). Nothing else is ever deleted. Unexpected
20
- // shapes → read the live API reference; authoritative source recipes:
21
- // wix-headless/references/inline-recipes/setup-restaurants.md, setup-restaurant-orders.md,
22
- // setup-restaurant-reservations.md.
23
- import { execFileSync } from "node:child_process";
24
- import { readFileSync } from "node:fs";
25
- import { resolveItemImages } from "../../shared/seed/images.mjs";
26
-
27
- const API = "https://www.wixapis.com";
28
- const MENUS_APP_ID = "b278a256-2757-4f19-9313-c05c783bec92";
29
- const ORDERS_APP_ID = "9a5d83fd-8570-482e-81ab-cfa88942ee60";
30
- const TABLE_RESERVATIONS_APP_ID = "f9c07de2-5341-40c6-b096-8eb39de391fb";
31
-
32
- export function makeCtx({ cwd = process.cwd() } = {}) {
33
- const config = JSON.parse(readFileSync(`${cwd}/wix.config.json`, "utf8"));
34
- const siteId = config.siteId ?? config.projectId;
35
- if (!siteId) throw new Error("wix.config.json has no siteId — is this a Wix CLI project?");
36
- const token = execFileSync("npx", ["@wix/cli@latest", "token", "--site", siteId], {
37
- encoding: "utf8",
38
- cwd,
39
- }).trim();
40
- if (!token) throw new Error("The Wix CLI returned no token — run `npx @wix/cli@latest login` first.");
41
- return { token, siteId };
42
- }
43
-
44
- async function req(ctx, path, { method = "POST", body } = {}) {
45
- const res = await fetch(API + path, {
46
- method,
47
- headers: {
48
- Authorization: `Bearer ${ctx.token}`,
49
- "wix-site-id": ctx.siteId,
50
- "Content-Type": "application/json",
51
- },
52
- body: body ? JSON.stringify(body) : undefined,
53
- });
54
- const json = await res.json().catch(() => ({}));
55
- if (!res.ok) throw new Error(`${method} ${path} -> ${res.status}: ${JSON.stringify(json).slice(0, 400)}`);
56
- return json;
57
- }
58
-
59
- const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
60
-
61
- // ---- app installs --------------------------------------------------------------------------------
62
-
63
- // docs: https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md
64
- async function installApp(ctx, appDefId) {
65
- try {
66
- await req(ctx, "/apps-installer-service/v1/app-instance/install", { body: {
67
- tenant: { tenantType: "SITE", id: ctx.siteId },
68
- appInstance: { appDefId, enabled: true },
69
- } });
70
- } catch {
71
- /* already installed is fine */
72
- }
73
- }
74
- export async function installMenusApp(ctx) { return installApp(ctx, MENUS_APP_ID); }
75
- export async function installOrdersApp(ctx) { return installApp(ctx, ORDERS_APP_ID); }
76
- export async function installTableReservationsApp(ctx) { return installApp(ctx, TABLE_RESERVATIONS_APP_ID); }
77
-
78
- /** True when the Menus API answers — i.e. the app is already on the site. */
79
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/menus/list-menus.md
80
- export async function menusAppPresent(ctx) {
81
- try {
82
- await req(ctx, "/restaurants/menus/v1/menus", { method: "GET" });
83
- return true;
84
- } catch {
85
- return false;
86
- }
87
- }
88
-
89
- // ---- menu (setup-restaurants.md) -----------------------------------------------------------------
90
- // Everything is Restaurants Menus V1 on /restaurants/menus/v1/... . REST flattens the
91
- // protobuf wrappers: plain values ("visible": true), never {"value": …}.
92
-
93
- /**
94
- * Recipe STEP 0 — a FRESH Menus-app install ships a populated sample "Dinner Menu"
95
- * (~4 sections, ~21 items) that would render next to the seeded menu. Call ONLY when this
96
- * run installed the app onto a site that didn't have it (menusAppPresent was false) — then
97
- * everything present is provably the install's own sample. Polls briefly (the sample
98
- * provisions async), then deletes children before parents. No-op when nothing appears.
99
- * docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/items/items/list-items.md
100
- * docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/sections/list-sections.md
101
- * docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/items/items/bulk-delete-items.md
102
- * docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/sections/bulk-delete-sections.md
103
- * docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/menus/delete-menu.md
104
- */
105
- export async function removeSampleMenu(ctx, { tries = 8, delayMs = 2000 } = {}) {
106
- let menus = [];
107
- for (let i = 0; i < tries; i++) {
108
- const r = await req(ctx, "/restaurants/menus/v1/menus", { method: "GET" });
109
- menus = r.menus ?? [];
110
- if (menus.length) break;
111
- if (i < tries - 1) await sleep(delayMs);
112
- }
113
- if (!menus.length) return { removed: false };
114
-
115
- const itemsRes = await req(ctx, "/restaurants/menus/v1/items", { method: "GET" });
116
- const sectionsRes = await req(ctx, "/restaurants/menus/v1/sections", { method: "GET" });
117
- const itemIds = (itemsRes.items ?? []).map((it) => it.id).filter(Boolean);
118
- const sectionIds = (sectionsRes.sections ?? []).map((s) => s.id).filter(Boolean);
119
- if (itemIds.length) {
120
- await req(ctx, "/restaurants/menus/v1/bulk/items/delete", { method: "DELETE", body: { ids: itemIds } });
121
- }
122
- if (sectionIds.length) {
123
- await req(ctx, "/restaurants/menus/v1/bulk/sections/delete", { method: "DELETE", body: { ids: sectionIds } });
124
- }
125
- for (const m of menus) {
126
- await req(ctx, `/restaurants/menus/v1/menus/${m.id}`, { method: "DELETE" }); // no bulk delete for menus
127
- }
128
- return { removed: true, menus: menus.map((m) => m.name) };
129
- }
130
-
131
- /**
132
- * Build ONE menu BOTTOM-UP (items → sections → menu) in three bulk phases.
133
- * price -> priceInfo.price as a decimal STRING; currency is the site's (send none).
134
- * visible:true is baked in at every level — required to render on the live site.
135
- * Returns { menuId, name, sectionIds, itemIds, items: [{ id, revision, price }] } — the
136
- * per-item revision/price feed the image pass (Update Item is a full replace).
137
- * docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/items/items/bulk-create-items.md
138
- * docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/sections/bulk-create-sections.md
139
- * docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/menus/create-menu.md
140
- */
141
- export async function createMenu(ctx, menu) {
142
- // STEP 1 — bulk-create every item across all sections in ONE request.
143
- const flat = [];
144
- menu.sections.forEach((sec, si) => (sec.items || []).forEach((it) => flat.push({ ...it, _section: si })));
145
- const itemRes = await req(ctx, "/restaurants/menus/v1/bulk/items/create", {
146
- body: {
147
- items: flat.map((it) => ({
148
- name: it.name,
149
- ...(it.description ? { description: it.description } : {}),
150
- priceInfo: { price: String(it.price) },
151
- visible: true,
152
- })),
153
- returnEntity: true,
154
- },
155
- });
156
- // created items are under results[].item (results[].itemMetadata.success is the per-item flag)
157
- const createdItems = (itemRes.results ?? []).map((r) => r.item);
158
- const itemIdsBySection = menu.sections.map(() => []);
159
- flat.forEach((it, i) => {
160
- const id = createdItems[i]?.id;
161
- if (id) itemIdsBySection[it._section].push(id);
162
- });
163
-
164
- // STEP 2 — bulk-create sections, each carrying the itemIds of its items in display order.
165
- const secRes = await req(ctx, "/restaurants/menus/v1/bulk/sections/create", {
166
- body: {
167
- sections: menu.sections.map((sec, si) => ({
168
- name: sec.name,
169
- ...(sec.description ? { description: sec.description } : {}),
170
- visible: true,
171
- itemIds: itemIdsBySection[si],
172
- })),
173
- returnEntity: true,
174
- },
175
- });
176
- const sectionIds = (secRes.results ?? []).map((r) => r.item?.id);
177
-
178
- // STEP 3 — create the menu (single create wraps in `menu`), carrying its sectionIds.
179
- // businessLocationId omitted -> binds to the site's default (main) location.
180
- const menuRes = await req(ctx, "/restaurants/menus/v1/menus", {
181
- body: {
182
- menu: {
183
- name: menu.name,
184
- ...(menu.description ? { description: menu.description } : {}),
185
- visible: true,
186
- sectionIds,
187
- },
188
- },
189
- });
190
- return {
191
- menuId: menuRes.menu?.id,
192
- name: menu.name,
193
- sectionIds,
194
- itemIds: createdItems.map((it) => it?.id),
195
- items: createdItems.map((it, i) => ({ id: it?.id, revision: it?.revision, price: flat[i]?.price })),
196
- };
197
- }
198
-
199
- // Restaurants binds an item image by Wix Media file ID — an external url must be imported
200
- // first; a plan `imagePrompt` is generated (Wix AI, 1 credit) then imported. Both live in the
201
- // shared util (parallel, resilient, never blocks the seed).
202
- export { importImage } from "../../shared/seed/images.mjs";
203
-
204
- // Image pass. Update Item is a FULL-ENTITY REPLACE with NO field mask — each entry MUST echo
205
- // the item's current `revision` AND `priceInfo`, or it fails 428 MISSING_ITEM_PRICING and the
206
- // image does NOT apply. `image` is an OBJECT { id, url, height, width } (never a bare string);
207
- // the binding field is the Wix Media file `id`.
208
- // items: [{ id, revision, price, image: { id, url, height, width } }]
209
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/menus/items/items/bulk-update-item.md
210
- // The bulk update returns 200 on PARTIAL failure: each item's outcome is in
211
- // results[].itemMetadata (success, error, originalIndex). Returns { attached: [id], failures: [{ id, error }] }.
212
- export async function attachItemImages(ctx, items) {
213
- const r = await req(ctx, "/restaurants/menus/v1/bulk/items/update", {
214
- body: {
215
- items: items.map((it) => ({
216
- item: {
217
- id: it.id,
218
- revision: it.revision,
219
- priceInfo: { price: String(it.price) },
220
- image: it.image,
221
- },
222
- })),
223
- },
224
- });
225
- return bulkOutcome(items, r.results);
226
- }
227
-
228
- // Pair a bulk response's results[] to the inputs by originalIndex; an input with no result did not persist.
229
- export function bulkOutcome(items, results) {
230
- const attached = [];
231
- const failures = [];
232
- for (const x of results ?? []) {
233
- const src = items[x.itemMetadata?.originalIndex];
234
- if (!src) continue;
235
- if (x.itemMetadata?.success) attached.push(src.id);
236
- else failures.push({ id: src.id, error: x.itemMetadata?.error?.description ?? x.itemMetadata?.error?.code ?? "unknown" });
237
- }
238
- for (const it of items) if (!attached.includes(it.id) && !failures.some((f) => f.id === it.id)) failures.push({ id: it.id, error: "no result for item" });
239
- return { attached, failures };
240
- }
241
-
242
- // ---- business location (shared STEP 0 for ordering + reservations) ------------------------------
243
- // Update Location is a FULL OVERRIDE — send the WHOLE `location` object (omitted fields are
244
- // wiped), echo `default:true` (omitting it 400s CHANGE_DEFAULT_FORBIDDEN) and the current
245
- // `revision`. address.country is a 2-letter ISO code. Without a real address, ordering is
246
- // "testing only" and checkout breaks — a placeholder must be flagged to the owner.
247
- // location: { name, timeZone, email?, phone?, address: { country, subdivision, city,
248
- // postalCode, streetAddress: { number, name }, formattedAddress } }
249
- // docs: https://dev.wix.com/docs/api-reference/business-management/locations/list-locations.md
250
- // docs: https://dev.wix.com/docs/api-reference/business-management/locations/create-location.md
251
- // docs: https://dev.wix.com/docs/api-reference/business-management/locations/update-location.md
252
- export async function setBusinessLocation(ctx, location) {
253
- const list = await req(ctx, "/locations/v1/locations", { method: "GET" });
254
- const def = (list.locations ?? []).find((l) => l.default);
255
- if (!def) {
256
- // No default location at all (a bare site can have none) -> CREATE one; operations
257
- // auto-bind on first-location-add.
258
- const r = await req(ctx, "/locations/v1/locations", { body: { location: { ...location, default: true } } });
259
- return r.location;
260
- }
261
- const r = await req(ctx, `/locations/v1/locations/${def.id}`, {
262
- method: "PUT",
263
- body: { location: { ...location, id: def.id, revision: def.revision, default: true } },
264
- });
265
- return r.location;
266
- }
267
-
268
- // ---- online ordering (setup-restaurant-orders.md) ------------------------------------------------
269
- // The Orders-app install AUTO-provisions a working setup (an ENABLED operation with Pickup +
270
- // Delivery attached, every menu ordering-enabled) — these helpers VERIFY it; they never POST
271
- // an operation. Each micro-service is on its OWN host prefix — do not normalize.
272
-
273
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/list-operations.md
274
- export async function listOperations(ctx) {
275
- const r = await req(ctx, "/restaurants-operations/v1/operations", { method: "GET" });
276
- return r.operations ?? [];
277
- }
278
-
279
- // A fresh install provisions the operation ASYNC — poll until it lands.
280
- export async function listOperationsWithRetry(ctx, { tries = 15, delayMs = 2000 } = {}) {
281
- for (let i = 0; i < tries; i++) {
282
- const ops = await listOperations(ctx).catch(() => []);
283
- if (ops.length) return ops;
284
- if (i < tries - 1) await sleep(delayMs);
285
- }
286
- return [];
287
- }
288
-
289
- // Normally already ENABLED — only PATCH when DISABLED/PAUSED_UNTIL. revision mandatory + current.
290
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/operations/update-operation.md
291
- export async function enableOperation(ctx, operationId, revision) {
292
- return req(ctx, `/restaurants-operations/v1/operations/${operationId}`, {
293
- method: "PATCH",
294
- body: { operation: { revision, onlineOrderingStatus: "ENABLED" } },
295
- });
296
- }
297
-
298
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/menu-ordering-settings/query-menu-ordering-settings.md
299
- export async function queryMenuOrderingSettings(ctx) {
300
- const r = await req(ctx, "/menu-ordering-settings/v1/menu-ordering-settings/query", { body: { query: {} } });
301
- return r.menuOrderingSettings ?? [];
302
- }
303
-
304
- // Only when an entry shows onlineOrderingEnabled:false / operationId:"none".
305
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/menu-ordering-settings/update-menu-ordering-settings.md
306
- export async function updateMenuOrderingSettings(ctx, settingsId, patch) {
307
- return req(ctx, `/menu-ordering-settings/v1/menu-ordering-settings/${settingsId}`, {
308
- method: "PATCH",
309
- body: { menuOrderingSettings: patch },
310
- });
311
- }
312
-
313
- // ---- table reservations (setup-restaurant-reservations.md) ---------------------------------------
314
- // The install AUTO-provisions one default reservation location with a complete config; the
315
- // one thing OFF is onlineReservationsEnabled (premium-gated). A reservation location cannot
316
- // be created via this API — discover, configure, enable. Post-Jan-2026 field names:
317
- // partySize (not partiesSize), approval (not manualApproval).
318
-
319
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/reservation-locations/list-reservation-locations.md
320
- export async function listReservationLocations(ctx) {
321
- const r = await req(ctx, "/table-reservations/reservation-locations/v1/reservation-locations", { method: "GET" });
322
- return r.reservationLocations ?? [];
323
- }
324
-
325
- export async function listReservationLocationsWithRetry(ctx, { tries = 15, delayMs = 2000 } = {}) {
326
- for (let i = 0; i < tries; i++) {
327
- const locs = await listReservationLocations(ctx).catch(() => []);
328
- if (locs.length) return locs;
329
- if (i < tries - 1) await sleep(delayMs);
330
- }
331
- return [];
332
- }
333
-
334
- // Partial PATCH; revision mandatory; works on a non-premium site. The `location` object
335
- // (address/name) is IMMUTABLE here — only touch `configuration`.
336
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/reservation-locations/update-reservation-location.md
337
- export async function updateReservationLocation(ctx, reservationLocationId, revision, configuration) {
338
- return req(ctx, `/table-reservations/reservation-locations/v1/reservation-locations/${reservationLocationId}`, {
339
- method: "PATCH",
340
- body: { reservationLocation: { id: reservationLocationId, revision, configuration } },
341
- });
342
- }
343
-
344
- // PREMIUM-ONLY: on a non-premium site this THROWS `428 PREMIUM_ONLY` — expected and
345
- // non-fatal; the caller records it and continues (never retry-spiral, never fail the seed).
346
- // docs: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/reservations/reservation-locations/update-reservation-location.md
347
- export async function enableOnlineReservations(ctx, reservationLocationId, revision) {
348
- return req(ctx, `/table-reservations/reservation-locations/v1/reservation-locations/${reservationLocationId}`, {
349
- method: "PATCH",
350
- body: {
351
- reservationLocation: {
352
- id: reservationLocationId,
353
- revision,
354
- configuration: { onlineReservations: { onlineReservationsEnabled: true } },
355
- },
356
- },
357
- });
358
- }
359
-
360
- /**
361
- * ONE-CALL seed: Menus install (+ sample cleanup when fresh) → menus bottom-up → images →
362
- * ordering add-on → reservations add-on, ids threaded in memory. The default path.
363
- */
364
- export async function setupRestaurants(ctx, plan) {
365
- const menusPlan = plan.menus ?? [];
366
- const wasPresent = await menusAppPresent(ctx);
367
- await installMenusApp(ctx);
368
- let sampleMenuRemoved = false;
369
- if (!wasPresent) {
370
- const r = await removeSampleMenu(ctx).catch(() => ({ removed: false }));
371
- sampleMenuRemoved = r.removed === true;
372
- }
373
-
374
- const createdMenus = [];
375
- for (const m of menusPlan) createdMenus.push(await createMenu(ctx, m));
376
-
377
- // image pass — resolve each item's image (import by url / generate by prompt) in ONE
378
- // parallel wave (restaurants binds by file id), then bulk full-replace with revision +
379
- // priceInfo echoed. Never block on image failure.
380
- let imagesAttached = 0;
381
- const imageItems = [];
382
- menusPlan.forEach((m, mi) => {
383
- const flat = m.sections.flatMap((s) => s.items || []);
384
- flat.forEach((it, i) => {
385
- const created = createdMenus[mi]?.items?.[i];
386
- if ((it.imageUrl || it.imagePrompt) && created?.id) {
387
- imageItems.push({ ...created, imageUrl: it.imageUrl, imagePrompt: it.imagePrompt, name: it.name });
388
- }
389
- });
390
- });
391
- const files = await resolveItemImages(ctx, imageItems.map((it) => ({
392
- url: it.imageUrl,
393
- path: it.imagePath,
394
- prompt: it.imagePrompt,
395
- displayName: `${it.name || "item"}.png`,
396
- })));
397
- const toAttach = imageItems
398
- .map((it, i) => (files[i]
399
- ? { id: it.id, revision: it.revision ?? "1", price: it.price,
400
- image: { id: files[i].id, url: files[i].url, width: 1024, height: 1024 } }
401
- : null))
402
- .filter(Boolean);
403
- const imageFailures = [];
404
- if (toAttach.length) {
405
- try {
406
- const r = await attachItemImages(ctx, toAttach);
407
- imagesAttached = r.attached.length;
408
- for (const f of r.failures) imageFailures.push(f);
409
- } catch (e) {
410
- for (const it of toAttach) imageFailures.push({ id: it.id, error: e?.message ?? String(e) });
411
- }
412
- }
413
-
414
- // shared STEP 0 address — set once across both add-ons.
415
- let locationSet = false;
416
- const ensureLocation = async (address) => {
417
- if (address && !locationSet) {
418
- await setBusinessLocation(ctx, address);
419
- locationSet = true;
420
- }
421
- };
422
-
423
- const ordering = { enabled: false, addressSet: false };
424
- if (plan.ordering) {
425
- const cfg = typeof plan.ordering === "object" ? plan.ordering : {};
426
- await installOrdersApp(ctx); // auto-provisions operation + methods + per-menu settings
427
- await ensureLocation(cfg.address);
428
- ordering.addressSet = locationSet;
429
- const ops = await listOperationsWithRetry(ctx);
430
- const op = ops.find((o) => o.default) ?? ops[0];
431
- if (!op) throw new Error("No ordering operation appeared — the Orders app install may not have completed; re-run the seed.");
432
- if (op.onlineOrderingStatus !== "ENABLED") await enableOperation(ctx, op.id, op.revision);
433
- // confirm each menu is orderable (auto-created + auto-enabled per menu; PATCH only when off)
434
- const settings = await queryMenuOrderingSettings(ctx);
435
- for (const s of settings) {
436
- if (s.onlineOrderingEnabled === false || s.operationId === "none") {
437
- await updateMenuOrderingSettings(ctx, s.id, {
438
- revision: s.revision,
439
- operationId: op.id,
440
- onlineOrderingEnabled: true,
441
- availability: { type: "ALWAYS_AVAILABLE", timeZone: cfg.address?.timeZone ?? "America/New_York" },
442
- }).catch(() => {});
443
- }
444
- }
445
- ordering.enabled = true;
446
- ordering.operationId = op.id;
447
- if (!ordering.addressSet) ordering.note = "No address in the plan — ordering is 'testing only' until the owner sets the real business address.";
448
- }
449
-
450
- const reservations = { enabled: false };
451
- if (plan.reservations) {
452
- const cfg = typeof plan.reservations === "object" ? plan.reservations : {};
453
- await installTableReservationsApp(ctx); // auto-provisions the default reservation location
454
- await ensureLocation(cfg.address);
455
- let [loc] = await listReservationLocationsWithRetry(ctx);
456
- if (!loc) throw new Error("No reservation location appeared — the Table Reservations install may not have completed; re-run the seed.");
457
- const configuration = cfg.configuration ?? (cfg.partySize ? { onlineReservations: { partySize: cfg.partySize } } : null);
458
- if (configuration) {
459
- await updateReservationLocation(ctx, loc.id, loc.revision, configuration);
460
- [loc] = await listReservationLocations(ctx); // re-read for the bumped revision
461
- }
462
- reservations.reservationLocationId = loc.id;
463
- try {
464
- await enableOnlineReservations(ctx, loc.id, loc.revision);
465
- reservations.enabled = true;
466
- } catch {
467
- // 428 PREMIUM_ONLY on a free site — expected; record, don't fail.
468
- reservations.premiumRequired = true;
469
- }
470
- }
471
-
472
- return {
473
- menus: createdMenus.map(({ items, ...m }) => m),
474
- imagesAttached,
475
- imageFailures,
476
- sampleMenuRemoved,
477
- ordering,
478
- reservations,
479
- };
480
- }
481
-
482
- // ---- CLI entry ----------------------------------------------------------------------------------
483
-
484
- const invokedDirectly = process.argv[1] && import.meta.url.endsWith(process.argv[1].split("/").pop());
485
- if (invokedDirectly) {
486
- const planPath = process.argv[2];
487
- if (!planPath) {
488
- console.error("usage: node seed-restaurants.mjs <plan.json> (run from the project root)");
489
- process.exit(1);
490
- }
491
- const plan = JSON.parse(readFileSync(planPath, "utf8"));
492
- const ctx = makeCtx();
493
- setupRestaurants(ctx, plan)
494
- .then((result) => console.log(JSON.stringify(result, null, 2)))
495
- .catch((e) => {
496
- console.error(e.message);
497
- process.exit(1);
498
- });
499
- }
@@ -1,22 +0,0 @@
1
- # Content floor — the copy you write on every authored surface
2
-
3
- **A fallback, not an override.** If the user supplied copy, voice, or tone, use theirs. The
4
- one exception is the first rule — a comprehension floor, not a style preference.
5
-
6
- - **Say what the business is, literally, above the fold.** A first-time visitor must know
7
- what the site *is* and can *do* from the hero alone. The business category ("ceramics
8
- studio", "trattoria", "yoga studio") appears verbatim in the H1, the kicker above it, or
9
- the first clause of the subtitle. A witty H1 is welcome — beside an explicit category,
10
- never instead of one.
11
- - **The subtitle leads with the offer** — the verb the visitor cares about comes early
12
- ("Book…", "Order…", "Browse…"), flavor after.
13
- - **Kickers carry information or don't exist.** "Handmade in Portland · Since 2019" earns its
14
- place; "The Collection" above a Collection heading doesn't. A voice-led H1 pairs with an
15
- informative kicker (that's where the category goes).
16
- - **Titles and subtitles end without a period.** Paragraphs keep theirs.
17
- - **CTA labels are short, concrete, and not all-caps** — the actual action, matching the one
18
- primary CTA per page (`DESIGN.md`).
19
- - **No fluff.** Every line moves a visitor's understanding forward — the H1 and subtitle most
20
- of all.
21
- - **A caption describes what its image actually shows.** A slogan overlaid on a photo is not
22
- a caption; if none is warranted, write none.
@@ -1,73 +0,0 @@
1
- # Custom operations
2
-
3
- Shipped vertical code covers its advertised contract. A brief can also require an operation
4
- outside that contract: a member submission, a file derived in the browser, moderation, a
5
- custom business write, or a third-party service.
6
-
7
- ## Decide the boundary first
8
-
9
- 1. **Caller-permitted Wix operation** — add one function to the appropriate `src/wix/<vertical>/`
10
- data layer. Use the documented SDK method; components call that function, never the SDK.
11
- 2. **Privileged Wix operation** — on Wix-managed Astro, create a narrow `src/pages/api/` endpoint.
12
- Authenticate/authorize the caller and validate the exact input before elevating the one SDK
13
- call with `auth.elevate()`. On another stack, the equivalent belongs on a server using
14
- server-only credentials. Never expose an elevated method or credential to the browser.
15
- 3. **No documented Wix path** — simplify the feature to a supported design. Do not infer a
16
- contract from generated types, SDK implementation files, or `node_modules`.
17
-
18
- ## The research rule
19
-
20
- Read the relevant shipped playbook first. For anything it doesn't cover, use `wix-docs` to
21
- read the official method or feature guide, then implement that contract. One documentation
22
- lookup and one type check are enough before coding. Investigate further only after a concrete error.
23
-
24
- ## User-created public content
25
-
26
- Use the CMS vertical when a visitor or member submits content that the app must later list or
27
- show publicly. Seed the collection with the appropriate permission preset and never trust the
28
- browser to choose an owner, collection, or privileged action.
29
-
30
- For a small browser-created artifact, the official Wix-managed Astro pattern is a validated
31
- server endpoint that writes the contribution with elevation. For binary media, first confirm
32
- the Media Files API's authorization requirements: generating a media upload URL requires
33
- Manage Media Manager permission, so it is not a browser-side member call. Validate identity,
34
- MIME type, size, and destination before any elevated call. The authoritative references are:
35
-
36
- - `wix-docs`: **Upload Images to CMS** for the secure CMS contribution flow.
37
- - `wix-docs`: **Generate File Upload URL** and **Upload API** for Media Manager files.
38
-
39
- Keep the endpoint specific to the allowed contribution. An endpoint that accepts arbitrary
40
- SDK method names, collection ids, or upload destinations is a privilege-escalation bug.
41
-
42
- ## Optional Media Upload capability
43
-
44
- Use this only when a site actually needs a normal file upload (not a small canvas artifact
45
- stored as a CMS data URL). Put the policy in the site plan; the Fast deployer ships the shared
46
- client helper and Astro endpoint once, plus a generated read-only policy module:
47
-
48
- ```json
49
- {
50
- "capabilities": {
51
- "mediaUpload": {
52
- "policies": [{
53
- "id": "gallery-artwork",
54
- "accept": ["image/png", "image/jpeg"],
55
- "maxBytes": 5242880
56
- }]
57
- }
58
- }
59
- }
60
- ```
61
-
62
- The generated policy lives at `src/wix/media-upload/policies.generated.ts`; do not hand-edit
63
- it. The shared browser helper is `src/wix/media-upload/client.ts`:
64
-
65
- ```ts
66
- const media = await uploadMedia("gallery-artwork", pngBlob, "my-drawing.png");
67
- // media.id and media.url are the Wix Media reference to store in the intended CMS image field.
68
- ```
69
-
70
- The browser can select only the **named policy** and the bytes. The deployed API route fixes
71
- the destination and elevates only `files.generateFileUploadUrl`. A vertical uses the same
72
- capability by putting its own policy in its plan. Do not copy, fork, or widen the endpoint in
73
- vertical code.
@@ -1,26 +0,0 @@
1
- # Design floor — every vertical, every surface you author
2
-
3
- **A fallback, not an override.** These rules fill the gap when the user gave no design
4
- direction. The moment the brief specifies a palette, a mood, a reference — their intent wins.
5
- Two exceptions that hold regardless: the contrast floor (in `styles/global.css`, where you
6
- choose the tokens), and the anti-genericism intent — derive the look from *this* brand even
7
- when the user supplied the inputs.
8
-
9
- Token judgment (polarity, palette, contrast, type floors) lives in the `@theme` header in
10
- `styles/global.css` — you'll meet it when you set the tokens. This file governs the surfaces:
11
-
12
- - **Full-bleed, not boxed.** Don't wrap pages in a narrow centered shell (`max-w-4xl mx-auto`
13
- around everything). Design for the viewport; use peripheral space intentionally.
14
- - **One primary CTA per page**, worded to the page's actual action — "Add to Cart",
15
- "Book a Table", "Reserve Your Spot" — never "Submit" / "Click here" / "Learn more" as the
16
- hero action.
17
- - **Icons render bare on the surface** — no circle/square/pill shell behind nav or card
18
- glyphs.
19
- - **No emojis** in UI copy, headings, or empty states (unless the brief itself asks for
20
- them).
21
- - **Vary the look across projects.** Repeating the same palette/layout on unrelated brands is
22
- a failure mode, not a shortcut — two sites with the same vertical and different briefs
23
- should look nothing alike.
24
-
25
- This constrains the *how*, not the *what* — the brief and the vertical decide what the pages
26
- are; INSTRUCTIONS decides which surfaces exist.
@@ -1,23 +0,0 @@
1
- # Supplied content — when the user brings their own
2
-
3
- When the brief supplies the content in any form — a CSV, JSON or spreadsheet, a list typed in the
4
- prompt, a PDF or an image of a price list or a menu, a folder of photos with a text file beside
5
- it, a link to a page that lists it — that source is the seed plan. The vertical's default count
6
- ("start with 3", "a few posts") applies only to catalogs you draft yourself.
7
-
8
- Read it however it needs to be read: parse the file (a quoted comma inside a description is
9
- common), open the PDF, fetch the page, look at the images. Then map, don't author:
10
-
11
- - Every entry in the source becomes an entry in the plan. Names, titles, descriptions, prices,
12
- dates verbatim; never rename, reprice, reword, reorder or add.
13
- - Column and field names vary; map by meaning to the fields the vertical's `SEED.md` plan
14
- shape defines. Anything the plan has no field for is dropped — say which columns you dropped.
15
- - Their images only: an image URL column → the plan's image URL field, verified with `curl -sI`
16
- → 200; a local file → the plan's image path field. An entry with no image is seeded without one
17
- and listed in your summary. **Never an `imagePrompt` beside supplied content** — these are their
18
- things, not a mood board.
19
- - Currency, time zone, address: only when the source or the brief states them.
20
- - Show the user the count you read next to the count you seeded, and the mapping you applied.
21
-
22
- The vertical's `SEED.md` says what an entry is for that vertical and which of its plan fields the
23
- usual columns land in.