@wix/agent-skills 1.15.1 → 1.16.1
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 +42 -8
- 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 +143 -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/COMPONENT-CONFIGURATION.md +60 -0
- 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 +24 -7
- 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/editor-react-component/SITE-CONTEXT-HOOKS.md +187 -0
- 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-app/scripts/scan-a11y-code.cjs +777 -0
- package/skills/wix-app/scripts/scan-a11y-eslint.cjs +201 -0
- package/skills/wix-docs/SKILL.md +35 -3
- package/skills/wix-headless/SKILL.md +3 -1
- package/skills/wix-headless/references/CAPABILITIES.md +16 -3
- 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/SDK_HANDOFF.md +1 -1
- package/skills/wix-headless/references/SEED.md +1 -1
- package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +3 -2
- package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +560 -102
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +210 -143
- 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 +130 -7
- package/skills/wix-manage/references/accessibility/scan-site-accessibility.md +98 -0
- package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +40 -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 +217 -192
- 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 +49 -25
- package/skills/wix-vibe-headless/install/deploy.cjs +156 -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 +111 -101
- package/skills/wix-vibe-headless/platforms/generic.md +99 -64
- package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +226 -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 +256 -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 +168 -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 +223 -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 +272 -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 +229 -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 +236 -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 +244 -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 +8 -0
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +259 -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 +338 -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,187 @@
|
|
|
1
|
+
# Site Context Hooks
|
|
2
|
+
|
|
3
|
+
Rules and patterns for reading **runtime site context** in Editor React
|
|
4
|
+
components — the site's page tree, the current URL, the language direction, and
|
|
5
|
+
editor mode. None of these can be carried by a prop.
|
|
6
|
+
|
|
7
|
+
All of them come from hooks in `@wix/react-component-utils`, already a base
|
|
8
|
+
dependency. No additional install is needed, but the hooks require
|
|
9
|
+
`@wix/react-component-utils` ≥ 1.12.0.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## When this applies
|
|
14
|
+
|
|
15
|
+
Apply only when the component genuinely needs live site context:
|
|
16
|
+
|
|
17
|
+
- **The component reflects where the visitor is in the site** — breadcrumbs,
|
|
18
|
+
"you are here" indicators. Not navigation menus: the site owner authors those,
|
|
19
|
+
and their items need not necessarily be site pages, so they take a
|
|
20
|
+
`MenuItems` prop
|
|
21
|
+
- **The component needs the page's own URL** — share buttons, copy-link,
|
|
22
|
+
canonical links, QR codes
|
|
23
|
+
- **Language direction drives JavaScript** — keyboard navigation, transform or
|
|
24
|
+
animation math, conditional rendering
|
|
25
|
+
- **Behavior must differ inside the editor** — suppressing autoplay, network
|
|
26
|
+
calls, or timers while the site owner is designing
|
|
27
|
+
|
|
28
|
+
The test is whether the site owner **authors** the data. A hook reports state the
|
|
29
|
+
owner cannot write — which page is being rendered, what the site's URL is. Data
|
|
30
|
+
the owner chooses belongs in props, even when it happens to point at site
|
|
31
|
+
pages — see [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md) and
|
|
32
|
+
[`COMPONENT-API.md`](COMPONENT-API.md). Purely visual RTL needs no hook
|
|
33
|
+
either — use logical CSS properties, see
|
|
34
|
+
[`DIRECTIONALITY.md`](DIRECTIONALITY.md).
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Rules
|
|
39
|
+
|
|
40
|
+
### The Available Hooks
|
|
41
|
+
|
|
42
|
+
| Hook | Returns | Use for |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| `usePages()` | `Readonly<Record<string, PageConfig>>` | Every page on the site, keyed by page id |
|
|
45
|
+
| `useCurrentPageId()` | `string` | Id of the page being rendered |
|
|
46
|
+
| `useMainPageId()` | `string` | Id of the site's homepage |
|
|
47
|
+
| `useSiteUrl()` | `string` | The site's public base URL |
|
|
48
|
+
| `useCurrentUrl()` | `string` | Full URL of the page being rendered |
|
|
49
|
+
| `useLanguageDirection()` | `'ltr' \| 'rtl'` | The site's language direction |
|
|
50
|
+
| `useIsEditMode()` | `boolean` | `true` in editor design mode — see [`COMPONENT-PREVIEW.md`](COMPONENT-PREVIEW.md) |
|
|
51
|
+
| `useReducedMotion()` | `boolean` | `true` when the OS requests reduced motion — see [`ANIMATED-COMPONENTS.md`](ANIMATED-COMPONENTS.md) |
|
|
52
|
+
|
|
53
|
+
All import from the same place:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { usePages, useCurrentPageId, useSiteUrl } from '@wix/react-component-utils';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Each returns a plain value, so there is nothing to unwrap or guard. They are
|
|
60
|
+
React hooks — call them at the top of the component or hook body, never at module
|
|
61
|
+
scope, inside a callback, or conditionally.
|
|
62
|
+
|
|
63
|
+
### Read Values During Render
|
|
64
|
+
|
|
65
|
+
Hook values are read on the server too, so their results are part of the server
|
|
66
|
+
markup — see [`SSR.md`](SSR.md). Use the value directly.
|
|
67
|
+
|
|
68
|
+
**✅ Correct:**
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const siteUrl = useSiteUrl();
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**❌ Wrong — empty on the server, then a hydration mismatch:**
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
const resolvedUrl = useSiteUrl();
|
|
78
|
+
const [siteUrl, setSiteUrl] = useState('');
|
|
79
|
+
useEffect(() => setSiteUrl(resolvedUrl), []);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Patterns
|
|
85
|
+
|
|
86
|
+
### Walking the Page Tree
|
|
87
|
+
|
|
88
|
+
`usePages()` returns a map keyed by page id. Three things to get right:
|
|
89
|
+
|
|
90
|
+
- **The map key is the page id** — the values carry no `id` field.
|
|
91
|
+
- **`parentPageId` is absent for top-level pages** — treat those as children of
|
|
92
|
+
`useMainPageId()` when walking upward.
|
|
93
|
+
- **`popup: true` pages are lightboxes**, not navigable pages. Filter them out of
|
|
94
|
+
breadcrumbs, menus, and page pickers.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { usePages, useCurrentPageId, useMainPageId } from '@wix/react-component-utils';
|
|
98
|
+
|
|
99
|
+
export const useBreadcrumbTrail = (): Array<{ id: string; label: string }> => {
|
|
100
|
+
const pages = usePages();
|
|
101
|
+
const currentPageId = useCurrentPageId();
|
|
102
|
+
const mainPageId = useMainPageId();
|
|
103
|
+
|
|
104
|
+
const trail: Array<{ id: string; label: string }> = [];
|
|
105
|
+
const visited = new Set<string>();
|
|
106
|
+
let pageId: string | undefined = currentPageId;
|
|
107
|
+
|
|
108
|
+
while (pageId && !visited.has(pageId) && pages[pageId]) {
|
|
109
|
+
visited.add(pageId);
|
|
110
|
+
const page = pages[pageId]!;
|
|
111
|
+
if (!page.popup) {
|
|
112
|
+
trail.push({ id: pageId, label: page.title });
|
|
113
|
+
}
|
|
114
|
+
// Pages without parentPageId are top-level children of the homepage.
|
|
115
|
+
pageId = pageId === mainPageId ? undefined : (page.parentPageId ?? mainPageId);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return trail.reverse();
|
|
119
|
+
};
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The `visited` set is not optional — a misconfigured site can produce a parent
|
|
123
|
+
cycle, and an unguarded walk hangs the render.
|
|
124
|
+
|
|
125
|
+
### Building a Link to a Page
|
|
126
|
+
|
|
127
|
+
Join a page's `path` onto `useSiteUrl()`. The base URL may or may not carry a
|
|
128
|
+
trailing slash, so normalize before joining:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
const buildPageUrl = (path: string, siteUrl: string): string => {
|
|
132
|
+
const base = siteUrl.replace(/\/$/, '');
|
|
133
|
+
return path ? `${base}/${path}` : base;
|
|
134
|
+
};
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Direction-Dependent Logic
|
|
138
|
+
|
|
139
|
+
Resolve the component's own `direction` prop first, then fall back to the site:
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
import type { Direction } from '@wix/editor-react-types';
|
|
143
|
+
import { useLanguageDirection } from '@wix/react-component-utils';
|
|
144
|
+
|
|
145
|
+
export const useResolvedDirection = (direction?: Direction): Direction => {
|
|
146
|
+
// Call unconditionally — `direction ?? useLanguageDirection()` would
|
|
147
|
+
// short-circuit and skip the hook whenever the prop is set.
|
|
148
|
+
const siteDirection = useLanguageDirection() as Direction;
|
|
149
|
+
return direction ?? siteDirection;
|
|
150
|
+
};
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Use the resolved value for **logic only** — arrow-key handling, transform sign,
|
|
154
|
+
scroll direction:
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
const isRTL = useResolvedDirection(direction) === 'rtl';
|
|
158
|
+
|
|
159
|
+
const onKeyDown = (event: React.KeyboardEvent) => {
|
|
160
|
+
const forward = isRTL ? 'ArrowLeft' : 'ArrowRight';
|
|
161
|
+
if (event.key === forward) {
|
|
162
|
+
focusNext();
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Common Mistake: Direction Logic Instead of Logical CSS
|
|
170
|
+
|
|
171
|
+
Calling `useLanguageDirection()` to pick between physical CSS properties.
|
|
172
|
+
|
|
173
|
+
**❌ Wrong:**
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
const isRTL = useLanguageDirection() === 'rtl';
|
|
177
|
+
|
|
178
|
+
<div style={{ paddingLeft: isRTL ? 0 : 8, paddingRight: isRTL ? 8 : 0 }} />
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**✅ Correct:**
|
|
182
|
+
|
|
183
|
+
```scss
|
|
184
|
+
.element {
|
|
185
|
+
padding-inline-start: 8px; // Auto RTL/LTR, no hook needed
|
|
186
|
+
}
|
|
187
|
+
```
|
|
@@ -31,27 +31,31 @@ This example sorts staff members to balance workload by prioritizing those with
|
|
|
31
31
|
```typescript
|
|
32
32
|
import { staffSorting } from "@wix/bookings/service-plugins";
|
|
33
33
|
import { auth } from "@wix/essentials";
|
|
34
|
-
import {
|
|
34
|
+
import { extendedBookings } from "@wix/bookings";
|
|
35
35
|
|
|
36
36
|
staffSorting.provideHandlers({
|
|
37
37
|
sortStaffMembers: async (payload) => {
|
|
38
38
|
const { request } = payload;
|
|
39
39
|
const { availableResourceIds, slot } = request;
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
const elevatedQuery = auth.elevate(
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString();
|
|
42
|
+
const elevatedQuery = auth.elevate(extendedBookings.query);
|
|
43
|
+
const result = await elevatedQuery({
|
|
44
|
+
filter: {
|
|
45
|
+
"bookedEntity.item.slot.resource.id": { "$in": availableResourceIds },
|
|
46
|
+
"startDate": { "$gte": sevenDaysAgo },
|
|
47
|
+
},
|
|
48
|
+
cursorPaging: { limit: 100 },
|
|
49
|
+
});
|
|
50
|
+
const recentBookings = result.extendedBookings ?? [];
|
|
47
51
|
|
|
48
52
|
// Count bookings per staff member
|
|
49
53
|
const bookingCounts = new Map<string, number>();
|
|
50
54
|
for (const id of availableResourceIds) {
|
|
51
55
|
bookingCounts.set(id, 0);
|
|
52
56
|
}
|
|
53
|
-
for (const booking of recentBookings
|
|
54
|
-
const resourceId = booking.resource?.
|
|
57
|
+
for (const booking of recentBookings) {
|
|
58
|
+
const resourceId = booking.booking?.bookedEntity?.slot?.resource?._id;
|
|
55
59
|
if (resourceId && bookingCounts.has(resourceId)) {
|
|
56
60
|
bookingCounts.set(resourceId, (bookingCounts.get(resourceId) ?? 0) + 1);
|
|
57
61
|
}
|
|
@@ -69,6 +69,10 @@ customTriggers.provideHandlers({
|
|
|
69
69
|
});
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
## Singular Constraint
|
|
73
|
+
|
|
74
|
+
`ECOM_DISCOUNTS_TRIGGER` is **singular** — only one component of this type is allowed per app. Do not scaffold or include two Discount Triggers service plugins in the same app.
|
|
75
|
+
|
|
72
76
|
## Key Implementation Notes
|
|
73
77
|
|
|
74
78
|
1. **Trigger IDs must match** - The `customTriggerId` in `getEligibleTriggers` must match an `_id` from `listTriggers`
|
|
@@ -67,6 +67,10 @@ giftVouchersProvider.provideHandlers({
|
|
|
67
67
|
});
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
## Singular Constraint
|
|
71
|
+
|
|
72
|
+
`GIFT_CARDS_PROVIDER` is **singular** — only one component of this type is allowed per app. Do not scaffold or include two Gift Cards service plugins in the same app.
|
|
73
|
+
|
|
70
74
|
## Key Implementation Notes
|
|
71
75
|
|
|
72
76
|
1. **All three handlers required** - You must implement `redeem`, `getBalance`, and `_void`
|
|
@@ -26,7 +26,7 @@ paymentSettings.provideHandlers({
|
|
|
26
26
|
getPaymentSettings: async ({ request, metadata }) => {
|
|
27
27
|
try {
|
|
28
28
|
// Get the order total
|
|
29
|
-
const orderTotal = request.order?.
|
|
29
|
+
const orderTotal = Number(request.order?.priceSummary?.total?.amount) || 0;
|
|
30
30
|
|
|
31
31
|
// Determine if 3DS is required based on order value
|
|
32
32
|
const require3DS = orderTotal >= HIGH_VALUE_THRESHOLD;
|
|
@@ -45,6 +45,7 @@ paymentSettings.provideHandlers({
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
+
getPaymentSettingsForCheckout: async () => ({ blockedPaymentOptions: [] }),
|
|
48
49
|
});
|
|
49
50
|
```
|
|
50
51
|
|
|
@@ -83,6 +84,7 @@ paymentSettings.provideHandlers({
|
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
},
|
|
87
|
+
getPaymentSettingsForCheckout: async () => ({ blockedPaymentOptions: [] }),
|
|
86
88
|
});
|
|
87
89
|
```
|
|
88
90
|
|
|
@@ -53,6 +53,10 @@ shippingRates.provideHandlers({
|
|
|
53
53
|
});
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
## Singular Constraint
|
|
57
|
+
|
|
58
|
+
`ECOM_SHIPPING_RATES` is **singular** — only one component of this type is allowed per app. Do not scaffold or include two Shipping Rates service plugins in the same app.
|
|
59
|
+
|
|
56
60
|
## Key Implementation Notes
|
|
57
61
|
|
|
58
62
|
1. **Price as string** - All price values must be strings, not numbers
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Tools Provider Service Plugin Reference
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Tools Provider SPI lets your app handle tool invocations from the Wix AI assistant. Implement the `runTool` handler — it receives the tool's `methodName` and a JSON `payload`, runs your business logic, and returns a response the AI assistant uses to answer the user.
|
|
6
|
+
|
|
7
|
+
This is the execution side of the App Tools feature. The declaration side lives in the `APP_TOOLS` extension. See [APP_TOOLS.md](../APP_TOOLS.md) for the full picture.
|
|
8
|
+
|
|
9
|
+
## Request and Response Schema
|
|
10
|
+
|
|
11
|
+
Before implementing, call `ReadFullDocsMethodSchema` on the docs URL to get the full request/response types.
|
|
12
|
+
|
|
13
|
+
| Handler | Docs URL |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `runTool` | https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-provider-v1/run-tool?apiView=SDK |
|
|
16
|
+
|
|
17
|
+
## Example: Routing Tool Calls by methodName
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { toolsProvider } from '@wix/app-tools/service-plugins';
|
|
21
|
+
|
|
22
|
+
toolsProvider.provideHandlers({
|
|
23
|
+
runTool: async ({ request, metadata }) => {
|
|
24
|
+
const { methodName, payload } = request;
|
|
25
|
+
|
|
26
|
+
switch (methodName) {
|
|
27
|
+
case 'get-order-status': {
|
|
28
|
+
const orderId = payload?.['orderId'];
|
|
29
|
+
if (typeof orderId !== 'string' || !orderId) {
|
|
30
|
+
throw new Error('orderId is required');
|
|
31
|
+
}
|
|
32
|
+
// fetch order status...
|
|
33
|
+
return {
|
|
34
|
+
response: {
|
|
35
|
+
status: 'shipped',
|
|
36
|
+
trackingNumber: 'TRACK123'
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
default:
|
|
42
|
+
throw new Error(`Unknown tool: ${methodName}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Key Implementation Notes
|
|
49
|
+
|
|
50
|
+
1. **Route on `methodName`** — use a `switch` or map to dispatch to the right handler logic
|
|
51
|
+
2. **Validate inputs defensively** — `requestSchema` is advisory for the AI assistant; Wix does not validate the payload before calling your handler
|
|
52
|
+
3. **Handle all activated tools** — cover every `methodName` with `activated: true` in your `APP_TOOLS` declaration; unhandled names should throw a clear error
|
|
53
|
+
4. **Respond quickly** — the AI assistant is waiting; slow responses degrade the user experience
|
|
54
|
+
5. **Elevate permissions for Wix API calls** — wrap SDK methods with `auth.elevate` from `@wix/essentials`
|
|
@@ -60,6 +60,38 @@ export async function listProductsPage(
|
|
|
60
60
|
|
|
61
61
|
---
|
|
62
62
|
|
|
63
|
+
## Search products by name
|
|
64
|
+
|
|
65
|
+
V3 `queryProducts` filters only on `_id`, `slug`, `options.id` and `handle` — `name` is a
|
|
66
|
+
compile error. Use `productsV3.searchProducts()`, a direct call rather than a builder. V1 has
|
|
67
|
+
no search method; its builder accepts `name` via `startsWith` (prefix match only, no `fuzzy`).
|
|
68
|
+
|
|
69
|
+
Imports come from the first example in this file.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// `v` comes from getVersion() — see STORES_VERSIONING.md.
|
|
73
|
+
export async function searchByName(
|
|
74
|
+
term: string,
|
|
75
|
+
limit: number,
|
|
76
|
+
v: 'V1_CATALOG' | 'V3_CATALOG' | 'STORES_NOT_INSTALLED',
|
|
77
|
+
) {
|
|
78
|
+
if (v === 'V3_CATALOG') {
|
|
79
|
+
const res = await productsV3.searchProducts({
|
|
80
|
+
cursorPaging: { limit },
|
|
81
|
+
// `fields` is required for free-text search. Searchable: 'name', 'description',
|
|
82
|
+
// 'variantsInfo.variants.sku', 'minVariantPriceInfo.sku'.
|
|
83
|
+
search: { expression: term, fields: ['name'], fuzzy: true },
|
|
84
|
+
});
|
|
85
|
+
// Note `products` (not `items`) and `pagingMetadata.hasNext` (a property, not a method).
|
|
86
|
+
return res.products ?? [];
|
|
87
|
+
}
|
|
88
|
+
const res = await products.queryProducts().startsWith('name', term).limit(limit).find();
|
|
89
|
+
return res.items;
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
63
95
|
## Display price/stock without fetching variants
|
|
64
96
|
|
|
65
97
|
V3 `queryProducts` does not return variants. Read product-level rollup fields instead:
|