@crossly/sdk 0.3.0 → 0.3.2
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 +8 -12
- package/dist/client.d.ts +3 -12
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -86
- package/dist/client.js.map +1 -1
- package/dist/create-client-carnival.d.ts +44 -0
- package/dist/create-client-carnival.d.ts.map +1 -0
- package/dist/create-client-carnival.js +31 -0
- package/dist/create-client-carnival.js.map +1 -0
- package/dist/create-client-data-sync.d.ts +13 -0
- package/dist/create-client-data-sync.d.ts.map +1 -0
- package/dist/create-client-data-sync.js +7 -0
- package/dist/create-client-data-sync.js.map +1 -0
- package/dist/create-client-store-ops.d.ts +53 -0
- package/dist/create-client-store-ops.d.ts.map +1 -0
- package/dist/create-client-store-ops.js +27 -0
- package/dist/create-client-store-ops.js.map +1 -0
- package/dist/create-client.d.ts +57 -34
- package/dist/create-client.d.ts.map +1 -1
- package/dist/create-client.js +42 -26
- package/dist/create-client.js.map +1 -1
- package/dist/errors.d.ts +8 -18
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +17 -20
- package/dist/errors.js.map +1 -1
- package/dist/generated/api-types.d.ts +12587 -675
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/generated/operations.d.ts +3337 -513
- package/dist/generated/operations.d.ts.map +1 -1
- package/dist/generated/operations.js +384 -31
- package/dist/generated/operations.js.map +1 -1
- package/dist/index.d.ts +21 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/public-exports.d.ts +14 -5
- package/dist/public-exports.d.ts.map +1 -1
- package/dist/public-exports.js +5 -0
- package/dist/public-exports.js.map +1 -1
- package/dist/resources/account-billing.d.ts +26 -0
- package/dist/resources/account-billing.d.ts.map +1 -1
- package/dist/resources/account-billing.js +20 -0
- package/dist/resources/account-billing.js.map +1 -1
- package/dist/resources/account.d.ts +8 -85
- package/dist/resources/account.d.ts.map +1 -1
- package/dist/resources/account.js +14 -86
- package/dist/resources/account.js.map +1 -1
- package/dist/resources/ai-integrations.d.ts +36 -0
- package/dist/resources/ai-integrations.d.ts.map +1 -1
- package/dist/resources/ai-integrations.js +4 -0
- package/dist/resources/ai-integrations.js.map +1 -1
- package/dist/resources/analytics-benchmarks.d.ts +67 -0
- package/dist/resources/analytics-benchmarks.d.ts.map +1 -0
- package/dist/resources/analytics-benchmarks.js +24 -0
- package/dist/resources/analytics-benchmarks.js.map +1 -0
- package/dist/resources/analytics-goals.d.ts +100 -0
- package/dist/resources/analytics-goals.d.ts.map +1 -0
- package/dist/resources/analytics-goals.js +45 -0
- package/dist/resources/analytics-goals.js.map +1 -0
- package/dist/resources/analytics.d.ts +108 -0
- package/dist/resources/analytics.d.ts.map +1 -0
- package/dist/resources/analytics.js +110 -0
- package/dist/resources/analytics.js.map +1 -0
- package/dist/resources/automation-activity.d.ts +32 -0
- package/dist/resources/automation-activity.d.ts.map +1 -0
- package/dist/resources/automation-activity.js +26 -0
- package/dist/resources/automation-activity.js.map +1 -0
- package/dist/resources/automation-guardrails.d.ts +42 -0
- package/dist/resources/automation-guardrails.d.ts.map +1 -0
- package/dist/resources/automation-guardrails.js +31 -0
- package/dist/resources/automation-guardrails.js.map +1 -0
- package/dist/resources/automation.d.ts +1 -1
- package/dist/resources/automation.d.ts.map +1 -1
- package/dist/resources/books.d.ts +147 -1
- package/dist/resources/books.d.ts.map +1 -1
- package/dist/resources/books.js +53 -0
- package/dist/resources/books.js.map +1 -1
- package/dist/resources/branding.d.ts +38 -3
- package/dist/resources/branding.d.ts.map +1 -1
- package/dist/resources/branding.js +12 -2
- package/dist/resources/branding.js.map +1 -1
- package/dist/resources/buyer/after-purchase.d.ts +26 -4
- package/dist/resources/buyer/after-purchase.d.ts.map +1 -1
- package/dist/resources/buyer/after-purchase.js +26 -4
- package/dist/resources/buyer/after-purchase.js.map +1 -1
- package/dist/resources/buyer/catalog-surface.d.ts +291 -0
- package/dist/resources/buyer/catalog-surface.d.ts.map +1 -0
- package/dist/resources/buyer/catalog-surface.js +314 -0
- package/dist/resources/buyer/catalog-surface.js.map +1 -0
- package/dist/resources/buyer/commerce.d.ts +15 -3
- package/dist/resources/buyer/commerce.d.ts.map +1 -1
- package/dist/resources/buyer/commerce.js +15 -3
- package/dist/resources/buyer/commerce.js.map +1 -1
- package/dist/resources/buyer/gift-cards.d.ts +12 -2
- package/dist/resources/buyer/gift-cards.d.ts.map +1 -1
- package/dist/resources/buyer/gift-cards.js +12 -2
- package/dist/resources/buyer/gift-cards.js.map +1 -1
- package/dist/resources/buyer/xmarket.d.ts +2 -0
- package/dist/resources/buyer/xmarket.d.ts.map +1 -1
- package/dist/resources/buyer/xmarket.js +2 -0
- package/dist/resources/buyer/xmarket.js.map +1 -1
- package/dist/resources/buyer.d.ts +216 -244
- package/dist/resources/buyer.d.ts.map +1 -1
- package/dist/resources/buyer.js +192 -263
- package/dist/resources/buyer.js.map +1 -1
- package/dist/resources/calendar.d.ts +48 -0
- package/dist/resources/calendar.d.ts.map +1 -0
- package/dist/resources/calendar.js +23 -0
- package/dist/resources/calendar.js.map +1 -0
- package/dist/resources/campaigns.d.ts +212 -0
- package/dist/resources/campaigns.d.ts.map +1 -0
- package/dist/resources/campaigns.js +60 -0
- package/dist/resources/campaigns.js.map +1 -0
- package/dist/resources/catalog.d.ts +34 -162
- package/dist/resources/catalog.d.ts.map +1 -1
- package/dist/resources/catalog.js +46 -230
- package/dist/resources/catalog.js.map +1 -1
- package/dist/resources/categories.d.ts +10 -2
- package/dist/resources/categories.d.ts.map +1 -1
- package/dist/resources/categories.js.map +1 -1
- package/dist/resources/channel-inventory.d.ts +24 -0
- package/dist/resources/channel-inventory.d.ts.map +1 -1
- package/dist/resources/channel-inventory.js +14 -0
- package/dist/resources/channel-inventory.js.map +1 -1
- package/dist/resources/comms.d.ts +90 -17
- package/dist/resources/comms.d.ts.map +1 -1
- package/dist/resources/comms.js +68 -16
- package/dist/resources/comms.js.map +1 -1
- package/dist/resources/connection-health.d.ts +56 -0
- package/dist/resources/connection-health.d.ts.map +1 -0
- package/dist/resources/connection-health.js +19 -0
- package/dist/resources/connection-health.js.map +1 -0
- package/dist/resources/connection-panels.d.ts +37 -0
- package/dist/resources/connection-panels.d.ts.map +1 -0
- package/dist/resources/connection-panels.js +33 -0
- package/dist/resources/connection-panels.js.map +1 -0
- package/dist/resources/consignment.d.ts +248 -0
- package/dist/resources/consignment.d.ts.map +1 -0
- package/dist/resources/consignment.js +64 -0
- package/dist/resources/consignment.js.map +1 -0
- package/dist/resources/custom-data.d.ts +149 -0
- package/dist/resources/custom-data.d.ts.map +1 -0
- package/dist/resources/custom-data.js +112 -0
- package/dist/resources/custom-data.js.map +1 -0
- package/dist/resources/customers-types.d.ts +86 -0
- package/dist/resources/customers-types.d.ts.map +1 -1
- package/dist/resources/customers.d.ts +16 -1
- package/dist/resources/customers.d.ts.map +1 -1
- package/dist/resources/customers.js +32 -0
- package/dist/resources/customers.js.map +1 -1
- package/dist/resources/delist-outcomes.d.ts +77 -0
- package/dist/resources/delist-outcomes.d.ts.map +1 -0
- package/dist/resources/delist-outcomes.js +39 -0
- package/dist/resources/delist-outcomes.js.map +1 -0
- package/dist/resources/devices.d.ts +90 -0
- package/dist/resources/devices.d.ts.map +1 -1
- package/dist/resources/devices.js +36 -0
- package/dist/resources/devices.js.map +1 -1
- package/dist/resources/discount-programs.d.ts +175 -0
- package/dist/resources/discount-programs.d.ts.map +1 -1
- package/dist/resources/discount-programs.js +33 -0
- package/dist/resources/discount-programs.js.map +1 -1
- package/dist/resources/discount-promos.d.ts +80 -0
- package/dist/resources/discount-promos.d.ts.map +1 -0
- package/dist/resources/discount-promos.js +35 -0
- package/dist/resources/discount-promos.js.map +1 -0
- package/dist/resources/discovery.d.ts +12 -74
- package/dist/resources/discovery.d.ts.map +1 -1
- package/dist/resources/discovery.js +16 -81
- package/dist/resources/discovery.js.map +1 -1
- package/dist/resources/drops.d.ts +15 -3
- package/dist/resources/drops.d.ts.map +1 -1
- package/dist/resources/drops.js +15 -3
- package/dist/resources/drops.js.map +1 -1
- package/dist/resources/event-policies.d.ts +4 -3
- package/dist/resources/event-policies.d.ts.map +1 -1
- package/dist/resources/event-policies.js +4 -3
- package/dist/resources/event-policies.js.map +1 -1
- package/dist/resources/funding.d.ts +17 -0
- package/dist/resources/funding.d.ts.map +1 -1
- package/dist/resources/funding.js +12 -0
- package/dist/resources/funding.js.map +1 -1
- package/dist/resources/hub-agent-changes.d.ts +96 -0
- package/dist/resources/hub-agent-changes.d.ts.map +1 -0
- package/dist/resources/hub-agent-changes.js +34 -0
- package/dist/resources/hub-agent-changes.js.map +1 -0
- package/dist/resources/hub-programs.d.ts +40 -1
- package/dist/resources/hub-programs.d.ts.map +1 -1
- package/dist/resources/hub-programs.js +7 -0
- package/dist/resources/hub-programs.js.map +1 -1
- package/dist/resources/imports.d.ts +54 -0
- package/dist/resources/imports.d.ts.map +1 -1
- package/dist/resources/imports.js +15 -0
- package/dist/resources/imports.js.map +1 -1
- package/dist/resources/inventory-bulk-quantity.d.ts +24 -0
- package/dist/resources/inventory-bulk-quantity.d.ts.map +1 -0
- package/dist/resources/inventory-bulk-quantity.js +3 -0
- package/dist/resources/inventory-bulk-quantity.js.map +1 -0
- package/dist/resources/inventory-kits.d.ts +42 -0
- package/dist/resources/inventory-kits.d.ts.map +1 -0
- package/dist/resources/inventory-kits.js +29 -0
- package/dist/resources/inventory-kits.js.map +1 -0
- package/dist/resources/inventory-labels.d.ts +70 -0
- package/dist/resources/inventory-labels.d.ts.map +1 -0
- package/dist/resources/inventory-labels.js +34 -0
- package/dist/resources/inventory-labels.js.map +1 -0
- package/dist/resources/inventory-locations.d.ts +107 -0
- package/dist/resources/inventory-locations.d.ts.map +1 -0
- package/dist/resources/inventory-locations.js +63 -0
- package/dist/resources/inventory-locations.js.map +1 -0
- package/dist/resources/inventory-stale.d.ts +33 -0
- package/dist/resources/inventory-stale.d.ts.map +1 -0
- package/dist/resources/inventory-stale.js +3 -0
- package/dist/resources/inventory-stale.js.map +1 -0
- package/dist/resources/inventory.d.ts +144 -0
- package/dist/resources/inventory.d.ts.map +1 -0
- package/dist/resources/inventory.js +221 -0
- package/dist/resources/inventory.js.map +1 -0
- package/dist/resources/linear.d.ts +157 -0
- package/dist/resources/linear.d.ts.map +1 -0
- package/dist/resources/linear.js +77 -0
- package/dist/resources/linear.js.map +1 -0
- package/dist/resources/listing-automation.d.ts +59 -0
- package/dist/resources/listing-automation.d.ts.map +1 -0
- package/dist/resources/listing-automation.js +28 -0
- package/dist/resources/listing-automation.js.map +1 -0
- package/dist/resources/listing-defaults.d.ts +57 -0
- package/dist/resources/listing-defaults.d.ts.map +1 -0
- package/dist/resources/listing-defaults.js +20 -0
- package/dist/resources/listing-defaults.js.map +1 -0
- package/dist/resources/listing-duplicate.d.ts +46 -0
- package/dist/resources/listing-duplicate.d.ts.map +1 -0
- package/dist/resources/listing-duplicate.js +6 -0
- package/dist/resources/listing-duplicate.js.map +1 -0
- package/dist/resources/listing-issues.d.ts +73 -0
- package/dist/resources/listing-issues.d.ts.map +1 -0
- package/dist/resources/listing-issues.js +44 -0
- package/dist/resources/listing-issues.js.map +1 -0
- package/dist/resources/listing-list.d.ts +41 -0
- package/dist/resources/listing-list.d.ts.map +1 -0
- package/dist/resources/listing-list.js +13 -0
- package/dist/resources/listing-list.js.map +1 -0
- package/dist/resources/listing-photos.d.ts +59 -0
- package/dist/resources/listing-photos.d.ts.map +1 -0
- package/dist/resources/listing-photos.js +32 -0
- package/dist/resources/listing-photos.js.map +1 -0
- package/dist/resources/listing-proposals.d.ts +111 -0
- package/dist/resources/listing-proposals.d.ts.map +1 -0
- package/dist/resources/listing-proposals.js +70 -0
- package/dist/resources/listing-proposals.js.map +1 -0
- package/dist/resources/listing-revisions.d.ts +88 -0
- package/dist/resources/listing-revisions.d.ts.map +1 -0
- package/dist/resources/listing-revisions.js +57 -0
- package/dist/resources/listing-revisions.js.map +1 -0
- package/dist/resources/listing-schedule.d.ts +56 -0
- package/dist/resources/listing-schedule.d.ts.map +1 -0
- package/dist/resources/listing-schedule.js +40 -0
- package/dist/resources/listing-schedule.js.map +1 -0
- package/dist/resources/listing-word-rules.d.ts +96 -0
- package/dist/resources/listing-word-rules.d.ts.map +1 -0
- package/dist/resources/listing-word-rules.js +41 -0
- package/dist/resources/listing-word-rules.js.map +1 -0
- package/dist/resources/listings-csv.d.ts +105 -0
- package/dist/resources/listings-csv.d.ts.map +1 -0
- package/dist/resources/listings-csv.js +42 -0
- package/dist/resources/listings-csv.js.map +1 -0
- package/dist/resources/listings-search.d.ts +47 -0
- package/dist/resources/listings-search.d.ts.map +1 -0
- package/dist/resources/listings-search.js +2 -0
- package/dist/resources/listings-search.js.map +1 -0
- package/dist/resources/live-destinations.d.ts +89 -0
- package/dist/resources/live-destinations.d.ts.map +1 -0
- package/dist/resources/live-destinations.js +34 -0
- package/dist/resources/live-destinations.js.map +1 -0
- package/dist/resources/live-shows.d.ts +88 -2
- package/dist/resources/live-shows.d.ts.map +1 -1
- package/dist/resources/live-shows.js +21 -2
- package/dist/resources/live-shows.js.map +1 -1
- package/dist/resources/marketing.d.ts +141 -0
- package/dist/resources/marketing.d.ts.map +1 -0
- package/dist/resources/marketing.js +48 -0
- package/dist/resources/marketing.js.map +1 -0
- package/dist/resources/marketplace-ads.d.ts +214 -0
- package/dist/resources/marketplace-ads.d.ts.map +1 -0
- package/dist/resources/marketplace-ads.js +56 -0
- package/dist/resources/marketplace-ads.js.map +1 -0
- package/dist/resources/marketplace-fit.d.ts +58 -0
- package/dist/resources/marketplace-fit.d.ts.map +1 -0
- package/dist/resources/marketplace-fit.js +16 -0
- package/dist/resources/marketplace-fit.js.map +1 -0
- package/dist/resources/notion.d.ts +80 -0
- package/dist/resources/notion.d.ts.map +1 -0
- package/dist/resources/notion.js +54 -0
- package/dist/resources/notion.js.map +1 -0
- package/dist/resources/offer-rules.d.ts +125 -0
- package/dist/resources/offer-rules.d.ts.map +1 -0
- package/dist/resources/offer-rules.js +57 -0
- package/dist/resources/offer-rules.js.map +1 -0
- package/dist/resources/order-cancel-requests.d.ts +68 -0
- package/dist/resources/order-cancel-requests.d.ts.map +1 -0
- package/dist/resources/order-cancel-requests.js +32 -0
- package/dist/resources/order-cancel-requests.js.map +1 -0
- package/dist/resources/orders-bulk.d.ts +94 -0
- package/dist/resources/orders-bulk.d.ts.map +1 -0
- package/dist/resources/orders-bulk.js +58 -0
- package/dist/resources/orders-bulk.js.map +1 -0
- package/dist/resources/orders-ship-groups.d.ts +72 -0
- package/dist/resources/orders-ship-groups.d.ts.map +1 -0
- package/dist/resources/orders-ship-groups.js +29 -0
- package/dist/resources/orders-ship-groups.js.map +1 -0
- package/dist/resources/orders-types.d.ts +53 -0
- package/dist/resources/orders-types.d.ts.map +1 -1
- package/dist/resources/orders.d.ts +31 -48
- package/dist/resources/orders.d.ts.map +1 -1
- package/dist/resources/orders.js +19 -64
- package/dist/resources/orders.js.map +1 -1
- package/dist/resources/price-rules.d.ts +18 -0
- package/dist/resources/price-rules.d.ts.map +1 -1
- package/dist/resources/price-rules.js.map +1 -1
- package/dist/resources/publish-tasks.d.ts +32 -0
- package/dist/resources/publish-tasks.d.ts.map +1 -0
- package/dist/resources/publish-tasks.js +37 -0
- package/dist/resources/publish-tasks.js.map +1 -0
- package/dist/resources/rentals.d.ts +2 -2
- package/dist/resources/rentals.d.ts.map +1 -1
- package/dist/resources/rentals.js.map +1 -1
- package/dist/resources/reorder-points.d.ts +34 -0
- package/dist/resources/reorder-points.d.ts.map +1 -0
- package/dist/resources/reorder-points.js +20 -0
- package/dist/resources/reorder-points.js.map +1 -0
- package/dist/resources/restock-orders.d.ts +111 -0
- package/dist/resources/restock-orders.d.ts.map +1 -0
- package/dist/resources/restock-orders.js +67 -0
- package/dist/resources/restock-orders.js.map +1 -0
- package/dist/resources/returns.d.ts +92 -0
- package/dist/resources/returns.d.ts.map +1 -0
- package/dist/resources/returns.js +106 -0
- package/dist/resources/returns.js.map +1 -0
- package/dist/resources/seller-xmarket.d.ts +5 -5
- package/dist/resources/seller-xmarket.d.ts.map +1 -1
- package/dist/resources/seller-xmarket.js.map +1 -1
- package/dist/resources/sentry.d.ts +82 -0
- package/dist/resources/sentry.d.ts.map +1 -0
- package/dist/resources/sentry.js +49 -0
- package/dist/resources/sentry.js.map +1 -0
- package/dist/resources/sharing-schedules.d.ts +108 -0
- package/dist/resources/sharing-schedules.d.ts.map +1 -0
- package/dist/resources/sharing-schedules.js +34 -0
- package/dist/resources/sharing-schedules.js.map +1 -0
- package/dist/resources/shipping-add-ons-types.d.ts +63 -0
- package/dist/resources/shipping-add-ons-types.d.ts.map +1 -0
- package/dist/resources/shipping-add-ons-types.js +2 -0
- package/dist/resources/shipping-add-ons-types.js.map +1 -0
- package/dist/resources/slack-app.d.ts +66 -0
- package/dist/resources/slack-app.d.ts.map +1 -0
- package/dist/resources/slack-app.js +48 -0
- package/dist/resources/slack-app.js.map +1 -0
- package/dist/resources/stock-adjustments.d.ts +62 -0
- package/dist/resources/stock-adjustments.d.ts.map +1 -0
- package/dist/resources/stock-adjustments.js +35 -0
- package/dist/resources/stock-adjustments.js.map +1 -0
- package/dist/resources/stock-counts.d.ts +73 -0
- package/dist/resources/stock-counts.d.ts.map +1 -0
- package/dist/resources/stock-counts.js +45 -0
- package/dist/resources/stock-counts.js.map +1 -0
- package/dist/resources/store-credit.d.ts +119 -0
- package/dist/resources/store-credit.d.ts.map +1 -0
- package/dist/resources/store-credit.js +47 -0
- package/dist/resources/store-credit.js.map +1 -0
- package/dist/resources/store-reviews.d.ts +103 -0
- package/dist/resources/store-reviews.d.ts.map +1 -0
- package/dist/resources/store-reviews.js +39 -0
- package/dist/resources/store-reviews.js.map +1 -0
- package/dist/resources/store-settings-copy.d.ts +82 -0
- package/dist/resources/store-settings-copy.d.ts.map +1 -0
- package/dist/resources/store-settings-copy.js +56 -0
- package/dist/resources/store-settings-copy.js.map +1 -0
- package/dist/resources/store-setup.d.ts +49 -0
- package/dist/resources/store-setup.d.ts.map +1 -0
- package/dist/resources/store-setup.js +18 -0
- package/dist/resources/store-setup.js.map +1 -0
- package/dist/resources/storefront-site.d.ts +100 -0
- package/dist/resources/storefront-site.d.ts.map +1 -1
- package/dist/resources/storefront-site.js +26 -0
- package/dist/resources/storefront-site.js.map +1 -1
- package/dist/resources/storefronts.d.ts +58 -0
- package/dist/resources/storefronts.d.ts.map +1 -1
- package/dist/resources/storefronts.js +13 -0
- package/dist/resources/storefronts.js.map +1 -1
- package/dist/resources/stories-live-studio.d.ts +256 -1
- package/dist/resources/stories-live-studio.d.ts.map +1 -1
- package/dist/resources/stories-live-studio.js +65 -1
- package/dist/resources/stories-live-studio.js.map +1 -1
- package/dist/resources/supabase.d.ts +64 -0
- package/dist/resources/supabase.d.ts.map +1 -0
- package/dist/resources/supabase.js +35 -0
- package/dist/resources/supabase.js.map +1 -0
- package/dist/resources/tax.d.ts +128 -0
- package/dist/resources/tax.d.ts.map +1 -0
- package/dist/resources/tax.js +132 -0
- package/dist/resources/tax.js.map +1 -0
- package/dist/resources/team.d.ts +68 -1
- package/dist/resources/team.d.ts.map +1 -1
- package/dist/resources/team.js +65 -0
- package/dist/resources/team.js.map +1 -1
- package/dist/resources/templates.d.ts +19 -3
- package/dist/resources/templates.d.ts.map +1 -1
- package/dist/resources/templates.js +17 -2
- package/dist/resources/templates.js.map +1 -1
- package/dist/resources/units.d.ts +43 -1
- package/dist/resources/units.d.ts.map +1 -1
- package/dist/resources/units.js +17 -1
- package/dist/resources/units.js.map +1 -1
- package/dist/resources/variation-groups.js +10 -10
- package/dist/resources/variation-groups.js.map +1 -1
- package/dist/resources/vault-markets-mm.d.ts +6 -28
- package/dist/resources/vault-markets-mm.d.ts.map +1 -1
- package/dist/resources/vault-markets-mm.js.map +1 -1
- package/dist/resources/vault-markets-supply.d.ts +28 -0
- package/dist/resources/vault-markets-supply.d.ts.map +1 -1
- package/dist/resources/vault-markets-supply.js +12 -0
- package/dist/resources/vault-markets-supply.js.map +1 -1
- package/dist/resources/workflows-types.d.ts +115 -0
- package/dist/resources/workflows-types.d.ts.map +1 -1
- package/dist/resources/workflows.d.ts +26 -2
- package/dist/resources/workflows.d.ts.map +1 -1
- package/dist/resources/workflows.js +34 -0
- package/dist/resources/workflows.js.map +1 -1
- package/dist/resources/world-conventions.d.ts +3 -3
- package/dist/resources/world-conventions.d.ts.map +1 -1
- package/dist/resources/world-conventions.js.map +1 -1
- package/dist/resources.d.ts +36 -1
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +36 -1
- package/dist/resources.js.map +1 -1
- package/dist/settings-exports.d.ts +18 -0
- package/dist/settings-exports.d.ts.map +1 -0
- package/dist/settings-exports.js +14 -0
- package/dist/settings-exports.js.map +1 -0
- package/dist/transport/index.d.ts +96 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/index.js +162 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/types.d.ts +72 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/webhooks.d.ts.map +1 -1
- package/dist/webhooks.js +14 -5
- package/dist/webhooks.js.map +1 -1
- package/package.json +4 -7
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { HttpClient, JsonObject, IdempotencyOpts } from './_shared.js';
|
|
2
|
+
/** What a count covers. */
|
|
3
|
+
export type StockCountScope = 'location' | 'label' | 'all';
|
|
4
|
+
/** open: scanning. reviewing: checking the variance. applied / cancelled: over. */
|
|
5
|
+
export type StockCountStatus = 'open' | 'reviewing' | 'applied' | 'cancelled';
|
|
6
|
+
/** How one line compares with the books. */
|
|
7
|
+
export type StockCountVarianceKind = 'match' | 'over' | 'short' | 'missing' | 'uncounted' | 'unexpected';
|
|
8
|
+
export interface StockCountApplySummary {
|
|
9
|
+
itemsAdjusted: number;
|
|
10
|
+
unitsAdded: number;
|
|
11
|
+
unitsRemoved: number;
|
|
12
|
+
unitsMarkedLost: number;
|
|
13
|
+
onlyCounted: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface StockCount {
|
|
16
|
+
id: string;
|
|
17
|
+
storeId: string | null;
|
|
18
|
+
scope: StockCountScope;
|
|
19
|
+
/** The location or label; null for `all`. */
|
|
20
|
+
scopeValue: string | null;
|
|
21
|
+
name: string;
|
|
22
|
+
status: StockCountStatus;
|
|
23
|
+
note: string | null;
|
|
24
|
+
itemLines: number;
|
|
25
|
+
countedLines: number;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
appliedAt: string | null;
|
|
29
|
+
cancelledAt: string | null;
|
|
30
|
+
applySummary: StockCountApplySummary | null;
|
|
31
|
+
}
|
|
32
|
+
export interface StockCountLine {
|
|
33
|
+
id: string;
|
|
34
|
+
inventoryItemId: string;
|
|
35
|
+
/** Set on a unit line: one identified copy. */
|
|
36
|
+
unitId: string | null;
|
|
37
|
+
unitLabel: string | null;
|
|
38
|
+
title: string | null;
|
|
39
|
+
sku: string | null;
|
|
40
|
+
image: string | null;
|
|
41
|
+
storageBin: string | null;
|
|
42
|
+
expectedQty: number;
|
|
43
|
+
countedQty: number;
|
|
44
|
+
scanCount: number;
|
|
45
|
+
countedAt: string | null;
|
|
46
|
+
/** Scanned here, outside the scope: reported, never applied. */
|
|
47
|
+
unexpected: boolean;
|
|
48
|
+
note: string | null;
|
|
49
|
+
}
|
|
50
|
+
export interface StockCountApplyOptions {
|
|
51
|
+
/** Mark identified units expected and never scanned as lost. Default false. */
|
|
52
|
+
markMissingLost?: boolean;
|
|
53
|
+
/** Leave items nobody counted alone (a partial count). Default false. */
|
|
54
|
+
onlyCounted?: boolean;
|
|
55
|
+
/** Push the new quantities to the marketplaces. Default true. */
|
|
56
|
+
syncMarketplaces?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare class StockCountsResource {
|
|
59
|
+
private http;
|
|
60
|
+
constructor(http: HttpClient);
|
|
61
|
+
/** The store's counts, newest first. Envelope: `{ data }`. */
|
|
62
|
+
list(opts?: {
|
|
63
|
+
status?: StockCountStatus;
|
|
64
|
+
limit?: number;
|
|
65
|
+
}): Promise<JsonObject>;
|
|
66
|
+
/** One count with its lines. Envelope: `{ data: { count, lines } }`. */
|
|
67
|
+
get(countId: string): Promise<JsonObject>;
|
|
68
|
+
/** What the count found against the books: rows worst first, missing units, totals. */
|
|
69
|
+
variance(countId: string): Promise<JsonObject>;
|
|
70
|
+
/** Apply the count as a recount. 409 `stock_count_closed` when it was already applied or cancelled. */
|
|
71
|
+
apply(countId: string, body?: StockCountApplyOptions, opts?: IdempotencyOpts): Promise<JsonObject>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=stock-counts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stock-counts.d.ts","sourceRoot":"","sources":["../../src/resources/stock-counts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE5E,2BAA2B;AAC3B,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;AAC3D,mFAAmF;AACnF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAC9E,4CAA4C;AAC5C,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,YAAY,CAAC;AAEzG,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;IACvB,6CAA6C;IAC7C,UAAU,EAAE,MAA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A8D;IAC9D,IAAI,CAAC,IAAI,GAAE;QAAE,MAAM,CAAC,EAAE,gBAAgB,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO;IAW7D,wEAAwE;IACxE,GAAG,CAAC,OAAO,EAAE,MAAM;IAInB,uFAAuF;IACvF,QAAQ,CAAC,OAAO,EAAE,MAAM;IAOxB,uGAAuG;IACvG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,sBAA2B,EAAE,IAAI,GAAE,eAAoB;CAQrF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// ─── Stock counts (cycle count / stock-take) ────────────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// A count snapshots what the books expect in one location, one label or the whole store; scans in the dashboard or
|
|
4
|
+
// the seller app count what is really there. Applying moves each item by counted minus expected (a delta, so a sale
|
|
5
|
+
// since the count opened is never undone) and pushes the new quantities to the marketplaces.
|
|
6
|
+
export class StockCountsResource {
|
|
7
|
+
http;
|
|
8
|
+
constructor(http) {
|
|
9
|
+
this.http = http;
|
|
10
|
+
}
|
|
11
|
+
/** The store's counts, newest first. Envelope: `{ data }`. */
|
|
12
|
+
list(opts = {}) {
|
|
13
|
+
const query = {};
|
|
14
|
+
if (opts.status)
|
|
15
|
+
query.status = opts.status;
|
|
16
|
+
if (opts.limit !== undefined)
|
|
17
|
+
query.limit = String(opts.limit);
|
|
18
|
+
return this.http.request({
|
|
19
|
+
method: 'GET',
|
|
20
|
+
path: '/v1/inventory/stock-counts',
|
|
21
|
+
query: Object.keys(query).length > 0 ? query : undefined,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** One count with its lines. Envelope: `{ data: { count, lines } }`. */
|
|
25
|
+
get(countId) {
|
|
26
|
+
return this.http.request({ method: 'GET', path: `/v1/inventory/stock-counts/${encodeURIComponent(countId)}` });
|
|
27
|
+
}
|
|
28
|
+
/** What the count found against the books: rows worst first, missing units, totals. */
|
|
29
|
+
variance(countId) {
|
|
30
|
+
return this.http.request({
|
|
31
|
+
method: 'GET',
|
|
32
|
+
path: `/v1/inventory/stock-counts/${encodeURIComponent(countId)}/variance`,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Apply the count as a recount. 409 `stock_count_closed` when it was already applied or cancelled. */
|
|
36
|
+
apply(countId, body = {}, opts = {}) {
|
|
37
|
+
return this.http.request({
|
|
38
|
+
method: 'POST',
|
|
39
|
+
path: `/v1/inventory/stock-counts/${encodeURIComponent(countId)}/apply`,
|
|
40
|
+
body,
|
|
41
|
+
idempotencyKey: opts.idempotencyKey,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=stock-counts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stock-counts.js","sourceRoot":"","sources":["../../src/resources/stock-counts.ts"],"names":[],"mappings":"AA+DA,+EAA+E;AAC/E,EAAE;AACF,mHAAmH;AACnH,oHAAoH;AACpH,6FAA6F;AAE7F,MAAM,OAAO,mBAAmB;IACV;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC,8DAA8D;IAC9D,IAAI,CAAC,OAAsD,EAAE;QAC3D,MAAM,KAAK,GAA2B,EAAE,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC5C,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAa;YACnC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,4BAA4B;YAClC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SACzD,CAAC,CAAC;IACL,CAAC;IAED,wEAAwE;IACxE,GAAG,CAAC,OAAe;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAa,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,8BAA8B,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7H,CAAC;IAED,uFAAuF;IACvF,QAAQ,CAAC,OAAe;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAa;YACnC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,8BAA8B,kBAAkB,CAAC,OAAO,CAAC,WAAW;SAC3E,CAAC,CAAC;IACL,CAAC;IAED,uGAAuG;IACvG,KAAK,CAAC,OAAe,EAAE,OAA+B,EAAE,EAAE,OAAwB,EAAE;QAClF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAa;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,8BAA8B,kBAAkB,CAAC,OAAO,CAAC,QAAQ;YACvE,IAAI;YACJ,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { HttpClient } from './_shared.js';
|
|
2
|
+
/**
|
|
3
|
+
* Store credit: a per-store buyer credit ledger. Credit is the STORE's money (not Crossly Bucks): issued on returns,
|
|
4
|
+
* loyalty rewards, goodwill or gift cards, and spent automatically on that store's items at checkout. Reading needs
|
|
5
|
+
* `customers:read`, writing `customers:write`; the store is the token's store (or `X-Storefront-Id`).
|
|
6
|
+
*/
|
|
7
|
+
export type StoreCreditReason = 'return' | 'loyalty_reward' | 'goodwill' | 'gift_card' | 'order_spend' | 'order_refund' | 'expiry' | 'adjust';
|
|
8
|
+
export type StoreCreditIssueReason = 'return' | 'loyalty_reward' | 'goodwill' | 'gift_card';
|
|
9
|
+
export interface StoreCreditAccount {
|
|
10
|
+
id: string;
|
|
11
|
+
storeId: string;
|
|
12
|
+
buyerId: string;
|
|
13
|
+
buyerName: string;
|
|
14
|
+
balanceCents: number;
|
|
15
|
+
currency: string;
|
|
16
|
+
nextExpiryAt: string | null;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}
|
|
19
|
+
export interface StoreCreditEntry {
|
|
20
|
+
id: string;
|
|
21
|
+
deltaCents: number;
|
|
22
|
+
reason: StoreCreditReason;
|
|
23
|
+
refType: string | null;
|
|
24
|
+
refId: string | null;
|
|
25
|
+
remainingCents: number;
|
|
26
|
+
expiresAt: string | null;
|
|
27
|
+
note: string | null;
|
|
28
|
+
createdBy: string | null;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
}
|
|
31
|
+
export interface StoreCreditWrite {
|
|
32
|
+
accountId: string;
|
|
33
|
+
balanceCents: number;
|
|
34
|
+
entry: StoreCreditEntry;
|
|
35
|
+
/** True when the idempotency key had already written: nothing moved this time. */
|
|
36
|
+
existing: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface StoreCreditPolicy {
|
|
39
|
+
/** Days newly issued credit lasts; null = never expires. */
|
|
40
|
+
expiryDays: number | null;
|
|
41
|
+
/** Bonus on a return refunded as store credit, basis points (1000 = +10%). */
|
|
42
|
+
returnBonusBps: number;
|
|
43
|
+
}
|
|
44
|
+
export interface IssueStoreCreditInput {
|
|
45
|
+
buyerId: string;
|
|
46
|
+
amountCents: number;
|
|
47
|
+
reason?: StoreCreditIssueReason;
|
|
48
|
+
note?: string | null;
|
|
49
|
+
/** ISO date-time, or null = never; left out, the store policy decides. */
|
|
50
|
+
expiresAt?: string | null;
|
|
51
|
+
}
|
|
52
|
+
export interface BuyerStoreCredit {
|
|
53
|
+
accountId: string;
|
|
54
|
+
storeId: string;
|
|
55
|
+
storeName: string;
|
|
56
|
+
storeSlug: string;
|
|
57
|
+
balanceCents: number;
|
|
58
|
+
currency: string;
|
|
59
|
+
nextExpiryAt: string | null;
|
|
60
|
+
}
|
|
61
|
+
export declare class StoreCreditResource {
|
|
62
|
+
private http;
|
|
63
|
+
constructor(http: HttpClient);
|
|
64
|
+
/** Buyers with credit at your store, biggest balance first; `meta.totalCents` is the credit outstanding. */
|
|
65
|
+
list(query?: {
|
|
66
|
+
q?: string;
|
|
67
|
+
limit?: number;
|
|
68
|
+
offset?: number;
|
|
69
|
+
}): Promise<{
|
|
70
|
+
data: StoreCreditAccount[];
|
|
71
|
+
meta?: {
|
|
72
|
+
totalCents: number;
|
|
73
|
+
};
|
|
74
|
+
}>;
|
|
75
|
+
/** Issue credit to a buyer who has bought from you. The idempotency key (optional) makes a retry issue once. */
|
|
76
|
+
issue(input: IssueStoreCreditInput, idempotencyKey?: string): Promise<{
|
|
77
|
+
data: StoreCreditWrite;
|
|
78
|
+
}>;
|
|
79
|
+
/** One account with its entry history. */
|
|
80
|
+
account(id: string): Promise<{
|
|
81
|
+
data: {
|
|
82
|
+
account: StoreCreditAccount;
|
|
83
|
+
entries: StoreCreditEntry[];
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
/** Adjust a balance up or down (never below 0). */
|
|
87
|
+
adjust(id: string, input: {
|
|
88
|
+
deltaCents: number;
|
|
89
|
+
note?: string | null;
|
|
90
|
+
}, idempotencyKey?: string): Promise<{
|
|
91
|
+
data: StoreCreditWrite;
|
|
92
|
+
}>;
|
|
93
|
+
/** A customer's account at your store, or null. */
|
|
94
|
+
customer(buyerId: string): Promise<{
|
|
95
|
+
data: StoreCreditAccount | null;
|
|
96
|
+
}>;
|
|
97
|
+
/** The Crossly buyer behind a customer handle and their account here (nulls when there is no single one). */
|
|
98
|
+
customerByHandle(handle: string): Promise<{
|
|
99
|
+
data: {
|
|
100
|
+
buyerId: string | null;
|
|
101
|
+
account: StoreCreditAccount | null;
|
|
102
|
+
};
|
|
103
|
+
}>;
|
|
104
|
+
policy(): Promise<{
|
|
105
|
+
data: StoreCreditPolicy;
|
|
106
|
+
}>;
|
|
107
|
+
savePolicy(policy: StoreCreditPolicy): Promise<{
|
|
108
|
+
data: StoreCreditPolicy;
|
|
109
|
+
}>;
|
|
110
|
+
}
|
|
111
|
+
/** A buyer's own store credit at every store (`buyer:wallet:read`). */
|
|
112
|
+
export declare class BuyerStoreCreditResource {
|
|
113
|
+
private http;
|
|
114
|
+
constructor(http: HttpClient);
|
|
115
|
+
list(): Promise<{
|
|
116
|
+
data: BuyerStoreCredit[];
|
|
117
|
+
}>;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=store-credit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-credit.d.ts","sourceRoot":"","sources":["../../src/resources/store-credit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC9I,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AAE5F,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE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AM,CAAA;SAAE;;IAEtF,gHAAgH;IAChH,KAAK,CAAC,KAAK,EAAE,qBAAqB,EAAE,cAAc,CAAC,EAAE,MAAM;cACxB,gBAAgB;;IAEnD,0CAA0C;IAC1C,OAAO,CAAC,EAAE,EAAE,MAAM;cACiB;YAAE,OAAO,EAAE,kBAAkB,CAAC;YAAC,OAAO,EAAE,gBAAgB,EAAE,CAAA;SAAE;;IAE/F,mDAAmD;IACnD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,cAAc,CAAC,EAAE,MAAM;cAC5D,gBAAgB;;IAEnD,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM;cACW,kBAAkB,GAAG,IAAI;;IAE5D,6GAA6G;IAC7G,gBAAgB,CAAC,MAAM,EAAE,MAAM;cACI;YAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAA;SAAE;;IAEjG,MAAM;cAC6B,iBAAiB;;IAEpD,UAAU,CAAC,MAAM,EAAE,iBAAiB;cACD,iBAAiB;;CAErD;AAED,uEAAuE;AACvE,qBAAa,wBAAwB;IACvB,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IACpC,IAAI;cAC+B,gBAAgB,EAAE;;CAEtD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export class StoreCreditResource {
|
|
2
|
+
http;
|
|
3
|
+
constructor(http) {
|
|
4
|
+
this.http = http;
|
|
5
|
+
}
|
|
6
|
+
/** Buyers with credit at your store, biggest balance first; `meta.totalCents` is the credit outstanding. */
|
|
7
|
+
list(query = {}) {
|
|
8
|
+
return this.http.request({ method: 'GET', path: '/v1/store-credit', query });
|
|
9
|
+
}
|
|
10
|
+
/** Issue credit to a buyer who has bought from you. The idempotency key (optional) makes a retry issue once. */
|
|
11
|
+
issue(input, idempotencyKey) {
|
|
12
|
+
return this.http.request({ method: 'POST', path: '/v1/store-credit', body: input, idempotencyKey });
|
|
13
|
+
}
|
|
14
|
+
/** One account with its entry history. */
|
|
15
|
+
account(id) {
|
|
16
|
+
return this.http.request({ method: 'GET', path: `/v1/store-credit/accounts/${encodeURIComponent(id)}` });
|
|
17
|
+
}
|
|
18
|
+
/** Adjust a balance up or down (never below 0). */
|
|
19
|
+
adjust(id, input, idempotencyKey) {
|
|
20
|
+
return this.http.request({ method: 'POST', path: `/v1/store-credit/accounts/${encodeURIComponent(id)}/adjust`, body: input, idempotencyKey });
|
|
21
|
+
}
|
|
22
|
+
/** A customer's account at your store, or null. */
|
|
23
|
+
customer(buyerId) {
|
|
24
|
+
return this.http.request({ method: 'GET', path: `/v1/store-credit/customers/${encodeURIComponent(buyerId)}` });
|
|
25
|
+
}
|
|
26
|
+
/** The Crossly buyer behind a customer handle and their account here (nulls when there is no single one). */
|
|
27
|
+
customerByHandle(handle) {
|
|
28
|
+
return this.http.request({ method: 'GET', path: `/v1/store-credit/customers/by-handle/${encodeURIComponent(handle)}` });
|
|
29
|
+
}
|
|
30
|
+
policy() {
|
|
31
|
+
return this.http.request({ method: 'GET', path: '/v1/store-credit/policy' });
|
|
32
|
+
}
|
|
33
|
+
savePolicy(policy) {
|
|
34
|
+
return this.http.request({ method: 'PUT', path: '/v1/store-credit/policy', body: policy });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** A buyer's own store credit at every store (`buyer:wallet:read`). */
|
|
38
|
+
export class BuyerStoreCreditResource {
|
|
39
|
+
http;
|
|
40
|
+
constructor(http) {
|
|
41
|
+
this.http = http;
|
|
42
|
+
}
|
|
43
|
+
list() {
|
|
44
|
+
return this.http.request({ method: 'GET', path: '/v1/buyer/store-credit' });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=store-credit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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;IACtJ,CAAC;IACD,6GAA6G;IAC7G,gBAAgB,CAAC,MAAc;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA2E,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,wCAAwC,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACpM,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA8B,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC,CAAC;IAC5G,CAAC;IACD,UAAU,CAAC,MAAyB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA8B,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1H,CAAC;CACF;AAED,uEAAuE;AACvE,MAAM,OAAO,wBAAwB;IACf;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IACxC,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA+B,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { HttpClient, IdempotencyOpts, StoreOpts } from './_shared.js';
|
|
2
|
+
/**
|
|
3
|
+
* Store reviews (`client.storeReviews`, Hub → Storefront → Reviews): your store's Crossly reviews and the feedback it
|
|
4
|
+
* earned on eBay and Etsy, in one list. Reply, take a review off your showcase or pin it there, import new marketplace
|
|
5
|
+
* feedback, and ask for AI reply drafts. Hiding never removes a review from your public list or your rating.
|
|
6
|
+
* Store-scoped (`storefrontId`, else the client's, else the default store). Scopes storefronts:read / storefronts:write.
|
|
7
|
+
*/
|
|
8
|
+
export type ReviewSource = 'crossly' | 'ebay' | 'etsy';
|
|
9
|
+
export interface StoreReview {
|
|
10
|
+
id: string;
|
|
11
|
+
source: ReviewSource;
|
|
12
|
+
/** 1..5 (eBay: positive 5, neutral 3, negative 1). */
|
|
13
|
+
rating: number;
|
|
14
|
+
body: string | null;
|
|
15
|
+
/** Masked reviewer handle. */
|
|
16
|
+
reviewer: string | null;
|
|
17
|
+
itemTitle: string | null;
|
|
18
|
+
leftAt: string;
|
|
19
|
+
reply: {
|
|
20
|
+
body: string;
|
|
21
|
+
at: string;
|
|
22
|
+
editedAt: string | null;
|
|
23
|
+
} | null;
|
|
24
|
+
hidden: boolean;
|
|
25
|
+
featured: boolean;
|
|
26
|
+
countsTowardRating: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface StoreReviewSummary {
|
|
29
|
+
summary: {
|
|
30
|
+
average: number | null;
|
|
31
|
+
count: number;
|
|
32
|
+
sources: Array<{
|
|
33
|
+
source: ReviewSource;
|
|
34
|
+
count: number;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
sources: Array<{
|
|
38
|
+
platform: 'ebay' | 'etsy';
|
|
39
|
+
connected: boolean;
|
|
40
|
+
imported: number;
|
|
41
|
+
lastImportedAt: string | null;
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
export interface StoreReviewImportResult {
|
|
45
|
+
platform: 'ebay' | 'etsy';
|
|
46
|
+
ok: boolean;
|
|
47
|
+
added: number;
|
|
48
|
+
updated: number;
|
|
49
|
+
error: string | null;
|
|
50
|
+
}
|
|
51
|
+
export interface StoreReviewListParams {
|
|
52
|
+
q?: string;
|
|
53
|
+
source?: ReviewSource | 'all';
|
|
54
|
+
rating?: '1' | '2' | '3' | '4' | '5' | 'all';
|
|
55
|
+
reply?: 'needs' | 'replied' | 'all';
|
|
56
|
+
visibility?: 'shown' | 'hidden' | 'featured' | 'all';
|
|
57
|
+
sort?: 'newest' | 'oldest' | 'lowest' | 'highest';
|
|
58
|
+
page?: number;
|
|
59
|
+
pageSize?: number;
|
|
60
|
+
}
|
|
61
|
+
export declare class StoreReviewsResource {
|
|
62
|
+
private http;
|
|
63
|
+
constructor(http: HttpClient);
|
|
64
|
+
/** The store's reviews, newest first. `meta.total` is the full count. */
|
|
65
|
+
list(params?: StoreReviewListParams, opts?: StoreOpts): Promise<{
|
|
66
|
+
data: StoreReview[];
|
|
67
|
+
meta: {
|
|
68
|
+
total: number;
|
|
69
|
+
page: number;
|
|
70
|
+
pageSize: number;
|
|
71
|
+
};
|
|
72
|
+
}>;
|
|
73
|
+
/** The rating across every source, and each import source's state. */
|
|
74
|
+
summary(opts?: StoreOpts): Promise<{
|
|
75
|
+
data: StoreReviewSummary;
|
|
76
|
+
}>;
|
|
77
|
+
/** Copy new eBay / Etsy feedback now (both, or one `platform`). */
|
|
78
|
+
import(input?: {
|
|
79
|
+
platform?: 'ebay' | 'etsy';
|
|
80
|
+
}, opts?: IdempotencyOpts & StoreOpts): Promise<{
|
|
81
|
+
data: StoreReviewImportResult[];
|
|
82
|
+
}>;
|
|
83
|
+
/** Post a public reply (posting again edits it). */
|
|
84
|
+
reply(reviewId: string, body: string, opts?: IdempotencyOpts & StoreOpts): Promise<{
|
|
85
|
+
data: StoreReview;
|
|
86
|
+
}>;
|
|
87
|
+
/** Take a review off the showcase (`hidden`) or pin it to its front (`featured`). */
|
|
88
|
+
setFlags(reviewId: string, flags: {
|
|
89
|
+
hidden?: boolean;
|
|
90
|
+
featured?: boolean;
|
|
91
|
+
}, opts?: StoreOpts): Promise<{
|
|
92
|
+
data: StoreReview;
|
|
93
|
+
}>;
|
|
94
|
+
/** Up to three AI reply drafts; nothing is posted. */
|
|
95
|
+
suggestReply(reviewId: string, input?: {
|
|
96
|
+
tone?: 'friendly' | 'professional' | 'playful' | 'minimal';
|
|
97
|
+
}, opts?: StoreOpts): Promise<{
|
|
98
|
+
data: {
|
|
99
|
+
suggestions: string[];
|
|
100
|
+
};
|
|
101
|
+
}>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=store-reviews.d.ts.map
|
|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AAuB,EAAE;;IAG5D,oDAAoD;IACpD,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,SAAS;cACrC,WAAW;;IAK9C,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,IAAI,CAAC,EAAE,SAAS;cACzD,WAAW;;IAK9C,sDAAsD;IACtD,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE;QAAE,IAAI,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAA;KAAO,EAAE,IAAI,CAAC,EAAE,SAAS;cACxF;YAAE,WAAW,EAAE,MAAM,EAAE,CAAA;SAAE;;CAI7D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export class StoreReviewsResource {
|
|
2
|
+
http;
|
|
3
|
+
constructor(http) {
|
|
4
|
+
this.http = http;
|
|
5
|
+
}
|
|
6
|
+
/** The store's reviews, newest first. `meta.total` is the full count. */
|
|
7
|
+
list(params, opts) {
|
|
8
|
+
return this.http.request({
|
|
9
|
+
method: 'GET', path: '/v1/storefront/reviews', query: params, ...opts,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** The rating across every source, and each import source's state. */
|
|
13
|
+
summary(opts) {
|
|
14
|
+
return this.http.request({ method: 'GET', path: '/v1/storefront/reviews/summary', ...opts });
|
|
15
|
+
}
|
|
16
|
+
/** Copy new eBay / Etsy feedback now (both, or one `platform`). */
|
|
17
|
+
import(input = {}, opts) {
|
|
18
|
+
return this.http.request({ method: 'POST', path: '/v1/storefront/reviews/import', body: input, ...opts });
|
|
19
|
+
}
|
|
20
|
+
/** Post a public reply (posting again edits it). */
|
|
21
|
+
reply(reviewId, body, opts) {
|
|
22
|
+
return this.http.request({
|
|
23
|
+
method: 'POST', path: `/v1/storefront/reviews/${encodeURIComponent(reviewId)}/reply`, body: { body }, ...opts,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** Take a review off the showcase (`hidden`) or pin it to its front (`featured`). */
|
|
27
|
+
setFlags(reviewId, flags, opts) {
|
|
28
|
+
return this.http.request({
|
|
29
|
+
method: 'PATCH', path: `/v1/storefront/reviews/${encodeURIComponent(reviewId)}`, body: flags, ...opts,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** Up to three AI reply drafts; nothing is posted. */
|
|
33
|
+
suggestReply(reviewId, input = {}, opts) {
|
|
34
|
+
return this.http.request({
|
|
35
|
+
method: 'POST', path: `/v1/storefront/reviews/${encodeURIComponent(reviewId)}/suggest-reply`, body: input, ...opts,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=store-reviews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-reviews.js","sourceRoot":"","sources":["../../src/resources/store-reviews.ts"],"names":[],"mappings":"AAkDA,MAAM,OAAO,oBAAoB;IACX;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC,yEAAyE;IACzE,IAAI,CAAC,MAA8B,EAAE,IAAgB;QACnD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAmF;YACzG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;SACtE,CAAC,CAAC;IACL,CAAC;IAED,sEAAsE;IACtE,OAAO,CAAC,IAAgB;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA+B,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gCAAgC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC7H,CAAC;IAED,mEAAmE;IACnE,MAAM,CAAC,QAAwC,EAAE,EAAE,IAAkC;QACnF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAsC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IACjJ,CAAC;IAED,oDAAoD;IACpD,KAAK,CAAC,QAAgB,EAAE,IAAY,EAAE,IAAkC;QACtE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAwB;YAC9C,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI;SAC9G,CAAC,CAAC;IACL,CAAC;IAED,qFAAqF;IACrF,QAAQ,CAAC,QAAgB,EAAE,KAA+C,EAAE,IAAgB;QAC1F,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAwB;YAC9C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,0BAA0B,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI;SACtG,CAAC,CAAC;IACL,CAAC;IAED,sDAAsD;IACtD,YAAY,CAAC,QAAgB,EAAE,QAAwE,EAAE,EAAE,IAAgB;QACzH,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAsC;YAC5D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,kBAAkB,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI;SACnH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { HttpClient, IdempotencyOpts } from './_shared.js';
|
|
2
|
+
/**
|
|
3
|
+
* A group of store settings that can be copied between your stores (mirrors @crosslister/shared/store-settings
|
|
4
|
+
* STORE_SETTING_FAMILIES; the SDK has zero deps). Price rules, field rules and detected events are kept once per
|
|
5
|
+
* account, so every store already uses the same ones: a copy reports them `shared`.
|
|
6
|
+
*/
|
|
7
|
+
export type StoreSettingsFamily = 'listing-defaults' | 'shipping' | 'packing-slip' | 'restock' | 'channel-inventory' | 'price-rules' | 'field-rules' | 'policies' | 'vacation' | 'detected-events' | 'automation' | 'ai-config' | 'product-feeds' | 'smart-actions' | 'external-sales' | 'currency';
|
|
8
|
+
/** `merge` (default): add what a target store lacks, never change what it chose. `replace`: make it match the source. */
|
|
9
|
+
export type StoreSettingsCopyMode = 'merge' | 'replace';
|
|
10
|
+
export interface StoreSettingsCopyInput {
|
|
11
|
+
fromStorefrontId: string;
|
|
12
|
+
/** At most 50; the source is skipped if listed. */
|
|
13
|
+
toStorefrontIds: string[];
|
|
14
|
+
/** Default `'all'`. */
|
|
15
|
+
families?: StoreSettingsFamily[] | 'all';
|
|
16
|
+
mode?: StoreSettingsCopyMode;
|
|
17
|
+
}
|
|
18
|
+
/** One group's counts, in rows (a settings body is one row). */
|
|
19
|
+
export interface StoreSettingsFamilyCopy {
|
|
20
|
+
family: StoreSettingsFamily;
|
|
21
|
+
add: number;
|
|
22
|
+
overwrite: number;
|
|
23
|
+
skip: number;
|
|
24
|
+
remove: number;
|
|
25
|
+
/** Kept once per account: nothing to copy. */
|
|
26
|
+
shared: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface StoreSettingsCopyResult {
|
|
29
|
+
mode: StoreSettingsCopyMode;
|
|
30
|
+
fromStorefrontId: string;
|
|
31
|
+
stores: Array<{
|
|
32
|
+
storefrontId: string;
|
|
33
|
+
storeName: string;
|
|
34
|
+
families: StoreSettingsFamilyCopy[];
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
/** A settings file: what `exportSettings` returns and `importSettings` takes. Never holds secrets or ids. */
|
|
38
|
+
export interface StoreSettingsFile {
|
|
39
|
+
format: 'crossly.store-settings';
|
|
40
|
+
version: number;
|
|
41
|
+
exportedAt: string;
|
|
42
|
+
store: {
|
|
43
|
+
name: string;
|
|
44
|
+
};
|
|
45
|
+
/** One entry per group: its settings `body`, or a row family's `rows` (policies, shipping, product feeds). */
|
|
46
|
+
families: Partial<Record<StoreSettingsFamily, {
|
|
47
|
+
body?: Record<string, unknown>;
|
|
48
|
+
rows?: unknown;
|
|
49
|
+
shared?: boolean;
|
|
50
|
+
}>>;
|
|
51
|
+
}
|
|
52
|
+
export interface StoreSettingsImportInput {
|
|
53
|
+
/** The store to import into. */
|
|
54
|
+
storefrontId: string;
|
|
55
|
+
document: StoreSettingsFile;
|
|
56
|
+
/** Default `'all'`: every group the file holds. */
|
|
57
|
+
families?: StoreSettingsFamily[] | 'all';
|
|
58
|
+
mode?: StoreSettingsCopyMode;
|
|
59
|
+
}
|
|
60
|
+
export interface StoreSettingsImportResult {
|
|
61
|
+
mode: StoreSettingsCopyMode;
|
|
62
|
+
/** True for `previewImport`: nothing was written. */
|
|
63
|
+
dryRun: boolean;
|
|
64
|
+
storefrontId: string;
|
|
65
|
+
storeName: string;
|
|
66
|
+
families: StoreSettingsFamilyCopy[];
|
|
67
|
+
}
|
|
68
|
+
export declare class StoreSettingsCopyResource {
|
|
69
|
+
private http;
|
|
70
|
+
constructor(http: HttpClient);
|
|
71
|
+
/** What `copy` would do, per target store and group. Writes nothing. Requires `storefronts:read`. */
|
|
72
|
+
preview(input: StoreSettingsCopyInput): Promise<StoreSettingsCopyResult>;
|
|
73
|
+
/** Copy the groups to every target store; one Activity entry on each. Requires `storefronts:write`. */
|
|
74
|
+
copy(input: StoreSettingsCopyInput, opts?: IdempotencyOpts): Promise<StoreSettingsCopyResult>;
|
|
75
|
+
/** One store's settings as a file (default every group). Requires `storefronts:read`. */
|
|
76
|
+
exportSettings(storefrontId: string, families?: StoreSettingsFamily[] | 'all'): Promise<StoreSettingsFile>;
|
|
77
|
+
/** What `importSettings` would do, per group. Writes nothing. Requires `storefronts:read`. */
|
|
78
|
+
previewImport(input: StoreSettingsImportInput): Promise<StoreSettingsImportResult>;
|
|
79
|
+
/** Import a settings file into a store; one Activity entry on it. Requires `storefronts:write`. */
|
|
80
|
+
importSettings(input: StoreSettingsImportInput, opts?: IdempotencyOpts): Promise<StoreSettingsImportResult>;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=store-settings-copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-settings-copy.d.ts","sourceRoot":"","sources":["../../src/resources/store-settings-copy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,kBAAkB,GAClB,UAAU,GACV,cAAc,GACd,SAAS,GACT,mBAAmB,GACnB,aAAa,GACb,aAAa,GACb,UAAU,GACV,UAAU,GACV,iBAAiB,GACjB,YAAY,GACZ,WAAW,GACX,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,yHAAyH;AACzH,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,SAAS,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,uBAAuB;IACvB,QAAQ,CAAC,EAAE,mBAAmB,EAAE,GAAG,KAAK,CAAC;IACzC,IAAI,CAAC,EAAE,qBAAqB,CAAC;CAC9B;AAED,gEAAgE;AAChE,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,gBAAgB,EA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E,eAAoB;IAS9D,yFAAyF;IACzF,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,GAAE,mBAAmB,EAAE,GAAG,KAAa;IAQpF,8FAA8F;IAC9F,aAAa,CAAC,KAAK,EAAE,wBAAwB;IAQ7C,mGAAmG;IACnG,cAAc,CAAC,KAAK,EAAE,wBAAwB,EAAE,IAAI,GAAE,eAAoB;CAQ3E"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// ─── Copy settings between your stores ──────────
|
|
2
|
+
export class StoreSettingsCopyResource {
|
|
3
|
+
http;
|
|
4
|
+
constructor(http) {
|
|
5
|
+
this.http = http;
|
|
6
|
+
}
|
|
7
|
+
/** What `copy` would do, per target store and group. Writes nothing. Requires `storefronts:read`. */
|
|
8
|
+
preview(input) {
|
|
9
|
+
const families = input.families === undefined || input.families === 'all' ? 'all' : input.families.join(',');
|
|
10
|
+
return this.http.request({
|
|
11
|
+
method: 'GET',
|
|
12
|
+
path: '/v1/store-settings/copy/preview',
|
|
13
|
+
query: {
|
|
14
|
+
fromStorefrontId: input.fromStorefrontId,
|
|
15
|
+
toStorefrontIds: input.toStorefrontIds.join(','),
|
|
16
|
+
families,
|
|
17
|
+
mode: input.mode ?? 'merge',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** Copy the groups to every target store; one Activity entry on each. Requires `storefronts:write`. */
|
|
22
|
+
copy(input, opts = {}) {
|
|
23
|
+
return this.http.request({
|
|
24
|
+
method: 'POST',
|
|
25
|
+
path: '/v1/store-settings/copy',
|
|
26
|
+
body: { ...input },
|
|
27
|
+
idempotencyKey: opts.idempotencyKey,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** One store's settings as a file (default every group). Requires `storefronts:read`. */
|
|
31
|
+
exportSettings(storefrontId, families = 'all') {
|
|
32
|
+
return this.http.request({
|
|
33
|
+
method: 'GET',
|
|
34
|
+
path: '/v1/store-settings/export',
|
|
35
|
+
query: { storefrontId, families: families === 'all' ? 'all' : families.join(',') },
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** What `importSettings` would do, per group. Writes nothing. Requires `storefronts:read`. */
|
|
39
|
+
previewImport(input) {
|
|
40
|
+
return this.http.request({
|
|
41
|
+
method: 'POST',
|
|
42
|
+
path: '/v1/store-settings/import/preview',
|
|
43
|
+
body: { ...input },
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/** Import a settings file into a store; one Activity entry on it. Requires `storefronts:write`. */
|
|
47
|
+
importSettings(input, opts = {}) {
|
|
48
|
+
return this.http.request({
|
|
49
|
+
method: 'POST',
|
|
50
|
+
path: '/v1/store-settings/import',
|
|
51
|
+
body: { ...input },
|
|
52
|
+
idempotencyKey: opts.idempotencyKey,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=store-settings-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-settings-copy.js","sourceRoot":"","sources":["../../src/resources/store-settings-copy.ts"],"names":[],"mappings":"AAkFA,mDAAmD;AAEnD,MAAM,OAAO,yBAAyB;IAChB;IAApB,YAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAExC,qGAAqG;IACrG,OAAO,CAAC,KAA6B;QACnC,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7G,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA0B;YAChD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,iCAAiC;YACvC,KAAK,EAAE;gBACL,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,eAAe,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,C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