@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,215 +0,0 @@
1
- // Member authentication over REST — the twin of app/wix/members/auth.ts. Same exports, same
2
- // LoginResult; the state and error-code rules come from auth-core (the SAME file the SDK transport
3
- // uses). The custom credential flow, as the docs order it: login/register with the VISITOR token →
4
- // a one-shot sessionToken (5-minute life) → a redirect session that authorizes it (PKCE,
5
- // web_message) → an authorization code → POST /oauth2/token grantType authorization_code → MEMBER
6
- // tokens, adopted by ./client.js so every later call (the current-member read, a member's own
7
- // records) runs as the member and the refresh keeps the member. All from a page with the public
8
- // client id; nothing elevated. Porting: keep the paths and bodies; the exchange is three calls.
9
- // docs: https://dev.wix.com/docs/go-headless/authentication/members/custom-login-page/build-a-custom-login-page-rest.md
10
- // docs: https://dev.wix.com/docs/api-reference/business-management/headless/redirects/create-redirect-session.md
11
- import { WIX_CLIENT_ID } from "./config.js";
12
- import { WixApiError, clearTokens, loadTokens, mintTokens, setTokens, wixRequest, type Tokens } from "./client.js";
13
- import {
14
- NO_SESSION_ERROR,
15
- authOutcome,
16
- failure,
17
- loginErrorCode,
18
- registerErrorCode,
19
- toLoginResult,
20
- type LoginResult,
21
- type LoginState,
22
- type RawAuth,
23
- } from "./auth-core.js";
24
-
25
- export type { LoginResult, LoginState };
26
-
27
- const REDIRECT_SESSION = "/headless/v1/redirect-session";
28
- /** The stateToken of a login/registration that stopped at email verification — verifyMemberEmail continues it. */
29
- let pendingStateToken: string | null = null;
30
-
31
- /** True when the persisted token set is a member's (no network) — the store skips the profile read when false. */
32
- export function loggedInHint(): boolean {
33
- return loadTokens()?.role === "member";
34
- }
35
-
36
- // A SUCCESS carries the one-shot session token: exchange it for member tokens and adopt them. Other
37
- // states pass through; a verification state keeps its stateToken for verifyMemberEmail.
38
- async function finish(raw: RawAuth): Promise<LoginResult> {
39
- const outcome = authOutcome(raw);
40
- if (outcome.state === "SUCCESS") {
41
- pendingStateToken = null;
42
- if (!outcome.sessionToken) return failure(NO_SESSION_ERROR);
43
- setTokens(await memberTokensForSession(outcome.sessionToken));
44
- return { state: "SUCCESS" };
45
- }
46
- if (outcome.stateToken) pendingStateToken = outcome.stateToken;
47
- return toLoginResult(outcome);
48
- }
49
-
50
- const message = (e: unknown): string => (e instanceof Error ? e.message : String(e));
51
-
52
- /**
53
- * Sign in with email + password. A wrong password or unknown email is a FAILURE result (errorCode
54
- * invalidPassword / invalidEmail, Wix's message in `error`), never a throw.
55
- * POST /_api/iam/authentication/v2/login { loginId: { email }, password } → { state, sessionToken?, stateToken? }
56
- */
57
- export async function loginMember(email: string, password: string): Promise<LoginResult> {
58
- let raw: RawAuth;
59
- try {
60
- raw = await wixRequest<RawAuth>("/_api/iam/authentication/v2/login", { body: { loginId: { email }, password } });
61
- } catch (e) {
62
- return failure(message(e), e instanceof WixApiError ? loginErrorCode(e.code) : undefined);
63
- }
64
- return finish(raw);
65
- }
66
-
67
- /**
68
- * Sign up with email + password (+ first/last name). An email already registered is a FAILURE with
69
- * errorCode emailAlreadyExists. Whether the result is SUCCESS, EMAIL_VERIFICATION_REQUIRED, or
70
- * OWNER_APPROVAL_REQUIRED is the site's signup policy (dashboard), not the caller's.
71
- * POST /_api/iam/authentication/v2/register { loginId: { email }, password, profile?: { firstName, lastName } }
72
- */
73
- export async function registerMember(
74
- email: string,
75
- password: string,
76
- profile?: { firstName?: string; lastName?: string },
77
- ): Promise<LoginResult> {
78
- let raw: RawAuth;
79
- try {
80
- raw = await wixRequest<RawAuth>("/_api/iam/authentication/v2/register", {
81
- body: { loginId: { email }, password, ...(profile ? { profile } : {}) },
82
- });
83
- } catch (e) {
84
- return failure(message(e), e instanceof WixApiError ? registerErrorCode(e.code, e.details) : undefined);
85
- }
86
- return finish(raw);
87
- }
88
-
89
- /**
90
- * Continue an EMAIL_VERIFICATION_REQUIRED flow with the code from the email; the state token of the
91
- * last login/registration is kept here. A FAILURE when nothing is waiting or the code is wrong.
92
- * POST /_api/iam/verification/v1/auth/verify { code, stateToken } → { state, sessionToken?, stateToken? }
93
- */
94
- export async function verifyMemberEmail(verificationCode: string): Promise<LoginResult> {
95
- if (!pendingStateToken) return failure("No sign-in is waiting for a verification code.");
96
- let raw: RawAuth;
97
- try {
98
- raw = await wixRequest<RawAuth>("/_api/iam/verification/v1/auth/verify", { body: { code: verificationCode, stateToken: pendingStateToken } });
99
- } catch (e) {
100
- return failure(message(e));
101
- }
102
- return finish(raw);
103
- }
104
-
105
- /**
106
- * The Wix logout URL for the current member — navigating the document there ends the Wix session
107
- * and lands on `returnTo` (an absolute URL). Called with the MEMBER token.
108
- * POST /headless/v1/redirect-session { logout: { clientId }, callbacks: { postFlowUrl } } → { redirectSession: { fullUrl } }
109
- */
110
- export async function logoutUrl(returnTo: string): Promise<string> {
111
- const res = await wixRequest<RawAuth>(REDIRECT_SESSION, { body: { logout: { clientId: WIX_CLIENT_ID }, callbacks: { postFlowUrl: returnTo } } });
112
- const url = res?.redirectSession?.fullUrl;
113
- if (!url) throw new Error("Logout couldn't start: no redirect URL returned.");
114
- return url;
115
- }
116
-
117
- /** Log out: drop the member tokens (the next call is a fresh visitor) and navigate to Wix's logout, which returns to `returnTo`. */
118
- export async function logoutMember(returnTo = "/"): Promise<void> {
119
- const target = typeof window !== "undefined" ? new URL(returnTo, window.location.origin).href : returnTo;
120
- const url = await logoutUrl(target);
121
- clearTokens();
122
- if (typeof window !== "undefined") window.location.assign(url);
123
- }
124
-
125
- /**
126
- * sessionToken → member tokens. Three calls, as the docs order them:
127
- * 1. POST /headless/v1/redirect-session
128
- * { auth: { authRequest: { clientId, codeChallenge, codeChallengeMethod: "S256", responseMode: "web_message",
129
- * responseType: "code", scope: "offline_access", state, sessionToken }, prompt: "none" } }
130
- * → { redirectSession: { fullUrl } } (with the visitor token)
131
- * 2. fullUrl is a page whose script posts { code, state, error } to its parent — a hidden iframe in a
132
- * browser (its origin must be one of the OAuth app's allowed domains, or the message is dropped
133
- * and this times out); without a DOM (a server-side port, a Node check) the same page is fetched
134
- * and read.
135
- * 3. POST /oauth2/token { clientId, grantType: "authorization_code", code, codeVerifier }
136
- * → member access + refresh tokens (role "member"); the code is single-use.
137
- */
138
- export async function memberTokensForSession(sessionToken: string): Promise<Tokens> {
139
- const { verifier, challenge } = await pkce();
140
- const state = randomString();
141
- const res = await wixRequest<RawAuth>(REDIRECT_SESSION, {
142
- body: {
143
- auth: {
144
- authRequest: {
145
- clientId: WIX_CLIENT_ID,
146
- codeChallenge: challenge,
147
- codeChallengeMethod: "S256",
148
- responseMode: "web_message",
149
- responseType: "code",
150
- scope: "offline_access",
151
- state,
152
- sessionToken,
153
- },
154
- prompt: "none",
155
- },
156
- },
157
- });
158
- const url: string | undefined = res?.redirectSession?.fullUrl;
159
- if (!url) throw new Error("Login couldn't finish: no authorization URL returned.");
160
- const code = await authorizationCode(url, state);
161
- return mintTokens({ grantType: "authorization_code", code, codeVerifier: verifier }, "member");
162
- }
163
-
164
- // The authorize page posts { code, state, error }. Browser: a hidden iframe and a message listener
165
- // keyed on our state (the SDK's own mechanism). No DOM: fetch the page and read the same three values.
166
- async function authorizationCode(url: string, state: string): Promise<string> {
167
- if (typeof document === "undefined") {
168
- const html = await (await fetch(url)).text();
169
- const field = (name: string) => html.match(new RegExp(`'${name}':\\s*'([^']*)'`))?.[1];
170
- const error = field("error");
171
- if (error) throw new Error(`Login was refused: ${error}`);
172
- const code = field("code");
173
- if (!code || field("state") !== state) throw new Error("Login couldn't finish: no authorization code.");
174
- return code;
175
- }
176
- return new Promise<string>((resolve, reject) => {
177
- const frame = document.createElement("iframe");
178
- frame.style.display = "none";
179
- const done = () => {
180
- window.removeEventListener("message", onMessage);
181
- clearTimeout(timer);
182
- frame.remove();
183
- };
184
- const onMessage = (e: MessageEvent) => {
185
- const data = e.data as { code?: string; state?: string; error?: string } | null;
186
- if (!data || data.state !== state) return; // a message not meant for us
187
- done();
188
- if (data.error) reject(new Error(`Login was refused: ${data.error}`));
189
- else if (data.code) resolve(data.code);
190
- else reject(new Error("Login couldn't finish: no authorization code."));
191
- };
192
- const timer = setTimeout(() => {
193
- done();
194
- reject(new Error("Login timed out. Is this page's origin on the OAuth app's allowed domains?"));
195
- }, 120_000);
196
- window.addEventListener("message", onMessage);
197
- frame.src = url;
198
- document.body.appendChild(frame);
199
- });
200
- }
201
-
202
- // PKCE: a 43-char base64url verifier, its SHA-256 as the S256 challenge. Web Crypto (browser + Node).
203
- function base64url(bytes: Uint8Array): string {
204
- let s = "";
205
- for (const b of bytes) s += String.fromCharCode(b);
206
- return btoa(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
207
- }
208
- function randomString(): string {
209
- return base64url(crypto.getRandomValues(new Uint8Array(32)));
210
- }
211
- async function pkce(): Promise<{ verifier: string; challenge: string }> {
212
- const verifier = randomString();
213
- const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(verifier));
214
- return { verifier, challenge: base64url(new Uint8Array(digest)) };
215
- }
@@ -1,26 +0,0 @@
1
- // Current-member read over REST — the twin of app/wix/members/members.ts. Same export, same DTO;
2
- // the mapper comes from members-core (the SAME file the SDK transport uses, deployed flat next to
3
- // this one by deploy.mjs --stack static), so this file is only the transport: one GET. It runs with
4
- // whatever token ./client.js holds — a member's after a rest/auth.ts login → the profile; a
5
- // visitor's → 403 → null. Porting: keep the path and the fieldsets, port the core once.
6
- // docs: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/get-my-member.md
7
- import { wixRequest } from "./client.js";
8
- import { imgSrc } from "./media.js";
9
- import { MEMBER_FIELDSETS, memberId, toCurrentMember, type Raw } from "./members-core.js";
10
- import type { CurrentMember } from "./types.js";
11
-
12
- /**
13
- * The current member, or null: for a visitor (the call is refused — "Missing site member id"), for
14
- * a logged-in member whose site lacks the Members Area app (no profile), and on any failure —
15
- * anonymous is a normal state, never an error.
16
- * GET /members/v1/members/my?fieldsets=FULL → { member: { id, loginEmail, contactId, contact: { firstName, lastName }, profile: { nickname, photo? }, createdDate, … } }
17
- */
18
- export async function fetchCurrentMember(): Promise<CurrentMember | null> {
19
- try {
20
- const res = await wixRequest<Raw>("/members/v1/members/my", { method: "GET", query: { fieldsets: MEMBER_FIELDSETS } });
21
- const raw: Raw | undefined = res?.member;
22
- return raw && memberId(raw) ? toCurrentMember(raw, imgSrc) : null;
23
- } catch {
24
- return null;
25
- }
26
- }
@@ -1,39 +0,0 @@
1
- # Members — seeding
2
-
3
- **Members self-register — there is no member content to seed.** The Wix login page registers
4
- or logs in members at runtime; creating members at build time is intentionally out of scope
5
- (a headless run must never stall on an interactive login, and Create Member needs an
6
- elevated credential).
7
-
8
- What `seed-members.mjs` does is the one build-time setup the vertical needs: **install the
9
- Wix Members Area app** — the *profile* layer. Identity (log in / log out / "logged-in vs
10
- not" gating) needs no install; profile data does: without the app, `getCurrentMember()`
11
- returns nothing for a logged-in member and the account page can't render who they are.
12
-
13
- ```bash
14
- # from the project root (where wix.config.json lives) — the plan file is optional:
15
- node <SKILL_ROOT>/references/members/seed/seed-members.mjs
16
- ```
17
-
18
- ```json
19
- { "installMembersArea": true }
20
- ```
21
-
22
- - `installMembersArea` — default `true`; set `false` only when the run needs pure
23
- "logged-in vs not" gating and will never display member data.
24
- - Re-running is safe: an already-installed app is recorded in the result JSON
25
- (`membersAreaInstall.note`), never thrown.
26
-
27
- **Seeding is additive — never delete or overwrite existing content**; ask first if a cleanup
28
- seems needed.
29
-
30
- ## Escape hatch — individual functions
31
- `setupMembers` composes the exported steps — `installMembersAreaApp`, plus `makeCtx()` —
32
- import them for a partial re-run.
33
-
34
- ## Reference
35
- The appDefId and the identity/profile split come from
36
- `wix-headless/references/SETUP.md` (§ members). Signup security (email verification, owner
37
- approval, reCAPTCHA) is dashboard-governed — never seeded. If a run's prompt explicitly needs
38
- a pre-created member (rare), the admin Create Member shape is in the live Wix API reference —
39
- read it via the `wix-docs` skill; don't guess it here.
@@ -1,15 +0,0 @@
1
- // Whether the site has a members area, and how many members.
2
- // node <SKILL_ROOT>/references/members/seed/read-site.mjs [--site <siteId>]
3
- import { runReader } from "../../shared/seed/read-site.mjs";
4
-
5
- const MEMBERS_AREA_APP_ID = "14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9";
6
- const D = "https://dev.wix.com/docs/api-reference/crm/members-contacts/members/members";
7
-
8
- await runReader({
9
- vertical: "members",
10
- appId: MEMBERS_AREA_APP_ID,
11
- async read(api) {
12
- const r = await api.call({ method: "GET", path: "/members/v1/members?fieldsets=PUBLIC&paging.limit=1", docs: `${D}/list-members` });
13
- return { memberCount: r.metadata?.total ?? r.pagingMetadata?.total ?? null };
14
- },
15
- });
@@ -1,94 +0,0 @@
1
- // Members seed — a BUILD-TIME script, never shipped in the app. Run from the project root
2
- // (where wix.config.json lives); the plan file is optional:
3
- //
4
- // node <SKILL_ROOT>/references/members/seed/seed-members.mjs [plan.json]
5
- //
6
- // Members SELF-REGISTER — there is no member content to create (see SEED.md). The one
7
- // build-time setup this vertical needs is installing the Wix Members Area app, which serves
8
- // member PROFILE data: without it getCurrentMember() returns nothing for a logged-in member,
9
- // so the account page can't render who they are. Identity alone (log in / log out / gating)
10
- // needs no install. Prints a JSON result to stdout.
11
- //
12
- // Plan shape (see SEED.md): { "installMembersArea": true } // default true
13
- //
14
- // Seeding is ADDITIVE — never deletes or overwrites existing content. Authoritative source:
15
- // wix-headless/references/SETUP.md § members (the appDefId and the identity/profile split).
16
- import { execFileSync } from "node:child_process";
17
- import { readFileSync } from "node:fs";
18
-
19
- const API = "https://www.wixapis.com";
20
- // The Wix Members Area app (the profile layer). Not in the "Apps Created by Wix" table —
21
- // the GUID comes from the App Market listing; recorded in wix-headless/references/SETUP.md.
22
- // Installing it pulls in its Site-Members dependency automatically.
23
- const MEMBERS_AREA_APP_ID = "14cc59bc-f0b7-15b8-e1c7-89ce41d0e0c9";
24
-
25
- export function makeCtx({ cwd = process.cwd() } = {}) {
26
- const config = JSON.parse(readFileSync(`${cwd}/wix.config.json`, "utf8"));
27
- const siteId = config.siteId ?? config.projectId;
28
- if (!siteId) throw new Error("wix.config.json has no siteId — is this a Wix CLI project?");
29
- const token = execFileSync("npx", ["@wix/cli@latest", "token", "--site", siteId], {
30
- encoding: "utf8",
31
- cwd,
32
- }).trim();
33
- if (!token) throw new Error("The Wix CLI returned no token — run `npx @wix/cli@latest login` first.");
34
- return { token, siteId };
35
- }
36
-
37
- async function req(ctx, path, { method = "POST", body } = {}) {
38
- const res = await fetch(API + path, {
39
- method,
40
- headers: {
41
- Authorization: `Bearer ${ctx.token}`,
42
- "wix-site-id": ctx.siteId,
43
- "Content-Type": "application/json",
44
- },
45
- body: body ? JSON.stringify(body) : undefined,
46
- });
47
- const json = await res.json().catch(() => ({}));
48
- if (!res.ok) throw new Error(`${method} ${path} -> ${res.status}: ${JSON.stringify(json).slice(0, 400)}`);
49
- return json;
50
- }
51
-
52
- // ---- operations ----------------------------------------------------------------------------------
53
-
54
- /**
55
- * Install the Wix Members Area app (idempotent in effect: re-running against a site that
56
- * already has it errors — recorded in the result, not thrown, since "already installed" and
57
- * a real failure aren't distinguishable from the response).
58
- * docs: https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/platform/about-apps-created-by-wix.md
59
- */
60
- export async function installMembersAreaApp(ctx) {
61
- try {
62
- await req(ctx, "/apps-installer-service/v1/app-instance/install", { body: {
63
- tenant: { tenantType: "SITE", id: ctx.siteId },
64
- appInstance: { appDefId: MEMBERS_AREA_APP_ID, enabled: true },
65
- } });
66
- return { requested: true, note: null };
67
- } catch (e) {
68
- return { requested: false, note: String(e.message).slice(0, 300) };
69
- }
70
- }
71
-
72
- /** ONE-CALL seed: install the Members Area app (the profile layer). The default path. */
73
- export async function setupMembers(ctx, { installMembersArea = true } = {}) {
74
- return {
75
- membersAreaAppId: MEMBERS_AREA_APP_ID,
76
- membersAreaInstall: installMembersArea ? await installMembersAreaApp(ctx) : { skipped: true },
77
- membersCreated: 0, // members self-register — never created at build time
78
- };
79
- }
80
-
81
- // ---- CLI entry ----------------------------------------------------------------------------------
82
-
83
- const invokedDirectly = process.argv[1] && import.meta.url.endsWith(process.argv[1].split("/").pop());
84
- if (invokedDirectly) {
85
- const planPath = process.argv[2];
86
- const plan = planPath ? JSON.parse(readFileSync(planPath, "utf8")) : {};
87
- const ctx = makeCtx();
88
- setupMembers(ctx, plan)
89
- .then((result) => console.log(JSON.stringify(result, null, 2)))
90
- .catch((e) => {
91
- console.error(e.message);
92
- process.exit(1);
93
- });
94
- }