@wix/agent-skills 1.33.1 → 1.34.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 +2 -0
- package/package.json +1 -1
- package/skills/wix-export/SKILL.md +83 -0
- package/skills/wix-harmony-editor/.publish-manifest.json +8 -0
- package/skills/wix-harmony-editor/COPY-SITE.md +494 -0
- package/skills/wix-harmony-editor/SKILL.md +317 -0
- package/skills/wix-harmony-editor/scripts/copy/build-description.mjs +249 -0
- package/skills/wix-harmony-editor/scripts/copy/check-description.mjs +225 -0
- package/skills/wix-harmony-editor/scripts/copy/check-mirror.mjs +89 -0
- package/skills/wix-harmony-editor/scripts/copy/compare-preview.mjs +76 -0
- package/skills/wix-harmony-editor/scripts/copy/deploy-description.mjs +212 -0
- package/skills/wix-harmony-editor/scripts/copy/desc-hash.mjs +44 -0
- package/skills/wix-harmony-editor/scripts/copy/editor-run.mjs +45 -0
- package/skills/wix-harmony-editor/scripts/copy/export-page.mjs +53 -0
- package/skills/wix-harmony-editor/scripts/copy/find-interactions.mjs +76 -0
- package/skills/wix-harmony-editor/scripts/copy/hide-scrollbars.mjs +16 -0
- package/skills/wix-harmony-editor/scripts/copy/import-media.mjs +150 -0
- package/skills/wix-harmony-editor/scripts/copy/link-url.mjs +27 -0
- package/skills/wix-harmony-editor/scripts/copy/lint-api.mjs +56 -0
- package/skills/wix-harmony-editor/scripts/copy/measure-source.mjs +211 -0
- package/skills/wix-harmony-editor/scripts/copy/merge-mirrors.mjs +29 -0
- package/skills/wix-harmony-editor/scripts/copy/mirror-site.mjs +92 -0
- package/skills/wix-harmony-editor/scripts/copy/mobile-stage.mjs +56 -0
- package/skills/wix-harmony-editor/scripts/copy/preview-widths.mjs +73 -0
- package/skills/wix-harmony-editor/scripts/copy/render-plate.mjs +67 -0
- package/skills/wix-harmony-editor/scripts/copy/serve-mirror.mjs +102 -0
- package/skills/wix-harmony-editor/scripts/copy/snapshot-capabilities.mjs +40 -0
- package/skills/wix-harmony-editor/scripts/copy/split-sections.mjs +191 -0
- package/skills/wix-harmony-editor/scripts/copy/upload-media-manager.mjs +61 -0
- package/skills/wix-harmony-editor/scripts/launch.sh +359 -0
- package/skills/wix-headless/SKILL.md +7 -2
- package/skills/wix-headless/references/CAPABILITIES.md +6 -1
- package/skills/wix-headless/references/DISCOVERY.md +2 -1
- package/skills/wix-headless/references/SDK_HANDOFF.md +6 -1
- package/skills/wix-headless/references/SEED.md +3 -2
- package/skills/wix-headless/references/SETUP.md +1 -0
- package/skills/wix-headless/references/inline-recipes/experience-donations.md +102 -0
- package/skills/wix-headless/references/inline-recipes/how-to-code-donations.md +146 -0
- package/skills/wix-headless/references/inline-recipes/setup-donations.md +15 -0
- package/skills/wix-headless/references/managed/CREATE.md +1 -1
- package/skills/wix-headless-kit/SKILL.md +110 -21
- package/skills/wix-headless-kit/guides/api-run.md +15 -13
- package/skills/wix-headless-kit/guides/existing-site.md +31 -0
- package/skills/wix-headless-kit/guides/migration.md +49 -17
- package/skills/wix-headless-kit/install/agents-md.mjs +1 -1
- package/skills/wix-headless-kit/install/context.mjs +61 -6
- package/skills/wix-headless-kit/install/pins.json +1 -1
- package/skills/wix-headless-kit/install/setup.mjs +107 -12
- package/skills/wix-headless-replatform/.publish-manifest.json +8 -0
- package/skills/wix-headless-replatform/SKILL.md +116 -0
- package/skills/wix-headless-replatform/agents/openai.yaml +6 -0
- package/skills/wix-headless-replatform/references/control-and-visual-fidelity-contract.md +43 -0
- package/skills/wix-headless-replatform/references/extraction-schema.md +187 -0
- package/skills/wix-headless-replatform/references/interaction-runtime-contract.md +137 -0
- package/skills/wix-headless-replatform/references/layout-blueprint-contract.md +41 -0
- package/skills/wix-headless-replatform/references/output-contract.md +93 -0
- package/skills/wix-headless-replatform/references/post-build-gap-contract.md +125 -0
- package/skills/wix-headless-replatform/references/qa-checklist.md +83 -0
- package/skills/wix-headless-replatform/references/safety.md +19 -0
- package/skills/wix-headless-replatform/references/ui-normalization-contract.md +70 -0
- package/skills/wix-headless-replatform/references/workflow.md +157 -0
- package/skills/wix-headless-replatform/registry/README.md +20 -0
- package/skills/wix-headless-replatform/registry/approvals/button/shadcn-default-ac60ef5.json +28 -0
- package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/button.tsx +54 -0
- package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/capabilities.json +60 -0
- package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/contract.md +48 -0
- package/skills/wix-headless-replatform/registry/licenses/shadcn-ui-ac60ef5-MIT.txt +21 -0
- package/skills/wix-headless-replatform/registry/registry.json +36 -0
- package/skills/wix-headless-replatform/resources/rp-facelift/SKILL.md +32 -0
- package/skills/wix-headless-replatform/resources/rp-project-context/SKILL.md +62 -0
- package/skills/wix-headless-replatform/resources/rp-qa-gap-loop/SKILL.md +64 -0
- package/skills/wix-headless-replatform/resources/rp-source-evidence/SKILL.md +42 -0
- package/skills/wix-headless-replatform/resources/rp-ui-implementation/SKILL.md +73 -0
- package/skills/wix-headless-replatform/schemas/build-plan.schema.json +10 -0
- package/skills/wix-headless-replatform/schemas/candidate.schema.json +19 -0
- package/skills/wix-headless-replatform/schemas/common.schema.json +33 -0
- package/skills/wix-headless-replatform/schemas/decision-patch.schema.json +10 -0
- package/skills/wix-headless-replatform/schemas/decision-request.schema.json +10 -0
- package/skills/wix-headless-replatform/schemas/extraction-gap.schema.json +28 -0
- package/skills/wix-headless-replatform/schemas/extraction-manifest.schema.json +34 -0
- package/skills/wix-headless-replatform/schemas/final-report.schema.json +10 -0
- package/skills/wix-headless-replatform/schemas/foundation.schema.json +11 -0
- package/skills/wix-headless-replatform/schemas/metadata.schema.json +11 -0
- package/skills/wix-headless-replatform/schemas/observation-packet.schema.json +17 -0
- package/skills/wix-headless-replatform/schemas/page-capture.schema.json +11 -0
- package/skills/wix-headless-replatform/schemas/page-resolution.schema.json +33 -0
- package/skills/wix-headless-replatform/schemas/shared-chrome.schema.json +11 -0
- package/skills/wix-headless-replatform/schemas/unit.schema.json +40 -0
- package/skills/wix-headless-replatform/scripts/assemble-extraction.mjs +844 -0
- package/skills/wix-headless-replatform/scripts/benchmark-extraction.mjs +163 -0
- package/skills/wix-headless-replatform/scripts/browser-extraction-preflight.mjs +42 -0
- package/skills/wix-headless-replatform/scripts/build-extracted-homepage.mjs +228 -0
- package/skills/wix-headless-replatform/scripts/clear-wix-starter.mjs +87 -0
- package/skills/wix-headless-replatform/scripts/create-wix-project.mjs +505 -0
- package/skills/wix-headless-replatform/scripts/discover-urls.mjs +142 -0
- package/skills/wix-headless-replatform/scripts/extract-assets.mjs +140 -0
- package/skills/wix-headless-replatform/scripts/extract-design-system.mjs +637 -0
- package/skills/wix-headless-replatform/scripts/extract-interactions.mjs +1903 -0
- package/skills/wix-headless-replatform/scripts/extract-page.mjs +2461 -0
- package/skills/wix-headless-replatform/scripts/extract-seo.mjs +25 -0
- package/skills/wix-headless-replatform/scripts/extract-tokens.mjs +63 -0
- package/skills/wix-headless-replatform/scripts/finalize-extraction-report.mjs +126 -0
- package/skills/wix-headless-replatform/scripts/finalize-gap-review.mjs +180 -0
- package/skills/wix-headless-replatform/scripts/finalize-gap-review.test.mjs +98 -0
- package/skills/wix-headless-replatform/scripts/finalize-migration-website.mjs +103 -0
- package/skills/wix-headless-replatform/scripts/generate-control-state-contract.mjs +176 -0
- package/skills/wix-headless-replatform/scripts/generate-design-md.mjs +261 -0
- package/skills/wix-headless-replatform/scripts/generate-extraction-validators.mjs +25 -0
- package/skills/wix-headless-replatform/scripts/generate-invoice-download-backend.mjs +342 -0
- package/skills/wix-headless-replatform/scripts/generate-layout-blueprint.mjs +140 -0
- package/skills/wix-headless-replatform/scripts/generate-repeater-cms.mjs +22 -0
- package/skills/wix-headless-replatform/scripts/generate-route-plan.mjs +143 -0
- package/skills/wix-headless-replatform/scripts/generate-scene-contract.mjs +288 -0
- package/skills/wix-headless-replatform/scripts/generate-ui-normalization.mjs +266 -0
- package/skills/wix-headless-replatform/scripts/generate-visual-assets.mjs +111 -0
- package/skills/wix-headless-replatform/scripts/lib/browser-tooling.mjs +570 -0
- package/skills/wix-headless-replatform/scripts/lib/common.mjs +329 -0
- package/skills/wix-headless-replatform/scripts/lib/component-capabilities.mjs +121 -0
- package/skills/wix-headless-replatform/scripts/lib/component-registry.mjs +282 -0
- package/skills/wix-headless-replatform/scripts/lib/content-boundary.mjs +61 -0
- package/skills/wix-headless-replatform/scripts/lib/extraction-contract.mjs +374 -0
- package/skills/wix-headless-replatform/scripts/lib/extraction-detectors.mjs +243 -0
- package/skills/wix-headless-replatform/scripts/lib/extraction-validators.generated.mjs +1139 -0
- package/skills/wix-headless-replatform/scripts/lib/font-contract.mjs +326 -0
- package/skills/wix-headless-replatform/scripts/lib/frontend-automation-state.mjs +184 -0
- package/skills/wix-headless-replatform/scripts/lib/gap-analysis.mjs +396 -0
- package/skills/wix-headless-replatform/scripts/lib/html-extract.mjs +168 -0
- package/skills/wix-headless-replatform/scripts/lib/interaction-bootstrap.mjs +10 -0
- package/skills/wix-headless-replatform/scripts/lib/interaction-runtime.mjs +194 -0
- package/skills/wix-headless-replatform/scripts/lib/interaction-timeline.mjs +348 -0
- package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/classifiers.mjs +141 -0
- package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/geometry.mjs +43 -0
- package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/vocabulary.mjs +18 -0
- package/skills/wix-headless-replatform/scripts/lib/ui-normalization.css +64 -0
- package/skills/wix-headless-replatform/scripts/optimize-svg.mjs +31 -0
- package/skills/wix-headless-replatform/scripts/post-build-gap.mjs +358 -0
- package/skills/wix-headless-replatform/scripts/provision-repeater-cms.mjs +25 -0
- package/skills/wix-headless-replatform/scripts/record-gap-decision.mjs +39 -0
- package/skills/wix-headless-replatform/scripts/replay-extraction.mjs +107 -0
- package/skills/wix-headless-replatform/scripts/resolve-home-page.mjs +96 -0
- package/skills/wix-headless-replatform/scripts/site-clone.mjs +658 -0
- package/skills/wix-headless-replatform/scripts/validate-font-contract.mjs +29 -0
- package/skills/wix-headless-replatform/scripts/verify-interactions.mjs +669 -0
- package/skills/wix-headless-replatform/scripts/visual-qa.mjs +370 -0
- package/skills/wix-headless-templates/donations/INSTRUCTIONS.md +37 -24
- package/skills/wix-headless-templates/donations/app/components/donations/DonateForm.tsx +49 -23
- package/skills/wix-headless-templates/donations/app/components/donations/DonationReceipt.tsx +6 -5
- package/skills/wix-headless-templates/donations/app/components/donations/GoalProgress.tsx +5 -5
- package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +7 -3
- package/skills/wix-headless-templates/donations/app/wix/donations/donation-store.ts +2 -2
- package/skills/wix-headless-templates/donations/app/wix/donations/donations-core.ts +12 -9
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonateForm.tsx +49 -23
- package/skills/wix-headless-templates/donations/project/src/components/donations/DonationReceipt.tsx +6 -5
- package/skills/wix-headless-templates/donations/project/src/components/donations/GoalProgress.tsx +5 -5
- package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +7 -3
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donation-store.ts +2 -2
- package/skills/wix-headless-templates/donations/project/src/wix/donations/donations-core.ts +12 -9
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/rest/donate.ts +7 -3
- package/skills/wix-headless-templates/donations/seed/SEED.md +12 -7
- package/skills/wix-headless-templates/donations/tests/donation-contract.test.mjs +71 -0
- package/skills/wix-headless-templates/donations/tests/donation-form.test.cjs +137 -0
- package/skills/wix-headless-templates/restaurants/INSTRUCTIONS.md +28 -14
- package/skills/wix-headless-templates/restaurants/app/components/restaurants/OrderCartDrawer.tsx +87 -5
- package/skills/wix-headless-templates/restaurants/app/hooks/restaurants/useOrderCart.ts +9 -1
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/order-store.ts +33 -4
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering-core.ts +100 -5
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/ordering.ts +101 -15
- package/skills/wix-headless-templates/restaurants/app/wix/restaurants/types.ts +35 -1
- package/skills/wix-headless-templates/restaurants/project/src/components/restaurants/OrderCartDrawer.tsx +87 -5
- package/skills/wix-headless-templates/restaurants/project/src/hooks/restaurants/useOrderCart.ts +9 -1
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/order-store.ts +33 -4
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering-core.ts +100 -5
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/ordering.ts +101 -15
- package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/types.ts +35 -1
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +91 -14
- package/skills/wix-import/SKILL.md +90 -0
- package/skills/wix-manage/SKILL.md +13 -3
- package/skills/wix-manage/references/dashboard-navigation/dashboard-navigation.md +2 -1
- package/skills/wix-manage/references/dashboard-navigation/routes.json +249 -0
- package/skills/wix-manage/references/donations/create-and-update-donation-campaigns.md +139 -0
- package/skills/wix-manage/references/events/events-dashboard-navigation.md +81 -0
- package/skills/wix-manage/references/sites/manage-oauth-apps.md +1 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +127 -8
- package/skills/wix-replatform/.publish-manifest.json +5 -5
- package/skills/wix-replatform/CLI.md +162 -0
- package/skills/wix-replatform/README.md +52 -0
- package/skills/wix-replatform/SKILL.md +229 -684
- package/skills/wix-replatform/console/account.css +1 -0
- package/skills/wix-replatform/console/app.css +1 -0
- package/skills/wix-replatform/console/app.js +117 -0
- package/skills/wix-replatform/console/index.html +4 -0
- package/skills/wix-replatform/console/json.css +11 -0
- package/skills/wix-replatform/lib/agent-adapters/index.js +71 -0
- package/skills/wix-replatform/lib/app-page-routing.js +75 -0
- package/skills/wix-replatform/lib/artifact-freshness.js +11 -1
- package/skills/wix-replatform/lib/blocked-data-requests.js +427 -0
- package/skills/wix-replatform/lib/census-reconciliation.js +426 -0
- package/skills/wix-replatform/lib/completion-report.js +1393 -13
- package/skills/wix-replatform/lib/config-env.js +85 -11
- package/skills/wix-replatform/lib/confirmed-pictures.js +212 -0
- package/skills/wix-replatform/lib/dependency-readiness.js +423 -0
- package/skills/wix-replatform/lib/dependency-recovery.js +21 -0
- package/skills/wix-replatform/lib/destination-choice.js +163 -0
- package/skills/wix-replatform/lib/destination-handoff.js +62 -0
- package/skills/wix-replatform/lib/destination-http.js +81 -0
- package/skills/wix-replatform/lib/destination-route.js +98 -0
- package/skills/wix-replatform/lib/destination.js +919 -0
- package/skills/wix-replatform/lib/discovered-census.js +231 -0
- package/skills/wix-replatform/lib/discovered-set-status.js +255 -0
- package/skills/wix-replatform/lib/document-url-guard.js +203 -0
- package/skills/wix-replatform/lib/entity-qa-attestation.js +339 -0
- package/skills/wix-replatform/lib/entity-verification.js +18 -0
- package/skills/wix-replatform/lib/execution-capability.js +120 -0
- package/skills/wix-replatform/lib/execution-log.js +170 -0
- package/skills/wix-replatform/lib/execution-manifest.js +20 -2
- package/skills/wix-replatform/lib/execution-state.js +22 -0
- package/skills/wix-replatform/lib/expectations-ledger.js +96 -0
- package/skills/wix-replatform/lib/generated-plugin-handoff.js +140 -0
- package/skills/wix-replatform/lib/import-readiness-contract.js +23 -0
- package/skills/wix-replatform/lib/import-recovery.js +800 -6
- package/skills/wix-replatform/lib/imported-redirect-targets.js +608 -0
- package/skills/wix-replatform/lib/internal-link-reconciliation.js +166 -0
- package/skills/wix-replatform/lib/link-audit.js +173 -0
- package/skills/wix-replatform/lib/link-census.js +194 -0
- package/skills/wix-replatform/lib/link-plan.js +148 -0
- package/skills/wix-replatform/lib/link-verification.js +274 -0
- package/skills/wix-replatform/lib/link-write-journal.js +42 -0
- package/skills/wix-replatform/lib/local-state.js +869 -30
- package/skills/wix-replatform/lib/member-completion.js +658 -0
- package/skills/wix-replatform/lib/member-crosswalk.js +69 -0
- package/skills/wix-replatform/lib/member-outcome-registry.js +265 -0
- package/skills/wix-replatform/lib/migration-completion.js +311 -0
- package/skills/wix-replatform/lib/operator-identity.js +47 -0
- package/skills/wix-replatform/lib/orchestration-decisions.js +248 -0
- package/skills/wix-replatform/lib/orchestration-preflight.js +401 -19
- package/skills/wix-replatform/lib/orchestration-router.js +608 -32
- package/skills/wix-replatform/lib/orchestration-state.js +188 -12
- package/skills/wix-replatform/lib/order-reference-readiness.js +30 -0
- package/skills/wix-replatform/lib/payments-outcome-registry.js +200 -0
- package/skills/wix-replatform/lib/plugin-cms-fallback.js +618 -0
- package/skills/wix-replatform/lib/preservation-approval-stamp.js +54 -0
- package/skills/wix-replatform/lib/product-media-deferral.js +96 -0
- package/skills/wix-replatform/lib/progress-log.js +19 -3
- package/skills/wix-replatform/lib/read-back-approval.js +184 -0
- package/skills/wix-replatform/lib/read-back-comparison.js +136 -0
- package/skills/wix-replatform/lib/read-back-contract.js +243 -0
- package/skills/wix-replatform/lib/read-back-extract.js +118 -0
- package/skills/wix-replatform/lib/read-back-gate.js +734 -0
- package/skills/wix-replatform/lib/read-back-reads.js +94 -0
- package/skills/wix-replatform/lib/read-back-state.js +107 -0
- package/skills/wix-replatform/lib/read-back-summary.js +81 -0
- package/skills/wix-replatform/lib/rerun-conflicts.js +334 -0
- package/skills/wix-replatform/lib/run-controller.js +401 -0
- package/skills/wix-replatform/lib/seo-outcome-registry.js +45 -0
- package/skills/wix-replatform/lib/setup-verification.js +148 -0
- package/skills/wix-replatform/lib/source-access.js +231 -0
- package/skills/wix-replatform/lib/source-coverage.js +1130 -0
- package/skills/wix-replatform/lib/source-secrets.js +277 -0
- package/skills/wix-replatform/lib/structured-link-patch.js +59 -0
- package/skills/wix-replatform/lib/task-state.js +110 -0
- package/skills/wix-replatform/lib/url-preservation-report.js +319 -0
- package/skills/wix-replatform/lib/url-preservation-state.js +349 -1
- package/skills/wix-replatform/lib/url-redirect-plan.js +728 -0
- package/skills/wix-replatform/lib/url-verification.js +315 -0
- package/skills/wix-replatform/lib/user-action-effects.js +42 -0
- package/skills/wix-replatform/lib/user-actions.js +264 -0
- package/skills/wix-replatform/lib/website-handoff.js +1220 -0
- package/skills/wix-replatform/lib/wix-client-callers.js +54 -0
- package/skills/wix-replatform/lib/wix-dashboard-url.js +35 -0
- package/skills/wix-replatform/lib/write-verification-state.js +92 -0
- package/skills/wix-replatform/lib/write-verification.js +274 -0
- package/skills/wix-replatform/resources/rp-destination/SKILL.md +137 -0
- package/skills/wix-replatform/resources/rp-discovery/SKILL.md +189 -16
- package/skills/wix-replatform/resources/rp-discovery/scripts/promote-source-coverage.js +47 -0
- package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +869 -29
- package/skills/wix-replatform/resources/rp-execute-import/scripts/shipping-estimate-audit.js +70 -0
- package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +195 -29
- package/skills/wix-replatform/resources/rp-execute-setup/scripts/execute-setup.js +442 -0
- package/skills/wix-replatform/resources/rp-execution-policy/SKILL.md +112 -0
- package/skills/wix-replatform/resources/rp-execution-policy/lib/coupon-currency-plan-report.js +143 -0
- package/skills/wix-replatform/resources/rp-execution-policy/lib/payments-report.js +244 -0
- package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +2082 -38
- package/skills/wix-replatform/resources/rp-mapper/SKILL.md +528 -11
- package/skills/wix-replatform/resources/rp-mapper/lib/structure-bridge-planning.js +303 -0
- package/skills/wix-replatform/resources/rp-mapper/scripts/coverage-reconcile.js +88 -0
- package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +6 -5
- package/skills/wix-replatform/resources/rp-preflight/SKILL.md +40 -0
- package/skills/wix-replatform/resources/rp-project-intake/SKILL.md +55 -0
- package/skills/wix-replatform/resources/rp-quick-runtime/SKILL.md +60 -0
- package/skills/wix-replatform/resources/rp-quick-runtime/lib/import-progress.js +89 -0
- package/skills/wix-replatform/resources/rp-quick-runtime/lib/limit-recovery.js +36 -0
- package/skills/wix-replatform/resources/rp-quick-shopify/SKILL.md +123 -0
- package/skills/wix-replatform/resources/rp-quick-shopify/quick-mode.json +124 -0
- package/skills/wix-replatform/resources/rp-quick-shopify/scripts/quick-mode.js +522 -0
- package/skills/wix-replatform/resources/rp-quick-woocommerce/SKILL.md +56 -0
- package/skills/wix-replatform/resources/rp-quick-woocommerce/quick-mode.json +91 -0
- package/skills/wix-replatform/resources/rp-quick-woocommerce/scripts/quick-mode.js +255 -0
- package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +80 -10
- package/skills/wix-replatform/resources/rp-setup-discovery/scripts/quick-setup-plan.js +44 -0
- package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +3 -0
- package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
- package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +21 -1
- package/skills/wix-replatform/resources/rp-source-inputs/SKILL.md +66 -0
- package/skills/wix-replatform/resources/rp-source-sfcc/SKILL.md +153 -0
- package/skills/wix-replatform/resources/rp-source-shopify/SKILL.md +394 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/discovery-reads.js +200 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/import-findings.js +34 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk-sqlite-worker.js +44 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk.js +1470 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-cli.js +446 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-gift-cards.js +474 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-protected-fields.js +879 -0
- package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-session.js +426 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/articles.graphql +24 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/blogs.graphql +18 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/collections.graphql +40 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/customers.graphql +76 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/delivery-profiles.graphql +51 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/discounts.graphql +35 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/files.graphql +20 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/gift-cards.graphql +18 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/inventory.graphql +31 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/locations.graphql +21 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/menus.graphql +21 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/metaobjects.graphql +30 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-core.graphql +150 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-fulfillments.graphql +36 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-refunds.graphql +48 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/pages.graphql +20 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-address.graphql +8 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-email.graphql +6 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-name.graphql +8 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-phone.graphql +8 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-address.graphql +12 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-email.graphql +6 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-name.graphql +13 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-phone.graphql +13 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/products.graphql +73 -0
- package/skills/wix-replatform/resources/rp-source-shopify/queries/url-redirects.graphql +13 -0
- package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-discovery.js +693 -0
- package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-extract.js +283 -0
- package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-gift-card-remedy.js +191 -0
- package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-session-check.js +115 -0
- package/skills/wix-replatform/resources/rp-source-shopify/source-schema.example.json +201 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/PLUGIN-READ-PLANS.md +146 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +736 -22
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/blocked-data-handlers.js +73 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.js +115 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.test-fixture.js +91 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/coupon-discovery.js +440 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/currency-gate.js +125 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.js +252 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.json +183 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-summary.mjs +333 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/invoice-discovery.js +426 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-disposition.js +400 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-entity-read-plan.js +633 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-knowledge.js +1127 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.js +194 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.json +100 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/sampled-ids-batch.js +157 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/secret-value-guard.js +234 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/store-currency.js +101 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/structure-bridge-reader.js +755 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.js +1074 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.test-fixture.js +149 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/woo-inventory.js +25 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +204 -9
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-image-url.js +186 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-plugin-detect.js +1422 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-redirect-sources.js +343 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +262 -26
- package/skills/wix-replatform/resources/rp-source-wordpress/lib/yoast-product-seo-evidence.js +272 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/README.md +373 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/advanced-custom-fields.json +101 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/back-in-stock-notifier-for-woocommerce.json +81 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/capabilities-pending-decision.json +128 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/cms-fallback-eligible.json +18 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/contact-form-7.json +104 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/facebook-for-woocommerce.json +44 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/fingerprint-aliases.json +49 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/free-gifts-for-woocommerce.json +94 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/index.json +863 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mailpoet.json +52 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/membership-for-woocommerce.json +161 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mwb-bookings-for-woocommerce.json +180 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/no-migration-needed.json +286 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pricing-deals-for-woocommerce.json +79 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/product-extras-for-woocommerce.json +120 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pw-woocommerce-gift-cards.json +128 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/requires-development.json +88 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seo-by-rank-math.json +80 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seriously-simple-podcasting.json +46 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/strong-testimonials.json +55 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/subscriptions-for-woocommerce.json +99 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/tablepress.json +55 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/the-events-calendar.json +160 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/ti-woocommerce-wishlist.json +81 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-checkout-field-editor-pro.json +60 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-discount-rules.json +74 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-product-bundle.json +75 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-gift-cards.json +60 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-other-payment-gateway.json +44 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-pdf-invoices-packing-slips.json +57 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-product-addon.json +141 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-progressive-discounts.json +54 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wordpress-seo.json +158 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpc-composite-products.json +97 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpforms-lite.json +86 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/capture-store-settings.js +90 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge-validate.js +51 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge.js +103 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +1668 -33
- package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-plugin-inventory.js +273 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/secret-value-patterns.v1.json +11 -0
- package/skills/wix-replatform/resources/rp-source-wordpress/sub-parts.json +13 -0
- package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +446 -32
- package/skills/wix-replatform/resources/rp-target-wix/app-page-routing-capabilities.json +36 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +38 -2
- package/skills/wix-replatform/resources/rp-target-wix/domains/SERVICE-PLUGINS.md +322 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/docs-survey.json +70 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +19 -9
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +42 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +54 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +66 -10
- package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +38 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/docs-survey.json +332 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/domain.json +75 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/booking.json +181 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service-add-on.json +130 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service.json +180 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/docs-survey.json +161 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +15 -4
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +39 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +47 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +7 -1
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/docs-survey.json +204 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +17 -4
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +159 -15
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +80 -12
- package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +48 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/docs-survey.json +306 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +30 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/delivery-profile.json +171 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/discount-rule.json +182 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-applied-discount.json +129 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-invoice-document.json +192 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item-options.json +123 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +60 -12
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-merchant-note.json +112 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-payment.json +191 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +140 -13
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +383 -18
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/pickup-location.json +122 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/shipping-option.json +98 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/wishlist-item.json +86 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/docs-survey.json +128 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/domain.json +38 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/category.json +73 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/event.json +107 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/registration-form.json +89 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/rsvp.json +118 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/ticket-definition.json +93 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/forms/docs-survey.json +86 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/forms/domain.json +56 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form-submission.json +121 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form.json +134 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/docs-survey.json +41 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/domain.json +50 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card-product.json +87 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card.json +130 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +914 -24
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/docs-survey.json +41 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +14 -4
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +45 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +41 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/docs-survey.json +119 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +13 -3
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +41 -7
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/custom-field.json +82 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member-about.json +77 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +165 -13
- package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/docs-survey.json +41 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/domain.json +46 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan-order.json +137 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan.json +133 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/docs-survey.json +7 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/domain.json +36 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/amazon-shop-connect.json +71 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/ebay-shop-connect.json +67 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/google-youtube-connect.json +72 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/meta-catalog-connect.json +74 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/pinterest-catalog-connect.json +69 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/tiktok-catalog-connect.json +61 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +28 -1
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/docs-survey.json +109 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/domain.json +73 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/item-seo-tags.json +148 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/seo-pattern.json +91 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/site-seo-tags.json +79 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/site/docs-survey.json +32 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/site/domain.json +49 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/site/entities/business-contact.json +103 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/docs-survey.json +203 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +27 -10
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/back-in-stock-request.json +119 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/brand.json +111 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +52 -8
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +214 -10
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +93 -13
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-customization.json +111 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +52 -10
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +145 -14
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/promotion.json +84 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/review.json +178 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/subscription-product.json +87 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/docs-survey.json +106 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/domain.json +64 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/manual-tax-mapping.json +119 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-group.json +94 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-region.json +113 -0
- package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-settings.json +65 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-author-attribution.js +165 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-client.js +60 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-duplicates.js +201 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-ledger.js +306 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-report.js +229 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-stage.js +55 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build.js +715 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-media.js +567 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/bulk-results.js +73 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contact-extended-fields.js +194 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contact-import.js +133 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +13 -4
- package/skills/wix-replatform/resources/rp-target-wix/lib/coupon-redemption-drift.js +491 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/customer-member.js +104 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/data-extension-schema.js +673 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +453 -2
- package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-balance-reconciliation.js +119 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-build.js +566 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-redemption-build.js +249 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-applied-discount-build.js +63 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-buyer.js +187 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-channel-build.js +64 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-history.js +1027 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-invoice-contract.js +90 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/order-payment-mapping.js +420 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/pricing-plan-definition.js +177 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/product-import.js +151 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/product-seo.js +723 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/seo-redirects.js +353 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-build.js +1437 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-option-stage.js +354 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/store-config-build.js +134 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-category-attach.js +221 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-inventory.js +248 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +86 -3
- package/skills/wix-replatform/resources/rp-target-wix/lib/tax-build.js +231 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/url-mapper-transport.js +28 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/value-utils.js +14 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/variant-correlation.js +34 -0
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +166 -15
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +19 -2
- package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +4079 -257
- package/skills/wix-replatform/resources/rp-target-wix/lib/write-verification.js +3 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/docs-survey-sync.js +150 -0
- package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +40 -2
- package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +6 -1
- package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +148 -8
- package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +83 -15
- package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +1119 -215
- package/skills/wix-replatform/resources/rp-telemetry/lib/transcript-digest.js +318 -0
- package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +2 -2
- package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +106 -4
- package/skills/wix-replatform/resources/rp-website-continuation/SKILL.md +94 -0
- package/skills/wix-replatform/scripts/census-reconciliation.js +25 -0
- package/skills/wix-replatform/scripts/cms-fallback.js +89 -0
- package/skills/wix-replatform/scripts/discovered-census.js +26 -0
- package/skills/wix-replatform/scripts/discovered-set-status.js +33 -0
- package/skills/wix-replatform/scripts/entity-qa-attestation.js +130 -0
- package/skills/wix-replatform/scripts/execution-health-check.js +415 -0
- package/skills/wix-replatform/scripts/execution-manifest-validate.js +1 -1
- package/skills/wix-replatform/scripts/execution-state-prepare.js +1 -1
- package/skills/wix-replatform/scripts/expectations-ledger.js +44 -0
- package/skills/wix-replatform/scripts/import-contract-verify.js +183 -0
- package/skills/wix-replatform/scripts/internal-link-audit.js +90 -0
- package/skills/wix-replatform/scripts/item-seo-tags-verify.js +205 -0
- package/skills/wix-replatform/scripts/migration-completion.js +76 -0
- package/skills/wix-replatform/scripts/orchestration-preflight.js +21 -2
- package/skills/wix-replatform/scripts/orchestration-route.js +32 -1
- package/skills/wix-replatform/scripts/orchestration-state.js +146 -10
- package/skills/wix-replatform/scripts/read-back-gate.js +175 -0
- package/skills/wix-replatform/scripts/replatform-console.js +146 -0
- package/skills/wix-replatform/scripts/replatform.js +436 -0
- package/skills/wix-replatform/scripts/source-secrets.js +77 -0
- package/skills/wix-replatform/scripts/url-redirects.js +286 -0
- package/skills/wix-replatform/scripts/user-action.js +58 -0
- package/skills/wix-replatform/scripts/website-handoff-generate.js +64 -0
- package/skills/wix-replatform/scripts/wix-dashboard-url.js +54 -0
- package/skills/wix-replatform/scripts/wix-destination.js +143 -0
- package/skills/wix-replatform/scripts/wix-headless-scaffold.js +762 -0
- package/skills/wix-vibe-headless/SKILL.md +7 -3
- package/skills/wix-vibe-headless/install/deploy.cjs +61 -34
- package/skills/wix-vibe-headless/platforms/base44.md +1 -0
- package/skills/wix-vibe-headless/references/donations/INSTRUCTIONS.md +88 -0
- package/skills/wix-vibe-headless/references/donations/app/rest/wix-donations.js +112 -0
- package/skills/wix-vibe-headless/references/donations/seed/SEED.md +11 -0
- package/skills/wix-vibe-headless/references/donations/tests/donations.test.mjs +258 -0
- package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +5 -2
- package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +4 -1
- package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +67 -3
- package/skills/wix-vibe-headless/references/shared/app/rest/wix-client.js +4 -3
- package/skills/wix-replatform/resources/rp-target-wix/SPEC-product-reviews-and-blog-authorship.md +0 -330
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { parseArgs, readJson, resolveOutputDir, writeJson, writeText } from "./lib/common.mjs";
|
|
5
|
+
|
|
6
|
+
// Generates the server-side backend that hands a member their preserved invoice document: a pure
|
|
7
|
+
// handler, the Wix adapters that give it real data, and the route that wires them together.
|
|
8
|
+
//
|
|
9
|
+
// This is the one place the invoice feature can leak BETWEEN customers, so the shape is not
|
|
10
|
+
// negotiable: the handler accepts an ORDER id and nothing else, checks that the calling member
|
|
11
|
+
// can read that order, and resolves the private file id server-side. If it accepted a file id
|
|
12
|
+
// from the client, any member could ask for another member's tax invoice by guessing or
|
|
13
|
+
// harvesting one — and an invoice carries a name, an address and a purchase history.
|
|
14
|
+
//
|
|
15
|
+
// The preserved document is a PRIVATE Media file, so it is not reachable by URL without a
|
|
16
|
+
// generated download link. That link is minted per request with an explicit short expiry: the
|
|
17
|
+
// API's own default is 600 minutes, which is not short-lived for a tax document.
|
|
18
|
+
//
|
|
19
|
+
// The field names are read from the migration's own contract at GENERATION time rather than
|
|
20
|
+
// written out here. Two copies of a field name is exactly the drift the contract adapter exists
|
|
21
|
+
// to prevent, and this generator is the third consumer of it.
|
|
22
|
+
const require = createRequire(import.meta.url);
|
|
23
|
+
const invoiceContract = require("../../wix-replatform/resources/rp-target-wix/lib/order-invoice-contract.js");
|
|
24
|
+
|
|
25
|
+
// The scaffold ships @wix/sdk, @wix/astro and @wix/essentials, and nothing else. Without these
|
|
26
|
+
// the generated route imports modules that are not installed and the build fails — which is
|
|
27
|
+
// better than the previous behaviour, where it built fine and answered 401 forever.
|
|
28
|
+
export const REQUIRED_DEPENDENCIES = Object.freeze({
|
|
29
|
+
"@wix/ecom": "^1.0.0",
|
|
30
|
+
"@wix/media": "^1.0.0",
|
|
31
|
+
"@wix/members": "^1.0.0",
|
|
32
|
+
"@wix/essentials": "^1.0.6",
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function handlerSource({ fileIdField, numberField, contractVersion }) {
|
|
36
|
+
return `// GENERATED by generate-invoice-download-backend.mjs — do not edit by hand.
|
|
37
|
+
// Field names generated from order-invoice contract ${contractVersion}.
|
|
38
|
+
//
|
|
39
|
+
// Hands a signed-in member a short-lived download link for the invoice document preserved on one
|
|
40
|
+
// of THEIR orders.
|
|
41
|
+
//
|
|
42
|
+
// The security contract, in order:
|
|
43
|
+
// 1. A client-supplied file id is REJECTED outright. The client names an order; the server
|
|
44
|
+
// resolves the file. Accepting a file id would let any member fetch any member's invoice.
|
|
45
|
+
// 2. The member must be authenticated.
|
|
46
|
+
// 3. The order must be readable BY THAT MEMBER. Order scoping is the authorization boundary.
|
|
47
|
+
// 4. The file id is read from the order's own extended fields, server-side.
|
|
48
|
+
// 5. The download URL is minted with an explicit short expiry and is never logged.
|
|
49
|
+
|
|
50
|
+
export const INVOICE_FILE_FIELD = ${JSON.stringify(fileIdField)};
|
|
51
|
+
export const INVOICE_NUMBER_FIELD = ${JSON.stringify(numberField)};
|
|
52
|
+
export const DOWNLOAD_EXPIRY_MINUTES = 10;
|
|
53
|
+
|
|
54
|
+
export function createInvoiceDownloadHandler({ getMemberId, getOrderForMember, generateDownloadUrl }) {
|
|
55
|
+
if (typeof getMemberId !== "function") throw new Error("getMemberId is required");
|
|
56
|
+
if (typeof getOrderForMember !== "function") throw new Error("getOrderForMember is required");
|
|
57
|
+
if (typeof generateDownloadUrl !== "function") throw new Error("generateDownloadUrl is required");
|
|
58
|
+
|
|
59
|
+
return async function handleInvoiceDownload(request = {}) {
|
|
60
|
+
try {
|
|
61
|
+
return await respond(request);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
// A dependency being down is not a refusal. Reported without detail — the member learns
|
|
64
|
+
// nothing about the order either way — but with a status a client may retry and monitoring
|
|
65
|
+
// can tell apart from a denial.
|
|
66
|
+
if (error && error.transient === true) return { status: 503, error: "service-temporarily-unavailable" };
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
async function respond(request) {
|
|
72
|
+
const body = request.body && typeof request.body === "object" ? request.body : {};
|
|
73
|
+
|
|
74
|
+
// 1. The client may not name a file. Any attempt is refused rather than ignored, so a
|
|
75
|
+
// misbuilt caller fails loudly instead of silently working for the wrong reason.
|
|
76
|
+
for (const forbidden of ["fileId", "file_id", "fileID", "mediaId", "media_id"]) {
|
|
77
|
+
if (Object.prototype.hasOwnProperty.call(body, forbidden)) {
|
|
78
|
+
return { status: 400, error: "client-supplied-file-id-rejected" };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const orderId = typeof body.orderId === "string" ? body.orderId.trim() : "";
|
|
83
|
+
if (!orderId) return { status: 400, error: "order-id-required" };
|
|
84
|
+
|
|
85
|
+
// 2. Authentication.
|
|
86
|
+
const memberId = await getMemberId(request);
|
|
87
|
+
if (!memberId) return { status: 401, error: "authentication-required" };
|
|
88
|
+
|
|
89
|
+
// 3. Authorization is the order read: if this member cannot read this order, there is nothing
|
|
90
|
+
// to talk about. Never fall back to an unscoped order read.
|
|
91
|
+
const order = await getOrderForMember({ orderId, memberId });
|
|
92
|
+
if (!order) return { status: 403, error: "order-not-readable-by-member" };
|
|
93
|
+
|
|
94
|
+
// 4. Resolve the file server-side.
|
|
95
|
+
const namespaces = (order.extendedFields && order.extendedFields.namespaces) || {};
|
|
96
|
+
const fields = namespaces._user_fields || {};
|
|
97
|
+
const fileId = typeof fields[INVOICE_FILE_FIELD] === "string" ? fields[INVOICE_FILE_FIELD].trim() : "";
|
|
98
|
+
if (!fileId) return { status: 404, error: "no-preserved-invoice-for-order" };
|
|
99
|
+
|
|
100
|
+
// 5. Mint a short-lived link. The URL is returned to the caller and never logged.
|
|
101
|
+
const url = await generateDownloadUrl({ fileId, expirationInMinutes: DOWNLOAD_EXPIRY_MINUTES });
|
|
102
|
+
if (!url) return { status: 502, error: "download-url-unavailable" };
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
status: 200,
|
|
106
|
+
url,
|
|
107
|
+
expiresInMinutes: DOWNLOAD_EXPIRY_MINUTES,
|
|
108
|
+
// The invoice number is the merchant's own reference and is safe to show. The file id is
|
|
109
|
+
// internal and is deliberately not echoed.
|
|
110
|
+
invoiceNumber: typeof fields[INVOICE_NUMBER_FIELD] === "string" ? fields[INVOICE_NUMBER_FIELD] : null,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// The authorization logic, with no Wix import in it. Split out from the adapters deliberately:
|
|
118
|
+
// a module that statically imports @wix/ecom cannot be loaded by a test without the whole SDK
|
|
119
|
+
// installed, and "we could not test it" is how the previous version of this backend shipped a
|
|
120
|
+
// seam that answered 401 to everything. What is left in the adapters file is wiring with no
|
|
121
|
+
// branches in it.
|
|
122
|
+
const AUTHORIZATION_SOURCE = `// GENERATED by generate-invoice-download-backend.mjs — do not edit by hand.
|
|
123
|
+
//
|
|
124
|
+
// Who may download which invoice. No Wix imports here on purpose, so this file can be run and
|
|
125
|
+
// tested on its own; the adapters supply the four functions that talk to Wix.
|
|
126
|
+
//
|
|
127
|
+
// Two facts shape it, both from the API docs rather than assumed:
|
|
128
|
+
//
|
|
129
|
+
// 1. Get Order called with a MEMBER's identity returns the order only if that member placed it.
|
|
130
|
+
// That check is Wix's, not ours, and it is the authorization boundary.
|
|
131
|
+
// 2. The migration's invoice fields are declared readable by \`apps\` and \`users\` — deliberately
|
|
132
|
+
// NOT by \`users-of-users\`, because they are merchant data. So the member-identity read that
|
|
133
|
+
// proves ownership does NOT return the field values, and a second, elevated read is needed
|
|
134
|
+
// to get them.
|
|
135
|
+
//
|
|
136
|
+
// So ownership is established by the unelevated read, and only then is anything elevated. The
|
|
137
|
+
// rule is then checked a SECOND time, by us, against the elevated order's buyerInfo.
|
|
138
|
+
//
|
|
139
|
+
// Be precise about what that second check is worth. It is a second IMPLEMENTATION, not a second
|
|
140
|
+
// source of evidence: both it and Wix's check rest on the same stored \`buyerInfo.memberId\`. It
|
|
141
|
+
// catches an elevated read that answers about the wrong order, or a change in what elevation
|
|
142
|
+
// returns. It does NOT catch an order attributed to the wrong member in the first place -- if the
|
|
143
|
+
// import writes Alice's order with Bob's memberId, both checks agree and Bob gets Alice's
|
|
144
|
+
// invoice. Correct \`buyerInfo.memberId\` on imported orders is a PREREQUISITE of this feature,
|
|
145
|
+
// not something it can verify. An order carrying no memberId fails closed.
|
|
146
|
+
|
|
147
|
+
// The SDK renames \`id\` to \`_id\`. Read both rather than pick one and be wrong on a version bump.
|
|
148
|
+
export function orderIdOf(order) {
|
|
149
|
+
if (!order || typeof order !== "object") return null;
|
|
150
|
+
const value = order._id ?? order.id;
|
|
151
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Not every failure is a refusal. Collapsing them told a member "you are not allowed" during a
|
|
155
|
+
// Wix outage, and left monitoring unable to tell a denial from a dependency being down.
|
|
156
|
+
//
|
|
157
|
+
// The Wix SDK throws \`SDKError\` carrying \`response.status\`. A 401, 403 or 404 is a real answer
|
|
158
|
+
// to the question asked, and becomes \`null\` — indistinguishable, on purpose, so a prober cannot
|
|
159
|
+
// learn from the difference between "not yours" and "does not exist". Anything else, including a
|
|
160
|
+
// 5xx and a network error with no status at all, is us failing rather than the caller being
|
|
161
|
+
// refused, and is raised so the route can say so.
|
|
162
|
+
const DENIAL_STATUSES = new Set([401, 403, 404]);
|
|
163
|
+
|
|
164
|
+
export class InvoiceBackendUnavailable extends Error {
|
|
165
|
+
constructor(status) {
|
|
166
|
+
super(\`the invoice backend could not reach Wix (status \${status ?? "unknown"})\`);
|
|
167
|
+
this.name = "InvoiceBackendUnavailable";
|
|
168
|
+
this.transient = true;
|
|
169
|
+
this.status = status ?? null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function orNull(operation) {
|
|
174
|
+
try {
|
|
175
|
+
return (await operation()) ?? null;
|
|
176
|
+
} catch (error) {
|
|
177
|
+
const status = error && error.response && error.response.status;
|
|
178
|
+
if (DENIAL_STATUSES.has(status)) return null;
|
|
179
|
+
throw new InvoiceBackendUnavailable(status);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function createInvoiceAdapters({
|
|
184
|
+
getCurrentMember,
|
|
185
|
+
getOrderAsCaller,
|
|
186
|
+
getOrderElevated,
|
|
187
|
+
generateDownloadUrlElevated,
|
|
188
|
+
}) {
|
|
189
|
+
for (const [name, fn] of Object.entries({ getCurrentMember, getOrderAsCaller, getOrderElevated, generateDownloadUrlElevated })) {
|
|
190
|
+
if (typeof fn !== "function") throw new Error(\`\${name} is required\`);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
async getMemberId() {
|
|
195
|
+
// \`getCurrentMember()\` resolves to \`{ member }\`, NOT to the member. The docs example shows
|
|
196
|
+
// a bare member object and is wrong; the published type is
|
|
197
|
+
// \`Promise<GetMyMemberResponse>\` with \`member?: Member\`. Reading \`_id\` off the response
|
|
198
|
+
// made every signed-in member resolve as anonymous, so the route answered 401 to everyone
|
|
199
|
+
// — the same failure as the \`locals\` seam it replaced, one layer in.
|
|
200
|
+
//
|
|
201
|
+
// Both shapes are accepted: the wrapper is what ships, the bare member is what the docs
|
|
202
|
+
// promise, and being wrong about which one arrives must not lock members out again.
|
|
203
|
+
const response = await orNull(getCurrentMember);
|
|
204
|
+
const member = (response && response.member) || response;
|
|
205
|
+
const id = member && (member._id ?? member.id);
|
|
206
|
+
return typeof id === "string" && id.length > 0 ? id : null;
|
|
207
|
+
},
|
|
208
|
+
|
|
209
|
+
async getOrderForMember({ orderId, memberId }) {
|
|
210
|
+
if (typeof orderId !== "string" || orderId.length === 0) return null;
|
|
211
|
+
if (typeof memberId !== "string" || memberId.length === 0) return null;
|
|
212
|
+
|
|
213
|
+
// 1. Wix's check. Nothing is elevated until this passes.
|
|
214
|
+
const asCaller = await orNull(() => getOrderAsCaller(orderId));
|
|
215
|
+
if (!asCaller || orderIdOf(asCaller) !== orderId) return null;
|
|
216
|
+
|
|
217
|
+
// 2. Our own read, elevated, because the fields are not member-readable.
|
|
218
|
+
const elevated = await orNull(() => getOrderElevated(orderId));
|
|
219
|
+
if (!elevated || orderIdOf(elevated) !== orderId) return null;
|
|
220
|
+
|
|
221
|
+
// 3. Our check, independent of Wix's. An order whose buyer is not this member is not this
|
|
222
|
+
// member's order, and an order with no member buyer at all belongs to nobody who can ask
|
|
223
|
+
// for it here. Email is never accepted as proof: it is changeable and guessable.
|
|
224
|
+
const buyerMemberId = elevated.buyerInfo && elevated.buyerInfo.memberId;
|
|
225
|
+
if (typeof buyerMemberId !== "string" || buyerMemberId !== memberId) return null;
|
|
226
|
+
|
|
227
|
+
return elevated;
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
async generateDownloadUrl({ fileId, expirationInMinutes }) {
|
|
231
|
+
if (typeof fileId !== "string" || fileId.length === 0) return null;
|
|
232
|
+
const result = await orNull(() => generateDownloadUrlElevated(fileId, { expirationInMinutes }));
|
|
233
|
+
const first = result && Array.isArray(result.downloadUrls) ? result.downloadUrls[0] : null;
|
|
234
|
+
const url = first && first.url;
|
|
235
|
+
return typeof url === "string" && url.length > 0 ? url : null;
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
`;
|
|
240
|
+
|
|
241
|
+
const ADAPTERS_SOURCE = `// GENERATED by generate-invoice-download-backend.mjs — do not edit by hand.
|
|
242
|
+
//
|
|
243
|
+
// Wiring only. Every decision lives in invoice-download-authorization.mjs; this file exists to
|
|
244
|
+
// name the four Wix calls, and there is deliberately no logic in it to get wrong.
|
|
245
|
+
import { members } from "@wix/members";
|
|
246
|
+
import { orders } from "@wix/ecom";
|
|
247
|
+
import { files } from "@wix/media";
|
|
248
|
+
import { auth } from "@wix/essentials";
|
|
249
|
+
import { createInvoiceAdapters } from "./invoice-download-authorization.mjs";
|
|
250
|
+
|
|
251
|
+
export const wixInvoiceAdapters = createInvoiceAdapters({
|
|
252
|
+
getCurrentMember: () => members.getCurrentMember(),
|
|
253
|
+
// Unelevated ON PURPOSE. This call running as the caller is the whole authorization mechanism.
|
|
254
|
+
getOrderAsCaller: (id) => orders.getOrder(id),
|
|
255
|
+
getOrderElevated: (id) => auth.elevate(orders.getOrder)(id),
|
|
256
|
+
generateDownloadUrlElevated: (fileId, options) => auth.elevate(files.generateFileDownloadUrl)(fileId, options),
|
|
257
|
+
});
|
|
258
|
+
`;
|
|
259
|
+
|
|
260
|
+
const ROUTE_SOURCE = `// GENERATED by generate-invoice-download-backend.mjs — do not edit by hand.
|
|
261
|
+
//
|
|
262
|
+
// Thin transport wrapper. All authorization lives in the handler and the adapters; this file only
|
|
263
|
+
// moves JSON.
|
|
264
|
+
import { createInvoiceDownloadHandler } from "../../lib/invoice-download.mjs";
|
|
265
|
+
import { wixInvoiceAdapters } from "../../lib/invoice-download-adapters.mjs";
|
|
266
|
+
|
|
267
|
+
const handler = createInvoiceDownloadHandler(wixInvoiceAdapters);
|
|
268
|
+
|
|
269
|
+
export async function POST({ request }) {
|
|
270
|
+
let body = {};
|
|
271
|
+
try {
|
|
272
|
+
body = await request.json();
|
|
273
|
+
} catch {
|
|
274
|
+
return new Response(JSON.stringify({ error: "invalid-json" }), { status: 400, headers: { "content-type": "application/json" } });
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const result = await handler({ body });
|
|
278
|
+
const { status, ...payload } = result;
|
|
279
|
+
return new Response(JSON.stringify(payload), { status, headers: { "content-type": "application/json" } });
|
|
280
|
+
}
|
|
281
|
+
`;
|
|
282
|
+
|
|
283
|
+
export function buildHandlerSource() {
|
|
284
|
+
return handlerSource({
|
|
285
|
+
fileIdField: invoiceContract.ROLES.fileId,
|
|
286
|
+
numberField: invoiceContract.ROLES.number,
|
|
287
|
+
contractVersion: invoiceContract.version(),
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Adds what the generated route imports. Merges rather than overwrites: the scaffold owns its own
|
|
292
|
+
// versions, and a project that already pins one of these keeps its pin.
|
|
293
|
+
export async function ensureInvoiceDependencies({ outputDir }) {
|
|
294
|
+
const packagePath = path.join(outputDir, "package.json");
|
|
295
|
+
let manifest;
|
|
296
|
+
try {
|
|
297
|
+
manifest = await readJson(packagePath);
|
|
298
|
+
} catch {
|
|
299
|
+
return { packagePath, added: [], skipped: "no package.json at the output dir" };
|
|
300
|
+
}
|
|
301
|
+
const dependencies = manifest.dependencies || {};
|
|
302
|
+
const added = [];
|
|
303
|
+
for (const [name, version] of Object.entries(REQUIRED_DEPENDENCIES)) {
|
|
304
|
+
if (!dependencies[name]) {
|
|
305
|
+
dependencies[name] = version;
|
|
306
|
+
added.push(name);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (added.length === 0) return { packagePath, added };
|
|
310
|
+
manifest.dependencies = dependencies;
|
|
311
|
+
await writeJson(packagePath, manifest);
|
|
312
|
+
return { packagePath, added };
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export async function generateInvoiceDownloadBackend({ outputDir }) {
|
|
316
|
+
const handlerPath = path.join(outputDir, "src", "lib", "invoice-download.mjs");
|
|
317
|
+
const authorizationPath = path.join(outputDir, "src", "lib", "invoice-download-authorization.mjs");
|
|
318
|
+
const adaptersPath = path.join(outputDir, "src", "lib", "invoice-download-adapters.mjs");
|
|
319
|
+
const routePath = path.join(outputDir, "src", "pages", "api", "invoice-download.mjs");
|
|
320
|
+
await writeText(handlerPath, HANDLER_SOURCE);
|
|
321
|
+
await writeText(authorizationPath, AUTHORIZATION_SOURCE);
|
|
322
|
+
await writeText(adaptersPath, ADAPTERS_SOURCE);
|
|
323
|
+
await writeText(routePath, ROUTE_SOURCE);
|
|
324
|
+
const dependencies = await ensureInvoiceDependencies({ outputDir });
|
|
325
|
+
return { handlerPath, authorizationPath, adaptersPath, routePath, dependencies };
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
async function main() {
|
|
329
|
+
const args = parseArgs();
|
|
330
|
+
const outputDir = resolveOutputDir(args._[0] || args.url, args.out);
|
|
331
|
+
const written = await generateInvoiceDownloadBackend({ outputDir });
|
|
332
|
+
if (args.json) process.stdout.write(`${JSON.stringify(written, null, 2)}\n`);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Computed once so consumers -- the tests included -- read exactly the bytes that get written.
|
|
336
|
+
export const HANDLER_SOURCE = buildHandlerSource();
|
|
337
|
+
|
|
338
|
+
export { AUTHORIZATION_SOURCE, ADAPTERS_SOURCE, ROUTE_SOURCE };
|
|
339
|
+
|
|
340
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
341
|
+
await main();
|
|
342
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { docsDir, parseArgs, readJson, resolveOutputDir, writeJson, writeText } from "./lib/common.mjs";
|
|
4
|
+
import { classifyBackground, classifyCanvas, buildRegions, classifyComposition, relationshipsFor } from "./lib/layout-blueprint/classifiers.mjs";
|
|
5
|
+
import { LAYOUT_VOCABULARY_VERSION, VOCABULARY } from "./lib/layout-blueprint/vocabulary.mjs";
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
const args = parseArgs();
|
|
9
|
+
const outputDir = resolveOutputDir(args._[0] || args.url, args.out);
|
|
10
|
+
const blueprint = await generateLayoutBlueprint({ outputDir });
|
|
11
|
+
if (args.json) process.stdout.write(`${JSON.stringify(blueprint, null, 2)}\n`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export async function generateLayoutBlueprint({ outputDir, pages: suppliedPages, interactionMap: suppliedInteractionMap, sceneContract: suppliedSceneContract } = {}) {
|
|
15
|
+
const docs = docsDir(outputDir);
|
|
16
|
+
const [sourceMap, interactionMap, sceneContract] = await Promise.all([
|
|
17
|
+
suppliedPages ? null : readJson(path.join(docs, "source-map.json")),
|
|
18
|
+
suppliedInteractionMap || readJson(path.join(docs, "interaction-map.json")),
|
|
19
|
+
suppliedSceneContract || readJson(path.join(docs, "scene-contract.json")),
|
|
20
|
+
]);
|
|
21
|
+
const pages = suppliedPages || sourceMap?.pages || interactionMap?.pages || [];
|
|
22
|
+
const pageBlueprints = pages.map((page) => ({
|
|
23
|
+
url: page.url,
|
|
24
|
+
area: page.area || "page",
|
|
25
|
+
sections: (page.sections || []).map((section) => buildSectionBlueprint({ page, section, sceneContract })),
|
|
26
|
+
}));
|
|
27
|
+
const blueprint = {
|
|
28
|
+
schemaVersion: 1,
|
|
29
|
+
vocabularyVersion: LAYOUT_VOCABULARY_VERSION,
|
|
30
|
+
generatedAt: new Date().toISOString(),
|
|
31
|
+
sourceUrl: interactionMap?.sourceUrl || pages[0]?.url || "",
|
|
32
|
+
vocabulary: VOCABULARY,
|
|
33
|
+
implementationOrder: ["canvas", "background-layers", "container", "regions", "relationships", "responsive-reflow", "ui-normalization"],
|
|
34
|
+
pages: pageBlueprints,
|
|
35
|
+
};
|
|
36
|
+
await writeJson(path.join(docs, "layout-blueprint.json"), blueprint);
|
|
37
|
+
await writeText(path.join(docs, "layout-blueprint.md"), renderLayoutBlueprintMarkdown(blueprint));
|
|
38
|
+
return blueprint;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function buildSectionBlueprint({ page, section, sceneContract = {} }) {
|
|
42
|
+
const pagePrefix = `${page.area || "page"}-`;
|
|
43
|
+
const scene = (sceneContract.scenes || []).find((candidate) => candidate.sectionId === section.id && candidate.id.startsWith(pagePrefix));
|
|
44
|
+
const canvas = classifyCanvas(section, scene);
|
|
45
|
+
const background = classifyBackground(section, scene);
|
|
46
|
+
const regions = buildRegions(section).map((region) => ({
|
|
47
|
+
...region,
|
|
48
|
+
...(region.text ? { responsiveTextGeometry: responsiveTextSamples(page, region.text) } : {}),
|
|
49
|
+
}));
|
|
50
|
+
const composition = classifyComposition({ section, scene, background, regions });
|
|
51
|
+
const relationships = relationshipsFor(composition, regions);
|
|
52
|
+
const confidence = section.layoutEvidence ? "measured" : scene ? "scene-inferred" : "heuristic";
|
|
53
|
+
return {
|
|
54
|
+
sectionId: section.id,
|
|
55
|
+
sourceClassification: { kind: section.kind || "section", variant: section.variant || "generic" },
|
|
56
|
+
composition,
|
|
57
|
+
canvas,
|
|
58
|
+
background,
|
|
59
|
+
container: inferContainer(canvas, regions),
|
|
60
|
+
regions,
|
|
61
|
+
relationships,
|
|
62
|
+
responsive: {
|
|
63
|
+
strategy: composition === "rail" ? "retain-rail-with-touch-overflow" : composition === "split" ? "stack-at-narrow-width" : "preserve-composition",
|
|
64
|
+
observedViewports: section.layoutEvidence?.viewport ? [section.layoutEvidence.viewport] : [],
|
|
65
|
+
inferred: true,
|
|
66
|
+
},
|
|
67
|
+
identityLocks: {
|
|
68
|
+
composition,
|
|
69
|
+
backgroundKind: background.kind,
|
|
70
|
+
mediaRole: background.layers.some((layer) => layer.role === "media") ? "background" : section.capabilities?.hasMedia ? "content" : "none",
|
|
71
|
+
relationships,
|
|
72
|
+
textGeometry: regions.filter((region) => region.textGeometry).map((region) => ({ role: region.role, text: region.text, ...region.textGeometry, responsive: region.responsiveTextGeometry || [] })),
|
|
73
|
+
forbiddenConversions: forbiddenConversions(composition),
|
|
74
|
+
},
|
|
75
|
+
implementation: implementationRecipe(composition, canvas, background, regions),
|
|
76
|
+
evidence: {
|
|
77
|
+
confidence,
|
|
78
|
+
sourceDomRef: section.domRef || null,
|
|
79
|
+
sceneId: scene?.id || null,
|
|
80
|
+
sourceScreenshot: scene?.sourceScreenshot || null,
|
|
81
|
+
warnings: section.layoutEvidence ? [] : ["layout-evidence-unavailable; rerun extraction for measured region geometry"],
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function responsiveTextSamples(page, text) {
|
|
87
|
+
const target = String(text || "").replace(/\s+/g, " ").trim();
|
|
88
|
+
return Object.entries(page.responsiveTextGeometry || {}).map(([viewport, samples]) => {
|
|
89
|
+
const match = (samples || []).find((sample) => String(sample.text || "").replace(/\s+/g, " ").trim() === target);
|
|
90
|
+
return match ? { viewport, ...match } : null;
|
|
91
|
+
}).filter(Boolean);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function inferContainer(canvas, regions) {
|
|
95
|
+
const content = regions.filter((region) => region.role !== "media" && region.normalizedRect);
|
|
96
|
+
if (!content.length) return { widthMode: canvas.widthMode === "bounded" ? "bounded" : "full", maxWidthPx: null, inlineInsetRatio: null };
|
|
97
|
+
const left = Math.min(...content.map((region) => region.normalizedRect.x));
|
|
98
|
+
const right = Math.max(...content.map((region) => region.normalizedRect.x + region.normalizedRect.width));
|
|
99
|
+
return {
|
|
100
|
+
widthMode: left > 0.04 || right < 0.96 ? "bounded" : "full",
|
|
101
|
+
maxWidthPx: null,
|
|
102
|
+
inlineInsetRatio: { start: Number(left.toFixed(3)), end: Number((1 - right).toFixed(3)) },
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function forbiddenConversions(composition) {
|
|
107
|
+
const map = {
|
|
108
|
+
"layered-overlay": ["split", "stack"],
|
|
109
|
+
"scroll-narrative": ["split", "static-stack"],
|
|
110
|
+
rail: ["static-grid"],
|
|
111
|
+
split: ["layered-overlay"],
|
|
112
|
+
};
|
|
113
|
+
return map[composition] || [];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function implementationRecipe(composition, canvas, background, regions) {
|
|
117
|
+
const steps = [
|
|
118
|
+
`Create one section root with ${canvas.widthMode} width and ${canvas.heightMode} height behavior.`,
|
|
119
|
+
`Build background layers in declared order: ${background.layers.map((layer) => `${layer.role}:${layer.kind}`).join(" -> ") || "none"}.`,
|
|
120
|
+
];
|
|
121
|
+
if (["layered-overlay", "scroll-narrative"].includes(composition)) steps.push("Use one positioning context; keep background layers full-bleed and place foreground regions above them. Do not create media and copy as peer columns.");
|
|
122
|
+
if (composition === "split") steps.push("Use peer media and content regions with their captured left/right relationship; stack only at the declared narrow reflow.");
|
|
123
|
+
if (composition === "rail") steps.push("Use a clipped viewport and max-content horizontal track; preserve shared item geometry and active-state behavior.");
|
|
124
|
+
if (regions.length) steps.push("Place semantic regions from normalized rectangles and placement anchors before fine typography or motion polish.");
|
|
125
|
+
if (regions.some((region) => region.textGeometry)) steps.push("Apply each important text region's measured inline size, max-width, line count, and wrap policy. A captured single-line desktop heading must stay one line at the canonical desktop viewport.");
|
|
126
|
+
if (background.layers.some((layer) => layer.policy === "fallback-only")) steps.push("Render fallback-only posters only until primary media is ready; never leave them visibly stacked behind playing media.");
|
|
127
|
+
return { steps };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function renderLayoutBlueprintMarkdown(contract) {
|
|
131
|
+
const pages = contract.pages.map((page) => `# ${page.url}\n\n${page.sections.map((section) => `## ${section.sectionId}: ${section.composition}\n\n- Canvas: \`${section.canvas.widthMode}/${section.canvas.heightMode}\`${section.canvas.pinned ? ", pinned" : ""}\n- Background: \`${section.background.kind}\` (${section.background.layers.map((layer) => `${layer.role}:${layer.kind}`).join(" -> ") || "none"})\n- Container: \`${section.container.widthMode}\`\n- Identity locks: ${section.identityLocks.relationships.join(", ") || "composition and media role"}\n- Forbidden conversions: ${section.identityLocks.forbiddenConversions.map((item) => `\`${item}\``).join(", ") || "none"}\n\nRegions:\n${section.regions.map((region) => `- \`${region.role}\` at \`${region.placement}\`: ${JSON.stringify(region.normalizedRect)}${region.textGeometry ? `; text geometry ${JSON.stringify(region.textGeometry)}` : ""}${region.text ? ` — ${region.text}` : ""}`).join("\n") || "- no measured regions"}\n\nBuild order:\n${section.implementation.steps.map((step, index) => `${index + 1}. ${step}`).join("\n")}\n\nEvidence: \`${section.evidence.confidence}\`${section.evidence.sourceScreenshot ? `; screenshot \`${section.evidence.sourceScreenshot}\`` : ""}`).join("\n\n")}`).join("\n\n");
|
|
132
|
+
return `# Section layout blueprints\n\nControlled vocabulary version: ${contract.vocabularyVersion}. Implement each section independently. Composition and layer order are identity locks; UI normalization comes last.\n\n${pages}\n`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
136
|
+
main().catch((error) => {
|
|
137
|
+
console.error(error.stack || error.message);
|
|
138
|
+
process.exit(1);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { docsDir, ensureDir, writeJson, writeText } from "./lib/common.mjs";
|
|
4
|
+
|
|
5
|
+
export async function generateRepeaterCms({ outputDir, pages }) {
|
|
6
|
+
const collections = (pages || []).flatMap((page) => (page.repeaters || []).filter((r) => r.kind === "accordion-repeater").map((r, index) => plan(page, r, index)));
|
|
7
|
+
const docs = docsDir(outputDir);
|
|
8
|
+
await writeJson(path.join(docs, "repeater-cms.json"), { version: 1, collections });
|
|
9
|
+
await writeText(path.join(docs, "repeater-cms.md"), `# CMS repeater plan\n\n${collections.map((c) => `## ${c.displayName}\n\n- id: \`${c.id}\`\n- rows: ${c.items.length}\n- state: \`${JSON.stringify(c.state)}\`\n- fields: \`label\`, \`body\`, \`imagesJson\`, \`linksJson\`, \`sortOrder\`, \`initialExpanded\`, \`itemStructure\``).join("\n\n") || "No accordion repeaters extracted."}\n`);
|
|
10
|
+
if (collections.length) await install(outputDir);
|
|
11
|
+
return { collections };
|
|
12
|
+
}
|
|
13
|
+
function plan(page, repeater, index) { const id = `rpAccordion${slug(`${page.area}-${repeater.label || index + 1}`).split("-").map((p) => p[0]?.toUpperCase() + p.slice(1)).join("")}`; return { id, displayName: `RePlatform Accordion: ${repeater.label || index + 1}`, sourceUrl: page.url, state: repeater.state || {}, items: (repeater.items || []).map((item, i) => ({ sourceKey: `${id}-${i + 1}`, label: item.heading || `Item ${i + 1}`, body: (item.paragraphs || []).join("\n\n"), imagesJson: JSON.stringify(item.images || []), linksJson: JSON.stringify(item.links || []), sortOrder: i, initialExpanded: Boolean(item.initialExpanded), itemStructure: item.itemStructure || "text-only" })) }; }
|
|
14
|
+
async function install(outputDir) {
|
|
15
|
+
const lib = path.join(outputDir, "src", "lib"), components = path.join(outputDir, "src", "components");
|
|
16
|
+
await ensureDir(lib); await ensureDir(components);
|
|
17
|
+
await generated(path.join(lib, "rp-repeater-cms.ts"), `// @generated-source wix-headless-replatform\nexport async function loadAccordionRows(itemsApi:any,dataCollectionId:string){const r=await itemsApi.queryDataItems({dataCollectionId}).ascending("data.sortOrder").find();return (r.items||[]).map((x:any)=>x.data||x).sort((a:any,b:any)=>a.sortOrder-b.sortOrder)}\n`);
|
|
18
|
+
await generated(path.join(components, "RpAccordion.astro"), `---\n// @generated-source wix-headless-replatform\nconst { rows, dataCollectionId, singleOpen = true } = Astro.props;\n---\n<section data-rp-accordion={singleOpen?'single':'multiple'} data-rp-collection={dataCollectionId}>{rows.map((row)=><details open={row.initialExpanded}><summary>{row.label}</summary><div>{row.body.split('\\n\\n').map((p)=><p>{p}</p>)}</div></details>)}</section>\n<script>\nimport { items } from '@wix/data';\nconst escapeHtml=(value)=>String(value).replace(/[&<>'\\"]/g,(char)=>({'&':'&','<':'<','>':'>',\"'\":''','\\"':'"'}[char]));\nconst renderRows=(root,rows)=>root.replaceChildren(...rows.map((row)=>{const detail=document.createElement('details');detail.open=Boolean(row.initialExpanded);detail.innerHTML=\`<summary>\${escapeHtml(row.label)}</summary><div>\${String(row.body||'').split('\\\\n\\\\n').map((paragraph)=>\`<p>\${escapeHtml(paragraph)}</p>\`).join('')}</div>\`;return detail;}));\ndocument.querySelectorAll('[data-rp-collection]').forEach(async(root)=>{try{const result=await items.queryDataItems({dataCollectionId:root.dataset.rpCollection}).ascending('data.sortOrder').find();const cmsRows=(result.items||[]).map((item)=>item.data||item).sort((a,b)=>a.sortOrder-b.sortOrder);if(cmsRows.length){renderRows(root,cmsRows);root.dataset.rpCmsBound='true';}}catch(error){console.warn('RePlatform accordion CMS read failed; using extracted fallback content.',error);}});\ndocument.querySelectorAll('[data-rp-accordion=\"single\"]').forEach((root)=>root.addEventListener('toggle',(event)=>{const current=event.target;if(current.tagName==='DETAILS'&¤t.open)root.querySelectorAll('details[open]').forEach((item)=>{if(item!==current)item.open=false;});},true));\n</script>\n`, migrateLegacyAccordion);
|
|
19
|
+
}
|
|
20
|
+
async function generated(file,text,migrate) { try { const existing = await readFile(file,"utf8"); if (!existing.includes("@generated-source wix-headless-replatform")) { const migrated = migrate?.(existing); if (migrated && migrated !== existing) await writeText(file,migrated); return; } } catch {} await writeText(file,text); }
|
|
21
|
+
function migrateLegacyAccordion(text) { const legacyImport = "import { createClient, OAuthStrategy } from '@wix/sdk';\nimport { items } from '@wix/data';"; const legacyQuery = "const client=createClient({modules:{items},auth:OAuthStrategy({clientId:import.meta.env.WIX_CLIENT_ID})});const result=await client.items.queryDataItems"; if (!text.includes(legacyImport) || !text.includes(legacyQuery)) return text; return text.replace(legacyImport, "import { items } from '@wix/data';").replace(legacyQuery, "const result=await items.queryDataItems"); }
|
|
22
|
+
function slug(v) { return String(v).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"") || "accordion"; }
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import {
|
|
4
|
+
classifyTemplate,
|
|
5
|
+
docsDir,
|
|
6
|
+
isDynamicArea,
|
|
7
|
+
isAssetLikeUrl,
|
|
8
|
+
normalizeUrl,
|
|
9
|
+
parseArgs,
|
|
10
|
+
readJson,
|
|
11
|
+
resolveOutputDir,
|
|
12
|
+
routePathFromUrl,
|
|
13
|
+
writeJson,
|
|
14
|
+
} from "./lib/common.mjs";
|
|
15
|
+
|
|
16
|
+
async function main() {
|
|
17
|
+
const args = parseArgs();
|
|
18
|
+
const url = normalizeUrl(args._[0] || args.url).toString();
|
|
19
|
+
const outputDir = resolveOutputDir(url, args.out);
|
|
20
|
+
const routes = await generateRoutePlan({ sourceUrl: url, outputDir });
|
|
21
|
+
await writeJson(path.join(docsDir(outputDir), "routes.json"), routes);
|
|
22
|
+
if (args.json) process.stdout.write(`${JSON.stringify(routes, null, 2)}\n`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function generateRoutePlan({ sourceUrl, outputDir }) {
|
|
26
|
+
const dir = docsDir(outputDir);
|
|
27
|
+
const discovery = await safeRead(path.join(dir, "discovery.json"), { pages: [] });
|
|
28
|
+
const pages = (discovery.pages || []).filter((page) => page?.url && !isAssetLikeUrl(page.url));
|
|
29
|
+
const inScopeUrls = new Set((discovery.inScopePages || pages.filter((page) => page.inScope))
|
|
30
|
+
.filter((page) => page?.url && !isAssetLikeUrl(page.url))
|
|
31
|
+
.map((page) => page.url));
|
|
32
|
+
const routes = [];
|
|
33
|
+
const inScopeRoutes = [];
|
|
34
|
+
const preservedFallbackLinks = [];
|
|
35
|
+
const dynamicSeen = new Set();
|
|
36
|
+
for (const page of pages) {
|
|
37
|
+
const inScope = inScopeUrls.has(page.url) || discovery.scope !== "specific";
|
|
38
|
+
if (!inScope) {
|
|
39
|
+
const route = notMigratedRouteFor({ sourceUrl, page });
|
|
40
|
+
routes.push(route);
|
|
41
|
+
preservedFallbackLinks.push(route);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (isDynamicArea(page.area)) {
|
|
45
|
+
const template = classifyTemplate(page.area);
|
|
46
|
+
if (dynamicSeen.has(template)) {
|
|
47
|
+
const existing = routes.find((route) => route.template === template);
|
|
48
|
+
existing?.representativeUrls?.push(page.url);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
dynamicSeen.add(template);
|
|
52
|
+
const route = dynamicRouteFor(page, template);
|
|
53
|
+
routes.push(route);
|
|
54
|
+
inScopeRoutes.push(route);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (page.area === "home" || inStaticScope(page.area)) {
|
|
58
|
+
const route = {
|
|
59
|
+
sourceUrl: page.url,
|
|
60
|
+
sourcePath: routePathFromUrl(sourceUrl, page.url),
|
|
61
|
+
targetRoute: routePathFromUrl(sourceUrl, page.url) || "/",
|
|
62
|
+
kind: "static",
|
|
63
|
+
area: page.area,
|
|
64
|
+
representativeUrls: [page.url],
|
|
65
|
+
};
|
|
66
|
+
routes.push(route);
|
|
67
|
+
inScopeRoutes.push(route);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const route = notMigratedRouteFor({ sourceUrl, page });
|
|
71
|
+
routes.push(route);
|
|
72
|
+
preservedFallbackLinks.push(route);
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
sourceUrl,
|
|
76
|
+
routes,
|
|
77
|
+
inScopeRoutes,
|
|
78
|
+
preservedFallbackLinks,
|
|
79
|
+
dynamicRouteCount: routes.filter((route) => route.kind === "dynamic").length,
|
|
80
|
+
notMigratedCount: routes.filter((route) => route.kind === "not-migrated").length,
|
|
81
|
+
generatedAt: new Date().toISOString(),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function notMigratedRouteFor({ sourceUrl, page }) {
|
|
86
|
+
const sourcePath = routePathFromUrl(sourceUrl, page.url);
|
|
87
|
+
return {
|
|
88
|
+
sourceUrl: page.url,
|
|
89
|
+
sourcePath,
|
|
90
|
+
targetRoute: `/not-migrated?from=${encodeURIComponent(sourcePath)}`,
|
|
91
|
+
kind: "not-migrated",
|
|
92
|
+
area: page.area,
|
|
93
|
+
representativeUrls: [page.url],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function dynamicRouteFor(page, template) {
|
|
98
|
+
const config = {
|
|
99
|
+
"product-detail": { targetRoute: "/products/[slug]", dataSource: "wix-stores" },
|
|
100
|
+
"product-category": { targetRoute: "/categories/[slug]", dataSource: "wix-stores" },
|
|
101
|
+
"blog-post": { targetRoute: "/blog/[slug]", dataSource: "wix-blog" },
|
|
102
|
+
"blog-index": { targetRoute: "/blog", dataSource: "wix-blog" },
|
|
103
|
+
"cms-item": { targetRoute: "/content/[slug]", dataSource: "wix-cms" },
|
|
104
|
+
booking: { targetRoute: "/bookings/[slug]", dataSource: "wix-bookings" },
|
|
105
|
+
event: { targetRoute: "/events/[slug]", dataSource: "wix-events" },
|
|
106
|
+
"pricing-plan": { targetRoute: "/pricing", dataSource: "wix-pricing-plans" },
|
|
107
|
+
}[template] || { targetRoute: `/${page.area}/[slug]`, dataSource: "wix-sdk" };
|
|
108
|
+
return {
|
|
109
|
+
sourcePattern: patternFor(page),
|
|
110
|
+
sourcePath: page.path,
|
|
111
|
+
targetRoute: config.targetRoute,
|
|
112
|
+
kind: "dynamic",
|
|
113
|
+
area: page.area,
|
|
114
|
+
template,
|
|
115
|
+
dataSource: config.dataSource,
|
|
116
|
+
representativeUrls: [page.url],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function patternFor(page) {
|
|
121
|
+
const parts = String(page.path || "/").split("/").filter(Boolean);
|
|
122
|
+
if (parts.length <= 1) return page.path || "/";
|
|
123
|
+
return `/${parts.slice(0, -1).join("/")}/*`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function inStaticScope(area) {
|
|
127
|
+
return ["about-contact", "legal", "docs", "other"].includes(area);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async function safeRead(filePath, fallback) {
|
|
131
|
+
try {
|
|
132
|
+
return await readJson(filePath);
|
|
133
|
+
} catch {
|
|
134
|
+
return fallback;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
139
|
+
main().catch((error) => {
|
|
140
|
+
console.error(error.stack || error.message);
|
|
141
|
+
process.exit(1);
|
|
142
|
+
});
|
|
143
|
+
}
|