@aglyn/plugins-commerce 1.0.0-beta.230 → 1.0.0-beta.232
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/package.json +13 -13
- package/src/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/index.js.map +1 -1
- package/src/lib/barcode/barcode-decode.d.ts +71 -0
- package/src/lib/barcode/barcode-decode.js +498 -0
- package/src/lib/barcode/barcode-decode.js.map +1 -0
- package/src/lib/barcode/barcode-encode.d.ts +44 -0
- package/src/lib/barcode/barcode-encode.js +138 -0
- package/src/lib/barcode/barcode-encode.js.map +1 -0
- package/src/lib/barcode/barcode-scanner.component.d.ts +23 -0
- package/src/lib/barcode/barcode-scanner.component.js +260 -0
- package/src/lib/barcode/barcode-scanner.component.js.map +1 -0
- package/src/lib/barcode/scan-button.component.d.ts +10 -0
- package/src/lib/barcode/scan-button.component.js +62 -0
- package/src/lib/barcode/scan-button.component.js.map +1 -0
- package/src/lib/barcode/scanner-wedge.d.ts +35 -0
- package/src/lib/barcode/scanner-wedge.js +108 -0
- package/src/lib/barcode/scanner-wedge.js.map +1 -0
- package/src/lib/components/account.js +10 -1
- package/src/lib/components/account.js.map +1 -1
- package/src/lib/components/cart-extras.d.ts +45 -0
- package/src/lib/components/cart-extras.js +127 -0
- package/src/lib/components/cart-extras.js.map +1 -0
- package/src/lib/components/cart.js +82 -15
- package/src/lib/components/cart.js.map +1 -1
- package/src/lib/components/checkout-return-notice.d.ts +26 -0
- package/src/lib/components/checkout-return-notice.js +48 -0
- package/src/lib/components/checkout-return-notice.js.map +1 -0
- package/src/lib/components/commerce-console-page.js +124 -0
- package/src/lib/components/commerce-console-page.js.map +1 -1
- package/src/lib/components/commerce-console-sections.d.ts +1 -1
- package/src/lib/components/commerce-console-sections.js +4 -0
- package/src/lib/components/commerce-console-sections.js.map +1 -1
- package/src/lib/components/console/bulk-fulfill.d.ts +44 -0
- package/src/lib/components/console/bulk-fulfill.js +84 -0
- package/src/lib/components/console/bulk-fulfill.js.map +1 -0
- package/src/lib/components/console/catalog-organization-card.component.js +1 -0
- package/src/lib/components/console/catalog-organization-card.component.js.map +1 -1
- package/src/lib/components/console/customer-notifications-card.component.d.ts +19 -0
- package/src/lib/components/console/customer-notifications-card.component.js +149 -0
- package/src/lib/components/console/customer-notifications-card.component.js.map +1 -0
- package/src/lib/components/console/host-orders-card.component.js +88 -6
- package/src/lib/components/console/host-orders-card.component.js.map +1 -1
- package/src/lib/components/console/locations-card.component.js +164 -57
- package/src/lib/components/console/locations-card.component.js.map +1 -1
- package/src/lib/components/console/order-detail-dialog.component.js +209 -61
- package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
- package/src/lib/components/console/order-fulfillment-panel.component.d.ts +48 -0
- package/src/lib/components/console/order-fulfillment-panel.component.js +542 -0
- package/src/lib/components/console/order-fulfillment-panel.component.js.map +1 -0
- package/src/lib/components/console/order-invoice.component.d.ts +33 -0
- package/src/lib/components/console/order-invoice.component.js +81 -0
- package/src/lib/components/console/order-invoice.component.js.map +1 -0
- package/src/lib/components/console/order-receipt-resend.component.d.ts +21 -0
- package/src/lib/components/console/order-receipt-resend.component.js +203 -0
- package/src/lib/components/console/order-receipt-resend.component.js.map +1 -0
- package/src/lib/components/console/order-returns.component.d.ts +36 -0
- package/src/lib/components/console/order-returns.component.js +142 -0
- package/src/lib/components/console/order-returns.component.js.map +1 -0
- package/src/lib/components/console/order-shipping-actions.component.d.ts +54 -0
- package/src/lib/components/console/order-shipping-actions.component.js +149 -0
- package/src/lib/components/console/order-shipping-actions.component.js.map +1 -0
- package/src/lib/components/console/order-webhooks-card.component.d.ts +50 -0
- package/src/lib/components/console/order-webhooks-card.component.js +623 -0
- package/src/lib/components/console/order-webhooks-card.component.js.map +1 -0
- package/src/lib/components/console/order-zones.d.ts +155 -0
- package/src/lib/components/console/order-zones.js +40 -0
- package/src/lib/components/console/order-zones.js.map +1 -0
- package/src/lib/components/console/payment-methods-card.component.d.ts +67 -0
- package/src/lib/components/console/payment-methods-card.component.js +395 -0
- package/src/lib/components/console/payment-methods-card.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-api.d.ts +124 -0
- package/src/lib/components/console/pos/pos-api.js +101 -0
- package/src/lib/components/console/pos/pos-api.js.map +1 -0
- package/src/lib/components/console/pos/pos-cart-panel.component.d.ts +36 -0
- package/src/lib/components/console/pos/pos-cart-panel.component.js +160 -0
- package/src/lib/components/console/pos/pos-cart-panel.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-item-dialog.component.d.ts +39 -0
- package/src/lib/components/console/pos/pos-item-dialog.component.js +352 -0
- package/src/lib/components/console/pos/pos-item-dialog.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-product-grid.component.d.ts +47 -0
- package/src/lib/components/console/pos/pos-product-grid.component.js +272 -0
- package/src/lib/components/console/pos/pos-product-grid.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-receipt-panel.component.d.ts +27 -0
- package/src/lib/components/console/pos/pos-receipt-panel.component.js +282 -0
- package/src/lib/components/console/pos/pos-receipt-panel.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-tender-dialogs.component.d.ts +53 -0
- package/src/lib/components/console/pos/pos-tender-dialogs.component.js +445 -0
- package/src/lib/components/console/pos/pos-tender-dialogs.component.js.map +1 -0
- package/src/lib/components/console/pos/pos-tender-panel.component.d.ts +31 -0
- package/src/lib/components/console/pos/pos-tender-panel.component.js +640 -0
- package/src/lib/components/console/pos/pos-tender-panel.component.js.map +1 -0
- package/src/lib/components/console/pos/use-pos-display.d.ts +43 -0
- package/src/lib/components/console/pos/use-pos-display.js +161 -0
- package/src/lib/components/console/pos/use-pos-display.js.map +1 -0
- package/src/lib/components/console/pos-devices-card.component.d.ts +14 -0
- package/src/lib/components/console/pos-devices-card.component.js +546 -0
- package/src/lib/components/console/pos-devices-card.component.js.map +1 -0
- package/src/lib/components/console/pos-display/brand-screen.d.ts +33 -0
- package/src/lib/components/console/pos-display/brand-screen.js +85 -0
- package/src/lib/components/console/pos-display/brand-screen.js.map +1 -0
- package/src/lib/components/console/pos-display/cart-screen.d.ts +29 -0
- package/src/lib/components/console/pos-display/cart-screen.js +166 -0
- package/src/lib/components/console/pos-display/cart-screen.js.map +1 -0
- package/src/lib/components/console/pos-display/pairing-screen.d.ts +24 -0
- package/src/lib/components/console/pos-display/pairing-screen.js +127 -0
- package/src/lib/components/console/pos-display/pairing-screen.js.map +1 -0
- package/src/lib/components/console/pos-display/pos-display-api.d.ts +90 -0
- package/src/lib/components/console/pos-display/pos-display-api.js +140 -0
- package/src/lib/components/console/pos-display/pos-display-api.js.map +1 -0
- package/src/lib/components/console/pos-display/receipt-screen.d.ts +35 -0
- package/src/lib/components/console/pos-display/receipt-screen.js +200 -0
- package/src/lib/components/console/pos-display/receipt-screen.js.map +1 -0
- package/src/lib/components/console/pos-display/tip-screen.d.ts +36 -0
- package/src/lib/components/console/pos-display/tip-screen.js +211 -0
- package/src/lib/components/console/pos-display/tip-screen.js.map +1 -0
- package/src/lib/components/console/pos-display-page.component.d.ts +16 -0
- package/src/lib/components/console/pos-display-page.component.js +407 -0
- package/src/lib/components/console/pos-display-page.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-customer-lookup.component.d.ts +40 -0
- package/src/lib/components/console/pos-ops/pos-customer-lookup.component.js +289 -0
- package/src/lib/components/console/pos-ops/pos-customer-lookup.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-last-receipt.component.d.ts +34 -0
- package/src/lib/components/console/pos-ops/pos-last-receipt.component.js +61 -0
- package/src/lib/components/console/pos-ops/pos-last-receipt.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.d.ts +38 -0
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.js +129 -0
- package/src/lib/components/console/pos-ops/pos-operations-bar.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-ops-api.d.ts +37 -0
- package/src/lib/components/console/pos-ops/pos-ops-api.js +60 -0
- package/src/lib/components/console/pos-ops/pos-ops-api.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-pin-pad.component.d.ts +48 -0
- package/src/lib/components/console/pos-ops/pos-pin-pad.component.js +220 -0
- package/src/lib/components/console/pos-ops/pos-pin-pad.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-receipt-actions.component.d.ts +63 -0
- package/src/lib/components/console/pos-ops/pos-receipt-actions.component.js +186 -0
- package/src/lib/components/console/pos-ops/pos-receipt-actions.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-receipt.d.ts +39 -0
- package/src/lib/components/console/pos-ops/pos-receipt.js +182 -0
- package/src/lib/components/console/pos-ops/pos-receipt.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-return-dialog.component.d.ts +40 -0
- package/src/lib/components/console/pos-ops/pos-return-dialog.component.js +465 -0
- package/src/lib/components/console/pos-ops/pos-return-dialog.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-shift-history-card.component.d.ts +29 -0
- package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js +253 -0
- package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.d.ts +34 -0
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.js +494 -0
- package/src/lib/components/console/pos-ops/pos-shift-panel.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-shift-report.component.d.ts +37 -0
- package/src/lib/components/console/pos-ops/pos-shift-report.component.js +102 -0
- package/src/lib/components/console/pos-ops/pos-shift-report.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.d.ts +30 -0
- package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.js +277 -0
- package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.js.map +1 -0
- package/src/lib/components/console/pos-ops/register-ops.d.ts +28 -0
- package/src/lib/components/console/pos-ops/register-ops.js +28 -0
- package/src/lib/components/console/pos-ops/register-ops.js.map +1 -0
- package/src/lib/components/console/pos-ops/use-pos-cashier.d.ts +46 -0
- package/src/lib/components/console/pos-ops/use-pos-cashier.js +128 -0
- package/src/lib/components/console/pos-ops/use-pos-cashier.js.map +1 -0
- package/src/lib/components/console/pos-ops/use-pos-sale-receipt.d.ts +36 -0
- package/src/lib/components/console/pos-ops/use-pos-sale-receipt.js +64 -0
- package/src/lib/components/console/pos-ops/use-pos-sale-receipt.js.map +1 -0
- package/src/lib/components/console/pos-page.component.d.ts +13 -5
- package/src/lib/components/console/pos-page.component.js +756 -654
- package/src/lib/components/console/pos-page.component.js.map +1 -1
- package/src/lib/components/console/pos-zones.d.ts +23 -0
- package/src/lib/components/console/pos-zones.js +31 -0
- package/src/lib/components/console/pos-zones.js.map +1 -0
- package/src/lib/components/console/product-editor-dialog.component.js +61 -71
- package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
- package/src/lib/components/console/product-labels-dialog.component.d.ts +13 -0
- package/src/lib/components/console/product-labels-dialog.component.js +197 -0
- package/src/lib/components/console/product-labels-dialog.component.js.map +1 -0
- package/src/lib/components/console/product-register-fields.component.d.ts +19 -0
- package/src/lib/components/console/product-register-fields.component.js +241 -0
- package/src/lib/components/console/product-register-fields.component.js.map +1 -0
- package/src/lib/components/console/product-zones.d.ts +44 -0
- package/src/lib/components/console/product-zones.js.map +1 -1
- package/src/lib/components/console/products-hub-card.component.js +23 -20
- package/src/lib/components/console/products-hub-card.component.js.map +1 -1
- package/src/lib/components/console/register-hardware-card.component.d.ts +33 -0
- package/src/lib/components/console/register-hardware-card.component.js +826 -0
- package/src/lib/components/console/register-hardware-card.component.js.map +1 -0
- package/src/lib/components/console/registers-card.component.js +24 -5
- package/src/lib/components/console/registers-card.component.js.map +1 -1
- package/src/lib/components/console/return-actions.d.ts +38 -0
- package/src/lib/components/console/return-actions.js +76 -0
- package/src/lib/components/console/return-actions.js.map +1 -0
- package/src/lib/components/console/return-detail-dialog.component.d.ts +34 -0
- package/src/lib/components/console/return-detail-dialog.component.js +718 -0
- package/src/lib/components/console/return-detail-dialog.component.js.map +1 -0
- package/src/lib/components/console/return-settings-card.component.d.ts +34 -0
- package/src/lib/components/console/return-settings-card.component.js +195 -0
- package/src/lib/components/console/return-settings-card.component.js.map +1 -0
- package/src/lib/components/console/return-zones.d.ts +87 -0
- package/src/lib/components/console/return-zones.js +31 -0
- package/src/lib/components/console/return-zones.js.map +1 -0
- package/src/lib/components/console/returns-card.component.d.ts +45 -0
- package/src/lib/components/console/returns-card.component.js +159 -0
- package/src/lib/components/console/returns-card.component.js.map +1 -0
- package/src/lib/components/console/shipping-settings-card.component.js +161 -5
- package/src/lib/components/console/shipping-settings-card.component.js.map +1 -1
- package/src/lib/components/console/shippingeasy-card.component.d.ts +59 -0
- package/src/lib/components/console/shippingeasy-card.component.js +378 -0
- package/src/lib/components/console/shippingeasy-card.component.js.map +1 -0
- package/src/lib/components/console/shipstation-card.component.d.ts +35 -0
- package/src/lib/components/console/shipstation-card.component.js +345 -0
- package/src/lib/components/console/shipstation-card.component.js.map +1 -0
- package/src/lib/components/console/start-return-dialog.component.d.ts +40 -0
- package/src/lib/components/console/start-return-dialog.component.js +243 -0
- package/src/lib/components/console/start-return-dialog.component.js.map +1 -0
- package/src/lib/components/console/stock-movements-card.component.js +2 -1
- package/src/lib/components/console/stock-movements-card.component.js.map +1 -1
- package/src/lib/components/console/store-settings-card.component.js +2 -66
- package/src/lib/components/console/store-settings-card.component.js.map +1 -1
- package/src/lib/components/console/store-zones.d.ts +42 -0
- package/src/lib/components/console/store-zones.js +39 -0
- package/src/lib/components/console/store-zones.js.map +1 -0
- package/src/lib/components/console/storefront-tax-summary-card.component.js +1 -0
- package/src/lib/components/console/storefront-tax-summary-card.component.js.map +1 -1
- package/src/lib/components/order-status.d.ts +36 -0
- package/src/lib/components/order-status.js +502 -0
- package/src/lib/components/order-status.js.map +1 -0
- package/src/lib/components/product-detail.js +41 -2
- package/src/lib/components/product-detail.js.map +1 -1
- package/src/lib/components/return-request.d.ts +32 -0
- package/src/lib/components/return-request.js +576 -0
- package/src/lib/components/return-request.js.map +1 -0
- package/src/lib/components/storefront-payment-appearance.d.ts +32 -0
- package/src/lib/components/storefront-payment-appearance.js +114 -0
- package/src/lib/components/storefront-payment-appearance.js.map +1 -0
- package/src/lib/components/storefront-payment-element.d.ts +57 -1
- package/src/lib/components/storefront-payment-element.js +332 -33
- package/src/lib/components/storefront-payment-element.js.map +1 -1
- package/src/lib/constants/order-status.d.ts +22 -0
- package/src/lib/constants/order-status.js +22 -0
- package/src/lib/constants/order-status.js.map +1 -0
- package/src/lib/constants/return-request.d.ts +27 -0
- package/src/lib/constants/return-request.js +32 -0
- package/src/lib/constants/return-request.js.map +1 -0
- package/src/lib/constants/stock-movement-query.js +2 -1
- package/src/lib/constants/stock-movement-query.js.map +1 -1
- package/src/lib/declarations.console-server.js +9 -0
- package/src/lib/declarations.console-server.js.map +1 -1
- package/src/lib/declarations.server.d.ts +2 -1
- package/src/lib/declarations.server.js +68 -1
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/model/buyer-notifications.d.ts +59 -0
- package/src/lib/model/buyer-notifications.js +97 -0
- package/src/lib/model/buyer-notifications.js.map +1 -0
- package/src/lib/model/commerce-orders.d.ts +171 -2
- package/src/lib/model/commerce-orders.js +26 -16
- package/src/lib/model/commerce-orders.js.map +1 -1
- package/src/lib/model/commerce-payment-methods.d.ts +146 -0
- package/src/lib/model/commerce-payment-methods.js +247 -0
- package/src/lib/model/commerce-payment-methods.js.map +1 -0
- package/src/lib/model/commerce-pos-ops.d.ts +437 -0
- package/src/lib/model/commerce-pos-ops.js +721 -0
- package/src/lib/model/commerce-pos-ops.js.map +1 -0
- package/src/lib/model/commerce-pos.d.ts +263 -0
- package/src/lib/model/commerce-pos.js +375 -0
- package/src/lib/model/commerce-pos.js.map +1 -0
- package/src/lib/model/commerce-printers.d.ts +211 -0
- package/src/lib/model/commerce-printers.js +181 -0
- package/src/lib/model/commerce-printers.js.map +1 -0
- package/src/lib/model/commerce-receipt.d.ts +97 -0
- package/src/lib/model/commerce-receipt.js +180 -0
- package/src/lib/model/commerce-receipt.js.map +1 -0
- package/src/lib/model/commerce-returns.d.ts +207 -0
- package/src/lib/model/commerce-returns.js +300 -0
- package/src/lib/model/commerce-returns.js.map +1 -0
- package/src/lib/model/commerce-shipping.d.ts +44 -1
- package/src/lib/model/commerce-shipping.js +53 -9
- package/src/lib/model/commerce-shipping.js.map +1 -1
- package/src/lib/model/commerce-tax-engine.d.ts +90 -0
- package/src/lib/model/commerce-tax-engine.js +129 -0
- package/src/lib/model/commerce-tax-engine.js.map +1 -0
- package/src/lib/model/commerce.d.ts +91 -2
- package/src/lib/model/commerce.js +89 -1
- package/src/lib/model/commerce.js.map +1 -1
- package/src/lib/model/index.d.ts +16 -0
- package/src/lib/model/index.js +16 -0
- package/src/lib/model/index.js.map +1 -1
- package/src/lib/model/order-events.d.ts +154 -0
- package/src/lib/model/order-events.js +153 -0
- package/src/lib/model/order-events.js.map +1 -0
- package/src/lib/model/order-fulfillment.d.ts +117 -0
- package/src/lib/model/order-fulfillment.js +217 -0
- package/src/lib/model/order-fulfillment.js.map +1 -0
- package/src/lib/model/order-history.d.ts +58 -0
- package/src/lib/model/order-history.js +22 -0
- package/src/lib/model/order-history.js.map +1 -0
- package/src/lib/model/order-list-fields.d.ts +9 -1
- package/src/lib/model/order-list-fields.js +7 -1
- package/src/lib/model/order-list-fields.js.map +1 -1
- package/src/lib/model/order-shipping-export.d.ts +91 -0
- package/src/lib/model/order-shipping-export.js +192 -0
- package/src/lib/model/order-shipping-export.js.map +1 -0
- package/src/lib/model/order-status-view.d.ts +103 -0
- package/src/lib/model/order-status-view.js +156 -0
- package/src/lib/model/order-status-view.js.map +1 -0
- package/src/lib/model/order-webhooks.d.ts +142 -0
- package/src/lib/model/order-webhooks.js +91 -0
- package/src/lib/model/order-webhooks.js.map +1 -0
- package/src/lib/model/product-channel.d.ts +56 -0
- package/src/lib/model/product-channel.js +86 -0
- package/src/lib/model/product-channel.js.map +1 -0
- package/src/lib/model/product-modifiers.d.ts +80 -0
- package/src/lib/model/product-modifiers.js +140 -0
- package/src/lib/model/product-modifiers.js.map +1 -0
- package/src/lib/model/product-write.d.ts +186 -0
- package/src/lib/model/product-write.js +116 -0
- package/src/lib/model/product-write.js.map +1 -0
- package/src/lib/model/shippingeasy.d.ts +94 -0
- package/src/lib/model/shippingeasy.js +267 -0
- package/src/lib/model/shippingeasy.js.map +1 -0
- package/src/lib/model/shipstation.d.ts +125 -0
- package/src/lib/model/shipstation.js +399 -0
- package/src/lib/model/shipstation.js.map +1 -0
- package/src/lib/model/smart-collection-reads.d.ts +32 -0
- package/src/lib/model/smart-collection-reads.js +63 -0
- package/src/lib/model/smart-collection-reads.js.map +1 -0
- package/src/lib/model/tracking-url.d.ts +74 -0
- package/src/lib/model/tracking-url.js +159 -0
- package/src/lib/model/tracking-url.js.map +1 -0
- package/src/lib/plugin-config.d.ts +13 -0
- package/src/lib/plugin-config.js +77 -5
- package/src/lib/plugin-config.js.map +1 -1
- package/src/lib/plugin.js +26 -0
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/pos-ops-config.d.ts +39 -0
- package/src/lib/pos-ops-config.js +88 -0
- package/src/lib/pos-ops-config.js.map +1 -0
- package/src/lib/printing/print-document.d.ts +106 -0
- package/src/lib/printing/print-document.js +464 -0
- package/src/lib/printing/print-document.js.map +1 -0
- package/src/lib/printing/product-labels.d.ts +58 -0
- package/src/lib/printing/product-labels.js +116 -0
- package/src/lib/printing/product-labels.js.map +1 -0
- package/src/lib/printing/render-epson.d.ts +57 -0
- package/src/lib/printing/render-epson.js +135 -0
- package/src/lib/printing/render-epson.js.map +1 -0
- package/src/lib/printing/render-star.d.ts +45 -0
- package/src/lib/printing/render-star.js +100 -0
- package/src/lib/printing/render-star.js.map +1 -0
- package/src/lib/printing/render-text.d.ts +25 -0
- package/src/lib/printing/render-text.js +53 -0
- package/src/lib/printing/render-text.js.map +1 -0
- package/src/lib/server/api-v1/openapi.js +27 -4
- package/src/lib/server/api-v1/openapi.js.map +1 -1
- package/src/lib/server/api-v1/order-view.d.ts +67 -0
- package/src/lib/server/api-v1/order-view.js +120 -0
- package/src/lib/server/api-v1/order-view.js.map +1 -0
- package/src/lib/server/api-v1/orders-and-products.js +58 -65
- package/src/lib/server/api-v1/orders-and-products.js.map +1 -1
- package/src/lib/server/billing-webhook.js +135 -28
- package/src/lib/server/billing-webhook.js.map +1 -1
- package/src/lib/server/cancel-order.js +29 -0
- package/src/lib/server/cancel-order.js.map +1 -1
- package/src/lib/server/carrier-rates-availability.d.ts +26 -0
- package/src/lib/server/carrier-rates-availability.js +76 -0
- package/src/lib/server/carrier-rates-availability.js.map +1 -0
- package/src/lib/server/carrier-shipping.d.ts +84 -0
- package/src/lib/server/carrier-shipping.js +135 -0
- package/src/lib/server/carrier-shipping.js.map +1 -0
- package/src/lib/server/cart-checkout.d.ts +2 -0
- package/src/lib/server/cart-checkout.js +226 -22
- package/src/lib/server/cart-checkout.js.map +1 -1
- package/src/lib/server/channel-order-updates.d.ts +50 -0
- package/src/lib/server/channel-order-updates.js +290 -0
- package/src/lib/server/channel-order-updates.js.map +1 -0
- package/src/lib/server/channel-orders.d.ts +85 -0
- package/src/lib/server/channel-orders.js +543 -0
- package/src/lib/server/channel-orders.js.map +1 -0
- package/src/lib/server/checkout-extras.d.ts +64 -0
- package/src/lib/server/checkout-extras.js +157 -0
- package/src/lib/server/checkout-extras.js.map +1 -0
- package/src/lib/server/{feed.d.ts → checkout-status.d.ts} +2 -7
- package/src/lib/server/checkout-status.js +111 -0
- package/src/lib/server/checkout-status.js.map +1 -0
- package/src/lib/server/checkout.js +86 -9
- package/src/lib/server/checkout.js.map +1 -1
- package/src/lib/server/draft-order.js +34 -5
- package/src/lib/server/draft-order.js.map +1 -1
- package/src/lib/server/fulfill-order.d.ts +127 -10
- package/src/lib/server/fulfill-order.js +451 -49
- package/src/lib/server/fulfill-order.js.map +1 -1
- package/src/lib/server/legacy-feed.d.ts +28 -0
- package/src/lib/server/legacy-feed.js +52 -0
- package/src/lib/server/legacy-feed.js.map +1 -0
- package/src/lib/server/native-checkout.d.ts +34 -15
- package/src/lib/server/native-checkout.js +32 -17
- package/src/lib/server/native-checkout.js.map +1 -1
- package/src/lib/server/order-event-host-emit.d.ts +23 -0
- package/src/lib/server/order-event-host-emit.js +30 -0
- package/src/lib/server/order-event-host-emit.js.map +1 -0
- package/src/lib/server/order-event-triggers.d.ts +37 -0
- package/src/lib/server/order-event-triggers.js +119 -0
- package/src/lib/server/order-event-triggers.js.map +1 -0
- package/src/lib/server/order-events.d.ts +62 -0
- package/src/lib/server/order-events.js +109 -0
- package/src/lib/server/order-events.js.map +1 -0
- package/src/lib/server/order-history.d.ts +23 -0
- package/src/lib/server/order-history.js +65 -0
- package/src/lib/server/order-history.js.map +1 -0
- package/src/lib/server/order-notifications.d.ts +185 -0
- package/src/lib/server/order-notifications.js +567 -0
- package/src/lib/server/order-notifications.js.map +1 -0
- package/src/lib/server/order-receipt-send.d.ts +39 -0
- package/src/lib/server/order-receipt-send.js +151 -0
- package/src/lib/server/order-receipt-send.js.map +1 -0
- package/src/lib/server/order-status-token.d.ts +31 -0
- package/src/lib/server/order-status-token.js +75 -0
- package/src/lib/server/order-status-token.js.map +1 -0
- package/src/lib/server/order-status.d.ts +58 -0
- package/src/lib/server/order-status.js +141 -0
- package/src/lib/server/order-status.js.map +1 -0
- package/src/lib/server/order-webhooks.d.ts +108 -0
- package/src/lib/server/order-webhooks.js +622 -0
- package/src/lib/server/order-webhooks.js.map +1 -0
- package/src/lib/server/orders-shipping-prepare.d.ts +26 -0
- package/src/lib/server/orders-shipping-prepare.js +121 -0
- package/src/lib/server/orders-shipping-prepare.js.map +1 -0
- package/src/lib/server/payment-method-domains.d.ts +209 -0
- package/src/lib/server/payment-method-domains.js +444 -0
- package/src/lib/server/payment-method-domains.js.map +1 -0
- package/src/lib/server/payment-methods.d.ts +77 -0
- package/src/lib/server/payment-methods.js +284 -0
- package/src/lib/server/payment-methods.js.map +1 -0
- package/src/lib/server/pos-auth.d.ts +50 -0
- package/src/lib/server/pos-auth.js +121 -0
- package/src/lib/server/pos-auth.js.map +1 -0
- package/src/lib/server/pos-customer.d.ts +49 -0
- package/src/lib/server/pos-customer.js +257 -0
- package/src/lib/server/pos-customer.js.map +1 -0
- package/src/lib/server/pos-display.d.ts +57 -0
- package/src/lib/server/pos-display.js +419 -0
- package/src/lib/server/pos-display.js.map +1 -0
- package/src/lib/server/pos-fee-month.d.ts +34 -0
- package/src/lib/server/pos-fee-month.js +36 -0
- package/src/lib/server/pos-fee-month.js.map +1 -0
- package/src/lib/server/pos-ops-gate.d.ts +161 -0
- package/src/lib/server/pos-ops-gate.js +295 -0
- package/src/lib/server/pos-ops-gate.js.map +1 -0
- package/src/lib/server/pos-ops-routes.d.ts +22 -0
- package/src/lib/server/pos-ops-routes.js +36 -0
- package/src/lib/server/pos-ops-routes.js.map +1 -0
- package/src/lib/server/pos-order.d.ts +1 -18
- package/src/lib/server/pos-order.js +222 -42
- package/src/lib/server/pos-order.js.map +1 -1
- package/src/lib/server/pos-payment.d.ts +39 -0
- package/src/lib/server/pos-payment.js +922 -0
- package/src/lib/server/pos-payment.js.map +1 -0
- package/src/lib/server/pos-print.d.ts +82 -0
- package/src/lib/server/pos-print.js +193 -0
- package/src/lib/server/pos-print.js.map +1 -0
- package/src/lib/server/pos-readers.d.ts +27 -0
- package/src/lib/server/pos-readers.js +276 -0
- package/src/lib/server/pos-readers.js.map +1 -0
- package/src/lib/server/pos-refund-authority.d.ts +60 -0
- package/src/lib/server/pos-refund-authority.js +72 -0
- package/src/lib/server/pos-refund-authority.js.map +1 -0
- package/src/lib/server/pos-return.d.ts +58 -0
- package/src/lib/server/pos-return.js +891 -0
- package/src/lib/server/pos-return.js.map +1 -0
- package/src/lib/server/pos-sale-stamp.d.ts +66 -0
- package/src/lib/server/pos-sale-stamp.js +84 -0
- package/src/lib/server/pos-sale-stamp.js.map +1 -0
- package/src/lib/server/pos-sale.d.ts +170 -0
- package/src/lib/server/pos-sale.js +461 -0
- package/src/lib/server/pos-sale.js.map +1 -0
- package/src/lib/server/pos-shift.d.ts +45 -0
- package/src/lib/server/pos-shift.js +484 -0
- package/src/lib/server/pos-shift.js.map +1 -0
- package/src/lib/server/pos-staff-pin.d.ts +26 -0
- package/src/lib/server/pos-staff-pin.js +339 -0
- package/src/lib/server/pos-staff-pin.js.map +1 -0
- package/src/lib/server/pos-stripe.d.ts +91 -0
- package/src/lib/server/pos-stripe.js +129 -0
- package/src/lib/server/pos-stripe.js.map +1 -0
- package/src/lib/server/pos-terminal-connection-token.d.ts +48 -0
- package/src/lib/server/pos-terminal-connection-token.js +166 -0
- package/src/lib/server/pos-terminal-connection-token.js.map +1 -0
- package/src/lib/server/pos-terminal.d.ts +218 -0
- package/src/lib/server/pos-terminal.js +1014 -0
- package/src/lib/server/pos-terminal.js.map +1 -0
- package/src/lib/server/print-queue.d.ts +124 -0
- package/src/lib/server/print-queue.js +301 -0
- package/src/lib/server/print-queue.js.map +1 -0
- package/src/lib/server/printer-poll.d.ts +75 -0
- package/src/lib/server/printer-poll.js +325 -0
- package/src/lib/server/printer-poll.js.map +1 -0
- package/src/lib/server/printer-secret.d.ts +39 -0
- package/src/lib/server/printer-secret.js +56 -0
- package/src/lib/server/printer-secret.js.map +1 -0
- package/src/lib/server/printers.d.ts +114 -0
- package/src/lib/server/printers.js +546 -0
- package/src/lib/server/printers.js.map +1 -0
- package/src/lib/server/product-catalog.d.ts +42 -0
- package/src/lib/server/product-catalog.js +309 -0
- package/src/lib/server/product-catalog.js.map +1 -0
- package/src/lib/server/product-drafts.d.ts +5 -1
- package/src/lib/server/product-drafts.js +3 -3
- package/src/lib/server/product-drafts.js.map +1 -1
- package/src/lib/server/product-writer.d.ts +19 -0
- package/src/lib/server/product-writer.js +261 -0
- package/src/lib/server/product-writer.js.map +1 -0
- package/src/lib/server/products-write.d.ts +61 -0
- package/src/lib/server/products-write.js +375 -0
- package/src/lib/server/products-write.js.map +1 -0
- package/src/lib/server/refund.js +110 -45
- package/src/lib/server/refund.js.map +1 -1
- package/src/lib/server/reserve.js +2 -0
- package/src/lib/server/reserve.js.map +1 -1
- package/src/lib/server/return-status-action.d.ts +37 -0
- package/src/lib/server/return-status-action.js +57 -0
- package/src/lib/server/return-status-action.js.map +1 -0
- package/src/lib/server/returns.d.ts +119 -0
- package/src/lib/server/returns.js +938 -0
- package/src/lib/server/returns.js.map +1 -0
- package/src/lib/server/shipment-records.d.ts +36 -0
- package/src/lib/server/shipment-records.js +289 -0
- package/src/lib/server/shipment-records.js.map +1 -0
- package/src/lib/server/shipping-connector-gates.d.ts +40 -0
- package/src/lib/server/shipping-connector-gates.js +97 -0
- package/src/lib/server/shipping-connector-gates.js.map +1 -0
- package/src/lib/server/shipping-connectors.d.ts +29 -0
- package/src/lib/server/shipping-connectors.js +236 -0
- package/src/lib/server/shipping-connectors.js.map +1 -0
- package/src/lib/server/shippingeasy.d.ts +238 -0
- package/src/lib/server/shippingeasy.js +787 -0
- package/src/lib/server/shippingeasy.js.map +1 -0
- package/src/lib/server/shipstation.d.ts +129 -0
- package/src/lib/server/shipstation.js +483 -0
- package/src/lib/server/shipstation.js.map +1 -0
- package/src/lib/server/site-page-resolver.d.ts +5 -0
- package/src/lib/server/site-page-resolver.js +156 -1
- package/src/lib/server/site-page-resolver.js.map +1 -1
- package/src/lib/server/stock-levels.d.ts +21 -0
- package/src/lib/server/stock-levels.js +263 -0
- package/src/lib/server/stock-levels.js.map +1 -0
- package/src/lib/server/stripe-refund.d.ts +47 -0
- package/src/lib/server/stripe-refund.js +87 -0
- package/src/lib/server/stripe-refund.js.map +1 -0
- package/src/lib/server/supplier-update.js +46 -5
- package/src/lib/server/supplier-update.js.map +1 -1
- package/src/lib/server/tax-engine-quote.d.ts +47 -0
- package/src/lib/server/tax-engine-quote.js +105 -0
- package/src/lib/server/tax-engine-quote.js.map +1 -0
- package/src/lib/server.js +143 -2
- package/src/lib/server.js.map +1 -1
- package/src/lib/site.js +12 -0
- package/src/lib/site.js.map +1 -1
- package/src/lib/subprocessors.d.ts +26 -0
- package/src/lib/subprocessors.js +50 -0
- package/src/lib/subprocessors.js.map +1 -0
- package/src/lib/tenant-emails.js +461 -3
- package/src/lib/tenant-emails.js.map +1 -1
- package/src/lib/testing/fake-firestore.d.ts +45 -0
- package/src/lib/testing/fake-firestore.js +189 -0
- package/src/lib/testing/fake-firestore.js.map +1 -0
- package/src/lib/testing/memory-firestore.d.ts +136 -0
- package/src/lib/testing/memory-firestore.js +282 -0
- package/src/lib/testing/memory-firestore.js.map +1 -0
- package/src/lib/testing/pos-ops-harness.d.ts +50 -0
- package/src/lib/testing/pos-ops-harness.js +184 -0
- package/src/lib/testing/pos-ops-harness.js.map +1 -0
- package/src/lib/testing/pos-ops-memory-firestore.d.ts +55 -0
- package/src/lib/testing/pos-ops-memory-firestore.js +376 -0
- package/src/lib/testing/pos-ops-memory-firestore.js.map +1 -0
- package/src/lib/transfer/products.server.d.ts +5 -0
- package/src/lib/transfer/products.server.js +2 -2
- package/src/lib/transfer/products.server.js.map +1 -1
- package/src/lib/transfer/records-transfer.d.ts +11 -1
- package/src/lib/transfer/records-transfer.js +127 -5
- package/src/lib/transfer/records-transfer.js.map +1 -1
- package/src/lib/transfer/records.server.d.ts +9 -2
- package/src/lib/transfer/records.server.js +58 -7
- package/src/lib/transfer/records.server.js.map +1 -1
- package/src/lib/transfer/register-transfer-resources.js +40 -1
- package/src/lib/transfer/register-transfer-resources.js.map +1 -1
- package/src/lib/transfer/register-transfer-ui.js +4 -1
- package/src/lib/transfer/register-transfer-ui.js.map +1 -1
- package/src/lib/transfer/shipping-presets.d.ts +23 -0
- package/src/lib/transfer/shipping-presets.js +156 -0
- package/src/lib/transfer/shipping-presets.js.map +1 -0
- package/src/lib/transfer/tracking-transfer.d.ts +101 -0
- package/src/lib/transfer/tracking-transfer.js +546 -0
- package/src/lib/transfer/tracking-transfer.js.map +1 -0
- package/src/lib/transfer/tracking.server.d.ts +37 -0
- package/src/lib/transfer/tracking.server.js +393 -0
- package/src/lib/transfer/tracking.server.js.map +1 -0
- package/src/lib/transfer/transfer-keys.d.ts +2 -1
- package/src/lib/transfer/transfer-keys.js +6 -2
- package/src/lib/transfer/transfer-keys.js.map +1 -1
- package/src/lib/utils/code128.d.ts +37 -0
- package/src/lib/utils/code128.js +199 -0
- package/src/lib/utils/code128.js.map +1 -0
- package/src/lib/utils/order-invoice.d.ts +55 -0
- package/src/lib/utils/order-invoice.js +127 -0
- package/src/lib/utils/order-invoice.js.map +1 -0
- package/src/lib/utils/use-checkout-return-notice.d.ts +34 -0
- package/src/lib/utils/use-checkout-return-notice.js +78 -0
- package/src/lib/utils/use-checkout-return-notice.js.map +1 -0
- package/src/lib/server/feed.js +0 -69
- package/src/lib/server/feed.js.map +0 -1
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import { pluginDocsHelp } from "@aglyn/aglyn";
|
|
19
|
+
import { PLATFORM_BRAND_NAME } from "@aglyn/aglyn/app-utils/platform-brand";
|
|
20
|
+
import { CardDisplay } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
22
|
+
import { authorizedFetch } from "@aglyn/shared-util-http/authorized-token";
|
|
23
|
+
import { useUser } from "@aglyn/tenant-feature-instance";
|
|
24
|
+
import { Alert, AlertTitle, Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Stack, TableBody, TableCell, TableRow, Typography } from "@mui/material";
|
|
25
|
+
import { useCallback, useEffect, useState } from "react";
|
|
26
|
+
import ScrollTable from "@aglyn/shared-ui-jsx/components/scroll-table.component";
|
|
27
|
+
import { SHIPSTATION_STATUS_NAMES } from "../../model/shipstation.js";
|
|
28
|
+
/** The address ShipStation calls: this console's own origin, never a guess. */ export function shipStationEndpoint(hostId, origin) {
|
|
29
|
+
const base = origin != null ? origin : typeof window === 'undefined' ? '' : window.location.origin;
|
|
30
|
+
return `${base}/api/commerce/shipstation/${encodeURIComponent(hostId)}`;
|
|
31
|
+
}
|
|
32
|
+
/** The status names to type into ShipStation's Custom Store form, in its order. */ export const SHIPSTATION_STATUS_ROWS = [
|
|
33
|
+
[
|
|
34
|
+
'Unpaid Status',
|
|
35
|
+
SHIPSTATION_STATUS_NAMES.unpaid
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
'Paid Status',
|
|
39
|
+
SHIPSTATION_STATUS_NAMES.paid
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
'Shipped Status',
|
|
43
|
+
SHIPSTATION_STATUS_NAMES.shipped
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
'Canceled Status',
|
|
47
|
+
SHIPSTATION_STATUS_NAMES.canceled
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
'On-Hold Status',
|
|
51
|
+
SHIPSTATION_STATUS_NAMES.onHold
|
|
52
|
+
]
|
|
53
|
+
];
|
|
54
|
+
const when = (ms)=>ms ? new Date(ms).toLocaleString(undefined, {
|
|
55
|
+
dateStyle: 'medium',
|
|
56
|
+
timeStyle: 'short'
|
|
57
|
+
}) : 'Not yet';
|
|
58
|
+
/**
|
|
59
|
+
* Connect ShipStation (AGL-3613): the URL, username and password a merchant
|
|
60
|
+
* pastes into ShipStation's Custom Store, the status names to map, a new
|
|
61
|
+
* password and a disconnect. The password is kept sealed on the server and
|
|
62
|
+
* a site admin can show it again; the card renders nothing on a deployment
|
|
63
|
+
* that cannot seal one.
|
|
64
|
+
*/ export function ShipStationCard(props) {
|
|
65
|
+
var _ref;
|
|
66
|
+
const { hostId } = props;
|
|
67
|
+
const { data: user } = useUser();
|
|
68
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
69
|
+
const [status, setStatus] = useState(null);
|
|
70
|
+
const [loadError, setLoadError] = useState(null);
|
|
71
|
+
const [busy, setBusy] = useState(false);
|
|
72
|
+
const [password, setPassword] = useState(null);
|
|
73
|
+
const [confirmDisconnect, setConfirmDisconnect] = useState(false);
|
|
74
|
+
// Keyed on the account, not the user object: the object is new on every
|
|
75
|
+
// render, and the status is the same until somebody else signs in.
|
|
76
|
+
const uid = user == null ? void 0 : user.uid;
|
|
77
|
+
useEffect(()=>{
|
|
78
|
+
if (!uid || !user) return;
|
|
79
|
+
let live = true;
|
|
80
|
+
authorizedFetch(user, `/api/commerce/shipping-connectors?hostId=${encodeURIComponent(hostId)}`).then(async (response)=>{
|
|
81
|
+
var _ref;
|
|
82
|
+
const body = await response.json().catch(()=>({}));
|
|
83
|
+
if (!live) return;
|
|
84
|
+
if (!response.ok) return setLoadError((_ref = body == null ? void 0 : body.error) != null ? _ref : 'The connection could not be read.');
|
|
85
|
+
setLoadError(null);
|
|
86
|
+
setStatus(body);
|
|
87
|
+
}).catch(()=>live && setLoadError('The connection could not be read.'));
|
|
88
|
+
return ()=>{
|
|
89
|
+
live = false;
|
|
90
|
+
};
|
|
91
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- `user` changes identity every render; `uid` is what matters.
|
|
92
|
+
}, [
|
|
93
|
+
uid,
|
|
94
|
+
hostId
|
|
95
|
+
]);
|
|
96
|
+
const act = useCallback(async (action)=>{
|
|
97
|
+
setBusy(true);
|
|
98
|
+
try {
|
|
99
|
+
const response = await authorizedFetch(user, '/api/commerce/shipping-connectors', {
|
|
100
|
+
method: 'POST',
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json'
|
|
103
|
+
},
|
|
104
|
+
body: JSON.stringify({
|
|
105
|
+
hostId,
|
|
106
|
+
action
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
const body = await response.json().catch(()=>({}));
|
|
110
|
+
if (!response.ok) {
|
|
111
|
+
var _ref;
|
|
112
|
+
enqueueSnackbar((_ref = body == null ? void 0 : body.error) != null ? _ref : 'That did not work. Try again.', {
|
|
113
|
+
variant: 'error',
|
|
114
|
+
allowDuplicate: true
|
|
115
|
+
});
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
setStatus(body);
|
|
119
|
+
setPassword(typeof (body == null ? void 0 : body.password) === 'string' ? body.password : null);
|
|
120
|
+
if (action === 'disconnect') {
|
|
121
|
+
enqueueSnackbar('ShipStation is disconnected. It can no longer read your orders.', {
|
|
122
|
+
variant: 'success'
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
} finally{
|
|
126
|
+
setBusy(false);
|
|
127
|
+
}
|
|
128
|
+
}, [
|
|
129
|
+
user,
|
|
130
|
+
hostId,
|
|
131
|
+
enqueueSnackbar
|
|
132
|
+
]);
|
|
133
|
+
const copy = (label, value)=>{
|
|
134
|
+
var _navigator_clipboard;
|
|
135
|
+
void ((_navigator_clipboard = navigator.clipboard) == null ? void 0 : _navigator_clipboard.writeText(value).then(()=>enqueueSnackbar(`${label} copied`, {
|
|
136
|
+
variant: 'success',
|
|
137
|
+
persist: false
|
|
138
|
+
})).catch(()=>enqueueSnackbar(`Select the ${label.toLowerCase()} and copy it.`, {
|
|
139
|
+
variant: 'info'
|
|
140
|
+
})));
|
|
141
|
+
};
|
|
142
|
+
// A deployment with no secret keyring cannot keep a password: nothing to offer.
|
|
143
|
+
if (status && status.available === false && !status.connected) return null;
|
|
144
|
+
const connected = Boolean(status == null ? void 0 : status.connected);
|
|
145
|
+
const actions = !status ? null : connected ? /*#__PURE__*/ _jsxs(Stack, {
|
|
146
|
+
direction: "row",
|
|
147
|
+
spacing: 1,
|
|
148
|
+
children: [
|
|
149
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
150
|
+
size: "small",
|
|
151
|
+
disabled: busy,
|
|
152
|
+
onClick: ()=>void act('rotate'),
|
|
153
|
+
children: 'New password'
|
|
154
|
+
}),
|
|
155
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
156
|
+
size: "small",
|
|
157
|
+
color: "error",
|
|
158
|
+
disabled: busy,
|
|
159
|
+
onClick: ()=>setConfirmDisconnect(true),
|
|
160
|
+
children: 'Disconnect'
|
|
161
|
+
})
|
|
162
|
+
]
|
|
163
|
+
}) : /*#__PURE__*/ _jsx(Button, {
|
|
164
|
+
size: "small",
|
|
165
|
+
variant: "contained",
|
|
166
|
+
disabled: busy,
|
|
167
|
+
onClick: ()=>void act('connect'),
|
|
168
|
+
children: 'Connect ShipStation'
|
|
169
|
+
});
|
|
170
|
+
const endpoint = shipStationEndpoint(hostId);
|
|
171
|
+
const credentialRows = [
|
|
172
|
+
[
|
|
173
|
+
'URL to custom XML page',
|
|
174
|
+
endpoint,
|
|
175
|
+
true
|
|
176
|
+
],
|
|
177
|
+
[
|
|
178
|
+
'Username',
|
|
179
|
+
(_ref = status == null ? void 0 : status.username) != null ? _ref : '',
|
|
180
|
+
true
|
|
181
|
+
]
|
|
182
|
+
];
|
|
183
|
+
if (password) credentialRows.push([
|
|
184
|
+
'Password',
|
|
185
|
+
password,
|
|
186
|
+
true
|
|
187
|
+
]);
|
|
188
|
+
return /*#__PURE__*/ _jsxs(CardDisplay, {
|
|
189
|
+
header: 'ShipStation',
|
|
190
|
+
help: pluginDocsHelp('shipStation', {
|
|
191
|
+
excerpt: `ShipStation imports your paid orders from ${PLATFORM_BRAND_NAME} and sends each shipment back, which ` + 'marks the order shipped and emails your customer the tracking link.'
|
|
192
|
+
}),
|
|
193
|
+
HeaderProps: {
|
|
194
|
+
action: actions
|
|
195
|
+
},
|
|
196
|
+
contentGutterX: true,
|
|
197
|
+
contentGutterY: true,
|
|
198
|
+
children: [
|
|
199
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
200
|
+
spacing: 2,
|
|
201
|
+
children: [
|
|
202
|
+
loadError ? /*#__PURE__*/ _jsx(Alert, {
|
|
203
|
+
severity: "error",
|
|
204
|
+
children: loadError
|
|
205
|
+
}) : null,
|
|
206
|
+
!connected ? /*#__PURE__*/ _jsx(Typography, {
|
|
207
|
+
variant: "body2",
|
|
208
|
+
color: "text.secondary",
|
|
209
|
+
children: 'Already labeling in ShipStation? Connect it as a Custom Store: ShipStation imports the ' + 'orders you still have to ship, and each label you buy there marks the order shipped ' + 'here and emails your customer the tracking link. Only a site admin can connect it.'
|
|
210
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
211
|
+
children: [
|
|
212
|
+
password ? /*#__PURE__*/ _jsxs(Alert, {
|
|
213
|
+
severity: "info",
|
|
214
|
+
children: [
|
|
215
|
+
/*#__PURE__*/ _jsx(AlertTitle, {
|
|
216
|
+
children: 'Paste these into ShipStation'
|
|
217
|
+
}),
|
|
218
|
+
'Anyone with this password can read the name and address on every order you ship. ' + 'If it gets out, make a new password: the old one stops working at once.'
|
|
219
|
+
]
|
|
220
|
+
}) : null,
|
|
221
|
+
/*#__PURE__*/ _jsx(ScrollTable, {
|
|
222
|
+
size: "small",
|
|
223
|
+
"aria-label": "ShipStation connection",
|
|
224
|
+
children: /*#__PURE__*/ _jsxs(TableBody, {
|
|
225
|
+
children: [
|
|
226
|
+
credentialRows.map(([label, value])=>/*#__PURE__*/ _jsxs(TableRow, {
|
|
227
|
+
children: [
|
|
228
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
229
|
+
component: "th",
|
|
230
|
+
scope: "row",
|
|
231
|
+
children: label
|
|
232
|
+
}),
|
|
233
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
234
|
+
sx: {
|
|
235
|
+
wordBreak: 'break-all'
|
|
236
|
+
},
|
|
237
|
+
children: value
|
|
238
|
+
}),
|
|
239
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
240
|
+
align: "right",
|
|
241
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
242
|
+
size: "small",
|
|
243
|
+
onClick: ()=>copy(label, value),
|
|
244
|
+
children: 'Copy'
|
|
245
|
+
})
|
|
246
|
+
})
|
|
247
|
+
]
|
|
248
|
+
}, label)),
|
|
249
|
+
!password ? /*#__PURE__*/ _jsxs(TableRow, {
|
|
250
|
+
children: [
|
|
251
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
252
|
+
component: "th",
|
|
253
|
+
scope: "row",
|
|
254
|
+
children: 'Password'
|
|
255
|
+
}),
|
|
256
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
257
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
258
|
+
variant: "body2",
|
|
259
|
+
color: "text.secondary",
|
|
260
|
+
children: 'Hidden. Only a site admin can show it.'
|
|
261
|
+
})
|
|
262
|
+
}),
|
|
263
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
264
|
+
align: "right",
|
|
265
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
266
|
+
size: "small",
|
|
267
|
+
disabled: busy,
|
|
268
|
+
onClick: ()=>void act('reveal'),
|
|
269
|
+
children: 'Show'
|
|
270
|
+
})
|
|
271
|
+
})
|
|
272
|
+
]
|
|
273
|
+
}) : null
|
|
274
|
+
]
|
|
275
|
+
})
|
|
276
|
+
}),
|
|
277
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
278
|
+
variant: "subtitle2",
|
|
279
|
+
children: 'Status names to type into ShipStation'
|
|
280
|
+
}),
|
|
281
|
+
/*#__PURE__*/ _jsx(ScrollTable, {
|
|
282
|
+
size: "small",
|
|
283
|
+
"aria-label": "ShipStation status names",
|
|
284
|
+
children: /*#__PURE__*/ _jsx(TableBody, {
|
|
285
|
+
children: SHIPSTATION_STATUS_ROWS.map(([field, value])=>/*#__PURE__*/ _jsxs(TableRow, {
|
|
286
|
+
children: [
|
|
287
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
288
|
+
component: "th",
|
|
289
|
+
scope: "row",
|
|
290
|
+
children: field
|
|
291
|
+
}),
|
|
292
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
293
|
+
children: value
|
|
294
|
+
})
|
|
295
|
+
]
|
|
296
|
+
}, field))
|
|
297
|
+
})
|
|
298
|
+
}),
|
|
299
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
300
|
+
variant: "body2",
|
|
301
|
+
color: "text.secondary",
|
|
302
|
+
children: `Last order import: ${when(status == null ? void 0 : status.lastExportAtMs)}. Last shipment received: ${when(status == null ? void 0 : status.lastShipNoticeAtMs)}.`
|
|
303
|
+
})
|
|
304
|
+
]
|
|
305
|
+
})
|
|
306
|
+
]
|
|
307
|
+
}),
|
|
308
|
+
/*#__PURE__*/ _jsxs(Dialog, {
|
|
309
|
+
open: confirmDisconnect,
|
|
310
|
+
onClose: ()=>setConfirmDisconnect(false),
|
|
311
|
+
children: [
|
|
312
|
+
/*#__PURE__*/ _jsx(DialogTitle, {
|
|
313
|
+
children: 'Disconnect ShipStation?'
|
|
314
|
+
}),
|
|
315
|
+
/*#__PURE__*/ _jsx(DialogContent, {
|
|
316
|
+
children: /*#__PURE__*/ _jsx(DialogContentText, {
|
|
317
|
+
children: 'ShipStation stops importing orders from this site, and shipments it sends back are ' + 'refused. Orders already shipped stay shipped. You can connect again later with a new password.'
|
|
318
|
+
})
|
|
319
|
+
}),
|
|
320
|
+
/*#__PURE__*/ _jsxs(DialogActions, {
|
|
321
|
+
children: [
|
|
322
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
323
|
+
onClick: ()=>setConfirmDisconnect(false),
|
|
324
|
+
children: 'Cancel'
|
|
325
|
+
}),
|
|
326
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
327
|
+
color: "error",
|
|
328
|
+
disabled: busy,
|
|
329
|
+
onClick: ()=>{
|
|
330
|
+
setConfirmDisconnect(false);
|
|
331
|
+
void act('disconnect');
|
|
332
|
+
},
|
|
333
|
+
children: 'Disconnect'
|
|
334
|
+
})
|
|
335
|
+
]
|
|
336
|
+
})
|
|
337
|
+
]
|
|
338
|
+
})
|
|
339
|
+
]
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
ShipStationCard.displayName = 'ShipStationCard';
|
|
343
|
+
export default ShipStationCard;
|
|
344
|
+
|
|
345
|
+
//# sourceMappingURL=shipstation-card.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/shipstation-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n'use client'\n\nimport { pluginDocsHelp } from '@aglyn/aglyn'\nimport { PLATFORM_BRAND_NAME } from '@aglyn/aglyn/app-utils/platform-brand'\nimport { CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport { authorizedFetch } from '@aglyn/shared-util-http/authorized-token'\nimport { useUser } from '@aglyn/tenant-feature-instance'\nimport {\n Alert,\n AlertTitle,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Stack,\n TableBody,\n TableCell,\n TableRow,\n Typography,\n} from '@mui/material'\nimport { useCallback, useEffect, useState } from 'react'\nimport ScrollTable from '@aglyn/shared-ui-jsx/components/scroll-table.component'\nimport { SHIPSTATION_STATUS_NAMES } from '../../model/shipstation'\n\nexport interface ShipStationCardProps {\n hostId: string\n}\n\n/** What the connectors route answers about a connection. */\ninterface ConnectionStatus {\n /** Whether this deployment can keep a ShipStation password at all. */\n available?: boolean\n connected: boolean\n username?: string\n createdAtMs?: number\n rotatedAtMs?: number\n lastExportAtMs?: number\n lastShipNoticeAtMs?: number\n}\n\n/** The address ShipStation calls: this console's own origin, never a guess. */\nexport function shipStationEndpoint(hostId: string, origin?: string): string {\n const base = origin ?? (typeof window === 'undefined' ? '' : window.location.origin)\n return `${base}/api/commerce/shipstation/${encodeURIComponent(hostId)}`\n}\n\n/** The status names to type into ShipStation's Custom Store form, in its order. */\nexport const SHIPSTATION_STATUS_ROWS: ReadonlyArray<readonly [string, string]> = [\n ['Unpaid Status', SHIPSTATION_STATUS_NAMES.unpaid],\n ['Paid Status', SHIPSTATION_STATUS_NAMES.paid],\n ['Shipped Status', SHIPSTATION_STATUS_NAMES.shipped],\n ['Canceled Status', SHIPSTATION_STATUS_NAMES.canceled],\n ['On-Hold Status', SHIPSTATION_STATUS_NAMES.onHold],\n]\n\nconst when = (ms: number | undefined): string =>\n ms ? new Date(ms).toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' }) : 'Not yet'\n\n/**\n * Connect ShipStation (AGL-3613): the URL, username and password a merchant\n * pastes into ShipStation's Custom Store, the status names to map, a new\n * password and a disconnect. The password is kept sealed on the server and\n * a site admin can show it again; the card renders nothing on a deployment\n * that cannot seal one.\n */\nexport function ShipStationCard(props: ShipStationCardProps) {\n const { hostId } = props\n const { data: user } = useUser()\n const { enqueueSnackbar } = useSnackbar()\n const [status, setStatus] = useState<ConnectionStatus | null>(null)\n const [loadError, setLoadError] = useState<string | null>(null)\n const [busy, setBusy] = useState(false)\n const [password, setPassword] = useState<string | null>(null)\n const [confirmDisconnect, setConfirmDisconnect] = useState(false)\n\n // Keyed on the account, not the user object: the object is new on every\n // render, and the status is the same until somebody else signs in.\n const uid = user?.uid\n useEffect(() => {\n if (!uid || !user) return\n let live = true\n authorizedFetch(user as never, `/api/commerce/shipping-connectors?hostId=${encodeURIComponent(hostId)}`)\n .then(async (response) => {\n const body = await response.json().catch(() => ({}))\n if (!live) return\n if (!response.ok) return setLoadError(body?.error ?? 'The connection could not be read.')\n setLoadError(null)\n setStatus(body as ConnectionStatus)\n })\n .catch(() => live && setLoadError('The connection could not be read.'))\n return () => {\n live = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `user` changes identity every render; `uid` is what matters.\n }, [uid, hostId])\n\n const act = useCallback(\n async (action: 'connect' | 'rotate' | 'reveal' | 'disconnect') => {\n setBusy(true)\n try {\n const response = await authorizedFetch(user as never, '/api/commerce/shipping-connectors', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ hostId, action }),\n })\n const body = await response.json().catch(() => ({}))\n if (!response.ok) {\n enqueueSnackbar(body?.error ?? 'That did not work. Try again.', { variant: 'error', allowDuplicate: true })\n return\n }\n setStatus(body as ConnectionStatus)\n setPassword(typeof body?.password === 'string' ? body.password : null)\n if (action === 'disconnect') {\n enqueueSnackbar('ShipStation is disconnected. It can no longer read your orders.', { variant: 'success' })\n }\n } finally {\n setBusy(false)\n }\n },\n [user, hostId, enqueueSnackbar],\n )\n\n const copy = (label: string, value: string) => {\n void navigator.clipboard\n ?.writeText(value)\n .then(() => enqueueSnackbar(`${label} copied`, { variant: 'success', persist: false }))\n .catch(() => enqueueSnackbar(`Select the ${label.toLowerCase()} and copy it.`, { variant: 'info' }))\n }\n\n // A deployment with no secret keyring cannot keep a password: nothing to offer.\n if (status && status.available === false && !status.connected) return null\n\n const connected = Boolean(status?.connected)\n const actions = !status ? null : connected ? (\n <Stack direction=\"row\" spacing={1}>\n <Button size=\"small\" disabled={busy} onClick={() => void act('rotate')}>\n {'New password'}\n </Button>\n <Button size=\"small\" color=\"error\" disabled={busy} onClick={() => setConfirmDisconnect(true)}>\n {'Disconnect'}\n </Button>\n </Stack>\n ) : (\n <Button size=\"small\" variant=\"contained\" disabled={busy} onClick={() => void act('connect')}>\n {'Connect ShipStation'}\n </Button>\n )\n\n const endpoint = shipStationEndpoint(hostId)\n const credentialRows: Array<[string, string, boolean]> = [\n ['URL to custom XML page', endpoint, true],\n ['Username', status?.username ?? '', true],\n ]\n if (password) credentialRows.push(['Password', password, true])\n\n return (\n <CardDisplay\n header={'ShipStation'}\n help={pluginDocsHelp('shipStation', {\n excerpt:\n `ShipStation imports your paid orders from ${PLATFORM_BRAND_NAME} and sends each shipment back, which ` +\n 'marks the order shipped and emails your customer the tracking link.',\n })}\n HeaderProps={{ action: actions }}\n contentGutterX\n contentGutterY\n >\n <Stack spacing={2}>\n {loadError ? <Alert severity=\"error\">{loadError}</Alert> : null}\n {!connected ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {\n 'Already labeling in ShipStation? Connect it as a Custom Store: ShipStation imports the ' +\n 'orders you still have to ship, and each label you buy there marks the order shipped ' +\n 'here and emails your customer the tracking link. Only a site admin can connect it.'\n }\n </Typography>\n ) : (\n <>\n {password ? (\n <Alert severity=\"info\">\n <AlertTitle>{'Paste these into ShipStation'}</AlertTitle>\n {\n 'Anyone with this password can read the name and address on every order you ship. ' +\n 'If it gets out, make a new password: the old one stops working at once.'\n }\n </Alert>\n ) : null}\n <ScrollTable size=\"small\" aria-label=\"ShipStation connection\">\n <TableBody>\n {credentialRows.map(([label, value]) => (\n <TableRow key={label}>\n <TableCell component=\"th\" scope=\"row\">\n {label}\n </TableCell>\n <TableCell sx={{ wordBreak: 'break-all' }}>{value}</TableCell>\n <TableCell align=\"right\">\n <Button size=\"small\" onClick={() => copy(label, value)}>\n {'Copy'}\n </Button>\n </TableCell>\n </TableRow>\n ))}\n {!password ? (\n <TableRow>\n <TableCell component=\"th\" scope=\"row\">\n {'Password'}\n </TableCell>\n <TableCell>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Hidden. Only a site admin can show it.'}\n </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Button size=\"small\" disabled={busy} onClick={() => void act('reveal')}>\n {'Show'}\n </Button>\n </TableCell>\n </TableRow>\n ) : null}\n </TableBody>\n </ScrollTable>\n <Typography variant=\"subtitle2\">{'Status names to type into ShipStation'}</Typography>\n <ScrollTable size=\"small\" aria-label=\"ShipStation status names\">\n <TableBody>\n {SHIPSTATION_STATUS_ROWS.map(([field, value]) => (\n <TableRow key={field}>\n <TableCell component=\"th\" scope=\"row\">\n {field}\n </TableCell>\n <TableCell>{value}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n </ScrollTable>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`Last order import: ${when(status?.lastExportAtMs)}. Last shipment received: ${when(status?.lastShipNoticeAtMs)}.`}\n </Typography>\n </>\n )}\n </Stack>\n <Dialog open={confirmDisconnect} onClose={() => setConfirmDisconnect(false)}>\n <DialogTitle>{'Disconnect ShipStation?'}</DialogTitle>\n <DialogContent>\n <DialogContentText>\n {\n 'ShipStation stops importing orders from this site, and shipments it sends back are ' +\n 'refused. Orders already shipped stay shipped. You can connect again later with a new password.'\n }\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setConfirmDisconnect(false)}>{'Cancel'}</Button>\n <Button\n color=\"error\"\n disabled={busy}\n onClick={() => {\n setConfirmDisconnect(false)\n void act('disconnect')\n }}\n >\n {'Disconnect'}\n </Button>\n </DialogActions>\n </Dialog>\n </CardDisplay>\n )\n}\nShipStationCard.displayName = 'ShipStationCard'\n\nexport default ShipStationCard\n"],"names":["pluginDocsHelp","PLATFORM_BRAND_NAME","CardDisplay","useSnackbar","authorizedFetch","useUser","Alert","AlertTitle","Button","Dialog","DialogActions","DialogContent","DialogContentText","DialogTitle","Stack","TableBody","TableCell","TableRow","Typography","useCallback","useEffect","useState","ScrollTable","SHIPSTATION_STATUS_NAMES","shipStationEndpoint","hostId","origin","base","window","location","encodeURIComponent","SHIPSTATION_STATUS_ROWS","unpaid","paid","shipped","canceled","onHold","when","ms","Date","toLocaleString","undefined","dateStyle","timeStyle","ShipStationCard","props","data","user","enqueueSnackbar","status","setStatus","loadError","setLoadError","busy","setBusy","password","setPassword","confirmDisconnect","setConfirmDisconnect","uid","live","then","response","body","json","catch","ok","error","act","action","method","headers","JSON","stringify","variant","allowDuplicate","copy","label","value","navigator","clipboard","writeText","persist","toLowerCase","available","connected","Boolean","actions","direction","spacing","size","disabled","onClick","color","endpoint","credentialRows","username","push","header","help","excerpt","HeaderProps","contentGutterX","contentGutterY","severity","aria-label","map","component","scope","sx","wordBreak","align","field","lastExportAtMs","lastShipNoticeAtMs","open","onClose","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;AAEA,SAASA,cAAc,QAAQ,eAAc;AAC7C,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,WAAW,QAAQ,uBAAsB;AAClD,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAASC,eAAe,QAAQ,2CAA0C;AAC1E,SAASC,OAAO,QAAQ,iCAAgC;AACxD,SACEC,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,MAAM,EACNC,aAAa,EACbC,aAAa,EACbC,iBAAiB,EACjBC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,UAAU,QACL,gBAAe;AACtB,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AACxD,OAAOC,iBAAiB,yDAAwD;AAChF,SAASC,wBAAwB,QAAQ,6BAAyB;AAkBlE,6EAA6E,GAC7E,OAAO,SAASC,oBAAoBC,MAAc,EAAEC,MAAe;IACjE,MAAMC,OAAOD,iBAAAA,SAAW,OAAOE,WAAW,cAAc,KAAKA,OAAOC,QAAQ,CAACH,MAAM;IACnF,OAAO,GAAGC,KAAK,0BAA0B,EAAEG,m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AACC;sCAEG,wFACA;;;kCAIN,MAACF;;0CACC,KAACF;gCAAOoF,SAAS,IAAMlC,qBAAqB;0CAAS;;0CACrD,KAAClD;gCACCqF,OAAM;gCACNF,UAAUtC;gCACVuC,SAAS;oCACPlC,qBAAqB;oCACrB,KAAKU,IAAI;gCACX;0CAEC;;;;;;;;AAMb;AACAxB,gBAAgByE,WAAW,GAAG;AAE9B,eAAezE,gBAAe"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import * as CommerceModel from '../../model';
|
|
18
|
+
export interface StartReturnDialogProps {
|
|
19
|
+
hostId: string;
|
|
20
|
+
orderId: string;
|
|
21
|
+
order: Pick<CommerceModel.HostOrder, 'lineItems' | 'fulfillments' | 'refundedLineItemIds'>;
|
|
22
|
+
/** The returns already on the order, which hold units against it. */
|
|
23
|
+
existing: ReadonlyArray<Pick<CommerceModel.HostReturn, 'status' | 'lines' | 'refundedAtMs'>>;
|
|
24
|
+
open: boolean;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
/** Called with the new return's id once the route opened it. */
|
|
27
|
+
onCreated?: (returnId: string) => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* "Start return" (AGL-3611): the merchant opens a return on the buyer's
|
|
31
|
+
* behalf. It starts approved — the merchant asking is the approval — and the
|
|
32
|
+
* route re-checks every quantity against the order and the returns already on
|
|
33
|
+
* it. What is offered here is `returnableLines` with no store policy, since a
|
|
34
|
+
* merchant may take back any product type, at any time.
|
|
35
|
+
*/
|
|
36
|
+
export declare function StartReturnDialog(props: StartReturnDialogProps): import("react").JSX.Element;
|
|
37
|
+
export declare namespace StartReturnDialog {
|
|
38
|
+
var displayName: string;
|
|
39
|
+
}
|
|
40
|
+
export default StartReturnDialog;
|