@wix/agent-skills 1.15.1 → 1.16.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.
- package/README.md +3 -7
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +4 -1
- package/skills/wix-app/references/APP_TOOLS.md +134 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +1 -1
- package/skills/wix-app/references/DASHBOARD_PAGE.md +0 -10
- package/skills/wix-app/references/DATA_COLLECTION.md +1 -1
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +28 -9
- package/skills/wix-app/references/SERVICE_PLUGIN.md +12 -10
- package/skills/wix-app/references/app-tools/TOOLS.md +75 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +2 -2
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW-REFERENCE.md +172 -0
- package/skills/wix-app/references/editor-react-component/A11Y-REVIEW.md +138 -0
- package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +23 -2
- package/skills/wix-app/references/editor-react-component/BRANDED-COMPONENTS.md +29 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +27 -2
- package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +5 -3
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +18 -1
- package/skills/wix-app/references/editor-react-component/PARTS.md +15 -2
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +2 -3
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +13 -9
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +4 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +4 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +3 -1
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +4 -0
- package/skills/wix-app/references/service-plugin/TOOLS_PROVIDER.md +54 -0
- package/skills/wix-app/references/stores/QUERY.md +32 -0
- package/skills/wix-docs/SKILL.md +35 -3
- package/skills/wix-headless/SKILL.md +3 -1
- package/skills/wix-headless/references/CONTENT.md +36 -0
- package/skills/wix-headless/references/DESIGN.md +54 -0
- package/skills/wix-headless/references/DISCOVERY.md +24 -0
- package/skills/wix-headless/references/IMAGE_GENERATION.md +10 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +3 -2
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +32 -23
- package/skills/wix-headless/references/managed/CONNECT.md +1 -1
- package/skills/wix-headless/references/managed/CREATE.md +14 -0
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +25 -0
- package/skills/wix-manage/SKILL.md +123 -7
- package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +41 -0
- package/skills/wix-manage/references/app-installation/app-installation-dashboard-navigation.md +28 -0
- package/skills/wix-manage/references/blog/blog-dashboard-navigation.md +56 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +31 -6
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -1
- package/skills/wix-manage/references/bookings/bookings-dashboard-navigation.md +63 -0
- package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +10 -1
- package/skills/wix-manage/references/cms/cms-dashboard-navigation.md +44 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +31 -3
- package/skills/wix-manage/references/cms/cms-publishing-flow.md +287 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +27 -1
- package/skills/wix-manage/references/contacts/contacts-dashboard-navigation.md +46 -0
- package/skills/wix-manage/references/contacts/create-a-contact.md +82 -0
- package/skills/wix-manage/references/contacts/update-a-contact.md +119 -0
- package/skills/wix-manage/references/dashboard-navigation/dashboard-navigation.md +82 -0
- package/skills/wix-manage/references/dashboard-navigation/routes.json +1733 -0
- package/skills/wix-manage/references/domains/domains-dashboard-navigation.md +32 -0
- package/skills/wix-manage/references/ecommerce/ecom-pricing.md +4 -4
- package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
- package/skills/wix-manage/references/ecommerce/gift-cards/ecom-gift-cards-goal-sell-gift-cards.md +338 -0
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-discount-rule.md +42 -78
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-bundle-and-save.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-stock-mover.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-flow-upsell-boost.md +1 -1
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +90 -92
- package/skills/wix-manage/references/events/create-wix-event.md +176 -0
- package/skills/wix-manage/references/events/manage-wix-events.md +174 -0
- package/skills/wix-manage/references/forms/forms-dashboard-navigation.md +44 -0
- package/skills/wix-manage/references/get-paid/get-paid-dashboard-navigation.md +52 -0
- package/skills/wix-manage/references/google-ads/billing-and-payment.md +80 -0
- package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +212 -0
- package/skills/wix-manage/references/google-ads/get-campaign-suggestions.md +110 -0
- package/skills/wix-manage/references/google-ads/google-ads-dashboard-navigation.md +25 -0
- package/skills/wix-manage/references/google-ads/install-and-create-account.md +155 -0
- package/skills/wix-manage/references/google-ads/manage-campaign-lifecycle.md +63 -0
- package/skills/wix-manage/references/google-ads/query-campaign-analytics.md +155 -0
- package/skills/wix-manage/references/marketing/marketing-dashboard-navigation.md +52 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +99 -1
- package/skills/wix-manage/references/pricing-plans/pricing-plans-dashboard-navigation.md +45 -0
- package/skills/wix-manage/references/restaurants/restaurants-dashboard-navigation.md +68 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +94 -125
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +48 -9
- package/skills/wix-manage/references/site-properties/site-properties-dashboard-navigation.md +31 -0
- package/skills/wix-manage/references/sites/create-headless-site.md +52 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +2 -25
- package/skills/wix-manage/references/sites/site-import.md +163 -190
- package/skills/wix-manage/references/sites/sites-dashboard-navigation.md +29 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +17 -1
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +26 -8
- package/skills/wix-manage/references/stores/stores-dashboard-navigation.md +65 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +39 -7
- package/skills/wix-replatform/.publish-manifest.json +8 -0
- package/skills/wix-replatform/SKILL.md +693 -0
- package/skills/wix-replatform/lib/artifact-freshness.js +215 -0
- package/skills/wix-replatform/lib/completion-report.js +200 -0
- package/skills/wix-replatform/lib/config-env.js +59 -0
- package/skills/wix-replatform/lib/execution-manifest.js +185 -0
- package/skills/wix-replatform/lib/execution-state.js +173 -0
- package/skills/wix-replatform/lib/import-recovery.js +313 -0
- package/skills/wix-replatform/lib/local-state.js +642 -0
- package/skills/wix-replatform/lib/orchestration-preflight.js +143 -0
- package/skills/wix-replatform/lib/orchestration-router.js +122 -0
- package/skills/wix-replatform/lib/orchestration-state.js +455 -0
- package/skills/wix-replatform/lib/progress-log.js +224 -0
- package/skills/wix-replatform/lib/progress-log.sh +140 -0
- package/skills/wix-replatform/lib/url-preservation-state.js +391 -0
- package/skills/wix-replatform/resources/rp-discovery/SKILL.md +184 -0
- package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +529 -0
- package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +316 -0
- package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +64 -0
- package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +1114 -0
- package/skills/wix-replatform/resources/rp-mapper/SKILL.md +430 -0
- package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +217 -0
- package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +148 -0
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +378 -0
- package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +183 -0
- package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +478 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +136 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +310 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +1081 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +618 -0
- package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +949 -0
- package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +196 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +66 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +60 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +95 -0
- package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +82 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +256 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +249 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +444 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +774 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +71 -0
- package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +632 -0
- package/skills/wix-replatform/resources/rp-target-wix/SPEC-product-reviews-and-blog-authorship.md +330 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +21 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +19 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +39 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +36 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +35 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +131 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +21 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +97 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +528 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +13 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +53 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +84 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +25 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +37 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +90 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +64 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +141 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +384 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +260 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +238 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +237 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +238 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +2219 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +31 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +100 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +107 -0
- package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +344 -0
- package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +250 -0
- package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +1927 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +83 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +141 -0
- package/skills/wix-replatform/scripts/artifact-freshness.js +76 -0
- package/skills/wix-replatform/scripts/execution-manifest-validate.js +43 -0
- package/skills/wix-replatform/scripts/execution-state-prepare.js +128 -0
- package/skills/wix-replatform/scripts/orchestration-preflight.js +48 -0
- package/skills/wix-replatform/scripts/orchestration-route.js +46 -0
- package/skills/wix-replatform/scripts/orchestration-state.js +245 -0
- package/skills/wix-vibe-headless/SKILL.md +48 -25
- package/skills/wix-vibe-headless/install/deploy.cjs +95 -0
- package/skills/wix-vibe-headless/install/pin-agents-md.cjs +34 -0
- package/skills/wix-vibe-headless/platforms/README.md +8 -4
- package/skills/wix-vibe-headless/platforms/base44.md +133 -98
- package/skills/wix-vibe-headless/platforms/generic.md +99 -64
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +230 -119
- package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +43 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +25 -0
- package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +35 -0
- package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +38 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +40 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +54 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +65 -0
- package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +50 -0
- package/skills/wix-vibe-headless/references/blog/seed/SEED.md +103 -0
- package/skills/wix-vibe-headless/references/blog/seed/seed-blog.js +270 -0
- package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +260 -149
- package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +65 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +47 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +13 -0
- package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +126 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +108 -0
- package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +58 -0
- package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +95 -0
- package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +94 -0
- package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +89 -0
- package/skills/wix-vibe-headless/references/bookings/{wix-bookings-checkout.js → app/rest/wix-bookings-checkout.js} +1 -1
- package/skills/wix-vibe-headless/references/bookings/{wix-bookings-services.js → app/rest/wix-bookings-services.js} +87 -11
- package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +117 -0
- package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.js +333 -0
- package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +169 -147
- package/skills/wix-vibe-headless/references/cms/app/collection.config.js +31 -0
- package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +18 -0
- package/skills/wix-vibe-headless/references/cms/{wix-cms.js → app/rest/wix-cms.js} +47 -2
- package/skills/wix-vibe-headless/references/cms/seed/SEED.md +145 -0
- package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +228 -131
- package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +23 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +43 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +13 -0
- package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +29 -0
- package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +57 -0
- package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +78 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +27 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +54 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +40 -0
- package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +81 -0
- package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +48 -0
- package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +36 -0
- package/skills/wix-vibe-headless/references/events/{wix-events-browse.js → app/rest/wix-events-browse.js} +1 -1
- package/skills/wix-vibe-headless/references/events/seed/SEED.md +107 -0
- package/skills/wix-vibe-headless/references/events/seed/seed-events.js +251 -0
- package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +276 -188
- package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +101 -0
- package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +33 -0
- package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +21 -0
- package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +29 -0
- package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +54 -0
- package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +77 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +36 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +32 -0
- package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +35 -0
- package/skills/wix-vibe-headless/references/members/{wix-members-auth.js → app/rest/wix-members-auth.js} +6 -3
- package/skills/wix-vibe-headless/references/members/install/Register.jsx +22 -0
- package/skills/wix-vibe-headless/references/members/seed/SEED.md +22 -0
- package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +233 -104
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +31 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +39 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +15 -0
- package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +29 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +35 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +27 -0
- package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +25 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +39 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +27 -0
- package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +60 -0
- package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +94 -0
- package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.js +236 -0
- package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +240 -117
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +35 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +48 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +16 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +35 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +25 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +28 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +30 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +30 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +53 -0
- package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +28 -0
- package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +86 -0
- package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.js +251 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +248 -124
- package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +81 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +71 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +43 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +21 -0
- package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +60 -0
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +63 -0
- package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +32 -0
- package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +73 -0
- package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +28 -0
- package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +102 -0
- package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +180 -0
- package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.js +452 -0
- package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +56 -0
- package/skills/wix-vibe-headless/references/shared/{wix-client.js → app/rest/wix-client.js} +6 -8
- package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +6 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +263 -157
- package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +20 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +150 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductCard.jsx +167 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGallery.jsx +51 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/ProductGrid.jsx +54 -0
- package/skills/wix-vibe-headless/references/storefront/app/components/VariantPicker.jsx +119 -0
- package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +71 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +109 -0
- package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +98 -0
- package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +27 -0
- package/skills/wix-vibe-headless/references/storefront/app/pages/ProductDetail.jsx +139 -0
- package/skills/wix-vibe-headless/references/storefront/app/pages/Shop.jsx +75 -0
- package/skills/wix-vibe-headless/references/storefront/{wix-store-cart.js → app/rest/wix-store-cart.js} +1 -1
- package/skills/wix-vibe-headless/references/storefront/{wix-store-catalog.js → app/rest/wix-store-catalog.js} +20 -1
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +111 -0
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.js +299 -0
- /package/skills/wix-vibe-headless/references/blog/{wix-blog.js → app/rest/wix-blog.js} +0 -0
- /package/skills/wix-vibe-headless/references/events/{wix-events-registration.js → app/rest/wix-events-registration.js} +0 -0
- /package/skills/wix-vibe-headless/references/portfolio/{wix-portfolio.js → app/rest/wix-portfolio.js} +0 -0
- /package/skills/wix-vibe-headless/references/pricing-plans/{wix-pricing-plans.js → app/rest/wix-pricing-plans.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-menu.js → app/rest/wix-restaurants-menu.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-ordering.js → app/rest/wix-restaurants-ordering.js} +0 -0
- /package/skills/wix-vibe-headless/references/restaurants/{wix-restaurants-reservations.js → app/rest/wix-restaurants-reservations.js} +0 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ROUTE_CATEGORIES = new Set([
|
|
4
|
+
'backend_data',
|
|
5
|
+
'backend_metadata',
|
|
6
|
+
'public_commerce_data',
|
|
7
|
+
'excluded_frontend',
|
|
8
|
+
'excluded_template_editor',
|
|
9
|
+
'excluded_runtime_session',
|
|
10
|
+
'excluded_admin_dashboard',
|
|
11
|
+
'excluded_diagnostics',
|
|
12
|
+
'excluded_integration',
|
|
13
|
+
'excluded_marketplace_setup',
|
|
14
|
+
'excluded_unsupported',
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const FRONTEND_RULES = [
|
|
18
|
+
['/wp/v2/pages', 'wp.frontend.pages', 'site composition pages are outside backend data scope'],
|
|
19
|
+
['/wp/v2/navigation', 'wp.frontend.navigation', 'navigation is site composition, not backend data'],
|
|
20
|
+
['/wp/v2/menus', 'wp.frontend.menus', 'menus are site composition, not backend data'],
|
|
21
|
+
['/wp/v2/menu-items', 'wp.frontend.menu-items', 'menu items are site composition, not backend data'],
|
|
22
|
+
['/wp/v2/menu-locations', 'wp.frontend.menu-locations', 'menu locations are presentation configuration'],
|
|
23
|
+
['/wp/v2/search', 'wp.frontend.search', 'search is a frontend lookup helper'],
|
|
24
|
+
['/oembed/1.0/*', 'wp.frontend.oembed', 'oEmbed routes are frontend embedding helpers'],
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const TEMPLATE_EDITOR_RULES = [
|
|
28
|
+
['/wp/v2/templates*', 'wp.editor.templates', 'templates are theme/editor construction state'],
|
|
29
|
+
['/wp/v2/template-parts*', 'wp.editor.template-parts', 'template parts are theme/editor construction state'],
|
|
30
|
+
['/wp/v2/blocks', 'wp.editor.blocks', 'blocks are editor construction state'],
|
|
31
|
+
['/wp/v2/block-types', 'wp.editor.block-types', 'block types are editor metadata'],
|
|
32
|
+
['/wp/v2/block-directory/*', 'wp.editor.block-directory', 'block directory routes are editor helpers'],
|
|
33
|
+
['/wp/v2/block-patterns/*', 'wp.editor.block-patterns', 'block pattern routes are editor helpers'],
|
|
34
|
+
['/wp/v2/pattern-directory/*', 'wp.editor.pattern-directory', 'pattern directory routes are editor helpers'],
|
|
35
|
+
['/wp/v2/wp_pattern_category', 'wp.editor.pattern-category', 'pattern categories are editor helpers'],
|
|
36
|
+
['/wp-block-editor/*', 'wp.editor.namespace', 'block editor namespace is outside backend data scope'],
|
|
37
|
+
['/wp/v2/widgets', 'wp.editor.widgets', 'widgets are presentation configuration'],
|
|
38
|
+
['/wp/v2/widget-types', 'wp.editor.widget-types', 'widget types are presentation metadata'],
|
|
39
|
+
['/wp/v2/sidebars', 'wp.editor.sidebars', 'sidebars are presentation configuration'],
|
|
40
|
+
['/wp/v2/themes', 'wp.editor.themes', 'themes are presentation configuration'],
|
|
41
|
+
['/wp/v2/font-*', 'wp.editor.fonts', 'font routes describe presentation assets'],
|
|
42
|
+
['/wp/v2/icons', 'wp.editor.icons', 'icons describe presentation assets'],
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const RUNTIME_RULES = [
|
|
46
|
+
['/wc/store/cart*', 'wc.runtime.cart', 'store cart routes are customer-session state'],
|
|
47
|
+
['/wc/store/checkout*', 'wc.runtime.checkout', 'store checkout routes are customer-session state'],
|
|
48
|
+
['/wc/store/v1/cart*', 'wc.runtime.v1.cart', 'store cart routes are customer-session state'],
|
|
49
|
+
['/wc/store/v1/checkout*', 'wc.runtime.v1.checkout', 'store checkout routes are customer-session state'],
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const ADMIN_RULES = [
|
|
53
|
+
['/wc-admin/*', 'wc.admin.namespace', 'WooCommerce admin routes are dashboard surfaces'],
|
|
54
|
+
['/wc-analytics/*', 'wc.admin.analytics', 'WooCommerce analytics routes are dashboard/reporting surfaces'],
|
|
55
|
+
['/wc/v1/reports*', 'wc.admin.reports.v1', 'WooCommerce reports are analytics surfaces'],
|
|
56
|
+
['/wc/v2/reports*', 'wc.admin.reports.v2', 'WooCommerce reports are analytics surfaces'],
|
|
57
|
+
['/wc/v3/reports*', 'wc.admin.reports.v3', 'WooCommerce reports are analytics surfaces'],
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const MARKETPLACE_RULES = [
|
|
61
|
+
['/wc/v3/marketplace/*', 'wc.setup.marketplace', 'WooCommerce marketplace routes are setup surfaces'],
|
|
62
|
+
['/wc/v3/system_status*', 'wc.setup.system-status', 'WooCommerce system status routes are operational diagnostics'],
|
|
63
|
+
['/wc/v3/settings', 'wc.setup.settings', 'WooCommerce settings are setup/configuration surfaces'],
|
|
64
|
+
['/wc/v3/wc_paypal/*', 'wc.setup.paypal', 'WooCommerce PayPal routes are provider setup surfaces'],
|
|
65
|
+
['/wc/v3/wc_stripe/*', 'wc.setup.stripe', 'WooCommerce Stripe routes are provider setup surfaces'],
|
|
66
|
+
['/wccom-site/*', 'wc.setup.wccom-site', 'WooCommerce.com routes are marketplace/setup surfaces'],
|
|
67
|
+
['/wc/gla/*', 'wc.setup.google-listings', 'Google Listings and Ads routes are setup/reporting surfaces'],
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const DIAGNOSTIC_RULES = [
|
|
71
|
+
['/wp-site-health/*', 'wp.diagnostics.site-health', 'site health routes are diagnostics'],
|
|
72
|
+
['/wp-abilities/*', 'wp.diagnostics.abilities', 'abilities routes are capability discovery'],
|
|
73
|
+
['/serviceapp/*', 'wp.diagnostics.serviceapp', 'service app routes are operational surfaces'],
|
|
74
|
+
['/vip/*', 'wp.diagnostics.vip', 'VIP routes are operational surfaces'],
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
const INTEGRATION_RULES = [
|
|
78
|
+
['/jetpack/*', 'wp.integration.jetpack', 'Jetpack routes are external service or site operations surfaces'],
|
|
79
|
+
['/post-smtp/*', 'wp.integration.post-smtp', 'SMTP routes are mail operations surfaces'],
|
|
80
|
+
['/redirection/*', 'wp.integration.redirection', 'redirection routes are operational helper surfaces'],
|
|
81
|
+
['/yoast/*', 'wp.integration.yoast', 'SEO helper routes are outside backend data scope'],
|
|
82
|
+
['/klaviyo/*', 'wp.integration.klaviyo', 'marketing integration routes are outside backend data scope'],
|
|
83
|
+
['/kb-fluentcrm/*', 'wp.integration.fluentcrm', 'marketing integration routes are outside backend data scope'],
|
|
84
|
+
['/kb-getresponse/*', 'wp.integration.getresponse', 'marketing integration routes are outside backend data scope'],
|
|
85
|
+
['/kb-mailerlite/*', 'wp.integration.mailerlite', 'marketing integration routes are outside backend data scope'],
|
|
86
|
+
['/kb-design-library/*', 'wp.integration.design-library', 'design library routes are presentation helpers'],
|
|
87
|
+
['/kbp/*', 'wp.integration.kbp', 'AI or pattern helper routes are outside backend data scope'],
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
const BACKEND_DATA_RULES = [
|
|
91
|
+
['/wp/v2/posts', 'wp.data.posts', 'posts are durable content records'],
|
|
92
|
+
['/wp/v2/media', 'wp.data.media', 'media are durable asset records'],
|
|
93
|
+
['/wp/v2/categories', 'wp.data.categories', 'categories are durable taxonomy records'],
|
|
94
|
+
['/wp/v2/tags', 'wp.data.tags', 'tags are durable taxonomy records'],
|
|
95
|
+
['/wp/v2/comments', 'wp.data.comments', 'comments are durable content records'],
|
|
96
|
+
['/wc/v3/products/attributes*', 'wc.data.product-attributes', 'WooCommerce product attributes are canonical store data'],
|
|
97
|
+
['/wc/v3/products/categories*', 'wc.data.product-categories', 'WooCommerce product categories are canonical store data'],
|
|
98
|
+
['/wc/v3/products/tags*', 'wc.data.product-tags', 'WooCommerce product tags are canonical store data'],
|
|
99
|
+
['/wc/v3/products/shipping_classes*', 'wc.data.shipping-classes', 'WooCommerce shipping classes are canonical store data'],
|
|
100
|
+
['/wc/v3/products*', 'wc.data.products', 'WooCommerce products are canonical store data'],
|
|
101
|
+
['/wc/v3/coupons*', 'wc.data.coupons', 'WooCommerce coupons are canonical store data'],
|
|
102
|
+
['/wc/v3/orders*', 'wc.data.orders', 'WooCommerce orders are canonical store data'],
|
|
103
|
+
['/wc/v3/refunds*', 'wc.data.refunds', 'WooCommerce refunds are canonical store data'],
|
|
104
|
+
['/wc/v3/customers*', 'wc.data.customers', 'WooCommerce customers are canonical store data'],
|
|
105
|
+
['/wc/v3/taxes*', 'wc.data.taxes', 'WooCommerce taxes are canonical store data'],
|
|
106
|
+
['/wc/v3/tax_classes*', 'wc.data.tax-classes', 'WooCommerce tax classes are canonical store data'],
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
const BACKEND_METADATA_RULES = [
|
|
110
|
+
{
|
|
111
|
+
pattern: '/wc/v3/data/currencies*',
|
|
112
|
+
ruleId: 'wc.metadata.currencies',
|
|
113
|
+
reason: 'currency metadata may be needed to interpret WooCommerce records',
|
|
114
|
+
requiredPatterns: ['/wc/v3/products*', '/wc/v3/orders*', '/wc/v3/coupons*'],
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
pattern: '/wc/v3/data/countries*',
|
|
118
|
+
ruleId: 'wc.metadata.countries',
|
|
119
|
+
reason: 'country metadata may be needed to interpret WooCommerce tax and customer records',
|
|
120
|
+
requiredPatterns: ['/wc/v3/customers*', '/wc/v3/taxes*', '/wc/v3/orders*'],
|
|
121
|
+
},
|
|
122
|
+
];
|
|
123
|
+
|
|
124
|
+
const KNOWN_PLUGIN_DATA_RULES = [
|
|
125
|
+
['/ssp/v1/*', 'plugin.data.ssp', 'Seriously Simple Podcasting routes expose durable podcast records'],
|
|
126
|
+
['/tribe/events/v1/events', 'plugin.data.tribe-events', 'events routes expose durable event records'],
|
|
127
|
+
['/wp/v2/tribe_events', 'plugin.data.wp-tribe-events', 'event custom post type routes expose durable event records'],
|
|
128
|
+
];
|
|
129
|
+
|
|
130
|
+
const LEGACY_WC_PREFIXES = [
|
|
131
|
+
'/wc/v1/products',
|
|
132
|
+
'/wc/v1/coupons',
|
|
133
|
+
'/wc/v1/orders',
|
|
134
|
+
'/wc/v1/refunds',
|
|
135
|
+
'/wc/v1/customers',
|
|
136
|
+
'/wc/v1/taxes',
|
|
137
|
+
'/wc/v1/tax_classes',
|
|
138
|
+
'/wc/v2/products',
|
|
139
|
+
'/wc/v2/coupons',
|
|
140
|
+
'/wc/v2/orders',
|
|
141
|
+
'/wc/v2/refunds',
|
|
142
|
+
'/wc/v2/customers',
|
|
143
|
+
'/wc/v2/taxes',
|
|
144
|
+
'/wc/v2/tax_classes',
|
|
145
|
+
];
|
|
146
|
+
|
|
147
|
+
function normalizeRoutePath(routePath) {
|
|
148
|
+
if (typeof routePath !== 'string' || routePath.length === 0) {
|
|
149
|
+
return '/';
|
|
150
|
+
}
|
|
151
|
+
return routePath.startsWith('/') ? routePath : `/${routePath}`;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function routeMatchesPattern(routePath, pattern) {
|
|
155
|
+
const route = normalizeRoutePath(routePath);
|
|
156
|
+
if (pattern.endsWith('/*')) {
|
|
157
|
+
const prefix = pattern.slice(0, -1);
|
|
158
|
+
return route.startsWith(prefix);
|
|
159
|
+
}
|
|
160
|
+
if (pattern.endsWith('*')) {
|
|
161
|
+
return route.startsWith(pattern.slice(0, -1));
|
|
162
|
+
}
|
|
163
|
+
return route === pattern;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function findMatchingRule(routePath, rules) {
|
|
167
|
+
for (const rule of rules) {
|
|
168
|
+
const [pattern, ruleId, reason] = rule;
|
|
169
|
+
if (routeMatchesPattern(routePath, pattern)) {
|
|
170
|
+
return { ruleId, reason };
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function actionForCategory(category) {
|
|
177
|
+
if (category === 'backend_data' || category === 'public_commerce_data') {
|
|
178
|
+
return 'sample';
|
|
179
|
+
}
|
|
180
|
+
if (category === 'backend_metadata') {
|
|
181
|
+
return 'metadata';
|
|
182
|
+
}
|
|
183
|
+
return 'skip';
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function makeClassification(candidate, category, reason, ruleId, extra = {}) {
|
|
187
|
+
return {
|
|
188
|
+
routePath: candidate.routePath,
|
|
189
|
+
namespace: candidate.namespace,
|
|
190
|
+
category,
|
|
191
|
+
reason,
|
|
192
|
+
ruleId,
|
|
193
|
+
sampleByDefault: category === 'backend_data',
|
|
194
|
+
canIncludeByOverride: category !== 'backend_data',
|
|
195
|
+
includedByOverride: false,
|
|
196
|
+
excludedByOverride: false,
|
|
197
|
+
effectiveAction: actionForCategory(category),
|
|
198
|
+
...extra,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function candidateHasCollectionShape(candidate) {
|
|
203
|
+
return Boolean(candidate.supportsPagination || candidate.getEndpoint?.args?.per_page || candidate.getEndpoint?.args?.page);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function hasSchema(candidate) {
|
|
207
|
+
return Boolean(candidate.getEndpoint?.schema || candidate.routeDefinition?.schema);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function classifyStoreCatalogRoute(candidate, routeSet, options = {}) {
|
|
211
|
+
const routePath = candidate.routePath;
|
|
212
|
+
let canonicalRoute = null;
|
|
213
|
+
let ruleId = null;
|
|
214
|
+
let reason = null;
|
|
215
|
+
|
|
216
|
+
if (routeMatchesPattern(routePath, '/wc/store/v1/products/categories*')) {
|
|
217
|
+
canonicalRoute = '/wc/v3/products/categories';
|
|
218
|
+
ruleId = 'wc.public-store.product-categories';
|
|
219
|
+
reason = 'WooCommerce Store API product categories expose durable public commerce taxonomy data';
|
|
220
|
+
} else if (routeMatchesPattern(routePath, '/wc/store/v1/products*')) {
|
|
221
|
+
canonicalRoute = '/wc/v3/products';
|
|
222
|
+
ruleId = 'wc.public-store.products';
|
|
223
|
+
reason = 'WooCommerce Store API products expose durable public commerce catalog data';
|
|
224
|
+
} else {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const commerceMode = options.commerceMode || 'authenticated';
|
|
229
|
+
if (commerceMode !== 'public' && routeSet.has(canonicalRoute)) {
|
|
230
|
+
return makeClassification(
|
|
231
|
+
candidate,
|
|
232
|
+
'excluded_unsupported',
|
|
233
|
+
`duplicated by canonical ${canonicalRoute} for authenticated/private commerce reads`,
|
|
234
|
+
'wc.public-store.duplicate',
|
|
235
|
+
{ duplicateOf: canonicalRoute },
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return makeClassification(candidate, 'public_commerce_data', reason, ruleId, {
|
|
240
|
+
canonicalRoute: routeSet.has(canonicalRoute) ? canonicalRoute : null,
|
|
241
|
+
commerceMode,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function classifyLegacyWooCommerceRoute(candidate, routeSet) {
|
|
246
|
+
const routePath = candidate.routePath;
|
|
247
|
+
const legacyPrefix = LEGACY_WC_PREFIXES.find((prefix) => routeMatchesPattern(routePath, `${prefix}*`));
|
|
248
|
+
if (!legacyPrefix) {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const canonicalRoute = routePath.replace(/^\/wc\/v[12]\//, '/wc/v3/');
|
|
253
|
+
if (routeSet.has(canonicalRoute)) {
|
|
254
|
+
return makeClassification(
|
|
255
|
+
candidate,
|
|
256
|
+
'excluded_unsupported',
|
|
257
|
+
`duplicated by canonical ${canonicalRoute}`,
|
|
258
|
+
'wc.duplicate.legacy-version',
|
|
259
|
+
{ duplicateOf: canonicalRoute },
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return makeClassification(
|
|
264
|
+
candidate,
|
|
265
|
+
'backend_data',
|
|
266
|
+
'legacy WooCommerce data route accepted because wc/v3 equivalent is unavailable',
|
|
267
|
+
'wc.data.legacy',
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function classifyBaseRoute(candidate, routeSet, options = {}) {
|
|
272
|
+
const routePath = candidate.routePath;
|
|
273
|
+
const ruleGroups = [
|
|
274
|
+
['excluded_frontend', FRONTEND_RULES],
|
|
275
|
+
['excluded_template_editor', TEMPLATE_EDITOR_RULES],
|
|
276
|
+
['excluded_runtime_session', RUNTIME_RULES],
|
|
277
|
+
['excluded_admin_dashboard', ADMIN_RULES],
|
|
278
|
+
['excluded_marketplace_setup', MARKETPLACE_RULES],
|
|
279
|
+
['excluded_diagnostics', DIAGNOSTIC_RULES],
|
|
280
|
+
['excluded_integration', INTEGRATION_RULES],
|
|
281
|
+
];
|
|
282
|
+
|
|
283
|
+
for (const [category, rules] of ruleGroups) {
|
|
284
|
+
const rule = findMatchingRule(routePath, rules);
|
|
285
|
+
if (rule) {
|
|
286
|
+
return makeClassification(candidate, category, rule.reason, rule.ruleId);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const storeCatalogClassification = classifyStoreCatalogRoute(candidate, routeSet, options);
|
|
291
|
+
if (storeCatalogClassification) {
|
|
292
|
+
return storeCatalogClassification;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const legacyWooCommerce = classifyLegacyWooCommerceRoute(candidate, routeSet);
|
|
296
|
+
if (legacyWooCommerce) {
|
|
297
|
+
return legacyWooCommerce;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
const dataRule = findMatchingRule(routePath, BACKEND_DATA_RULES);
|
|
301
|
+
if (dataRule) {
|
|
302
|
+
return makeClassification(candidate, 'backend_data', dataRule.reason, dataRule.ruleId);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const metadataRule = BACKEND_METADATA_RULES.find((rule) => routeMatchesPattern(routePath, rule.pattern));
|
|
306
|
+
if (metadataRule) {
|
|
307
|
+
return makeClassification(candidate, 'backend_metadata', metadataRule.reason, metadataRule.ruleId, {
|
|
308
|
+
requiredPatterns: metadataRule.requiredPatterns,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const pluginRule = findMatchingRule(routePath, KNOWN_PLUGIN_DATA_RULES);
|
|
313
|
+
if (pluginRule) {
|
|
314
|
+
return makeClassification(candidate, 'backend_data', pluginRule.reason, pluginRule.ruleId);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (candidate.namespace === 'wp/v2' && candidateHasCollectionShape(candidate) && hasSchema(candidate)) {
|
|
318
|
+
return makeClassification(
|
|
319
|
+
candidate,
|
|
320
|
+
'backend_data',
|
|
321
|
+
'wp/v2 collection route has persisted-record shape and is not otherwise excluded',
|
|
322
|
+
'wp.data.custom-collection',
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (candidateHasCollectionShape(candidate) && hasSchema(candidate)) {
|
|
327
|
+
return makeClassification(
|
|
328
|
+
candidate,
|
|
329
|
+
'backend_data',
|
|
330
|
+
'collection route has persisted-record REST shape and is not otherwise excluded',
|
|
331
|
+
'plugin.data.collection-shape',
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return makeClassification(
|
|
336
|
+
candidate,
|
|
337
|
+
'excluded_unsupported',
|
|
338
|
+
'route is not in the backend data allowlist and does not have an accepted collection shape',
|
|
339
|
+
'unsupported.default',
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function normalizeList(values) {
|
|
344
|
+
if (!Array.isArray(values)) {
|
|
345
|
+
return [];
|
|
346
|
+
}
|
|
347
|
+
return values.filter(Boolean).map(String);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function normalizeOverrides(overrides = {}) {
|
|
351
|
+
return {
|
|
352
|
+
includeRoutes: normalizeList(overrides.includeRoutes).map(normalizeRoutePath),
|
|
353
|
+
includeNamespaces: normalizeList(overrides.includeNamespaces),
|
|
354
|
+
includeExcludedCategories: normalizeList(overrides.includeExcludedCategories),
|
|
355
|
+
excludeRoutes: normalizeList(overrides.excludeRoutes).map(normalizeRoutePath),
|
|
356
|
+
overrideReason: overrides.overrideReason ? String(overrides.overrideReason) : null,
|
|
357
|
+
commerceMode: overrides.commerceMode === 'public' ? 'public' : 'authenticated',
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function isIncludedCategory(category, includeExcludedCategories) {
|
|
362
|
+
return includeExcludedCategories.includes(category) || includeExcludedCategories.includes('all');
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function finalizeMetadataActions(classifications) {
|
|
366
|
+
const sampledRoutes = classifications
|
|
367
|
+
.filter((classification) => classification.effectiveAction === 'sample')
|
|
368
|
+
.map((classification) => classification.routePath);
|
|
369
|
+
|
|
370
|
+
return classifications.map((classification) => {
|
|
371
|
+
if (classification.category !== 'backend_metadata' || classification.includedByOverride || classification.excludedByOverride) {
|
|
372
|
+
return classification;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const requiredPatterns = Array.isArray(classification.requiredPatterns) ? classification.requiredPatterns : [];
|
|
376
|
+
const hasRelatedSampledRoute = requiredPatterns.some((pattern) =>
|
|
377
|
+
sampledRoutes.some((routePath) => routeMatchesPattern(routePath, pattern)));
|
|
378
|
+
|
|
379
|
+
if (hasRelatedSampledRoute) {
|
|
380
|
+
return { ...classification, effectiveAction: 'metadata' };
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return {
|
|
384
|
+
...classification,
|
|
385
|
+
effectiveAction: 'skip',
|
|
386
|
+
sampleByDefault: false,
|
|
387
|
+
reason: `${classification.reason}; no related sampled backend route is in scope`,
|
|
388
|
+
};
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function classifyRoutes(candidates, overrides = {}) {
|
|
393
|
+
const normalizedOverrides = normalizeOverrides(overrides);
|
|
394
|
+
const routeSet = new Set(candidates.map((candidate) => candidate.routePath));
|
|
395
|
+
let classifications = candidates.map((candidate) => {
|
|
396
|
+
const classification = classifyBaseRoute(candidate, routeSet, normalizedOverrides);
|
|
397
|
+
|
|
398
|
+
if (normalizedOverrides.excludeRoutes.includes(candidate.routePath)) {
|
|
399
|
+
return {
|
|
400
|
+
...classification,
|
|
401
|
+
excludedByOverride: true,
|
|
402
|
+
includedByOverride: false,
|
|
403
|
+
effectiveAction: 'skip',
|
|
404
|
+
sampleByDefault: false,
|
|
405
|
+
overrideReason: normalizedOverrides.overrideReason,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const includeRoute = normalizedOverrides.includeRoutes.includes(candidate.routePath);
|
|
410
|
+
const includeCategory = isIncludedCategory(classification.category, normalizedOverrides.includeExcludedCategories);
|
|
411
|
+
if (includeRoute || includeCategory) {
|
|
412
|
+
return {
|
|
413
|
+
...classification,
|
|
414
|
+
includedByOverride: true,
|
|
415
|
+
effectiveAction: 'sample',
|
|
416
|
+
overrideReason: normalizedOverrides.overrideReason,
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return classification;
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
classifications = finalizeMetadataActions(classifications);
|
|
424
|
+
return classifications.sort((a, b) => a.routePath.localeCompare(b.routePath));
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function summarizeSkippedByCategory(classifications) {
|
|
428
|
+
const summary = {};
|
|
429
|
+
for (const classification of classifications) {
|
|
430
|
+
if (classification.effectiveAction !== 'skip') {
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
summary[classification.category] = (summary[classification.category] || 0) + 1;
|
|
434
|
+
}
|
|
435
|
+
return Object.fromEntries(Object.entries(summary).sort(([a], [b]) => a.localeCompare(b)));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
module.exports = {
|
|
439
|
+
ROUTE_CATEGORIES,
|
|
440
|
+
classifyRoutes,
|
|
441
|
+
normalizeOverrides,
|
|
442
|
+
routeMatchesPattern,
|
|
443
|
+
summarizeSkippedByCategory,
|
|
444
|
+
};
|