@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,27 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* The buyer's "Request a return" page (AGL-3611).
|
|
19
|
+
*
|
|
20
|
+
* The component id is persisted in screen documents; never rename it. The
|
|
21
|
+
* path is where the site serves the page when it has no page of its own
|
|
22
|
+
* there, and where the account block and the order-status page link to.
|
|
23
|
+
*/
|
|
24
|
+
export declare const RETURN_REQUEST_COMPONENT_ID = "return-request";
|
|
25
|
+
export declare const RETURN_REQUEST_PATH = "order-return";
|
|
26
|
+
/** The page's address for one order, with the status-link token when there is one. */
|
|
27
|
+
export declare function returnRequestHref(orderId: string, token?: string | null): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
* The buyer's "Request a return" page (AGL-3611).
|
|
18
|
+
*
|
|
19
|
+
* The component id is persisted in screen documents; never rename it. The
|
|
20
|
+
* path is where the site serves the page when it has no page of its own
|
|
21
|
+
* there, and where the account block and the order-status page link to.
|
|
22
|
+
*/ export const RETURN_REQUEST_COMPONENT_ID = 'return-request';
|
|
23
|
+
export const RETURN_REQUEST_PATH = 'order-return';
|
|
24
|
+
/** The page's address for one order, with the status-link token when there is one. */ export function returnRequestHref(orderId, token) {
|
|
25
|
+
const query = new URLSearchParams({
|
|
26
|
+
o: orderId
|
|
27
|
+
});
|
|
28
|
+
if (token) query.set('t', token);
|
|
29
|
+
return `/${RETURN_REQUEST_PATH}?${query.toString()}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=return-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/constants/return-request.ts"],"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/**\n * The buyer's \"Request a return\" page (AGL-3611).\n *\n * The component id is persisted in screen documents; never rename it. The\n * path is where the site serves the page when it has no page of its own\n * there, and where the account block and the order-status page link to.\n */\nexport const RETURN_REQUEST_COMPONENT_ID = 'return-request'\n\nexport const RETURN_REQUEST_PATH = 'order-return'\n\n/** The page's address for one order, with the status-link token when there is one. */\nexport function returnRequestHref(orderId: string, token?: string | null): string {\n const query = new URLSearchParams({ o: orderId })\n if (token) query.set('t', token)\n return `/${RETURN_REQUEST_PATH}?${query.toString()}`\n}\n"],"names":["RETURN_REQUEST_COMPONENT_ID","RETURN_REQUEST_PATH","returnRequestHref","orderId","token","query","URLSearchParams","o","set","toString"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;CAMC,GACD,OAAO,MAAMA,8BAA8B,iBAAgB;AAE3D,OAAO,MAAMC,sBAAsB,eAAc;AAEjD,oFAAoF,GACpF,OAAO,SAASC,kBAAkBC,OAAe,EAAEC,KAAqB;IACtE,MAAMC,QAAQ,IAAIC,gBAAgB;QAAEC,GAAGJ;IAAQ;IAC/C,IAAIC,OAAOC,MAAMG,GAAG,CAAC,KAAKJ;IAC1B,OAAO,CAAC,CAAC,EAAEH,oBAAoB,CAAC,EAAEI,MAAMI,QAAQ,IAAI;AACtD"}
|
|
@@ -104,7 +104,8 @@ export const STOCK_MOVEMENT_FILTER_HEADERS = {
|
|
|
104
104
|
restock: 'Restock',
|
|
105
105
|
correction: 'Correction',
|
|
106
106
|
damage: 'Damaged',
|
|
107
|
-
cancellation: 'Order canceled'
|
|
107
|
+
cancellation: 'Order canceled',
|
|
108
|
+
sync: 'Count synced'
|
|
108
109
|
};
|
|
109
110
|
|
|
110
111
|
//# sourceMappingURL=stock-movement-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/constants/stock-movement-query.ts"],"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\nimport type { ListFilterField } from '@aglyn/shared-ui-jsx/const/list-filter'\nimport type { ListQueryDeclaration } from '@aglyn/shared-ui-jsx/const/list-query-plan'\nimport type { InventoryAdjustmentReason } from '../model/commerce'\n\n/*\n * What the stock movements ledger filters by, and how its query serves it\n * (AGL-3321).\n *\n * Every field is one every writer of `hosts/{hostId}/inventoryAdjustments`\n * already stores — the \"Adjust stock\" dialog, the sale path\n * (`decrementVariantStock`) and the cancellation restock — so nothing new is\n * written and nothing needs a backfill. Each is an EQUALITY beneath the\n * ledger's one order, `atMs` newest first, which is one `(field, atMs DESC)`\n * composite per field under index merging; the date filter is a range on\n * `atMs` itself, the order the ledger is already in, so it costs nothing.\n *\n * Order and location are typed or picked ids, matched whole. A sparse field\n * answers `equals` exactly — a row with no order is simply not that order —\n * and offers no \"is set\", which would be an inequality on a second field.\n *\n * No quick search. The ledger's rows name a product by id; the name a reader\n * would type lives on the product, so a search could only ever match the\n * names of the rows already loaded. Product is a picked filter instead, and\n * the ids the old search read (order, location) are filters of their own.\n */\nexport const STOCK_MOVEMENT_FILTER_FIELDS: readonly ListFilterField[] = [\n { column: 'productId', kind: 'exact', path: 'productId', operators: ['equals', 'isAnyOf'] },\n { column: 'reason', kind: 'exact', path: 'reason', operators: ['equals', 'isAnyOf'] },\n { column: 'atMs', kind: 'date', path: 'atMs', storedAs: 'millis', presence: 'always' },\n { column: 'orderId', kind: 'exact', path: 'orderId', operators: ['equals'] },\n { column: 'locationId', kind: 'exact', path: 'locationId', operators: ['equals'] },\n]\n\n/** The ledger's one order: newest first, the order every writer stamps. */\nexport const STOCK_MOVEMENT_QUERY: ListQueryDeclaration = {\n fields: STOCK_MOVEMENT_FILTER_FIELDS,\n sorts: [{ path: 'atMs', direction: 'desc', column: 'atMs' }],\n}\n\nexport const STOCK_MOVEMENT_FILTER_HEADERS: Readonly<Record<string, string>> = {\n productId: 'Product',\n reason: 'Reason',\n atMs: 'When',\n orderId: 'Order',\n locationId: 'Location',\n}\n\n/** The fields picked from choices rather than typed. */\nexport const STOCK_MOVEMENT_SELECT_FIELDS: readonly string[] = ['productId', 'reason', 'locationId']\n\n/** The stored key is a closed set; these are what a merchant reads. */\nexport const STOCK_MOVEMENT_REASON_LABEL: Readonly<Record<InventoryAdjustmentReason, string>> = {\n sale: 'Sale',\n refund: 'Refund return',\n restock: 'Restock',\n correction: 'Correction',\n damage: 'Damaged',\n cancellation: 'Order canceled',\n}\n"],"names":["STOCK_MOVEMENT_FILTER_FIELDS","column","kind","path","operators","storedAs","presence","STOCK_MOVEMENT_QUERY","fields","sorts","direction","STOCK_MOVEMENT_FILTER_HEADERS","productId","reason","atMs","orderId","locationId","STOCK_MOVEMENT_SELECT_FIELDS","STOCK_MOVEMENT_REASON_LABEL","sale","refund","restock","correction","damage","cancellation"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAMD;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,MAAMA,+BAA2D;IACtE;QAAEC,QAAQ;QAAaC,MAAM;QAASC,MAAM;QAAaC,WAAW;YAAC;YAAU;SAAU;IAAC;IAC1F;QAAEH,QAAQ;QAAUC,MAAM;QAASC,MAAM;QAAUC,WAAW;YAAC;YAAU;SAAU;IAAC;IACpF;QAAEH,QAAQ;QAAQC,MAAM;QAAQC,MAAM;QAAQE,UAAU;QAAUC,UAAU;IAAS;IACrF;QAAEL,QAAQ;QAAWC,MAAM;QAASC,MAAM;QAAWC,WAAW;YAAC;SAAS;IAAC;IAC3E;QAAEH,QAAQ;QAAcC,MAAM;QAASC,MAAM;QAAcC,WAAW;YAAC;SAAS;IAAC;CAClF,CAAA;AAED,yEAAyE,GACzE,OAAO,MAAMG,uBAA6C;IACxDC,QAAQR;IACRS,OAAO;QAAC;YAAEN,MAAM;YAAQO,WAAW;YAAQT,QAAQ;QAAO;KAAE;AAC9D,EAAC;AAED,OAAO,MAAMU,gCAAkE;IAC7EC,WAAW;IACXC,QAAQ;IACRC,MAAM;IACNC,SAAS;IACTC,YAAY;AACd,EAAC;AAED,sDAAsD,GACtD,OAAO,MAAMC,+BAAkD;IAAC;IAAa;IAAU;CAAa,CAAA;AAEpG,qEAAqE,GACrE,OAAO,MAAMC,8BAAmF;IAC9FC,MAAM;IACNC,QAAQ;IACRC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,cAAc;
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/constants/stock-movement-query.ts"],"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\nimport type { ListFilterField } from '@aglyn/shared-ui-jsx/const/list-filter'\nimport type { ListQueryDeclaration } from '@aglyn/shared-ui-jsx/const/list-query-plan'\nimport type { InventoryAdjustmentReason } from '../model/commerce'\n\n/*\n * What the stock movements ledger filters by, and how its query serves it\n * (AGL-3321).\n *\n * Every field is one every writer of `hosts/{hostId}/inventoryAdjustments`\n * already stores — the \"Adjust stock\" dialog, the sale path\n * (`decrementVariantStock`) and the cancellation restock — so nothing new is\n * written and nothing needs a backfill. Each is an EQUALITY beneath the\n * ledger's one order, `atMs` newest first, which is one `(field, atMs DESC)`\n * composite per field under index merging; the date filter is a range on\n * `atMs` itself, the order the ledger is already in, so it costs nothing.\n *\n * Order and location are typed or picked ids, matched whole. A sparse field\n * answers `equals` exactly — a row with no order is simply not that order —\n * and offers no \"is set\", which would be an inequality on a second field.\n *\n * No quick search. The ledger's rows name a product by id; the name a reader\n * would type lives on the product, so a search could only ever match the\n * names of the rows already loaded. Product is a picked filter instead, and\n * the ids the old search read (order, location) are filters of their own.\n */\nexport const STOCK_MOVEMENT_FILTER_FIELDS: readonly ListFilterField[] = [\n { column: 'productId', kind: 'exact', path: 'productId', operators: ['equals', 'isAnyOf'] },\n { column: 'reason', kind: 'exact', path: 'reason', operators: ['equals', 'isAnyOf'] },\n { column: 'atMs', kind: 'date', path: 'atMs', storedAs: 'millis', presence: 'always' },\n { column: 'orderId', kind: 'exact', path: 'orderId', operators: ['equals'] },\n { column: 'locationId', kind: 'exact', path: 'locationId', operators: ['equals'] },\n]\n\n/** The ledger's one order: newest first, the order every writer stamps. */\nexport const STOCK_MOVEMENT_QUERY: ListQueryDeclaration = {\n fields: STOCK_MOVEMENT_FILTER_FIELDS,\n sorts: [{ path: 'atMs', direction: 'desc', column: 'atMs' }],\n}\n\nexport const STOCK_MOVEMENT_FILTER_HEADERS: Readonly<Record<string, string>> = {\n productId: 'Product',\n reason: 'Reason',\n atMs: 'When',\n orderId: 'Order',\n locationId: 'Location',\n}\n\n/** The fields picked from choices rather than typed. */\nexport const STOCK_MOVEMENT_SELECT_FIELDS: readonly string[] = ['productId', 'reason', 'locationId']\n\n/** The stored key is a closed set; these are what a merchant reads. */\nexport const STOCK_MOVEMENT_REASON_LABEL: Readonly<Record<InventoryAdjustmentReason, string>> = {\n sale: 'Sale',\n refund: 'Refund return',\n restock: 'Restock',\n correction: 'Correction',\n damage: 'Damaged',\n cancellation: 'Order canceled',\n sync: 'Count synced',\n}\n"],"names":["STOCK_MOVEMENT_FILTER_FIELDS","column","kind","path","operators","storedAs","presence","STOCK_MOVEMENT_QUERY","fields","sorts","direction","STOCK_MOVEMENT_FILTER_HEADERS","productId","reason","atMs","orderId","locationId","STOCK_MOVEMENT_SELECT_FIELDS","STOCK_MOVEMENT_REASON_LABEL","sale","refund","restock","correction","damage","cancellation","sync"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAMD;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,MAAMA,+BAA2D;IACtE;QAAEC,QAAQ;QAAaC,MAAM;QAASC,MAAM;QAAaC,WAAW;YAAC;YAAU;SAAU;IAAC;IAC1F;QAAEH,QAAQ;QAAUC,MAAM;QAASC,MAAM;QAAUC,WAAW;YAAC;YAAU;SAAU;IAAC;IACpF;QAAEH,QAAQ;QAAQC,MAAM;QAAQC,MAAM;QAAQE,UAAU;QAAUC,UAAU;IAAS;IACrF;QAAEL,QAAQ;QAAWC,MAAM;QAASC,MAAM;QAAWC,WAAW;YAAC;SAAS;IAAC;IAC3E;QAAEH,QAAQ;QAAcC,MAAM;QAASC,MAAM;QAAcC,WAAW;YAAC;SAAS;IAAC;CAClF,CAAA;AAED,yEAAyE,GACzE,OAAO,MAAMG,uBAA6C;IACxDC,QAAQR;IACRS,OAAO;QAAC;YAAEN,MAAM;YAAQO,WAAW;YAAQT,QAAQ;QAAO;KAAE;AAC9D,EAAC;AAED,OAAO,MAAMU,gCAAkE;IAC7EC,WAAW;IACXC,QAAQ;IACRC,MAAM;IACNC,SAAS;IACTC,YAAY;AACd,EAAC;AAED,sDAAsD,GACtD,OAAO,MAAMC,+BAAkD;IAAC;IAAa;IAAU;CAAa,CAAA;AAEpG,qEAAqE,GACrE,OAAO,MAAMC,8BAAmF;IAC9FC,MAAM;IACNC,QAAQ;IACRC,SAAS;IACTC,YAAY;IACZC,QAAQ;IACRC,cAAc;IACdC,MAAM;AACR,EAAC"}
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
// registry, not the whole server surface.
|
|
18
18
|
import { registerApiV1SiteResource } from "@aglyn/tenant-data-admin/server/api-v1-resources";
|
|
19
19
|
import { registerPluginPersonEraser } from "@aglyn/aglyn/plugin-manager/plugin-person-erasure";
|
|
20
|
+
import { registerPluginService } from "@aglyn/aglyn/plugin-manager/plugin-services";
|
|
20
21
|
import { BUNDLE_ID } from "./constants/bundle-common.js";
|
|
22
|
+
import { ORDER_HISTORY_CONTRACT } from "./model/order-history.js";
|
|
21
23
|
import { registerCommerceTransferResources } from "./transfer/register-transfer-resources.js";
|
|
22
24
|
/**
|
|
23
25
|
* The commerce plugin's CONSOLE-ONLY server declarations, named under
|
|
@@ -46,6 +48,13 @@ import { registerCommerceTransferResources } from "./transfer/register-transfer-
|
|
|
46
48
|
registerPluginPersonEraser(async (request)=>(await import("./server/person-eraser.js")).commercePersonEraser(request), {
|
|
47
49
|
pluginId: BUNDLE_ID
|
|
48
50
|
});
|
|
51
|
+
// A site's earlier orders, for a plugin that reads history behind the
|
|
52
|
+
// order events (AGL-3614); the reader is loaded with the first page asked.
|
|
53
|
+
registerPluginService(ORDER_HISTORY_CONTRACT, {
|
|
54
|
+
listOrders: async (request)=>(await import("./server/order-history.js")).listOrderHistory(request)
|
|
55
|
+
}, {
|
|
56
|
+
pluginId: BUNDLE_ID
|
|
57
|
+
});
|
|
49
58
|
registerApiV1SiteResource('products', {
|
|
50
59
|
handle: async (...args)=>(await import("./server/api-v1/orders-and-products.js")).handleProducts(...args),
|
|
51
60
|
describe: async ()=>(await import("./server/api-v1/openapi.js")).PRODUCTS_API_V1_DESCRIPTION
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/declarations.console-server.ts"],"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// The registry's own module, not the data layer's barrel: boot needs the\n// registry, not the whole server surface.\nimport { registerApiV1SiteResource } from '@aglyn/tenant-data-admin/server/api-v1-resources'\nimport { registerPluginPersonEraser } from '@aglyn/aglyn/plugin-manager/plugin-person-erasure'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { registerCommerceTransferResources } from './transfer/register-transfer-resources'\n\n/**\n * The commerce plugin's CONSOLE-ONLY server declarations, named under\n * `consoleServerDeclarations` in `plugins.config.json` and run at the\n * console's boot. The tenant runtime registers none of it.\n *\n * It serves a site's products and orders on the customer REST API,\n * `/v1/sites/{siteId}/products/…` and `/v1/sites/{siteId}/orders/…`: the\n * console's router owns the pipeline in front — the key, the plan's API\n * access, the quota, the rate limit, the error envelope — and the site's\n * ownership, and hands every request under each resource here.\n *\n * No plan feature is named on the registrations, though both need\n * `commerce`: the handlers ask the key's scope FIRST and the plan second\n * (AGL-900, AGL-1928), so a key without the scope is told about the scope\n * whatever plan its organization is on, and the router would ask in the\n * opposite order.\n *\n * Light at boot: the handlers are imported with their first request and the\n * descriptions when the document is first built. Registering again replaces\n * this plugin's own entries.\n */\nexport function registerCommerceConsoleServerDeclarations(): void {\n // Commerce's share of a person erasure (AGL-2623, AGL-3080): every order the\n // person placed keeps its amounts, with the buyer taken off it. Required,\n // and loaded with the first erasure.\n registerPluginPersonEraser(\n async (request) => (await import('./server/person-eraser')).commercePersonEraser(request),\n { pluginId: BUNDLE_ID },\n )\n registerApiV1SiteResource(\n 'products',\n {\n handle: async (...args) =>\n (await import('./server/api-v1/orders-and-products')).handleProducts(...args),\n describe: async () =>\n (await import('./server/api-v1/openapi')).PRODUCTS_API_V1_DESCRIPTION,\n },\n { pluginId: BUNDLE_ID },\n )\n registerApiV1SiteResource(\n 'orders',\n {\n handle: async (...args) =>\n (await import('./server/api-v1/orders-and-products')).handleOrders(...args),\n describe: async () =>\n (await import('./server/api-v1/openapi')).ORDERS_API_V1_DESCRIPTION,\n },\n { pluginId: BUNDLE_ID },\n )\n // Products, categories, orders, discounts, coupons and gift cards on the\n // import wizard and the export dialog (AGL-3531): the transfer routes are\n // the console's alone, so they register here.\n registerCommerceTransferResources()\n}\n"],"names":["registerApiV1SiteResource","registerPluginPersonEraser","BUNDLE_ID","registerCommerceTransferResources","registerCommerceConsoleServerDeclarations","request","commercePersonEraser","pluginId","handle","args","handleProducts","describe","PRODUCTS_API_V1_DESCRIPTION","handleOrders","ORDERS_API_V1_DESCRIPTION"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,yEAAyE;AACzE,0CAA0C;AAC1C,SAASA,yBAAyB,QAAQ,mDAAkD;AAC5F,SAASC,0BAA0B,QAAQ,oDAAmD;AAC9F,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,iCAAiC,QAAQ,4CAAwC;AAE1F;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,SAASC;IACd,6EAA6E;IAC7E,0EAA0E;IAC1E,qCAAqC;
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/declarations.console-server.ts"],"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// The registry's own module, not the data layer's barrel: boot needs the\n// registry, not the whole server surface.\nimport { registerApiV1SiteResource } from '@aglyn/tenant-data-admin/server/api-v1-resources'\nimport { registerPluginPersonEraser } from '@aglyn/aglyn/plugin-manager/plugin-person-erasure'\nimport { registerPluginService } from '@aglyn/aglyn/plugin-manager/plugin-services'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { ORDER_HISTORY_CONTRACT } from './model/order-history'\nimport { registerCommerceTransferResources } from './transfer/register-transfer-resources'\n\n/**\n * The commerce plugin's CONSOLE-ONLY server declarations, named under\n * `consoleServerDeclarations` in `plugins.config.json` and run at the\n * console's boot. The tenant runtime registers none of it.\n *\n * It serves a site's products and orders on the customer REST API,\n * `/v1/sites/{siteId}/products/…` and `/v1/sites/{siteId}/orders/…`: the\n * console's router owns the pipeline in front — the key, the plan's API\n * access, the quota, the rate limit, the error envelope — and the site's\n * ownership, and hands every request under each resource here.\n *\n * No plan feature is named on the registrations, though both need\n * `commerce`: the handlers ask the key's scope FIRST and the plan second\n * (AGL-900, AGL-1928), so a key without the scope is told about the scope\n * whatever plan its organization is on, and the router would ask in the\n * opposite order.\n *\n * Light at boot: the handlers are imported with their first request and the\n * descriptions when the document is first built. Registering again replaces\n * this plugin's own entries.\n */\nexport function registerCommerceConsoleServerDeclarations(): void {\n // Commerce's share of a person erasure (AGL-2623, AGL-3080): every order the\n // person placed keeps its amounts, with the buyer taken off it. Required,\n // and loaded with the first erasure.\n registerPluginPersonEraser(\n async (request) => (await import('./server/person-eraser')).commercePersonEraser(request),\n { pluginId: BUNDLE_ID },\n )\n // A site's earlier orders, for a plugin that reads history behind the\n // order events (AGL-3614); the reader is loaded with the first page asked.\n registerPluginService(\n ORDER_HISTORY_CONTRACT,\n { listOrders: async (request) => (await import('./server/order-history')).listOrderHistory(request) },\n { pluginId: BUNDLE_ID },\n )\n registerApiV1SiteResource(\n 'products',\n {\n handle: async (...args) =>\n (await import('./server/api-v1/orders-and-products')).handleProducts(...args),\n describe: async () =>\n (await import('./server/api-v1/openapi')).PRODUCTS_API_V1_DESCRIPTION,\n },\n { pluginId: BUNDLE_ID },\n )\n registerApiV1SiteResource(\n 'orders',\n {\n handle: async (...args) =>\n (await import('./server/api-v1/orders-and-products')).handleOrders(...args),\n describe: async () =>\n (await import('./server/api-v1/openapi')).ORDERS_API_V1_DESCRIPTION,\n },\n { pluginId: BUNDLE_ID },\n )\n // Products, categories, orders, discounts, coupons and gift cards on the\n // import wizard and the export dialog (AGL-3531): the transfer routes are\n // the console's alone, so they register here.\n registerCommerceTransferResources()\n}\n"],"names":["registerApiV1SiteResource","registerPluginPersonEraser","registerPluginService","BUNDLE_ID","ORDER_HISTORY_CONTRACT","registerCommerceTransferResources","registerCommerceConsoleServerDeclarations","request","commercePersonEraser","pluginId","listOrders","listOrderHistory","handle","args","handleProducts","describe","PRODUCTS_API_V1_DESCRIPTION","handleOrders","ORDERS_API_V1_DESCRIPTION"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,yEAAyE;AACzE,0CAA0C;AAC1C,SAASA,yBAAyB,QAAQ,mDAAkD;AAC5F,SAASC,0BAA0B,QAAQ,oDAAmD;AAC9F,SAASC,qBAAqB,QAAQ,8CAA6C;AACnF,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,sBAAsB,QAAQ,2BAAuB;AAC9D,SAASC,iCAAiC,QAAQ,4CAAwC;AAE1F;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,SAASC;IACd,6EAA6E;IAC7E,0EAA0E;IAC1E,qCAAqC;IACrCL,2BACE,OAAOM,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,4BAAwB,EAAGC,oBAAoB,CAACD,UACjF;QAAEE,UAAUN;IAAU;IAExB,sEAAsE;IACtE,2EAA2E;IAC3ED,sBACEE,wBACA;QAAEM,YAAY,OAAOH,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,4BAAwB,EAAGI,gBAAgB,CAACJ;IAAS,GACpG;QAAEE,UAAUN;IAAU;IAExBH,0BACE,YACA;QACEY,QAAQ,OAAO,GAAGC,OAChB,AAAC,CAAA,MAAM,MAAM,CAAC,yCAAqC,EAAGC,cAAc,IAAID;QAC1EE,UAAU,UACR,AAAC,CAAA,MAAM,MAAM,CAAC,6BAAyB,EAAGC,2BAA2B;IACzE,GACA;QAAEP,UAAUN;IAAU;IAExBH,0BACE,UACA;QACEY,QAAQ,OAAO,GAAGC,OAChB,AAAC,CAAA,MAAM,MAAM,CAAC,yCAAqC,EAAGI,YAAY,IAAIJ;QACxEE,UAAU,UACR,AAAC,CAAA,MAAM,MAAM,CAAC,6BAAyB,EAAGG,yBAAyB;IACvE,GACA;QAAET,UAAUN;IAAU;IAExB,yEAAyE;IACzE,0EAA0E;IAC1E,8CAA8C;IAC9CE;AACF"}
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
18
|
* The commerce plugin's server declarations: the light registrations core
|
|
19
|
-
* reads at boot, before any surface loads
|
|
19
|
+
* reads at boot, before any surface loads — among them its orders as a label
|
|
20
|
+
* buyer reads and writes them, through core's `core.shipment-records`.
|
|
20
21
|
*
|
|
21
22
|
* Its operator alerts (AGL-3377), so Staff → Operator alerts lists them and
|
|
22
23
|
* staff can switch them before the first one is ever raised; and the indexes
|
|
@@ -16,12 +16,20 @@
|
|
|
16
16
|
*/ // The seam from its own module, not the plugin-manager barrel: boot needs the
|
|
17
17
|
// registry and nothing else, and the barrel reaches the client contexts.
|
|
18
18
|
import { registerOperatorAlerts } from "@aglyn/aglyn/plugin-manager/operator-alerts";
|
|
19
|
+
import { registerPluginEventHandler } from "@aglyn/aglyn/plugin-manager/plugin-events";
|
|
19
20
|
import { registerPluginRecordIndex } from "@aglyn/aglyn/plugin-manager/plugin-record-index";
|
|
21
|
+
import { registerPluginShipmentRecords } from "@aglyn/aglyn/plugin-manager/plugin-shipment-records";
|
|
22
|
+
import { registerPluginProductCatalog } from "@aglyn/aglyn/plugin-manager/plugin-product-catalog";
|
|
23
|
+
import { registerPluginStockLevels } from "@aglyn/aglyn/plugin-manager/plugin-stock-levels";
|
|
24
|
+
import { registerPluginChannelOrders } from "@aglyn/aglyn/plugin-manager/plugin-channel-orders";
|
|
25
|
+
import { registerPluginProductWriter } from "@aglyn/aglyn/plugin-manager/plugin-product-writer";
|
|
20
26
|
import { BUNDLE_ID } from "./constants/bundle-common.js";
|
|
21
27
|
import { COMMERCE_OPERATOR_ALERTS } from "./constants/operator-alerts.js";
|
|
28
|
+
import { registerCommerceEventTriggers } from "./server/order-event-triggers.js";
|
|
22
29
|
/**
|
|
23
30
|
* The commerce plugin's server declarations: the light registrations core
|
|
24
|
-
* reads at boot, before any surface loads
|
|
31
|
+
* reads at boot, before any surface loads — among them its orders as a label
|
|
32
|
+
* buyer reads and writes them, through core's `core.shipment-records`.
|
|
25
33
|
*
|
|
26
34
|
* Its operator alerts (AGL-3377), so Staff → Operator alerts lists them and
|
|
27
35
|
* staff can switch them before the first one is ever raised; and the indexes
|
|
@@ -31,6 +39,8 @@ import { COMMERCE_OPERATOR_ALERTS } from "./constants/operator-alerts.js";
|
|
|
31
39
|
registerOperatorAlerts(COMMERCE_OPERATOR_ALERTS, {
|
|
32
40
|
pluginId: BUNDLE_ID
|
|
33
41
|
});
|
|
42
|
+
// Its order and return events (AGL-3611), and each as a workflow trigger.
|
|
43
|
+
registerCommerceEventTriggers();
|
|
34
44
|
// Products and categories, as another plugin reads them (AGL-3080). The
|
|
35
45
|
// readers and the Admin SDK arrive with the first read, not with the boot.
|
|
36
46
|
registerPluginRecordIndex('product', lazyIndex('productRecordIndex'), {
|
|
@@ -39,7 +49,64 @@ import { COMMERCE_OPERATOR_ALERTS } from "./constants/operator-alerts.js";
|
|
|
39
49
|
registerPluginRecordIndex('productCategory', lazyIndex('productCategoryRecordIndex'), {
|
|
40
50
|
pluginId: BUNDLE_ID
|
|
41
51
|
});
|
|
52
|
+
// Orders, as a label buyer reads and writes them (AGL-3612): read the
|
|
53
|
+
// lines and the address, write a shipment, record tracking. The module and
|
|
54
|
+
// the Admin SDK load with the first call.
|
|
55
|
+
registerPluginShipmentRecords(lazyShipmentRecords, {
|
|
56
|
+
pluginId: BUNDLE_ID
|
|
57
|
+
});
|
|
58
|
+
// A site's domains as Stripe payment method domains (AGL-3629), so Apple
|
|
59
|
+
// Pay and the other wallets show on the merchant's own domain. The Stripe
|
|
60
|
+
// calls arrive with the first event, not with the boot.
|
|
61
|
+
registerPluginEventHandler('host.domain.attached', async (payload)=>(await import("./server/payment-method-domains.js")).onHostDomainAttached(payload), {
|
|
62
|
+
pluginId: BUNDLE_ID
|
|
63
|
+
});
|
|
64
|
+
registerPluginEventHandler('host.domain.released', async (payload)=>(await import("./server/payment-method-domains.js")).onHostDomainReleased(payload), {
|
|
65
|
+
pluginId: BUNDLE_ID
|
|
66
|
+
});
|
|
67
|
+
// The store's catalog, as a shopping-channel feed reads it (AGL-3637).
|
|
68
|
+
registerPluginProductCatalog(lazyCatalog, {
|
|
69
|
+
pluginId: BUNDLE_ID
|
|
70
|
+
});
|
|
71
|
+
// Counts another warehouse keeps, applied as a stock-take (AGL-3634): a
|
|
72
|
+
// fulfillment network says how many it can ship and the products say so.
|
|
73
|
+
registerPluginStockLevels(lazyStockLevels, {
|
|
74
|
+
pluginId: BUNDLE_ID
|
|
75
|
+
});
|
|
76
|
+
// Products another plugin brings from a source of its own (AGL-3641),
|
|
77
|
+
// written through the store's own rules.
|
|
78
|
+
registerPluginProductWriter(lazyProductWriter, {
|
|
79
|
+
pluginId: BUNDLE_ID
|
|
80
|
+
});
|
|
81
|
+
// Orders a marketplace sold (AGL-3638), recorded as this plugin's own:
|
|
82
|
+
// numbered, their units off the same shelf in the same write, announced.
|
|
83
|
+
registerPluginChannelOrders(lazyChannelOrders, {
|
|
84
|
+
pluginId: BUNDLE_ID
|
|
85
|
+
});
|
|
42
86
|
}
|
|
87
|
+
/** Outside orders, with the Admin SDK and the model arriving on the first call. */ const loadChannelOrders = async ()=>(await import("./server/channel-orders.js")).commerceChannelOrders;
|
|
88
|
+
const lazyChannelOrders = {
|
|
89
|
+
importOrder: async (order)=>(await loadChannelOrders()).importOrder(order),
|
|
90
|
+
cancelOrder: async (request)=>(await loadChannelOrders()).cancelOrder(request),
|
|
91
|
+
recordFees: async (request)=>(await loadChannelOrders()).recordFees(request)
|
|
92
|
+
};
|
|
93
|
+
/** Stock counts, with the Admin SDK and the model arriving on the first call. */ const lazyStockLevels = {
|
|
94
|
+
setAvailable: async (request)=>(await import("./server/stock-levels.js")).commerceStockLevels.setAvailable(request)
|
|
95
|
+
};
|
|
96
|
+
/** The writer, with the Admin SDK and the model arriving on the first write. */ const lazyProductWriter = {
|
|
97
|
+
upsertSourced: async (write)=>(await import("./server/product-writer.js")).commerceProductWriter.upsertSourced(write)
|
|
98
|
+
};
|
|
99
|
+
const loadShipmentRecords = async ()=>(await import("./server/shipment-records.js")).commerceShipmentRecords;
|
|
100
|
+
const lazyShipmentRecords = {
|
|
101
|
+
read: async (hostId, recordId)=>(await loadShipmentRecords()).read(hostId, recordId),
|
|
102
|
+
recordShipment: async (write)=>(await loadShipmentRecords()).recordShipment(write),
|
|
103
|
+
recordTracking: async (update)=>(await loadShipmentRecords()).recordTracking(update),
|
|
104
|
+
shipFromAddresses: async (hostId)=>(await loadShipmentRecords()).shipFromAddresses(hostId)
|
|
105
|
+
};
|
|
106
|
+
/** The catalog, with the Admin SDK and the model arriving on the first read. */ const lazyCatalog = {
|
|
107
|
+
store: async (hostId)=>(await import("./server/product-catalog.js")).productCatalog.store(hostId),
|
|
108
|
+
page: async (request)=>(await import("./server/product-catalog.js")).productCatalog.page(request)
|
|
109
|
+
};
|
|
43
110
|
function lazyIndex(name) {
|
|
44
111
|
const load = async ()=>(await import("./server/product-record-index.js"))[name];
|
|
45
112
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/declarations.server.ts"],"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// The seam from its own module, not the plugin-manager barrel: boot needs the\n// registry and nothing else, and the barrel reaches the client contexts.\nimport { registerOperatorAlerts } from '@aglyn/aglyn/plugin-manager/operator-alerts'\nimport {\n registerPluginRecordIndex,\n type PluginRecordIndex,\n} from '@aglyn/aglyn/plugin-manager/plugin-record-index'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { COMMERCE_OPERATOR_ALERTS } from './constants/operator-alerts'\n\n/**\n * The commerce plugin's server declarations: the light registrations core\n * reads at boot, before any surface loads.\n *\n * Its operator alerts (AGL-3377), so Staff → Operator alerts lists them and\n * staff can switch them before the first one is ever raised; and the indexes\n * of its products and categories, so another plugin reads them without\n * reaching for this plugin's collections.\n */\nexport function registerCommerceServerDeclarations(): void {\n registerOperatorAlerts(COMMERCE_OPERATOR_ALERTS, { pluginId: BUNDLE_ID })\n // Products and categories, as another plugin reads them (AGL-3080). The\n // readers and the Admin SDK arrive with the first read, not with the boot.\n registerPluginRecordIndex('product', lazyIndex('productRecordIndex'), { pluginId: BUNDLE_ID })\n registerPluginRecordIndex('productCategory', lazyIndex('productCategoryRecordIndex'), {\n pluginId: BUNDLE_ID,\n })\n}\n\ntype IndexName = 'productRecordIndex' | 'productCategoryRecordIndex'\n\nfunction lazyIndex(name: IndexName): PluginRecordIndex {\n const load = async () => (await import('./server/product-record-index'))[name]\n return {\n list: async (request) => (await load()).list(request),\n get: async (request) => (await load()).get(request),\n }\n}\n"],"names":["registerOperatorAlerts","registerPluginRecordIndex","BUNDLE_ID","COMMERCE_OPERATOR_ALERTS","registerCommerceServerDeclarations","pluginId","lazyIndex","name","load","list","request","get"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,8EAA8E;AAC9E,yEAAyE;AACzE,SAASA,sBAAsB,QAAQ,8CAA6C;AACpF,SACEC,yBAAyB,QAEpB,kDAAiD;AACxD,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,wBAAwB,QAAQ,iCAA6B;AAEtE;;;;;;;;CAQC,GACD,OAAO,SAASC;IACdJ,uBAAuBG,0BAA0B;QAAEE,UAAUH;IAAU;IACvE,wEAAwE;IACxE,2EAA2E;IAC3ED,0BAA0B,WAAWK,UAAU,uBAAuB;QAAED,UAAUH;IAAU;IAC5FD,0BAA0B,mBAAmBK,UAAU,+BAA+B;QACpFD,UAAUH;IACZ;AACF;AAIA,SAASI,UAAUC,IAAe;IAChC,MAAMC,OAAO,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,mCAA+B,CAAE,CAACD,KAAK;IAC9E,OAAO;QACLE,MAAM,OAAOC,UAAY,AAAC,CAAA,MAAMF,MAAK,EAAGC,IAAI,CAACC;QAC7CC,KAAK,OAAOD,UAAY,AAAC,CAAA,MAAMF,MAAK,EAAGG,GAAG,CAACD;IAC7C;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/plugins/commerce/src/lib/declarations.server.ts"],"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// The seam from its own module, not the plugin-manager barrel: boot needs the\n// registry and nothing else, and the barrel reaches the client contexts.\nimport { registerOperatorAlerts } from '@aglyn/aglyn/plugin-manager/operator-alerts'\nimport { registerPluginEventHandler } from '@aglyn/aglyn/plugin-manager/plugin-events'\nimport {\n registerPluginRecordIndex,\n type PluginRecordIndex,\n} from '@aglyn/aglyn/plugin-manager/plugin-record-index'\nimport {\n registerPluginShipmentRecords,\n type PluginShipmentRecords,\n} from '@aglyn/aglyn/plugin-manager/plugin-shipment-records'\nimport {\n registerPluginProductCatalog,\n type PluginProductCatalog,\n} from '@aglyn/aglyn/plugin-manager/plugin-product-catalog'\nimport {\n registerPluginStockLevels,\n type PluginStockLevels,\n} from '@aglyn/aglyn/plugin-manager/plugin-stock-levels'\nimport {\n registerPluginChannelOrders,\n type PluginChannelOrders,\n} from '@aglyn/aglyn/plugin-manager/plugin-channel-orders'\nimport {\n registerPluginProductWriter,\n type PluginProductWriter,\n} from '@aglyn/aglyn/plugin-manager/plugin-product-writer'\nimport { BUNDLE_ID } from './constants/bundle-common'\nimport { COMMERCE_OPERATOR_ALERTS } from './constants/operator-alerts'\nimport { registerCommerceEventTriggers } from './server/order-event-triggers'\n\n/**\n * The commerce plugin's server declarations: the light registrations core\n * reads at boot, before any surface loads — among them its orders as a label\n * buyer reads and writes them, through core's `core.shipment-records`.\n *\n * Its operator alerts (AGL-3377), so Staff → Operator alerts lists them and\n * staff can switch them before the first one is ever raised; and the indexes\n * of its products and categories, so another plugin reads them without\n * reaching for this plugin's collections.\n */\nexport function registerCommerceServerDeclarations(): void {\n registerOperatorAlerts(COMMERCE_OPERATOR_ALERTS, { pluginId: BUNDLE_ID })\n // Its order and return events (AGL-3611), and each as a workflow trigger.\n registerCommerceEventTriggers()\n // Products and categories, as another plugin reads them (AGL-3080). The\n // readers and the Admin SDK arrive with the first read, not with the boot.\n registerPluginRecordIndex('product', lazyIndex('productRecordIndex'), { pluginId: BUNDLE_ID })\n registerPluginRecordIndex('productCategory', lazyIndex('productCategoryRecordIndex'), {\n pluginId: BUNDLE_ID,\n })\n // Orders, as a label buyer reads and writes them (AGL-3612): read the\n // lines and the address, write a shipment, record tracking. The module and\n // the Admin SDK load with the first call.\n registerPluginShipmentRecords(lazyShipmentRecords, { pluginId: BUNDLE_ID })\n // A site's domains as Stripe payment method domains (AGL-3629), so Apple\n // Pay and the other wallets show on the merchant's own domain. The Stripe\n // calls arrive with the first event, not with the boot.\n registerPluginEventHandler(\n 'host.domain.attached',\n async (payload) =>\n (await import('./server/payment-method-domains')).onHostDomainAttached(payload),\n { pluginId: BUNDLE_ID },\n )\n registerPluginEventHandler(\n 'host.domain.released',\n async (payload) =>\n (await import('./server/payment-method-domains')).onHostDomainReleased(payload),\n { pluginId: BUNDLE_ID },\n )\n // The store's catalog, as a shopping-channel feed reads it (AGL-3637).\n registerPluginProductCatalog(lazyCatalog, { pluginId: BUNDLE_ID })\n // Counts another warehouse keeps, applied as a stock-take (AGL-3634): a\n // fulfillment network says how many it can ship and the products say so.\n registerPluginStockLevels(lazyStockLevels, { pluginId: BUNDLE_ID })\n // Products another plugin brings from a source of its own (AGL-3641),\n // written through the store's own rules.\n registerPluginProductWriter(lazyProductWriter, { pluginId: BUNDLE_ID })\n // Orders a marketplace sold (AGL-3638), recorded as this plugin's own:\n // numbered, their units off the same shelf in the same write, announced.\n registerPluginChannelOrders(lazyChannelOrders, { pluginId: BUNDLE_ID })\n}\n\n/** Outside orders, with the Admin SDK and the model arriving on the first call. */\nconst loadChannelOrders = async () => (await import('./server/channel-orders')).commerceChannelOrders\n\nconst lazyChannelOrders: PluginChannelOrders = {\n importOrder: async (order) => (await loadChannelOrders()).importOrder(order),\n cancelOrder: async (request) => (await loadChannelOrders()).cancelOrder(request),\n recordFees: async (request) => (await loadChannelOrders()).recordFees(request),\n}\n\n/** Stock counts, with the Admin SDK and the model arriving on the first call. */\nconst lazyStockLevels: PluginStockLevels = {\n setAvailable: async (request) => (await import('./server/stock-levels')).commerceStockLevels.setAvailable(request),\n}\n\n/** The writer, with the Admin SDK and the model arriving on the first write. */\nconst lazyProductWriter: PluginProductWriter = {\n upsertSourced: async (write) => (await import('./server/product-writer')).commerceProductWriter.upsertSourced(write),\n}\n\nconst loadShipmentRecords = async () =>\n (await import('./server/shipment-records')).commerceShipmentRecords\n\nconst lazyShipmentRecords: PluginShipmentRecords = {\n read: async (hostId, recordId) => (await loadShipmentRecords()).read(hostId, recordId),\n recordShipment: async (write) => (await loadShipmentRecords()).recordShipment(write),\n recordTracking: async (update) => (await loadShipmentRecords()).recordTracking(update),\n shipFromAddresses: async (hostId) => (await loadShipmentRecords()).shipFromAddresses(hostId),\n}\n\n/** The catalog, with the Admin SDK and the model arriving on the first read. */\nconst lazyCatalog: PluginProductCatalog = {\n store: async (hostId) => (await import('./server/product-catalog')).productCatalog.store(hostId),\n page: async (request) => (await import('./server/product-catalog')).productCatalog.page(request),\n}\n\ntype IndexName = 'productRecordIndex' | 'productCategoryRecordIndex'\n\nfunction lazyIndex(name: IndexName): PluginRecordIndex {\n const load = async () => (await import('./server/product-record-index'))[name]\n return {\n list: async (request) => (await load()).list(request),\n get: async (request) => (await load()).get(request),\n }\n}\n"],"names":["registerOperatorAlerts","registerPluginEventHandler","registerPluginRecordIndex","registerPluginShipmentRecords","registerPluginProductCatalog","registerPluginStockLevels","registerPluginChannelOrders","registerPluginProductWriter","BUNDLE_ID","COMMERCE_OPERATOR_ALERTS","registerCommerceEventTriggers","registerCommerceServerDeclarations","pluginId","lazyIndex","lazyShipmentRecords","payload","onHostDomainAttached","onHostDomainReleased","lazyCatalog","lazyStockLevels","lazyProductWriter","lazyChannelOrders","loadChannelOrders","commerceChannelOrders","importOrder","order","cancelOrder","request","recordFees","setAvailable","commerceStockLevels","upsertSourced","write","commerceProductWriter","loadShipmentRecords","commerceShipmentRecords","read","hostId","recordId","recordShipment","recordTracking","update","shipFromAddresses","store","productCatalog","page","name","load","list","get"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,8EAA8E;AAC9E,yEAAyE;AACzE,SAASA,sBAAsB,QAAQ,8CAA6C;AACpF,SAASC,0BAA0B,QAAQ,4CAA2C;AACtF,SACEC,yBAAyB,QAEpB,kDAAiD;AACxD,SACEC,6BAA6B,QAExB,sDAAqD;AAC5D,SACEC,4BAA4B,QAEvB,qDAAoD;AAC3D,SACEC,yBAAyB,QAEpB,kDAAiD;AACxD,SACEC,2BAA2B,QAEtB,oDAAmD;AAC1D,SACEC,2BAA2B,QAEtB,oDAAmD;AAC1D,SAASC,SAAS,QAAQ,+BAA2B;AACrD,SAASC,wBAAwB,QAAQ,iCAA6B;AACtE,SAASC,6BAA6B,QAAQ,mCAA+B;AAE7E;;;;;;;;;CASC,GACD,OAAO,SAASC;IACdX,uBAAuBS,0BAA0B;QAAEG,UAAUJ;IAAU;IACvE,0EAA0E;IAC1EE;IACA,wEAAwE;IACxE,2EAA2E;IAC3ER,0BAA0B,WAAWW,UAAU,uBAAuB;QAAED,UAAUJ;IAAU;IAC5FN,0BAA0B,mBAAmBW,UAAU,+BAA+B;QACpFD,UAAUJ;IACZ;IACA,sEAAsE;IACtE,2EAA2E;IAC3E,0CAA0C;IAC1CL,8BAA8BW,qBAAqB;QAAEF,UAAUJ;IAAU;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,wDAAwD;IACxDP,2BACE,wBACA,OAAOc,UACL,AAAC,CAAA,MAAM,MAAM,CAAC,qCAAiC,EAAGC,oBAAoB,CAACD,UACzE;QAAEH,UAAUJ;IAAU;IAExBP,2BACE,wBACA,OAAOc,UACL,AAAC,CAAA,MAAM,MAAM,CAAC,qCAAiC,EAAGE,oBAAoB,CAACF,UACzE;QAAEH,UAAUJ;IAAU;IAExB,uEAAuE;IACvEJ,6BAA6Bc,aAAa;QAAEN,UAAUJ;IAAU;IAChE,wEAAwE;IACxE,yEAAyE;IACzEH,0BAA0Bc,iBAAiB;QAAEP,UAAUJ;IAAU;IACjE,sEAAsE;IACtE,yCAAyC;IACzCD,4BAA4Ba,mBAAmB;QAAER,UAAUJ;IAAU;IACrE,uEAAuE;IACvE,yEAAyE;IACzEF,4BAA4Be,mBAAmB;QAAET,UAAUJ;IAAU;AACvE;AAEA,iFAAiF,GACjF,MAAMc,oBAAoB,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,6BAAyB,EAAGC,qBAAqB;AAErG,MAAMF,oBAAyC;IAC7CG,aAAa,OAAOC,QAAU,AAAC,CAAA,MAAMH,mBAAkB,EAAGE,WAAW,CAACC;IACtEC,aAAa,OAAOC,UAAY,AAAC,CAAA,MAAML,mBAAkB,EAAGI,WAAW,CAACC;IACxEC,YAAY,OAAOD,UAAY,AAAC,CAAA,MAAML,mBAAkB,EAAGM,UAAU,CAACD;AACxE;AAEA,+EAA+E,GAC/E,MAAMR,kBAAqC;IACzCU,cAAc,OAAOF,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,2BAAuB,EAAGG,mBAAmB,CAACD,YAAY,CAACF;AAC5G;AAEA,8EAA8E,GAC9E,MAAMP,oBAAyC;IAC7CW,eAAe,OAAOC,QAAU,AAAC,CAAA,MAAM,MAAM,CAAC,6BAAyB,EAAGC,qBAAqB,CAACF,aAAa,CAACC;AAChH;AAEA,MAAME,sBAAsB,UAC1B,AAAC,CAAA,MAAM,MAAM,CAAC,+BAA2B,EAAGC,uBAAuB;AAErE,MAAMrB,sBAA6C;IACjDsB,MAAM,OAAOC,QAAQC,WAAa,AAAC,CAAA,MAAMJ,qBAAoB,EAAGE,IAAI,CAACC,QAAQC;IAC7EC,gBAAgB,OAAOP,QAAU,AAAC,CAAA,MAAME,qBAAoB,EAAGK,cAAc,CAACP;IAC9EQ,gBAAgB,OAAOC,SAAW,AAAC,CAAA,MAAMP,qBAAoB,EAAGM,cAAc,CAACC;IAC/EC,mBAAmB,OAAOL,SAAW,AAAC,CAAA,MAAMH,qBAAoB,EAAGQ,iBAAiB,CAACL;AACvF;AAEA,8EAA8E,GAC9E,MAAMnB,cAAoC;IACxCyB,OAAO,OAAON,SAAW,AAAC,CAAA,MAAM,MAAM,CAAC,8BAA0B,EAAGO,cAAc,CAACD,KAAK,CAACN;IACzFQ,MAAM,OAAOlB,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,8BAA0B,EAAGiB,cAAc,CAACC,IAAI,CAAClB;AAC1F;AAIA,SAASd,UAAUiC,IAAe;IAChC,MAAMC,OAAO,UAAY,AAAC,CAAA,MAAM,MAAM,CAAC,mCAA+B,CAAE,CAACD,KAAK;IAC9E,OAAO;QACLE,MAAM,OAAOrB,UAAY,AAAC,CAAA,MAAMoB,MAAK,EAAGC,IAAI,CAACrB;QAC7CsB,KAAK,OAAOtB,UAAY,AAAC,CAAA,MAAMoB,MAAK,EAAGE,GAAG,CAACtB;IAC7C;AACF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* What a store tells its buyer, and when (AGL-3610).
|
|
19
|
+
*
|
|
20
|
+
* Five moments in an order's life each send the buyer one message: the
|
|
21
|
+
* receipt, each shipment, delivery, each refund and a cancellation. A store
|
|
22
|
+
* turns any of them off on `hosts/{hostId}/settings/store.buyerNotifications`
|
|
23
|
+
* — and ONLY off: every moment is ON unless an explicit `false` is stored,
|
|
24
|
+
* because transaction messages are on by default for every store, existing
|
|
25
|
+
* and new (the 2026-10-06 decision AGL-3600 implemented for the owner's own
|
|
26
|
+
* notices). An absent map, an absent key and a malformed value all read as
|
|
27
|
+
* on, so a schema slip can never silence a store's receipts.
|
|
28
|
+
*
|
|
29
|
+
* `texts` is the channel switch rather than a moment: when the platform can
|
|
30
|
+
* send texts and the order carries the buyer's phone number, each moment that
|
|
31
|
+
* is on also goes by text unless the store turned texts off.
|
|
32
|
+
*/
|
|
33
|
+
export declare const BUYER_NOTIFICATION_EVENTS: readonly ["receipt", "shipped", "delivered", "refunded", "cancelled"];
|
|
34
|
+
export type BuyerNotificationEvent = (typeof BUYER_NOTIFICATION_EVENTS)[number];
|
|
35
|
+
export type BuyerNotificationChannel = 'email' | 'sms';
|
|
36
|
+
export type BuyerNotificationSettings = Partial<Record<BuyerNotificationEvent | 'texts', boolean>>;
|
|
37
|
+
/** The designable email each moment sends: keys in `tenant-emails.ts`. */
|
|
38
|
+
export declare const BUYER_NOTIFICATION_EMAIL_KEYS: Readonly<Record<BuyerNotificationEvent, string>>;
|
|
39
|
+
/** How the store settings card names each moment. */
|
|
40
|
+
export declare const BUYER_NOTIFICATION_LABELS: Readonly<Record<BuyerNotificationEvent, {
|
|
41
|
+
label: string;
|
|
42
|
+
description: string;
|
|
43
|
+
}>>;
|
|
44
|
+
/** Whether a moment (or the `texts` channel) is on. Only `false` is off. */
|
|
45
|
+
export declare function buyerNotificationEnabled(settings: unknown, key: BuyerNotificationEvent | 'texts'): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The idempotency key for one message: which moment, which occurrence of it
|
|
48
|
+
* (a shipment id, a refund id; `order` for the once-per-order moments) and
|
|
49
|
+
* which channel. Stored as a field name under `buyerNotifications` on the
|
|
50
|
+
* order, so it is restricted to characters a Firestore field path takes
|
|
51
|
+
* without quoting.
|
|
52
|
+
*/
|
|
53
|
+
export declare function buyerNotificationMarker(event: BuyerNotificationEvent, occurrence: string, channel: BuyerNotificationChannel): string;
|
|
54
|
+
/**
|
|
55
|
+
* Formats integer cents in the store's currency. Falls back to a plain dollar
|
|
56
|
+
* figure for a currency code `Intl` does not know, rather than throwing on a
|
|
57
|
+
* stored typo.
|
|
58
|
+
*/
|
|
59
|
+
export declare function formatOrderMoney(cents: number, currency?: string): string;
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
* What a store tells its buyer, and when (AGL-3610).
|
|
18
|
+
*
|
|
19
|
+
* Five moments in an order's life each send the buyer one message: the
|
|
20
|
+
* receipt, each shipment, delivery, each refund and a cancellation. A store
|
|
21
|
+
* turns any of them off on `hosts/{hostId}/settings/store.buyerNotifications`
|
|
22
|
+
* — and ONLY off: every moment is ON unless an explicit `false` is stored,
|
|
23
|
+
* because transaction messages are on by default for every store, existing
|
|
24
|
+
* and new (the 2026-10-06 decision AGL-3600 implemented for the owner's own
|
|
25
|
+
* notices). An absent map, an absent key and a malformed value all read as
|
|
26
|
+
* on, so a schema slip can never silence a store's receipts.
|
|
27
|
+
*
|
|
28
|
+
* `texts` is the channel switch rather than a moment: when the platform can
|
|
29
|
+
* send texts and the order carries the buyer's phone number, each moment that
|
|
30
|
+
* is on also goes by text unless the store turned texts off.
|
|
31
|
+
*/ export const BUYER_NOTIFICATION_EVENTS = [
|
|
32
|
+
'receipt',
|
|
33
|
+
'shipped',
|
|
34
|
+
'delivered',
|
|
35
|
+
'refunded',
|
|
36
|
+
'cancelled'
|
|
37
|
+
];
|
|
38
|
+
/** The designable email each moment sends: keys in `tenant-emails.ts`. */ export const BUYER_NOTIFICATION_EMAIL_KEYS = {
|
|
39
|
+
receipt: 'order-receipt',
|
|
40
|
+
shipped: 'order-shipped',
|
|
41
|
+
delivered: 'order-delivered',
|
|
42
|
+
refunded: 'order-refunded',
|
|
43
|
+
cancelled: 'order-cancelled'
|
|
44
|
+
};
|
|
45
|
+
/** How the store settings card names each moment. */ export const BUYER_NOTIFICATION_LABELS = {
|
|
46
|
+
receipt: {
|
|
47
|
+
label: 'Order receipt',
|
|
48
|
+
description: 'When an order is paid: online, from a payment link, or at the register when the customer gives an email.'
|
|
49
|
+
},
|
|
50
|
+
shipped: {
|
|
51
|
+
label: 'Order shipped',
|
|
52
|
+
description: 'Each time you ship part or all of an order, with the carrier and tracking link.'
|
|
53
|
+
},
|
|
54
|
+
delivered: {
|
|
55
|
+
label: 'Order delivered',
|
|
56
|
+
description: 'When you mark an order delivered.'
|
|
57
|
+
},
|
|
58
|
+
refunded: {
|
|
59
|
+
label: 'Refund issued',
|
|
60
|
+
description: 'Each refund, with the amount and any items you named.'
|
|
61
|
+
},
|
|
62
|
+
cancelled: {
|
|
63
|
+
label: 'Order canceled',
|
|
64
|
+
description: 'When you cancel an order.'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/** Whether a moment (or the `texts` channel) is on. Only `false` is off. */ export function buyerNotificationEnabled(settings, key) {
|
|
68
|
+
if (!settings || typeof settings !== 'object') return true;
|
|
69
|
+
return settings[key] !== false;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The idempotency key for one message: which moment, which occurrence of it
|
|
73
|
+
* (a shipment id, a refund id; `order` for the once-per-order moments) and
|
|
74
|
+
* which channel. Stored as a field name under `buyerNotifications` on the
|
|
75
|
+
* order, so it is restricted to characters a Firestore field path takes
|
|
76
|
+
* without quoting.
|
|
77
|
+
*/ export function buyerNotificationMarker(event, occurrence, channel) {
|
|
78
|
+
const safe = (value)=>String(value || 'order').replace(/[^A-Za-z0-9_-]/g, '_').slice(0, 120);
|
|
79
|
+
return `${event}__${safe(occurrence)}__${channel}`;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Formats integer cents in the store's currency. Falls back to a plain dollar
|
|
83
|
+
* figure for a currency code `Intl` does not know, rather than throwing on a
|
|
84
|
+
* stored typo.
|
|
85
|
+
*/ export function formatOrderMoney(cents, currency = 'USD') {
|
|
86
|
+
const amount = (Number(cents) || 0) / 100;
|
|
87
|
+
try {
|
|
88
|
+
return new Intl.NumberFormat('en-US', {
|
|
89
|
+
style: 'currency',
|
|
90
|
+
currency: String(currency || 'USD').toUpperCase()
|
|
91
|
+
}).format(amount);
|
|
92
|
+
} catch (unused) {
|
|
93
|
+
return `$${amount.toFixed(2)}`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=buyer-notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/model/buyer-notifications.ts"],"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/**\n * What a store tells its buyer, and when (AGL-3610).\n *\n * Five moments in an order's life each send the buyer one message: the\n * receipt, each shipment, delivery, each refund and a cancellation. A store\n * turns any of them off on `hosts/{hostId}/settings/store.buyerNotifications`\n * — and ONLY off: every moment is ON unless an explicit `false` is stored,\n * because transaction messages are on by default for every store, existing\n * and new (the 2026-10-06 decision AGL-3600 implemented for the owner's own\n * notices). An absent map, an absent key and a malformed value all read as\n * on, so a schema slip can never silence a store's receipts.\n *\n * `texts` is the channel switch rather than a moment: when the platform can\n * send texts and the order carries the buyer's phone number, each moment that\n * is on also goes by text unless the store turned texts off.\n */\nexport const BUYER_NOTIFICATION_EVENTS = [\n 'receipt',\n 'shipped',\n 'delivered',\n 'refunded',\n 'cancelled',\n] as const\n\nexport type BuyerNotificationEvent = (typeof BUYER_NOTIFICATION_EVENTS)[number]\n\nexport type BuyerNotificationChannel = 'email' | 'sms'\n\nexport type BuyerNotificationSettings = Partial<\n Record<BuyerNotificationEvent | 'texts', boolean>\n>\n\n/** The designable email each moment sends: keys in `tenant-emails.ts`. */\nexport const BUYER_NOTIFICATION_EMAIL_KEYS: Readonly<\n Record<BuyerNotificationEvent, string>\n> = {\n receipt: 'order-receipt',\n shipped: 'order-shipped',\n delivered: 'order-delivered',\n refunded: 'order-refunded',\n cancelled: 'order-cancelled',\n}\n\n/** How the store settings card names each moment. */\nexport const BUYER_NOTIFICATION_LABELS: Readonly<\n Record<BuyerNotificationEvent, { label: string; description: string }>\n> = {\n receipt: {\n label: 'Order receipt',\n description:\n 'When an order is paid: online, from a payment link, or at the register when the customer gives an email.',\n },\n shipped: {\n label: 'Order shipped',\n description:\n 'Each time you ship part or all of an order, with the carrier and tracking link.',\n },\n delivered: {\n label: 'Order delivered',\n description: 'When you mark an order delivered.',\n },\n refunded: {\n label: 'Refund issued',\n description: 'Each refund, with the amount and any items you named.',\n },\n cancelled: {\n label: 'Order canceled',\n description: 'When you cancel an order.',\n },\n}\n\n/** Whether a moment (or the `texts` channel) is on. Only `false` is off. */\nexport function buyerNotificationEnabled(\n settings: unknown,\n key: BuyerNotificationEvent | 'texts',\n): boolean {\n if (!settings || typeof settings !== 'object') return true\n return (settings as Record<string, unknown>)[key] !== false\n}\n\n/**\n * The idempotency key for one message: which moment, which occurrence of it\n * (a shipment id, a refund id; `order` for the once-per-order moments) and\n * which channel. Stored as a field name under `buyerNotifications` on the\n * order, so it is restricted to characters a Firestore field path takes\n * without quoting.\n */\nexport function buyerNotificationMarker(\n event: BuyerNotificationEvent,\n occurrence: string,\n channel: BuyerNotificationChannel,\n): string {\n const safe = (value: string) =>\n String(value || 'order')\n .replace(/[^A-Za-z0-9_-]/g, '_')\n .slice(0, 120)\n return `${event}__${safe(occurrence)}__${channel}`\n}\n\n/**\n * Formats integer cents in the store's currency. Falls back to a plain dollar\n * figure for a currency code `Intl` does not know, rather than throwing on a\n * stored typo.\n */\nexport function formatOrderMoney(cents: number, currency = 'USD'): string {\n const amount = (Number(cents) || 0) / 100\n try {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency: String(currency || 'USD').toUpperCase(),\n }).format(amount)\n } catch {\n return `$${amount.toFixed(2)}`\n }\n}\n"],"names":["BUYER_NOTIFICATION_EVENTS","BUYER_NOTIFICATION_EMAIL_KEYS","receipt","shipped","delivered","refunded","cancelled","BUYER_NOTIFICATION_LABELS","label","description","buyerNotificationEnabled","settings","key","buyerNotificationMarker","event","occurrence","channel","safe","value","String","replace","slice","formatOrderMoney","cents","currency","amount","Number","Intl","NumberFormat","style","toUpperCase","format","toFixed"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;CAeC,GACD,OAAO,MAAMA,4BAA4B;IACvC;IACA;IACA;IACA;IACA;CACD,CAAS;AAUV,wEAAwE,GACxE,OAAO,MAAMC,gCAET;IACFC,SAAS;IACTC,SAAS;IACTC,WAAW;IACXC,UAAU;IACVC,WAAW;AACb,EAAC;AAED,mDAAmD,GACnD,OAAO,MAAMC,4BAET;IACFL,SAAS;QACPM,OAAO;QACPC,aACE;IACJ;IACAN,SAAS;QACPK,OAAO;QACPC,aACE;IACJ;IACAL,WAAW;QACTI,OAAO;QACPC,aAAa;IACf;IACAJ,UAAU;QACRG,OAAO;QACPC,aAAa;IACf;IACAH,WAAW;QACTE,OAAO;QACPC,aAAa;IACf;AACF,EAAC;AAED,0EAA0E,GAC1E,OAAO,SAASC,yBACdC,QAAiB,EACjBC,GAAqC;IAErC,IAAI,CAACD,YAAY,OAAOA,aAAa,UAAU,OAAO;IACtD,OAAO,AAACA,QAAoC,CAACC,IAAI,KAAK;AACxD;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,wBACdC,KAA6B,EAC7BC,UAAkB,EAClBC,OAAiC;IAEjC,MAAMC,OAAO,CAACC,QACZC,OAAOD,SAAS,SACbE,OAAO,CAAC,mBAAmB,KAC3BC,KAAK,CAAC,GAAG;IACd,OAAO,GAAGP,MAAM,EAAE,EAAEG,KAAKF,YAAY,EAAE,EAAEC,SAAS;AACpD;AAEA;;;;CAIC,GACD,OAAO,SAASM,iBAAiBC,KAAa,EAAEC,WAAW,KAAK;IAC9D,MAAMC,SAAS,AAACC,CAAAA,OAAOH,UAAU,CAAA,IAAK;IACtC,IAAI;QACF,OAAO,IAAII,KAAKC,YAAY,CAAC,SAAS;YACpCC,OAAO;YACPL,UAAUL,OAAOK,YAAY,OAAOM,WAAW;QACjD,GAAGC,MAAM,CAACN;IACZ,EAAE,eAAM;QACN,OAAO,CAAC,CAAC,EAAEA,OAAOO,OAAO,CAAC,IAAI;IAChC;AACF"}
|