@wix/agent-skills 1.15.0 → 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 +5 -1
- 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 +6 -4
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +28 -7
- package/skills/wix-app/references/SERVICE_PLUGIN.md +12 -10
- package/skills/wix-app/references/STORES_VERSIONING.md +9 -211
- package/skills/wix-app/references/app-tools/TOOLS.md +75 -0
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +5 -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 +172 -0
- 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-PREVIEW.md +57 -0
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +33 -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 +4 -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/CATEGORIES.md +22 -0
- package/skills/wix-app/references/stores/GET_PRODUCT.md +99 -0
- package/skills/wix-app/references/stores/INVENTORY.md +37 -0
- package/skills/wix-app/references/stores/QUERY.md +119 -0
- package/skills/wix-app/references/stores/WRITE.md +55 -0
- package/skills/wix-docs/SKILL.md +35 -3
- package/skills/wix-headless/SKILL.md +9 -2
- package/skills/wix-headless/entry/bootstrap.mjs +2 -2
- package/skills/wix-headless/entry/skill.md +0 -2
- package/skills/wix-headless/references/CAPABILITIES.md +6 -4
- 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 +25 -1
- package/skills/wix-headless/references/FEEDBACK.md +16 -5
- package/skills/wix-headless/references/IMAGE_GENERATION.md +10 -0
- package/skills/wix-headless/references/SDK_HANDOFF.md +2 -0
- package/skills/wix-headless/references/SEED.md +3 -1
- package/skills/wix-headless/references/SETUP.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-restaurant-reservations.md +42 -2
- package/skills/wix-headless/references/inline-recipes/setup-bookings.md +5 -1
- package/skills/wix-headless/references/inline-recipes/setup-forms.md +1 -1
- package/skills/wix-headless/references/inline-recipes/setup-online-store.md +33 -8
- package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +3 -1
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-experiences.md +73 -0
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +38 -2
- package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +20 -1
- package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +1 -1
- package/skills/wix-headless/references/managed/CONNECT.md +2 -2
- package/skills/wix-headless/references/managed/CREATE.md +15 -1
- package/skills/wix-headless/references/managed/DEPLOYMENT.md +47 -0
- package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +8 -0
- package/skills/wix-headless/references/stripe/DEPLOYMENT.md +8 -0
- package/skills/wix-manage/SKILL.md +131 -12
- package/skills/wix-manage/references/analytics/analytics-dashboard-navigation.md +41 -0
- package/skills/wix-manage/references/analytics/query-site-analytics.md +66 -9
- package/skills/wix-manage/references/app-installation/app-installation-dashboard-navigation.md +28 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +3 -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/create-booking-service-from-prompt.md +6 -5
- package/skills/wix-manage/references/bookings/create-course-service.md +30 -5
- package/skills/wix-manage/references/bookings/diagnose-availability-issues.md +85 -42
- 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 +33 -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/get-paid/how-to-setup-wix-payments.md +30 -7
- 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/create-and-publish-social-post.md +225 -144
- package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +19 -10
- 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 +243 -0
- 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/create-product-from-image.md +8 -6
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +16 -10
- 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 +54 -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 +26 -0
- package/skills/wix-vibe-headless/platforms/base44.md +177 -0
- package/skills/wix-vibe-headless/platforms/generic.md +122 -0
- 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 -145
- 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} +90 -12
- 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} +3 -2
- 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/{wix-portfolio.js → app/rest/wix-portfolio.js} +84 -55
- 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 -148
- 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} +25 -2
- 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/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,256 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rp-source-wordpress
|
|
3
|
+
description: >-
|
|
4
|
+
WordPress and WooCommerce source adapter: REST capture, auth, pagination, and read
|
|
5
|
+
contract for codegen. Use when the source platform is WordPress or WooCommerce.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# rp-source-wordpress
|
|
9
|
+
|
|
10
|
+
WordPress / WooCommerce **source adapter**. Owns every WordPress-specific detail the
|
|
11
|
+
platform-agnostic skills must not hardcode: how to capture the schema, how to read the
|
|
12
|
+
data, auth models, pagination, and REST quirks.
|
|
13
|
+
|
|
14
|
+
## When this skill is used
|
|
15
|
+
|
|
16
|
+
This is not a stage in the migration flow — it is a reference consulted by two stages:
|
|
17
|
+
|
|
18
|
+
- **`rp-discovery`** consults the *Capture* section to sample the source and produce the
|
|
19
|
+
canonical `source-profile.md` + `source-schema.json`.
|
|
20
|
+
- **`rp-import-codegen`** consults the *Read contract* section to generate a reader that
|
|
21
|
+
bulk-extracts WordPress data correctly (auth, pagination, `wc/v3` vs `wp/v2`) into
|
|
22
|
+
durable project-local files for the later import step.
|
|
23
|
+
|
|
24
|
+
`rp-execute-import` never consults this skill — by the time execution runs, the
|
|
25
|
+
WordPress-specific knowledge is already baked into the generated reader code. Keeping the
|
|
26
|
+
WordPress knowledge here is what lets the rest of the workflow stay platform-agnostic.
|
|
27
|
+
|
|
28
|
+
## Platform identity
|
|
29
|
+
|
|
30
|
+
- Source platform: WordPress (core REST `wp/v2`), optionally WooCommerce (`wc/v3`).
|
|
31
|
+
- Detect by hitting `<base-url>/wp-json/` — the REST index lists advertised namespaces.
|
|
32
|
+
- Set `"platform": "wordpress"` (and note WooCommerce presence in `sourceMeta`) in the
|
|
33
|
+
emitted `source-schema.json`.
|
|
34
|
+
|
|
35
|
+
## Capture (discovery-time)
|
|
36
|
+
|
|
37
|
+
Sampling the source to learn its shape — **not** a bulk export.
|
|
38
|
+
|
|
39
|
+
The Wix domain knowledge base may be used as a classifier supplement during synthesis,
|
|
40
|
+
but not as a sampling mandate. When a discovered WordPress/WooCommerce route matches a
|
|
41
|
+
known alias, annotate the emitted entity with `sourceMeta.candidateTargetRefs[]`; do not
|
|
42
|
+
turn that hint into a target decision here. Keep frontend, theme, runtime, admin, and
|
|
43
|
+
transient routes skipped by default even if a knowledge entry exists for a related
|
|
44
|
+
setup/config target.
|
|
45
|
+
|
|
46
|
+
Before capture, verify `migrations/<project>/config/source.wordpress.env`. Create it if
|
|
47
|
+
missing, using empty values for the user to fill:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
WP_BASE_URL=
|
|
51
|
+
WP_USERNAME=
|
|
52
|
+
WP_APPLICATION_PASSWORD=
|
|
53
|
+
WP_MEDIA_URL_REWRITE_FROM=
|
|
54
|
+
WP_MEDIA_URL_REWRITE_TO=
|
|
55
|
+
WC_CONSUMER_KEY=
|
|
56
|
+
WC_CONSUMER_SECRET=
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Before requesting any WordPress / WooCommerce credentials for a URL-based migration, ask
|
|
60
|
+
the user which data scope they want:
|
|
61
|
+
|
|
62
|
+
- `public content only`
|
|
63
|
+
- `also include private/authenticated data`
|
|
64
|
+
|
|
65
|
+
This choice is mandatory and must be explicit. Do not ask for `WP_USERNAME`,
|
|
66
|
+
`WP_APPLICATION_PASSWORD`, or WooCommerce keys until the user chooses `also include
|
|
67
|
+
private/authenticated data`.
|
|
68
|
+
|
|
69
|
+
Required for a complete WordPress/WooCommerce capture:
|
|
70
|
+
|
|
71
|
+
- `WP_BASE_URL`
|
|
72
|
+
- `WP_USERNAME`
|
|
73
|
+
- `WP_APPLICATION_PASSWORD`
|
|
74
|
+
|
|
75
|
+
`WC_CONSUMER_KEY` and `WC_CONSUMER_SECRET` are optional when WooCommerce accepts the
|
|
76
|
+
WordPress Application Password for `wc/v3` reads; ask for them only if WooCommerce routes
|
|
77
|
+
return 401/403 with the WordPress Application Password.
|
|
78
|
+
|
|
79
|
+
`WP_MEDIA_URL_REWRITE_FROM` and `WP_MEDIA_URL_REWRITE_TO` are optional. Use them when the
|
|
80
|
+
WordPress API is reached through a public tunnel but media/file URLs inside records still
|
|
81
|
+
point at `localhost` or another private origin. If they are blank, generated readers may
|
|
82
|
+
rewrite localhost/private origins to `WP_BASE_URL` when `WP_BASE_URL` is public.
|
|
83
|
+
|
|
84
|
+
`config/source.wordpress.env` is a secret-bearing file once it may contain real values.
|
|
85
|
+
Do not read it with whole-file commands that print its contents into tool output. Check
|
|
86
|
+
only whether the file exists and whether each required key is present/blank/missing; when
|
|
87
|
+
describing status, name keys only and never echo values.
|
|
88
|
+
|
|
89
|
+
1. Run the deterministic capture script **from this skill's directory** (the folder
|
|
90
|
+
containing this `SKILL.md`; see `CONVENTIONS.md`):
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
node scripts/wp-discovery.js --base-url <url> --out-dir <migrations-root>/<project>/data/wp-discovery
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
It walks the REST index, runs one `OPTIONS` + a small `GET` sample per entity, and
|
|
97
|
+
writes per-entity markdown (routes, schemas, sample records, record counts,
|
|
98
|
+
relationships). Pass auth options (see Read contract → Auth) for a complete capture.
|
|
99
|
+
For long runs, pass `--progress-log <path>` and poll it per
|
|
100
|
+
`CONVENTIONS.md#progress-log-polling`.
|
|
101
|
+
|
|
102
|
+
2. If the user chose `public content only`, run unauthenticated and keep the scope framed
|
|
103
|
+
as public-only. Do not pivot into asking for credentials unless the user changes scope.
|
|
104
|
+
|
|
105
|
+
3. **Credentials are required for a complete capture.** Without auth, only published
|
|
106
|
+
public content is reachable; drafts, WooCommerce (`wc/v3`), user PII, and private
|
|
107
|
+
fields return 401/403, making their `recordCount`/`inUse` unreliable. The script flags
|
|
108
|
+
this in its README under "Incomplete Capture (Authentication)" — do not treat an
|
|
109
|
+
unauthenticated run as authoritative.
|
|
110
|
+
|
|
111
|
+
**Author identity is a specific casualty of public-only capture.** Public
|
|
112
|
+
`/wp/v2/users` lists only users who authored public posts and exposes **no `roles`
|
|
113
|
+
and no emails** — admin vs editor vs contributor vs subscriber is indistinguishable.
|
|
114
|
+
Roles/capabilities require `context=edit` (App Password with `list_users`) or a DB
|
|
115
|
+
dump (`wp_usermeta` → `wp_capabilities`); WXR exports carry author login/email/display
|
|
116
|
+
name but no roles either. Vanilla WP has no guest-byline concept (every byline is a
|
|
117
|
+
user); plugin guest authors (Co-Authors Plus `guest-author` entities) are separate
|
|
118
|
+
non-user records. Record author capture mode in the source profile — it determines the
|
|
119
|
+
blog `authorAttributionMode` downstream (public-only → fallback/owner attribution;
|
|
120
|
+
authenticated → per-author mapping: administrators → owner user-member,
|
|
121
|
+
content roles → per-author members; subscribers/customers → **Wix contacts by
|
|
122
|
+
default** — a contact is the no-login CRM person entity and Contacts V5 upserts in
|
|
123
|
+
bulk — promote to full site members (MEM-01: 1/sec serial, re-registration) only when
|
|
124
|
+
member-gated features are in scope. Every Wix member auto-creates its contact, so
|
|
125
|
+
member-first ordering: never pre-create a contact for someone who will become a
|
|
126
|
+
member. Note contacts cannot author blog posts or comments — bylines need members).
|
|
127
|
+
|
|
128
|
+
4. Distinguish **supported** entities (advertised by the REST index) from **used**
|
|
129
|
+
entities (those with `recordCount > 0`). Entities advertised but empty should be
|
|
130
|
+
flagged, not mapped as if they hold data.
|
|
131
|
+
|
|
132
|
+
5. **Backend data scope.** The capture script classifies REST routes before per-route
|
|
133
|
+
`OPTIONS` or sample `GET` requests. By default it samples backend data routes and skips
|
|
134
|
+
frontend, theme/editor, runtime session, admin dashboard, diagnostics, marketplace
|
|
135
|
+
setup, and integration/helper APIs. It writes the skipped-route audit trail to
|
|
136
|
+
`skipped-routes.json`.
|
|
137
|
+
|
|
138
|
+
For WooCommerce, prefer canonical durable data APIs such as `wc/v3` over duplicated
|
|
139
|
+
`wc/v2`/`wc/v1` routes for authenticated/private commerce reads. For `public content only`
|
|
140
|
+
discovery, probe public Store API catalog routes before declaring commerce deferred:
|
|
141
|
+
`wc/store/v1/products` and `wc/store/v1/products/categories` are in-scope public
|
|
142
|
+
commerce data when present. Cart and checkout Store API routes remain out of scope as
|
|
143
|
+
runtime session state.
|
|
144
|
+
|
|
145
|
+
6. Map known plugins to entity types where relevant (e.g. WooCommerce → store,
|
|
146
|
+
Seriously Simple Podcasting `ssp/v1` → podcasts, Yoast → SEO, ACF → custom fields).
|
|
147
|
+
|
|
148
|
+
7. **Localhost sources and media URLs.** A source at `localhost`, `127.0.0.1`, or another
|
|
149
|
+
private-only host is valid for discovery and source reads from the user's machine.
|
|
150
|
+
However, Wix Media import fetches files from the URL using Wix servers, so media URLs
|
|
151
|
+
like `http://localhost:8090/wp-content/uploads/...` are not reachable by Wix during a
|
|
152
|
+
live import. This is optional setup and, as far as we know today, only affects media
|
|
153
|
+
import:
|
|
154
|
+
- Prefer exposing the local source through a temporary public HTTPS tunnel such as
|
|
155
|
+
ngrok before live media import.
|
|
156
|
+
- Or explicitly skip/defer media import and continue with non-media entities.
|
|
157
|
+
- If using ngrok on macOS:
|
|
158
|
+
1. Install: `brew install ngrok`
|
|
159
|
+
2. Add an authtoken from the ngrok dashboard:
|
|
160
|
+
`ngrok config add-authtoken "<YOUR_AUTHTOKEN>"`
|
|
161
|
+
3. Expose the local source port, for example: `ngrok http 8090`
|
|
162
|
+
4. Set the source base URL to the HTTPS forwarding URL:
|
|
163
|
+
`export WP_BASE_URL=https://<id>.ngrok-free.app`
|
|
164
|
+
Record this in `source-profile.md` when the captured source URL is localhost, and note
|
|
165
|
+
whether media will use the tunnel or be skipped/deferred.
|
|
166
|
+
|
|
167
|
+
The raw capture is evidence, not a hand-off artifact. `rp-discovery` synthesizes it into
|
|
168
|
+
the canonical artifacts and records traceability pointers (`rawDiscovery`, per-entity
|
|
169
|
+
`rawFile`).
|
|
170
|
+
|
|
171
|
+
## Read contract (codegen-time)
|
|
172
|
+
|
|
173
|
+
What a generated WordPress reader must get right. Capture the operational facts below into
|
|
174
|
+
`source-profile.md` during discovery so codegen has them without re-deriving.
|
|
175
|
+
|
|
176
|
+
The generated reader is an **extractor**, not an in-memory bulk loader. It should fetch
|
|
177
|
+
WordPress/WooCommerce records page by page and write them to project-local files (for
|
|
178
|
+
example per-entity paged JSON files plus a manifest) so the import step can read from
|
|
179
|
+
disk later without re-fetching the source.
|
|
180
|
+
|
|
181
|
+
**Reuse the shared transport — do not regenerate it.** The auth, URL building, rate-limit
|
|
182
|
+
throttling, and `Retry-After`-aware 429/503 backoff a reader needs already exist as a
|
|
183
|
+
dependency-free module at `lib/wp-http.js` in **this skill directory** (the same module
|
|
184
|
+
the capture script imports). It
|
|
185
|
+
exports `fetchJson`, `buildHeaders`, `configureRateLimit`, and `parseTotalHeader`. Any
|
|
186
|
+
generated WordPress reader **must reuse this module rather than reimplementing transport**,
|
|
187
|
+
so the reader contains only per-project orchestration: which entities to pull, the
|
|
188
|
+
pagination loop, `_embed`/`_links` resolution, and transform glue. One tested transport
|
|
189
|
+
core is what makes the sampler and the reader behave identically. *How* the module is
|
|
190
|
+
carried into a runnable migration project is `rp-import-codegen`'s concern (its File
|
|
191
|
+
targets), not this adapter's. The notes below describe what the reader does *on top of*
|
|
192
|
+
that shared core:
|
|
193
|
+
|
|
194
|
+
- **Namespaces & auth differ per namespace:**
|
|
195
|
+
- `wp/v2` (core): HTTP Basic auth with a WordPress **Application Password**
|
|
196
|
+
(`--username` + `--application-password`).
|
|
197
|
+
- `wc/v3` (WooCommerce): **consumer key / secret**, sent as Basic auth over HTTPS (or
|
|
198
|
+
as query params on some hosts). This is a different credential from the Application
|
|
199
|
+
Password — both may be needed for a full migration.
|
|
200
|
+
- **Pagination:** `?page=N&per_page=M` (max `per_page` is typically 100). Total pages are
|
|
201
|
+
in the `X-WP-TotalPages` response header and total records in `X-WP-Total` — read
|
|
202
|
+
those rather than guessing when to stop. Some public WooCommerce Store API collection
|
|
203
|
+
routes paginate without `X-WP-TotalPages`; when that header is absent, generated readers
|
|
204
|
+
must stop on the first page whose item count is smaller than `per_page`.
|
|
205
|
+
- **Embedded relations:** request `?_embed` to inline related resources, or follow the
|
|
206
|
+
`_links` block (`author`, `wp:featuredmedia`, `wp:term`) to resolve relations. The
|
|
207
|
+
`evidence` pointers in `source-schema.json` relations come from this `_links` block.
|
|
208
|
+
- **Hierarchical taxonomies:** WordPress categories (and custom hierarchical taxonomies)
|
|
209
|
+
carry a `parent` field on each term (`0` = top-level). When **any** term has a non-zero
|
|
210
|
+
`parent`, the source taxonomy is nested. Discovery must elevate this into structured
|
|
211
|
+
schema — set `"hierarchical": true` on that entity in `source-schema.json` (see
|
|
212
|
+
`source-schema.example.json` → `category`) rather than leaving `parent` buried in the raw
|
|
213
|
+
dump. The Wix Blog category target is flat (no parent/child), so this flag is what triggers the
|
|
214
|
+
mapper's mandatory lossiness entry; without it, the flatten happens silently.
|
|
215
|
+
- **Rate limits / retries:** not advertised; the capture script throttles
|
|
216
|
+
(`--rate-limit-rpm`, default 120) and backs off on 429/503 honoring `Retry-After`.
|
|
217
|
+
Generated readers should inherit the same discipline.
|
|
218
|
+
- **Rich content:** `content.rendered` / `title.rendered` are HTML; `*.raw` requires
|
|
219
|
+
`context=edit` (authenticated). Note which the reader should pull.
|
|
220
|
+
- **HTML entities in "plain text" fields (trap, hit live 2026-07-19):** WordPress returns
|
|
221
|
+
HTML-encoded entities (`–`, `&`, `’`, …) not only in rendered HTML but
|
|
222
|
+
also in fields consumed as plain text — product/category/tag `name`, `title.rendered`
|
|
223
|
+
after tag-stripping, excerpts, even SKUs. Values sent to plain-text Wix fields (product
|
|
224
|
+
name, blog title, tag label, CMS text columns) must be entity-decoded by the generated
|
|
225
|
+
transforms or the encoded form appears verbatim in the Wix dashboard. HTML passed to
|
|
226
|
+
rich-content conversion does NOT need pre-decoding — the converter handles entities.
|
|
227
|
+
- **Custom fields:** ACF / meta often appear in sample records but are absent from the
|
|
228
|
+
`OPTIONS` schema — surface them as `unknowns` in discovery so the mapper can decide.
|
|
229
|
+
- **WooCommerce variation attribute values are URL-encoded slugs, not display names (trap, hit live 2026-07-21):**
|
|
230
|
+
`variations[].attributes[].value` from `wc/v3/products/{id}/variations` is a URL-encoded
|
|
231
|
+
taxonomy-term slug (e.g. `1-%d7%a7%d7%92` for `1 ק"ג`), not the human-readable display
|
|
232
|
+
name that the product's `attributes[].options[]` array contains. Generated readers must
|
|
233
|
+
build a per-option slug→displayName map from the parent product's `attributes[].options[]`
|
|
234
|
+
(which does carry display names) and resolve slug values to display names before writing to
|
|
235
|
+
Wix. Passing slugs directly causes `MISSING_VARIANT_OPTION_CHOICE` because Wix compares
|
|
236
|
+
variant choice names against option choice names and finds no match.
|
|
237
|
+
- **WooCommerce "Any"-style variations have null attribute values (trap, hit live 2026-07-21):**
|
|
238
|
+
When a WooCommerce variation is set to "Any" for an option (the variation applies to any
|
|
239
|
+
value of that option), `variations[].attributes[].value` is an empty string or null, not a
|
|
240
|
+
specific term. Generated transforms that filter variants by attribute value will silently
|
|
241
|
+
drop "Any" variants, leaving options with no variants — Wix then auto-generates priceless
|
|
242
|
+
placeholder variants, causing price-empty errors. Fix: when ALL attributes for a variation
|
|
243
|
+
are null/"Any", treat the variation as a single cartesian entry covering all option choices
|
|
244
|
+
at the variation's price, rather than filtering it out.
|
|
245
|
+
- **Route paths passed to `fetchJson` / `buildApiUrl` must NOT include `/wp-json` (trap, hit live 2026-07-21):**
|
|
246
|
+
`buildApiUrl` in `lib/wp-http.js` already prepends `/wp-json` to the `routePath` argument.
|
|
247
|
+
Generated route paths must start with the namespace directly (e.g. `/wc/store/v1/products`,
|
|
248
|
+
`/wp/v2/posts`) — never with `/wp-json/...`. Prefixing with `/wp-json` doubles the prefix
|
|
249
|
+
and produces 404s.
|
|
250
|
+
|
|
251
|
+
## Schema shape
|
|
252
|
+
|
|
253
|
+
`source-schema.example.json` (in this skill folder) is the template `rp-discovery` follows
|
|
254
|
+
when emitting `migrations/<project>/source-schema.json`. It is a shape to follow, not a
|
|
255
|
+
strict schema to validate against. Keep the platform-agnostic core stable; push WordPress
|
|
256
|
+
quirks (`restNamespace`, statuses, etc.) into each entity's open `sourceMeta` blob.
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Shared WordPress REST transport core.
|
|
4
|
+
//
|
|
5
|
+
// This module is the single source of truth for the operational discipline a
|
|
6
|
+
// WordPress reader must get right: auth header construction, URL building,
|
|
7
|
+
// rate-limit throttling, and Retry-After-aware backoff on 429/503. It is
|
|
8
|
+
// imported by:
|
|
9
|
+
// - scripts/wp-discovery.js (discovery-time sampling), and
|
|
10
|
+
// - the bulk-extract reader generated by rp-import-codegen, which vendors a
|
|
11
|
+
// copy of this file into the migration project so the project stays
|
|
12
|
+
// self-contained.
|
|
13
|
+
//
|
|
14
|
+
// Keep this file dependency-free (Node built-ins / global fetch only) so the
|
|
15
|
+
// vendored copy needs no install step.
|
|
16
|
+
|
|
17
|
+
const DEFAULT_TIMEOUT_MS = 60000;
|
|
18
|
+
const DEFAULT_RATE_LIMIT_RPM = 120;
|
|
19
|
+
const DEFAULT_MAX_RETRIES = 3;
|
|
20
|
+
const MAX_BACKOFF_MS = 30000;
|
|
21
|
+
|
|
22
|
+
// Shared throttle state. Every request routes through fetchJson, so a single
|
|
23
|
+
// module-level throttle enforces the rate limit across the whole run.
|
|
24
|
+
const rateState = { minIntervalMs: 0, lastRequestAt: 0, maxRetries: DEFAULT_MAX_RETRIES };
|
|
25
|
+
|
|
26
|
+
function sleep(ms) {
|
|
27
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Configure the shared throttle. Call once before issuing requests.
|
|
31
|
+
function configureRateLimit({ rateLimitRpm = DEFAULT_RATE_LIMIT_RPM, maxRetries = DEFAULT_MAX_RETRIES } = {}) {
|
|
32
|
+
const rpm = Number.isFinite(rateLimitRpm) && rateLimitRpm >= 1 ? rateLimitRpm : DEFAULT_RATE_LIMIT_RPM;
|
|
33
|
+
rateState.minIntervalMs = Math.ceil(60000 / rpm);
|
|
34
|
+
rateState.maxRetries = Number.isFinite(maxRetries) && maxRetries >= 0 ? maxRetries : DEFAULT_MAX_RETRIES;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function applyThrottle(progress) {
|
|
38
|
+
if (rateState.minIntervalMs <= 0) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const elapsed = Date.now() - rateState.lastRequestAt;
|
|
42
|
+
const wait = rateState.minIntervalMs - elapsed;
|
|
43
|
+
if (wait > 0) {
|
|
44
|
+
if (progress) {
|
|
45
|
+
await progress.withHeartbeat({ phase: 'discovery', step: 'rate-limit', message: 'Still waiting for WordPress rate limit' }, () => sleep(wait));
|
|
46
|
+
} else {
|
|
47
|
+
await sleep(wait);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
rateState.lastRequestAt = Date.now();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function retryAfterMs(responseHeaders) {
|
|
54
|
+
const raw = responseHeaders?.['retry-after'];
|
|
55
|
+
if (!raw) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const seconds = Number.parseInt(raw, 10);
|
|
59
|
+
return Number.isFinite(seconds) ? seconds * 1000 : null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function buildHeaders(args) {
|
|
63
|
+
const headers = new Headers();
|
|
64
|
+
headers.set('accept', 'application/json');
|
|
65
|
+
|
|
66
|
+
for (const rawHeader of args.authHeaders || []) {
|
|
67
|
+
const splitIndex = rawHeader.indexOf(':');
|
|
68
|
+
if (splitIndex === -1) {
|
|
69
|
+
throw new Error(`Invalid --auth-header value: ${rawHeader}`);
|
|
70
|
+
}
|
|
71
|
+
const name = rawHeader.slice(0, splitIndex).trim();
|
|
72
|
+
const value = rawHeader.slice(splitIndex + 1).trim();
|
|
73
|
+
headers.set(name, value);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (args.username && args.applicationPassword) {
|
|
77
|
+
const credentials = Buffer.from(`${args.username}:${args.applicationPassword}`).toString('base64');
|
|
78
|
+
headers.set('authorization', `Basic ${credentials}`);
|
|
79
|
+
} else if (args.apiKey) {
|
|
80
|
+
const headerName = args.apiKeyHeader || 'Authorization';
|
|
81
|
+
const headerValue = headerName.toLowerCase() === 'authorization' && !/^bearer\s+/i.test(args.apiKey)
|
|
82
|
+
? `Bearer ${args.apiKey}`
|
|
83
|
+
: args.apiKey;
|
|
84
|
+
headers.set(headerName, headerValue);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return headers;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function normalizeBaseUrl(input) {
|
|
91
|
+
return input.replace(/\/+$/, '');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function buildApiUrl(baseUrl, routePath, query = {}) {
|
|
95
|
+
const url = new URL(`${normalizeBaseUrl(baseUrl)}/wp-json${routePath}`);
|
|
96
|
+
for (const [key, value] of Object.entries(query)) {
|
|
97
|
+
if (value === undefined || value === null || value === '') {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
url.searchParams.set(key, String(value));
|
|
101
|
+
}
|
|
102
|
+
return url;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async function fetchJson(baseUrl, routePath, { headers, method = 'GET', query, timeoutMs = DEFAULT_TIMEOUT_MS, progress = null, progressContext = {} }) {
|
|
106
|
+
const url = buildApiUrl(baseUrl, routePath, query);
|
|
107
|
+
|
|
108
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
109
|
+
await applyThrottle(progress);
|
|
110
|
+
const controller = new AbortController();
|
|
111
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
const response = progress
|
|
115
|
+
? await progress.withHeartbeat({
|
|
116
|
+
phase: 'discovery',
|
|
117
|
+
step: 'wordpress-request',
|
|
118
|
+
...progressContext,
|
|
119
|
+
message: `Still waiting on WordPress ${method} ${routePath || '/'}`,
|
|
120
|
+
}, () => fetch(url, {
|
|
121
|
+
method,
|
|
122
|
+
headers,
|
|
123
|
+
signal: controller.signal,
|
|
124
|
+
}))
|
|
125
|
+
: await fetch(url, {
|
|
126
|
+
method,
|
|
127
|
+
headers,
|
|
128
|
+
signal: controller.signal,
|
|
129
|
+
});
|
|
130
|
+
const text = await response.text();
|
|
131
|
+
const responseHeaders = Object.fromEntries(response.headers.entries());
|
|
132
|
+
|
|
133
|
+
// Back off and retry on throttling / transient unavailability,
|
|
134
|
+
// honoring Retry-After when the server provides it.
|
|
135
|
+
if ((response.status === 429 || response.status === 503) && attempt < rateState.maxRetries) {
|
|
136
|
+
const backoff = retryAfterMs(responseHeaders) ?? Math.min(MAX_BACKOFF_MS, 1000 * 2 ** attempt);
|
|
137
|
+
if (progress) {
|
|
138
|
+
progress.warn(`WordPress ${response.status} response; backing off before retry`, {
|
|
139
|
+
phase: 'discovery',
|
|
140
|
+
step: 'wordpress-retry',
|
|
141
|
+
...progressContext,
|
|
142
|
+
count: attempt + 1,
|
|
143
|
+
total: rateState.maxRetries,
|
|
144
|
+
unit: 'retries',
|
|
145
|
+
});
|
|
146
|
+
await progress.withHeartbeat({
|
|
147
|
+
phase: 'discovery',
|
|
148
|
+
step: 'wordpress-retry',
|
|
149
|
+
...progressContext,
|
|
150
|
+
message: `Still backing off after WordPress ${response.status}`,
|
|
151
|
+
}, () => sleep(backoff));
|
|
152
|
+
} else {
|
|
153
|
+
await sleep(backoff);
|
|
154
|
+
}
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
let json;
|
|
159
|
+
if (text) {
|
|
160
|
+
try {
|
|
161
|
+
json = JSON.parse(text);
|
|
162
|
+
} catch {
|
|
163
|
+
json = undefined;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
ok: response.ok,
|
|
169
|
+
status: response.status,
|
|
170
|
+
statusText: response.statusText,
|
|
171
|
+
url: url.toString(),
|
|
172
|
+
headers: responseHeaders,
|
|
173
|
+
json,
|
|
174
|
+
text,
|
|
175
|
+
retries: attempt,
|
|
176
|
+
};
|
|
177
|
+
} catch (error) {
|
|
178
|
+
return {
|
|
179
|
+
ok: false,
|
|
180
|
+
status: 0,
|
|
181
|
+
statusText: error.name === 'AbortError' ? 'Request Timeout' : error.message,
|
|
182
|
+
url: url.toString(),
|
|
183
|
+
headers: {},
|
|
184
|
+
json: undefined,
|
|
185
|
+
text: '',
|
|
186
|
+
error,
|
|
187
|
+
retries: attempt,
|
|
188
|
+
};
|
|
189
|
+
} finally {
|
|
190
|
+
clearTimeout(timeout);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Total record count for a collection. WordPress returns it in X-WP-Total;
|
|
196
|
+
// X-WP-TotalPages carries the page count. Header names are lowercased by fetch's
|
|
197
|
+
// Headers iterator, but accept the canonical casing too for resilience.
|
|
198
|
+
function parseTotalHeader(responseHeaders, name = 'x-wp-total') {
|
|
199
|
+
if (!responseHeaders) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
// fetch's Headers iterator lowercases names, but match case-insensitively so a
|
|
203
|
+
// plain object built with WordPress's canonical casing (X-WP-Total) also works.
|
|
204
|
+
const target = name.toLowerCase();
|
|
205
|
+
let raw;
|
|
206
|
+
for (const [key, value] of Object.entries(responseHeaders)) {
|
|
207
|
+
if (key.toLowerCase() === target) {
|
|
208
|
+
raw = value;
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (raw === undefined || raw === null || raw === '') {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
const total = Number.parseInt(raw, 10);
|
|
216
|
+
return Number.isFinite(total) ? total : null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function parseTotalPagesHeader(responseHeaders) {
|
|
220
|
+
return parseTotalHeader(responseHeaders, 'x-wp-totalpages');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function shouldContinueCollectionPaging({ responseHeaders, page, perPage, itemCount }) {
|
|
224
|
+
const totalPages = parseTotalPagesHeader(responseHeaders);
|
|
225
|
+
if (totalPages !== null) {
|
|
226
|
+
return Number(page) < totalPages;
|
|
227
|
+
}
|
|
228
|
+
if (Number.isFinite(perPage) && perPage > 0) {
|
|
229
|
+
return Number(itemCount) >= perPage;
|
|
230
|
+
}
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
module.exports = {
|
|
235
|
+
DEFAULT_TIMEOUT_MS,
|
|
236
|
+
DEFAULT_RATE_LIMIT_RPM,
|
|
237
|
+
DEFAULT_MAX_RETRIES,
|
|
238
|
+
MAX_BACKOFF_MS,
|
|
239
|
+
sleep,
|
|
240
|
+
configureRateLimit,
|
|
241
|
+
retryAfterMs,
|
|
242
|
+
buildHeaders,
|
|
243
|
+
normalizeBaseUrl,
|
|
244
|
+
buildApiUrl,
|
|
245
|
+
fetchJson,
|
|
246
|
+
parseTotalHeader,
|
|
247
|
+
parseTotalPagesHeader,
|
|
248
|
+
shouldContinueCollectionPaging,
|
|
249
|
+
};
|