@wix/agent-skills 1.36.0 → 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 (776) hide show
  1. package/package.json +8 -3
  2. package/skills/wix-headless-kit/install/pins.json +1 -1
  3. package/skills/wix-manage/SKILL.md +3 -3
  4. package/skills/wix-manage/references/cms/cms-data-items-crud.md +78 -1
  5. package/skills/wix-manage/references/google-ads/create-performance-max-campaign.md +11 -11
  6. package/skills/wix-manage/references/marketing/create-and-publish-social-post.md +20 -51
  7. package/skills/wix-manage/references/marketing/generate-and-publish-marketing-plan.md +4 -4
  8. package/skills/wix-base44-connector/SKILL.md +0 -437
  9. package/skills/wix-base44-connector/references/CAPABILITY_MAP.md +0 -78
  10. package/skills/wix-base44-connector/scripts/utils.cjs +0 -466
  11. package/skills/wix-export/SKILL.md +0 -83
  12. package/skills/wix-harmony-editor/.publish-manifest.json +0 -8
  13. package/skills/wix-harmony-editor/COPY-SITE.md +0 -494
  14. package/skills/wix-harmony-editor/SKILL.md +0 -317
  15. package/skills/wix-harmony-editor/scripts/copy/build-description.mjs +0 -249
  16. package/skills/wix-harmony-editor/scripts/copy/check-description.mjs +0 -225
  17. package/skills/wix-harmony-editor/scripts/copy/check-mirror.mjs +0 -89
  18. package/skills/wix-harmony-editor/scripts/copy/compare-preview.mjs +0 -76
  19. package/skills/wix-harmony-editor/scripts/copy/deploy-description.mjs +0 -212
  20. package/skills/wix-harmony-editor/scripts/copy/desc-hash.mjs +0 -44
  21. package/skills/wix-harmony-editor/scripts/copy/editor-run.mjs +0 -45
  22. package/skills/wix-harmony-editor/scripts/copy/export-page.mjs +0 -53
  23. package/skills/wix-harmony-editor/scripts/copy/find-interactions.mjs +0 -76
  24. package/skills/wix-harmony-editor/scripts/copy/hide-scrollbars.mjs +0 -16
  25. package/skills/wix-harmony-editor/scripts/copy/import-media.mjs +0 -150
  26. package/skills/wix-harmony-editor/scripts/copy/link-url.mjs +0 -27
  27. package/skills/wix-harmony-editor/scripts/copy/lint-api.mjs +0 -56
  28. package/skills/wix-harmony-editor/scripts/copy/measure-source.mjs +0 -211
  29. package/skills/wix-harmony-editor/scripts/copy/merge-mirrors.mjs +0 -29
  30. package/skills/wix-harmony-editor/scripts/copy/mirror-site.mjs +0 -92
  31. package/skills/wix-harmony-editor/scripts/copy/mobile-stage.mjs +0 -56
  32. package/skills/wix-harmony-editor/scripts/copy/preview-widths.mjs +0 -73
  33. package/skills/wix-harmony-editor/scripts/copy/render-plate.mjs +0 -67
  34. package/skills/wix-harmony-editor/scripts/copy/serve-mirror.mjs +0 -102
  35. package/skills/wix-harmony-editor/scripts/copy/snapshot-capabilities.mjs +0 -40
  36. package/skills/wix-harmony-editor/scripts/copy/split-sections.mjs +0 -191
  37. package/skills/wix-harmony-editor/scripts/copy/upload-media-manager.mjs +0 -61
  38. package/skills/wix-harmony-editor/scripts/launch.sh +0 -359
  39. package/skills/wix-headless/SKILL.md +0 -151
  40. package/skills/wix-headless/references/AI_FEATURES.md +0 -178
  41. package/skills/wix-headless/references/CAPABILITIES.md +0 -117
  42. package/skills/wix-headless/references/CONTENT.md +0 -36
  43. package/skills/wix-headless/references/DESIGN.md +0 -55
  44. package/skills/wix-headless/references/DISCOVERY.md +0 -80
  45. package/skills/wix-headless/references/DOC_DISCOVERY.md +0 -43
  46. package/skills/wix-headless/references/FEEDBACK.md +0 -129
  47. package/skills/wix-headless/references/IMAGE_GENERATION.md +0 -80
  48. package/skills/wix-headless/references/SDK_HANDOFF.md +0 -108
  49. package/skills/wix-headless/references/SEED.md +0 -74
  50. package/skills/wix-headless/references/SETUP.md +0 -60
  51. package/skills/wix-headless/references/astro.md +0 -98
  52. package/skills/wix-headless/references/inline-recipes/experience-donations.md +0 -102
  53. package/skills/wix-headless/references/inline-recipes/experience-store.md +0 -49
  54. package/skills/wix-headless/references/inline-recipes/how-to-code-a-blog.md +0 -196
  55. package/skills/wix-headless/references/inline-recipes/how-to-code-a-store.md +0 -590
  56. package/skills/wix-headless/references/inline-recipes/how-to-code-bookings.md +0 -279
  57. package/skills/wix-headless/references/inline-recipes/how-to-code-cms.md +0 -163
  58. package/skills/wix-headless/references/inline-recipes/how-to-code-donations.md +0 -146
  59. package/skills/wix-headless/references/inline-recipes/how-to-code-events.md +0 -203
  60. package/skills/wix-headless/references/inline-recipes/how-to-code-forms.md +0 -696
  61. package/skills/wix-headless/references/inline-recipes/how-to-code-members-astro.md +0 -124
  62. package/skills/wix-headless/references/inline-recipes/how-to-code-members-custom-login.md +0 -160
  63. package/skills/wix-headless/references/inline-recipes/how-to-code-members-non-astro.md +0 -118
  64. package/skills/wix-headless/references/inline-recipes/how-to-code-portfolio.md +0 -132
  65. package/skills/wix-headless/references/inline-recipes/how-to-code-pricing-plans.md +0 -126
  66. package/skills/wix-headless/references/inline-recipes/how-to-code-rentals.md +0 -254
  67. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-orders.md +0 -191
  68. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurant-reservations.md +0 -213
  69. package/skills/wix-headless/references/inline-recipes/how-to-code-restaurants.md +0 -161
  70. package/skills/wix-headless/references/inline-recipes/setup-blog.md +0 -175
  71. package/skills/wix-headless/references/inline-recipes/setup-bookings.md +0 -232
  72. package/skills/wix-headless/references/inline-recipes/setup-cms.md +0 -200
  73. package/skills/wix-headless/references/inline-recipes/setup-donations.md +0 -15
  74. package/skills/wix-headless/references/inline-recipes/setup-events.md +0 -196
  75. package/skills/wix-headless/references/inline-recipes/setup-forms.md +0 -288
  76. package/skills/wix-headless/references/inline-recipes/setup-online-store.md +0 -214
  77. package/skills/wix-headless/references/inline-recipes/setup-portfolio.md +0 -155
  78. package/skills/wix-headless/references/inline-recipes/setup-pricing-plans.md +0 -229
  79. package/skills/wix-headless/references/inline-recipes/setup-rentals.md +0 -254
  80. package/skills/wix-headless/references/inline-recipes/setup-restaurant-experiences.md +0 -73
  81. package/skills/wix-headless/references/inline-recipes/setup-restaurant-orders.md +0 -197
  82. package/skills/wix-headless/references/inline-recipes/setup-restaurant-reservations.md +0 -136
  83. package/skills/wix-headless/references/inline-recipes/setup-restaurants.md +0 -152
  84. package/skills/wix-headless/references/managed/AUTHENTICATION.md +0 -71
  85. package/skills/wix-headless/references/managed/CONNECT.md +0 -74
  86. package/skills/wix-headless/references/managed/CREATE.md +0 -149
  87. package/skills/wix-headless/references/managed/DEPLOYMENT.md +0 -104
  88. package/skills/wix-headless/references/non-astro.md +0 -59
  89. package/skills/wix-headless/references/self-managed/AUTHENTICATION.md +0 -22
  90. package/skills/wix-headless/references/self-managed/DEPLOYMENT.md +0 -15
  91. package/skills/wix-headless/references/stripe/AUTHENTICATION.md +0 -55
  92. package/skills/wix-headless/references/stripe/DEPLOYMENT.md +0 -71
  93. package/skills/wix-headless/scripts/bootstrap.mjs +0 -156
  94. package/skills/wix-headless-replatform/.publish-manifest.json +0 -8
  95. package/skills/wix-headless-replatform/SKILL.md +0 -116
  96. package/skills/wix-headless-replatform/agents/openai.yaml +0 -6
  97. package/skills/wix-headless-replatform/references/control-and-visual-fidelity-contract.md +0 -43
  98. package/skills/wix-headless-replatform/references/extraction-schema.md +0 -187
  99. package/skills/wix-headless-replatform/references/interaction-runtime-contract.md +0 -137
  100. package/skills/wix-headless-replatform/references/layout-blueprint-contract.md +0 -41
  101. package/skills/wix-headless-replatform/references/output-contract.md +0 -93
  102. package/skills/wix-headless-replatform/references/post-build-gap-contract.md +0 -125
  103. package/skills/wix-headless-replatform/references/qa-checklist.md +0 -83
  104. package/skills/wix-headless-replatform/references/safety.md +0 -19
  105. package/skills/wix-headless-replatform/references/ui-normalization-contract.md +0 -70
  106. package/skills/wix-headless-replatform/references/workflow.md +0 -157
  107. package/skills/wix-headless-replatform/registry/README.md +0 -20
  108. package/skills/wix-headless-replatform/registry/approvals/button/shadcn-default-ac60ef5.json +0 -28
  109. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/button.tsx +0 -54
  110. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/capabilities.json +0 -60
  111. package/skills/wix-headless-replatform/registry/items/button/shadcn-default-ac60ef5/contract.md +0 -48
  112. package/skills/wix-headless-replatform/registry/licenses/shadcn-ui-ac60ef5-MIT.txt +0 -21
  113. package/skills/wix-headless-replatform/registry/registry.json +0 -36
  114. package/skills/wix-headless-replatform/resources/rp-facelift/SKILL.md +0 -32
  115. package/skills/wix-headless-replatform/resources/rp-project-context/SKILL.md +0 -62
  116. package/skills/wix-headless-replatform/resources/rp-qa-gap-loop/SKILL.md +0 -64
  117. package/skills/wix-headless-replatform/resources/rp-source-evidence/SKILL.md +0 -42
  118. package/skills/wix-headless-replatform/resources/rp-ui-implementation/SKILL.md +0 -73
  119. package/skills/wix-headless-replatform/schemas/build-plan.schema.json +0 -10
  120. package/skills/wix-headless-replatform/schemas/candidate.schema.json +0 -19
  121. package/skills/wix-headless-replatform/schemas/common.schema.json +0 -33
  122. package/skills/wix-headless-replatform/schemas/decision-patch.schema.json +0 -10
  123. package/skills/wix-headless-replatform/schemas/decision-request.schema.json +0 -10
  124. package/skills/wix-headless-replatform/schemas/extraction-gap.schema.json +0 -28
  125. package/skills/wix-headless-replatform/schemas/extraction-manifest.schema.json +0 -34
  126. package/skills/wix-headless-replatform/schemas/final-report.schema.json +0 -10
  127. package/skills/wix-headless-replatform/schemas/foundation.schema.json +0 -11
  128. package/skills/wix-headless-replatform/schemas/metadata.schema.json +0 -11
  129. package/skills/wix-headless-replatform/schemas/observation-packet.schema.json +0 -17
  130. package/skills/wix-headless-replatform/schemas/page-capture.schema.json +0 -11
  131. package/skills/wix-headless-replatform/schemas/page-resolution.schema.json +0 -33
  132. package/skills/wix-headless-replatform/schemas/shared-chrome.schema.json +0 -11
  133. package/skills/wix-headless-replatform/schemas/unit.schema.json +0 -40
  134. package/skills/wix-headless-replatform/scripts/assemble-extraction.mjs +0 -844
  135. package/skills/wix-headless-replatform/scripts/benchmark-extraction.mjs +0 -163
  136. package/skills/wix-headless-replatform/scripts/browser-extraction-preflight.mjs +0 -42
  137. package/skills/wix-headless-replatform/scripts/build-extracted-homepage.mjs +0 -228
  138. package/skills/wix-headless-replatform/scripts/clear-wix-starter.mjs +0 -87
  139. package/skills/wix-headless-replatform/scripts/create-wix-project.mjs +0 -505
  140. package/skills/wix-headless-replatform/scripts/discover-urls.mjs +0 -142
  141. package/skills/wix-headless-replatform/scripts/extract-assets.mjs +0 -140
  142. package/skills/wix-headless-replatform/scripts/extract-design-system.mjs +0 -637
  143. package/skills/wix-headless-replatform/scripts/extract-interactions.mjs +0 -1903
  144. package/skills/wix-headless-replatform/scripts/extract-page.mjs +0 -2461
  145. package/skills/wix-headless-replatform/scripts/extract-seo.mjs +0 -25
  146. package/skills/wix-headless-replatform/scripts/extract-tokens.mjs +0 -63
  147. package/skills/wix-headless-replatform/scripts/finalize-extraction-report.mjs +0 -126
  148. package/skills/wix-headless-replatform/scripts/finalize-gap-review.mjs +0 -180
  149. package/skills/wix-headless-replatform/scripts/finalize-gap-review.test.mjs +0 -98
  150. package/skills/wix-headless-replatform/scripts/finalize-migration-website.mjs +0 -103
  151. package/skills/wix-headless-replatform/scripts/generate-control-state-contract.mjs +0 -176
  152. package/skills/wix-headless-replatform/scripts/generate-design-md.mjs +0 -261
  153. package/skills/wix-headless-replatform/scripts/generate-extraction-validators.mjs +0 -25
  154. package/skills/wix-headless-replatform/scripts/generate-invoice-download-backend.mjs +0 -342
  155. package/skills/wix-headless-replatform/scripts/generate-layout-blueprint.mjs +0 -140
  156. package/skills/wix-headless-replatform/scripts/generate-repeater-cms.mjs +0 -22
  157. package/skills/wix-headless-replatform/scripts/generate-route-plan.mjs +0 -143
  158. package/skills/wix-headless-replatform/scripts/generate-scene-contract.mjs +0 -288
  159. package/skills/wix-headless-replatform/scripts/generate-ui-normalization.mjs +0 -266
  160. package/skills/wix-headless-replatform/scripts/generate-visual-assets.mjs +0 -111
  161. package/skills/wix-headless-replatform/scripts/lib/browser-tooling.mjs +0 -570
  162. package/skills/wix-headless-replatform/scripts/lib/common.mjs +0 -329
  163. package/skills/wix-headless-replatform/scripts/lib/component-capabilities.mjs +0 -121
  164. package/skills/wix-headless-replatform/scripts/lib/component-registry.mjs +0 -282
  165. package/skills/wix-headless-replatform/scripts/lib/content-boundary.mjs +0 -61
  166. package/skills/wix-headless-replatform/scripts/lib/extraction-contract.mjs +0 -374
  167. package/skills/wix-headless-replatform/scripts/lib/extraction-detectors.mjs +0 -243
  168. package/skills/wix-headless-replatform/scripts/lib/extraction-validators.generated.mjs +0 -1139
  169. package/skills/wix-headless-replatform/scripts/lib/font-contract.mjs +0 -326
  170. package/skills/wix-headless-replatform/scripts/lib/frontend-automation-state.mjs +0 -184
  171. package/skills/wix-headless-replatform/scripts/lib/gap-analysis.mjs +0 -396
  172. package/skills/wix-headless-replatform/scripts/lib/html-extract.mjs +0 -168
  173. package/skills/wix-headless-replatform/scripts/lib/interaction-bootstrap.mjs +0 -10
  174. package/skills/wix-headless-replatform/scripts/lib/interaction-runtime.mjs +0 -194
  175. package/skills/wix-headless-replatform/scripts/lib/interaction-timeline.mjs +0 -348
  176. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/classifiers.mjs +0 -141
  177. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/geometry.mjs +0 -43
  178. package/skills/wix-headless-replatform/scripts/lib/layout-blueprint/vocabulary.mjs +0 -18
  179. package/skills/wix-headless-replatform/scripts/lib/ui-normalization.css +0 -64
  180. package/skills/wix-headless-replatform/scripts/optimize-svg.mjs +0 -31
  181. package/skills/wix-headless-replatform/scripts/post-build-gap.mjs +0 -358
  182. package/skills/wix-headless-replatform/scripts/provision-repeater-cms.mjs +0 -25
  183. package/skills/wix-headless-replatform/scripts/record-gap-decision.mjs +0 -39
  184. package/skills/wix-headless-replatform/scripts/replay-extraction.mjs +0 -107
  185. package/skills/wix-headless-replatform/scripts/resolve-home-page.mjs +0 -96
  186. package/skills/wix-headless-replatform/scripts/site-clone.mjs +0 -658
  187. package/skills/wix-headless-replatform/scripts/validate-font-contract.mjs +0 -29
  188. package/skills/wix-headless-replatform/scripts/verify-interactions.mjs +0 -669
  189. package/skills/wix-headless-replatform/scripts/visual-qa.mjs +0 -370
  190. package/skills/wix-import/SKILL.md +0 -90
  191. package/skills/wix-replatform/.publish-manifest.json +0 -8
  192. package/skills/wix-replatform/CLI.md +0 -162
  193. package/skills/wix-replatform/README.md +0 -52
  194. package/skills/wix-replatform/SKILL.md +0 -238
  195. package/skills/wix-replatform/console/account.css +0 -1
  196. package/skills/wix-replatform/console/app.css +0 -1
  197. package/skills/wix-replatform/console/app.js +0 -117
  198. package/skills/wix-replatform/console/index.html +0 -4
  199. package/skills/wix-replatform/console/json.css +0 -11
  200. package/skills/wix-replatform/lib/agent-adapters/index.js +0 -71
  201. package/skills/wix-replatform/lib/app-page-routing.js +0 -75
  202. package/skills/wix-replatform/lib/artifact-freshness.js +0 -225
  203. package/skills/wix-replatform/lib/blocked-data-requests.js +0 -427
  204. package/skills/wix-replatform/lib/census-reconciliation.js +0 -426
  205. package/skills/wix-replatform/lib/completion-report.js +0 -1580
  206. package/skills/wix-replatform/lib/config-env.js +0 -133
  207. package/skills/wix-replatform/lib/confirmed-pictures.js +0 -212
  208. package/skills/wix-replatform/lib/dependency-readiness.js +0 -423
  209. package/skills/wix-replatform/lib/dependency-recovery.js +0 -21
  210. package/skills/wix-replatform/lib/destination-choice.js +0 -163
  211. package/skills/wix-replatform/lib/destination-handoff.js +0 -62
  212. package/skills/wix-replatform/lib/destination-http.js +0 -81
  213. package/skills/wix-replatform/lib/destination-route.js +0 -98
  214. package/skills/wix-replatform/lib/destination.js +0 -919
  215. package/skills/wix-replatform/lib/discovered-census.js +0 -231
  216. package/skills/wix-replatform/lib/discovered-set-status.js +0 -255
  217. package/skills/wix-replatform/lib/document-url-guard.js +0 -203
  218. package/skills/wix-replatform/lib/entity-qa-attestation.js +0 -339
  219. package/skills/wix-replatform/lib/entity-verification.js +0 -18
  220. package/skills/wix-replatform/lib/execution-capability.js +0 -120
  221. package/skills/wix-replatform/lib/execution-log.js +0 -170
  222. package/skills/wix-replatform/lib/execution-manifest.js +0 -203
  223. package/skills/wix-replatform/lib/execution-state.js +0 -195
  224. package/skills/wix-replatform/lib/expectations-ledger.js +0 -96
  225. package/skills/wix-replatform/lib/generated-plugin-handoff.js +0 -140
  226. package/skills/wix-replatform/lib/import-readiness-contract.js +0 -23
  227. package/skills/wix-replatform/lib/import-recovery.js +0 -1107
  228. package/skills/wix-replatform/lib/imported-redirect-targets.js +0 -608
  229. package/skills/wix-replatform/lib/internal-link-reconciliation.js +0 -166
  230. package/skills/wix-replatform/lib/link-audit.js +0 -173
  231. package/skills/wix-replatform/lib/link-census.js +0 -194
  232. package/skills/wix-replatform/lib/link-plan.js +0 -148
  233. package/skills/wix-replatform/lib/link-verification.js +0 -274
  234. package/skills/wix-replatform/lib/link-write-journal.js +0 -42
  235. package/skills/wix-replatform/lib/local-state.js +0 -1481
  236. package/skills/wix-replatform/lib/member-completion.js +0 -658
  237. package/skills/wix-replatform/lib/member-crosswalk.js +0 -69
  238. package/skills/wix-replatform/lib/member-outcome-registry.js +0 -265
  239. package/skills/wix-replatform/lib/migration-completion.js +0 -311
  240. package/skills/wix-replatform/lib/operator-identity.js +0 -47
  241. package/skills/wix-replatform/lib/orchestration-decisions.js +0 -248
  242. package/skills/wix-replatform/lib/orchestration-preflight.js +0 -525
  243. package/skills/wix-replatform/lib/orchestration-router.js +0 -698
  244. package/skills/wix-replatform/lib/orchestration-state.js +0 -631
  245. package/skills/wix-replatform/lib/order-reference-readiness.js +0 -30
  246. package/skills/wix-replatform/lib/payments-outcome-registry.js +0 -200
  247. package/skills/wix-replatform/lib/plugin-cms-fallback.js +0 -618
  248. package/skills/wix-replatform/lib/preservation-approval-stamp.js +0 -54
  249. package/skills/wix-replatform/lib/product-media-deferral.js +0 -96
  250. package/skills/wix-replatform/lib/progress-log.js +0 -240
  251. package/skills/wix-replatform/lib/progress-log.sh +0 -140
  252. package/skills/wix-replatform/lib/read-back-approval.js +0 -184
  253. package/skills/wix-replatform/lib/read-back-comparison.js +0 -136
  254. package/skills/wix-replatform/lib/read-back-contract.js +0 -243
  255. package/skills/wix-replatform/lib/read-back-extract.js +0 -118
  256. package/skills/wix-replatform/lib/read-back-gate.js +0 -734
  257. package/skills/wix-replatform/lib/read-back-reads.js +0 -94
  258. package/skills/wix-replatform/lib/read-back-state.js +0 -107
  259. package/skills/wix-replatform/lib/read-back-summary.js +0 -81
  260. package/skills/wix-replatform/lib/rerun-conflicts.js +0 -334
  261. package/skills/wix-replatform/lib/run-controller.js +0 -401
  262. package/skills/wix-replatform/lib/seo-outcome-registry.js +0 -45
  263. package/skills/wix-replatform/lib/setup-verification.js +0 -148
  264. package/skills/wix-replatform/lib/source-access.js +0 -231
  265. package/skills/wix-replatform/lib/source-coverage.js +0 -1130
  266. package/skills/wix-replatform/lib/source-secrets.js +0 -277
  267. package/skills/wix-replatform/lib/structured-link-patch.js +0 -59
  268. package/skills/wix-replatform/lib/task-state.js +0 -110
  269. package/skills/wix-replatform/lib/url-preservation-report.js +0 -319
  270. package/skills/wix-replatform/lib/url-preservation-state.js +0 -739
  271. package/skills/wix-replatform/lib/url-redirect-plan.js +0 -728
  272. package/skills/wix-replatform/lib/url-verification.js +0 -315
  273. package/skills/wix-replatform/lib/user-action-effects.js +0 -42
  274. package/skills/wix-replatform/lib/user-actions.js +0 -264
  275. package/skills/wix-replatform/lib/website-handoff.js +0 -1220
  276. package/skills/wix-replatform/lib/wix-client-callers.js +0 -54
  277. package/skills/wix-replatform/lib/wix-dashboard-url.js +0 -35
  278. package/skills/wix-replatform/lib/write-verification-state.js +0 -92
  279. package/skills/wix-replatform/lib/write-verification.js +0 -274
  280. package/skills/wix-replatform/resources/rp-destination/SKILL.md +0 -137
  281. package/skills/wix-replatform/resources/rp-discovery/SKILL.md +0 -357
  282. package/skills/wix-replatform/resources/rp-discovery/scripts/promote-source-coverage.js +0 -47
  283. package/skills/wix-replatform/resources/rp-execute-import/SKILL.md +0 -1369
  284. package/skills/wix-replatform/resources/rp-execute-import/scripts/shipping-estimate-audit.js +0 -70
  285. package/skills/wix-replatform/resources/rp-execute-setup/SKILL.md +0 -482
  286. package/skills/wix-replatform/resources/rp-execute-setup/scripts/execute-setup.js +0 -442
  287. package/skills/wix-replatform/resources/rp-execute-setup/scripts/mint-token.sh +0 -64
  288. package/skills/wix-replatform/resources/rp-execution-policy/SKILL.md +0 -112
  289. package/skills/wix-replatform/resources/rp-execution-policy/lib/coupon-currency-plan-report.js +0 -143
  290. package/skills/wix-replatform/resources/rp-execution-policy/lib/payments-report.js +0 -244
  291. package/skills/wix-replatform/resources/rp-import-codegen/SKILL.md +0 -3158
  292. package/skills/wix-replatform/resources/rp-mapper/SKILL.md +0 -947
  293. package/skills/wix-replatform/resources/rp-mapper/lib/mapping-resolve.js +0 -217
  294. package/skills/wix-replatform/resources/rp-mapper/lib/structure-bridge-planning.js +0 -303
  295. package/skills/wix-replatform/resources/rp-mapper/scripts/coverage-reconcile.js +0 -88
  296. package/skills/wix-replatform/resources/rp-mapper/scripts/resolve-mapping.js +0 -148
  297. package/skills/wix-replatform/resources/rp-mapper/wix-business-solutions-taxonomy.md +0 -378
  298. package/skills/wix-replatform/resources/rp-preflight/SKILL.md +0 -40
  299. package/skills/wix-replatform/resources/rp-project-intake/SKILL.md +0 -55
  300. package/skills/wix-replatform/resources/rp-quick-runtime/SKILL.md +0 -60
  301. package/skills/wix-replatform/resources/rp-quick-runtime/lib/import-progress.js +0 -89
  302. package/skills/wix-replatform/resources/rp-quick-runtime/lib/limit-recovery.js +0 -36
  303. package/skills/wix-replatform/resources/rp-quick-shopify/SKILL.md +0 -123
  304. package/skills/wix-replatform/resources/rp-quick-shopify/quick-mode.json +0 -124
  305. package/skills/wix-replatform/resources/rp-quick-shopify/scripts/quick-mode.js +0 -522
  306. package/skills/wix-replatform/resources/rp-quick-woocommerce/SKILL.md +0 -56
  307. package/skills/wix-replatform/resources/rp-quick-woocommerce/quick-mode.json +0 -91
  308. package/skills/wix-replatform/resources/rp-quick-woocommerce/scripts/quick-mode.js +0 -255
  309. package/skills/wix-replatform/resources/rp-setup-discovery/SKILL.md +0 -253
  310. package/skills/wix-replatform/resources/rp-setup-discovery/scripts/quick-setup-plan.js +0 -44
  311. package/skills/wix-replatform/resources/rp-source-csv/SKILL.md +0 -481
  312. package/skills/wix-replatform/resources/rp-source-csv/lib/canonical-record.js +0 -136
  313. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fileset.js +0 -0
  314. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-fingerprint.js +0 -310
  315. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-layout.js +0 -1081
  316. package/skills/wix-replatform/resources/rp-source-csv/lib/csv-parse.js +0 -618
  317. package/skills/wix-replatform/resources/rp-source-csv/scripts/csv-discovery.js +0 -969
  318. package/skills/wix-replatform/resources/rp-source-csv/source-schema.example.json +0 -196
  319. package/skills/wix-replatform/resources/rp-source-csv/vendors/bigcommerce.json +0 -66
  320. package/skills/wix-replatform/resources/rp-source-csv/vendors/magento.json +0 -60
  321. package/skills/wix-replatform/resources/rp-source-csv/vendors/shopify.json +0 -95
  322. package/skills/wix-replatform/resources/rp-source-csv/vendors/woocommerce.json +0 -82
  323. package/skills/wix-replatform/resources/rp-source-inputs/SKILL.md +0 -66
  324. package/skills/wix-replatform/resources/rp-source-sfcc/SKILL.md +0 -153
  325. package/skills/wix-replatform/resources/rp-source-shopify/SKILL.md +0 -394
  326. package/skills/wix-replatform/resources/rp-source-shopify/lib/discovery-reads.js +0 -200
  327. package/skills/wix-replatform/resources/rp-source-shopify/lib/import-findings.js +0 -34
  328. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk-sqlite-worker.js +0 -44
  329. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-bulk.js +0 -1470
  330. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-cli.js +0 -446
  331. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-gift-cards.js +0 -474
  332. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-protected-fields.js +0 -879
  333. package/skills/wix-replatform/resources/rp-source-shopify/lib/shopify-session.js +0 -426
  334. package/skills/wix-replatform/resources/rp-source-shopify/queries/articles.graphql +0 -24
  335. package/skills/wix-replatform/resources/rp-source-shopify/queries/blogs.graphql +0 -18
  336. package/skills/wix-replatform/resources/rp-source-shopify/queries/collections.graphql +0 -40
  337. package/skills/wix-replatform/resources/rp-source-shopify/queries/customers.graphql +0 -76
  338. package/skills/wix-replatform/resources/rp-source-shopify/queries/delivery-profiles.graphql +0 -51
  339. package/skills/wix-replatform/resources/rp-source-shopify/queries/discounts.graphql +0 -35
  340. package/skills/wix-replatform/resources/rp-source-shopify/queries/files.graphql +0 -20
  341. package/skills/wix-replatform/resources/rp-source-shopify/queries/gift-cards.graphql +0 -18
  342. package/skills/wix-replatform/resources/rp-source-shopify/queries/inventory.graphql +0 -31
  343. package/skills/wix-replatform/resources/rp-source-shopify/queries/locations.graphql +0 -21
  344. package/skills/wix-replatform/resources/rp-source-shopify/queries/menus.graphql +0 -21
  345. package/skills/wix-replatform/resources/rp-source-shopify/queries/metaobjects.graphql +0 -30
  346. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-core.graphql +0 -150
  347. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-fulfillments.graphql +0 -36
  348. package/skills/wix-replatform/resources/rp-source-shopify/queries/orders-refunds.graphql +0 -48
  349. package/skills/wix-replatform/resources/rp-source-shopify/queries/pages.graphql +0 -20
  350. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-address.graphql +0 -8
  351. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-email.graphql +0 -6
  352. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-name.graphql +0 -8
  353. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-customers-phone.graphql +0 -8
  354. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-address.graphql +0 -12
  355. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-email.graphql +0 -6
  356. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-name.graphql +0 -13
  357. package/skills/wix-replatform/resources/rp-source-shopify/queries/probe-orders-phone.graphql +0 -13
  358. package/skills/wix-replatform/resources/rp-source-shopify/queries/products.graphql +0 -73
  359. package/skills/wix-replatform/resources/rp-source-shopify/queries/url-redirects.graphql +0 -13
  360. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-discovery.js +0 -693
  361. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-extract.js +0 -283
  362. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-gift-card-remedy.js +0 -191
  363. package/skills/wix-replatform/resources/rp-source-shopify/scripts/shopify-session-check.js +0 -115
  364. package/skills/wix-replatform/resources/rp-source-shopify/source-schema.example.json +0 -201
  365. package/skills/wix-replatform/resources/rp-source-wordpress/PLUGIN-READ-PLANS.md +0 -146
  366. package/skills/wix-replatform/resources/rp-source-wordpress/SKILL.md +0 -970
  367. package/skills/wix-replatform/resources/rp-source-wordpress/lib/blocked-data-handlers.js +0 -73
  368. package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.js +0 -115
  369. package/skills/wix-replatform/resources/rp-source-wordpress/lib/checkout-field-csv-parser.test-fixture.js +0 -91
  370. package/skills/wix-replatform/resources/rp-source-wordpress/lib/coupon-discovery.js +0 -440
  371. package/skills/wix-replatform/resources/rp-source-wordpress/lib/currency-gate.js +0 -125
  372. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.js +0 -252
  373. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-source-keys.json +0 -183
  374. package/skills/wix-replatform/resources/rp-source-wordpress/lib/gateway-summary.mjs +0 -333
  375. package/skills/wix-replatform/resources/rp-source-wordpress/lib/invoice-discovery.js +0 -426
  376. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-disposition.js +0 -400
  377. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-entity-read-plan.js +0 -633
  378. package/skills/wix-replatform/resources/rp-source-wordpress/lib/plugin-knowledge.js +0 -1127
  379. package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.js +0 -194
  380. package/skills/wix-replatform/resources/rp-source-wordpress/lib/refund-corroboration.json +0 -100
  381. package/skills/wix-replatform/resources/rp-source-wordpress/lib/sampled-ids-batch.js +0 -157
  382. package/skills/wix-replatform/resources/rp-source-wordpress/lib/secret-value-guard.js +0 -234
  383. package/skills/wix-replatform/resources/rp-source-wordpress/lib/store-currency.js +0 -101
  384. package/skills/wix-replatform/resources/rp-source-wordpress/lib/structure-bridge-reader.js +0 -755
  385. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.js +0 -1074
  386. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wix-wp-plugin-v2-client.test-fixture.js +0 -149
  387. package/skills/wix-replatform/resources/rp-source-wordpress/lib/woo-inventory.js +0 -25
  388. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-http.js +0 -444
  389. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-image-url.js +0 -186
  390. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-plugin-detect.js +0 -1422
  391. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-redirect-sources.js +0 -343
  392. package/skills/wix-replatform/resources/rp-source-wordpress/lib/wp-route-classifier.js +0 -680
  393. package/skills/wix-replatform/resources/rp-source-wordpress/lib/yoast-product-seo-evidence.js +0 -272
  394. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/README.md +0 -373
  395. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/advanced-custom-fields.json +0 -101
  396. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/back-in-stock-notifier-for-woocommerce.json +0 -81
  397. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/capabilities-pending-decision.json +0 -128
  398. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/cms-fallback-eligible.json +0 -18
  399. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/contact-form-7.json +0 -104
  400. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/facebook-for-woocommerce.json +0 -44
  401. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/fingerprint-aliases.json +0 -49
  402. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/free-gifts-for-woocommerce.json +0 -94
  403. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/index.json +0 -863
  404. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mailpoet.json +0 -52
  405. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/membership-for-woocommerce.json +0 -161
  406. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/mwb-bookings-for-woocommerce.json +0 -180
  407. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/no-migration-needed.json +0 -286
  408. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pricing-deals-for-woocommerce.json +0 -79
  409. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/product-extras-for-woocommerce.json +0 -120
  410. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/pw-woocommerce-gift-cards.json +0 -128
  411. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/requires-development.json +0 -88
  412. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seo-by-rank-math.json +0 -80
  413. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/seriously-simple-podcasting.json +0 -46
  414. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/strong-testimonials.json +0 -55
  415. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/subscriptions-for-woocommerce.json +0 -99
  416. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/tablepress.json +0 -55
  417. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/the-events-calendar.json +0 -160
  418. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/ti-woocommerce-wishlist.json +0 -81
  419. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-checkout-field-editor-pro.json +0 -60
  420. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-discount-rules.json +0 -74
  421. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woo-product-bundle.json +0 -75
  422. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-gift-cards.json +0 -60
  423. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-other-payment-gateway.json +0 -44
  424. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-pdf-invoices-packing-slips.json +0 -57
  425. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-product-addon.json +0 -141
  426. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/woocommerce-progressive-discounts.json +0 -54
  427. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wordpress-seo.json +0 -158
  428. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpc-composite-products.json +0 -97
  429. package/skills/wix-replatform/resources/rp-source-wordpress/plugins/wpforms-lite.json +0 -86
  430. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/capture-store-settings.js +0 -90
  431. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge-validate.js +0 -51
  432. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/plugin-knowledge.js +0 -103
  433. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-discovery.js +0 -2409
  434. package/skills/wix-replatform/resources/rp-source-wordpress/scripts/wp-plugin-inventory.js +0 -273
  435. package/skills/wix-replatform/resources/rp-source-wordpress/secret-value-patterns.v1.json +0 -11
  436. package/skills/wix-replatform/resources/rp-source-wordpress/source-schema.example.json +0 -71
  437. package/skills/wix-replatform/resources/rp-source-wordpress/sub-parts.json +0 -13
  438. package/skills/wix-replatform/resources/rp-target-wix/SKILL.md +0 -1046
  439. package/skills/wix-replatform/resources/rp-target-wix/app-page-routing-capabilities.json +0 -36
  440. package/skills/wix-replatform/resources/rp-target-wix/domains/README.md +0 -57
  441. package/skills/wix-replatform/resources/rp-target-wix/domains/SERVICE-PLUGINS.md +0 -322
  442. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/docs-survey.json +0 -70
  443. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/domain.json +0 -29
  444. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/category.json +0 -71
  445. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/comment.json +0 -83
  446. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/post.json +0 -95
  447. package/skills/wix-replatform/resources/rp-target-wix/domains/blog/entities/tag.json +0 -66
  448. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/docs-survey.json +0 -332
  449. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/domain.json +0 -75
  450. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/booking.json +0 -181
  451. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service-add-on.json +0 -130
  452. package/skills/wix-replatform/resources/rp-target-wix/domains/bookings/entities/service.json +0 -180
  453. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/docs-survey.json +0 -161
  454. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/domain.json +0 -25
  455. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/collection.json +0 -67
  456. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/data-item.json +0 -75
  457. package/skills/wix-replatform/resources/rp-target-wix/domains/cms/entities/reference.json +0 -41
  458. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/docs-survey.json +0 -204
  459. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/domain.json +0 -27
  460. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/contact.json +0 -275
  461. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/email-subscription.json +0 -105
  462. package/skills/wix-replatform/resources/rp-target-wix/domains/crm/entities/label.json +0 -77
  463. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/docs-survey.json +0 -297
  464. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/domain.json +0 -44
  465. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/delivery-profile.json +0 -171
  466. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/discount-rule.json +0 -182
  467. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-applied-discount.json +0 -129
  468. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-invoice-document.json +0 -192
  469. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item-options.json +0 -123
  470. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-line-item.json +0 -85
  471. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-merchant-note.json +0 -112
  472. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-payment.json +0 -191
  473. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order-refund.json +0 -164
  474. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/order.json +0 -462
  475. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/pickup-location.json +0 -122
  476. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/shipping-option.json +0 -98
  477. package/skills/wix-replatform/resources/rp-target-wix/domains/ecom/entities/wishlist-item.json +0 -86
  478. package/skills/wix-replatform/resources/rp-target-wix/domains/events/docs-survey.json +0 -128
  479. package/skills/wix-replatform/resources/rp-target-wix/domains/events/domain.json +0 -38
  480. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/category.json +0 -73
  481. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/event.json +0 -107
  482. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/registration-form.json +0 -89
  483. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/rsvp.json +0 -118
  484. package/skills/wix-replatform/resources/rp-target-wix/domains/events/entities/ticket-definition.json +0 -93
  485. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/docs-survey.json +0 -86
  486. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/domain.json +0 -56
  487. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form-submission.json +0 -121
  488. package/skills/wix-replatform/resources/rp-target-wix/domains/forms/entities/form.json +0 -134
  489. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/docs-survey.json +0 -41
  490. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/domain.json +0 -50
  491. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card-product.json +0 -87
  492. package/skills/wix-replatform/resources/rp-target-wix/domains/gift-cards/entities/gift-card.json +0 -130
  493. package/skills/wix-replatform/resources/rp-target-wix/domains/index.json +0 -1418
  494. package/skills/wix-replatform/resources/rp-target-wix/domains/media/docs-survey.json +0 -41
  495. package/skills/wix-replatform/resources/rp-target-wix/domains/media/domain.json +0 -24
  496. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-file.json +0 -75
  497. package/skills/wix-replatform/resources/rp-target-wix/domains/media/entities/media-folder.json +0 -71
  498. package/skills/wix-replatform/resources/rp-target-wix/domains/members/docs-survey.json +0 -119
  499. package/skills/wix-replatform/resources/rp-target-wix/domains/members/domain.json +0 -23
  500. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/badge.json +0 -71
  501. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/custom-field.json +0 -82
  502. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member-about.json +0 -77
  503. package/skills/wix-replatform/resources/rp-target-wix/domains/members/entities/member.json +0 -205
  504. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/docs-survey.json +0 -41
  505. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/domain.json +0 -46
  506. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan-order.json +0 -137
  507. package/skills/wix-replatform/resources/rp-target-wix/domains/pricing-plans/entities/plan.json +0 -133
  508. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/docs-survey.json +0 -7
  509. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/domain.json +0 -36
  510. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/amazon-shop-connect.json +0 -71
  511. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/ebay-shop-connect.json +0 -67
  512. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/google-youtube-connect.json +0 -72
  513. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/meta-catalog-connect.json +0 -74
  514. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/pinterest-catalog-connect.json +0 -69
  515. package/skills/wix-replatform/resources/rp-target-wix/domains/sales-channels/entities/tiktok-catalog-connect.json +0 -61
  516. package/skills/wix-replatform/resources/rp-target-wix/domains/schema.json +0 -111
  517. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/docs-survey.json +0 -109
  518. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/domain.json +0 -73
  519. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/item-seo-tags.json +0 -148
  520. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/seo-pattern.json +0 -91
  521. package/skills/wix-replatform/resources/rp-target-wix/domains/seo/entities/site-seo-tags.json +0 -79
  522. package/skills/wix-replatform/resources/rp-target-wix/domains/site/docs-survey.json +0 -32
  523. package/skills/wix-replatform/resources/rp-target-wix/domains/site/domain.json +0 -49
  524. package/skills/wix-replatform/resources/rp-target-wix/domains/site/entities/business-contact.json +0 -103
  525. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/docs-survey.json +0 -203
  526. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/domain.json +0 -42
  527. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/back-in-stock-request.json +0 -119
  528. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/brand.json +0 -111
  529. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/category.json +0 -81
  530. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/coupon.json +0 -241
  531. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/inventory-item.json +0 -118
  532. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-customization.json +0 -111
  533. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product-tag.json +0 -79
  534. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/product.json +0 -221
  535. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/promotion.json +0 -84
  536. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/review.json +0 -178
  537. package/skills/wix-replatform/resources/rp-target-wix/domains/stores/entities/subscription-product.json +0 -87
  538. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/docs-survey.json +0 -106
  539. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/domain.json +0 -64
  540. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/manual-tax-mapping.json +0 -119
  541. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-group.json +0 -94
  542. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-region.json +0 -113
  543. package/skills/wix-replatform/resources/rp-target-wix/domains/tax/entities/tax-settings.json +0 -65
  544. package/skills/wix-replatform/resources/rp-target-wix/lib/audit-summary.js +0 -64
  545. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-author-attribution.js +0 -165
  546. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-client.js +0 -60
  547. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-duplicates.js +0 -201
  548. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-ledger.js +0 -306
  549. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-report.js +0 -229
  550. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build-stage.js +0 -55
  551. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-build.js +0 -715
  552. package/skills/wix-replatform/resources/rp-target-wix/lib/blog-post-media.js +0 -567
  553. package/skills/wix-replatform/resources/rp-target-wix/lib/bulk-results.js +0 -73
  554. package/skills/wix-replatform/resources/rp-target-wix/lib/contact-extended-fields.js +0 -194
  555. package/skills/wix-replatform/resources/rp-target-wix/lib/contact-import.js +0 -133
  556. package/skills/wix-replatform/resources/rp-target-wix/lib/contract-ledger.js +0 -150
  557. package/skills/wix-replatform/resources/rp-target-wix/lib/coupon-redemption-drift.js +0 -491
  558. package/skills/wix-replatform/resources/rp-target-wix/lib/customer-member.js +0 -104
  559. package/skills/wix-replatform/resources/rp-target-wix/lib/data-extension-schema.js +0 -673
  560. package/skills/wix-replatform/resources/rp-target-wix/lib/domain-knowledge.js +0 -835
  561. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-balance-reconciliation.js +0 -119
  562. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-build.js +0 -566
  563. package/skills/wix-replatform/resources/rp-target-wix/lib/gift-card-redemption-build.js +0 -249
  564. package/skills/wix-replatform/resources/rp-target-wix/lib/ndjson.js +0 -260
  565. package/skills/wix-replatform/resources/rp-target-wix/lib/order-applied-discount-build.js +0 -63
  566. package/skills/wix-replatform/resources/rp-target-wix/lib/order-buyer.js +0 -187
  567. package/skills/wix-replatform/resources/rp-target-wix/lib/order-channel-build.js +0 -64
  568. package/skills/wix-replatform/resources/rp-target-wix/lib/order-history.js +0 -1027
  569. package/skills/wix-replatform/resources/rp-target-wix/lib/order-invoice-contract.js +0 -90
  570. package/skills/wix-replatform/resources/rp-target-wix/lib/order-payment-mapping.js +0 -420
  571. package/skills/wix-replatform/resources/rp-target-wix/lib/pricing-plan-definition.js +0 -177
  572. package/skills/wix-replatform/resources/rp-target-wix/lib/product-import.js +0 -151
  573. package/skills/wix-replatform/resources/rp-target-wix/lib/product-seo.js +0 -723
  574. package/skills/wix-replatform/resources/rp-target-wix/lib/seo-redirects.js +0 -353
  575. package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-build.js +0 -1437
  576. package/skills/wix-replatform/resources/rp-target-wix/lib/shipping-option-stage.js +0 -354
  577. package/skills/wix-replatform/resources/rp-target-wix/lib/store-config-build.js +0 -134
  578. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-category-attach.js +0 -221
  579. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-inventory.js +0 -248
  580. package/skills/wix-replatform/resources/rp-target-wix/lib/stores-verification.js +0 -321
  581. package/skills/wix-replatform/resources/rp-target-wix/lib/tax-build.js +0 -231
  582. package/skills/wix-replatform/resources/rp-target-wix/lib/url-mapper-transport.js +0 -28
  583. package/skills/wix-replatform/resources/rp-target-wix/lib/value-utils.js +0 -14
  584. package/skills/wix-replatform/resources/rp-target-wix/lib/variant-correlation.js +0 -34
  585. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-build.js +0 -388
  586. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-target-spec.js +0 -255
  587. package/skills/wix-replatform/resources/rp-target-wix/lib/wix-writers.js +0 -6041
  588. package/skills/wix-replatform/resources/rp-target-wix/lib/write-verification.js +0 -3
  589. package/skills/wix-replatform/resources/rp-target-wix/scripts/docs-survey-sync.js +0 -150
  590. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge-validate.js +0 -69
  591. package/skills/wix-replatform/resources/rp-target-wix/scripts/domain-knowledge.js +0 -100
  592. package/skills/wix-replatform/resources/rp-target-wix/scripts/verify-stores.js +0 -112
  593. package/skills/wix-replatform/resources/rp-telemetry/SKILL.md +0 -484
  594. package/skills/wix-replatform/resources/rp-telemetry/lib/bi-sink.js +0 -318
  595. package/skills/wix-replatform/resources/rp-telemetry/lib/telemetry-recorder.js +0 -2831
  596. package/skills/wix-replatform/resources/rp-telemetry/lib/transcript-digest.js +0 -318
  597. package/skills/wix-replatform/resources/rp-telemetry/scripts/meter-from-audit.js +0 -83
  598. package/skills/wix-replatform/resources/rp-telemetry/scripts/rp-telemetry.js +0 -243
  599. package/skills/wix-replatform/resources/rp-website-continuation/SKILL.md +0 -94
  600. package/skills/wix-replatform/scripts/artifact-freshness.js +0 -76
  601. package/skills/wix-replatform/scripts/census-reconciliation.js +0 -25
  602. package/skills/wix-replatform/scripts/cms-fallback.js +0 -89
  603. package/skills/wix-replatform/scripts/discovered-census.js +0 -26
  604. package/skills/wix-replatform/scripts/discovered-set-status.js +0 -33
  605. package/skills/wix-replatform/scripts/entity-qa-attestation.js +0 -130
  606. package/skills/wix-replatform/scripts/execution-health-check.js +0 -415
  607. package/skills/wix-replatform/scripts/execution-manifest-validate.js +0 -43
  608. package/skills/wix-replatform/scripts/execution-state-prepare.js +0 -128
  609. package/skills/wix-replatform/scripts/expectations-ledger.js +0 -44
  610. package/skills/wix-replatform/scripts/import-contract-verify.js +0 -183
  611. package/skills/wix-replatform/scripts/internal-link-audit.js +0 -90
  612. package/skills/wix-replatform/scripts/item-seo-tags-verify.js +0 -205
  613. package/skills/wix-replatform/scripts/migration-completion.js +0 -76
  614. package/skills/wix-replatform/scripts/orchestration-preflight.js +0 -67
  615. package/skills/wix-replatform/scripts/orchestration-route.js +0 -77
  616. package/skills/wix-replatform/scripts/orchestration-state.js +0 -381
  617. package/skills/wix-replatform/scripts/read-back-gate.js +0 -175
  618. package/skills/wix-replatform/scripts/replatform-console.js +0 -146
  619. package/skills/wix-replatform/scripts/replatform.js +0 -436
  620. package/skills/wix-replatform/scripts/source-secrets.js +0 -77
  621. package/skills/wix-replatform/scripts/url-redirects.js +0 -286
  622. package/skills/wix-replatform/scripts/user-action.js +0 -58
  623. package/skills/wix-replatform/scripts/website-handoff-generate.js +0 -64
  624. package/skills/wix-replatform/scripts/wix-dashboard-url.js +0 -54
  625. package/skills/wix-replatform/scripts/wix-destination.js +0 -143
  626. package/skills/wix-replatform/scripts/wix-headless-scaffold.js +0 -762
  627. package/skills/wix-vibe-headless/SKILL.md +0 -183
  628. package/skills/wix-vibe-headless/install/deploy.cjs +0 -221
  629. package/skills/wix-vibe-headless/install/pin-agents-md.cjs +0 -35
  630. package/skills/wix-vibe-headless/platforms/README.md +0 -26
  631. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed-with-install.md +0 -127
  632. package/skills/wix-vibe-headless/platforms/base44-ecom-light-seed.md +0 -121
  633. package/skills/wix-vibe-headless/platforms/base44-ecom-light.md +0 -87
  634. package/skills/wix-vibe-headless/platforms/base44.md +0 -148
  635. package/skills/wix-vibe-headless/platforms/generic.md +0 -132
  636. package/skills/wix-vibe-headless/references/_shared/nav/nav.tanstack.js +0 -30
  637. package/skills/wix-vibe-headless/references/_shared/routing.md +0 -86
  638. package/skills/wix-vibe-headless/references/blog/INSTRUCTIONS.md +0 -270
  639. package/skills/wix-vibe-headless/references/blog/app/components/PostCard.jsx +0 -43
  640. package/skills/wix-vibe-headless/references/blog/app/components/PostChips.jsx +0 -25
  641. package/skills/wix-vibe-headless/references/blog/app/components/PostGrid.jsx +0 -15
  642. package/skills/wix-vibe-headless/references/blog/app/context/TaxonomyContext.jsx +0 -35
  643. package/skills/wix-vibe-headless/references/blog/app/hooks/usePostDetail.js +0 -38
  644. package/skills/wix-vibe-headless/references/blog/app/pages/Blog.jsx +0 -40
  645. package/skills/wix-vibe-headless/references/blog/app/pages/CategoryPage.jsx +0 -54
  646. package/skills/wix-vibe-headless/references/blog/app/pages/PostDetail.jsx +0 -65
  647. package/skills/wix-vibe-headless/references/blog/app/pages/TagPage.jsx +0 -50
  648. package/skills/wix-vibe-headless/references/blog/app/rest/wix-blog.js +0 -217
  649. package/skills/wix-vibe-headless/references/blog/seed/SEED.md +0 -99
  650. package/skills/wix-vibe-headless/references/blog/seed/seed-blog.cjs +0 -269
  651. package/skills/wix-vibe-headless/references/bookings/INSTRUCTIONS.md +0 -342
  652. package/skills/wix-vibe-headless/references/bookings/app/components/BookingForm.jsx +0 -65
  653. package/skills/wix-vibe-headless/references/bookings/app/components/RentalDurationPicker.jsx +0 -67
  654. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceCard.jsx +0 -47
  655. package/skills/wix-vibe-headless/references/bookings/app/components/ServiceGrid.jsx +0 -13
  656. package/skills/wix-vibe-headless/references/bookings/app/components/SlotPicker.jsx +0 -126
  657. package/skills/wix-vibe-headless/references/bookings/app/hooks/useRentalDuration.js +0 -128
  658. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServiceDetail.js +0 -110
  659. package/skills/wix-vibe-headless/references/bookings/app/hooks/useServices.js +0 -58
  660. package/skills/wix-vibe-headless/references/bookings/app/lib/serviceFacts.js +0 -95
  661. package/skills/wix-vibe-headless/references/bookings/app/pages/ServiceDetail.jsx +0 -94
  662. package/skills/wix-vibe-headless/references/bookings/app/pages/Services.jsx +0 -89
  663. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-checkout.js +0 -148
  664. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-rentals.js +0 -250
  665. package/skills/wix-vibe-headless/references/bookings/app/rest/wix-bookings-services.js +0 -300
  666. package/skills/wix-vibe-headless/references/bookings/seed/SEED.md +0 -154
  667. package/skills/wix-vibe-headless/references/bookings/seed/seed-bookings.cjs +0 -333
  668. package/skills/wix-vibe-headless/references/bookings/seed/seed-rentals.cjs +0 -267
  669. package/skills/wix-vibe-headless/references/cms/INSTRUCTIONS.md +0 -178
  670. package/skills/wix-vibe-headless/references/cms/app/collection.config.js +0 -31
  671. package/skills/wix-vibe-headless/references/cms/app/lib/wixImage.js +0 -18
  672. package/skills/wix-vibe-headless/references/cms/app/rest/wix-cms.js +0 -231
  673. package/skills/wix-vibe-headless/references/cms/seed/SEED.md +0 -145
  674. package/skills/wix-vibe-headless/references/donations/INSTRUCTIONS.md +0 -88
  675. package/skills/wix-vibe-headless/references/donations/app/rest/wix-donations.js +0 -112
  676. package/skills/wix-vibe-headless/references/donations/seed/SEED.md +0 -11
  677. package/skills/wix-vibe-headless/references/donations/tests/donations.test.mjs +0 -258
  678. package/skills/wix-vibe-headless/references/events/INSTRUCTIONS.md +0 -267
  679. package/skills/wix-vibe-headless/references/events/app/components/CategoryFilter.jsx +0 -23
  680. package/skills/wix-vibe-headless/references/events/app/components/EventCard.jsx +0 -43
  681. package/skills/wix-vibe-headless/references/events/app/components/EventGrid.jsx +0 -13
  682. package/skills/wix-vibe-headless/references/events/app/components/EventRegistration.jsx +0 -29
  683. package/skills/wix-vibe-headless/references/events/app/components/RsvpForm.jsx +0 -57
  684. package/skills/wix-vibe-headless/references/events/app/components/TicketPicker.jsx +0 -78
  685. package/skills/wix-vibe-headless/references/events/app/hooks/useEventDetail.js +0 -27
  686. package/skills/wix-vibe-headless/references/events/app/hooks/useEventsList.js +0 -54
  687. package/skills/wix-vibe-headless/references/events/app/hooks/useRsvpForm.js +0 -40
  688. package/skills/wix-vibe-headless/references/events/app/hooks/useTicketing.js +0 -81
  689. package/skills/wix-vibe-headless/references/events/app/pages/EventDetail.jsx +0 -48
  690. package/skills/wix-vibe-headless/references/events/app/pages/Events.jsx +0 -36
  691. package/skills/wix-vibe-headless/references/events/app/rest/wix-events-browse.js +0 -136
  692. package/skills/wix-vibe-headless/references/events/app/rest/wix-events-registration.js +0 -187
  693. package/skills/wix-vibe-headless/references/events/seed/SEED.md +0 -103
  694. package/skills/wix-vibe-headless/references/events/seed/seed-events.cjs +0 -251
  695. package/skills/wix-vibe-headless/references/forms/INSTRUCTIONS.md +0 -487
  696. package/skills/wix-vibe-headless/references/forms/app/hooks/useWixForm.js +0 -425
  697. package/skills/wix-vibe-headless/references/forms/app/lib/wix-form-schema-utils.js +0 -187
  698. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms-submissions.js +0 -238
  699. package/skills/wix-vibe-headless/references/forms/app/rest/wix-forms.js +0 -108
  700. package/skills/wix-vibe-headless/references/forms/seed/SEED.md +0 -1836
  701. package/skills/wix-vibe-headless/references/members/INSTRUCTIONS.md +0 -328
  702. package/skills/wix-vibe-headless/references/members/app/components/LoginForm.jsx +0 -101
  703. package/skills/wix-vibe-headless/references/members/app/components/MemberMenu.jsx +0 -33
  704. package/skills/wix-vibe-headless/references/members/app/components/RequireAuth.jsx +0 -21
  705. package/skills/wix-vibe-headless/references/members/app/components/SocialButtons.jsx +0 -29
  706. package/skills/wix-vibe-headless/references/members/app/context/MemberContext.jsx +0 -54
  707. package/skills/wix-vibe-headless/references/members/app/hooks/useLoginForm.js +0 -77
  708. package/skills/wix-vibe-headless/references/members/app/pages/Account.jsx +0 -36
  709. package/skills/wix-vibe-headless/references/members/app/pages/Callback.jsx +0 -32
  710. package/skills/wix-vibe-headless/references/members/app/pages/Login.jsx +0 -35
  711. package/skills/wix-vibe-headless/references/members/app/rest/wix-members-auth.js +0 -390
  712. package/skills/wix-vibe-headless/references/members/install/Register.jsx +0 -22
  713. package/skills/wix-vibe-headless/references/members/seed/SEED.md +0 -21
  714. package/skills/wix-vibe-headless/references/portfolio/INSTRUCTIONS.md +0 -270
  715. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionCard.jsx +0 -31
  716. package/skills/wix-vibe-headless/references/portfolio/app/components/CollectionGrid.jsx +0 -15
  717. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectCard.jsx +0 -39
  718. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectGrid.jsx +0 -15
  719. package/skills/wix-vibe-headless/references/portfolio/app/components/ProjectMedia.jsx +0 -29
  720. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useCollectionProjects.js +0 -35
  721. package/skills/wix-vibe-headless/references/portfolio/app/hooks/usePortfolioGallery.js +0 -27
  722. package/skills/wix-vibe-headless/references/portfolio/app/hooks/useProjectDetail.js +0 -25
  723. package/skills/wix-vibe-headless/references/portfolio/app/pages/CollectionPage.jsx +0 -39
  724. package/skills/wix-vibe-headless/references/portfolio/app/pages/Portfolio.jsx +0 -27
  725. package/skills/wix-vibe-headless/references/portfolio/app/pages/ProjectDetail.jsx +0 -60
  726. package/skills/wix-vibe-headless/references/portfolio/app/rest/wix-portfolio.js +0 -223
  727. package/skills/wix-vibe-headless/references/portfolio/seed/SEED.md +0 -90
  728. package/skills/wix-vibe-headless/references/portfolio/seed/seed-portfolio.cjs +0 -236
  729. package/skills/wix-vibe-headless/references/pricing-plans/INSTRUCTIONS.md +0 -280
  730. package/skills/wix-vibe-headless/references/pricing-plans/app/components/OrderCard.jsx +0 -35
  731. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanCard.jsx +0 -48
  732. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanGrid.jsx +0 -16
  733. package/skills/wix-vibe-headless/references/pricing-plans/app/components/PlanPrice.jsx +0 -35
  734. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/useMyPlans.js +0 -25
  735. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlanDetail.js +0 -28
  736. package/skills/wix-vibe-headless/references/pricing-plans/app/hooks/usePlans.js +0 -30
  737. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/MyPlans.jsx +0 -30
  738. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/PlanDetail.jsx +0 -53
  739. package/skills/wix-vibe-headless/references/pricing-plans/app/pages/Plans.jsx +0 -28
  740. package/skills/wix-vibe-headless/references/pricing-plans/app/rest/wix-pricing-plans.js +0 -157
  741. package/skills/wix-vibe-headless/references/pricing-plans/seed/SEED.md +0 -82
  742. package/skills/wix-vibe-headless/references/pricing-plans/seed/seed-pricing-plans.cjs +0 -251
  743. package/skills/wix-vibe-headless/references/rentals/INSTRUCTIONS.md +0 -13
  744. package/skills/wix-vibe-headless/references/restaurants/INSTRUCTIONS.md +0 -290
  745. package/skills/wix-vibe-headless/references/restaurants/app/components/ItemDialog.jsx +0 -81
  746. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuItemCard.jsx +0 -71
  747. package/skills/wix-vibe-headless/references/restaurants/app/components/MenuList.jsx +0 -43
  748. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartButton.jsx +0 -21
  749. package/skills/wix-vibe-headless/references/restaurants/app/components/OrderCartDrawer.jsx +0 -72
  750. package/skills/wix-vibe-headless/references/restaurants/app/context/OrderCartContext.jsx +0 -66
  751. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useItemOrder.js +0 -32
  752. package/skills/wix-vibe-headless/references/restaurants/app/hooks/useReservation.js +0 -73
  753. package/skills/wix-vibe-headless/references/restaurants/app/pages/Menu.jsx +0 -28
  754. package/skills/wix-vibe-headless/references/restaurants/app/pages/Reservations.jsx +0 -102
  755. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-menu.js +0 -224
  756. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-ordering.js +0 -218
  757. package/skills/wix-vibe-headless/references/restaurants/app/rest/wix-restaurants-reservations.js +0 -107
  758. package/skills/wix-vibe-headless/references/restaurants/seed/SEED.md +0 -176
  759. package/skills/wix-vibe-headless/references/restaurants/seed/seed-restaurants.cjs +0 -452
  760. package/skills/wix-vibe-headless/references/shared/app/components/WixManageBanner.jsx +0 -56
  761. package/skills/wix-vibe-headless/references/shared/app/lib/nav.js +0 -9
  762. package/skills/wix-vibe-headless/references/shared/app/rest/wix-client.js +0 -185
  763. package/skills/wix-vibe-headless/references/shared/app/rest/wix-config.js +0 -8
  764. package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +0 -471
  765. package/skills/wix-vibe-headless/references/storefront/app/components/CartButton.jsx +0 -20
  766. package/skills/wix-vibe-headless/references/storefront/app/components/CartDrawer.jsx +0 -167
  767. package/skills/wix-vibe-headless/references/storefront/app/context/CartContext.jsx +0 -83
  768. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductCard.js +0 -104
  769. package/skills/wix-vibe-headless/references/storefront/app/hooks/useProductDetail.js +0 -163
  770. package/skills/wix-vibe-headless/references/storefront/app/hooks/useShop.js +0 -83
  771. package/skills/wix-vibe-headless/references/storefront/app/hooks/useVariantOptions.js +0 -76
  772. package/skills/wix-vibe-headless/references/storefront/app/lib/storeImage.js +0 -64
  773. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-cart.js +0 -176
  774. package/skills/wix-vibe-headless/references/storefront/app/rest/wix-store-catalog.js +0 -218
  775. package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +0 -174
  776. package/skills/wix-vibe-headless/references/storefront/seed/seed-store.cjs +0 -546
@@ -1,1470 +0,0 @@
1
- 'use strict';
2
-
3
- // The sequential Shopify bulk runner. One bulk operation runs at a time, for both
4
- // callers: the discovery census and the extract. A caller supplies its own
5
- // manifest, staging directory, ordered query list and handlers; this module owns every state, stop
6
- // and recovery rule, so a caller adds no runner and no recovery path of its own.
7
- //
8
- // Query states, one atomic manifest write per change:
9
- // pending -> starting -> running -> downloaded -> done
10
- // \-> pending (one re-run, or an expired link)
11
- // running | downloaded -> settling -> failed | denied (terminal; the handler runs in between)
12
- // `settling` makes every terminal side effect recoverable: a query never becomes `failed` or
13
- // `denied` directly. The runner writes `settling` with the outcome and the verbatim error, runs the
14
- // outcome's handler, then writes the terminal state with the handler's result. On every start each
15
- // `settling` entry's handler runs again before anything else, so every handler must be idempotent.
16
- //
17
- // run() resolves with { status: 'complete' | 'stopped' | 'awaiting_user_action', code?, message?,
18
- // details?, manifest }. Anything else it throws is a crash: the manifest on disk is the recovery
19
- // point, and a fresh runner over the same files resumes it.
20
-
21
- const fs = require('node:fs');
22
- const fsp = require('node:fs/promises');
23
- const http = require('node:http');
24
- const https = require('node:https');
25
- const path = require('node:path');
26
- const readline = require('node:readline');
27
- const { fork } = require('node:child_process');
28
- const { finished } = require('node:stream/promises');
29
- const { buildShopifyCoverageRows, upsertAdapterCoverageRows, writeJsonAtomic } = require('../../../lib/source-coverage.js');
30
- const { createUserAction, readUserAction } = require('../../../lib/user-actions.js');
31
- const { ShopifyCliError } = require('./shopify-cli.js');
32
- const { ShopifyExtractStop } = require('./import-findings.js');
33
- const session = require('./shopify-session.js');
34
-
35
- const QUERIES_DIR = path.join(__dirname, '..', 'queries');
36
- const MANIFEST_SCHEMA_VERSION = 1;
37
- const POLL_START_MS = 2000;
38
- const POLL_CAP_MS = 30000;
39
- const OVERDUE_MS = 4 * 60 * 60 * 1000;
40
- const MAX_ATTEMPTS = 1;
41
- const MAX_DOWNLOAD_TRIES = 3;
42
- const MAX_LINK_RERUNS = 2;
43
- const SNAPSHOT_PLACEHOLDER = '{{SNAPSHOT_TIME}}';
44
- const OVERDUE_NAMESPACE = 'shopify-bulk-overdue';
45
- const RAW_EXTRACT_DIR = 'data/source-extract';
46
- const EXTRACT_MANIFEST_FILE = 'extract-manifest.json';
47
- const SQLITE_WORKER = path.join(__dirname, 'shopify-bulk-sqlite-worker.js');
48
-
49
- const STATUS_QUERY = 'query RpBulkStatus($id: ID!) { node(id: $id) { ... on BulkOperation { id status errorCode createdAt completedAt objectCount rootObjectCount fileSize url partialDataUrl } } }';
50
-
51
- // ---------------------------------------------------------------------------------------------
52
- // The query catalog: eighteen queries, in this order, and how each one's child rows fold
53
- // ---------------------------------------------------------------------------------------------
54
-
55
- const MEDIA_TYPES = ['MediaImage', 'Video', 'ExternalVideo', 'Model3d', 'GenericFile'];
56
- const DISCOUNT_APPLICATION_TYPES = ['DiscountCodeApplication', 'AutomaticDiscountApplication', 'ManualDiscountApplication', 'ScriptDiscountApplication'];
57
-
58
- function typesTo(types, field, extra = {}) {
59
- return Object.fromEntries(types.map((type) => [type, { field, ...extra }]));
60
- }
61
-
62
- // `children` maps a child row's `__typename` to the field it folds into on its parent (`into` names
63
- // an inline object of the parent that holds the field). `rootFields` and `childFields` are the
64
- // fields initialised to [] so an empty connection reads as empty, not absent. `inline` lists
65
- // non-connection list fields on a root row whose elements carry nested connections: such a
66
- // child's `__parentId` may name the inline element, so its objects are indexed by `id`.
67
- const QUERY_CATALOG = Object.freeze([
68
- { name: 'products', entity: 'products', rootFields: ['variants', 'media', 'metafields'], children: { ProductVariant: { field: 'variants' }, ...typesTo(MEDIA_TYPES, 'media'), Metafield: { field: 'metafields' } } },
69
- { name: 'collections', entity: 'collections', rootFields: ['products', 'metafields'], children: { Product: { field: 'products' }, Metafield: { field: 'metafields' } } },
70
- { name: 'customers', entity: 'customers', rootFields: ['metafields'], children: { Metafield: { field: 'metafields' } } },
71
- { name: 'orders-core', entity: 'orders', rootFields: ['lineItems', 'shippingLines', 'discountApplications', 'metafields'], children: { LineItem: { field: 'lineItems' }, ShippingLine: { field: 'shippingLines' }, ...typesTo(DISCOUNT_APPLICATION_TYPES, 'discountApplications'), Metafield: { field: 'metafields' } } },
72
- { name: 'orders-refunds', entity: 'orders', inline: { refunds: ['refundLineItems', 'transactions'] }, children: { RefundLineItem: { field: 'refundLineItems' }, OrderTransaction: { field: 'transactions' } } },
73
- { name: 'orders-fulfillments', entity: 'orders', inline: { fulfillments: ['fulfillmentLineItems'] }, children: { FulfillmentLineItem: { field: 'fulfillmentLineItems' } } },
74
- { name: 'gift-cards', entity: 'gift-cards', children: {} },
75
- { name: 'discounts', entity: 'discounts', children: { DiscountRedeemCode: { field: 'codes', into: 'discount' } } },
76
- { name: 'delivery-profiles', entity: 'delivery-profiles', rootFields: ['locationGroupZones'], childFields: { DeliveryLocationGroupZone: ['methodDefinitions'] }, children: { DeliveryLocationGroupZone: { field: 'locationGroupZones' }, DeliveryMethodDefinition: { field: 'methodDefinitions' } } },
77
- { name: 'inventory', entity: 'inventory-items', rootFields: ['inventoryLevels'], children: { InventoryLevel: { field: 'inventoryLevels' } } },
78
- { name: 'pages', entity: 'pages', children: {} },
79
- { name: 'blogs', entity: 'blogs', children: {} },
80
- { name: 'articles', entity: 'articles', children: {} },
81
- { name: 'menus', entity: 'menus', children: {} },
82
- { name: 'url-redirects', entity: 'url-redirects', children: {} },
83
- { name: 'locations', entity: 'locations', children: {} },
84
- { name: 'metaobjects', entity: 'metaobjects', rootFields: ['metaobjects'], children: { Metaobject: { field: 'metaobjects' } } },
85
- { name: 'files', entity: 'files', children: {} },
86
- ]);
87
-
88
- const QUERY_NAMES = Object.freeze(QUERY_CATALOG.map((entry) => entry.name));
89
- const CUSTOMER_QUERIES = Object.freeze(['customers']);
90
- const ORDER_QUERIES = Object.freeze(['orders-core', 'orders-refunds', 'orders-fulfillments']);
91
- const DENIAL_ATTRIBUTED_QUERIES = Object.freeze([...CUSTOMER_QUERIES, ...ORDER_QUERIES]);
92
-
93
- function catalogEntry(name) {
94
- const entry = QUERY_CATALOG.find((candidate) => candidate.name === name);
95
- if (!entry) throw new Error(`unknown Shopify bulk query ${name}`);
96
- return entry;
97
- }
98
-
99
- function queryFilePath(name, dir = QUERIES_DIR) {
100
- return path.join(dir, `${name}.graphql`);
101
- }
102
-
103
- function readQueryFile(name, dir = QUERIES_DIR) {
104
- return fs.readFileSync(queryFilePath(name, dir), 'utf8');
105
- }
106
-
107
- // The text sent for one query: the file with the snapshot time filled in, then the caller's
108
- // projection (`projectQuery`), if it passes one, for the customer and order queries.
109
- function generateQueryText(name, { snapshotTime, project = null, dir = QUERIES_DIR } = {}) {
110
- let text = readQueryFile(name, dir);
111
- if (text.includes(SNAPSHOT_PLACEHOLDER)) {
112
- if (!snapshotTime) throw new Error(`query ${name} needs the snapshot time`);
113
- text = text.split(SNAPSHOT_PLACEHOLDER).join(snapshotTime);
114
- }
115
- if (typeof project === 'function' && DENIAL_ATTRIBUTED_QUERIES.includes(name)) text = project(name, text);
116
- return text;
117
- }
118
-
119
- // Static shape checks for the contract test: connections are the `edges { node }` blocks.
120
- function stripForShape(text) {
121
- const noComments = String(text).replace(/#[^\n]*/g, ' ');
122
- let out = '';
123
- let depth = 0;
124
- let inString = false;
125
- for (let i = 0; i < noComments.length; i += 1) {
126
- const ch = noComments[i];
127
- if (inString) {
128
- if (ch === '\\') i += 1;
129
- else if (ch === '"') inString = false;
130
- continue;
131
- }
132
- if (ch === '"') { inString = true; continue; }
133
- if (ch === '(') { depth += 1; continue; }
134
- if (ch === ')') { depth = Math.max(0, depth - 1); continue; }
135
- if (depth === 0) out += ch;
136
- }
137
- return out;
138
- }
139
-
140
- function connectionShape(text) {
141
- const tokens = stripForShape(text).match(/[{}]|[A-Za-z_][A-Za-z0-9_]*/g) || [];
142
- const stack = [];
143
- let connections = 0;
144
- let maxDepth = 0;
145
- let open = 0;
146
- for (let i = 0; i < tokens.length; i += 1) {
147
- const token = tokens[i];
148
- if (token === '{') {
149
- const isEdges = tokens[i - 1] === 'edges';
150
- stack.push(isEdges);
151
- if (isEdges) { open += 1; connections += 1; maxDepth = Math.max(maxDepth, open); }
152
- } else if (token === '}') {
153
- if (stack.pop()) open -= 1;
154
- }
155
- }
156
- return { connections, nestedLevels: Math.max(0, maxDepth - 1) };
157
- }
158
-
159
- // ---------------------------------------------------------------------------------------------
160
- // Stops
161
- // ---------------------------------------------------------------------------------------------
162
-
163
- class BulkStop extends Error {
164
- constructor(code, message, { status = 'stopped', details = {} } = {}) {
165
- super(message);
166
- this.name = 'BulkStop';
167
- this.code = code;
168
- this.status = status;
169
- this.details = details;
170
- }
171
- }
172
-
173
- const STOPPING_FAILED_CODE = 'shopify_bulk_failed';
174
-
175
- function iso(ms) {
176
- return new Date(ms).toISOString();
177
- }
178
-
179
- function entityOf(name) {
180
- return catalogEntry(name).entity;
181
- }
182
-
183
- function isStopping(entry, caller) {
184
- if (caller !== 'extract') return false;
185
- if (entry.state === 'failed') return true;
186
- return entry.state === 'denied' && entry.handlerOutcome && entry.handlerOutcome.attribution === 'unattributed';
187
- }
188
-
189
- // ---------------------------------------------------------------------------------------------
190
- // Files: JSONL validation, folding, ndjson writing, the default file host download
191
- // ---------------------------------------------------------------------------------------------
192
-
193
- async function removeFile(file) {
194
- await fsp.rm(file, { force: true });
195
- }
196
-
197
- async function writeTextAtomic(file, text) {
198
- await fsp.mkdir(path.dirname(file), { recursive: true });
199
- const temp = `${file}.${process.pid}.${Date.now()}.tmp`;
200
- await fsp.writeFile(temp, text, 'utf8');
201
- await fsp.rename(temp, file);
202
- }
203
-
204
- async function writeNdjsonAtomic(file, records) {
205
- await fsp.mkdir(path.dirname(file), { recursive: true });
206
- const temp = `${file}.${process.pid}.${Date.now()}.tmp`;
207
- const out = fs.createWriteStream(temp, { encoding: 'utf8' });
208
- let count = 0;
209
- try {
210
- for await (const record of records) {
211
- if (!out.write(`${JSON.stringify(record)}\n`)) await new Promise((resolve) => out.once('drain', resolve));
212
- count += 1;
213
- }
214
- out.end();
215
- await finished(out);
216
- await fsp.rename(temp, file);
217
- return count;
218
- } catch (error) {
219
- out.destroy();
220
- await removeFile(temp);
221
- throw error;
222
- }
223
- }
224
-
225
- async function* iterateNdjson(file) {
226
- const input = fs.createReadStream(file, { encoding: 'utf8' });
227
- const lines = readline.createInterface({ input, crlfDelay: Infinity });
228
- for await (const line of lines) if (line.length) yield JSON.parse(line);
229
- }
230
-
231
- async function countLines(file) {
232
- try {
233
- await fsp.access(file);
234
- } catch (error) {
235
- if (error.code === 'ENOENT') return null;
236
- throw error;
237
- }
238
- let count = 0;
239
- for await (const _record of iterateNdjson(file)) count += 1;
240
- return count;
241
- }
242
-
243
- async function copyFileAtomic(source, destination) {
244
- await fsp.mkdir(path.dirname(destination), { recursive: true });
245
- const temp = `${destination}.${process.pid}.${Date.now()}.tmp`;
246
- try {
247
- await fsp.copyFile(source, temp);
248
- await fsp.rename(temp, destination);
249
- } catch (error) {
250
- await removeFile(temp);
251
- throw error;
252
- }
253
- }
254
-
255
- // The download gate's file checks: empty or newline-terminated, and every line one
256
- // JSON object. Streams the file; keeps no record in memory.
257
- function validateJsonlFile(file) {
258
- return new Promise((resolve) => {
259
- const stream = fs.createReadStream(file, { encoding: 'utf8' });
260
- let rest = '';
261
- let lines = 0;
262
- let last = '';
263
- let failure = null;
264
- const checkLine = (line) => {
265
- if (failure) return;
266
- let value;
267
- try {
268
- value = JSON.parse(line);
269
- } catch {
270
- failure = 'a line does not parse as JSON';
271
- return;
272
- }
273
- if (!value || typeof value !== 'object' || Array.isArray(value)) failure = 'a line is not a JSON object';
274
- else lines += 1;
275
- };
276
- stream.on('data', (chunk) => {
277
- if (failure) return;
278
- last = chunk[chunk.length - 1];
279
- rest += chunk;
280
- let at = rest.indexOf('\n');
281
- while (at !== -1 && !failure) {
282
- checkLine(rest.slice(0, at));
283
- rest = rest.slice(at + 1);
284
- at = rest.indexOf('\n');
285
- }
286
- });
287
- stream.on('error', (error) => resolve({ ok: false, reason: `the file could not be read: ${error.message}` }));
288
- stream.on('end', () => {
289
- if (!failure && rest.length) failure = 'the file does not end with a newline';
290
- if (failure) resolve({ ok: false, reason: failure });
291
- else resolve({ ok: true, lines, endsWithNewline: last === '\n' || last === '' });
292
- });
293
- });
294
- }
295
-
296
- // Node 22.12 ships node:sqlite behind --experimental-sqlite. Keep the documented adapter
297
- // invocation flag-free: on that one supported boundary runtime, only the disk-backed transform
298
- // runs in a child with the built-in module enabled. Node 22.13+ stays in-process. The worker gets
299
- // only paths and the public query shape, never credentials or record values over the command line.
300
- function loadDatabaseSync() {
301
- try {
302
- return require('node:sqlite').DatabaseSync;
303
- } catch (error) {
304
- if (error && error.code === 'ERR_UNKNOWN_BUILTIN_MODULE') return null;
305
- throw error;
306
- }
307
- }
308
-
309
- function sqliteWorkerError(payload) {
310
- const error = new Error(payload && payload.message ? payload.message : 'the SQLite worker failed');
311
- if (payload && payload.name) error.name = payload.name;
312
- for (const field of ['code', 'errno', 'syscall', 'path']) {
313
- if (payload && payload[field] !== undefined) error[field] = payload[field];
314
- }
315
- if (payload && payload.stack) error.stack = payload.stack;
316
- return error;
317
- }
318
-
319
- function runSqliteWorker(operation, payload) {
320
- return new Promise((resolve, reject) => {
321
- // Preserve explicit memory ceilings used to prove the bounded-memory contract. Other Node
322
- // entry-point/debug flags belong to the parent, not to this internal helper.
323
- const memoryArgs = process.execArgv.filter((arg) => /^--(?:max-old-space-size|max-semi-space-size|stack-size)=/.test(arg));
324
- const child = fork(SQLITE_WORKER, [], {
325
- execArgv: [...memoryArgs, '--no-warnings', '--experimental-sqlite'],
326
- stdio: ['ignore', 'inherit', 'inherit', 'ipc'],
327
- });
328
- let settled = false;
329
- const fail = (error) => {
330
- if (settled) return;
331
- settled = true;
332
- reject(error);
333
- };
334
- child.once('error', fail);
335
- child.once('exit', (code, signal) => {
336
- if (!settled) fail(new Error(`the SQLite worker exited before replying (${signal || `code ${code}`})`));
337
- });
338
- child.once('message', (message) => {
339
- if (settled) return;
340
- settled = true;
341
- if (child.connected) child.disconnect();
342
- if (message && message.ok) resolve(message.result);
343
- else reject(sqliteWorkerError(message && message.error));
344
- });
345
- child.send({ operation, payload }, (error) => {
346
- if (error) fail(error);
347
- });
348
- });
349
- }
350
-
351
- // Shopify leaves `groupObjects` false, so children may precede their parents. Index child rows in
352
- // a temporary SQLite database, then stream roots in source order and attach only that root's tree.
353
- // Memory is therefore bounded by the largest assembled root, not by the full store export.
354
- async function foldBulkJsonl(file, shape, { outputFile } = {}) {
355
- if (!outputFile) throw new Error('foldBulkJsonl requires outputFile');
356
- const DatabaseSync = loadDatabaseSync();
357
- if (!DatabaseSync) return runSqliteWorker('foldBulkJsonl', { file, shape, outputFile });
358
- await fsp.mkdir(path.dirname(outputFile), { recursive: true });
359
- const work = `${outputFile}.${process.pid}.${Date.now()}.fold.tmp`;
360
- const outputTemp = `${outputFile}.${process.pid}.${Date.now()}.tmp`;
361
- const db = new DatabaseSync(work);
362
- let output = null;
363
- let lines = 0;
364
- try {
365
- db.exec(`
366
- PRAGMA journal_mode = OFF;
367
- PRAGMA synchronous = OFF;
368
- PRAGMA temp_store = FILE;
369
- CREATE TABLE roots (seq INTEGER PRIMARY KEY, json TEXT NOT NULL);
370
- CREATE TABLE children (
371
- seq INTEGER PRIMARY KEY,
372
- parent_id TEXT NOT NULL,
373
- child_id TEXT,
374
- child_type TEXT,
375
- json TEXT NOT NULL,
376
- attached INTEGER NOT NULL DEFAULT 0,
377
- orphan_reason TEXT
378
- );
379
- `);
380
- const addRoot = db.prepare('INSERT INTO roots(seq, json) VALUES (?, ?)');
381
- const addChild = db.prepare('INSERT INTO children(seq, parent_id, child_id, child_type, json) VALUES (?, ?, ?, ?, ?)');
382
- db.exec('BEGIN');
383
- let inTransaction = true;
384
- try {
385
- for await (const line of readline.createInterface({ input: fs.createReadStream(file, { encoding: 'utf8' }), crlfDelay: Infinity })) {
386
- if (!line.length) continue;
387
- const row = JSON.parse(line);
388
- lines += 1;
389
- if (row.__parentId === undefined) addRoot.run(lines, line);
390
- else addChild.run(lines, String(row.__parentId), typeof row.id === 'string' ? row.id : null, typeof row.__typename === 'string' ? row.__typename : null, line);
391
- }
392
- db.exec('COMMIT');
393
- inTransaction = false;
394
- db.exec('CREATE INDEX children_parent ON children(parent_id, seq)');
395
- } catch (error) {
396
- if (inTransaction) db.exec('ROLLBACK');
397
- throw error;
398
- }
399
-
400
- const childrenFor = db.prepare('SELECT seq, json, child_type FROM children WHERE parent_id = ? AND attached = 0 ORDER BY seq');
401
- const markAttached = db.prepare('UPDATE children SET attached = 1 WHERE seq = ?');
402
- const markOrphan = db.prepare('UPDATE children SET orphan_reason = ? WHERE seq = ?');
403
- // Node 22.12's flag-gated StatementSync has no iterate(). Walk the integer primary key with
404
- // get() instead: one root is resident at a time and later runtimes follow the identical path.
405
- const nextRoot = db.prepare('SELECT seq, json FROM roots WHERE seq > ? ORDER BY seq LIMIT 1');
406
- const nestedParentTypes = new Set(Object.keys(shape.childFields || {}));
407
- output = fs.createWriteStream(outputTemp, { encoding: 'utf8' });
408
- let recordCount = 0;
409
- let rootSeq = 0;
410
-
411
- for (let stored = nextRoot.get(rootSeq); stored; stored = nextRoot.get(rootSeq)) {
412
- rootSeq = Number(stored.seq);
413
- const root = JSON.parse(stored.json);
414
- const seen = new Set();
415
- for (const field of shape.rootFields || []) if (!Array.isArray(root[field])) root[field] = [];
416
- for (const [field, nested] of Object.entries(shape.inline || {})) {
417
- for (const element of Array.isArray(root[field]) ? root[field] : []) {
418
- if (element && typeof element === 'object') for (const nestedField of nested) if (!Array.isArray(element[nestedField])) element[nestedField] = [];
419
- }
420
- }
421
-
422
- const attachChildren = (value, mayHaveChildren) => {
423
- if (!value || typeof value !== 'object') return;
424
- if (mayHaveChildren && typeof value.id === 'string' && !seen.has(value.id)) {
425
- seen.add(value.id);
426
- for (const storedChild of childrenFor.all(value.id)) {
427
- const rule = shape.children[storedChild.child_type];
428
- if (!rule) { markOrphan.run('unrecognised_child_type', storedChild.seq); continue; }
429
- const holder = rule.into ? (value[rule.into] && typeof value[rule.into] === 'object' ? value[rule.into] : null) : value;
430
- if (!holder) { markOrphan.run('parent_not_found', storedChild.seq); continue; }
431
- const child = JSON.parse(storedChild.json);
432
- delete child.__parentId;
433
- if (!Array.isArray(holder[rule.field])) holder[rule.field] = [];
434
- holder[rule.field].push(child);
435
- markAttached.run(storedChild.seq);
436
- attachChildren(child, nestedParentTypes.has(child.__typename));
437
- }
438
- }
439
- };
440
- attachChildren(root, true);
441
- for (const field of Object.keys(shape.inline || {})) {
442
- for (const element of Array.isArray(root[field]) ? root[field] : []) attachChildren(element, true);
443
- }
444
-
445
- const initialiseTree = (value) => {
446
- if (Array.isArray(value)) { for (const item of value) initialiseTree(item); return; }
447
- if (!value || typeof value !== 'object') return;
448
- const initialise = shape.childFields && shape.childFields[value.__typename];
449
- if (initialise) for (const field of initialise) if (!Array.isArray(value[field])) value[field] = [];
450
- for (const nested of Object.values(value)) initialiseTree(nested);
451
- };
452
- initialiseTree(root);
453
- if (!output.write(`${JSON.stringify(root)}\n`)) await new Promise((resolve) => output.once('drain', resolve));
454
- recordCount += 1;
455
- }
456
- output.end();
457
- await finished(output);
458
- output = null;
459
-
460
- const orphanCount = Number(db.prepare('SELECT COUNT(*) AS count FROM children WHERE attached = 0').get().count);
461
- if (orphanCount) {
462
- const orphans = db.prepare('SELECT parent_id, child_id, child_type, orphan_reason FROM children WHERE attached = 0 ORDER BY seq LIMIT 20').all().map((row) => ({
463
- reason: row.orphan_reason || 'parent_not_found',
464
- parentId: row.parent_id,
465
- id: row.child_id || null,
466
- type: row.child_type || null,
467
- }));
468
- await removeFile(outputTemp);
469
- return { orphans, orphanCount, lines };
470
- }
471
- await fsp.rename(outputTemp, outputFile);
472
- return { outputFile, recordCount, lines };
473
- } finally {
474
- if (output) output.destroy();
475
- db.close();
476
- await removeFile(outputTemp);
477
- await removeFile(work);
478
- }
479
- }
480
-
481
- // Join the three order datasets without loading any of them as a whole. Supplemental rows live
482
- // in a temporary SQLite table; core orders stream through one at a time in their original order.
483
- async function joinOrderFiles({ coreFile, refundsFile, fulfillmentsFile, outputFile, workDir = path.dirname(outputFile) }) {
484
- const DatabaseSync = loadDatabaseSync();
485
- if (!DatabaseSync) return runSqliteWorker('joinOrderFiles', { coreFile, refundsFile, fulfillmentsFile, outputFile, workDir });
486
- const work = path.join(workDir, `${path.basename(outputFile)}.${process.pid}.${Date.now()}.orders.tmp`);
487
- const outputTemp = path.join(workDir, `${path.basename(outputFile)}.${process.pid}.${Date.now()}.tmp`);
488
- const db = new DatabaseSync(work);
489
- let output = null;
490
- try {
491
- db.exec(`
492
- PRAGMA journal_mode = OFF;
493
- PRAGMA synchronous = OFF;
494
- PRAGMA temp_store = FILE;
495
- CREATE TABLE supplements (
496
- query_name TEXT NOT NULL,
497
- order_id TEXT NOT NULL,
498
- value TEXT NOT NULL,
499
- used INTEGER NOT NULL DEFAULT 0,
500
- PRIMARY KEY(query_name, order_id)
501
- );
502
- CREATE INDEX supplements_order ON supplements(order_id);
503
- `);
504
- const add = db.prepare('INSERT OR REPLACE INTO supplements(query_name, order_id, value) VALUES (?, ?, ?)');
505
- db.exec('BEGIN');
506
- try {
507
- for (const [query, field, file] of [['orders-refunds', 'refunds', refundsFile], ['orders-fulfillments', 'fulfillments', fulfillmentsFile]]) {
508
- if (!file) continue; // this run does not carry that query
509
- // A `done` supplement always has its staged file, empty when the dataset is. A missing one
510
- // is lost input, never an empty dataset: fail loudly rather than write empty arrays.
511
- try {
512
- await fsp.access(file);
513
- } catch (error) {
514
- if (error.code === 'ENOENT') throw new Error(`the staged ${query} file is missing: ${path.basename(file)}`);
515
- throw error;
516
- }
517
- for await (const row of iterateNdjson(file)) add.run(query, String(row.id), JSON.stringify(Array.isArray(row[field]) ? row[field] : []));
518
- }
519
- db.exec('COMMIT');
520
- } catch (error) {
521
- db.exec('ROLLBACK');
522
- throw error;
523
- }
524
- const find = db.prepare('SELECT query_name, value FROM supplements WHERE order_id = ?');
525
- const markUsed = db.prepare('UPDATE supplements SET used = 1 WHERE order_id = ?');
526
- output = fs.createWriteStream(outputTemp, { encoding: 'utf8' });
527
- for await (const order of iterateNdjson(coreFile)) {
528
- const joined = { ...order, refunds: [], fulfillments: [] };
529
- for (const row of find.all(String(order.id))) joined[row.query_name === 'orders-refunds' ? 'refunds' : 'fulfillments'] = JSON.parse(row.value);
530
- markUsed.run(String(order.id));
531
- if (!output.write(`${JSON.stringify(joined)}\n`)) await new Promise((resolve) => output.once('drain', resolve));
532
- }
533
- output.end();
534
- await finished(output);
535
- output = null;
536
- await fsp.rename(outputTemp, outputFile);
537
- const droppedByQuery = Object.fromEntries(['orders-refunds', 'orders-fulfillments'].map((query) => [query, Number(db.prepare('SELECT COUNT(*) AS count FROM supplements WHERE query_name = ? AND used = 0').get(query).count)]));
538
- return { droppedOrphans: droppedByQuery['orders-refunds'] + droppedByQuery['orders-fulfillments'], droppedByQuery };
539
- } finally {
540
- if (output) output.destroy();
541
- db.close();
542
- await removeFile(outputTemp);
543
- await removeFile(work);
544
- }
545
- }
546
-
547
- // The default file host download: plain http(s), no content decoding (identity only), bytes
548
- // counted as they arrive. It reports what happened; the gate decides what it means.
549
- function defaultDownload(url, destination) {
550
- return new Promise((resolve) => {
551
- let client;
552
- try {
553
- client = String(url).startsWith('http:') ? http : https;
554
- } catch {
555
- client = https;
556
- }
557
- const request = client.get(url, { headers: { 'accept-encoding': 'identity' } }, (response) => {
558
- if (response.statusCode !== 200) {
559
- response.resume();
560
- response.on('end', () => resolve({ status: response.statusCode, bytes: 0 }));
561
- response.on('error', (error) => resolve({ status: response.statusCode, bytes: 0, error: error.message }));
562
- return;
563
- }
564
- const out = fs.createWriteStream(destination);
565
- let bytes = 0;
566
- let failed = null;
567
- response.on('data', (chunk) => { bytes += chunk.length; });
568
- response.on('error', (error) => { failed = error.message; out.end(); });
569
- response.on('aborted', () => { failed = failed || 'the connection was cut'; });
570
- response.pipe(out);
571
- out.on('finish', () => resolve({ status: 200, bytes, ...(failed || !response.complete ? { error: failed || 'the response did not complete' } : {}) }));
572
- out.on('error', (error) => resolve({ status: 200, bytes, error: error.message }));
573
- });
574
- request.on('error', (error) => resolve({ status: null, bytes: 0, error: error.message }));
575
- });
576
- }
577
-
578
- // ---------------------------------------------------------------------------------------------
579
- // The runner
580
- // ---------------------------------------------------------------------------------------------
581
-
582
- function newManifest({ caller, store, snapshotTime, queries, previousSidecars, now }) {
583
- const manifest = {
584
- schemaVersion: MANIFEST_SCHEMA_VERSION,
585
- caller,
586
- store,
587
- snapshotTime,
588
- startedAt: iso(now()),
589
- status: 'running',
590
- order: queries.map((query) => query.name),
591
- queries: Object.fromEntries(queries.map((query) => [query.name, {
592
- state: 'pending',
593
- entity: query.entity || entityOf(query.name),
594
- text: query.text,
595
- attempts: 0,
596
- reapproved: false,
597
- downloadTries: 0,
598
- linkReruns: 0,
599
- }])),
600
- };
601
- if (previousSidecars.length) manifest.previousSidecars = [...new Set(previousSidecars)].sort();
602
- return manifest;
603
- }
604
-
605
- const OPERATION_FIELDS = ['operationId', 'runningAt', 'deadlineAt', 'overdueRound', 'overdueActionId', 'url', 'fileSize', 'objectCount', 'rootObjectCount', 'createdAt', 'completedAt', 'startedAt'];
606
-
607
- // The shopify extract adapters plug into the runner here and add no runner logic of their own: a denial
608
- // handler, a `failed` handler per query (`failed.byQuery`), a reassembly hook per query, the
609
- // `denied` reset, and `project` (the projection applied to the customer and order query text).
610
- // Everything a handler registers must be idempotent. Options passed to createBulkRunner
611
- // override what is registered.
612
- const registered = { handlers: {}, deniedReset: null, project: null };
613
-
614
- function registerHandlers({ denied, failed, reassemble, deniedReset, project } = {}) {
615
- if (denied) registered.handlers.denied = denied;
616
- if (failed) registered.handlers.failed = { ...(registered.handlers.failed || {}), ...failed, byQuery: { ...((registered.handlers.failed || {}).byQuery || {}), ...(failed.byQuery || {}) } };
617
- if (reassemble) registered.handlers.reassemble = { ...(registered.handlers.reassemble || {}), ...reassemble };
618
- if (deniedReset) registered.deniedReset = deniedReset;
619
- if (project) registered.project = project;
620
- }
621
-
622
- function clearRegisteredHandlers() {
623
- registered.handlers = {};
624
- registered.deniedReset = null;
625
- registered.project = null;
626
- }
627
-
628
- function mergeHandlers(extra = {}) {
629
- const base = registered.handlers;
630
- return {
631
- denied: extra.denied || base.denied,
632
- failed: { ...(base.failed || {}), ...(extra.failed || {}), byQuery: { ...((base.failed || {}).byQuery || {}), ...((extra.failed || {}).byQuery || {}) } },
633
- reassemble: { ...(base.reassemble || {}), ...(extra.reassemble || {}) },
634
- };
635
- }
636
-
637
- function createBulkRunner(options = {}) {
638
- const {
639
- projectDir,
640
- store,
641
- caller,
642
- manifestPath,
643
- stagingDir,
644
- queries = null,
645
- snapshotTime = null,
646
- execute,
647
- handlers: handlerOptions = {},
648
- deniedReset = registered.deniedReset,
649
- retryFailed = false,
650
- previousSidecars = [],
651
- sessionCheck = null,
652
- download = defaultDownload,
653
- outputDir = null,
654
- now = () => Date.now(),
655
- sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
656
- progress = () => {},
657
- onPersist = null,
658
- overdueMs = OVERDUE_MS,
659
- } = options;
660
- if (caller !== 'extract' && caller !== 'census') throw new Error('caller must be extract or census');
661
- if (!projectDir || !manifestPath || !stagingDir) throw new Error('projectDir, manifestPath and stagingDir are required');
662
- if (typeof execute !== 'function' || typeof execute.startBulkOperation !== 'function') throw new Error('execute (a store executor with startBulkOperation) is required');
663
- if (caller === 'extract' && !outputDir) throw new Error('an extract needs outputDir');
664
- const stage = caller === 'extract' ? 'execution' : 'discovery';
665
- const extract = caller === 'extract';
666
- const normalizedStore = session.normalizeDomain(store);
667
- const handlers = mergeHandlers(handlerOptions);
668
- let manifest = null;
669
-
670
- // -------------------------------------------------------------------------------------------
671
- // Manifest
672
- // -------------------------------------------------------------------------------------------
673
-
674
- async function save(label, query = null) {
675
- await writeJsonAtomic(manifestPath, manifest);
676
- if (typeof onPersist === 'function') await onPersist({ label, query, state: query ? manifest.queries[query].state : null, manifest });
677
- }
678
-
679
- async function readManifest() {
680
- try {
681
- return JSON.parse(await fsp.readFile(manifestPath, 'utf8'));
682
- } catch (error) {
683
- if (error.code === 'ENOENT') return null;
684
- throw error;
685
- }
686
- }
687
-
688
- const entry = (name) => manifest.queries[name];
689
-
690
- async function setState(name, state, fields = {}, dropFields = []) {
691
- const target = entry(name);
692
- target.state = state;
693
- Object.assign(target, fields);
694
- for (const field of dropFields) delete target[field];
695
- await save(`${name}:${state}`, name);
696
- }
697
-
698
- function dropOperation(name) {
699
- const target = entry(name);
700
- for (const field of OPERATION_FIELDS) delete target[field];
701
- }
702
-
703
- // -------------------------------------------------------------------------------------------
704
- // Handlers
705
- // -------------------------------------------------------------------------------------------
706
-
707
- function coverageRowFor(name, { artifact, pointer, recoveryAction }) {
708
- const entity = entityOf(name);
709
- const [row] = buildShopifyCoverageRows({
710
- captureFailures: [{ entity, artifact, reads: [name], errors: [{ code: 'shopify_bulk' }] }],
711
- rawDir: RAW_EXTRACT_DIR,
712
- });
713
- return { ...row, evidence: { artifact, pointer }, recoveryAction };
714
- }
715
-
716
- function failureEvidence(name, target) {
717
- const parts = [`queries.${name}`, `state ${target.outcome || target.state}`, `errorCode ${target.errorCode || 'unknown'}`];
718
- if (target.error && target.error.message) parts.push(String(target.error.message).slice(0, 300));
719
- return parts.join('; ');
720
- }
721
-
722
- // The default `failed` handler. Extract: the capture-failed row, upserted by coverageId.
723
- // Census: the same row, carried in the entry's handlerOutcome for the discovery coverage step
724
- // (the raw coverage file does not exist until discovery's last step, so nothing is upserted).
725
- async function defaultFailedHandler({ name, entry: target }) {
726
- const recoveryAction = extract
727
- ? `Fix the cause named in the stop message, then run shopify-extract.js --retry-failed for ${entityOf(name)}.`
728
- : `Fix the cause, then run Shopify discovery again for ${entityOf(name)} (the extract's gated read also covers it).`;
729
- const row = coverageRowFor(name, {
730
- artifact: extract ? `${RAW_EXTRACT_DIR}/${EXTRACT_MANIFEST_FILE}` : path.relative(projectDir, manifestPath).split(path.sep).join('/'),
731
- pointer: failureEvidence(name, target),
732
- recoveryAction,
733
- });
734
- if (extract) await upsertAdapterCoverageRows(projectDir, { adapter: 'shopify', rows: [row] });
735
- return { handlerOutcome: { coverageId: row.coverageId, ...(extract ? {} : { row }) } };
736
- }
737
-
738
- // The fail-closed denial fallback, used only when the caller registers no denial handler (the
739
- // customer-and-order adapter registers its own): the denial is unattributed, so the dataset is treated like a failed one.
740
- async function defaultDeniedHandler(context) {
741
- const result = await defaultFailedHandler(context);
742
- return { handlerOutcome: { attribution: 'unattributed', ...result.handlerOutcome }, stop: { code: STOPPING_FAILED_CODE, message: `Shopify denied the ${context.name} export and the denial could not be attributed to a withheld detail.` } };
743
- }
744
-
745
- function failedHandlerFor(name) {
746
- const byQuery = (handlers.failed && handlers.failed.byQuery) || {};
747
- return byQuery[name] || (handlers.failed && handlers.failed.default) || defaultFailedHandler;
748
- }
749
-
750
- function handlerContext(name) {
751
- return { name, query: name, entity: entityOf(name), entry: entry(name), manifest, caller, stage, projectDir, store, execute, stagingDir, outputDir, manifestPath, now, sleep };
752
- }
753
-
754
- // -------------------------------------------------------------------------------------------
755
- // Settling
756
- // -------------------------------------------------------------------------------------------
757
-
758
- async function beginSettling(name, outcome, { errorCode, error }) {
759
- await setState(name, 'settling', { outcome, errorCode, error, settlingAt: iso(now()) });
760
- }
761
-
762
- // `later` is a start that finds an already-terminal stopping entry: it stops with the generic
763
- // `shopify_bulk_failed`; the first settle stops with the entry's own code.
764
- function stopFor(name, target, handlerStop, { later = false } = {}) {
765
- const entity = entityOf(name);
766
- if (handlerStop) {
767
- return new BulkStop(handlerStop.code, handlerStop.message || `Shopify ${caller} stopped (${handlerStop.code}) at ${name}.`, { details: { query: name, entity, ...(handlerStop.details || {}) } });
768
- }
769
- const specific = target.errorCode && target.state === 'failed' ? target.errorCode : STOPPING_FAILED_CODE;
770
- const code = later ? STOPPING_FAILED_CODE : specific;
771
- const cause = target.error && target.error.message ? `: ${String(target.error.message).slice(0, 300)}` : '';
772
- return new BulkStop(code, `Shopify dataset ${entity} could not be read (${specific})${cause}. Requires Import Operator: fix the cause named here, run \`shopify-extract.js --retry-failed\`, and when the extract completes record the coverage decision \`provided\` for \`shopify:${entity}\`; otherwise show the merchant the row at mapping.`, { details: { query: name, entity, errorCode: target.errorCode || null, coverageId: target.handlerOutcome ? target.handlerOutcome.coverageId : null } });
773
- }
774
-
775
- // Runs the outcome's handler for a `settling` entry, writes the terminal state, and returns the
776
- // stop the entry causes, or null.
777
- async function finishSettling(name) {
778
- const target = entry(name);
779
- const context = handlerContext(name);
780
- let result;
781
- if (target.outcome === 'failed') {
782
- result = await failedHandlerFor(name)({ ...context, outcome: 'failed' });
783
- } else {
784
- result = await (handlers.denied || defaultDeniedHandler)({ ...context, outcome: 'denied' });
785
- }
786
- const terminal = { handlerOutcome: (result && result.handlerOutcome) || {} };
787
- if (target.outcome === 'denied') terminal.deniedAt = iso(now());
788
- await setState(name, target.outcome, terminal);
789
- const handlerStop = result && result.stop ? result.stop : null;
790
- if (handlerStop) return stopFor(name, entry(name), handlerStop);
791
- if (isStopping(entry(name), caller)) return stopFor(name, entry(name), null);
792
- return null;
793
- }
794
-
795
- async function settle(name, outcome, details) {
796
- await beginSettling(name, outcome, details);
797
- const stop = await finishSettling(name);
798
- if (stop) throw stop;
799
- }
800
-
801
- async function settleAll() {
802
- for (const name of manifest.order) {
803
- if (entry(name).state === 'settling') {
804
- const stop = await finishSettling(name);
805
- if (stop) throw stop;
806
- }
807
- }
808
- }
809
-
810
- // -------------------------------------------------------------------------------------------
811
- // Session expiry, denial
812
- // -------------------------------------------------------------------------------------------
813
-
814
- async function authExpiredStop(extraMessage = '') {
815
- const action = await session.recordAuthExpired(projectDir, { stage, store });
816
- return new BulkStop('source_auth_expired', `the Shopify connection for ${store} expired during the ${caller}${extraMessage}. Re-approval request ${action.requestId} is pending: run the Shopify session check (with --connect if asked), answer it, then run the same step again. Finished reads are not repeated.`, { details: { requestId: action.requestId } });
817
- }
818
-
819
- async function runSessionCheck() {
820
- if (typeof sessionCheck !== 'function') return { ok: true };
821
- return sessionCheck();
822
- }
823
-
824
- async function handleDenial(name, evidence) {
825
- const target = entry(name);
826
- const check = await runSessionCheck();
827
- if (!check.ok && !target.reapproved) {
828
- dropOperation(name);
829
- await setState(name, 'pending', { reapproved: true });
830
- throw await authExpiredStop(` (Shopify denied the ${name} export and the session check failed)`);
831
- }
832
- const verbatim = { message: 'Shopify refused the bulk export with ACCESS_DENIED', ...evidence };
833
- if (DENIAL_ATTRIBUTED_QUERIES.includes(name)) {
834
- await settle(name, 'denied', { errorCode: 'ACCESS_DENIED', error: verbatim });
835
- } else {
836
- await settle(name, 'failed', { errorCode: STOPPING_FAILED_CODE, error: { ...verbatim, message: 'Shopify refused the bulk export with ACCESS_DENIED' } });
837
- }
838
- }
839
-
840
- // -------------------------------------------------------------------------------------------
841
- // Per query
842
- // -------------------------------------------------------------------------------------------
843
-
844
- const hasCode = (errors, code) => (errors || []).some((error) => error && error.extensions && error.extensions.code === code);
845
-
846
- async function startQuery(name) {
847
- const target = entry(name);
848
- await setState(name, 'starting', { startedAt: iso(now()) });
849
- progress('Starting Shopify bulk export', { query: name });
850
- const result = await execute.startBulkOperation(target.text);
851
- if (result.errors && result.errors.length) {
852
- if (hasCode(result.errors, 'ACCESS_DENIED')) { await handleDenial(name, { graphqlErrors: result.errors }); return; }
853
- await settle(name, 'failed', { errorCode: STOPPING_FAILED_CODE, error: { message: 'Shopify answered the bulk start with GraphQL errors', graphqlErrors: result.errors } });
854
- return;
855
- }
856
- const payload = result.data && result.data.bulkOperationRunQuery;
857
- if (!payload) {
858
- await settle(name, 'failed', { errorCode: STOPPING_FAILED_CODE, error: { message: 'Shopify answered the bulk start with no bulkOperationRunQuery result' } });
859
- return;
860
- }
861
- if (Array.isArray(payload.userErrors) && payload.userErrors.length) {
862
- await settle(name, 'failed', { errorCode: STOPPING_FAILED_CODE, error: { message: 'Shopify refused the bulk start', userErrors: payload.userErrors } });
863
- return;
864
- }
865
- const operation = payload.bulkOperation;
866
- if (!operation || typeof operation.id !== 'string') {
867
- await settle(name, 'failed', { errorCode: STOPPING_FAILED_CODE, error: { message: 'Shopify answered the bulk start with no operation id' } });
868
- return;
869
- }
870
- const runningAt = now();
871
- await setState(name, 'running', { operationId: operation.id, runningAt: iso(runningAt), deadlineAt: iso(runningAt + overdueMs), overdueRound: 1 });
872
- }
873
-
874
- function overdueRequestId(name, round) {
875
- return session.sequencedRequestId(OVERDUE_NAMESPACE, `${caller}\0${name}\0${entry(name).operationId}`, round);
876
- }
877
-
878
- async function readActionIfAny(requestId) {
879
- try {
880
- return await readUserAction(projectDir, requestId);
881
- } catch (error) {
882
- if (error.code === 'ENOENT') return null;
883
- throw error;
884
- }
885
- }
886
-
887
- async function raiseOverdue(name) {
888
- const target = entry(name);
889
- const round = target.overdueRound || 1;
890
- const requestId = overdueRequestId(name, round);
891
- let action = await readActionIfAny(requestId);
892
- if (!action) {
893
- action = await createUserAction(projectDir, {
894
- requestId,
895
- kind: 'question',
896
- stage,
897
- title: `Shopify export overdue: ${name} (shopify_bulk_overdue)`,
898
- prompt: `Shopify has been preparing the \`${name}\` export (operation ${target.operationId}) for over ${round * 4} hours. Wait another 4 hours, or abort this dataset?`,
899
- response: { mode: 'choice' },
900
- choices: [
901
- { id: 'wait', label: 'Wait another 4 hours' },
902
- { id: 'abort', label: 'Abort this dataset' },
903
- ],
904
- });
905
- }
906
- await setState(name, 'running', { overdueActionId: action.requestId });
907
- throw new BulkStop('shopify_bulk_overdue', `Shopify has been preparing the ${name} export for over ${round * 4} hours. Answer request ${action.requestId} (wait or abort), then run the same step again.`, { status: 'awaiting_user_action', details: { query: name, operationId: target.operationId, round, requestIds: [action.requestId] } });
908
- }
909
-
910
- // Applies an answered overdue action, or stops while it is unanswered. Returns 'waited' | 'aborted'.
911
- async function applyOverdue(name) {
912
- const target = entry(name);
913
- const action = await readActionIfAny(target.overdueActionId);
914
- if (!action || action.status !== 'answered') {
915
- throw new BulkStop('shopify_bulk_overdue', `The ${name} export is overdue and request ${target.overdueActionId} is unanswered; nothing was polled or started.`, { status: 'awaiting_user_action', details: { query: name, operationId: target.operationId, round: target.overdueRound || 1, requestIds: [target.overdueActionId] } });
916
- }
917
- if (action.answer && action.answer.choice === 'abort') {
918
- await settle(name, 'failed', { errorCode: 'shopify_bulk_overdue_aborted', error: { message: `The ${name} export was aborted after it ran over ${(target.overdueRound || 1) * 4} hours; Shopify's operation ${target.operationId} was not cancelled and its result was never downloaded`, operationId: target.operationId, requestId: action.requestId } });
919
- return 'aborted';
920
- }
921
- const answeredAt = Date.parse(action.answer && action.answer.answeredAt);
922
- const base = Number.isFinite(answeredAt) ? answeredAt : now();
923
- await setState(name, 'running', { deadlineAt: iso(base + overdueMs), overdueRound: (target.overdueRound || 1) + 1 }, ['overdueActionId']);
924
- return 'waited';
925
- }
926
-
927
- function classifyOperation(operation) {
928
- if (!operation) return 'failed';
929
- if (operation.partialDataUrl) return 'failed';
930
- if (operation.status === 'COMPLETED') return 'completed';
931
- if (operation.status === 'FAILED' && operation.errorCode === 'ACCESS_DENIED') return 'denied';
932
- if (['FAILED', 'CANCELED', 'EXPIRED'].includes(operation.status)) return 'failed';
933
- return 'running';
934
- }
935
-
936
- async function failedResult(name, { errorCode = STOPPING_FAILED_CODE, message, evidence = {} }) {
937
- const target = entry(name);
938
- if (target.attempts < MAX_ATTEMPTS) {
939
- dropOperation(name);
940
- await setState(name, 'pending', { attempts: target.attempts + 1, downloadTries: 0 });
941
- return;
942
- }
943
- await settle(name, 'failed', { errorCode, error: { message, ...evidence } });
944
- }
945
-
946
- async function pollOperation(name) {
947
- const result = await execute(STATUS_QUERY, { id: entry(name).operationId });
948
- if (result.errors && result.errors.length) {
949
- return { errors: result.errors };
950
- }
951
- return { operation: result.data && result.data.node ? result.data.node : null };
952
- }
953
-
954
- async function processRunning(name) {
955
- if (entry(name).overdueActionId) {
956
- const outcome = await applyOverdue(name);
957
- if (outcome === 'aborted') return;
958
- }
959
- let wait = POLL_START_MS;
960
- for (;;) {
961
- const polled = await pollOperation(name);
962
- if (polled.errors) {
963
- if (hasCode(polled.errors, 'ACCESS_DENIED')) { await handleDenial(name, { graphqlErrors: polled.errors }); return; }
964
- await settle(name, 'failed', { errorCode: STOPPING_FAILED_CODE, error: { message: 'Shopify answered the status poll with GraphQL errors', graphqlErrors: polled.errors } });
965
- return;
966
- }
967
- const operation = polled.operation;
968
- const kind = classifyOperation(operation);
969
- if (kind === 'running') {
970
- if (now() >= Date.parse(entry(name).deadlineAt)) await raiseOverdue(name);
971
- await sleep(wait);
972
- wait = Math.min(wait * 2, POLL_CAP_MS);
973
- continue;
974
- }
975
- if (kind === 'denied') { await handleDenial(name, { operation: operationEvidence(operation) }); return; }
976
- if (kind === 'failed') {
977
- await failedResult(name, { message: operation ? `Shopify's bulk operation ended ${operation.status}${operation.errorCode ? ` (${operation.errorCode})` : ''}${operation.partialDataUrl ? ' with only partial data' : ''}` : 'Shopify no longer knows the bulk operation', evidence: { operation: operationEvidence(operation) } });
978
- return;
979
- }
980
- await setState(name, 'running', {
981
- url: operation.url || null,
982
- fileSize: operation.fileSize === undefined ? null : operation.fileSize,
983
- objectCount: operation.objectCount,
984
- rootObjectCount: operation.rootObjectCount,
985
- createdAt: operation.createdAt,
986
- completedAt: operation.completedAt,
987
- });
988
- await downloadGate(name);
989
- return;
990
- }
991
- }
992
-
993
- function operationEvidence(operation) {
994
- if (!operation) return null;
995
- return { id: operation.id, status: operation.status, errorCode: operation.errorCode || null, partialDataUrl: operation.partialDataUrl || null, objectCount: operation.objectCount, fileSize: operation.fileSize === undefined ? null : operation.fileSize };
996
- }
997
-
998
- // Marks the entry `downloaded` only when the whole gate holds.
999
- async function downloadGate(name) {
1000
- const jsonl = path.join(stagingDir, `${name}.jsonl`);
1001
- const partial = `${jsonl}.partial`;
1002
- await fsp.mkdir(stagingDir, { recursive: true });
1003
- for (;;) {
1004
- const target = entry(name);
1005
- if (!target.url) {
1006
- if (String(target.objectCount) === '0') {
1007
- await writeTextAtomic(jsonl, '');
1008
- await setState(name, 'downloaded', { bytes: 0, lines: 0 });
1009
- return;
1010
- }
1011
- await failedResult(name, { message: `Shopify completed the ${name} export with no file for ${target.objectCount} objects`, evidence: { operation: { objectCount: target.objectCount } } });
1012
- return;
1013
- }
1014
- progress('Downloading Shopify bulk file', { query: name });
1015
- await removeFile(partial);
1016
- const result = await download(target.url, partial);
1017
- const written = result && Number.isFinite(result.bytes) ? result.bytes : 0;
1018
- if (result && (result.status === 400 || result.status === 403)) {
1019
- await removeFile(partial);
1020
- if (target.linkReruns >= MAX_LINK_RERUNS) {
1021
- await settle(name, 'failed', { errorCode: 'shopify_bulk_download_failed', error: { message: `The ${name} export's download link expired ${target.linkReruns + 1} times (HTTP ${result.status})`, httpStatus: result.status } });
1022
- return;
1023
- }
1024
- dropOperation(name);
1025
- await setState(name, 'pending', { linkReruns: target.linkReruns + 1, downloadTries: 0 });
1026
- return;
1027
- }
1028
- let reason = null;
1029
- if (!result || result.status !== 200) reason = `the download answered ${result && result.status !== null && result.status !== undefined ? `HTTP ${result.status}` : 'no HTTP response'}${result && result.error ? ` (${result.error})` : ''}`;
1030
- else if (result.error) reason = `the download failed: ${result.error}`;
1031
- else if (target.fileSize === null || target.fileSize === undefined || String(written) !== String(target.fileSize)) reason = `the download was ${written} bytes, Shopify reported ${target.fileSize === null || target.fileSize === undefined ? 'no size' : target.fileSize}`;
1032
- let checked = null;
1033
- if (!reason) {
1034
- checked = await validateJsonlFile(partial);
1035
- if (!checked.ok) reason = checked.reason;
1036
- }
1037
- if (!reason) {
1038
- await fsp.rename(partial, jsonl);
1039
- await setState(name, 'downloaded', { bytes: written, lines: checked.lines });
1040
- return;
1041
- }
1042
- await removeFile(partial);
1043
- const tries = target.downloadTries + 1;
1044
- await setState(name, 'running', { downloadTries: tries });
1045
- if (tries < MAX_DOWNLOAD_TRIES) continue;
1046
- await failedResult(name, { errorCode: 'shopify_bulk_download_failed', message: `The ${name} export could not be downloaded whole after ${tries} tries: ${reason}`, evidence: { reason } });
1047
- return;
1048
- }
1049
- }
1050
-
1051
- async function reassemble(name) {
1052
- const target = entry(name);
1053
- const catalog = catalogEntry(name);
1054
- const jsonl = path.join(stagingDir, `${name}.jsonl`);
1055
- if (!fs.existsSync(jsonl)) {
1056
- // `downloaded` promises a complete local file. If it is gone (staging cleared by hand), the
1057
- // dataset is simply read again: no attempt is spent, nothing is guessed.
1058
- dropOperation(name);
1059
- await setState(name, 'pending', { downloadTries: 0 }, ['bytes', 'lines']);
1060
- return;
1061
- }
1062
- const foldedFile = path.join(stagingDir, `${name}.folded.tmp`);
1063
- const folded = await foldBulkJsonl(jsonl, catalog, { outputFile: foldedFile });
1064
- if (folded.orphans) {
1065
- await settle(name, 'failed', { errorCode: 'shopify_bulk_orphan_child', error: { message: `${folded.orphanCount} child row(s) of ${name} match no parent row`, orphans: folded.orphans } });
1066
- return;
1067
- }
1068
- const hook = handlers.reassemble && handlers.reassemble[name];
1069
- let records = null;
1070
- let recordsFile = null;
1071
- let recordCount = folded.recordCount;
1072
- let outputs = {};
1073
- let sidecarFiles = {};
1074
- let result = {};
1075
- let outputFile = null;
1076
- let entryFields = {};
1077
- let hookStop = null;
1078
- if (hook) {
1079
- const hooked = await hook({ ...handlerContext(name), records: iterateNdjson(foldedFile), recordsFile: foldedFile, recordCount, lines: folded.lines });
1080
- if (hooked && hooked.ok === false) {
1081
- await removeFile(foldedFile);
1082
- await settle(name, 'failed', { errorCode: hooked.errorCode || STOPPING_FAILED_CODE, error: { message: hooked.message || `The ${name} recheck failed (${hooked.errorCode || STOPPING_FAILED_CODE})`, ...(hooked.evidence ? { evidence: hooked.evidence } : {}) } });
1083
- return;
1084
- }
1085
- if (hooked && hooked.records) records = hooked.records;
1086
- if (hooked && hooked.recordsFile) recordsFile = hooked.recordsFile;
1087
- if (hooked && Number.isInteger(hooked.recordCount)) recordCount = hooked.recordCount;
1088
- if (hooked && hooked.sidecars) outputs = hooked.sidecars;
1089
- if (hooked && hooked.sidecarFiles) sidecarFiles = hooked.sidecarFiles;
1090
- if (hooked && hooked.manifest) Object.assign(manifest, hooked.manifest);
1091
- if (hooked && hooked.result) result = hooked.result;
1092
- if (hooked && hooked.outputFile) outputFile = hooked.outputFile;
1093
- if (hooked && hooked.entry) entryFields = hooked.entry;
1094
- if (hooked && hooked.stop) hookStop = hooked.stop;
1095
- }
1096
- const readAt = { createdAt: target.createdAt || null, completedAt: target.completedAt || null };
1097
- const durationMs = Number.isFinite(Date.parse(target.completedAt)) && Number.isFinite(Date.parse(target.createdAt)) ? Date.parse(target.completedAt) - Date.parse(target.createdAt) : null;
1098
- if (extract) {
1099
- const stagedName = outputFile || `${name}.ndjson`;
1100
- const staged = path.join(stagingDir, stagedName);
1101
- if (recordsFile) {
1102
- await removeFile(staged);
1103
- await fsp.rename(recordsFile, staged);
1104
- await removeFile(foldedFile);
1105
- } else if (records) {
1106
- recordCount = await writeNdjsonAtomic(staged, records);
1107
- await removeFile(foldedFile);
1108
- } else {
1109
- await fsp.rename(foldedFile, staged);
1110
- }
1111
- const sidecarNames = [...new Set([...Object.keys(outputs), ...Object.keys(sidecarFiles)])].sort();
1112
- const oldSidecars = Array.isArray(target.sidecars) ? target.sidecars : [];
1113
- for (const sidecar of oldSidecars.filter((sidecar) => !sidecarNames.includes(sidecar))) {
1114
- await removeFile(path.join(stagingDir, `sidecar-${sidecar}.ndjson`));
1115
- manifest.obsoleteSidecars = [...new Set([...(manifest.obsoleteSidecars || []), sidecar])].sort();
1116
- }
1117
- for (const sidecar of sidecarNames) {
1118
- const destination = path.join(stagingDir, `sidecar-${sidecar}.ndjson`);
1119
- if (sidecarFiles[sidecar]) {
1120
- await removeFile(destination);
1121
- await fsp.rename(sidecarFiles[sidecar], destination);
1122
- } else {
1123
- await writeNdjsonAtomic(destination, outputs[sidecar]);
1124
- }
1125
- }
1126
- manifest.sidecars = [...new Set(manifest.order.flatMap((query) => query === name ? sidecarNames : (entry(query).sidecars || [])))].sort();
1127
- await setState(name, 'done', { readAt, durationMs, records: recordCount, sidecars: sidecarNames, ...(outputFile ? { outputFile } : {}), ...entryFields }, ['url']);
1128
- } else {
1129
- await removeFile(foldedFile);
1130
- await setState(name, 'done', { readAt, durationMs, result: { records: recordCount, ...result }, ...entryFields }, ['url']);
1131
- }
1132
- await removeFile(jsonl);
1133
- if (hookStop) throw new BulkStop(hookStop.code, hookStop.message || `Shopify extract stopped (${hookStop.code}) at ${name}.`, { details: { query: name, entity: entityOf(name), ...(hookStop.details || {}) } });
1134
- }
1135
-
1136
- async function processQuery(name) {
1137
- for (;;) {
1138
- const target = entry(name);
1139
- switch (target.state) {
1140
- case 'done':
1141
- return;
1142
- case 'denied':
1143
- if (isStopping(target, caller)) throw stopFor(name, target, null, { later: true });
1144
- return;
1145
- case 'failed':
1146
- if (extract) throw stopFor(name, target, null, { later: true });
1147
- return;
1148
- case 'settling': {
1149
- const stop = await finishSettling(name);
1150
- if (stop) throw stop;
1151
- break;
1152
- }
1153
- case 'starting':
1154
- dropOperation(name);
1155
- await setState(name, 'pending');
1156
- break;
1157
- case 'pending':
1158
- await startQuery(name);
1159
- break;
1160
- case 'running':
1161
- await processRunning(name);
1162
- break;
1163
- case 'downloaded':
1164
- await reassemble(name);
1165
- break;
1166
- default:
1167
- throw new Error(`unknown query state ${target.state} for ${name}`);
1168
- }
1169
- }
1170
- }
1171
-
1172
- // -------------------------------------------------------------------------------------------
1173
- // Resume resets
1174
- // -------------------------------------------------------------------------------------------
1175
-
1176
- async function cleanLeftovers() {
1177
- let names = [];
1178
- try {
1179
- names = await fsp.readdir(stagingDir);
1180
- } catch (error) {
1181
- if (error.code !== 'ENOENT') throw error;
1182
- }
1183
- for (const leftover of names.filter((file) => file.endsWith('.partial') || file.endsWith('.tmp'))) await removeFile(path.join(stagingDir, leftover));
1184
- // A crash between the `done` write and the JSONL delete leaves the file behind.
1185
- for (const name of manifest.order) if (entry(name).state === 'done') await removeFile(path.join(stagingDir, `${name}.jsonl`));
1186
- }
1187
-
1188
- function resetEntry(name, fields = {}) {
1189
- const target = entry(name);
1190
- dropOperation(name);
1191
- for (const field of ['outcome', 'errorCode', 'error', 'settlingAt', 'handlerOutcome', 'deniedAt', 'readAt', 'durationMs', 'records', 'result', 'bytes', 'lines']) delete target[field];
1192
- Object.assign(target, { state: 'pending', attempts: 0, downloadTries: 0, linkReruns: 0, reapproved: false }, fields);
1193
- }
1194
-
1195
- async function applyResets() {
1196
- if (!extract) return;
1197
- let changed = false;
1198
- if (typeof deniedReset === 'function') {
1199
- for (const reset of (await deniedReset({ manifest, projectDir })) || []) {
1200
- resetEntry(reset.name, { text: reset.text });
1201
- changed = true;
1202
- }
1203
- }
1204
- if (retryFailed) {
1205
- for (const name of manifest.order) {
1206
- if (isStopping(entry(name), caller)) { resetEntry(name); changed = true; }
1207
- }
1208
- if (manifest.countFailure && manifest.countFailure.entities) {
1209
- for (const failedEntity of manifest.countFailure.entities) {
1210
- for (const name of manifest.order.filter((candidate) => entityOf(candidate) === failedEntity)) {
1211
- await removeFile(path.join(stagingDir, `${name}.ndjson`));
1212
- resetEntry(name);
1213
- }
1214
- }
1215
- delete manifest.countFailure;
1216
- changed = true;
1217
- }
1218
- }
1219
- // A `done` extract entry promises its staged output, and a resume never reads a
1220
- // finished query again. When that output is gone before the final join, read the query again
1221
- // without spending an attempt instead of joining the hole as an empty dataset.
1222
- for (const name of manifest.order) {
1223
- const target = entry(name);
1224
- if (target.state !== 'done') continue;
1225
- const files = [target.outputFile || `${name}.ndjson`, ...(target.sidecars || []).map((sidecar) => `sidecar-${sidecar}.ndjson`)].map((file) => path.join(stagingDir, file));
1226
- const present = await Promise.all(files.map((file) => fsp.access(file).then(() => true, (error) => { if (error.code === 'ENOENT') return false; throw error; })));
1227
- if (present.every(Boolean)) continue;
1228
- for (const file of files) await removeFile(file);
1229
- resetEntry(name);
1230
- changed = true;
1231
- }
1232
- if (changed) await save('resets');
1233
- }
1234
-
1235
- // -------------------------------------------------------------------------------------------
1236
- // Extract: the final join and the count check
1237
- // -------------------------------------------------------------------------------------------
1238
-
1239
- function expectedFinalFiles() {
1240
- const entities = [...new Set(manifest.order.map(entityOf))];
1241
- return [
1242
- ...entities.map((entity) => {
1243
- const first = manifest.order.find((name) => entityOf(name) === entity);
1244
- return (first && entry(first).outputFile) || `${entity}.ndjson`;
1245
- }),
1246
- ...(manifest.sidecars || []).map((entity) => `${entity}.ndjson`),
1247
- ];
1248
- }
1249
-
1250
- async function joinFinalFiles() {
1251
- await fsp.mkdir(outputDir, { recursive: true });
1252
- const staged = (name) => path.join(stagingDir, `${name}.ndjson`);
1253
- let droppedOrphans = 0;
1254
- const droppedByQuery = {};
1255
- for (const entity of [...new Set(manifest.order.map(entityOf))]) {
1256
- const members = manifest.order.filter((name) => entityOf(name) === entity);
1257
- if (entity !== 'orders') {
1258
- const outputFile = entry(members[0]).outputFile || `${entity}.ndjson`;
1259
- const stagedFile = entry(members[0]).outputFile || `${members[0]}.ndjson`;
1260
- await copyFileAtomic(path.join(stagingDir, stagedFile), path.join(outputDir, outputFile));
1261
- continue;
1262
- }
1263
- const joined = await joinOrderFiles({
1264
- coreFile: staged('orders-core'),
1265
- refundsFile: members.includes('orders-refunds') ? staged('orders-refunds') : null,
1266
- fulfillmentsFile: members.includes('orders-fulfillments') ? staged('orders-fulfillments') : null,
1267
- outputFile: path.join(outputDir, 'orders.ndjson'),
1268
- workDir: stagingDir,
1269
- });
1270
- droppedOrphans += joined.droppedOrphans;
1271
- Object.assign(droppedByQuery, joined.droppedByQuery);
1272
- }
1273
- for (const sidecar of manifest.sidecars || []) await copyFileAtomic(path.join(stagingDir, `sidecar-${sidecar}.ndjson`), path.join(outputDir, `${sidecar}.ndjson`));
1274
- const currentSidecars = new Set(manifest.sidecars || []);
1275
- for (const sidecar of new Set([...(manifest.previousSidecars || []), ...(manifest.obsoleteSidecars || [])])) {
1276
- if (!currentSidecars.has(sidecar)) await removeFile(path.join(outputDir, `${sidecar}.ndjson`));
1277
- }
1278
- manifest.droppedOrphans = droppedOrphans;
1279
- manifest.droppedOrphansByQuery = droppedByQuery;
1280
- }
1281
-
1282
- const COUNT_QUERIES = {
1283
- customers: (snapshot) => `query RpExtractCustomersCount { customersCount(query: "created_at:<='${snapshot}'", limit: null) { count precision } }`,
1284
- orders: (snapshot) => `query RpExtractOrdersCount { ordersCount(query: "created_at:<='${snapshot}'", limit: null) { count precision } }`,
1285
- };
1286
-
1287
- async function readExactCount(entity) {
1288
- const root = entity === 'customers' ? 'customersCount' : 'ordersCount';
1289
- let result;
1290
- try {
1291
- result = await execute(COUNT_QUERIES[entity](manifest.snapshotTime));
1292
- } catch (error) {
1293
- if (error instanceof ShopifyCliError && error.code === 'shopify_throttled') return { error: { code: 'shopify_throttled', message: error.message } };
1294
- throw error;
1295
- }
1296
- if (result.errors && result.errors.length) return { error: { code: 'GRAPHQL_ERROR', message: result.errors.map((error) => error && error.message).filter(Boolean).join('; ').slice(0, 300) } };
1297
- const counted = result.data && result.data[root];
1298
- if (!counted || !Number.isInteger(counted.count)) return { error: { code: 'COUNT_MISSING', message: 'the count read returned no count' } };
1299
- return { count: counted.count, precision: counted.precision || null };
1300
- }
1301
-
1302
- async function countCheck() {
1303
- const customersReceived = (await countLines(path.join(outputDir, 'customers.ndjson'))) || 0;
1304
- const withheld = (manifest.sidecars || []).includes('customers-withheld-identity') ? ((await countLines(path.join(outputDir, 'customers-withheld-identity.ndjson'))) || 0) : 0;
1305
- const received = { customers: customersReceived + withheld, orders: (await countLines(path.join(outputDir, 'orders.ndjson'))) || 0 };
1306
- manifest.counts = {};
1307
- const rows = [];
1308
- const stopCodes = [];
1309
- for (const entity of ['customers', 'orders']) {
1310
- const expected = await readExactCount(entity);
1311
- const record = { received: received[entity], ...(entity === 'customers' ? { withheldIdentity: withheld } : {}) };
1312
- let outcome;
1313
- if (expected.error) {
1314
- outcome = 'inexact';
1315
- Object.assign(record, { error: expected.error });
1316
- } else if (expected.precision !== 'EXACT') {
1317
- outcome = 'inexact';
1318
- Object.assign(record, { expected: expected.count, precision: expected.precision });
1319
- } else if (received[entity] < expected.count) {
1320
- outcome = 'short';
1321
- Object.assign(record, { expected: expected.count, precision: expected.precision });
1322
- } else {
1323
- outcome = 'pass';
1324
- Object.assign(record, { expected: expected.count, precision: expected.precision });
1325
- }
1326
- record.outcome = outcome;
1327
- manifest.counts[entity] = record;
1328
- if (outcome === 'pass') continue;
1329
- const code = outcome === 'short' ? 'shopify_extract_count_short' : 'shopify_extract_count_inexact';
1330
- const pointer = outcome === 'short'
1331
- ? `counts.${entity}: received ${record.received} < Shopify's exact count ${record.expected} (precision ${record.precision})`
1332
- : `counts.${entity}: Shopify's count is not exact (${record.error ? `${record.error.code}: ${record.error.message}` : `precision ${record.precision}`}); received ${record.received}`;
1333
- rows.push(coverageRowFor(orderQueryOf(entity), { artifact: `${RAW_EXTRACT_DIR}/${EXTRACT_MANIFEST_FILE}`, pointer, recoveryAction: `Run shopify-extract.js --retry-failed to read ${entity} again, or decide the shortfall at mapping.` }));
1334
- stopCodes.push({ code, entity });
1335
- }
1336
- if (!stopCodes.length) { await save('counts'); return; }
1337
- manifest.countFailure = { entities: stopCodes.map((stop) => stop.entity), codes: stopCodes.map((stop) => stop.code) };
1338
- await save('counts');
1339
- const result = await upsertAdapterCoverageRows(projectDir, { adapter: 'shopify', rows });
1340
- throw new ShopifyExtractStop(stopCodes[0].code, `Shopify extract stopped (${stopCodes[0].code}): ${rows.map((row) => row.coverageId).join(', ')} recorded as source-coverage row(s) for the merchant's decision at mapping. Counts: ${JSON.stringify(manifest.counts)}. Requires Import Operator: after any cause is fixed, run \`shopify-extract.js --retry-failed\` to read the dataset again; when the extract completes, record the coverage decision \`provided\` for each row, otherwise show the merchant the row at mapping.`, { coverageIds: rows.map((row) => row.coverageId), ...result });
1341
- }
1342
-
1343
- function orderQueryOf(entity) {
1344
- return entity === 'customers' ? 'customers' : 'orders-core';
1345
- }
1346
-
1347
- async function finishExtract() {
1348
- if (!manifest.order.every((name) => entry(name).state === 'done')) {
1349
- const open = manifest.order.filter((name) => entry(name).state !== 'done');
1350
- throw new BulkStop(STOPPING_FAILED_CODE, `The extract cannot finish: ${open.join(', ')} ${open.length === 1 ? 'is' : 'are'} not read (${open.map((name) => `${name} ${entry(name).state}`).join(', ')}). Nothing was marked complete.`, { details: { open } });
1351
- }
1352
- await joinFinalFiles();
1353
- await save('joined');
1354
- await countCheck();
1355
- manifest.status = 'complete';
1356
- manifest.completedAt = iso(now());
1357
- delete manifest.countFailure;
1358
- await save('complete');
1359
- await fsp.rm(stagingDir, { recursive: true, force: true });
1360
- }
1361
-
1362
- // -------------------------------------------------------------------------------------------
1363
- // run()
1364
- // -------------------------------------------------------------------------------------------
1365
-
1366
- async function filesPresent() {
1367
- for (const file of expectedFinalFiles()) {
1368
- try {
1369
- await fsp.access(path.join(outputDir, file));
1370
- } catch {
1371
- return false;
1372
- }
1373
- }
1374
- return true;
1375
- }
1376
-
1377
- async function runInner() {
1378
- manifest = await readManifest();
1379
- let storeMatches = !manifest;
1380
- if (manifest && manifest.store) {
1381
- try {
1382
- storeMatches = session.normalizeDomain(manifest.store) === normalizedStore;
1383
- } catch {
1384
- storeMatches = false;
1385
- }
1386
- }
1387
- if (manifest && !storeMatches) {
1388
- const recorded = manifest.store || null;
1389
- manifest = null;
1390
- throw new BulkStop('shopify_extract_store_mismatch', `${path.basename(manifestPath)} was read from ${recorded || 'an unrecorded store'}, not ${normalizedStore}. Nothing was read or changed.`, { details: { recorded, store: normalizedStore } });
1391
- }
1392
- if (!manifest) {
1393
- if (!Array.isArray(queries) || !queries.length) throw new Error('queries are required to start a new manifest');
1394
- manifest = newManifest({ caller, store: normalizedStore, snapshotTime: extract ? snapshotTime : null, queries, previousSidecars, now });
1395
- await save('created');
1396
- }
1397
- if (extract && manifest.status === 'complete') {
1398
- if (!(await filesPresent())) {
1399
- throw new BulkStop('shopify_extract_files_missing', `The extract manifest says complete but its final files are missing from ${path.relative(projectDir, outputDir)}. Run shopify-extract.js --catch-up to read the store again.`);
1400
- }
1401
- await fsp.rm(stagingDir, { recursive: true, force: true });
1402
- return { status: 'complete', skipped: true };
1403
- }
1404
- if (manifest.lastStop) { delete manifest.lastStop; await save('cleared-stop'); }
1405
- await settleAll();
1406
- await cleanLeftovers();
1407
- await applyResets();
1408
- for (const name of manifest.order) {
1409
- if (isStopping(entry(name), caller)) throw stopFor(name, entry(name), null, { later: true });
1410
- }
1411
- for (const name of manifest.order) await processQuery(name);
1412
- if (extract) await finishExtract();
1413
- else { manifest.status = 'complete'; manifest.completedAt = iso(now()); await save('complete'); }
1414
- return { status: 'complete' };
1415
- }
1416
-
1417
- async function run() {
1418
- let stop = null;
1419
- try {
1420
- const outcome = await runInner();
1421
- return { ...outcome, manifest };
1422
- } catch (error) {
1423
- if (error instanceof BulkStop) stop = error;
1424
- else if (error instanceof ShopifyExtractStop) stop = new BulkStop(error.code, error.message, { details: error.details });
1425
- else if (error instanceof ShopifyCliError && error.code === 'source_auth_expired') stop = await authExpiredStop();
1426
- else if (error instanceof ShopifyCliError) stop = new BulkStop(error.code, error.message, { details: { cli: true } });
1427
- else throw error;
1428
- }
1429
- if (manifest) {
1430
- manifest.lastStop = { code: stop.code, message: stop.message, status: stop.status, at: iso(now()) };
1431
- await save('stopped');
1432
- }
1433
- return { status: stop.status, code: stop.code, message: stop.message, details: stop.details, manifest };
1434
- }
1435
-
1436
- return { run, get manifest() { return manifest; } };
1437
- }
1438
-
1439
- module.exports = {
1440
- QUERIES_DIR,
1441
- QUERY_CATALOG,
1442
- QUERY_NAMES,
1443
- CUSTOMER_QUERIES,
1444
- ORDER_QUERIES,
1445
- DENIAL_ATTRIBUTED_QUERIES,
1446
- MANIFEST_SCHEMA_VERSION,
1447
- EXTRACT_MANIFEST_FILE,
1448
- RAW_EXTRACT_DIR,
1449
- SNAPSHOT_PLACEHOLDER,
1450
- STATUS_QUERY,
1451
- POLL_START_MS,
1452
- POLL_CAP_MS,
1453
- OVERDUE_MS,
1454
- MAX_DOWNLOAD_TRIES,
1455
- MAX_LINK_RERUNS,
1456
- BulkStop,
1457
- catalogEntry,
1458
- entityOf,
1459
- readQueryFile,
1460
- generateQueryText,
1461
- connectionShape,
1462
- validateJsonlFile,
1463
- foldBulkJsonl,
1464
- joinOrderFiles,
1465
- defaultDownload,
1466
- registerHandlers,
1467
- clearRegisteredHandlers,
1468
- registeredProjection: () => registered.project,
1469
- createBulkRunner,
1470
- };