@ecomweb/cli 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -3
- package/dist/base-command.d.ts +7 -3
- package/dist/base-command.js +22 -14
- package/dist/base-command.js.map +1 -1
- package/dist/commands/analytics/ga4/all.d.ts +1 -1
- package/dist/commands/analytics/ga4/all.js +2 -2
- package/dist/commands/analytics/ga4/all.js.map +1 -1
- package/dist/commands/analytics/ga4/overview.d.ts +1 -1
- package/dist/commands/analytics/ga4/overview.js +2 -2
- package/dist/commands/analytics/ga4/overview.js.map +1 -1
- package/dist/commands/analytics/ga4/sessions-by-channel.d.ts +1 -1
- package/dist/commands/analytics/ga4/sessions-by-channel.js +2 -2
- package/dist/commands/analytics/ga4/sessions-by-channel.js.map +1 -1
- package/dist/commands/analytics/ga4/trends.d.ts +1 -1
- package/dist/commands/analytics/ga4/trends.js +2 -2
- package/dist/commands/analytics/ga4/trends.js.map +1 -1
- package/dist/commands/analytics/ga4/users-by-country.d.ts +1 -1
- package/dist/commands/analytics/ga4/users-by-country.js +2 -2
- package/dist/commands/analytics/ga4/users-by-country.js.map +1 -1
- package/dist/commands/analytics/ga4/views-by-page.d.ts +1 -1
- package/dist/commands/analytics/ga4/views-by-page.js +2 -2
- package/dist/commands/analytics/ga4/views-by-page.js.map +1 -1
- package/dist/commands/analytics/gsc/all.d.ts +1 -1
- package/dist/commands/analytics/gsc/all.js +2 -2
- package/dist/commands/analytics/gsc/all.js.map +1 -1
- package/dist/commands/analytics/gsc/search-console.d.ts +1 -1
- package/dist/commands/analytics/gsc/search-console.js +2 -2
- package/dist/commands/analytics/gsc/search-console.js.map +1 -1
- package/dist/commands/analytics/sales/all.d.ts +1 -1
- package/dist/commands/analytics/sales/all.js +2 -2
- package/dist/commands/analytics/sales/all.js.map +1 -1
- package/dist/commands/analytics/sales/summary.d.ts +1 -1
- package/dist/commands/analytics/sales/summary.js +2 -2
- package/dist/commands/analytics/sales/summary.js.map +1 -1
- package/dist/commands/analytics/sales/time-series.d.ts +1 -1
- package/dist/commands/analytics/sales/time-series.js +2 -2
- package/dist/commands/analytics/sales/time-series.js.map +1 -1
- package/dist/commands/assets/bulk-delete.d.ts +1 -1
- package/dist/commands/assets/bulk-delete.js +3 -3
- package/dist/commands/assets/bulk-delete.js.map +1 -1
- package/dist/commands/assets/delete.d.ts +1 -1
- package/dist/commands/assets/delete.js +3 -3
- package/dist/commands/assets/delete.js.map +1 -1
- package/dist/commands/assets/get-by-entity.d.ts +1 -1
- package/dist/commands/assets/get-by-entity.js +2 -2
- package/dist/commands/assets/get-by-entity.js.map +1 -1
- package/dist/commands/assets/get.d.ts +1 -1
- package/dist/commands/assets/get.js +2 -2
- package/dist/commands/assets/get.js.map +1 -1
- package/dist/commands/assets/link.d.ts +1 -1
- package/dist/commands/assets/link.js +3 -3
- package/dist/commands/assets/link.js.map +1 -1
- package/dist/commands/assets/list.d.ts +1 -1
- package/dist/commands/assets/list.js +2 -2
- package/dist/commands/assets/list.js.map +1 -1
- package/dist/commands/assets/replace.d.ts +1 -1
- package/dist/commands/assets/replace.js +3 -3
- package/dist/commands/assets/replace.js.map +1 -1
- package/dist/commands/assets/unlink.d.ts +1 -1
- package/dist/commands/assets/unlink.js +3 -3
- package/dist/commands/assets/unlink.js.map +1 -1
- package/dist/commands/assets/update.d.ts +1 -1
- package/dist/commands/assets/update.js +3 -3
- package/dist/commands/assets/update.js.map +1 -1
- package/dist/commands/assets/upload-and-link.d.ts +1 -1
- package/dist/commands/assets/upload-and-link.js +5 -4
- package/dist/commands/assets/upload-and-link.js.map +1 -1
- package/dist/commands/assets/upload-video.d.ts +1 -1
- package/dist/commands/assets/upload-video.js +3 -3
- package/dist/commands/assets/upload-video.js.map +1 -1
- package/dist/commands/assets/upload.d.ts +1 -1
- package/dist/commands/assets/upload.js +5 -4
- package/dist/commands/assets/upload.js.map +1 -1
- package/dist/commands/attributes/create.d.ts +21 -0
- package/dist/commands/attributes/create.js +37 -0
- package/dist/commands/attributes/create.js.map +1 -0
- package/dist/commands/{shipping-programs → attributes}/delete.d.ts +3 -2
- package/dist/commands/attributes/delete.js +45 -0
- package/dist/commands/attributes/delete.js.map +1 -0
- package/dist/commands/{blog-posts/generate.d.ts → attributes/list.d.ts} +6 -6
- package/dist/commands/attributes/list.js +47 -0
- package/dist/commands/attributes/list.js.map +1 -0
- package/dist/commands/{shipping-methods → attributes}/update.d.ts +4 -7
- package/dist/commands/attributes/update.js +41 -0
- package/dist/commands/attributes/update.js.map +1 -0
- package/dist/commands/attributes/values/create.d.ts +28 -0
- package/dist/commands/attributes/values/create.js +45 -0
- package/dist/commands/attributes/values/create.js.map +1 -0
- package/dist/commands/{shipping-programs/get-rule.d.ts → attributes/values/delete.d.ts} +6 -5
- package/dist/commands/attributes/values/delete.js +48 -0
- package/dist/commands/attributes/values/delete.js.map +1 -0
- package/dist/commands/attributes/values/list.d.ts +24 -0
- package/dist/commands/attributes/values/list.js +29 -0
- package/dist/commands/attributes/values/list.js.map +1 -0
- package/dist/commands/attributes/values/update.d.ts +33 -0
- package/dist/commands/attributes/values/update.js +50 -0
- package/dist/commands/attributes/values/update.js.map +1 -0
- package/dist/commands/auth/login.d.ts +5 -1
- package/dist/commands/auth/login.js +70 -3
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/logout.d.ts +1 -1
- package/dist/commands/auth/profiles/delete.d.ts +1 -1
- package/dist/commands/auth/profiles/list.d.ts +1 -1
- package/dist/commands/auth/profiles/list.js +1 -1
- package/dist/commands/auth/profiles/list.js.map +1 -1
- package/dist/commands/auth/profiles/use.d.ts +1 -1
- package/dist/commands/auth/register.d.ts +1 -1
- package/dist/commands/auth/status.d.ts +1 -1
- package/dist/commands/auth/status.js +10 -3
- package/dist/commands/auth/status.js.map +1 -1
- package/dist/commands/auth/verify.d.ts +1 -1
- package/dist/commands/banners/create.d.ts +1 -1
- package/dist/commands/banners/create.js +3 -3
- package/dist/commands/banners/create.js.map +1 -1
- package/dist/commands/banners/delete.d.ts +1 -1
- package/dist/commands/banners/delete.js +3 -3
- package/dist/commands/banners/delete.js.map +1 -1
- package/dist/commands/banners/get.d.ts +1 -1
- package/dist/commands/banners/get.js +2 -2
- package/dist/commands/banners/get.js.map +1 -1
- package/dist/commands/banners/list.d.ts +1 -1
- package/dist/commands/banners/list.js +2 -2
- package/dist/commands/banners/list.js.map +1 -1
- package/dist/commands/banners/update.d.ts +1 -1
- package/dist/commands/banners/update.js +3 -3
- package/dist/commands/banners/update.js.map +1 -1
- package/dist/commands/blog-categories/all.d.ts +1 -1
- package/dist/commands/blog-categories/all.js +2 -2
- package/dist/commands/blog-categories/all.js.map +1 -1
- package/dist/commands/blog-categories/create.d.ts +1 -1
- package/dist/commands/blog-categories/create.js +3 -4
- package/dist/commands/blog-categories/create.js.map +1 -1
- package/dist/commands/blog-categories/delete.d.ts +1 -1
- package/dist/commands/blog-categories/delete.js +3 -3
- package/dist/commands/blog-categories/delete.js.map +1 -1
- package/dist/commands/blog-categories/list.d.ts +1 -1
- package/dist/commands/blog-categories/list.js +2 -2
- package/dist/commands/blog-categories/list.js.map +1 -1
- package/dist/commands/blog-categories/update.d.ts +1 -1
- package/dist/commands/blog-categories/update.js +3 -3
- package/dist/commands/blog-categories/update.js.map +1 -1
- package/dist/commands/blog-posts/all.d.ts +1 -1
- package/dist/commands/blog-posts/all.js +2 -2
- package/dist/commands/blog-posts/all.js.map +1 -1
- package/dist/commands/blog-posts/batch-create.d.ts +1 -1
- package/dist/commands/blog-posts/batch-create.js +3 -3
- package/dist/commands/blog-posts/batch-create.js.map +1 -1
- package/dist/commands/blog-posts/batch-delete.d.ts +1 -1
- package/dist/commands/blog-posts/batch-delete.js +2 -2
- package/dist/commands/blog-posts/batch-delete.js.map +1 -1
- package/dist/commands/blog-posts/batch-update.d.ts +1 -1
- package/dist/commands/blog-posts/batch-update.js +3 -3
- package/dist/commands/blog-posts/batch-update.js.map +1 -1
- package/dist/commands/blog-posts/create.d.ts +1 -1
- package/dist/commands/blog-posts/create.js +3 -4
- package/dist/commands/blog-posts/create.js.map +1 -1
- package/dist/commands/blog-posts/delete.d.ts +1 -1
- package/dist/commands/blog-posts/delete.js +3 -3
- package/dist/commands/blog-posts/delete.js.map +1 -1
- package/dist/commands/blog-posts/get.d.ts +1 -1
- package/dist/commands/blog-posts/get.js +2 -2
- package/dist/commands/blog-posts/get.js.map +1 -1
- package/dist/commands/blog-posts/import.d.ts +1 -1
- package/dist/commands/blog-posts/import.js +3 -3
- package/dist/commands/blog-posts/import.js.map +1 -1
- package/dist/commands/blog-posts/list.d.ts +1 -1
- package/dist/commands/blog-posts/list.js +2 -2
- package/dist/commands/blog-posts/list.js.map +1 -1
- package/dist/commands/blog-posts/stats.d.ts +1 -1
- package/dist/commands/blog-posts/stats.js +2 -2
- package/dist/commands/blog-posts/stats.js.map +1 -1
- package/dist/commands/blog-posts/update.d.ts +1 -1
- package/dist/commands/blog-posts/update.js +3 -3
- package/dist/commands/blog-posts/update.js.map +1 -1
- package/dist/commands/blog-settings/get.d.ts +1 -1
- package/dist/commands/blog-settings/get.js +2 -2
- package/dist/commands/blog-settings/get.js.map +1 -1
- package/dist/commands/blog-settings/update.d.ts +1 -1
- package/dist/commands/blog-settings/update.js +3 -3
- package/dist/commands/blog-settings/update.js.map +1 -1
- package/dist/commands/blog-tags/all.d.ts +1 -1
- package/dist/commands/blog-tags/all.js +2 -2
- package/dist/commands/blog-tags/all.js.map +1 -1
- package/dist/commands/blog-tags/create.d.ts +1 -1
- package/dist/commands/blog-tags/create.js +3 -4
- package/dist/commands/blog-tags/create.js.map +1 -1
- package/dist/commands/blog-tags/delete.d.ts +1 -1
- package/dist/commands/blog-tags/delete.js +3 -3
- package/dist/commands/blog-tags/delete.js.map +1 -1
- package/dist/commands/blog-tags/list.d.ts +1 -1
- package/dist/commands/blog-tags/list.js +2 -2
- package/dist/commands/blog-tags/list.js.map +1 -1
- package/dist/commands/categories/all.d.ts +2 -18
- package/dist/commands/categories/all.js +2 -24
- package/dist/commands/categories/all.js.map +1 -1
- package/dist/commands/categories/create.d.ts +2 -27
- package/dist/commands/categories/create.js +2 -73
- package/dist/commands/categories/create.js.map +1 -1
- package/dist/commands/categories/delete.d.ts +2 -24
- package/dist/commands/categories/delete.js +2 -30
- package/dist/commands/categories/delete.js.map +1 -1
- package/dist/commands/categories/get.d.ts +2 -23
- package/dist/commands/categories/get.js +2 -26
- package/dist/commands/categories/get.js.map +1 -1
- package/dist/commands/categories/list.d.ts +2 -27
- package/dist/commands/categories/list.js +2 -65
- package/dist/commands/categories/list.js.map +1 -1
- package/dist/commands/categories/update.d.ts +2 -33
- package/dist/commands/categories/update.js +2 -79
- package/dist/commands/categories/update.js.map +1 -1
- package/dist/commands/collections/all.d.ts +1 -1
- package/dist/commands/collections/all.js +2 -2
- package/dist/commands/collections/all.js.map +1 -1
- package/dist/commands/collections/create.d.ts +1 -1
- package/dist/commands/collections/create.js +6 -5
- package/dist/commands/collections/create.js.map +1 -1
- package/dist/commands/collections/delete.d.ts +1 -1
- package/dist/commands/collections/delete.js +3 -3
- package/dist/commands/collections/delete.js.map +1 -1
- package/dist/commands/collections/get.d.ts +1 -1
- package/dist/commands/collections/get.js +2 -2
- package/dist/commands/collections/get.js.map +1 -1
- package/dist/commands/collections/list.d.ts +1 -1
- package/dist/commands/collections/list.js +2 -2
- package/dist/commands/collections/list.js.map +1 -1
- package/dist/commands/collections/update.d.ts +1 -1
- package/dist/commands/collections/update.js +3 -3
- package/dist/commands/collections/update.js.map +1 -1
- package/dist/commands/customers/addresses.d.ts +5 -2
- package/dist/commands/customers/addresses.js +8 -7
- package/dist/commands/customers/addresses.js.map +1 -1
- package/dist/commands/customers/create.d.ts +1 -1
- package/dist/commands/customers/create.js +4 -5
- package/dist/commands/customers/create.js.map +1 -1
- package/dist/commands/customers/delete.d.ts +1 -1
- package/dist/commands/customers/delete.js +3 -3
- package/dist/commands/customers/delete.js.map +1 -1
- package/dist/commands/customers/get.d.ts +5 -2
- package/dist/commands/customers/get.js +9 -7
- package/dist/commands/customers/get.js.map +1 -1
- package/dist/commands/{shipping-methods/get.d.ts → customers/insights.d.ts} +2 -2
- package/dist/commands/customers/insights.js +30 -0
- package/dist/commands/customers/insights.js.map +1 -0
- package/dist/commands/customers/list.d.ts +1 -1
- package/dist/commands/customers/list.js +3 -3
- package/dist/commands/customers/list.js.map +1 -1
- package/dist/commands/customers/stats.d.ts +1 -1
- package/dist/commands/customers/stats.js +2 -2
- package/dist/commands/customers/stats.js.map +1 -1
- package/dist/commands/customers/timeline.d.ts +26 -0
- package/dist/commands/customers/timeline.js +66 -0
- package/dist/commands/customers/timeline.js.map +1 -0
- package/dist/commands/customers/update.d.ts +1 -1
- package/dist/commands/customers/update.js +4 -4
- package/dist/commands/customers/update.js.map +1 -1
- package/dist/commands/deploy.d.ts +22 -0
- package/dist/commands/deploy.js +72 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/{shipping-zones/location-data.d.ts → deployments/index.d.ts} +2 -2
- package/dist/commands/deployments/index.js +17 -0
- package/dist/commands/deployments/index.js.map +1 -0
- package/dist/commands/deployments/promote.d.ts +22 -0
- package/dist/commands/deployments/promote.js +39 -0
- package/dist/commands/deployments/promote.js.map +1 -0
- package/dist/commands/deployments/rollback.d.ts +5 -0
- package/dist/commands/deployments/rollback.js +12 -0
- package/dist/commands/deployments/rollback.js.map +1 -0
- package/dist/commands/deployments/unpublish.d.ts +18 -0
- package/dist/commands/deployments/unpublish.js +21 -0
- package/dist/commands/deployments/unpublish.js.map +1 -0
- package/dist/commands/describe.d.ts +1 -1
- package/dist/commands/describe.js +6 -0
- package/dist/commands/describe.js.map +1 -1
- package/dist/commands/env/index.d.ts +18 -0
- package/dist/commands/env/index.js +17 -0
- package/dist/commands/env/index.js.map +1 -0
- package/dist/commands/env/set.d.ts +23 -0
- package/dist/commands/env/set.js +44 -0
- package/dist/commands/env/set.js.map +1 -0
- package/dist/commands/env/unset.d.ts +21 -0
- package/dist/commands/env/unset.js +26 -0
- package/dist/commands/env/unset.js.map +1 -0
- package/dist/commands/health/check.d.ts +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.js +3 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/logs.d.ts +21 -0
- package/dist/commands/logs.js +23 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/orders/batch-cancel.d.ts +1 -1
- package/dist/commands/orders/batch-cancel.js +2 -2
- package/dist/commands/orders/batch-cancel.js.map +1 -1
- package/dist/commands/orders/batch-fulfill.d.ts +1 -1
- package/dist/commands/orders/batch-fulfill.js +2 -2
- package/dist/commands/orders/batch-fulfill.js.map +1 -1
- package/dist/commands/orders/batch-update.d.ts +1 -1
- package/dist/commands/orders/batch-update.js +3 -3
- package/dist/commands/orders/batch-update.js.map +1 -1
- package/dist/commands/orders/cancel.d.ts +1 -1
- package/dist/commands/orders/cancel.js +3 -3
- package/dist/commands/orders/cancel.js.map +1 -1
- package/dist/commands/orders/create.d.ts +1 -1
- package/dist/commands/orders/create.js +4 -5
- package/dist/commands/orders/create.js.map +1 -1
- package/dist/commands/orders/deliver.d.ts +1 -1
- package/dist/commands/orders/deliver.js +3 -3
- package/dist/commands/orders/deliver.js.map +1 -1
- package/dist/commands/orders/fulfill.d.ts +1 -1
- package/dist/commands/orders/fulfill.js +3 -3
- package/dist/commands/orders/fulfill.js.map +1 -1
- package/dist/commands/orders/get.d.ts +1 -1
- package/dist/commands/orders/get.js +2 -2
- package/dist/commands/orders/get.js.map +1 -1
- package/dist/commands/orders/list.d.ts +1 -1
- package/dist/commands/orders/list.js +2 -2
- package/dist/commands/orders/list.js.map +1 -1
- package/dist/commands/orders/resume.d.ts +1 -1
- package/dist/commands/orders/resume.js +3 -3
- package/dist/commands/orders/resume.js.map +1 -1
- package/dist/commands/orders/ship.d.ts +1 -1
- package/dist/commands/orders/ship.js +3 -3
- package/dist/commands/orders/ship.js.map +1 -1
- package/dist/commands/orders/stats.d.ts +1 -1
- package/dist/commands/orders/stats.js +2 -2
- package/dist/commands/orders/stats.js.map +1 -1
- package/dist/commands/orders/transitions.d.ts +1 -1
- package/dist/commands/orders/transitions.js +2 -2
- package/dist/commands/orders/transitions.js.map +1 -1
- package/dist/commands/orders/update.d.ts +1 -1
- package/dist/commands/orders/update.js +3 -3
- package/dist/commands/orders/update.js.map +1 -1
- package/dist/commands/{shipping-programs/delete-rule.d.ts → product-services/assign.d.ts} +5 -7
- package/dist/commands/product-services/assign.js +51 -0
- package/dist/commands/product-services/assign.js.map +1 -0
- package/dist/commands/{shipping-programs → product-services}/create.d.ts +5 -7
- package/dist/commands/product-services/create.js +65 -0
- package/dist/commands/product-services/create.js.map +1 -0
- package/dist/commands/{shipping-methods → product-services}/delete.d.ts +2 -2
- package/dist/commands/product-services/delete.js +30 -0
- package/dist/commands/product-services/delete.js.map +1 -0
- package/dist/commands/product-services/list.d.ts +19 -0
- package/dist/commands/product-services/list.js +33 -0
- package/dist/commands/product-services/list.js.map +1 -0
- package/dist/commands/{shipping-programs → product-services}/update.d.ts +5 -7
- package/dist/commands/product-services/update.js +66 -0
- package/dist/commands/product-services/update.js.map +1 -0
- package/dist/commands/product-tags/create.d.ts +21 -0
- package/dist/commands/product-tags/create.js +52 -0
- package/dist/commands/product-tags/create.js.map +1 -0
- package/dist/commands/product-tags/delete.d.ts +21 -0
- package/dist/commands/product-tags/delete.js +35 -0
- package/dist/commands/product-tags/delete.js.map +1 -0
- package/dist/commands/{shipping-methods → product-tags}/list.d.ts +2 -5
- package/dist/commands/{shipping-methods → product-tags}/list.js +17 -21
- package/dist/commands/product-tags/list.js.map +1 -0
- package/dist/commands/product-tags/merge.d.ts +22 -0
- package/dist/commands/product-tags/merge.js +45 -0
- package/dist/commands/product-tags/merge.js.map +1 -0
- package/dist/commands/product-tags/rename.d.ts +22 -0
- package/dist/commands/product-tags/rename.js +36 -0
- package/dist/commands/product-tags/rename.js.map +1 -0
- package/dist/commands/products/all.d.ts +1 -1
- package/dist/commands/products/all.js +2 -2
- package/dist/commands/products/all.js.map +1 -1
- package/dist/commands/products/batch-create.d.ts +1 -1
- package/dist/commands/products/batch-create.js +3 -3
- package/dist/commands/products/batch-create.js.map +1 -1
- package/dist/commands/products/batch-delete.d.ts +1 -1
- package/dist/commands/products/batch-delete.js +2 -2
- package/dist/commands/products/batch-delete.js.map +1 -1
- package/dist/commands/products/batch-update.d.ts +1 -1
- package/dist/commands/products/batch-update.js +3 -3
- package/dist/commands/products/batch-update.js.map +1 -1
- package/dist/commands/products/create.d.ts +3 -2
- package/dist/commands/products/create.js +9 -7
- package/dist/commands/products/create.js.map +1 -1
- package/dist/commands/products/delete.d.ts +1 -1
- package/dist/commands/products/delete.js +3 -3
- package/dist/commands/products/delete.js.map +1 -1
- package/dist/commands/products/get.d.ts +1 -2
- package/dist/commands/products/get.js +3 -5
- package/dist/commands/products/get.js.map +1 -1
- package/dist/commands/products/list.d.ts +2 -4
- package/dist/commands/products/list.js +11 -11
- package/dist/commands/products/list.js.map +1 -1
- package/dist/commands/products/search.d.ts +2 -4
- package/dist/commands/products/search.js +11 -10
- package/dist/commands/products/search.js.map +1 -1
- package/dist/commands/products/stats.d.ts +1 -1
- package/dist/commands/products/stats.js +2 -2
- package/dist/commands/products/stats.js.map +1 -1
- package/dist/commands/products/update.d.ts +3 -2
- package/dist/commands/products/update.js +9 -6
- package/dist/commands/products/update.js.map +1 -1
- package/dist/commands/products/variant-options.d.ts +1 -1
- package/dist/commands/products/variant-options.js +12 -10
- package/dist/commands/products/variant-options.js.map +1 -1
- package/dist/commands/promotions/batch-delete.d.ts +1 -1
- package/dist/commands/promotions/batch-delete.js +2 -2
- package/dist/commands/promotions/batch-delete.js.map +1 -1
- package/dist/commands/promotions/create.d.ts +1 -1
- package/dist/commands/promotions/create.js +3 -4
- package/dist/commands/promotions/create.js.map +1 -1
- package/dist/commands/promotions/delete.d.ts +1 -1
- package/dist/commands/promotions/delete.js +3 -3
- package/dist/commands/promotions/delete.js.map +1 -1
- package/dist/commands/promotions/get-by-code.d.ts +1 -1
- package/dist/commands/promotions/get-by-code.js +2 -2
- package/dist/commands/promotions/get-by-code.js.map +1 -1
- package/dist/commands/promotions/get.d.ts +1 -1
- package/dist/commands/promotions/get.js +2 -2
- package/dist/commands/promotions/get.js.map +1 -1
- package/dist/commands/promotions/list.d.ts +1 -1
- package/dist/commands/promotions/list.js +2 -2
- package/dist/commands/promotions/list.js.map +1 -1
- package/dist/commands/promotions/stats.d.ts +1 -1
- package/dist/commands/promotions/stats.js +2 -2
- package/dist/commands/promotions/stats.js.map +1 -1
- package/dist/commands/promotions/update.d.ts +1 -1
- package/dist/commands/promotions/update.js +3 -3
- package/dist/commands/promotions/update.js.map +1 -1
- package/dist/commands/reviews/bulk-import.d.ts +1 -1
- package/dist/commands/reviews/bulk-import.js +3 -3
- package/dist/commands/reviews/bulk-import.js.map +1 -1
- package/dist/commands/reviews/bulk-moderate.d.ts +1 -1
- package/dist/commands/reviews/bulk-moderate.js +3 -3
- package/dist/commands/reviews/bulk-moderate.js.map +1 -1
- package/dist/commands/reviews/create.d.ts +1 -1
- package/dist/commands/reviews/create.js +3 -3
- package/dist/commands/reviews/create.js.map +1 -1
- package/dist/commands/reviews/delete-reply.d.ts +1 -1
- package/dist/commands/reviews/delete-reply.js +3 -3
- package/dist/commands/reviews/delete-reply.js.map +1 -1
- package/dist/commands/reviews/delete.d.ts +1 -1
- package/dist/commands/reviews/delete.js +3 -3
- package/dist/commands/reviews/delete.js.map +1 -1
- package/dist/commands/reviews/get.d.ts +1 -1
- package/dist/commands/reviews/get.js +2 -2
- package/dist/commands/reviews/get.js.map +1 -1
- package/dist/commands/reviews/list.d.ts +1 -1
- package/dist/commands/reviews/list.js +2 -2
- package/dist/commands/reviews/list.js.map +1 -1
- package/dist/commands/reviews/reply.d.ts +1 -1
- package/dist/commands/reviews/reply.js +3 -3
- package/dist/commands/reviews/reply.js.map +1 -1
- package/dist/commands/reviews/stats.d.ts +1 -1
- package/dist/commands/reviews/stats.js +2 -2
- package/dist/commands/reviews/stats.js.map +1 -1
- package/dist/commands/reviews/update-reply.d.ts +1 -1
- package/dist/commands/reviews/update-reply.js +3 -3
- package/dist/commands/reviews/update-reply.js.map +1 -1
- package/dist/commands/reviews/update.d.ts +1 -1
- package/dist/commands/reviews/update.js +3 -3
- package/dist/commands/reviews/update.js.map +1 -1
- package/dist/commands/setup.d.ts +1 -1
- package/dist/commands/setup.js +4 -4
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/shipping/locations.d.ts +20 -0
- package/dist/commands/shipping/locations.js +42 -0
- package/dist/commands/shipping/locations.js.map +1 -0
- package/dist/commands/shipping-rates/create.d.ts +32 -0
- package/dist/commands/shipping-rates/create.js +89 -0
- package/dist/commands/shipping-rates/create.js.map +1 -0
- package/dist/commands/shipping-rates/delete.d.ts +25 -0
- package/dist/commands/shipping-rates/delete.js +32 -0
- package/dist/commands/shipping-rates/delete.js.map +1 -0
- package/dist/commands/{shipping-programs → shipping-rates}/get.d.ts +3 -2
- package/dist/commands/shipping-rates/get.js +36 -0
- package/dist/commands/shipping-rates/get.js.map +1 -0
- package/dist/commands/shipping-rates/list.d.ts +21 -0
- package/dist/commands/shipping-rates/list.js +47 -0
- package/dist/commands/shipping-rates/list.js.map +1 -0
- package/dist/commands/{shipping-programs/create-rule.d.ts → shipping-rates/update.d.ts} +14 -16
- package/dist/commands/shipping-rates/update.js +94 -0
- package/dist/commands/shipping-rates/update.js.map +1 -0
- package/dist/commands/shipping-zones/create.d.ts +1 -1
- package/dist/commands/shipping-zones/create.js +4 -4
- package/dist/commands/shipping-zones/create.js.map +1 -1
- package/dist/commands/shipping-zones/delete.d.ts +1 -1
- package/dist/commands/shipping-zones/delete.js +4 -4
- package/dist/commands/shipping-zones/delete.js.map +1 -1
- package/dist/commands/shipping-zones/get.d.ts +1 -1
- package/dist/commands/shipping-zones/get.js +3 -3
- package/dist/commands/shipping-zones/get.js.map +1 -1
- package/dist/commands/shipping-zones/list.d.ts +2 -2
- package/dist/commands/shipping-zones/list.js +6 -6
- package/dist/commands/shipping-zones/list.js.map +1 -1
- package/dist/commands/shipping-zones/update.d.ts +1 -1
- package/dist/commands/shipping-zones/update.js +4 -4
- package/dist/commands/shipping-zones/update.js.map +1 -1
- package/dist/commands/skills/install.d.ts +20 -0
- package/dist/commands/skills/install.js +26 -0
- package/dist/commands/skills/install.js.map +1 -0
- package/dist/commands/store-menus/create.d.ts +1 -1
- package/dist/commands/store-menus/create.js +3 -4
- package/dist/commands/store-menus/create.js.map +1 -1
- package/dist/commands/store-menus/delete.d.ts +1 -1
- package/dist/commands/store-menus/delete.js +3 -3
- package/dist/commands/store-menus/delete.js.map +1 -1
- package/dist/commands/store-menus/get-by-ref.d.ts +1 -1
- package/dist/commands/store-menus/get-by-ref.js +2 -2
- package/dist/commands/store-menus/get-by-ref.js.map +1 -1
- package/dist/commands/store-menus/get.d.ts +1 -1
- package/dist/commands/store-menus/get.js +2 -2
- package/dist/commands/store-menus/get.js.map +1 -1
- package/dist/commands/store-menus/list.d.ts +1 -1
- package/dist/commands/store-menus/list.js +2 -2
- package/dist/commands/store-menus/list.js.map +1 -1
- package/dist/commands/store-menus/update.d.ts +1 -1
- package/dist/commands/store-menus/update.js +3 -3
- package/dist/commands/store-menus/update.js.map +1 -1
- package/dist/commands/store-pages/all.d.ts +1 -1
- package/dist/commands/store-pages/all.js +2 -2
- package/dist/commands/store-pages/all.js.map +1 -1
- package/dist/commands/store-pages/create.d.ts +1 -1
- package/dist/commands/store-pages/create.js +3 -4
- package/dist/commands/store-pages/create.js.map +1 -1
- package/dist/commands/store-pages/delete.d.ts +1 -1
- package/dist/commands/store-pages/delete.js +3 -3
- package/dist/commands/store-pages/delete.js.map +1 -1
- package/dist/commands/store-pages/duplicate.d.ts +1 -1
- package/dist/commands/store-pages/duplicate.js +3 -3
- package/dist/commands/store-pages/duplicate.js.map +1 -1
- package/dist/commands/store-pages/get.d.ts +1 -1
- package/dist/commands/store-pages/get.js +2 -2
- package/dist/commands/store-pages/get.js.map +1 -1
- package/dist/commands/store-pages/list.d.ts +1 -1
- package/dist/commands/store-pages/list.js +2 -2
- package/dist/commands/store-pages/list.js.map +1 -1
- package/dist/commands/store-pages/stats.d.ts +1 -1
- package/dist/commands/store-pages/stats.js +2 -2
- package/dist/commands/store-pages/stats.js.map +1 -1
- package/dist/commands/store-pages/update.d.ts +1 -1
- package/dist/commands/store-pages/update.js +3 -3
- package/dist/commands/store-pages/update.js.map +1 -1
- package/dist/commands/store-settings/auth/get.d.ts +18 -0
- package/dist/commands/store-settings/auth/get.js +23 -0
- package/dist/commands/store-settings/auth/get.js.map +1 -0
- package/dist/commands/{shipping-programs/calculate.d.ts → store-settings/auth/update.d.ts} +12 -9
- package/dist/commands/store-settings/auth/update.js +78 -0
- package/dist/commands/store-settings/auth/update.js.map +1 -0
- package/dist/commands/store-settings/get.d.ts +1 -1
- package/dist/commands/store-settings/get.js +2 -2
- package/dist/commands/store-settings/get.js.map +1 -1
- package/dist/commands/store-settings/update.d.ts +1 -1
- package/dist/commands/store-settings/update.js +3 -3
- package/dist/commands/store-settings/update.js.map +1 -1
- package/dist/commands/storefront/init.d.ts +43 -0
- package/dist/commands/storefront/init.js +137 -0
- package/dist/commands/storefront/init.js.map +1 -0
- package/dist/commands/storefront/key.d.ts +20 -0
- package/dist/commands/storefront/key.js +42 -0
- package/dist/commands/storefront/key.js.map +1 -0
- package/dist/commands/storefront/skill.d.ts +20 -0
- package/dist/commands/storefront/skill.js +54 -0
- package/dist/commands/storefront/skill.js.map +1 -0
- package/dist/commands/stores/current.d.ts +1 -1
- package/dist/commands/stores/current.js +24 -7
- package/dist/commands/stores/current.js.map +1 -1
- package/dist/commands/stores/info.d.ts +2 -5
- package/dist/commands/stores/info.js +4 -4
- package/dist/commands/stores/info.js.map +1 -1
- package/dist/commands/stores/list.d.ts +1 -1
- package/dist/commands/stores/switch.d.ts +2 -5
- package/dist/commands/stores/switch.js +8 -8
- package/dist/commands/stores/switch.js.map +1 -1
- package/dist/commands/{shipping-methods/create.d.ts → stores/update.d.ts} +2 -4
- package/dist/commands/stores/update.js +60 -0
- package/dist/commands/stores/update.js.map +1 -0
- package/dist/lib/api-client.d.ts +5 -3
- package/dist/lib/api-client.js +20 -6
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/attribute-errors.d.ts +12 -0
- package/dist/lib/attribute-errors.js +20 -0
- package/dist/lib/attribute-errors.js.map +1 -0
- package/dist/lib/categories-removed.d.ts +9 -0
- package/dist/lib/categories-removed.js +22 -0
- package/dist/lib/categories-removed.js.map +1 -0
- package/dist/lib/codex-skill.d.ts +9 -0
- package/dist/lib/codex-skill.js +70 -0
- package/dist/lib/codex-skill.js.map +1 -0
- package/dist/lib/config.d.ts +6 -4
- package/dist/lib/config.js +8 -8
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/deployments.d.ts +59 -0
- package/dist/lib/deployments.js +212 -0
- package/dist/lib/deployments.js.map +1 -0
- package/dist/lib/email-login.d.ts +35 -0
- package/dist/lib/email-login.js +86 -0
- package/dist/lib/email-login.js.map +1 -0
- package/dist/lib/env-vars.d.ts +16 -0
- package/dist/lib/env-vars.js +33 -0
- package/dist/lib/env-vars.js.map +1 -0
- package/dist/lib/errors.d.ts +3 -1
- package/dist/lib/errors.js +2 -0
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/github-flow.d.ts +7 -0
- package/dist/lib/github-flow.js +34 -0
- package/dist/lib/github-flow.js.map +1 -0
- package/dist/lib/multipart.d.ts +2 -0
- package/dist/lib/multipart.js +15 -0
- package/dist/lib/multipart.js.map +1 -0
- package/dist/lib/output.d.ts +6 -6
- package/dist/lib/output.js +10 -10
- package/dist/lib/output.js.map +1 -1
- package/dist/lib/pack-prebuilt.d.ts +12 -0
- package/dist/lib/pack-prebuilt.js +138 -0
- package/dist/lib/pack-prebuilt.js.map +1 -0
- package/dist/lib/pack-source.d.ts +10 -0
- package/dist/lib/pack-source.js +119 -0
- package/dist/lib/pack-source.js.map +1 -0
- package/dist/lib/project-setup.d.ts +15 -0
- package/dist/lib/project-setup.js +65 -0
- package/dist/lib/project-setup.js.map +1 -0
- package/dist/lib/publishable-key.d.ts +18 -0
- package/dist/lib/publishable-key.js +10 -0
- package/dist/lib/publishable-key.js.map +1 -0
- package/dist/lib/skill-update.d.ts +11 -0
- package/dist/lib/skill-update.js +74 -0
- package/dist/lib/skill-update.js.map +1 -0
- package/dist/lib/sse.d.ts +5 -0
- package/dist/lib/sse.js +36 -0
- package/dist/lib/sse.js.map +1 -0
- package/dist/lib/stdin.d.ts +6 -2
- package/dist/lib/stdin.js +9 -9
- package/dist/lib/stdin.js.map +1 -1
- package/dist/lib/template-download.d.ts +9 -0
- package/dist/lib/template-download.js +15 -0
- package/dist/lib/template-download.js.map +1 -0
- package/dist/lib/template-scaffold.d.ts +18 -0
- package/dist/lib/template-scaffold.js +91 -0
- package/dist/lib/template-scaffold.js.map +1 -0
- package/dist/lib/validators.d.ts +11 -0
- package/dist/lib/validators.js +152 -108
- package/dist/lib/validators.js.map +1 -1
- package/oclif.manifest.json +8960 -6766
- package/package.json +23 -12
- package/dist/commands/analytics/summary.js.map +0 -1
- package/dist/commands/analytics/time-series.js.map +0 -1
- package/dist/commands/blog-posts/generate.js +0 -42
- package/dist/commands/blog-posts/generate.js.map +0 -1
- package/dist/commands/blog-posts/search.d.ts +0 -27
- package/dist/commands/blog-posts/search.js +0 -55
- package/dist/commands/blog-posts/search.js.map +0 -1
- package/dist/commands/shipping-methods/create.js +0 -63
- package/dist/commands/shipping-methods/create.js.map +0 -1
- package/dist/commands/shipping-methods/delete.js +0 -30
- package/dist/commands/shipping-methods/delete.js.map +0 -1
- package/dist/commands/shipping-methods/get.js +0 -31
- package/dist/commands/shipping-methods/get.js.map +0 -1
- package/dist/commands/shipping-methods/list.js.map +0 -1
- package/dist/commands/shipping-methods/update.js +0 -69
- package/dist/commands/shipping-methods/update.js.map +0 -1
- package/dist/commands/shipping-programs/calculate.js +0 -72
- package/dist/commands/shipping-programs/calculate.js.map +0 -1
- package/dist/commands/shipping-programs/create-rule.js +0 -110
- package/dist/commands/shipping-programs/create-rule.js.map +0 -1
- package/dist/commands/shipping-programs/create.js +0 -75
- package/dist/commands/shipping-programs/create.js.map +0 -1
- package/dist/commands/shipping-programs/delete-rule.js +0 -42
- package/dist/commands/shipping-programs/delete-rule.js.map +0 -1
- package/dist/commands/shipping-programs/delete.js +0 -30
- package/dist/commands/shipping-programs/delete.js.map +0 -1
- package/dist/commands/shipping-programs/get-rule.js +0 -38
- package/dist/commands/shipping-programs/get-rule.js.map +0 -1
- package/dist/commands/shipping-programs/get.js +0 -32
- package/dist/commands/shipping-programs/get.js.map +0 -1
- package/dist/commands/shipping-programs/list-rules.d.ts +0 -34
- package/dist/commands/shipping-programs/list-rules.js +0 -86
- package/dist/commands/shipping-programs/list-rules.js.map +0 -1
- package/dist/commands/shipping-programs/list.d.ts +0 -30
- package/dist/commands/shipping-programs/list.js +0 -74
- package/dist/commands/shipping-programs/list.js.map +0 -1
- package/dist/commands/shipping-programs/update-rule.d.ts +0 -44
- package/dist/commands/shipping-programs/update-rule.js +0 -120
- package/dist/commands/shipping-programs/update-rule.js.map +0 -1
- package/dist/commands/shipping-programs/update.js +0 -81
- package/dist/commands/shipping-programs/update.js.map +0 -1
- package/dist/commands/shipping-zones/location-data.js +0 -25
- package/dist/commands/shipping-zones/location-data.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const core_1 = require("@oclif/core");
|
|
9
|
+
const base_command_1 = require("../../base-command");
|
|
10
|
+
const skill_update_1 = require("../../lib/skill-update");
|
|
11
|
+
const template_download_1 = require("../../lib/template-download");
|
|
12
|
+
class StorefrontSkill extends base_command_1.BaseCommand {
|
|
13
|
+
async run() {
|
|
14
|
+
const dir = node_path_1.default.resolve(this.getFlag("dir"));
|
|
15
|
+
if (!this.getFlag("update")) {
|
|
16
|
+
const manifest = node_path_1.default.join(dir, ".ecomweb.json");
|
|
17
|
+
const skill = node_path_1.default.join(dir, skill_update_1.SKILL_DIR);
|
|
18
|
+
const count = (d) => (0, node_fs_1.readdirSync)(d, { withFileTypes: true }).reduce((n, e) => n + (e.isDirectory() ? count(node_path_1.default.join(d, e.name)) : 1), 0);
|
|
19
|
+
this.outputJson({
|
|
20
|
+
dir,
|
|
21
|
+
skill: (0, node_fs_1.existsSync)(skill) ? { path: skill_update_1.SKILL_DIR, files: count(skill) } : null,
|
|
22
|
+
template_version: (0, node_fs_1.existsSync)(manifest) ? JSON.parse((0, node_fs_1.readFileSync)(manifest, "utf8")).templateVersion ?? null : null,
|
|
23
|
+
});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
(0, skill_update_1.assertStorefront)(dir);
|
|
27
|
+
this.requireStore(dir);
|
|
28
|
+
const template = await (0, template_download_1.downloadTemplate)(this.apiClient);
|
|
29
|
+
const result = await (0, skill_update_1.updateSkill)(dir, template.zip, { dryRun: this.isDryRun });
|
|
30
|
+
if (!this.getFlag("quiet")) {
|
|
31
|
+
const lines = [
|
|
32
|
+
...result.added.map((f) => ` + ${f}`),
|
|
33
|
+
...result.changed.map((f) => ` ~ ${f}`),
|
|
34
|
+
...result.removed.map((f) => ` - ${f}`),
|
|
35
|
+
];
|
|
36
|
+
this.logToStderr(lines.length
|
|
37
|
+
? `${this.isDryRun ? "Would update" : "Updated"} ${skill_update_1.SKILL_DIR} (template ${template.version}):\n${lines.join("\n")}`
|
|
38
|
+
: `${skill_update_1.SKILL_DIR} is already up to date (template ${template.version}).`);
|
|
39
|
+
}
|
|
40
|
+
this.outputJson({ dir, template_version: template.version, dry_run: this.isDryRun, ...result });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
StorefrontSkill.description = "Show or update the ecomweb-storefront skill that teaches Claude Code and Codex this storefront";
|
|
44
|
+
StorefrontSkill.examples = ["ecomweb storefront skill", "ecomweb storefront skill --update", "ecomweb storefront skill --update --dry-run"];
|
|
45
|
+
StorefrontSkill.flags = {
|
|
46
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
47
|
+
update: core_1.Flags.boolean({
|
|
48
|
+
description: "Replace the project's skill with the one in the store's current template (nothing else is touched)",
|
|
49
|
+
default: false,
|
|
50
|
+
}),
|
|
51
|
+
dir: core_1.Flags.string({ description: "The storefront project", default: "." }),
|
|
52
|
+
};
|
|
53
|
+
exports.default = StorefrontSkill;
|
|
54
|
+
//# sourceMappingURL=skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../../src/commands/storefront/skill.ts"],"names":[],"mappings":";;;;;AAAA,qCAAgE;AAChE,0DAA6B;AAC7B,sCAAoC;AACpC,qDAAiD;AACjD,yDAAkF;AAClF,mEAA+D;AAE/D,MAAqB,eAAgB,SAAQ,0BAAW;IAetD,KAAK,CAAC,GAAG;QACP,MAAM,GAAG,GAAG,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAS,KAAK,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAU,QAAQ,CAAC,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;YACjD,MAAM,KAAK,GAAG,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,wBAAS,CAAC,CAAC;YACxC,MAAM,KAAK,GAAG,CAAC,CAAS,EAAU,EAAE,CAClC,IAAA,qBAAW,EAAC,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAA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AC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;gBACxC,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;aACzC,CAAC;YACF,IAAI,CAAC,WAAW,CACd,KAAK,CAAC,MAAM;gBACV,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,IAAI,wBAAS,cAAc,QAAQ,CAAC,OAAO,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBACnH,CAAC,CAAC,GAAG,wBAAS,oCAAoC,QAAQ,CAAC,OAAO,IAAI,CACzE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,gBAAgB,EAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IAClG,CAAC;;AA/CM,2BAAW,GAChB,gGAAgG,CAAC;AAE5F,wBAAQ,GAAG,CAAC,0BAA0B,EAAE,mCAAmC,EAAE,6CAA6C,CAAC,CAAC;AAE5H,qBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC;QACpB,WAAW,EAAE,oGAAoG;QACjH,OAAO,EAAE,KAAK;KACf,CAAC;IACF,GAAG,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;CAC3E,CAAC;kBAbiB,eAAe"}
|
|
@@ -3,7 +3,7 @@ export default class StoresCurrent extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
"store-
|
|
6
|
+
"store-ref": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
"api-key": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
8
|
"api-url": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
9
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -4,23 +4,40 @@ const base_command_1 = require("../../base-command");
|
|
|
4
4
|
class StoresCurrent extends base_command_1.BaseCommand {
|
|
5
5
|
async run() {
|
|
6
6
|
const profile = this.configManager.getProfile();
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
7
|
+
const storeRef = this.configManager.resolveStoreRef(this.getFlag("store-ref"));
|
|
8
|
+
if (!storeRef) {
|
|
9
9
|
this.outputJson({
|
|
10
|
-
|
|
10
|
+
store_ref: null,
|
|
11
11
|
message: "No store selected.",
|
|
12
|
-
hint: "Run: ecomweb stores switch <
|
|
12
|
+
hint: "Run: ecomweb stores switch <ref>",
|
|
13
13
|
});
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
+
const isProfileStore = storeRef === profile.store_ref;
|
|
17
|
+
let storeName = isProfileStore ? profile.store_name : undefined;
|
|
18
|
+
let source = "profile";
|
|
19
|
+
try {
|
|
20
|
+
const store = await this.apiClient.getStore(storeRef);
|
|
21
|
+
const liveName = store?.name || store?.store_name;
|
|
22
|
+
if (liveName) {
|
|
23
|
+
storeName = liveName;
|
|
24
|
+
source = "api";
|
|
25
|
+
if (isProfileStore && liveName !== profile.store_name) {
|
|
26
|
+
this.configManager.setStoreRef(storeRef, liveName);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
}
|
|
16
32
|
this.outputJson({
|
|
17
|
-
|
|
18
|
-
store_name:
|
|
33
|
+
store_ref: storeRef,
|
|
34
|
+
store_name: storeName || null,
|
|
35
|
+
store_name_source: storeName ? source : null,
|
|
19
36
|
profile: this.configManager.getActiveProfileName(),
|
|
20
37
|
});
|
|
21
38
|
}
|
|
22
39
|
}
|
|
23
|
-
StoresCurrent.description = "Show the currently active store";
|
|
40
|
+
StoresCurrent.description = "Show the currently active store (its live name, or the cached one offline)";
|
|
24
41
|
StoresCurrent.examples = ["ecomweb stores current"];
|
|
25
42
|
StoresCurrent.flags = {
|
|
26
43
|
...base_command_1.BaseCommand.baseFlags,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current.js","sourceRoot":"","sources":["../../../src/commands/stores/current.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAqB,aAAc,SAAQ,0BAAW;IASpD,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;QAChD,MAAM,
|
|
1
|
+
{"version":3,"file":"current.js","sourceRoot":"","sources":["../../../src/commands/stores/current.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAqB,aAAc,SAAQ,0BAAW;IASpD,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;QAE/E,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,IAAI,CAAC,UAAU,CAAC;gBACd,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,oBAAoB;gBAC7B,IAAI,EAAE,kCAAkC;aACzC,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAID,MAAM,cAAc,GAAG,QAAQ,KAAK,OAAO,CAAC,SAAS,CAAC;QACtD,IAAI,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;QAChE,IAAI,MAAM,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACtD,MAAM,QAAQ,GAAG,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,UAAU,CAAC;YAClD,IAAI,QAAQ,EAAE,CAAC;gBACb,SAAS,GAAG,QAAQ,CAAC;gBACrB,MAAM,GAAG,KAAK,CAAC;gBACf,IAAI,cAAc,IAAI,QAAQ,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC;oBACtD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;QAED,IAAI,CAAC,UAAU,CAAC;YACd,SAAS,EAAE,QAAQ;YACnB,UAAU,EAAE,SAAS,IAAI,IAAI;YAC7B,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;YAC5C,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE;SACnD,CAAC,CAAC;IACL,CAAC;;AA9CM,yBAAW,GAAG,4EAA4E,CAAC;AAE3F,sBAAQ,GAAG,CAAC,wBAAwB,CAAC,CAAC;AAEtC,mBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;CACzB,CAAC;kBAPiB,aAAa"}
|
|
@@ -3,13 +3,10 @@ export default class StoresInfo extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
|
-
|
|
7
|
-
max?: number;
|
|
8
|
-
min?: number;
|
|
9
|
-
}>;
|
|
6
|
+
ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
7
|
};
|
|
11
8
|
static flags: {
|
|
12
|
-
"store-
|
|
9
|
+
"store-ref": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
10
|
"api-key": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
11
|
"api-url": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
12
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -5,22 +5,22 @@ const base_command_1 = require("../../base-command");
|
|
|
5
5
|
class StoresInfo extends base_command_1.BaseCommand {
|
|
6
6
|
async run() {
|
|
7
7
|
const { args } = await this.parse(StoresInfo);
|
|
8
|
-
const store = await this.apiClient.getStore(args.
|
|
8
|
+
const store = await this.apiClient.getStore(args.ref);
|
|
9
9
|
this.outputResult({
|
|
10
10
|
resource: "stores",
|
|
11
11
|
action: "info",
|
|
12
12
|
data: store,
|
|
13
13
|
available_actions: ["switch"],
|
|
14
14
|
hints: {
|
|
15
|
-
switch: `ecomweb stores switch ${args.
|
|
15
|
+
switch: `ecomweb stores switch ${args.ref}`,
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
StoresInfo.description = "Show details for a specific store";
|
|
21
|
-
StoresInfo.examples = ["ecomweb stores info
|
|
21
|
+
StoresInfo.examples = ["ecomweb stores info abc123def456"];
|
|
22
22
|
StoresInfo.args = {
|
|
23
|
-
|
|
23
|
+
ref: core_1.Args.string({ description: "Store ref", required: true }),
|
|
24
24
|
};
|
|
25
25
|
StoresInfo.flags = {
|
|
26
26
|
...base_command_1.BaseCommand.baseFlags,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../src/commands/stores/info.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AACnC,qDAAiD;AAEjD,MAAqB,UAAW,SAAQ,0BAAW;IAajD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../src/commands/stores/info.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AACnC,qDAAiD;AAEjD,MAAqB,UAAW,SAAQ,0BAAW;IAajD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEtD,IAAI,CAAC,YAAY,CAAC;YAChB,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;YACX,iBAAiB,EAAE,CAAC,QAAQ,CAAC;YAC7B,KAAK,EAAE;gBACL,MAAM,EAAE,yBAAyB,IAAI,CAAC,GAAG,EAAE;aAC5C;SACF,CAAC,CAAC;IACL,CAAC;;AAzBM,sBAAW,GAAG,mCAAmC,CAAC;AAElD,mBAAQ,GAAG,CAAC,kCAAkC,CAAC,CAAC;AAEhD,eAAI,GAAG;IACZ,GAAG,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CAC/D,CAAC;AAEK,gBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;CACzB,CAAC;kBAXiB,UAAU"}
|
|
@@ -3,7 +3,7 @@ export default class StoresList extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
"store-
|
|
6
|
+
"store-ref": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
"api-key": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
8
|
"api-url": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
9
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -3,13 +3,10 @@ export default class StoresSwitch extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static args: {
|
|
6
|
-
|
|
7
|
-
max?: number;
|
|
8
|
-
min?: number;
|
|
9
|
-
}>;
|
|
6
|
+
ref: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
7
|
};
|
|
11
8
|
static flags: {
|
|
12
|
-
"store-
|
|
9
|
+
"store-ref": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
10
|
"api-key": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
11
|
"api-url": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
12
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -5,30 +5,30 @@ const base_command_1 = require("../../base-command");
|
|
|
5
5
|
class StoresSwitch extends base_command_1.BaseCommand {
|
|
6
6
|
async run() {
|
|
7
7
|
const { args } = await this.parse(StoresSwitch);
|
|
8
|
-
const
|
|
8
|
+
const storeRef = args.ref;
|
|
9
9
|
let storeName;
|
|
10
10
|
try {
|
|
11
|
-
const store = await this.apiClient.getStore(
|
|
11
|
+
const store = await this.apiClient.getStore(storeRef);
|
|
12
12
|
storeName = store.name || store.store_name;
|
|
13
13
|
}
|
|
14
14
|
catch {
|
|
15
15
|
}
|
|
16
|
-
this.configManager.
|
|
16
|
+
this.configManager.setStoreRef(storeRef, storeName);
|
|
17
17
|
this.outputJson({
|
|
18
|
-
|
|
18
|
+
store_ref: storeRef,
|
|
19
19
|
store_name: storeName || null,
|
|
20
|
-
message: `Switched to store ${
|
|
20
|
+
message: `Switched to store ${storeRef}`,
|
|
21
21
|
profile: this.configManager.getActiveProfileName(),
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
StoresSwitch.description = "Switch the active store (persists to profile)";
|
|
26
26
|
StoresSwitch.examples = [
|
|
27
|
-
"ecomweb stores switch
|
|
28
|
-
"ecomweb stores switch
|
|
27
|
+
"ecomweb stores switch abc123def456",
|
|
28
|
+
"ecomweb stores switch abc123def456 --profile production",
|
|
29
29
|
];
|
|
30
30
|
StoresSwitch.args = {
|
|
31
|
-
|
|
31
|
+
ref: core_1.Args.string({ description: "Store ref to switch to", required: true }),
|
|
32
32
|
};
|
|
33
33
|
StoresSwitch.flags = {
|
|
34
34
|
...base_command_1.BaseCommand.baseFlags,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/commands/stores/switch.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AACnC,qDAAiD;AAEjD,MAAqB,YAAa,SAAQ,0BAAW;IAgBnD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAChD,MAAM,
|
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/commands/stores/switch.ts"],"names":[],"mappings":";;AAAA,sCAAmC;AACnC,qDAAiD;AAEjD,MAAqB,YAAa,SAAQ,0BAAW;IAgBnD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC;QAE1B,IAAI,SAA6B,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACtD,SAAS,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,UAAU,CAAC;QAC7C,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAEpD,IAAI,CAAC,UAAU,CAAC;YACd,SAAS,EAAE,QAAQ;YACnB,UAAU,EAAE,SAAS,IAAI,IAAI;YAC7B,OAAO,EAAE,qBAAqB,QAAQ,EAAE;YACxC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE;SACnD,CAAC,CAAC;IACL,CAAC;;AAnCM,wBAAW,GAAG,+CAA+C,CAAC;AAE9D,qBAAQ,GAAG;IAChB,oCAAoC;IACpC,yDAAyD;CAC1D,CAAC;AAEK,iBAAI,GAAG;IACZ,GAAG,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CAC5E,CAAC;AAEK,kBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;CACzB,CAAC;kBAdiB,YAAY"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { BaseCommand } from "../../base-command";
|
|
2
|
-
export default class
|
|
2
|
+
export default class StoresUpdate extends BaseCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
stdin: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
-
code: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
8
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
9
|
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
"
|
|
12
|
-
"store-id": import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
"store-ref": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
11
|
"api-key": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
12
|
"api-url": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
13
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const output_1 = require("../../lib/output");
|
|
6
|
+
const stdin_1 = require("../../lib/stdin");
|
|
7
|
+
class StoresUpdate extends base_command_1.BaseCommand {
|
|
8
|
+
async run() {
|
|
9
|
+
const storeRef = this.requireStore();
|
|
10
|
+
let body = await (0, stdin_1.getJsonInput)({
|
|
11
|
+
stdin: this.getFlag("stdin"),
|
|
12
|
+
file: this.getFlag("file"),
|
|
13
|
+
});
|
|
14
|
+
if (!body) {
|
|
15
|
+
body = {};
|
|
16
|
+
if (this.getFlag("name"))
|
|
17
|
+
body.name = this.getFlag("name");
|
|
18
|
+
if (this.getFlag("description") !== undefined)
|
|
19
|
+
body.description = this.getFlag("description");
|
|
20
|
+
if (Object.keys(body).length === 0) {
|
|
21
|
+
this.outputJson({
|
|
22
|
+
error: {
|
|
23
|
+
code: "NO_INPUT",
|
|
24
|
+
message: "No input provided.",
|
|
25
|
+
hint: "Use --name, --description, --stdin or --file. Logos, links and the rest: ecomweb store-settings update",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
this.exit(2);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (this.isDryRun) {
|
|
33
|
+
this.outputResult((0, output_1.mutationEnvelope)("stores", "update (dry-run)", storeRef, body));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const result = await this.apiClient.put(`/stores/${storeRef}`, body);
|
|
37
|
+
const profile = this.configManager.getProfile();
|
|
38
|
+
if (result?.name && storeRef === profile.store_ref && result.name !== profile.store_name) {
|
|
39
|
+
this.configManager.setStoreRef(storeRef, result.name);
|
|
40
|
+
}
|
|
41
|
+
this.outputResult((0, output_1.mutationEnvelope)("stores", "update", storeRef, result, {
|
|
42
|
+
current: "ecomweb stores current",
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
StoresUpdate.description = "Update the current store's name or description";
|
|
47
|
+
StoresUpdate.examples = [
|
|
48
|
+
`ecomweb stores update --name "Mai Phú Hưng"`,
|
|
49
|
+
`ecomweb stores update --stdin <<< '{"name":"Mai Phú Hưng","description":"Đồ gia dụng"}'`,
|
|
50
|
+
"ecomweb stores update --file store.json",
|
|
51
|
+
];
|
|
52
|
+
StoresUpdate.flags = {
|
|
53
|
+
...base_command_1.BaseCommand.baseFlags,
|
|
54
|
+
stdin: core_1.Flags.boolean({ description: "Read JSON body from stdin" }),
|
|
55
|
+
file: core_1.Flags.string({ description: "Read JSON body from file" }),
|
|
56
|
+
name: core_1.Flags.string({ description: "Store name (2-100 characters)" }),
|
|
57
|
+
description: core_1.Flags.string({ description: "Store description" }),
|
|
58
|
+
};
|
|
59
|
+
exports.default = StoresUpdate;
|
|
60
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/stores/update.ts"],"names":[],"mappings":";;AAAA,sCAAoC;AACpC,qDAAiD;AACjD,6CAAoD;AACpD,2CAA+C;AAE/C,MAAqB,YAAa,SAAQ,0BAAW;IAiBnD,KAAK,CAAC,GAAG;QACP,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAErC,IAAI,IAAI,GAAG,MAAM,IAAA,oBAAY,EAAC;YAC5B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YAC5B,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;SAC3B,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,GAAG,EAAyB,CAAC;YACjC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;gBAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAC3D,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,SAAS;gBAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YAE9F,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnC,IAAI,CAAC,UAAU,CAAC;oBACd,KAAK,EAAE;wBACL,IAAI,EAAE,UAAU;wBAChB,OAAO,EAAE,oBAAoB;wBAC7B,IAAI,EAAE,wGAAwG;qBAC/G;iBACF,CAAC,CAAC;gBACH,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACb,OAAO;YACT,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,YAAY,CAAC,IAAA,yBAAgB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ginatedResponse<T> {
|
|
|
20
20
|
}
|
|
21
21
|
export declare class ApiClient {
|
|
22
22
|
private client;
|
|
23
|
-
private
|
|
23
|
+
private storeRef?;
|
|
24
24
|
constructor(options: ApiClientOptions);
|
|
25
25
|
setJwtToken(token: string): void;
|
|
26
26
|
clearAuth(): void;
|
|
27
|
-
|
|
27
|
+
setStoreRef(storeRef: string): void;
|
|
28
28
|
private storePath;
|
|
29
29
|
get<T = any>(path: string, params?: Record<string, any>): Promise<T>;
|
|
30
30
|
post<T = any>(path: string, body?: any, config?: AxiosRequestConfig): Promise<T>;
|
|
@@ -36,11 +36,13 @@ export declare class ApiClient {
|
|
|
36
36
|
storePut<T = any>(path: string, body?: any): Promise<T>;
|
|
37
37
|
storePatch<T = any>(path: string, body?: any): Promise<T>;
|
|
38
38
|
storeDelete<T = any>(path: string, body?: any): Promise<T>;
|
|
39
|
+
storeDownload(path: string): Promise<Buffer>;
|
|
40
|
+
storeEventStream(path: string): Promise<AsyncIterable<Buffer>>;
|
|
39
41
|
storeUpload<T = any>(path: string, formData: FormData): Promise<T>;
|
|
40
42
|
listPaginated<T = any>(path: string, params?: Record<string, any>): Promise<PaginatedResponse<T>>;
|
|
41
43
|
listAll<T = any>(path: string, params?: Record<string, any>): Promise<T[]>;
|
|
42
44
|
private paginateAll;
|
|
43
45
|
health(): Promise<any>;
|
|
44
46
|
listStores(): Promise<any[]>;
|
|
45
|
-
getStore(
|
|
47
|
+
getStore(ref: string): Promise<any>;
|
|
46
48
|
}
|
package/dist/lib/api-client.js
CHANGED
|
@@ -35,13 +35,13 @@ class ApiClient {
|
|
|
35
35
|
delete this.client.defaults.headers.common["Authorization"];
|
|
36
36
|
delete this.client.defaults.headers.common["x-api-key"];
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
this.
|
|
38
|
+
setStoreRef(storeRef) {
|
|
39
|
+
this.storeRef = storeRef;
|
|
40
40
|
}
|
|
41
41
|
storePath(path) {
|
|
42
|
-
if (!this.
|
|
42
|
+
if (!this.storeRef)
|
|
43
43
|
throw new Error("No store selected");
|
|
44
|
-
return `/stores/${this.
|
|
44
|
+
return `/stores/${this.storeRef}${path}`;
|
|
45
45
|
}
|
|
46
46
|
async get(path, params) {
|
|
47
47
|
const { data } = await this.client.get(path, { params });
|
|
@@ -78,6 +78,20 @@ class ApiClient {
|
|
|
78
78
|
async storeDelete(path, body) {
|
|
79
79
|
return this.delete(this.storePath(path), body);
|
|
80
80
|
}
|
|
81
|
+
async storeDownload(path) {
|
|
82
|
+
const { data } = await this.client.get(this.storePath(path), {
|
|
83
|
+
responseType: "arraybuffer",
|
|
84
|
+
});
|
|
85
|
+
return Buffer.from(data);
|
|
86
|
+
}
|
|
87
|
+
async storeEventStream(path) {
|
|
88
|
+
const { data } = await this.client.get(this.storePath(path), {
|
|
89
|
+
responseType: "stream",
|
|
90
|
+
headers: { Accept: "text/event-stream" },
|
|
91
|
+
timeout: 0,
|
|
92
|
+
});
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
81
95
|
async storeUpload(path, formData) {
|
|
82
96
|
return this.post(this.storePath(path), formData, {
|
|
83
97
|
headers: formData.getHeaders(),
|
|
@@ -118,8 +132,8 @@ class ApiClient {
|
|
|
118
132
|
const result = await this.get("/stores");
|
|
119
133
|
return Array.isArray(result) ? result : result.data || [];
|
|
120
134
|
}
|
|
121
|
-
async getStore(
|
|
122
|
-
return this.get(`/stores/${
|
|
135
|
+
async getStore(ref) {
|
|
136
|
+
return this.get(`/stores/${ref}`);
|
|
123
137
|
}
|
|
124
138
|
}
|
|
125
139
|
exports.ApiClient = ApiClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAiE;AAuBjE,MAAa,SAAS;IAIpB,YAAY,OAAyB;QACnC,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,OAAO,CAAC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MAAM,IAAI,KAAK,CAAC;QAClB,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAGD,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAGD,KAAK,CAAC,UAAU;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAM,SAAS,CAAC,CAAC;QAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAW;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC;IACpC,CAAC;CACF;AA3KD,8BA2KC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AttributeApiError = {
|
|
2
|
+
kind: "forceable";
|
|
3
|
+
count: number;
|
|
4
|
+
code: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "blocked";
|
|
7
|
+
count: number;
|
|
8
|
+
code: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: "other";
|
|
11
|
+
};
|
|
12
|
+
export declare function describeAttributeApiError(error: any): AttributeApiError;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeAttributeApiError = describeAttributeApiError;
|
|
4
|
+
function describeAttributeApiError(error) {
|
|
5
|
+
const data = error?.response?.data;
|
|
6
|
+
const code = data?.code;
|
|
7
|
+
if (code !== "ATTRIBUTE_IN_USE" && code !== "ATTRIBUTE_VALUE_IN_USE") {
|
|
8
|
+
return { kind: "other" };
|
|
9
|
+
}
|
|
10
|
+
const count = Number(data?.details?.value ?? 0);
|
|
11
|
+
const constraint = data?.details?.constraint;
|
|
12
|
+
if (constraint === "variant_combinations") {
|
|
13
|
+
return { kind: "blocked", count, code };
|
|
14
|
+
}
|
|
15
|
+
if (constraint === "product_links") {
|
|
16
|
+
return { kind: "forceable", count, code };
|
|
17
|
+
}
|
|
18
|
+
return { kind: "other" };
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=attribute-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-errors.js","sourceRoot":"","sources":["../../src/lib/attribute-errors.ts"],"names":[],"mappings":";;AAWA,8DAkBC;AAlBD,SAAgB,yBAAyB,CAAC,KAAU;IAClD,MAAM,IAAI,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,CAAC;IACxB,IAAI,IAAI,KAAK,kBAAkB,IAAI,IAAI,KAAK,wBAAwB,EAAE,CAAC;QACrE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC;IAC7C,IAAI,UAAU,KAAK,sBAAsB,EAAE,CAAC;QAC1C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC1C,CAAC;IACD,IAAI,UAAU,KAAK,eAAe,EAAE,CAAC;QACnC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC5C,CAAC;IAID,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from "../base-command";
|
|
2
|
+
export declare const CATEGORIES_REMOVED_MESSAGE: string;
|
|
3
|
+
export declare abstract class CategoriesRemovedCommand extends BaseCommand {
|
|
4
|
+
static hidden: boolean;
|
|
5
|
+
static strict: boolean;
|
|
6
|
+
static description: string;
|
|
7
|
+
init(): Promise<void>;
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CategoriesRemovedCommand = exports.CATEGORIES_REMOVED_MESSAGE = void 0;
|
|
4
|
+
const base_command_1 = require("../base-command");
|
|
5
|
+
const errors_1 = require("./errors");
|
|
6
|
+
exports.CATEGORIES_REMOVED_MESSAGE = "Store categories were removed from ecomweb and replaced by collections. " +
|
|
7
|
+
"Products are classified with category_code from the global product taxonomy.";
|
|
8
|
+
class CategoriesRemovedCommand extends base_command_1.BaseCommand {
|
|
9
|
+
async init() {
|
|
10
|
+
await this.parse({ strict: false, flags: {}, args: {} }, []);
|
|
11
|
+
}
|
|
12
|
+
async run() {
|
|
13
|
+
throw new errors_1.CliError("CATEGORIES_REMOVED", exports.CATEGORIES_REMOVED_MESSAGE, errors_1.ExitCode.VALIDATION, {
|
|
14
|
+
hint: "Use collections: ecomweb collections list (create, update, ...); ecomweb describe collections",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.CategoriesRemovedCommand = CategoriesRemovedCommand;
|
|
19
|
+
CategoriesRemovedCommand.hidden = true;
|
|
20
|
+
CategoriesRemovedCommand.strict = false;
|
|
21
|
+
CategoriesRemovedCommand.description = "Removed: categories were replaced by collections (ecomweb collections --help)";
|
|
22
|
+
//# sourceMappingURL=categories-removed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categories-removed.js","sourceRoot":"","sources":["../../src/lib/categories-removed.ts"],"names":[],"mappings":";;;AAAA,kDAA8C;AAC9C,qCAA8C;AAEjC,QAAA,0BAA0B,GACrC,0EAA0E;IAC1E,8EAA8E,CAAC;AAOjF,MAAsB,wBAAyB,SAAQ,0BAAW;IAOhE,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAS,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,iBAAQ,CAAC,oBAAoB,EAAE,kCAA0B,EAAE,iBAAQ,CAAC,UAAU,EAAE;YACxF,IAAI,EAAE,+FAA+F;SACtG,CAAC,CAAC;IACL,CAAC;;AAfH,4DAgBC;AAfQ,+BAAM,GAAG,IAAI,CAAC;AACd,+BAAM,GAAG,KAAK,CAAC;AACf,oCAAW,GAAG,+EAA+E,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CODEX_SKILL = "---\nname: ecomweb\ndescription: Use when someone wants to start building an ecomweb storefront, or asks how to build their ecomweb store's website with Codex, outside an existing storefront project.\n---\n\n# Starting an ecomweb storefront\n\nAn ecomweb storefront is a Next.js project for one ecomweb store: products,\ncart, checkout and accounts come from ecomweb; the merchant (with Codex) owns\nthe pages and the design.\n\n## Inside a storefront project\n\nIf the current folder has an `.ecomweb.json` file, it already is a storefront\nproject. Follow its `AGENTS.md`, which points to the project's own skill.\n\n## Starting one\n\n1. Check the prerequisites: `node --version` (24 or newer), `pnpm --version`,\n `git --version`. If one is missing, stop and give the install links:\n https://nodejs.org, https://pnpm.io/installation, https://git-scm.com/downloads.\n2. Check the login: `npx @ecomweb/cli auth status`. If not logged in, ask for\n the user's ecomweb email, run `npx @ecomweb/cli auth login --email <email>`\n (it emails them a 6-digit code), ask them for the code, then run\n `npx @ecomweb/cli auth login --email <email> --code <code> [--store-ref <ref>]`.\n (If they have several stores, it lists them: ask which one.)\n3. The login picked the store; `npx @ecomweb/cli stores current` shows it.\n4. Ask whether to create the project on this machine or as a new GitHub\n repository (add `--github`).\n5. Create it: `npx @ecomweb/cli storefront init`. It\n installs dependencies and prints the next steps.\n6. Tell the user to start `codex` inside the new folder and describe the\n storefront they want; `pnpm dev` shows it at http://localhost:3002.\n\nThe emailed code is fine to type into the chat (it works once, for a few\nminutes); never paste API keys or tokens into the chat or into files.\n";
|
|
2
|
+
export declare function codexSkillPath(home: string): string;
|
|
3
|
+
export declare function installCodexSkill(home: string, opts?: {
|
|
4
|
+
force?: boolean;
|
|
5
|
+
dryRun?: boolean;
|
|
6
|
+
}): {
|
|
7
|
+
path: string;
|
|
8
|
+
status: "installed" | "unchanged" | "would-install";
|
|
9
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CODEX_SKILL = void 0;
|
|
7
|
+
exports.codexSkillPath = codexSkillPath;
|
|
8
|
+
exports.installCodexSkill = installCodexSkill;
|
|
9
|
+
const node_fs_1 = require("node:fs");
|
|
10
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
+
const errors_1 = require("./errors");
|
|
12
|
+
exports.CODEX_SKILL = `---
|
|
13
|
+
name: ecomweb
|
|
14
|
+
description: Use when someone wants to start building an ecomweb storefront, or asks how to build their ecomweb store's website with Codex, outside an existing storefront project.
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Starting an ecomweb storefront
|
|
18
|
+
|
|
19
|
+
An ecomweb storefront is a Next.js project for one ecomweb store: products,
|
|
20
|
+
cart, checkout and accounts come from ecomweb; the merchant (with Codex) owns
|
|
21
|
+
the pages and the design.
|
|
22
|
+
|
|
23
|
+
## Inside a storefront project
|
|
24
|
+
|
|
25
|
+
If the current folder has an \`.ecomweb.json\` file, it already is a storefront
|
|
26
|
+
project. Follow its \`AGENTS.md\`, which points to the project's own skill.
|
|
27
|
+
|
|
28
|
+
## Starting one
|
|
29
|
+
|
|
30
|
+
1. Check the prerequisites: \`node --version\` (24 or newer), \`pnpm --version\`,
|
|
31
|
+
\`git --version\`. If one is missing, stop and give the install links:
|
|
32
|
+
https://nodejs.org, https://pnpm.io/installation, https://git-scm.com/downloads.
|
|
33
|
+
2. Check the login: \`npx @ecomweb/cli auth status\`. If not logged in, ask for
|
|
34
|
+
the user's ecomweb email, run \`npx @ecomweb/cli auth login --email <email>\`
|
|
35
|
+
(it emails them a 6-digit code), ask them for the code, then run
|
|
36
|
+
\`npx @ecomweb/cli auth login --email <email> --code <code> [--store-ref <ref>]\`.
|
|
37
|
+
(If they have several stores, it lists them: ask which one.)
|
|
38
|
+
3. The login picked the store; \`npx @ecomweb/cli stores current\` shows it.
|
|
39
|
+
4. Ask whether to create the project on this machine or as a new GitHub
|
|
40
|
+
repository (add \`--github\`).
|
|
41
|
+
5. Create it: \`npx @ecomweb/cli storefront init\`. It
|
|
42
|
+
installs dependencies and prints the next steps.
|
|
43
|
+
6. Tell the user to start \`codex\` inside the new folder and describe the
|
|
44
|
+
storefront they want; \`pnpm dev\` shows it at http://localhost:3002.
|
|
45
|
+
|
|
46
|
+
The emailed code is fine to type into the chat (it works once, for a few
|
|
47
|
+
minutes); never paste API keys or tokens into the chat or into files.
|
|
48
|
+
`;
|
|
49
|
+
function codexSkillPath(home) {
|
|
50
|
+
return node_path_1.default.join(home, ".agents/skills/ecomweb/SKILL.md");
|
|
51
|
+
}
|
|
52
|
+
function installCodexSkill(home, opts = {}) {
|
|
53
|
+
const file = codexSkillPath(home);
|
|
54
|
+
if ((0, node_fs_1.existsSync)(file)) {
|
|
55
|
+
const current = (0, node_fs_1.readFileSync)(file, "utf8");
|
|
56
|
+
if (current === exports.CODEX_SKILL)
|
|
57
|
+
return { path: file, status: "unchanged" };
|
|
58
|
+
if (!opts.force) {
|
|
59
|
+
throw new errors_1.CliError("SKILL_EXISTS", `A different skill already exists at ${file}`, errors_1.ExitCode.VALIDATION, {
|
|
60
|
+
hint: "Pass --force to replace it.",
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (opts.dryRun)
|
|
65
|
+
return { path: file, status: "would-install" };
|
|
66
|
+
(0, node_fs_1.mkdirSync)(node_path_1.default.dirname(file), { recursive: true });
|
|
67
|
+
(0, node_fs_1.writeFileSync)(file, exports.CODEX_SKILL);
|
|
68
|
+
return { path: file, status: "installed" };
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=codex-skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-skill.js","sourceRoot":"","sources":["../../src/lib/codex-skill.ts"],"names":[],"mappings":";;;;;;AA+CA,wCAEC;AAED,8CAkBC;AArED,qCAA6E;AAC7E,0DAA6B;AAC7B,qCAA8C;AAOjC,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC1B,CAAC;AAEF,SAAgB,cAAc,CAAC,IAAY;IACzC,OAAO,mBAAI,CAAC,IAAI,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAC;AAC5D,CAAC;AAED,SAAgB,iBAAiB,CAC/B,IAAY,EACZ,OAA8C,EAAE;IAEhD,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,IAAA,oBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3C,IAAI,OAAO,KAAK,mBAAW;YAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;QACxE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,iBAAQ,CAAC,cAAc,EAAE,uCAAuC,IAAI,EAAE,EAAE,iBAAQ,CAAC,UAAU,EAAE;gBACrG,IAAI,EAAE,6BAA6B;aACpC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,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