@shopify/ui-extensions 2026.10.0-rc.9 → 2026.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/surfaces/customer-account/preact/authenticated-account.js +1 -1
- package/build/cjs/surfaces/point-of-sale/events.js +39 -22
- package/build/cjs/surfaces/point-of-sale/pos-list-template.js +339 -0
- package/build/cjs/surfaces/point-of-sale.js +2 -0
- package/build/esm/surfaces/customer-account/preact/authenticated-account.mjs +1 -1
- package/build/esm/surfaces/point-of-sale/events.mjs +39 -22
- package/build/esm/surfaces/point-of-sale/pos-list-template.mjs +331 -0
- package/build/esm/surfaces/point-of-sale.mjs +1 -0
- package/build/esnext/surfaces/customer-account/preact/authenticated-account.esnext +1 -1
- package/build/esnext/surfaces/point-of-sale/events.esnext +39 -22
- package/build/esnext/surfaces/point-of-sale/pos-list-template.esnext +331 -0
- package/build/esnext/surfaces/point-of-sale.esnext +1 -0
- package/build/ts/shared.d.ts +6 -20
- package/build/ts/shared.d.ts.map +1 -1
- package/build/ts/surfaces/admin/api/picker/picker.d.ts +2 -2
- package/build/ts/surfaces/admin/api/picker/picker.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/AdminAction.d.ts +2 -2
- package/build/ts/surfaces/admin/components/AdminBlock.d.ts +3 -3
- package/build/ts/surfaces/admin/components/AdminPrintAction.d.ts +2 -2
- package/build/ts/surfaces/admin/components/AppNav.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Avatar.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Badge.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Banner.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Box.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Button.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ButtonGroup.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Checkbox.d.ts +3 -3
- package/build/ts/surfaces/admin/components/Chip.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Choice.d.ts +3 -3
- package/build/ts/surfaces/admin/components/ChoiceList.d.ts +3 -3
- package/build/ts/surfaces/admin/components/Clickable.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ClickableChip.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ColorField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ColorPicker.d.ts +1 -1
- package/build/ts/surfaces/admin/components/DateField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/DatePicker.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Divider.d.ts +1 -1
- package/build/ts/surfaces/admin/components/DropZone.d.ts +1 -1
- package/build/ts/surfaces/admin/components/EmailField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/EmptyState.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Form.d.ts +1 -1
- package/build/ts/surfaces/admin/components/FunctionSettings.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Grid.d.ts +1 -1
- package/build/ts/surfaces/admin/components/GridItem.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Heading.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Icon.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Image.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Link.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ListItem.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Menu.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Modal.d.ts +1 -1
- package/build/ts/surfaces/admin/components/MoneyField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Number.d.ts +1 -1
- package/build/ts/surfaces/admin/components/NumberField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Option.d.ts +3 -3
- package/build/ts/surfaces/admin/components/OptionGroup.d.ts +1 -1
- package/build/ts/surfaces/admin/components/OrderedList.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Page.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Paragraph.d.ts +1 -1
- package/build/ts/surfaces/admin/components/PasswordField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Popover.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Progress.d.ts +155 -0
- package/build/ts/surfaces/admin/components/QueryContainer.d.ts +1 -1
- package/build/ts/surfaces/admin/components/SearchField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Section.d.ts +11 -3
- package/build/ts/surfaces/admin/components/Select.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Spinner.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Stack.d.ts +1 -1
- package/build/ts/surfaces/admin/components/StandardComponents.d.ts +1 -1
- package/build/ts/surfaces/admin/components/StandardComponents.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Switch.d.ts +3 -3
- package/build/ts/surfaces/admin/components/Table.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableBody.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableCell.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableHeader.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableHeaderRow.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableRow.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Text.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TextArea.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TextField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Thumbnail.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Tooltip.d.ts +1 -1
- package/build/ts/surfaces/admin/components/URLField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/UnorderedList.d.ts +1 -1
- package/build/ts/surfaces/admin/components/shared.d.ts +47 -7
- package/build/ts/surfaces/admin/targets/admin.abandoned-checkout-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.abandoned-checkout-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.abandoned-checkout-index.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.app.home.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.app.intent.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.catalog-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.catalog-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.collection-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.collection-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.collection-index.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.company-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.company-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.company-location-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.customer-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.customer-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.customer-index.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.customer-index.selection-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.customer-segment-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.discount-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.discount-details.function-settings.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.discount-index.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.discount-index.selection-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.draft-order-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.draft-order-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.draft-order-index.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.draft-order-index.selection-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.gift-card-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.gift-card-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.order-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.order-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.order-details.print-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.order-fulfilled-card.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.order-index.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.order-index.selection-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.order-index.selection-print-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.configuration.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.print-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-details.reorder.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-index.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-index.selection-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-index.selection-print-action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-purchase-option.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.block.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.configuration.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.product-variant-purchase-option.action.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.settings.internal-order-routing-rule.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.settings.order-routing-rule.render.d.ts +3 -0
- package/build/ts/surfaces/admin/targets/admin.settings.validation.render.d.ts +3 -0
- package/build/ts/surfaces/checkout/api/address-autocomplete/format-suggestion.d.ts +7 -0
- package/build/ts/surfaces/checkout/api/address-autocomplete/format-suggestion.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/address-autocomplete/shared.d.ts +8 -1
- package/build/ts/surfaces/checkout/api/address-autocomplete/shared.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/address-autocomplete/standard.d.ts +2 -2
- package/build/ts/surfaces/checkout/api/address-autocomplete/standard.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/address-autocomplete/suggest.d.ts +7 -0
- package/build/ts/surfaces/checkout/api/address-autocomplete/suggest.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts +15 -4
- package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/redeemable/redeemable.d.ts +1 -1
- package/build/ts/surfaces/checkout/api/shared.d.ts +108 -1
- package/build/ts/surfaces/checkout/api/shared.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts +8 -4
- package/build/ts/surfaces/checkout/api/standard/standard.d.ts.map +1 -1
- package/build/ts/surfaces/checkout/components/MoneyField.d.ts +3 -1
- package/build/ts/surfaces/checkout/components/NumberField.d.ts +3 -1
- package/build/ts/surfaces/checkout/components/components-shared.d.ts +1 -1
- package/build/ts/surfaces/checkout/preact/country.d.ts +1 -1
- package/build/ts/surfaces/checkout/preact/country.d.ts.map +1 -1
- package/build/ts/surfaces/checkout.d.ts +2 -2
- package/build/ts/surfaces/checkout.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api/order-status/order-status.d.ts +1 -1
- package/build/ts/surfaces/customer-account/api/shared.d.ts +26 -7
- package/build/ts/surfaces/customer-account/api/shared.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/api.d.ts +1 -1
- package/build/ts/surfaces/customer-account/api.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/components/MoneyField.d.ts +3 -1
- package/build/ts/surfaces/customer-account/components/NumberField.d.ts +3 -1
- package/build/ts/surfaces/customer-account/components/components-shared.d.ts +1 -1
- package/build/ts/surfaces/customer-account/preact/authenticated-account.d.ts +3 -3
- package/build/ts/surfaces/customer-account/preact/authenticated-account.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/cart-api/cart-api.d.ts +13 -0
- package/build/ts/surfaces/point-of-sale/api/cart-api/cart-api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/device-api/device-api.d.ts +4 -0
- package/build/ts/surfaces/point-of-sale/api/device-api/device-api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/docs.d.ts +7 -0
- package/build/ts/surfaces/point-of-sale/api/docs.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/extension-api/extension-api.d.ts +25 -5
- package/build/ts/surfaces/point-of-sale/api/extension-api/extension-api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts +19 -7
- package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/resolution-api/resolution-api.d.ts +28 -3
- package/build/ts/surfaces/point-of-sale/api/resolution-api/resolution-api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/api/session-api/session-api.d.ts +1 -1
- package/build/ts/surfaces/point-of-sale/api.d.ts +2 -2
- package/build/ts/surfaces/point-of-sale/api.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/POSList.d.ts +179 -0
- package/build/ts/surfaces/point-of-sale/components/targets/BlockExtensionComponents.d.ts +1 -1
- package/build/ts/surfaces/point-of-sale/components/targets/BlockExtensionComponents.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/targets/ResolutionComponents.d.ts +1 -1
- package/build/ts/surfaces/point-of-sale/components/targets/ResolutionComponents.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/components/targets/StandardComponents.d.ts +1 -1
- package/build/ts/surfaces/point-of-sale/components/targets/StandardComponents.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/event/data/BaseData.d.ts +12 -1
- package/build/ts/surfaces/point-of-sale/event/data/BaseData.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/event/data.d.ts +1 -1
- package/build/ts/surfaces/point-of-sale/event/data.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/events/scan-event.d.ts +34 -0
- package/build/ts/surfaces/point-of-sale/events/scan-event.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/events/transaction-complete-event.d.ts +8 -0
- package/build/ts/surfaces/point-of-sale/events/transaction-complete-event.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/events.d.ts +58 -28
- package/build/ts/surfaces/point-of-sale/events.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/extension-targets.d.ts +4 -4
- package/build/ts/surfaces/point-of-sale/extension-targets.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/globals.d.ts +0 -2
- package/build/ts/surfaces/point-of-sale/globals.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/pos-list-template.d.ts +36 -0
- package/build/ts/surfaces/point-of-sale/pos-list-template.d.ts.map +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.cart.line-item-details.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.cart.validations.resolution.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.customer-details.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.draft-order-details.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.exchange.post.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.home.modal.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.order-details.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.payment.validations.resolution.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.product-details.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.purchase.post.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.register-details.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/targets/pos.return.post.action.render.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale/types/base-transaction-complete.d.ts +8 -0
- package/build/ts/surfaces/point-of-sale/types/base-transaction-complete.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale/types/session.d.ts +0 -6
- package/build/ts/surfaces/point-of-sale/types/session.d.ts.map +1 -1
- package/build/ts/surfaces/point-of-sale.d.ts +1 -0
- package/build/ts/surfaces/point-of-sale.d.ts.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/src/shared.ts +22 -21
- package/src/surfaces/admin/api/picker/picker.ts +5 -2
- package/src/surfaces/admin/components/AdminAction.d.ts +2 -2
- package/src/surfaces/admin/components/AdminBlock.d.ts +3 -3
- package/src/surfaces/admin/components/AdminPrintAction.d.ts +2 -2
- package/src/surfaces/admin/components/AppNav.d.ts +1 -1
- package/src/surfaces/admin/components/Avatar.d.ts +1 -1
- package/src/surfaces/admin/components/Badge.d.ts +1 -1
- package/src/surfaces/admin/components/Banner.d.ts +1 -1
- package/src/surfaces/admin/components/Box.d.ts +1 -1
- package/src/surfaces/admin/components/Button.d.ts +1 -1
- package/src/surfaces/admin/components/ButtonGroup.d.ts +1 -1
- package/src/surfaces/admin/components/Checkbox.d.ts +3 -3
- package/src/surfaces/admin/components/Chip.d.ts +1 -1
- package/src/surfaces/admin/components/Choice.d.ts +3 -3
- package/src/surfaces/admin/components/ChoiceList.d.ts +3 -3
- package/src/surfaces/admin/components/Clickable.d.ts +1 -1
- package/src/surfaces/admin/components/ClickableChip.d.ts +1 -1
- package/src/surfaces/admin/components/ColorField.d.ts +1 -1
- package/src/surfaces/admin/components/ColorPicker.d.ts +1 -1
- package/src/surfaces/admin/components/DateField.d.ts +1 -1
- package/src/surfaces/admin/components/DatePicker.d.ts +1 -1
- package/src/surfaces/admin/components/Divider.d.ts +1 -1
- package/src/surfaces/admin/components/DropZone.d.ts +1 -1
- package/src/surfaces/admin/components/EmailField.d.ts +1 -1
- package/src/surfaces/admin/components/EmptyState.d.ts +1 -1
- package/src/surfaces/admin/components/Form.d.ts +1 -1
- package/src/surfaces/admin/components/FunctionSettings.d.ts +1 -1
- package/src/surfaces/admin/components/Grid.d.ts +1 -1
- package/src/surfaces/admin/components/GridItem.d.ts +1 -1
- package/src/surfaces/admin/components/Heading.d.ts +1 -1
- package/src/surfaces/admin/components/Icon.d.ts +1 -1
- package/src/surfaces/admin/components/Image.d.ts +1 -1
- package/src/surfaces/admin/components/Link.d.ts +1 -1
- package/src/surfaces/admin/components/ListItem.d.ts +1 -1
- package/src/surfaces/admin/components/Menu.d.ts +1 -1
- package/src/surfaces/admin/components/Modal.d.ts +1 -1
- package/src/surfaces/admin/components/MoneyField.d.ts +1 -1
- package/src/surfaces/admin/components/Number.d.ts +1 -1
- package/src/surfaces/admin/components/NumberField.d.ts +1 -1
- package/src/surfaces/admin/components/Option.d.ts +3 -3
- package/src/surfaces/admin/components/OptionGroup.d.ts +1 -1
- package/src/surfaces/admin/components/OrderedList.d.ts +1 -1
- package/src/surfaces/admin/components/Page.d.ts +1 -1
- package/src/surfaces/admin/components/Paragraph.d.ts +1 -1
- package/src/surfaces/admin/components/PasswordField.d.ts +1 -1
- package/src/surfaces/admin/components/Popover.d.ts +1 -1
- package/src/surfaces/admin/components/Progress.d.ts +155 -0
- package/src/surfaces/admin/components/QueryContainer.d.ts +1 -1
- package/src/surfaces/admin/components/SearchField.d.ts +1 -1
- package/src/surfaces/admin/components/Section.d.ts +11 -3
- package/src/surfaces/admin/components/Select.d.ts +1 -1
- package/src/surfaces/admin/components/Spinner.d.ts +1 -1
- package/src/surfaces/admin/components/Stack.d.ts +1 -1
- package/src/surfaces/admin/components/StandardComponents.ts +3 -0
- package/src/surfaces/admin/components/Switch.d.ts +3 -3
- package/src/surfaces/admin/components/Table.d.ts +1 -1
- package/src/surfaces/admin/components/TableBody.d.ts +1 -1
- package/src/surfaces/admin/components/TableCell.d.ts +1 -1
- package/src/surfaces/admin/components/TableHeader.d.ts +1 -1
- package/src/surfaces/admin/components/TableHeaderRow.d.ts +1 -1
- package/src/surfaces/admin/components/TableRow.d.ts +1 -1
- package/src/surfaces/admin/components/Text.d.ts +1 -1
- package/src/surfaces/admin/components/TextArea.d.ts +1 -1
- package/src/surfaces/admin/components/TextField.d.ts +1 -1
- package/src/surfaces/admin/components/Thumbnail.d.ts +1 -1
- package/src/surfaces/admin/components/Tooltip.d.ts +1 -1
- package/src/surfaces/admin/components/URLField.d.ts +1 -1
- package/src/surfaces/admin/components/UnorderedList.d.ts +1 -1
- package/src/surfaces/admin/components/shared.d.ts +47 -7
- package/src/surfaces/admin/components.d.ts +8216 -2635
- package/src/surfaces/checkout/api/address-autocomplete/format-suggestion.ts +9 -0
- package/src/surfaces/checkout/api/address-autocomplete/shared.ts +9 -0
- package/src/surfaces/checkout/api/address-autocomplete/standard.ts +1 -2
- package/src/surfaces/checkout/api/address-autocomplete/suggest.ts +8 -0
- package/src/surfaces/checkout/api/checkout/checkout.ts +19 -9
- package/src/surfaces/checkout/api/redeemable/redeemable.ts +1 -1
- package/src/surfaces/checkout/api/shared.ts +116 -1
- package/src/surfaces/checkout/api/standard/standard.ts +11 -3
- package/src/surfaces/checkout/components/MoneyField.d.ts +3 -1
- package/src/surfaces/checkout/components/NumberField.d.ts +3 -1
- package/src/surfaces/checkout/components/components-shared.d.ts +1 -1
- package/src/surfaces/checkout/preact/country.ts +1 -1
- package/src/surfaces/checkout.ts +3 -0
- package/src/surfaces/customer-account/api/order-status/order-status.ts +1 -1
- package/src/surfaces/customer-account/api/shared.ts +25 -7
- package/src/surfaces/customer-account/api.ts +1 -0
- package/src/surfaces/customer-account/preact/authenticated-account.ts +3 -3
- package/src/surfaces/point-of-sale/api/cart-api/cart-api.ts +14 -0
- package/src/surfaces/point-of-sale/api/device-api/device-api.ts +4 -0
- package/src/surfaces/point-of-sale/api/docs.ts +8 -0
- package/src/surfaces/point-of-sale/api/extension-api/extension-api.ts +25 -5
- package/src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts +22 -7
- package/src/surfaces/point-of-sale/api/resolution-api/resolution-api.ts +30 -3
- package/src/surfaces/point-of-sale/api/session-api/session-api.ts +1 -1
- package/src/surfaces/point-of-sale/api.ts +2 -0
- package/src/surfaces/point-of-sale/components/POSList.d.ts +179 -0
- package/src/surfaces/point-of-sale/components/targets/BlockExtensionComponents.ts +0 -4
- package/src/surfaces/point-of-sale/components/targets/ResolutionComponents.ts +1 -1
- package/src/surfaces/point-of-sale/components/targets/StandardComponents.ts +1 -3
- package/src/surfaces/point-of-sale/components.d.ts +194 -0
- package/src/surfaces/point-of-sale/event/data/BaseData.ts +13 -1
- package/src/surfaces/point-of-sale/event/data.ts +1 -1
- package/src/surfaces/point-of-sale/events/scan-event.ts +34 -0
- package/src/surfaces/point-of-sale/events/transaction-complete-event.ts +8 -0
- package/src/surfaces/point-of-sale/events.ts +58 -27
- package/src/surfaces/point-of-sale/extension-targets.ts +4 -4
- package/src/surfaces/point-of-sale/globals.ts +0 -2
- package/src/surfaces/point-of-sale/pos-list-template.ts +351 -0
- package/src/surfaces/point-of-sale/tests/pos-list-template.test.ts +306 -0
- package/src/surfaces/point-of-sale/types/base-transaction-complete.ts +8 -0
- package/src/surfaces/point-of-sale/types/session.ts +0 -7
- package/src/surfaces/point-of-sale.ts +1 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import htm from 'htm';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The tagged template that compiles `<s-pos-list-item>` markup into the
|
|
5
|
+
* `itemTemplates` value `<s-pos-list>` accepts. Templates are static: the
|
|
6
|
+
* result contains no functions. Compilation and validation happen when the
|
|
7
|
+
* helper executes, not during the extension build. Define templates at module
|
|
8
|
+
* scope to compile once per module execution.
|
|
9
|
+
* Invalid templates throw synchronously and return no partial collection.
|
|
10
|
+
* An uncaught module-scope exception aborts module evaluation; catch the helper
|
|
11
|
+
* invocation to recover explicitly. There is no automatic list-only fallback.
|
|
12
|
+
*
|
|
13
|
+
* @publicDocs
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const ITEM_TAG = 's-pos-list-item';
|
|
17
|
+
const LIST_TAG = 's-pos-list';
|
|
18
|
+
const PATH_PATTERN = /^[\w.]+$/;
|
|
19
|
+
const EVENT_PROP_PATTERN = /^on/i;
|
|
20
|
+
const BIND_PREFIX = 'bind:';
|
|
21
|
+
/** `{{#if path}}`, `{{/if}}`, or `{{path}}`; anything else inside `{{ }}` is unsupported. */
|
|
22
|
+
const EXPRESSION_PATTERN = /\{\{\s*(?:#if\s+([\w.]+)|(\/if)|([\w.]+))\s*\}\}/g;
|
|
23
|
+
const ANY_EXPRESSION_PATTERN = /\{\{([\s\S]*?)\}\}/g;
|
|
24
|
+
function fail(message) {
|
|
25
|
+
throw new Error(`posListTemplate: ${message}`);
|
|
26
|
+
}
|
|
27
|
+
function isRawElement(value) {
|
|
28
|
+
return typeof value === 'object' && value !== null && 'tag' in value && 'props' in value && 'children' in value;
|
|
29
|
+
}
|
|
30
|
+
function createRawElement(type, props, ...children) {
|
|
31
|
+
if (typeof type !== 'string') {
|
|
32
|
+
fail('interpolated values are not supported; templates must be static');
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
tag: type,
|
|
36
|
+
props: props !== null && props !== void 0 ? props : {},
|
|
37
|
+
children
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const parse = htm.bind(createRawElement);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Splits a string into literal and `{{path}}` segments. Used for attribute
|
|
44
|
+
* values, where block expressions have no meaning.
|
|
45
|
+
*/
|
|
46
|
+
function parseSegments(value) {
|
|
47
|
+
const segments = [];
|
|
48
|
+
let lastIndex = 0;
|
|
49
|
+
for (const match of value.matchAll(ANY_EXPRESSION_PATTERN)) {
|
|
50
|
+
var _match$index;
|
|
51
|
+
const expression = match[1].trim();
|
|
52
|
+
if (!PATH_PATTERN.test(expression)) {
|
|
53
|
+
if (expression.startsWith('#if') || expression === '/if') {
|
|
54
|
+
fail(`{{#if}} is not supported inside an attribute value: "${match[0]}"`);
|
|
55
|
+
}
|
|
56
|
+
fail(`unsupported template expression "${match[0]}"`);
|
|
57
|
+
}
|
|
58
|
+
const index = (_match$index = match.index) !== null && _match$index !== void 0 ? _match$index : 0;
|
|
59
|
+
if (index > lastIndex) {
|
|
60
|
+
segments.push(value.slice(lastIndex, index));
|
|
61
|
+
}
|
|
62
|
+
segments.push({
|
|
63
|
+
path: expression
|
|
64
|
+
});
|
|
65
|
+
lastIndex = index + match[0].length;
|
|
66
|
+
}
|
|
67
|
+
if (lastIndex < value.length) {
|
|
68
|
+
segments.push(value.slice(lastIndex));
|
|
69
|
+
}
|
|
70
|
+
return segments;
|
|
71
|
+
}
|
|
72
|
+
function tokenizeText(value, tokens) {
|
|
73
|
+
let lastIndex = 0;
|
|
74
|
+
for (const match of value.matchAll(ANY_EXPRESSION_PATTERN)) {
|
|
75
|
+
var _match$index2;
|
|
76
|
+
const index = (_match$index2 = match.index) !== null && _match$index2 !== void 0 ? _match$index2 : 0;
|
|
77
|
+
if (index > lastIndex) {
|
|
78
|
+
tokens.push({
|
|
79
|
+
kind: 'text',
|
|
80
|
+
value: value.slice(lastIndex, index)
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
EXPRESSION_PATTERN.lastIndex = 0;
|
|
84
|
+
const expression = EXPRESSION_PATTERN.exec(match[0]);
|
|
85
|
+
if (expression === null || expression[0].length !== match[0].length) {
|
|
86
|
+
fail(`unsupported template expression "${match[0]}"`);
|
|
87
|
+
}
|
|
88
|
+
const [, ifPath, endIf, path] = expression;
|
|
89
|
+
if (ifPath !== undefined) {
|
|
90
|
+
tokens.push({
|
|
91
|
+
kind: 'if',
|
|
92
|
+
path: ifPath
|
|
93
|
+
});
|
|
94
|
+
} else if (endIf !== undefined) {
|
|
95
|
+
tokens.push({
|
|
96
|
+
kind: 'endif'
|
|
97
|
+
});
|
|
98
|
+
} else if (path !== undefined) {
|
|
99
|
+
tokens.push({
|
|
100
|
+
kind: 'path',
|
|
101
|
+
path
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
lastIndex = index + match[0].length;
|
|
105
|
+
}
|
|
106
|
+
if (lastIndex < value.length) {
|
|
107
|
+
tokens.push({
|
|
108
|
+
kind: 'text',
|
|
109
|
+
value: value.slice(lastIndex)
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function tokenize(rawChildren) {
|
|
114
|
+
const tokens = [];
|
|
115
|
+
for (const child of rawChildren.flat()) {
|
|
116
|
+
if (typeof child === 'string') {
|
|
117
|
+
if (child.trim().length > 0) {
|
|
118
|
+
tokenizeText(child, tokens);
|
|
119
|
+
}
|
|
120
|
+
} else if (isRawElement(child)) {
|
|
121
|
+
tokens.push({
|
|
122
|
+
kind: 'element',
|
|
123
|
+
element: child
|
|
124
|
+
});
|
|
125
|
+
} else if (child !== null && child !== undefined && child !== false) {
|
|
126
|
+
fail('interpolated values are not supported; templates must be static');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return tokens;
|
|
130
|
+
}
|
|
131
|
+
function compileProp(name, value, props) {
|
|
132
|
+
const isBinding = name.startsWith(BIND_PREFIX);
|
|
133
|
+
const propName = isBinding ? name.slice(BIND_PREFIX.length) : name;
|
|
134
|
+
if (EVENT_PROP_PATTERN.test(propName)) {
|
|
135
|
+
fail(`event handlers are not supported in templates; use onRowClick on <${LIST_TAG}>`);
|
|
136
|
+
}
|
|
137
|
+
if (isBinding) {
|
|
138
|
+
if (typeof value !== 'string' || !PATH_PATTERN.test(value)) {
|
|
139
|
+
fail(`${name} must name a row field path`);
|
|
140
|
+
}
|
|
141
|
+
if (propName in props) {
|
|
142
|
+
fail(`"${propName}" is set both as an attribute and through ${name}`);
|
|
143
|
+
}
|
|
144
|
+
props[propName] = {
|
|
145
|
+
kind: 'field',
|
|
146
|
+
path: value
|
|
147
|
+
};
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (typeof value === 'string') {
|
|
151
|
+
props[name] = value.includes('{{') ? {
|
|
152
|
+
kind: 'segments',
|
|
153
|
+
segments: parseSegments(value)
|
|
154
|
+
} : {
|
|
155
|
+
kind: 'literal',
|
|
156
|
+
value
|
|
157
|
+
};
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (typeof value === 'boolean') {
|
|
161
|
+
props[name] = {
|
|
162
|
+
kind: 'literal',
|
|
163
|
+
value
|
|
164
|
+
};
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
fail('interpolated values are not supported; templates must be static');
|
|
168
|
+
}
|
|
169
|
+
function compileElement(element, parentIfPath) {
|
|
170
|
+
if (element.tag === ITEM_TAG || element.tag === LIST_TAG) {
|
|
171
|
+
fail(`<${element.tag}> can only appear as a template root`);
|
|
172
|
+
}
|
|
173
|
+
const props = {};
|
|
174
|
+
// Plain attributes first so `bind:` can detect a collision with one.
|
|
175
|
+
const entries = Object.entries(element.props);
|
|
176
|
+
for (const [name, value] of entries) {
|
|
177
|
+
if (!name.startsWith(BIND_PREFIX)) {
|
|
178
|
+
compileProp(name, value, props);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const [name, value] of entries) {
|
|
182
|
+
if (name.startsWith(BIND_PREFIX)) {
|
|
183
|
+
compileProp(name, value, props);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const node = {
|
|
187
|
+
kind: 'element',
|
|
188
|
+
tag: element.tag,
|
|
189
|
+
props
|
|
190
|
+
};
|
|
191
|
+
const children = compileChildren(element.children, false, parentIfPath);
|
|
192
|
+
if (children.length > 0) {
|
|
193
|
+
node.children = children;
|
|
194
|
+
}
|
|
195
|
+
return node;
|
|
196
|
+
}
|
|
197
|
+
function compileChildren(rawChildren, atRoot, parentIfPath) {
|
|
198
|
+
var _openIf$path2, _openIf2;
|
|
199
|
+
const nodes = [];
|
|
200
|
+
let pendingText = [];
|
|
201
|
+
let openIf;
|
|
202
|
+
const target = () => openIf ? openIf.children : nodes;
|
|
203
|
+
const flushText = () => {
|
|
204
|
+
if (pendingText.length === 0) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (atRoot) {
|
|
208
|
+
fail('text must be inside a component such as <s-text>');
|
|
209
|
+
}
|
|
210
|
+
target().push({
|
|
211
|
+
kind: 'text',
|
|
212
|
+
segments: pendingText
|
|
213
|
+
});
|
|
214
|
+
pendingText = [];
|
|
215
|
+
};
|
|
216
|
+
for (const token of tokenize(rawChildren)) {
|
|
217
|
+
switch (token.kind) {
|
|
218
|
+
case 'text':
|
|
219
|
+
pendingText.push(token.value);
|
|
220
|
+
break;
|
|
221
|
+
case 'path':
|
|
222
|
+
pendingText.push({
|
|
223
|
+
path: token.path
|
|
224
|
+
});
|
|
225
|
+
break;
|
|
226
|
+
case 'if':
|
|
227
|
+
{
|
|
228
|
+
var _openIf$path, _openIf;
|
|
229
|
+
flushText();
|
|
230
|
+
const enclosingIfPath = (_openIf$path = (_openIf = openIf) === null || _openIf === void 0 ? void 0 : _openIf.path) !== null && _openIf$path !== void 0 ? _openIf$path : parentIfPath;
|
|
231
|
+
if (enclosingIfPath !== undefined) {
|
|
232
|
+
fail(`{{#if}} cannot be nested: {{#if ${token.path}}} inside {{#if ${enclosingIfPath}}}`);
|
|
233
|
+
}
|
|
234
|
+
openIf = {
|
|
235
|
+
path: token.path,
|
|
236
|
+
children: []
|
|
237
|
+
};
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
case 'endif':
|
|
241
|
+
flushText();
|
|
242
|
+
if (!openIf) {
|
|
243
|
+
fail('{{/if}} without a matching {{#if}}');
|
|
244
|
+
}
|
|
245
|
+
nodes.push({
|
|
246
|
+
kind: 'if',
|
|
247
|
+
path: openIf.path,
|
|
248
|
+
children: openIf.children
|
|
249
|
+
});
|
|
250
|
+
openIf = undefined;
|
|
251
|
+
break;
|
|
252
|
+
case 'element':
|
|
253
|
+
flushText();
|
|
254
|
+
target().push(compileElement(token.element, (_openIf$path2 = (_openIf2 = openIf) === null || _openIf2 === void 0 ? void 0 : _openIf2.path) !== null && _openIf$path2 !== void 0 ? _openIf$path2 : parentIfPath));
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
flushText();
|
|
259
|
+
if (openIf) {
|
|
260
|
+
fail(`{{#if ${openIf.path}}} is missing its {{/if}}`);
|
|
261
|
+
}
|
|
262
|
+
return nodes;
|
|
263
|
+
}
|
|
264
|
+
function compileRoot(root, seen) {
|
|
265
|
+
if (!isRawElement(root) || root.tag !== ITEM_TAG) {
|
|
266
|
+
fail(`every template root must be an <${ITEM_TAG} templateId="…"> element`);
|
|
267
|
+
}
|
|
268
|
+
let templateId;
|
|
269
|
+
let type = 'button';
|
|
270
|
+
for (const [name, value] of Object.entries(root.props)) {
|
|
271
|
+
if (name === 'templateId') {
|
|
272
|
+
if (typeof value !== 'string' || value.length === 0) {
|
|
273
|
+
fail(`<${ITEM_TAG}> requires a literal, non-empty templateId`);
|
|
274
|
+
}
|
|
275
|
+
templateId = value;
|
|
276
|
+
} else if (name === 'type') {
|
|
277
|
+
if (value !== 'button' && value !== 'text') {
|
|
278
|
+
fail(`<${ITEM_TAG}> type must be "button" or "text", got ${JSON.stringify(value)}`);
|
|
279
|
+
}
|
|
280
|
+
type = value;
|
|
281
|
+
} else {
|
|
282
|
+
fail(`<${ITEM_TAG}> does not accept a "${name}" attribute; only templateId and type are allowed`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (templateId === undefined) {
|
|
286
|
+
fail(`<${ITEM_TAG}> requires a literal, non-empty templateId`);
|
|
287
|
+
}
|
|
288
|
+
if (seen.has(templateId)) {
|
|
289
|
+
fail(`duplicate templateId "${templateId}"`);
|
|
290
|
+
}
|
|
291
|
+
seen.add(templateId);
|
|
292
|
+
return {
|
|
293
|
+
templateId,
|
|
294
|
+
type,
|
|
295
|
+
children: compileChildren(root.children, true)
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Compiles `<s-pos-list-item>` markup into the `itemTemplates` value for
|
|
301
|
+
* `<s-pos-list>`.
|
|
302
|
+
*
|
|
303
|
+
* Compilation and validation happen when this helper executes, not during the
|
|
304
|
+
* extension build. Define templates at module scope to compile once per module
|
|
305
|
+
* execution.
|
|
306
|
+
* Invalid templates throw synchronously and return no partial collection.
|
|
307
|
+
* An uncaught module-scope exception aborts module evaluation; catch the helper
|
|
308
|
+
* invocation to recover explicitly. There is no automatic list-only fallback.
|
|
309
|
+
*
|
|
310
|
+
* Inside a template, `{{path}}` interpolates a row field as text, `bind:prop="path"`
|
|
311
|
+
* passes a row field to a component prop with its own type, and
|
|
312
|
+
* `{{#if path}}…{{/if}}` renders its content only when the field is truthy.
|
|
313
|
+
* Event handlers, interpolated values, and any other `{{…}}` expression are
|
|
314
|
+
* rejected when the template is compiled.
|
|
315
|
+
*
|
|
316
|
+
* @publicDocs
|
|
317
|
+
*/
|
|
318
|
+
const posListTemplate = (strings, ...values) => {
|
|
319
|
+
if (values.length > 0) {
|
|
320
|
+
fail('interpolated values are not supported; templates must be static');
|
|
321
|
+
}
|
|
322
|
+
const parsed = parse(strings);
|
|
323
|
+
const roots = Array.isArray(parsed) ? parsed : [parsed];
|
|
324
|
+
const seen = new Set();
|
|
325
|
+
const templates = roots.filter(root => !(typeof root === 'string' && root.trim().length === 0)).map(root => compileRoot(root, seen));
|
|
326
|
+
return {
|
|
327
|
+
templates
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export { posListTemplate };
|
|
@@ -2,7 +2,7 @@ import { useApi } from './api.esnext';
|
|
|
2
2
|
import { useSubscription } from './subscription.esnext';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Returns the current
|
|
5
|
+
* Returns the current `AuthenticatedAccountCustomer`.
|
|
6
6
|
*
|
|
7
7
|
* The value is `undefined` if the customer isn't authenticated.
|
|
8
8
|
*/
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
const POS_EVENT_NAMES = {
|
|
8
8
|
TRANSACTION_COMPLETE: 'transactioncomplete',
|
|
9
9
|
CASH_TRACKING_SESSION_START: 'cashtrackingsessionstart',
|
|
10
|
-
CASH_TRACKING_SESSION_COMPLETE: 'cashtrackingsessioncomplete'
|
|
10
|
+
CASH_TRACKING_SESSION_COMPLETE: 'cashtrackingsessioncomplete',
|
|
11
|
+
SCAN: 'scan'
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -35,26 +36,26 @@ const POS_INTERCEPT_NAMES = {
|
|
|
35
36
|
*
|
|
36
37
|
* Used as the generic type parameter for `shopify.intercept`.
|
|
37
38
|
*
|
|
38
|
-
* @
|
|
39
|
+
* @publicDocs
|
|
39
40
|
*/
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
43
|
* The data carried by a `cartvalidations` event.
|
|
43
44
|
*
|
|
44
|
-
* @
|
|
45
|
+
* @publicDocs
|
|
45
46
|
*/
|
|
46
47
|
|
|
47
48
|
/**
|
|
48
49
|
* The event a `cartvalidations` interceptor receives. Carries a snapshot of
|
|
49
50
|
* the POS cart taken when the event was produced.
|
|
50
51
|
*
|
|
51
|
-
* @
|
|
52
|
+
* @publicDocs
|
|
52
53
|
*/
|
|
53
54
|
|
|
54
55
|
/**
|
|
55
56
|
* The kind of payment method being attempted.
|
|
56
57
|
*
|
|
57
|
-
* @
|
|
58
|
+
* @publicDocs
|
|
58
59
|
*/
|
|
59
60
|
|
|
60
61
|
/**
|
|
@@ -64,7 +65,7 @@ const POS_INTERCEPT_NAMES = {
|
|
|
64
65
|
* disambiguates method types a shop can have several of (for example custom
|
|
65
66
|
* payment methods) as they become interceptable.
|
|
66
67
|
*
|
|
67
|
-
* @
|
|
68
|
+
* @publicDocs
|
|
68
69
|
*/
|
|
69
70
|
|
|
70
71
|
/**
|
|
@@ -72,77 +73,93 @@ const POS_INTERCEPT_NAMES = {
|
|
|
72
73
|
* attempt's payment method and amount; split payments produce one event per
|
|
73
74
|
* tender, each with its own amount.
|
|
74
75
|
*
|
|
75
|
-
* @
|
|
76
|
+
* @publicDocs
|
|
76
77
|
*/
|
|
77
78
|
|
|
78
79
|
/**
|
|
79
80
|
* The data carried by a `paymentvalidations` event.
|
|
80
81
|
*
|
|
81
|
-
* @
|
|
82
|
+
* @publicDocs
|
|
82
83
|
*/
|
|
83
84
|
|
|
84
85
|
/**
|
|
85
86
|
* Targets the whole cart rather than a specific line item.
|
|
86
87
|
*
|
|
87
|
-
* @
|
|
88
|
+
* @publicDocs
|
|
88
89
|
*/
|
|
89
90
|
|
|
90
91
|
/**
|
|
91
92
|
* Targets one cart line item by its `uuid` from this event's `cart` snapshot,
|
|
92
93
|
* for example `$.cart.lineItems['adfd6b06-4a24-4f5f-9f4b-ea21f4432dd4']`.
|
|
93
94
|
*
|
|
94
|
-
* @
|
|
95
|
+
* @publicDocs
|
|
95
96
|
*/
|
|
96
97
|
|
|
97
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* A target that a `cartvalidations` interceptor can use: the whole cart or
|
|
100
|
+
* one cart line item.
|
|
101
|
+
*
|
|
102
|
+
* @publicDocs
|
|
103
|
+
*/
|
|
98
104
|
|
|
99
105
|
/**
|
|
100
106
|
* Targets the payment attempt being intercepted.
|
|
101
107
|
*
|
|
102
|
-
* @
|
|
108
|
+
* @publicDocs
|
|
103
109
|
*/
|
|
104
110
|
|
|
105
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* A target that a `paymentvalidations` interceptor can use. The only
|
|
113
|
+
* supported target is the payment attempt.
|
|
114
|
+
*
|
|
115
|
+
* @publicDocs
|
|
116
|
+
*/
|
|
106
117
|
|
|
107
118
|
/**
|
|
108
119
|
* Where a validation applies, as an enumerated token. Targets are matched
|
|
109
120
|
* as exact strings, never evaluated as JSON paths.
|
|
110
121
|
*
|
|
111
|
-
* @
|
|
122
|
+
* @publicDocs
|
|
112
123
|
*/
|
|
113
124
|
|
|
114
125
|
/**
|
|
115
126
|
* Maps POS interceptable workflow names to their valid validation targets.
|
|
116
127
|
*
|
|
117
|
-
* @
|
|
128
|
+
* @publicDocs
|
|
118
129
|
*/
|
|
119
130
|
|
|
120
131
|
/**
|
|
121
132
|
* The interceptor callback for a POS interceptable workflow, keyed by the
|
|
122
133
|
* workflow name so the event and its valid validation targets stay paired.
|
|
123
134
|
*
|
|
124
|
-
* @
|
|
135
|
+
* @publicDocs
|
|
125
136
|
*/
|
|
126
137
|
|
|
127
138
|
/**
|
|
128
|
-
* The result an interceptor returns. An empty `operations` list
|
|
129
|
-
*
|
|
139
|
+
* The result an interceptor returns. An empty `operations` list adds no
|
|
140
|
+
* findings from this interceptor and doesn't remove or override findings from
|
|
141
|
+
* other interceptors.
|
|
130
142
|
*
|
|
131
|
-
* @
|
|
143
|
+
* @publicDocs
|
|
132
144
|
*/
|
|
133
145
|
|
|
134
146
|
/**
|
|
135
147
|
* A single host operation produced by an interceptor.
|
|
136
148
|
*
|
|
137
|
-
* @
|
|
149
|
+
* @publicDocs
|
|
138
150
|
*/
|
|
139
151
|
|
|
140
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* The severity of a validation. `ERROR` can block the workflow when blocking
|
|
154
|
+
* is declared and allowed by the store. `WARNING` never blocks.
|
|
155
|
+
*
|
|
156
|
+
* @publicDocs
|
|
157
|
+
*/
|
|
141
158
|
|
|
142
159
|
/**
|
|
143
160
|
* Adds a validation to the workflow being intercepted.
|
|
144
161
|
*
|
|
145
|
-
* @
|
|
162
|
+
* @publicDocs
|
|
146
163
|
*/
|
|
147
164
|
|
|
148
165
|
export { POS_EVENT_NAMES, POS_INTERCEPT_NAMES };
|