@wix/agent-skills 1.35.1 → 1.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (820) hide show
  1. package/package.json +8 -3
  2. package/skills/wix-app/references/CODE_QUALITY.md +1 -1
  3. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +27 -29
  4. package/skills/wix-app/references/editor-react-component/ANIMATED-COMPONENTS.md +1 -1
  5. package/skills/wix-app/references/editor-react-component/COMPONENT-CONTRACT.md +26 -25
  6. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +12 -42
  7. package/skills/wix-app/references/editor-react-component/DESIGN-STATES.md +9 -20
  8. package/skills/wix-app/references/editor-react-component/MANIFEST-ERRORS.md +5 -4
  9. package/skills/wix-app/references/editor-react-component/PARTS.md +1 -1
  10. package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +1 -1
  11. package/skills/wix-app/references/editor-react-component/VECTOR-ART.md +95 -0
  12. package/skills/wix-app/references/editor-react-component/VISUAL-QUALITY.md +39 -0
  13. package/skills/wix-docs/references/CALLING.md +1 -1
  14. package/skills/wix-headless-kit/guides/api-run.md +1 -1
  15. package/skills/wix-headless-kit/install/pins.json +1 -1
  16. package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +1 -1
  17. package/skills/wix-headless-templates/donations/app/wix/donations/campaigns.ts +0 -1
  18. package/skills/wix-headless-templates/donations/app/wix/donations/donate.ts +1 -1
  19. package/skills/wix-headless-templates/donations/project/src/wix/donations/campaigns.ts +0 -1
  20. package/skills/wix-headless-templates/donations/project/src/wix/donations/donate.ts +1 -1
  21. package/skills/wix-headless-templates/donations/rest/campaigns.ts +0 -1
  22. package/skills/wix-headless-templates/donations/rest/donate.ts +1 -1
  23. package/skills/wix-headless-templates/events/seed/seed-events.mjs +1 -1
  24. package/skills/wix-headless-templates/faq/INSTRUCTIONS.md +1 -1
  25. package/skills/wix-headless-templates/faq/app/wix/faq/faq.ts +2 -2
  26. package/skills/wix-headless-templates/faq/project/src/wix/faq/faq.ts +2 -2
  27. package/skills/wix-headless-templates/faq/rest/faq.ts +2 -2
  28. package/skills/wix-headless-templates/faq/seed/SEED.md +1 -1
  29. package/skills/wix-headless-templates/faq/seed/read-site.mjs +1 -1
  30. package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +5 -5
  31. package/skills/wix-headless-templates/forms/app/wix/forms/forms.ts +2 -2
  32. package/skills/wix-headless-templates/forms/app/wix/forms/submissions.ts +2 -2
  33. package/skills/wix-headless-templates/forms/project/src/wix/forms/forms.ts +2 -2
  34. package/skills/wix-headless-templates/forms/project/src/wix/forms/submissions.ts +2 -2
  35. package/skills/wix-headless-templates/members/seed/read-site.mjs +1 -1
  36. package/skills/wix-headless-templates/pricing-plans/app/wix/pricing-plans/plan-access.ts +1 -1
  37. package/skills/wix-headless-templates/pricing-plans/project/src/wix/pricing-plans/plan-access.ts +1 -1
  38. package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +1 -1
  39. package/skills/wix-headless-templates/restaurants/app/wix/restaurants/menu.ts +0 -1
  40. package/skills/wix-headless-templates/restaurants/project/src/wix/restaurants/menu.ts +0 -1
  41. package/skills/wix-headless-templates/restaurants/rest/menu.ts +0 -1
  42. package/skills/wix-headless-templates/shared/rest/client.ts +1 -1
  43. package/skills/wix-headless-templates/shared/seed/site.mjs +2 -1
  44. package/skills/wix-manage/SKILL.md +3 -3
  45. package/skills/wix-manage/references/cms/cms-data-items-crud.md +78 -1
  46. package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +11 -11
  47. package/skills/wix-manage/references/google-ads/get-campaign-suggestions.md +0 -1
  48. package/skills/wix-manage/references/google-ads/install-and-create-account.md +0 -1
  49. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +20 -51
  50. package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +4 -4
  51. package/skills/wix-manage/references/rich-content/ricos-converter-service.md +1 -1
  52. package/skills/wix-base44-connector/SKILL.md +0 -437
  53. package/skills/wix-base44-connector/references/CAPABILITY_MAP.md +0 -78
  54. package/skills/wix-base44-connector/scripts/utils.cjs +0 -466
  55. package/skills/wix-export/SKILL.md +0 -83
  56. package/skills/wix-harmony-editor/.publish-manifest.json +0 -8
  57. package/skills/wix-harmony-editor/COPY-SITE.md +0 -494
  58. package/skills/wix-harmony-editor/SKILL.md +0 -317
  59. package/skills/wix-harmony-editor/scripts/copy/build-description.mjs +0 -249
  60. package/skills/wix-harmony-editor/scripts/copy/check-description.mjs +0 -225
  61. package/skills/wix-harmony-editor/scripts/copy/check-mirror.mjs +0 -89
  62. package/skills/wix-harmony-editor/scripts/copy/compare-preview.mjs +0 -76
  63. package/skills/wix-harmony-editor/scripts/copy/deploy-description.mjs +0 -212
  64. package/skills/wix-harmony-editor/scripts/copy/desc-hash.mjs +0 -44
  65. package/skills/wix-harmony-editor/scripts/copy/editor-run.mjs +0 -45
  66. package/skills/wix-harmony-editor/scripts/copy/export-page.mjs +0 -53
  67. package/skills/wix-harmony-editor/scripts/copy/find-interactions.mjs +0 -76
  68. package/skills/wix-harmony-editor/scripts/copy/hide-scrollbars.mjs +0 -16
  69. package/skills/wix-harmony-editor/scripts/copy/import-media.mjs +0 -150
  70. package/skills/wix-harmony-editor/scripts/copy/link-url.mjs +0 -27
  71. package/skills/wix-harmony-editor/scripts/copy/lint-api.mjs +0 -56
  72. package/skills/wix-harmony-editor/scripts/copy/measure-source.mjs +0 -211
  73. package/skills/wix-harmony-editor/scripts/copy/merge-mirrors.mjs +0 -29
  74. package/skills/wix-harmony-editor/scripts/copy/mirror-site.mjs +0 -92
  75. package/skills/wix-harmony-editor/scripts/copy/mobile-stage.mjs +0 -56
  76. package/skills/wix-harmony-editor/scripts/copy/preview-widths.mjs +0 -73
  77. package/skills/wix-harmony-editor/scripts/copy/render-plate.mjs +0 -67
  78. package/skills/wix-harmony-editor/scripts/copy/serve-mirror.mjs +0 -102
  79. package/skills/wix-harmony-editor/scripts/copy/snapshot-capabilities.mjs +0 -40
  80. package/skills/wix-harmony-editor/scripts/copy/split-sections.mjs +0 -191
  81. package/skills/wix-harmony-editor/scripts/copy/upload-media-manager.mjs +0 -61
  82. package/skills/wix-harmony-editor/scripts/launch.sh +0 -359
  83. package/skills/wix-headless/SKILL.md +0 -151
  84. package/skills/wix-headless/references/AI_FEATURES.md +0 -178
  85. package/skills/wix-headless/references/CAPABILITIES.md +0 -117
  86. package/skills/wix-headless/references/CONTENT.md +0 -36
  87. package/skills/wix-headless/references/DESIGN.md +0 -55
  88. package/skills/wix-headless/references/DISCOVERY.md +0 -80
  89. package/skills/wix-headless/references/DOC_DISCOVERY.md +0 -43
  90. package/skills/wix-headless/references/FEEDBACK.md +0 -129
  91. package/skills/wix-headless/references/IMAGE_GENERATION.md +0 -80
  92. package/skills/wix-headless/references/SDK_HANDOFF.md +0 -108
  93. package/skills/wix-headless/references/SEED.md +0 -74
  94. package/skills/wix-headless/references/SETUP.md +0 -60
  95. package/skills/wix-headless/references/astro.md +0 -98
  96. package/skills/wix-headless/references/inline-recipes/experience-donations.md +0 -102
  97. package/skills/wix-headless/references/inline-recipes/experience-store.md +0 -49
  98. package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +0 -196
  99. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +0 -590
  100. package/skills/wix-headless/references/inline-recipes/how-to-code-bookings.md +0 -279
  101. package/skills/wix-headless/references/inline-recipes/how-to-code-cms.md +0 -163
  102. package/skills/wix-headless/references/inline-recipes/how-to-code-donations.md +0 -146
  103. package/skills/wix-headless/references/inline-recipes/how-to-code-events.md +0 -203
  104. package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +0 -696
  105. package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +0 -124
  106. package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +0 -160
  107. package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +0 -118
  108. package/skills/wix-headless/references/inline-recipes/how-to-code-portfolio.md +0 -132
  109. package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +0 -126
  110. package/skills/wix-headless/references/inline-recipes/how-to-code-rentals.md +0 -254
  111. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +0 -191
  112. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +0 -213
  113. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurants.md +0 -161
  114. package/skills/wix-headless/references/inline-recipes/setup-blog.md +0 -175
  115. package/skills/wix-headless/references/inline-recipes/setup-bookings.md +0 -232
  116. package/skills/wix-headless/references/inline-recipes/setup-cms.md +0 -200
  117. package/skills/wix-headless/references/inline-recipes/setup-donations.md +0 -15
  118. package/skills/wix-headless/references/inline-recipes/setup-events.md +0 -196
  119. package/skills/wix-headless/references/inline-recipes/setup-forms.md +0 -288
  120. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +0 -214
  121. package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +0 -155
  122. package/skills/wix-headless/references/inline-recipes/setup-pricing-plans.md +0 -229
  123. package/skills/wix-headless/references/inline-recipes/setup-rentals.md +0 -254
  124. package/skills/wix-headless/references/inline-recipes/setup-restaurant-experiences.md +0 -73
  125. package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +0 -197
  126. package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +0 -136
  127. package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +0 -152
  128. package/skills/wix-headless/references/managed/AUTHENTICATION.md +0 -71
  129. package/skills/wix-headless/references/managed/CONNECT.md +0 -74
  130. package/skills/wix-headless/references/managed/CREATE.md +0 -149
  131. package/skills/wix-headless/references/managed/DEPLOYMENT.md +0 -104
  132. package/skills/wix-headless/references/non-astro.md +0 -59
  133. package/skills/wix-headless/references/self-managed/AUTHENTICATION.md +0 -22
  134. package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +0 -15
  135. package/skills/wix-headless/references/stripe/AUTHENTICATION.md +0 -55
  136. package/skills/wix-headless/references/stripe/DEPLOYMENT.md +0 -71
  137. package/skills/wix-headless/scripts/bootstrap.mjs +0 -156
  138. package/skills/wix-headless-replatform/.publish-manifest.json +0 -8
  139. package/skills/wix-headless-replatform/SKILL.md +0 -116
  140. package/skills/wix-headless-replatform/agents/openai.yaml +0 -6
  141. package/skills/wix-headless-replatform/references/control-and-visual-fidelity-contract.md +0 -43
  142. package/skills/wix-headless-replatform/references/extraction-schema.md +0 -187
  143. package/skills/wix-headless-replatform/references/interaction-runtime-contract.md +0 -137
  144. package/skills/wix-headless-replatform/references/layout-blueprint-contract.md +0 -41
  145. package/skills/wix-headless-replatform/references/output-contract.md +0 -93
  146. package/skills/wix-headless-replatform/references/post-build-gap-contract.md +0 -125
  147. package/skills/wix-headless-replatform/references/qa-checklist.md +0 -83
  148. package/skills/wix-headless-replatform/references/safety.md +0 -19
  149. package/skills/wix-headless-replatform/references/ui-normalization-contract.md +0 -70
  150. package/skills/wix-headless-replatform/references/workflow.md +0 -157
  151. package/skills/wix-headless-replatform/registry/README.md +0 -20
  152. package/skills/wix-headless-replatform/registry/approvals/button/shadcn-default-ac60ef5.json +0 -28
  153. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/button.tsx +0 -54
  154. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/capabilities.json +0 -60
  155. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/contract.md +0 -48
  156. package/skills/wix-headless-replatform/registry/licenses/shadcn-ui-ac60ef5-MIT.txt +0 -21
  157. package/skills/wix-headless-replatform/registry/registry.json +0 -36
  158. package/skills/wix-headless-replatform/resources/rp-facelift/SKILL.md +0 -32
  159. package/skills/wix-headless-replatform/resources/rp-project-context/SKILL.md +0 -62
  160. package/skills/wix-headless-replatform/resources/rp-qa-gap-loop/SKILL.md +0 -64
  161. package/skills/wix-headless-replatform/resources/rp-source-evidence/SKILL.md +0 -42
  162. package/skills/wix-headless-replatform/resources/rp-ui-implementation/SKILL.md +0 -73
  163. package/skills/wix-headless-replatform/schemas/build-plan.schema.json +0 -10
  164. package/skills/wix-headless-replatform/schemas/candidate.schema.json +0 -19
  165. package/skills/wix-headless-replatform/schemas/common.schema.json +0 -33
  166. package/skills/wix-headless-replatform/schemas/decision-patch.schema.json +0 -10
  167. package/skills/wix-headless-replatform/schemas/decision-request.schema.json +0 -10
  168. package/skills/wix-headless-replatform/schemas/extraction-gap.schema.json +0 -28
  169. package/skills/wix-headless-replatform/schemas/extraction-manifest.schema.json +0 -34
  170. package/skills/wix-headless-replatform/schemas/final-report.schema.json +0 -10
  171. package/skills/wix-headless-replatform/schemas/foundation.schema.json +0 -11
  172. package/skills/wix-headless-replatform/schemas/metadata.schema.json +0 -11
  173. package/skills/wix-headless-replatform/schemas/observation-packet.schema.json +0 -17
  174. package/skills/wix-headless-replatform/schemas/page-capture.schema.json +0 -11
  175. package/skills/wix-headless-replatform/schemas/page-resolution.schema.json +0 -33
  176. package/skills/wix-headless-replatform/schemas/shared-chrome.schema.json +0 -11
  177. package/skills/wix-headless-replatform/schemas/unit.schema.json +0 -40
  178. package/skills/wix-headless-replatform/scripts/assemble-extraction.mjs +0 -844
  179. package/skills/wix-headless-replatform/scripts/benchmark-extraction.mjs +0 -163
  180. package/skills/wix-headless-replatform/scripts/browser-extraction-preflight.mjs +0 -42
  181. package/skills/wix-headless-replatform/scripts/build-extracted-homepage.mjs +0 -228
  182. package/skills/wix-headless-replatform/scripts/clear-wix-starter.mjs +0 -87
  183. package/skills/wix-headless-replatform/scripts/create-wix-project.mjs +0 -505
  184. package/skills/wix-headless-replatform/scripts/discover-urls.mjs +0 -142
  185. package/skills/wix-headless-replatform/scripts/extract-assets.mjs +0 -140
  186. package/skills/wix-headless-replatform/scripts/extract-design-system.mjs +0 -637
  187. package/skills/wix-headless-replatform/scripts/extract-interactions.mjs +0 -1903
  188. package/skills/wix-headless-replatform/scripts/extract-page.mjs +0 -2461
  189. package/skills/wix-headless-replatform/scripts/extract-seo.mjs +0 -25
  190. package/skills/wix-headless-replatform/scripts/extract-tokens.mjs +0 -63
  191. package/skills/wix-headless-replatform/scripts/finalize-extraction-report.mjs +0 -126
  192. package/skills/wix-headless-replatform/scripts/finalize-gap-review.mjs +0 -180
  193. package/skills/wix-headless-replatform/scripts/finalize-gap-review.test.mjs +0 -98
  194. package/skills/wix-headless-replatform/scripts/finalize-migration-website.mjs +0 -103
  195. package/skills/wix-headless-replatform/scripts/generate-control-state-contract.mjs +0 -176
  196. package/skills/wix-headless-replatform/scripts/generate-design-md.mjs +0 -261
  197. package/skills/wix-headless-replatform/scripts/generate-extraction-validators.mjs +0 -25
  198. package/skills/wix-headless-replatform/scripts/generate-invoice-download-backend.mjs +0 -342
  199. package/skills/wix-headless-replatform/scripts/generate-layout-blueprint.mjs +0 -140
  200. package/skills/wix-headless-replatform/scripts/generate-repeater-cms.mjs +0 -22
  201. package/skills/wix-headless-replatform/scripts/generate-route-plan.mjs +0 -143
  202. package/skills/wix-headless-replatform/scripts/generate-scene-contract.mjs +0 -288
  203. package/skills/wix-headless-replatform/scripts/generate-ui-normalization.mjs +0 -266
  204. package/skills/wix-headless-replatform/scripts/generate-visual-assets.mjs +0 -111
  205. package/skills/wix-headless-replatform/scripts/lib/browser-tooling.mjs +0 -570
  206. package/skills/wix-headless-replatform/scripts/lib/common.mjs +0 -329
  207. package/skills/wix-headless-replatform/scripts/lib/component-capabilities.mjs +0 -121
  208. package/skills/wix-headless-replatform/scripts/lib/component-registry.mjs +0 -282
  209. package/skills/wix-headless-replatform/scripts/lib/content-boundary.mjs +0 -61
  210. package/skills/wix-headless-replatform/scripts/lib/extraction-contract.mjs +0 -374
  211. package/skills/wix-headless-replatform/scripts/lib/extraction-detectors.mjs +0 -243
  212. package/skills/wix-headless-replatform/scripts/lib/extraction-validators.generated.mjs +0 -1139
  213. package/skills/wix-headless-replatform/scripts/lib/font-contract.mjs +0 -326
  214. package/skills/wix-headless-replatform/scripts/lib/frontend-automation-state.mjs +0 -184
  215. package/skills/wix-headless-replatform/scripts/lib/gap-analysis.mjs +0 -396
  216. package/skills/wix-headless-replatform/scripts/lib/html-extract.mjs +0 -168
  217. package/skills/wix-headless-replatform/scripts/lib/interaction-bootstrap.mjs +0 -10
  218. package/skills/wix-headless-replatform/scripts/lib/interaction-runtime.mjs +0 -194
  219. package/skills/wix-headless-replatform/scripts/lib/interaction-timeline.mjs +0 -348
  220. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/classifiers.mjs +0 -141
  221. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/geometry.mjs +0 -43
  222. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/vocabulary.mjs +0 -18
  223. package/skills/wix-headless-replatform/scripts/lib/ui-normalization.css +0 -64
  224. package/skills/wix-headless-replatform/scripts/optimize-svg.mjs +0 -31
  225. package/skills/wix-headless-replatform/scripts/post-build-gap.mjs +0 -358
  226. package/skills/wix-headless-replatform/scripts/provision-repeater-cms.mjs +0 -25
  227. package/skills/wix-headless-replatform/scripts/record-gap-decision.mjs +0 -39
  228. package/skills/wix-headless-replatform/scripts/replay-extraction.mjs +0 -107
  229. package/skills/wix-headless-replatform/scripts/resolve-home-page.mjs +0 -96
  230. package/skills/wix-headless-replatform/scripts/site-clone.mjs +0 -658
  231. package/skills/wix-headless-replatform/scripts/validate-font-contract.mjs +0 -29
  232. package/skills/wix-headless-replatform/scripts/verify-interactions.mjs +0 -669
  233. package/skills/wix-headless-replatform/scripts/visual-qa.mjs +0 -370
  234. package/skills/wix-import/SKILL.md +0 -90
  235. package/skills/wix-replatform/.publish-manifest.json +0 -8
  236. package/skills/wix-replatform/CLI.md +0 -162
  237. package/skills/wix-replatform/README.md +0 -52
  238. package/skills/wix-replatform/SKILL.md +0 -238
  239. package/skills/wix-replatform/console/account.css +0 -1
  240. package/skills/wix-replatform/console/app.css +0 -1
  241. package/skills/wix-replatform/console/app.js +0 -117
  242. package/skills/wix-replatform/console/index.html +0 -4
  243. package/skills/wix-replatform/console/json.css +0 -11
  244. package/skills/wix-replatform/lib/agent-adapters/index.js +0 -71
  245. package/skills/wix-replatform/lib/app-page-routing.js +0 -75
  246. package/skills/wix-replatform/lib/artifact-freshness.js +0 -225
  247. package/skills/wix-replatform/lib/blocked-data-requests.js +0 -427
  248. package/skills/wix-replatform/lib/census-reconciliation.js +0 -426
  249. package/skills/wix-replatform/lib/completion-report.js +0 -1580
  250. package/skills/wix-replatform/lib/config-env.js +0 -133
  251. package/skills/wix-replatform/lib/confirmed-pictures.js +0 -212
  252. package/skills/wix-replatform/lib/dependency-readiness.js +0 -423
  253. package/skills/wix-replatform/lib/dependency-recovery.js +0 -21
  254. package/skills/wix-replatform/lib/destination-choice.js +0 -163
  255. package/skills/wix-replatform/lib/destination-handoff.js +0 -62
  256. package/skills/wix-replatform/lib/destination-http.js +0 -81
  257. package/skills/wix-replatform/lib/destination-route.js +0 -98
  258. package/skills/wix-replatform/lib/destination.js +0 -919
  259. package/skills/wix-replatform/lib/discovered-census.js +0 -231
  260. package/skills/wix-replatform/lib/discovered-set-status.js +0 -255
  261. package/skills/wix-replatform/lib/document-url-guard.js +0 -203
  262. package/skills/wix-replatform/lib/entity-qa-attestation.js +0 -339
  263. package/skills/wix-replatform/lib/entity-verification.js +0 -18
  264. package/skills/wix-replatform/lib/execution-capability.js +0 -120
  265. package/skills/wix-replatform/lib/execution-log.js +0 -170
  266. package/skills/wix-replatform/lib/execution-manifest.js +0 -203
  267. package/skills/wix-replatform/lib/execution-state.js +0 -195
  268. package/skills/wix-replatform/lib/expectations-ledger.js +0 -96
  269. package/skills/wix-replatform/lib/generated-plugin-handoff.js +0 -140
  270. package/skills/wix-replatform/lib/import-readiness-contract.js +0 -23
  271. package/skills/wix-replatform/lib/import-recovery.js +0 -1107
  272. package/skills/wix-replatform/lib/imported-redirect-targets.js +0 -608
  273. package/skills/wix-replatform/lib/internal-link-reconciliation.js +0 -166
  274. package/skills/wix-replatform/lib/link-audit.js +0 -173
  275. package/skills/wix-replatform/lib/link-census.js +0 -194
  276. package/skills/wix-replatform/lib/link-plan.js +0 -148
  277. package/skills/wix-replatform/lib/link-verification.js +0 -274
  278. package/skills/wix-replatform/lib/link-write-journal.js +0 -42
  279. package/skills/wix-replatform/lib/local-state.js +0 -1481
  280. package/skills/wix-replatform/lib/member-completion.js +0 -658
  281. package/skills/wix-replatform/lib/member-crosswalk.js +0 -69
  282. package/skills/wix-replatform/lib/member-outcome-registry.js +0 -265
  283. package/skills/wix-replatform/lib/migration-completion.js +0 -311
  284. package/skills/wix-replatform/lib/operator-identity.js +0 -47
  285. package/skills/wix-replatform/lib/orchestration-decisions.js +0 -248
  286. package/skills/wix-replatform/lib/orchestration-preflight.js +0 -525
  287. package/skills/wix-replatform/lib/orchestration-router.js +0 -698
  288. package/skills/wix-replatform/lib/orchestration-state.js +0 -631
  289. package/skills/wix-replatform/lib/order-reference-readiness.js +0 -30
  290. package/skills/wix-replatform/lib/payments-outcome-registry.js +0 -200
  291. package/skills/wix-replatform/lib/plugin-cms-fallback.js +0 -618
  292. package/skills/wix-replatform/lib/preservation-approval-stamp.js +0 -54
  293. package/skills/wix-replatform/lib/product-media-deferral.js +0 -96
  294. package/skills/wix-replatform/lib/progress-log.js +0 -240
  295. package/skills/wix-replatform/lib/progress-log.sh +0 -140
  296. package/skills/wix-replatform/lib/read-back-approval.js +0 -184
  297. package/skills/wix-replatform/lib/read-back-comparison.js +0 -136
  298. package/skills/wix-replatform/lib/read-back-contract.js +0 -243
  299. package/skills/wix-replatform/lib/read-back-extract.js +0 -118
  300. package/skills/wix-replatform/lib/read-back-gate.js +0 -734
  301. package/skills/wix-replatform/lib/read-back-reads.js +0 -94
  302. package/skills/wix-replatform/lib/read-back-state.js +0 -107
  303. package/skills/wix-replatform/lib/read-back-summary.js +0 -81
  304. package/skills/wix-replatform/lib/rerun-conflicts.js +0 -334
  305. package/skills/wix-replatform/lib/run-controller.js +0 -401
  306. package/skills/wix-replatform/lib/seo-outcome-registry.js +0 -45
  307. package/skills/wix-replatform/lib/setup-verification.js +0 -148
  308. package/skills/wix-replatform/lib/source-access.js +0 -231
  309. package/skills/wix-replatform/lib/source-coverage.js +0 -1130
  310. package/skills/wix-replatform/lib/source-secrets.js +0 -277
  311. package/skills/wix-replatform/lib/structured-link-patch.js +0 -59
  312. package/skills/wix-replatform/lib/task-state.js +0 -110
  313. package/skills/wix-replatform/lib/url-preservation-report.js +0 -319
  314. package/skills/wix-replatform/lib/url-preservation-state.js +0 -739
  315. package/skills/wix-replatform/lib/url-redirect-plan.js +0 -728
  316. package/skills/wix-replatform/lib/url-verification.js +0 -315
  317. package/skills/wix-replatform/lib/user-action-effects.js +0 -42
  318. package/skills/wix-replatform/lib/user-actions.js +0 -264
  319. package/skills/wix-replatform/lib/website-handoff.js +0 -1220
  320. package/skills/wix-replatform/lib/wix-client-callers.js +0 -54
  321. package/skills/wix-replatform/lib/wix-dashboard-url.js +0 -35
  322. package/skills/wix-replatform/lib/write-verification-state.js +0 -92
  323. package/skills/wix-replatform/lib/write-verification.js +0 -274
  324. package/skills/wix-replatform/resources/rp-destination/SKILL.md +0 -137
  325. package/skills/wix-replatform/resources/rp-discovery/SKILL.md +0 -357
  326. package/skills/wix-replatform/resources/rp-discovery/scripts/promote-source-coverage.js +0 -47
  327. package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +0 -1369
  328. package/skills/wix-replatform/resources/rp-execute-import/scripts/shipping-estimate-audit.js +0 -70
  329. package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +0 -482
  330. package/skills/wix-replatform/resources/rp-execute-setup/scripts/execute-setup.js +0 -442
  331. package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +0 -64
  332. package/skills/wix-replatform/resources/rp-execution-policy/SKILL.md +0 -112
  333. package/skills/wix-replatform/resources/rp-execution-policy/lib/coupon-currency-plan-report.js +0 -143
  334. package/skills/wix-replatform/resources/rp-execution-policy/lib/payments-report.js +0 -244
  335. package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +0 -3158
  336. package/skills/wix-replatform/resources/rp-mapper/SKILL.md +0 -947
  337. package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +0 -217
  338. package/skills/wix-replatform/resources/rp-mapper/lib/structure-bridge-planning.js +0 -303
  339. package/skills/wix-replatform/resources/rp-mapper/scripts/coverage-reconcile.js +0 -88
  340. package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +0 -148
  341. package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +0 -378
  342. package/skills/wix-replatform/resources/rp-preflight/SKILL.md +0 -40
  343. package/skills/wix-replatform/resources/rp-project-intake/SKILL.md +0 -55
  344. package/skills/wix-replatform/resources/rp-quick-runtime/SKILL.md +0 -60
  345. package/skills/wix-replatform/resources/rp-quick-runtime/lib/import-progress.js +0 -89
  346. package/skills/wix-replatform/resources/rp-quick-runtime/lib/limit-recovery.js +0 -36
  347. package/skills/wix-replatform/resources/rp-quick-shopify/SKILL.md +0 -123
  348. package/skills/wix-replatform/resources/rp-quick-shopify/quick-mode.json +0 -124
  349. package/skills/wix-replatform/resources/rp-quick-shopify/scripts/quick-mode.js +0 -522
  350. package/skills/wix-replatform/resources/rp-quick-woocommerce/SKILL.md +0 -56
  351. package/skills/wix-replatform/resources/rp-quick-woocommerce/quick-mode.json +0 -91
  352. package/skills/wix-replatform/resources/rp-quick-woocommerce/scripts/quick-mode.js +0 -255
  353. package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +0 -253
  354. package/skills/wix-replatform/resources/rp-setup-discovery/scripts/quick-setup-plan.js +0 -44
  355. package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +0 -481
  356. package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +0 -136
  357. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
  358. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +0 -310
  359. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +0 -1081
  360. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +0 -618
  361. package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +0 -969
  362. package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +0 -196
  363. package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +0 -66
  364. package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +0 -60
  365. package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +0 -95
  366. package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +0 -82
  367. package/skills/wix-replatform/resources/rp-source-inputs/SKILL.md +0 -66
  368. package/skills/wix-replatform/resources/rp-source-sfcc/SKILL.md +0 -153
  369. package/skills/wix-replatform/resources/rp-source-shopify/SKILL.md +0 -394
  370. package/skills/wix-replatform/resources/rp-source-shopify/lib/discovery-reads.js +0 -200
  371. package/skills/wix-replatform/resources/rp-source-shopify/lib/import-findings.js +0 -34
  372. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk-sqlite-worker.js +0 -44
  373. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk.js +0 -1470
  374. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-cli.js +0 -446
  375. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-gift-cards.js +0 -474
  376. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-protected-fields.js +0 -879
  377. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-session.js +0 -426
  378. package/skills/wix-replatform/resources/rp-source-shopify/queries/articles.graphql +0 -24
  379. package/skills/wix-replatform/resources/rp-source-shopify/queries/blogs.graphql +0 -18
  380. package/skills/wix-replatform/resources/rp-source-shopify/queries/collections.graphql +0 -40
  381. package/skills/wix-replatform/resources/rp-source-shopify/queries/customers.graphql +0 -76
  382. package/skills/wix-replatform/resources/rp-source-shopify/queries/delivery-profiles.graphql +0 -51
  383. package/skills/wix-replatform/resources/rp-source-shopify/queries/discounts.graphql +0 -35
  384. package/skills/wix-replatform/resources/rp-source-shopify/queries/files.graphql +0 -20
  385. package/skills/wix-replatform/resources/rp-source-shopify/queries/gift-cards.graphql +0 -18
  386. package/skills/wix-replatform/resources/rp-source-shopify/queries/inventory.graphql +0 -31
  387. package/skills/wix-replatform/resources/rp-source-shopify/queries/locations.graphql +0 -21
  388. package/skills/wix-replatform/resources/rp-source-shopify/queries/menus.graphql +0 -21
  389. package/skills/wix-replatform/resources/rp-source-shopify/queries/metaobjects.graphql +0 -30
  390. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-core.graphql +0 -150
  391. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-fulfillments.graphql +0 -36
  392. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-refunds.graphql +0 -48
  393. package/skills/wix-replatform/resources/rp-source-shopify/queries/pages.graphql +0 -20
  394. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-address.graphql +0 -8
  395. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-email.graphql +0 -6
  396. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-name.graphql +0 -8
  397. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-phone.graphql +0 -8
  398. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-address.graphql +0 -12
  399. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-email.graphql +0 -6
  400. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-name.graphql +0 -13
  401. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-phone.graphql +0 -13
  402. package/skills/wix-replatform/resources/rp-source-shopify/queries/products.graphql +0 -73
  403. package/skills/wix-replatform/resources/rp-source-shopify/queries/url-redirects.graphql +0 -13
  404. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-discovery.js +0 -693
  405. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-extract.js +0 -283
  406. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-gift-card-remedy.js +0 -191
  407. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-session-check.js +0 -115
  408. package/skills/wix-replatform/resources/rp-source-shopify/source-schema.example.json +0 -201
  409. package/skills/wix-replatform/resources/rp-source-wordpress/PLUGIN-READ-PLANS.md +0 -146
  410. package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +0 -970
  411. package/skills/wix-replatform/resources/rp-source-wordpress/lib/blocked-data-handlers.js +0 -73
  412. package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.js +0 -115
  413. package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.test-fixture.js +0 -91
  414. package/skills/wix-replatform/resources/rp-source-wordpress/lib/coupon-discovery.js +0 -440
  415. package/skills/wix-replatform/resources/rp-source-wordpress/lib/currency-gate.js +0 -125
  416. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.js +0 -252
  417. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.json +0 -183
  418. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-summary.mjs +0 -333
  419. package/skills/wix-replatform/resources/rp-source-wordpress/lib/invoice-discovery.js +0 -426
  420. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-disposition.js +0 -400
  421. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-entity-read-plan.js +0 -633
  422. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-knowledge.js +0 -1127
  423. package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.js +0 -194
  424. package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.json +0 -100
  425. package/skills/wix-replatform/resources/rp-source-wordpress/lib/sampled-ids-batch.js +0 -157
  426. package/skills/wix-replatform/resources/rp-source-wordpress/lib/secret-value-guard.js +0 -234
  427. package/skills/wix-replatform/resources/rp-source-wordpress/lib/store-currency.js +0 -101
  428. package/skills/wix-replatform/resources/rp-source-wordpress/lib/structure-bridge-reader.js +0 -755
  429. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.js +0 -1074
  430. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.test-fixture.js +0 -149
  431. package/skills/wix-replatform/resources/rp-source-wordpress/lib/woo-inventory.js +0 -25
  432. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +0 -444
  433. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-image-url.js +0 -186
  434. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-plugin-detect.js +0 -1422
  435. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-redirect-sources.js +0 -343
  436. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +0 -680
  437. package/skills/wix-replatform/resources/rp-source-wordpress/lib/yoast-product-seo-evidence.js +0 -272
  438. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/README.md +0 -373
  439. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/advanced-custom-fields.json +0 -101
  440. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/back-in-stock-notifier-for-woocommerce.json +0 -81
  441. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/capabilities-pending-decision.json +0 -128
  442. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/cms-fallback-eligible.json +0 -18
  443. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/contact-form-7.json +0 -104
  444. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/facebook-for-woocommerce.json +0 -44
  445. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/fingerprint-aliases.json +0 -49
  446. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/free-gifts-for-woocommerce.json +0 -94
  447. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/index.json +0 -863
  448. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mailpoet.json +0 -52
  449. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/membership-for-woocommerce.json +0 -161
  450. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mwb-bookings-for-woocommerce.json +0 -180
  451. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/no-migration-needed.json +0 -286
  452. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pricing-deals-for-woocommerce.json +0 -79
  453. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/product-extras-for-woocommerce.json +0 -120
  454. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pw-woocommerce-gift-cards.json +0 -128
  455. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/requires-development.json +0 -88
  456. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seo-by-rank-math.json +0 -80
  457. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seriously-simple-podcasting.json +0 -46
  458. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/strong-testimonials.json +0 -55
  459. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/subscriptions-for-woocommerce.json +0 -99
  460. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/tablepress.json +0 -55
  461. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/the-events-calendar.json +0 -160
  462. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/ti-woocommerce-wishlist.json +0 -81
  463. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-checkout-field-editor-pro.json +0 -60
  464. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-discount-rules.json +0 -74
  465. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-product-bundle.json +0 -75
  466. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-gift-cards.json +0 -60
  467. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-other-payment-gateway.json +0 -44
  468. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-pdf-invoices-packing-slips.json +0 -57
  469. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-product-addon.json +0 -141
  470. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-progressive-discounts.json +0 -54
  471. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wordpress-seo.json +0 -158
  472. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpc-composite-products.json +0 -97
  473. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpforms-lite.json +0 -86
  474. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/capture-store-settings.js +0 -90
  475. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge-validate.js +0 -51
  476. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge.js +0 -103
  477. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +0 -2409
  478. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-plugin-inventory.js +0 -273
  479. package/skills/wix-replatform/resources/rp-source-wordpress/secret-value-patterns.v1.json +0 -11
  480. package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +0 -71
  481. package/skills/wix-replatform/resources/rp-source-wordpress/sub-parts.json +0 -13
  482. package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +0 -1046
  483. package/skills/wix-replatform/resources/rp-target-wix/app-page-routing-capabilities.json +0 -36
  484. package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +0 -57
  485. package/skills/wix-replatform/resources/rp-target-wix/domains/SERVICE-PLUGINS.md +0 -322
  486. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/docs-survey.json +0 -70
  487. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +0 -29
  488. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +0 -71
  489. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +0 -83
  490. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +0 -95
  491. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +0 -66
  492. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/docs-survey.json +0 -332
  493. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/domain.json +0 -75
  494. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/booking.json +0 -181
  495. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service-add-on.json +0 -130
  496. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service.json +0 -180
  497. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/docs-survey.json +0 -161
  498. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +0 -25
  499. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +0 -67
  500. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +0 -75
  501. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +0 -41
  502. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/docs-survey.json +0 -204
  503. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +0 -27
  504. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +0 -275
  505. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +0 -105
  506. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +0 -77
  507. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/docs-survey.json +0 -306
  508. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +0 -44
  509. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/delivery-profile.json +0 -171
  510. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/discount-rule.json +0 -182
  511. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-applied-discount.json +0 -129
  512. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-invoice-document.json +0 -192
  513. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item-options.json +0 -123
  514. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +0 -85
  515. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-merchant-note.json +0 -112
  516. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-payment.json +0 -191
  517. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +0 -164
  518. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +0 -462
  519. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/pickup-location.json +0 -122
  520. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/shipping-option.json +0 -98
  521. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/wishlist-item.json +0 -86
  522. package/skills/wix-replatform/resources/rp-target-wix/domains/events/docs-survey.json +0 -128
  523. package/skills/wix-replatform/resources/rp-target-wix/domains/events/domain.json +0 -38
  524. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/category.json +0 -73
  525. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/event.json +0 -107
  526. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/registration-form.json +0 -89
  527. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/rsvp.json +0 -118
  528. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/ticket-definition.json +0 -93
  529. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/docs-survey.json +0 -86
  530. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/domain.json +0 -56
  531. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form-submission.json +0 -121
  532. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form.json +0 -134
  533. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/docs-survey.json +0 -41
  534. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/domain.json +0 -50
  535. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card-product.json +0 -87
  536. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card.json +0 -130
  537. package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +0 -1418
  538. package/skills/wix-replatform/resources/rp-target-wix/domains/media/docs-survey.json +0 -41
  539. package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +0 -24
  540. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +0 -75
  541. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +0 -71
  542. package/skills/wix-replatform/resources/rp-target-wix/domains/members/docs-survey.json +0 -119
  543. package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +0 -23
  544. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +0 -71
  545. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/custom-field.json +0 -82
  546. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member-about.json +0 -77
  547. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +0 -205
  548. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/docs-survey.json +0 -41
  549. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/domain.json +0 -46
  550. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan-order.json +0 -137
  551. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan.json +0 -133
  552. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/docs-survey.json +0 -7
  553. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/domain.json +0 -36
  554. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/amazon-shop-connect.json +0 -71
  555. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/ebay-shop-connect.json +0 -67
  556. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/google-youtube-connect.json +0 -72
  557. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/meta-catalog-connect.json +0 -74
  558. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/pinterest-catalog-connect.json +0 -69
  559. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/tiktok-catalog-connect.json +0 -61
  560. package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +0 -111
  561. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/docs-survey.json +0 -109
  562. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/domain.json +0 -73
  563. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/item-seo-tags.json +0 -148
  564. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/seo-pattern.json +0 -91
  565. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/site-seo-tags.json +0 -79
  566. package/skills/wix-replatform/resources/rp-target-wix/domains/site/docs-survey.json +0 -32
  567. package/skills/wix-replatform/resources/rp-target-wix/domains/site/domain.json +0 -49
  568. package/skills/wix-replatform/resources/rp-target-wix/domains/site/entities/business-contact.json +0 -103
  569. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/docs-survey.json +0 -203
  570. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +0 -42
  571. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/back-in-stock-request.json +0 -119
  572. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/brand.json +0 -111
  573. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +0 -81
  574. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +0 -241
  575. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +0 -118
  576. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-customization.json +0 -111
  577. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +0 -79
  578. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +0 -221
  579. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/promotion.json +0 -84
  580. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/review.json +0 -178
  581. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/subscription-product.json +0 -87
  582. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/docs-survey.json +0 -106
  583. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/domain.json +0 -64
  584. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/manual-tax-mapping.json +0 -119
  585. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-group.json +0 -94
  586. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-region.json +0 -113
  587. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-settings.json +0 -65
  588. package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +0 -64
  589. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-author-attribution.js +0 -165
  590. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-client.js +0 -60
  591. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-duplicates.js +0 -201
  592. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-ledger.js +0 -306
  593. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-report.js +0 -229
  594. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-stage.js +0 -55
  595. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build.js +0 -715
  596. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-media.js +0 -567
  597. package/skills/wix-replatform/resources/rp-target-wix/lib/bulk-results.js +0 -73
  598. package/skills/wix-replatform/resources/rp-target-wix/lib/contact-extended-fields.js +0 -194
  599. package/skills/wix-replatform/resources/rp-target-wix/lib/contact-import.js +0 -133
  600. package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +0 -150
  601. package/skills/wix-replatform/resources/rp-target-wix/lib/coupon-redemption-drift.js +0 -491
  602. package/skills/wix-replatform/resources/rp-target-wix/lib/customer-member.js +0 -104
  603. package/skills/wix-replatform/resources/rp-target-wix/lib/data-extension-schema.js +0 -673
  604. package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +0 -835
  605. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-balance-reconciliation.js +0 -119
  606. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-build.js +0 -566
  607. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-redemption-build.js +0 -249
  608. package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +0 -260
  609. package/skills/wix-replatform/resources/rp-target-wix/lib/order-applied-discount-build.js +0 -63
  610. package/skills/wix-replatform/resources/rp-target-wix/lib/order-buyer.js +0 -187
  611. package/skills/wix-replatform/resources/rp-target-wix/lib/order-channel-build.js +0 -64
  612. package/skills/wix-replatform/resources/rp-target-wix/lib/order-history.js +0 -1027
  613. package/skills/wix-replatform/resources/rp-target-wix/lib/order-invoice-contract.js +0 -90
  614. package/skills/wix-replatform/resources/rp-target-wix/lib/order-payment-mapping.js +0 -420
  615. package/skills/wix-replatform/resources/rp-target-wix/lib/pricing-plan-definition.js +0 -177
  616. package/skills/wix-replatform/resources/rp-target-wix/lib/product-import.js +0 -151
  617. package/skills/wix-replatform/resources/rp-target-wix/lib/product-seo.js +0 -723
  618. package/skills/wix-replatform/resources/rp-target-wix/lib/seo-redirects.js +0 -353
  619. package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-build.js +0 -1437
  620. package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-option-stage.js +0 -354
  621. package/skills/wix-replatform/resources/rp-target-wix/lib/store-config-build.js +0 -134
  622. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-category-attach.js +0 -221
  623. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-inventory.js +0 -248
  624. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +0 -321
  625. package/skills/wix-replatform/resources/rp-target-wix/lib/tax-build.js +0 -231
  626. package/skills/wix-replatform/resources/rp-target-wix/lib/url-mapper-transport.js +0 -28
  627. package/skills/wix-replatform/resources/rp-target-wix/lib/value-utils.js +0 -14
  628. package/skills/wix-replatform/resources/rp-target-wix/lib/variant-correlation.js +0 -34
  629. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +0 -388
  630. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +0 -255
  631. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +0 -6041
  632. package/skills/wix-replatform/resources/rp-target-wix/lib/write-verification.js +0 -3
  633. package/skills/wix-replatform/resources/rp-target-wix/scripts/docs-survey-sync.js +0 -150
  634. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +0 -69
  635. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +0 -100
  636. package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +0 -112
  637. package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +0 -484
  638. package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +0 -318
  639. package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +0 -2831
  640. package/skills/wix-replatform/resources/rp-telemetry/lib/transcript-digest.js +0 -318
  641. package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +0 -83
  642. package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +0 -243
  643. package/skills/wix-replatform/resources/rp-website-continuation/SKILL.md +0 -94
  644. package/skills/wix-replatform/scripts/artifact-freshness.js +0 -76
  645. package/skills/wix-replatform/scripts/census-reconciliation.js +0 -25
  646. package/skills/wix-replatform/scripts/cms-fallback.js +0 -89
  647. package/skills/wix-replatform/scripts/discovered-census.js +0 -26
  648. package/skills/wix-replatform/scripts/discovered-set-status.js +0 -33
  649. package/skills/wix-replatform/scripts/entity-qa-attestation.js +0 -130
  650. package/skills/wix-replatform/scripts/execution-health-check.js +0 -415
  651. package/skills/wix-replatform/scripts/execution-manifest-validate.js +0 -43
  652. package/skills/wix-replatform/scripts/execution-state-prepare.js +0 -128
  653. package/skills/wix-replatform/scripts/expectations-ledger.js +0 -44
  654. package/skills/wix-replatform/scripts/import-contract-verify.js +0 -183
  655. package/skills/wix-replatform/scripts/internal-link-audit.js +0 -90
  656. package/skills/wix-replatform/scripts/item-seo-tags-verify.js +0 -205
  657. package/skills/wix-replatform/scripts/migration-completion.js +0 -76
  658. package/skills/wix-replatform/scripts/orchestration-preflight.js +0 -67
  659. package/skills/wix-replatform/scripts/orchestration-route.js +0 -77
  660. package/skills/wix-replatform/scripts/orchestration-state.js +0 -381
  661. package/skills/wix-replatform/scripts/read-back-gate.js +0 -175
  662. package/skills/wix-replatform/scripts/replatform-console.js +0 -146
  663. package/skills/wix-replatform/scripts/replatform.js +0 -436
  664. package/skills/wix-replatform/scripts/source-secrets.js +0 -77
  665. package/skills/wix-replatform/scripts/url-redirects.js +0 -286
  666. package/skills/wix-replatform/scripts/user-action.js +0 -58
  667. package/skills/wix-replatform/scripts/website-handoff-generate.js +0 -64
  668. package/skills/wix-replatform/scripts/wix-dashboard-url.js +0 -54
  669. package/skills/wix-replatform/scripts/wix-destination.js +0 -143
  670. package/skills/wix-replatform/scripts/wix-headless-scaffold.js +0 -762
  671. package/skills/wix-vibe-headless/SKILL.md +0 -183
  672. package/skills/wix-vibe-headless/install/deploy.cjs +0 -221
  673. package/skills/wix-vibe-headless/install/pin-agents-md.cjs +0 -35
  674. package/skills/wix-vibe-headless/platforms/README.md +0 -26
  675. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed-with-install.md +0 -127
  676. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +0 -121
  677. package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +0 -87
  678. package/skills/wix-vibe-headless/platforms/base44.md +0 -148
  679. package/skills/wix-vibe-headless/platforms/generic.md +0 -132
  680. package/skills/wix-vibe-headless/references/_shared/nav/nav.tanstack.js +0 -30
  681. package/skills/wix-vibe-headless/references/_shared/routing.md +0 -86
  682. package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +0 -270
  683. package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +0 -43
  684. package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +0 -25
  685. package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +0 -15
  686. package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +0 -35
  687. package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +0 -38
  688. package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +0 -40
  689. package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +0 -54
  690. package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +0 -65
  691. package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +0 -50
  692. package/skills/wix-vibe-headless/references/blog/app/rest/wix-blog.js +0 -217
  693. package/skills/wix-vibe-headless/references/blog/seed/SEED.md +0 -99
  694. package/skills/wix-vibe-headless/references/blog/seed/seed-blog.cjs +0 -269
  695. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +0 -342
  696. package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +0 -65
  697. package/skills/wix-vibe-headless/references/bookings/app/components/RentalDurationPicker.jsx +0 -67
  698. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +0 -47
  699. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +0 -13
  700. package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +0 -126
  701. package/skills/wix-vibe-headless/references/bookings/app/hooks/useRentalDuration.js +0 -128
  702. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +0 -110
  703. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +0 -58
  704. package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +0 -95
  705. package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +0 -94
  706. package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +0 -89
  707. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-checkout.js +0 -148
  708. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-rentals.js +0 -250
  709. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-services.js +0 -300
  710. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +0 -154
  711. package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.cjs +0 -333
  712. package/skills/wix-vibe-headless/references/bookings/seed/seed-rentals.cjs +0 -267
  713. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +0 -178
  714. package/skills/wix-vibe-headless/references/cms/app/collection.config.js +0 -31
  715. package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +0 -18
  716. package/skills/wix-vibe-headless/references/cms/app/rest/wix-cms.js +0 -231
  717. package/skills/wix-vibe-headless/references/cms/seed/SEED.md +0 -145
  718. package/skills/wix-vibe-headless/references/donations/INSTRUCTIONS.md +0 -88
  719. package/skills/wix-vibe-headless/references/donations/app/rest/wix-donations.js +0 -112
  720. package/skills/wix-vibe-headless/references/donations/seed/SEED.md +0 -11
  721. package/skills/wix-vibe-headless/references/donations/tests/donations.test.mjs +0 -258
  722. package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +0 -267
  723. package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +0 -23
  724. package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +0 -43
  725. package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +0 -13
  726. package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +0 -29
  727. package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +0 -57
  728. package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +0 -78
  729. package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +0 -27
  730. package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +0 -54
  731. package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +0 -40
  732. package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +0 -81
  733. package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +0 -48
  734. package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +0 -36
  735. package/skills/wix-vibe-headless/references/events/app/rest/wix-events-browse.js +0 -136
  736. package/skills/wix-vibe-headless/references/events/app/rest/wix-events-registration.js +0 -187
  737. package/skills/wix-vibe-headless/references/events/seed/SEED.md +0 -103
  738. package/skills/wix-vibe-headless/references/events/seed/seed-events.cjs +0 -251
  739. package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +0 -487
  740. package/skills/wix-vibe-headless/references/forms/app/hooks/useWixForm.js +0 -425
  741. package/skills/wix-vibe-headless/references/forms/app/lib/wix-form-schema-utils.js +0 -187
  742. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms-submissions.js +0 -238
  743. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms.js +0 -108
  744. package/skills/wix-vibe-headless/references/forms/seed/SEED.md +0 -1836
  745. package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +0 -328
  746. package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +0 -101
  747. package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +0 -33
  748. package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +0 -21
  749. package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +0 -29
  750. package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +0 -54
  751. package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +0 -77
  752. package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +0 -36
  753. package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +0 -32
  754. package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +0 -35
  755. package/skills/wix-vibe-headless/references/members/app/rest/wix-members-auth.js +0 -390
  756. package/skills/wix-vibe-headless/references/members/install/Register.jsx +0 -22
  757. package/skills/wix-vibe-headless/references/members/seed/SEED.md +0 -21
  758. package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +0 -270
  759. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +0 -31
  760. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +0 -15
  761. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +0 -39
  762. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +0 -15
  763. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +0 -29
  764. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +0 -35
  765. package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +0 -27
  766. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +0 -25
  767. package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +0 -39
  768. package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +0 -27
  769. package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +0 -60
  770. package/skills/wix-vibe-headless/references/portfolio/app/rest/wix-portfolio.js +0 -223
  771. package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +0 -90
  772. package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.cjs +0 -236
  773. package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +0 -280
  774. package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +0 -35
  775. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +0 -48
  776. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +0 -16
  777. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +0 -35
  778. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +0 -25
  779. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +0 -28
  780. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +0 -30
  781. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +0 -30
  782. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +0 -53
  783. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +0 -28
  784. package/skills/wix-vibe-headless/references/pricing-plans/app/rest/wix-pricing-plans.js +0 -157
  785. package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +0 -82
  786. package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.cjs +0 -251
  787. package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +0 -13
  788. package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +0 -290
  789. package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +0 -81
  790. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +0 -71
  791. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +0 -43
  792. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +0 -21
  793. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +0 -72
  794. package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +0 -66
  795. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +0 -32
  796. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +0 -73
  797. package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +0 -28
  798. package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +0 -102
  799. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-menu.js +0 -224
  800. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +0 -218
  801. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-reservations.js +0 -107
  802. package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +0 -176
  803. package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.cjs +0 -452
  804. package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +0 -56
  805. package/skills/wix-vibe-headless/references/shared/app/lib/nav.js +0 -9
  806. package/skills/wix-vibe-headless/references/shared/app/rest/wix-client.js +0 -185
  807. package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +0 -8
  808. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +0 -471
  809. package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +0 -20
  810. package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +0 -167
  811. package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +0 -83
  812. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductCard.js +0 -104
  813. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +0 -163
  814. package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +0 -83
  815. package/skills/wix-vibe-headless/references/storefront/app/hooks/useVariantOptions.js +0 -76
  816. package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +0 -64
  817. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-cart.js +0 -176
  818. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-catalog.js +0 -218
  819. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +0 -174
  820. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.cjs +0 -546
@@ -1,1027 +0,0 @@
1
- 'use strict';
2
-
3
- // An imported order's history as ONE composite write.
4
- //
5
- // Four writes with an ordering constraint, a shared identity, two inputs that come from neither
6
- // the source nor the mapping plan, and one piece of state that must outlive a crash. The first
7
- // caller to assemble that by hand -- with the whole spec in context -- made four mistakes in an
8
- // afternoon, and two of them were silent: a mis-named gate parameter that reported a plausible
9
- // zero, and a missing order crosswalk that would have duplicated the store. The writers were
10
- // right every time. So the SEQUENCE lives here, and a caller supplies facts: a mapped order body
11
- // and the source's evidence. No ordering, no reconciliation, no gate invocation, no state.
12
- //
13
- // THE ORDER WRITE'S IDENTITY. LIVE-VERIFIED 2026-09-05 against a disposable site:
14
- // Import Order ACCEPTS a
15
- // caller-supplied `id` it has never seen and keeps it; a re-send with the same id fully replaces
16
- // the order body; payments and extendedFields attached to the order SURVIVE the replace; a
17
- // non-GUID id is refused with a 400. So the order id is DERIVED here from the source site and
18
- // the source order id, which makes the order write idempotent on the target's own terms: a run
19
- // that lost its crosswalk asks the target whether the derived id exists, and finds it. The
20
- // crosswalk is still written -- before anything else -- but it is an accelerator and a report
21
- // input, not the only thing standing between a crash and a duplicated store.
22
- //
23
- // What the probe ALSO showed, and why an existing order is never re-sent: a different order body
24
- // with an existing id replaces it silently, and nothing distinguishes "replace mine" from
25
- // "clobber a merchant's edits". So an order that already exists is RECONCILED (left alone) and
26
- // its history continued, never re-imported. Search Orders is not used as an existence check: it
27
- // read a stale number within a second of a change, and an id read is exact.
28
-
29
- const crypto = require('node:crypto');
30
- const fs = require('node:fs/promises');
31
- const path = require('node:path');
32
- const w = require('./wix-writers.js');
33
- const paymentMapping = require('./order-payment-mapping.js');
34
- const localState = require('../../../lib/local-state.js');
35
- const approvalStamp = require('../../../lib/preservation-approval-stamp.js');
36
- const orderBuyer = require('./order-buyer.js');
37
- const customerMember = require('./customer-member.js');
38
- const fsSync = require('node:fs');
39
-
40
- const GUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
41
-
42
- // A bounded retry for the TWO writes in this file that have earned one, and nowhere else. It is
43
- // deliberately not on the shared client: bulk coupon, contact, member, form-submission, product
44
- // and media creation are not reconciled against the target before writing, so a failure arriving
45
- // AFTER the target committed would be retried into a second copy -- worse than the problem.
46
- //
47
- // Both sites below are reconciled first, so the second attempt is demonstrably the SAME attempt:
48
- // the order id is derived from the source and the writer refuses a caller-chosen one, and the
49
- // payment write is preceded by a read that decides create-or-adopt.
50
- //
51
- // `isTransientWixError` says the condition is likely to clear; whether a retry can duplicate
52
- // anything is this call site's question, and only these two can answer it yes.
53
- const WRITE_RETRY_ATTEMPTS = 3;
54
- const WRITE_RETRY_DELAYS_MS = [500, 1500];
55
- const realSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
56
-
57
- const ORDER_OUTCOMES = Object.freeze({
58
- IMPORTED: 'order-imported',
59
- ALREADY_IMPORTED: 'order-already-imported',
60
- IMPORT_FAILED: 'order-import-failed',
61
- TARGET_READ_FAILED: 'order-target-read-failed',
62
- });
63
-
64
- // The evidence contract. A key outside this list is REFUSED, not ignored: an ignored key is how
65
- // `sourceAmount` for `amount` reported every order in a live store as never paid, with no reason.
66
- const EVIDENCE_KEYS = Object.freeze([
67
- 'amount', 'paidDate', 'altPaidDate', 'currency', 'status', 'distinctAmountCount', 'utcOffsetMinutes',
68
- 'paidDateZone', 'altPaidDateZone',
69
- 'methodName', 'providerTransactionId', 'offlinePayment', 'cardDisplay',
70
- 'refunds', 'invoice',
71
- ]);
72
- const REFUND_KEYS = Object.freeze(['sourceId', 'amount', 'reason']);
73
- const INVOICE_KEYS = Object.freeze(['approval', 'sourceUrl', 'invoiceNumber', 'pendingMediaFileId']);
74
- // Names a caller is likely to reach for, and where each actually goes.
75
- const MISNAMED = Object.freeze({
76
- sourceAmount: 'amount', total: 'amount', orderTotal: 'amount',
77
- sourcePaidDate: 'paidDate', datePaid: 'paidDate', paid: 'paidDate',
78
- // The two source stamps are NOT interchangeable and must not both land on `paidDate`: the
79
- // `_gmt` sibling is universal by the source schema's definition of that key, the plain one is
80
- // the shop's wall clock. Routing both here is how one shop offset came to be applied to a
81
- // value that was already universal, moving the payment by the whole offset.
82
- date_paid_gmt: "paidDate, declared paidDateZone: 'utc'",
83
- date_paid: "altPaidDate, declared altPaidDateZone: 'site-local'",
84
- sourceCurrency: 'currency',
85
- targetCurrency: 'nothing here -- the target currency is read from order.currency',
86
- transactionId: 'providerTransactionId', transaction_id: 'providerTransactionId', reference: 'providerTransactionId',
87
- method: 'methodName', paymentMethod: 'methodName', payment_method: 'methodName', payment_method_title: 'methodName',
88
- sourceStatus: 'status',
89
- refund: 'refunds (an array)', invoices: 'invoice (one document per order)',
90
- });
91
-
92
- function isPlainObject(value) {
93
- return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
94
- }
95
-
96
- function assertKeys(object, allowed, label) {
97
- if (!isPlainObject(object)) throw new Error(`${label} must be an object, got ${JSON.stringify(object)}`);
98
- const unknown = Object.keys(object).filter((key) => !allowed.includes(key));
99
- if (unknown.length === 0) return;
100
- const hints = unknown.map((key) => (MISNAMED[key] ? `${key} (this contract calls it ${MISNAMED[key]})` : key));
101
- throw new Error(
102
- `${label} carries keys this contract does not read: ${hints.join(', ')}. Accepted: ${allowed.join(', ')}. `
103
- + 'Unknown keys are refused rather than ignored, because an ignored key reads exactly like a source that evidences nothing.',
104
- );
105
- }
106
-
107
- // Known keys with malformed VALUES are as silent as unknown keys: `offlinePayment: "false"` was
108
- // dropped rather than read, a scalar `cardDisplay` lost the card evidence, and
109
- // `distinctAmountCount: "unknown"` became NaN, which is "not more than one", which let a
110
- // multi-payment order through the gate. Each is refused with the key and the value it got.
111
- const EVIDENCE_TYPES = Object.freeze({
112
- amount: (v) => typeof v === 'string' || (typeof v === 'number' && Number.isFinite(v)),
113
- paidDate: (v) => typeof v === 'string',
114
- altPaidDate: (v) => typeof v === 'string',
115
- currency: (v) => typeof v === 'string',
116
- status: (v) => typeof v === 'string',
117
- distinctAmountCount: (v) => Number.isInteger(v) && v >= 1,
118
- // UTC-14 to UTC+14 is every offset that exists; 999999 accepted here moved a payment two years.
119
- utcOffsetMinutes: (v) => Number.isInteger(v) && v >= -840 && v <= 840,
120
- // A clock is a two-member enumeration, refused rather than coerced: 'UTC', true and 0 each
121
- // read exactly like a correctly-declared clock once coerced, and would restore the defect
122
- // these keys exist to remove -- silently, on a financial value.
123
- paidDateZone: (v) => v === 'utc' || v === 'site-local',
124
- altPaidDateZone: (v) => v === 'utc' || v === 'site-local',
125
- methodName: (v) => typeof v === 'string',
126
- providerTransactionId: (v) => typeof v === 'string',
127
- offlinePayment: (v) => typeof v === 'boolean',
128
- cardDisplay: (v) => isPlainObject(v)
129
- && Object.keys(v).every((k) => k === 'lastFourDigits' || k === 'brand')
130
- && Object.values(v).every((x) => x === null || x === undefined || typeof x === 'string'),
131
- });
132
- const EVIDENCE_TYPE_HINTS = Object.freeze({
133
- amount: 'a decimal string or finite number',
134
- paidDate: 'an ISO date-time string', altPaidDate: 'an ISO date-time string',
135
- currency: 'an ISO 4217 code string', status: 'a string',
136
- distinctAmountCount: 'a positive integer', utcOffsetMinutes: 'an integer between -840 and 840',
137
- paidDateZone: "'utc' or 'site-local'", altPaidDateZone: "'utc' or 'site-local'",
138
- methodName: 'a string', providerTransactionId: 'a string',
139
- offlinePayment: 'a real boolean (not the string "false")',
140
- cardDisplay: 'an object { lastFourDigits?, brand? } of strings',
141
- });
142
-
143
- function assertEvidence(evidence, { sourceId = null } = {}) {
144
- assertKeys(evidence, EVIDENCE_KEYS, 'evidence');
145
- // Internal: the source id the approval must name. Not a contract key -- set on a shallow copy.
146
- evidence = { ...evidence, __sourceId: sourceId };
147
- for (const [key, accepts] of Object.entries(EVIDENCE_TYPES)) {
148
- const value = evidence[key];
149
- if (value === undefined || value === null) continue;
150
- if (!accepts(value)) {
151
- throw new Error(`evidence.${key} must be ${EVIDENCE_TYPE_HINTS[key]}, got ${JSON.stringify(value)}`);
152
- }
153
- }
154
- // Cross-key: a shop offset supplied beside a stamp whose clock nobody stated. Knowing the shop's
155
- // offset is exactly the case where getting the clock wrong moves the money -- the offset is
156
- // applied, so a stamp that was already universal lands hours out. The 'site-local' default exists
157
- // to leave callers that never knew the offset untouched; it is not allowed to cover this shape.
158
- // Per PRESENT stamp, not once per record: declaring one clock and leaving the other on the
159
- // default reads as though the caller had been updated while still exposing a stamp the offset can
160
- // move. Deliberately NOT widened to "offset present => declaration required": an unpaid order in
161
- // a shop whose offset the run happens to know has no stamp to misapply it to.
162
- if (evidence.utcOffsetMinutes !== undefined && evidence.utcOffsetMinutes !== null) {
163
- for (const [stamp, zoneKey] of [['paidDate', 'paidDateZone'], ['altPaidDate', 'altPaidDateZone']]) {
164
- if (evidence[stamp] === undefined || evidence[stamp] === null) continue;
165
- if (evidence[zoneKey] !== undefined && evidence[zoneKey] !== null) continue;
166
- throw new Error(
167
- `evidence.${stamp} needs ${zoneKey} ('utc' or 'site-local') when utcOffsetMinutes is supplied; `
168
- + 'without it the offset may be applied to a stamp that is already universal',
169
- );
170
- }
171
- }
172
- if (evidence.refunds !== undefined) {
173
- if (!Array.isArray(evidence.refunds)) throw new Error('evidence.refunds must be an array (one entry per source refund)');
174
- evidence.refunds.forEach((refund, index) => {
175
- assertKeys(refund, REFUND_KEYS, `evidence.refunds[${index}]`);
176
- if (refund.sourceId === undefined || refund.sourceId === null || String(refund.sourceId).trim() === '') {
177
- throw new Error(`evidence.refunds[${index}] needs a sourceId; occurrence numbers are assigned by it and a re-run recognizes its own refunds through it`);
178
- }
179
- // A refund with no positive amount would reach Refund Payments as `amount: "undefined"` --
180
- // after the payment create it hangs off. Refused here, before any target call.
181
- const amount = paymentMapping.canonicalizeDecimal(refund.amount);
182
- if (amount === null || !(Number(amount) > 0)) {
183
- throw new Error(`evidence.refunds[${index}] needs a positive amount, got ${JSON.stringify(refund.amount)}`);
184
- }
185
- });
186
- }
187
- if (evidence.invoice !== undefined && evidence.invoice !== null) {
188
- const invoice = evidence.invoice;
189
- assertKeys(invoice, INVOICE_KEYS, 'evidence.invoice');
190
- // The approval must be the PLANNER's. The writer only insists on the stamp where an opt-in is
191
- // relied on; this composite insists everywhere, because a hand-built reference-only approval
192
- // with an object for a number wrote "[object Object]" onto an order in review. The plan is the
193
- // one producer, and it stamps everything it issues.
194
- if (!isPlainObject(invoice.approval) || !approvalStamp.verifyApprovalStamp(invoice.approval)) {
195
- throw new Error('evidence.invoice.approval must be an approval issued by resolvePreservationPlan() (it carries the plan\'s stamp); pass the plan\'s object, do not rebuild it');
196
- }
197
- // The planner's approvals name their order, and the stamp covers that name. One handed over
198
- // for a different source order would preserve somebody else's document onto this one (review
199
- // demonstrated it), and one with the order DELETED after stamping would fit any order (review
200
- // demonstrated that too) -- so the order is required, not merely compared when present.
201
- if (invoice.approval.orderId === undefined || invoice.approval.orderId === null || String(invoice.approval.orderId).trim() === '') {
202
- throw new Error('evidence.invoice.approval names no source order (orderId); resolvePreservationPlan() issues approvals per order, and one without an order could be handed to any');
203
- }
204
- if (String(invoice.approval.orderId) !== String(evidence.__sourceId)) {
205
- throw new Error(`evidence.invoice.approval is for source order ${invoice.approval.orderId}, not ${evidence.__sourceId}`);
206
- }
207
- const optional = (key, accepts, hint) => {
208
- const v = invoice[key];
209
- if (v === undefined || v === null) return;
210
- if (!accepts(v)) throw new Error(`evidence.invoice.${key} must be ${hint}, got ${JSON.stringify(v)}`);
211
- };
212
- optional('sourceUrl', (v) => typeof v === 'string', 'a URL string');
213
- optional('invoiceNumber', (v) => typeof v === 'string' || typeof v === 'number', 'a string or number');
214
- optional('pendingMediaFileId', (v) => typeof v === 'string' && v.trim() !== '', 'a Media file id string');
215
- }
216
- }
217
-
218
- // A stable GUID for a source order on this target. Version-5 style: a SHA-1 over a namespaced
219
- // name with the version and variant bits set, which is what Import Order accepted live. The
220
- // source SITE is part of the name so two stores importing "order 1042" into one Wix site cannot
221
- // collide -- and so a migration re-run from the same store converges on the same order.
222
- // `shop.example`, `https://shop.example/`, `SHOP.EXAMPLE:443` and `shop.example/wp` are one site.
223
- // Four spellings deriving four ids would re-import a store the day a config string gained a
224
- // scheme, so the host is normalized to its bare lowercase hostname (a non-default port is kept).
225
- function normalizeSourceSiteHost(sourceSiteHost) {
226
- let text = String(sourceSiteHost === undefined || sourceSiteHost === null ? '' : sourceSiteHost).trim().toLowerCase();
227
- if (!text) return '';
228
- if (!/^[a-z][a-z0-9+.-]*:\/\//.test(text)) text = `https://${text}`;
229
- let url;
230
- try { url = new URL(text); } catch (error) { return ''; }
231
- return url.port && url.port !== '443' ? `${url.hostname}:${url.port}` : url.hostname;
232
- }
233
-
234
- function deriveImportedOrderId({ sourceSiteHost, sourceId } = {}) {
235
- const host = normalizeSourceSiteHost(sourceSiteHost);
236
- const id = sourceId === undefined || sourceId === null ? '' : String(sourceId).trim();
237
- if (!host) throw new Error('deriveImportedOrderId needs sourceSiteHost (a hostname, or a URL it can be read from): the id is namespaced by the source site');
238
- if (!id) throw new Error('deriveImportedOrderId needs the source order id');
239
- const hash = crypto.createHash('sha1').update(`replatform:ecom:order:${host}:${id}`).digest();
240
- hash[6] = (hash[6] & 0x0f) | 0x50;
241
- hash[8] = (hash[8] & 0x3f) | 0x80;
242
- const hex = hash.toString('hex');
243
- return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20, 32)}`;
244
- }
245
-
246
- // Same rule as rp-source-wordpress's assignRefundOccurrences, kept target-side so this module does
247
- // not depend on a source adapter: two source refunds of equal amount on one order are the first
248
- // and second OCCURRENCE of that amount, ordered by source id, and reconcile as such. Pass ALL of an
249
- // order's refunds in one call -- occurrences are relative to the list.
250
- function withOccurrences(refunds) {
251
- const seen = new Map();
252
- return [...refunds]
253
- .sort((a, b) => String(a.sourceId).localeCompare(String(b.sourceId)))
254
- .map((refund) => {
255
- const key = paymentMapping.canonicalizeDecimal(refund.amount) || String(refund.amount);
256
- const occurrence = (seen.get(key) || 0) + 1;
257
- seen.set(key, occurrence);
258
- return { ...refund, sourceOccurrence: occurrence };
259
- });
260
- }
261
-
262
- function describeError(error) {
263
- return {
264
- message: String((error && error.message) || error).slice(0, 300),
265
- ...(error && error.status ? { status: error.status } : {}),
266
- // Conditional, like the rest: an unknown outcome is the exceptional case, and making this
267
- // unconditional would change the shape of every row already written to a results ledger.
268
- // Without it, the rejected-vs-unknown distinction is lost the moment it is recorded.
269
- ...(error && error.outcomeKnown === false ? { outcomeKnown: false } : {}),
270
- ...(error && error.applicationErrorCode ? { applicationErrorCode: error.applicationErrorCode } : {}),
271
- };
272
- }
273
-
274
- function assertCrosswalk(crosswalk) {
275
- const has = (name) => crosswalk && typeof crosswalk[name] === 'function';
276
- if (!has('get') || !has('set') || !has('getInvoiceFile') || !has('setInvoiceFile')) {
277
- throw new Error(
278
- 'importOrderHistory needs a persisted crosswalk with get(sourceId), set(sourceId, orderId), '
279
- + 'getInvoiceFile(sourceId) and setInvoiceFile(sourceId, fileId). It is not optional: a run that '
280
- + 'forgets it re-imports the store, and one that forgets the invoice file imports a second copy of a '
281
- + 'tax document. createProjectOrderCrosswalk({ projectDir }) provides all four over state/crosswalk/.',
282
- );
283
- }
284
- }
285
-
286
- // Fill every remaining stage with a named outcome once the order stage has failed. Nothing else
287
- // is attempted: with no order there is nothing to attach a payment or a document to, and a payment
288
- // that was never attempted because of an import failure is a FAILURE, not an ineligibility.
289
- function failRemaining(outcomes, errors, { gate, refunds, evidence, cause }) {
290
- outcomes.payment = gate.eligible ? 'payment-failed' : gate.outcome;
291
- if (gate.eligible) errors.payment = { cause };
292
- outcomes.refunds = refunds.map((refund) => ({
293
- sourceId: refund.sourceId,
294
- sourceOccurrence: refund.sourceOccurrence,
295
- outcome: gate.eligible ? 'refund-failed' : 'refund-without-payment',
296
- ...(gate.eligible ? { error: { cause } } : {}),
297
- }));
298
- outcomes.invoice = evidence.invoice ? 'invoice-failed' : 'invoice-none-found';
299
- if (evidence.invoice) errors.invoice = { cause };
300
- }
301
-
302
- // ---- contact fields --------------------------
303
- // A source email or phone Import Order refuses fails the WHOLE order. The policy: a
304
- // contact detail is removed only when Import Order's own rejection NAMES that field, and the
305
- // order is then sent once more without it. Never removed on a local or customer-path check
306
- // alone, never rewritten, never replaced with an invented value. Every removal is a named
307
- // finding carrying the field and a reason, never the value.
308
- //
309
- // The field list is READ from `domains/ecom/entities/order.json` -> `safeModeContactFields[]`,
310
- // the same list safe mode replaces, so the two cannot drift apart.
311
- const ORDER_ENTITY_JSON = path.join(__dirname, '..', 'domains', 'ecom', 'entities', 'order.json');
312
- let CONTACT_FIELDS = null;
313
- function orderContactFields() {
314
- if (CONTACT_FIELDS) return CONTACT_FIELDS;
315
- const entity = JSON.parse(fsSync.readFileSync(ORDER_ENTITY_JSON, 'utf8'));
316
- const fields = Array.isArray(entity.safeModeContactFields) ? entity.safeModeContactFields : [];
317
- if (fields.length === 0) throw new Error(`${ORDER_ENTITY_JSON} carries no safeModeContactFields[]; the contact-field rules read their list from there and will not guess one`);
318
- for (const field of fields) {
319
- if (field.kind !== 'email' && field.kind !== 'phone') {
320
- throw new Error(`safeModeContactFields[] entry ${field.targetPath} has kind ${JSON.stringify(field.kind)}; only "email" and "phone" are known`);
321
- }
322
- }
323
- CONTACT_FIELDS = Object.freeze(fields.map((field) => Object.freeze({ kind: String(field.kind), targetPath: String(field.targetPath) })));
324
- return CONTACT_FIELDS;
325
- }
326
-
327
- function readAtPath(object, dotted) {
328
- let node = object;
329
- for (const key of dotted.split('.')) {
330
- if (!isPlainObject(node)) return undefined;
331
- node = node[key];
332
- }
333
- return node;
334
- }
335
-
336
- // Copy-on-write down the path only; the caller's object is never mutated.
337
- function withoutPath(object, dotted) {
338
- const [head, ...rest] = dotted.split('.');
339
- if (!isPlainObject(object) || !(head in object)) return object;
340
- if (rest.length === 0) {
341
- const next = { ...object };
342
- delete next[head];
343
- return next;
344
- }
345
- const child = withoutPath(object[head], rest.join('.'));
346
- return child === object[head] ? object : { ...object, [head]: child };
347
- }
348
-
349
- function presentValue(value) {
350
- if (value === undefined || value === null) return null;
351
- const text = String(value).trim();
352
- return text === '' ? null : text;
353
- }
354
-
355
- // Advisory only. Run on the SOURCE-DERIVED body, before `buildImportOrderRequest`
356
- // applies safe mode: safe mode's mocks always pass, so a check placed after it would report zero
357
- // suspects on every rehearsal. The body is never changed; a suspect is a forecast, not a loss.
358
- function checkOrderContactFields(order, { sourceId = null } = {}) {
359
- if (!isPlainObject(order)) throw new Error('checkOrderContactFields needs the mapped target order body as `order`');
360
- const findings = [];
361
- const id = sourceId === undefined || sourceId === null ? null : String(sourceId);
362
- const countryCode = presentValue(readAtPath(order, 'billingInfo.address.country'));
363
- for (const field of orderContactFields()) {
364
- const value = presentValue(readAtPath(order, field.targetPath));
365
- if (value === null) continue; // an absent detail is not a defect
366
- if (field.kind === 'email') {
367
- if (orderBuyer.normalizeEmail(value) === null) {
368
- findings.push({ code: 'order-contact-email-suspect', ...(id ? { sourceId: id } : {}), field: field.targetPath, reason: 'not-a-sendable-address' });
369
- }
370
- } else {
371
- const normalized = customerMember.normalizePhoneE164(value, countryCode);
372
- if (!normalized.ok) {
373
- findings.push({ code: 'order-contact-phone-suspect', ...(id ? { sourceId: id } : {}), field: field.targetPath, reason: String(normalized.reason) });
374
- }
375
- }
376
- }
377
- return { findings };
378
- }
379
-
380
- // Which contact fields did Import Order's rejection NAME? Only a 400 with a structured
381
- // `fieldViolations[]` counts, and only an EXACT path match (after an optional leading `order.`
382
- // request wrapper) against `safeModeContactFields[]`. Message text is never parsed. All or
383
- // nothing: one violation that is not an identified contact field means no removal (null).
384
- function identifyRejectedContactFields(error) {
385
- if (!error || error.status !== 400) return null;
386
- const violations = error.body && error.body.details && error.body.details.validationError
387
- && error.body.details.validationError.fieldViolations;
388
- if (!Array.isArray(violations) || violations.length === 0) return null;
389
- const known = new Set(orderContactFields().map((field) => field.targetPath));
390
- const paths = [];
391
- for (const violation of violations) {
392
- const raw = violation && typeof violation.field === 'string' ? violation.field : null;
393
- if (raw === null) return null;
394
- const field = raw.startsWith('order.') ? raw.slice('order.'.length) : raw;
395
- if (!known.has(field)) return null;
396
- if (!paths.includes(field)) paths.push(field);
397
- }
398
- return paths;
399
- }
400
-
401
- // The composite. Returns outcomes; throws only for CALLER errors (a malformed contract), never for
402
- // a target failure -- each stage's failure is a named outcome so a resumed run reconciles what
403
- // landed and retries only what did not.
404
- async function importOrderHistory(wix, {
405
- order,
406
- sourceId,
407
- sourceSiteHost,
408
- evidence,
409
- crosswalk,
410
- setupVerification = null,
411
- pacer = null,
412
- safeModeOptions = undefined,
413
- // Injectable only so the retry tests do not spend the delay ladder in real time.
414
- sleep = null,
415
- // The buyer, from resolveOrderBuyer -- stamped, so a hand-built memberId cannot reach
416
- // the order. Optional: an order with no buyer resolution imports with whatever contactId the
417
- // mapped body already carries, and never a memberId.
418
- buyer = null,
419
- } = {}) {
420
- if (!wix || typeof wix.send !== 'function') throw new Error('importOrderHistory needs a Wix client');
421
- const sleepFor = sleep || realSleep;
422
- const findings_pre = [];
423
- if (!isPlainObject(order)) throw new Error('importOrderHistory needs the mapped target order body as `order`');
424
- assertCrosswalk(crosswalk);
425
- assertEvidence(evidence, { sourceId });
426
- const derivedId = deriveImportedOrderId({ sourceSiteHost, sourceId });
427
- if (order.id !== undefined && order.id !== derivedId) {
428
- throw new Error(`order.id is not the caller's to choose: got ${order.id}, this order derives to ${derivedId}. Omit it.`);
429
- }
430
- // buyerInfo.memberId is what member-facing reads authorize on, and Import Order stores any GUID
431
- // unvalidated (verified live 2026-09-05). So it is never the caller's to set on the body: it comes
432
- // through `buyer`, corroborated and stamped by resolveOrderBuyer, or not at all.
433
- orderBuyer.assertBodyBuyerInfo(order);
434
- // No buyer resolution is itself a counted outcome, so the buyer stage partitions the order
435
- // population like the payment stage does.
436
- let buyerOutcome = 'buyer-not-resolved';
437
- if (buyer !== null && buyer !== undefined) {
438
- if (!orderBuyer.verifyBuyerStamp(buyer)) throw new Error('`buyer` must be the unchanged result of resolveOrderBuyer (its stamp did not verify)');
439
- // The resolver corroborated the member against ONE order's billing email, and the stamp covers
440
- // that email. The BODY's email must be the same one: a result resolved for jane@ handed over
441
- // beside a body carrying victim@ would attribute the victim's order and invoice to Jane, with
442
- // the stamp verifying (review demonstrated it). Bound for every outcome -- a resolution made for
443
- // a different order is wrong whatever it decided -- and a linked result requires the body to
444
- // carry the email at all, so the two are never merely "both absent".
445
- const rawBodyEmail = order.buyerInfo && order.buyerInfo.email;
446
- const bodyEmail = orderBuyer.normalizeEmail(rawBodyEmail);
447
- const bodyHasEmail = rawBodyEmail !== undefined && rawBodyEmail !== null && String(rawBodyEmail).trim() !== '';
448
- if (buyer.email && bodyHasEmail && bodyEmail !== buyer.email) {
449
- throw new Error('`buyer` was resolved for a different billing email than order.buyerInfo.email carries; resolve the buyer from THIS order\'s billing email');
450
- }
451
- if (buyer.memberId && (!bodyHasEmail || bodyEmail !== buyer.email)) {
452
- throw new Error('a linked `buyer` requires order.buyerInfo.email to be the billing email the member was corroborated against; the body carries none or another');
453
- }
454
- const info = orderBuyer.buyerInfoFrom(buyer);
455
- // Replace, not merge: only the body's email survives beside what the resolver decided.
456
- const kept = order.buyerInfo && order.buyerInfo.email ? { email: order.buyerInfo.email } : {};
457
- order = { ...order, buyerInfo: { ...kept, ...(order.buyerInfo && order.buyerInfo.contactId && !info.contactId ? { contactId: order.buyerInfo.contactId } : {}), ...info } };
458
- buyerOutcome = buyer.outcome;
459
- for (const finding of buyer.findings || []) findings_pre.push(finding);
460
- }
461
-
462
- const findings = findings_pre;
463
- const errors = {};
464
- const outcomes = { order: null, payment: null, refunds: [], invoice: null, buyer: buyerOutcome };
465
-
466
- // The gate runs FIRST and from the evidence structure, so a caller cannot mis-name a parameter
467
- // into a silent zero. It is pure: no target read is spent on an order the source never paid.
468
- const gate = paymentMapping.evaluatePaymentEligibility({
469
- sourceAmount: evidence.amount === undefined ? null : evidence.amount,
470
- paidDate: evidence.paidDate === undefined ? null : evidence.paidDate,
471
- altPaidDate: evidence.altPaidDate === undefined ? null : evidence.altPaidDate,
472
- distinctAmountCount: evidence.distinctAmountCount === undefined ? 1 : evidence.distinctAmountCount,
473
- sourceCurrency: evidence.currency === undefined ? null : evidence.currency,
474
- targetCurrency: order.currency === undefined ? null : order.currency,
475
- utcOffsetMinutes: evidence.utcOffsetMinutes === undefined ? null : evidence.utcOffsetMinutes,
476
- paidDateZone: evidence.paidDateZone === undefined || evidence.paidDateZone === null ? 'site-local' : evidence.paidDateZone,
477
- altPaidDateZone: evidence.altPaidDateZone === undefined || evidence.altPaidDateZone === null ? 'site-local' : evidence.altPaidDateZone,
478
- sourceStatus: evidence.status === undefined ? null : evidence.status,
479
- });
480
- findings.push(...(gate.findings || []));
481
-
482
- let payment = null;
483
- if (gate.eligible) {
484
- const built = paymentMapping.buildPaymentRecord({
485
- amount: gate.amount,
486
- createdDate: gate.createdDate,
487
- methodName: evidence.methodName === undefined ? null : evidence.methodName,
488
- providerTransactionId: evidence.providerTransactionId === undefined ? null : evidence.providerTransactionId,
489
- offlinePayment: evidence.offlinePayment,
490
- cardDisplay: evidence.cardDisplay === undefined ? null : evidence.cardDisplay,
491
- });
492
- payment = built.payment;
493
- findings.push(...(built.findings || []));
494
- }
495
- const refunds = withOccurrences(evidence.refunds || []);
496
-
497
- // ---- 1. The order. Crosswalk hit or miss, the TARGET is asked once by id. -------------------
498
- // A hit is not proof: the docs' own use of Bulk Delete Imported Orders is "clear a faulty
499
- // migration before re-importing", and a crosswalk that survived that must not report an order
500
- // the target no longer has. Only a readable 404 proves absence; an unreadable gateway
501
- // response must not authorize Import Order, which can replace an existing order.
502
- let orderId = derivedId;
503
- const readPacer = pacer || w.sharedTargetReadPacer();
504
- const existsOnTarget = async (id) => {
505
- const read = await readPacer.read(() => w.getOrder(wix, id));
506
- if (read.ok) return { exists: true };
507
- if (read.error && read.error.status === 404 && read.error.outcomeKnown !== false) return { exists: false };
508
- return { exists: null, error: read.error };
509
- };
510
- const known = await crosswalk.get(sourceId);
511
- // The crosswalk's answer is trusted as the order's identity, so its SHAPE is not: a row object
512
- // where a string was expected became `orders/[object Object]/add-payment` in review. Only a
513
- // GUID-shaped string may stand for an order; anything else is a broken crosswalk, which is a
514
- // caller problem and stops the run rather than continuing history onto a nonsense id.
515
- if (known !== null && known !== undefined && known !== '' && !GUID.test(String(known))) {
516
- throw new Error(`the crosswalk returned ${JSON.stringify(known)} for source order ${sourceId}; a crosswalk value must be the Wix order id (a GUID string) or null`);
517
- }
518
- // A row from before deterministic ids (a Wix-minted id) is still THE order: honouring it is what
519
- // keeps an earlier migration from being re-imported under a derived id.
520
- const candidateId = known ? String(known) : derivedId;
521
- const probe = await existsOnTarget(candidateId);
522
- if (probe.exists === null) {
523
- // Cannot tell whether the order is there. Importing now could replace a merchant-edited order;
524
- // not importing loses nothing a retry cannot recover. So: a named outcome, no write.
525
- outcomes.order = ORDER_OUTCOMES.TARGET_READ_FAILED;
526
- errors.order = describeError(probe.error);
527
- failRemaining(outcomes, errors, { gate, refunds, evidence, cause: 'order-not-imported' });
528
- return { orderId: null, derivedId, outcomes, findings, errors, paymentId: null, invoice: null };
529
- }
530
- if (probe.exists) {
531
- orderId = candidateId;
532
- if (known && orderId !== derivedId) findings.push({ code: 'order-id-from-crosswalk', sourceId: String(sourceId), orderId });
533
- outcomes.order = ORDER_OUTCOMES.ALREADY_IMPORTED;
534
- if (!known) {
535
- // The crosswalk had lost it; adopt it.
536
- try { await crosswalk.set(sourceId, orderId); } catch (error) { errors.crosswalk = describeError(error); }
537
- }
538
- } else {
539
- let derivedExists = false;
540
- if (known) {
541
- // The crosswalk points at an order the target no longer has -- a cleared migration, or a
542
- // stale row. Before importing under the derived id, ask whether THAT order already exists:
543
- // Import Order with an existing id silently replaces it, and a merchant's edits with it
544
- // (review demonstrated exactly that). If it exists, adopt it and replace the row.
545
- const derivedProbe = await existsOnTarget(derivedId);
546
- if (derivedProbe.exists === null) {
547
- outcomes.order = ORDER_OUTCOMES.TARGET_READ_FAILED;
548
- errors.order = describeError(derivedProbe.error);
549
- failRemaining(outcomes, errors, { gate, refunds, evidence, cause: 'order-not-imported' });
550
- return { orderId: null, derivedId, outcomes, findings, errors, paymentId: null, invoice: null };
551
- }
552
- derivedExists = derivedProbe.exists === true;
553
- findings.push(derivedExists
554
- ? { code: 'order-crosswalk-row-stale', sourceId: String(sourceId), previousOrderId: String(known), orderId: derivedId }
555
- : { code: 'order-reimported-after-deletion', sourceId: String(sourceId), previousOrderId: String(known) });
556
- }
557
- if (derivedExists) {
558
- orderId = derivedId;
559
- outcomes.order = ORDER_OUTCOMES.ALREADY_IMPORTED;
560
- } else {
561
- try {
562
- // Retried on a transient failure, and safe to: the id is derived from the source and
563
- // `:296` refuses a caller-chosen one, so a second attempt re-sends the same identity. A
564
- // retry that comes back already-imported is a SUCCESS -- the existing ALREADY_IMPORTED
565
- // outcome covers it. Only the send is wrapped: the checks below it are permanent
566
- // refusals, not conditions that clear.
567
- const send = async (body) => {
568
- for (let attempt = 1; ; attempt += 1) {
569
- try {
570
- return await w.importOrder(wix, { ...body, id: derivedId }, safeModeOptions);
571
- } catch (error) {
572
- if (attempt >= WRITE_RETRY_ATTEMPTS || !w.isTransientWixError(error)) throw error;
573
- await sleepFor(WRITE_RETRY_DELAYS_MS[attempt - 1]);
574
- }
575
- }
576
- };
577
- // Advisory, on the source-derived body, once, before the first send
578
- // (where safe mode is applied). Not repeated for the retry below.
579
- findings.push(...checkOrderContactFields(order, { sourceId }).findings);
580
- let imported = null;
581
- let removed = [];
582
- try {
583
- imported = await send(order);
584
- } catch (error) {
585
- // One retry, only when the rejection names contact fields the body
586
- // actually carries. The first call was refused and created nothing, so the retry under
587
- // the same derived id is not a duplicate. The retry body is the SOURCE-DERIVED order
588
- // minus exactly those paths -- safe mode still applies to what remains -- and on a
589
- // member-linked order it keeps `buyerInfo.memberId`/`contactId` untouched.
590
- const paths = identifyRejectedContactFields(error);
591
- if (!paths || !paths.every((p) => readAtPath(order, p) !== undefined)) throw error;
592
- const retryBody = paths.reduce((body, p) => withoutPath(body, p), order);
593
- imported = await send(retryBody);
594
- removed = paths;
595
- }
596
- if (!imported || !imported.id) {
597
- throw new Error('Import Order returned no order id');
598
- }
599
- if (imported.id !== derivedId && !GUID.test(String(imported.id))) {
600
- // Cannot be recorded (the crosswalk accepts only GUIDs) and cannot be trusted. Reported
601
- // with the id so a human can find the order by number; the run does not continue history
602
- // onto it.
603
- throw new Error(`Import Order returned a non-GUID id ${JSON.stringify(imported.id)} for source order ${sourceId} (number ${order.number}); the order may exist on the target under it`);
604
- }
605
- if (imported.id !== derivedId) {
606
- // The order EXISTS, under an id we did not choose. Reporting a failure here would leave
607
- // no crosswalk row, and every re-run would import it again -- the one outcome this
608
- // module exists to prevent. So the target's id is adopted and recorded, the order counts
609
- // as imported, and the finding says the identity model did not hold on this target.
610
- orderId = String(imported.id);
611
- findings.push({ code: 'order-id-not-derived', sourceId: String(sourceId), orderId, derivedId });
612
- }
613
- outcomes.order = ORDER_OUTCOMES.IMPORTED;
614
- // One drop finding per removed path, only once the order landed without it. Field and
615
- // reason, never the value, the member id or the rejection's wording.
616
- const kinds = new Map(orderContactFields().map((field) => [field.targetPath, field.kind]));
617
- for (const field of removed) {
618
- findings.push({
619
- code: kinds.get(field) === 'email' ? 'order-contact-email-dropped' : 'order-contact-phone-dropped',
620
- sourceId: String(sourceId),
621
- field,
622
- reason: 'import-order-rejected-field',
623
- ...(field === 'buyerInfo.email' && buyerOutcome === orderBuyer.OUTCOMES.LINKED ? { memberLinkKept: true } : {}),
624
- });
625
- }
626
- } catch (error) {
627
- outcomes.order = ORDER_OUTCOMES.IMPORT_FAILED;
628
- errors.order = describeError(error);
629
- failRemaining(outcomes, errors, { gate, refunds, evidence, cause: 'order-not-imported' });
630
- return { orderId: null, derivedId, outcomes, findings, errors, paymentId: null, invoice: null };
631
- }
632
- }
633
- // Persisted BEFORE any further write. The one thing nothing else catches. If the write
634
- // itself fails the order is still on the target and the next run finds it by derived id, so
635
- // the run continues -- but the caller is told, because a crosswalk that silently stopped
636
- // persisting is a report that undercounts what landed.
637
- try {
638
- await crosswalk.set(sourceId, orderId);
639
- } catch (error) {
640
- errors.crosswalk = describeError(error);
641
- }
642
- }
643
-
644
- // ---- 2. Payment and refunds, from ONE reconciliation read. ---------------------------------
645
- let paymentId = null;
646
- if (!gate.eligible) {
647
- outcomes.payment = gate.outcome;
648
- outcomes.refunds = refunds.map((refund) => ({ sourceId: refund.sourceId, sourceOccurrence: refund.sourceOccurrence, outcome: 'refund-without-payment' }));
649
- } else {
650
- // The read and the write are retried as ONE pair or not at all. The read decides create-or-
651
- // adopt, and a failed write attempt is exactly what can make that decision stale -- the
652
- // attempt that failed may be what created the payment. Retrying the write alone would re-use
653
- // the pre-failure decision and add a second payment. `assertReconciledBinding`
654
- // (`wix-writers.js:3729`) refuses a read taken for a different order or a different payment
655
- // fingerprint, but it cannot detect a stale read for the right one.
656
- //
657
- // A `payment-target-read-failed` reconcile does NOT enter this loop: the pacer already
658
- // retried it internally and `writeOrderPayment` returns that outcome rather than throwing.
659
- let reconciled = await w.reconcileOrderPaymentTarget(wix, { orderId, payment, pacer });
660
- let written = null;
661
- try {
662
- for (let attempt = 1; ; attempt += 1) {
663
- try {
664
- written = await w.writeOrderPayment(wix, { orderId, payment, pacer, reconciled });
665
- break;
666
- } catch (error) {
667
- if (attempt >= WRITE_RETRY_ATTEMPTS || !w.isTransientWixError(error)) throw error;
668
- await sleepFor(WRITE_RETRY_DELAYS_MS[attempt - 1]);
669
- // Re-read before re-writing. Coming back RECONCILED means the failed attempt committed
670
- // after all, and the writer turns that into `payment-reconciled-existing` with no
671
- // second write -- which is the outcome, not a failure.
672
- reconciled = await w.reconcileOrderPaymentTarget(wix, { orderId, payment, pacer });
673
- }
674
- }
675
- outcomes.payment = written.outcome;
676
- paymentId = written.paymentId || null;
677
- if (written.error) errors.payment = describeError(written.error);
678
- // "Written" with no id is not written: the refund path would see CREATE still standing and
679
- // add the payment a second time. Demonstrated in review with an empty `paymentsIds`.
680
- if (outcomes.payment === 'payment-written' && !paymentId) {
681
- outcomes.payment = 'payment-failed';
682
- errors.payment = { cause: 'add-payment-returned-no-id' };
683
- }
684
- } catch (error) {
685
- outcomes.payment = 'payment-failed';
686
- errors.payment = describeError(error);
687
- }
688
- // No payment id means no payment to hang anything off, whatever the outcome's name: ambiguous
689
- // reconciliation carries no error object from the writer, so the cause is recorded here.
690
- if (!paymentId && !errors.payment) errors.payment = { cause: outcomes.payment };
691
- // The refund path sees the same read, updated with the payment this run just created so it
692
- // does not create a second one. A payment stage that failed leaves nothing to refund against.
693
- const forRefunds = paymentId && reconciled.outcome === paymentMapping.RECONCILE.CREATE
694
- ? { ...reconciled, outcome: paymentMapping.RECONCILE.RECONCILED, paymentId, matchedBy: 'written-this-run' }
695
- : reconciled;
696
- for (const refund of refunds) {
697
- const line = { sourceId: refund.sourceId, sourceOccurrence: refund.sourceOccurrence, outcome: null, refundId: null, paymentId: null };
698
- if (!paymentId) {
699
- // Refunds are REFUND outcomes. Letting the writer answer here returned the payment stage's
700
- // own code as the refund's, which the report counts as a payment bucket and never as a
701
- // refund that did not land.
702
- line.outcome = 'refund-failed';
703
- line.error = { cause: outcomes.payment };
704
- } else {
705
- try {
706
- const result = await w.ensureOrderPaymentAndRefund(wix, {
707
- orderId,
708
- payment,
709
- refundAmount: refund.amount,
710
- reason: refund.reason,
711
- sourceRefundId: refund.sourceId,
712
- sourceOccurrence: refund.sourceOccurrence,
713
- pacer,
714
- reconciled: forRefunds,
715
- });
716
- line.outcome = result.outcome;
717
- line.refundId = result.refundId || (result.refund && result.refund.id) || null;
718
- line.paymentId = result.paymentId || null;
719
- } catch (error) {
720
- line.outcome = 'refund-failed';
721
- line.error = describeError(error);
722
- }
723
- }
724
- outcomes.refunds.push(line);
725
- }
726
- }
727
-
728
- // ---- 3. The invoice document. ---------------------------------------------------------------
729
- let invoice = null;
730
- if (!evidence.invoice) {
731
- outcomes.invoice = 'invoice-none-found';
732
- } else {
733
- // A document that reached Media but whose order patch failed is remembered HERE, in the same
734
- // persisted state as the order id, not by the caller: a generated importer following the
735
- // documented loop without persisting it imported a second copy in review. The caller may still
736
- // pass one explicitly (an older project's state); the crosswalk's answer is the fallback.
737
- let pendingMediaFileId = evidence.invoice.pendingMediaFileId || null;
738
- let rememberedPending = null;
739
- if (!pendingMediaFileId) {
740
- try {
741
- const remembered = await crosswalk.getInvoiceFile(sourceId);
742
- // Either a bare id (older rows) or { fileId, sourceUrl }. A remembered file is only THIS
743
- // document's if it was imported from the same URL: a re-issued invoice under a new link
744
- // must not be "resumed" onto the old bytes (review demonstrated it).
745
- const rememberedId = typeof remembered === 'string' ? remembered : remembered && remembered.fileId;
746
- const rememberedUrl = remembered && typeof remembered === 'object' ? remembered.sourceUrl || null : null;
747
- if (rememberedId && String(rememberedId).trim() !== '') {
748
- if (!rememberedUrl || rememberedUrl === (evidence.invoice.sourceUrl || null)) { pendingMediaFileId = String(rememberedId); rememberedPending = pendingMediaFileId; }
749
- else findings.push({ code: 'invoice-pending-file-superseded', sourceId: String(sourceId), note: 'a remembered Media file was imported from a different URL and was not resumed' });
750
- }
751
- } catch (error) {
752
- errors.crosswalk = errors.crosswalk || describeError(error);
753
- }
754
- }
755
- try {
756
- invoice = await w.preserveOrderInvoiceDocument(wix, {
757
- orderId,
758
- sourceUrl: evidence.invoice.sourceUrl,
759
- invoiceNumber: evidence.invoice.invoiceNumber,
760
- approval: evidence.invoice.approval,
761
- setupVerification,
762
- sourceSiteHost,
763
- pendingMediaFileId,
764
- });
765
- outcomes.invoice = invoice.outcome;
766
- // Remember a READY-but-unrecorded file (bound to its URL); CLEAR the memory once the document
767
- // is settled or the remembered import is dead. Left in place, a FAILED file id was resumed
768
- // forever and the document never imported (review finding).
769
- const settled = ['invoice-preserved', 'invoice-already-preserved', 'invoice-number-only', 'invoice-import-failed'].includes(invoice.outcome);
770
- try {
771
- if (invoice.pendingMediaFileId && invoice.pendingMediaFileId !== pendingMediaFileId) {
772
- await crosswalk.setInvoiceFile(sourceId, invoice.pendingMediaFileId, { sourceUrl: evidence.invoice.sourceUrl || null });
773
- } else if (settled && (rememberedPending || (invoice.outcome === 'invoice-import-failed' && pendingMediaFileId))) {
774
- await crosswalk.setInvoiceFile(sourceId, null, { sourceUrl: null });
775
- }
776
- } catch (error) {
777
- errors.crosswalk = errors.crosswalk || describeError(error);
778
- }
779
- } catch (error) {
780
- outcomes.invoice = 'invoice-failed';
781
- errors.invoice = describeError(error);
782
- }
783
- }
784
-
785
- return { orderId, derivedId, outcomes, findings, errors, paymentId, invoice };
786
- }
787
-
788
- // A crosswalk over the project's own state/crosswalk/crosswalk.ndjson, in the row shape and key
789
- // convention the rest of the runtime uses (`<sourceSystem>:<sourceEntityType>:<sourceId>`, as in
790
- // lib/import-recovery.js), so recovery tooling sees these rows and these rows see its. Loaded
791
- // once, appended per order (O(1) -- the last row per key wins), so a large store does not rewrite
792
- // its whole crosswalk seven thousand times.
793
- //
794
- // The loader is deliberately NOT lib/local-state's: that one throws on any unparsable line and on
795
- // any invalid row of any entity type, which turns a process killed mid-append -- the crash this
796
- // module exists to survive -- into a run that fails every order after it. Here a TRAILING partial
797
- // line (no newline terminator, not parseable) is dropped and reported; any other bad line still
798
- // throws, because that is corruption, not a crash.
799
- function createProjectOrderCrosswalk({ projectDir, sourceSystem = 'wordpress', sourceEntityType = 'order' } = {}) {
800
- if (!projectDir) throw new Error('createProjectOrderCrosswalk needs the migration projectDir');
801
- const filePath = localState.crosswalkPath(projectDir);
802
- const pendingPath = path.join(path.dirname(filePath), 'pending-invoice-files.ndjson');
803
- const key = (sourceId) => `${sourceSystem}:${sourceEntityType}:${String(sourceId)}`;
804
- const index = new Map();
805
- // Bytes of COMPLETE lines already indexed. The file is append-only, so a refresh reads from here
806
- // rather than re-parsing seven thousand rows -- and a MISS always refreshes first, because
807
- // another process (or lib/local-state's upsert) may have appended a row since we last looked.
808
- // Review demonstrated the alternative: a cached index returning null for a legacy row written
809
- // moments earlier, and a second order imported.
810
- let offset = 0;
811
- let lineCount = 0;
812
- let loaded = false;
813
- let inode = null;
814
- const state = { droppedPartialLine: null, droppedPendingPartialLine: null };
815
-
816
- // The file is append-only for THIS adapter, but lib/local-state's upsertCrosswalkRow rewrites
817
- // and compacts it (temp file + rename). A rewrite that shrank the file below our offset made the
818
- // incremental read return nothing and a legacy row stay invisible -- review demonstrated a
819
- // second order imported that way. So every refresh stats first: a new inode or a smaller file
820
- // means "start over", not "nothing new".
821
- async function statFile() {
822
- try {
823
- const st = await fs.stat(filePath);
824
- return { size: st.size, ino: st.ino };
825
- } catch (error) {
826
- if (error && error.code === 'ENOENT') return { size: 0, ino: null };
827
- throw error;
828
- }
829
- }
830
-
831
- async function readFrom(position) {
832
- let handle;
833
- try {
834
- handle = await fs.open(filePath, 'r');
835
- } catch (error) {
836
- if (error && error.code === 'ENOENT') return '';
837
- throw error;
838
- }
839
- try {
840
- const { size } = await handle.stat();
841
- if (size <= position) return '';
842
- const buffer = Buffer.alloc(size - position);
843
- await handle.read(buffer, 0, buffer.length, position);
844
- return buffer;
845
- } finally {
846
- await handle.close();
847
- }
848
- }
849
-
850
- async function refresh() {
851
- const st = await statFile();
852
- if ((inode !== null && st.ino !== inode) || st.size < offset) {
853
- index.clear();
854
- offset = 0;
855
- lineCount = 0;
856
- }
857
- inode = st.ino;
858
- const chunkBuffer = await readFrom(offset);
859
- if (!chunkBuffer || chunkBuffer.length === 0) return;
860
- // Split on the BYTE, not the decoded string: a tail torn inside a multibyte character decodes
861
- // to U+FFFD and mis-measures the bytes to truncate (review demonstrated a glued, fatal file).
862
- const lastNewline = chunkBuffer.lastIndexOf(0x0a);
863
- const completeBytes = lastNewline === -1 ? 0 : lastNewline + 1;
864
- const tailBytes = chunkBuffer.length - completeBytes;
865
- const parts = completeBytes > 0 ? chunkBuffer.subarray(0, completeBytes).toString('utf8').split('\n') : [''];
866
- if (completeBytes > 0) parts.pop(); // the trailing '' after the final newline
867
- const tail = tailBytes > 0 ? chunkBuffer.subarray(completeBytes).toString('utf8') : '';
868
- for (const raw of parts) {
869
- lineCount += 1;
870
- const line = raw.replace(/\r$/, '').trim();
871
- if (!line) continue;
872
- let row;
873
- try {
874
- row = JSON.parse(line);
875
- } catch (error) {
876
- throw new Error(`${filePath}:${lineCount} invalid NDJSON: ${error.message}`);
877
- }
878
- if (row && row.targetEntityType === 'ecom/order' && typeof row.sourceStableKey === 'string' && typeof row.targetId === 'string') {
879
- index.set(row.sourceStableKey, row.targetId);
880
- }
881
- }
882
- offset += completeBytes;
883
- if (tailBytes > 0 && tail.trim()) {
884
- // A last line with no newline: either a complete row from a writer that omits the
885
- // terminator, or a line torn by a kill mid-append. A torn line is TRUNCATED on disk, not just
886
- // skipped -- skipped, the next append would glue a row onto it and corrupt the file for every
887
- // later reader (review demonstrated this too).
888
- let row = null;
889
- try { row = JSON.parse(tail.trim()); } catch (error) { row = null; }
890
- if (row) {
891
- // A complete row another writer left unterminated. Indexed; the terminator is added by
892
- // set() just before our next append, so the file is never touched only to tidy it.
893
- lineCount += 1;
894
- if (row.targetEntityType === 'ecom/order' && typeof row.sourceStableKey === 'string' && typeof row.targetId === 'string') {
895
- index.set(row.sourceStableKey, row.targetId);
896
- }
897
- offset += tailBytes;
898
- needsTerminator = true;
899
- } else {
900
- // Truncate only if nothing has been appended since we read: a neighbour's row landing
901
- // between the read and the truncate would otherwise be deleted. One process per project
902
- // crosswalk is the supported model (lib/local-state has a state lock for the runtime); this
903
- // check narrows the window, it does not close it.
904
- const now = await statFile();
905
- if (now.ino === inode && now.size === offset + tailBytes) {
906
- await fs.truncate(filePath, offset);
907
- state.droppedPartialLine = { line: lineCount + 1, length: tail.length };
908
- }
909
- }
910
- }
911
- }
912
- let needsTerminator = false;
913
-
914
- // The pending-invoice sibling file gets the SAME crash discipline as the main crosswalk. Review
915
- // demonstrated the alternative: a row torn by a kill, the next append glued onto it, one
916
- // unparsable line holding two pending file ids, both silently ignored -- and a tax document
917
- // imported twice. A torn TAIL is truncated on disk; a bad line anywhere else is corruption and
918
- // throws; a complete row left unterminated is read and terminated before the next append.
919
- async function readPendingRows() {
920
- let buffer;
921
- try {
922
- buffer = await fs.readFile(pendingPath);
923
- } catch (error) {
924
- if (!error || error.code !== 'ENOENT') throw error;
925
- return { rows: [], needsTerminator: false };
926
- }
927
- const lastNewline = buffer.lastIndexOf(0x0a);
928
- const completeBytes = lastNewline === -1 ? 0 : lastNewline + 1;
929
- const complete = completeBytes > 0 ? buffer.subarray(0, completeBytes).toString('utf8').split('\n') : [];
930
- if (complete.length > 0) complete.pop(); // the '' after the final newline
931
- const rows = [];
932
- complete.forEach((raw, i) => {
933
- const line = raw.replace(/\r$/, '').trim();
934
- if (!line) return;
935
- try { rows.push(JSON.parse(line)); } catch (error) { throw new Error(`${pendingPath}:${i + 1} invalid NDJSON: ${error.message}`); }
936
- });
937
- const tail = buffer.subarray(completeBytes).toString('utf8');
938
- let pendingNeedsTerminator = false;
939
- if (tail.trim()) {
940
- let row = null;
941
- try { row = JSON.parse(tail.trim()); } catch (error) { row = null; }
942
- if (row) {
943
- rows.push(row);
944
- pendingNeedsTerminator = true;
945
- } else {
946
- await fs.truncate(pendingPath, completeBytes);
947
- state.droppedPendingPartialLine = { line: complete.length + 1, length: tail.length };
948
- }
949
- }
950
- return { rows, needsTerminator: pendingNeedsTerminator };
951
- }
952
-
953
- async function ensureLoaded() {
954
- if (!loaded) {
955
- await refresh();
956
- loaded = true;
957
- }
958
- }
959
-
960
- return {
961
- async get(sourceId) {
962
- await ensureLoaded();
963
- const hit = index.get(key(sourceId));
964
- if (hit) return hit;
965
- await refresh();
966
- return index.get(key(sourceId)) || null;
967
- },
968
- async set(sourceId, targetId) {
969
- await ensureLoaded();
970
- if (needsTerminator) {
971
- await fs.appendFile(filePath, '\n', 'utf8');
972
- needsTerminator = false;
973
- }
974
- await localState.appendCrosswalkRow(projectDir, {
975
- schemaVersion: localState.SCHEMA_VERSION,
976
- sourceSystem,
977
- sourceEntityType,
978
- sourceId: String(sourceId),
979
- sourceStableKey: key(sourceId),
980
- targetSystem: 'wix',
981
- targetEntityType: 'ecom/order',
982
- targetId: String(targetId),
983
- status: 'imported',
984
- updatedAt: new Date().toISOString(),
985
- });
986
- index.set(key(sourceId), String(targetId));
987
- await refresh(); // pick up our own row's bytes (and anything a neighbour appended)
988
- },
989
- // A Media file that reached READY but whose order patch failed, remembered per source order so
990
- // the resume records THAT file rather than importing another. Kept in a sibling file, read in
991
- // full on every ask: it only ever holds the failures, so it stays small, and a stale in-memory
992
- // copy here would cost a duplicated tax document.
993
- async getInvoiceFile(sourceId) {
994
- const { rows } = await readPendingRows();
995
- let found = null;
996
- for (const row of rows) {
997
- if (row && row.sourceStableKey === key(sourceId)) found = row.fileId ? { fileId: row.fileId, sourceUrl: row.sourceUrl || null } : null; // last row wins; a null row clears
998
- }
999
- return found;
1000
- },
1001
- async setInvoiceFile(sourceId, fileId, { sourceUrl = null } = {}) {
1002
- // Repair first: a torn tail is truncated and an unterminated complete row gets its newline,
1003
- // so this append always starts a clean line.
1004
- const { needsTerminator } = await readPendingRows();
1005
- await fs.mkdir(path.dirname(pendingPath), { recursive: true });
1006
- if (needsTerminator) await fs.appendFile(pendingPath, '\n', 'utf8');
1007
- await fs.appendFile(pendingPath, `${JSON.stringify({ sourceStableKey: key(sourceId), fileId: fileId === null ? null : String(fileId), sourceUrl: sourceUrl === null ? null : String(sourceUrl), updatedAt: new Date().toISOString() })}\n`, 'utf8');
1008
- },
1009
- // What the loaders had to drop, if anything -- a caller may want to report it.
1010
- droppedPartialLine() { return state.droppedPartialLine; },
1011
- droppedPendingPartialLine() { return state.droppedPendingPartialLine; },
1012
- };
1013
- }
1014
-
1015
- module.exports = {
1016
- ORDER_OUTCOMES,
1017
- EVIDENCE_KEYS,
1018
- REFUND_KEYS,
1019
- INVOICE_KEYS,
1020
- deriveImportedOrderId,
1021
- normalizeSourceSiteHost,
1022
- assertEvidence,
1023
- checkOrderContactFields,
1024
- identifyRejectedContactFields,
1025
- importOrderHistory,
1026
- createProjectOrderCrosswalk,
1027
- };