@vtex/faststore 0.0.6 → 0.0.8
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/CHANGELOG.md +99 -0
- package/dist/actions.json +152 -1
- package/dist/catalog.json +2541 -1278
- package/dist/cli/UnreachableCaseError-Crd168Vu.js +10 -0
- package/dist/cli/UnreachableCaseError-Crd168Vu.js.map +1 -0
- package/dist/cli/cacheControl-CEojH_TM.js +158 -0
- package/dist/cli/cacheControl-CEojH_TM.js.map +1 -0
- package/dist/cli/cachePolicy-m2vASMRW.js +26 -0
- package/dist/cli/cachePolicy-m2vASMRW.js.map +1 -0
- package/dist/cli/computeCoreSchemaHash-DPJZj-qJ.js +10 -0
- package/dist/cli/computeCoreSchemaHash-DPJZj-qJ.js.map +1 -0
- package/dist/cli/default-BCQHcwbL.js +253 -0
- package/dist/cli/default-BCQHcwbL.js.map +1 -0
- package/dist/cli/disableSuggestions-yO9UqiWn.js +21 -0
- package/dist/cli/disableSuggestions-yO9UqiWn.js.map +1 -0
- package/dist/cli/dist-C1JhdHfo.js +2001 -0
- package/dist/cli/dist-C1JhdHfo.js.map +1 -0
- package/dist/cli/graphql-DG9thCDG.js +14589 -0
- package/dist/cli/graphql-DG9thCDG.js.map +1 -0
- package/dist/cli/index.d.ts +799 -0
- package/dist/cli/index.js +36459 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/index.min-BsIHDfFK.js +613 -0
- package/dist/cli/index.min-BsIHDfFK.js.map +1 -0
- package/dist/cli/inlineTrace-uLgOJ3TH.js +52 -0
- package/dist/cli/inlineTrace-uLgOJ3TH.js.map +1 -0
- package/dist/cli/internalPlugin-DnuwN4_4.js +11 -0
- package/dist/cli/internalPlugin-DnuwN4_4.js.map +1 -0
- package/dist/cli/packageVersion-DQAnIEil.js +6 -0
- package/dist/cli/packageVersion-DQAnIEil.js.map +1 -0
- package/dist/cli/rolldown-runtime-BMI-E3GI.js +44 -0
- package/dist/cli/schemaIsSubgraph-DoGh3OYj.js +17 -0
- package/dist/cli/schemaIsSubgraph-DoGh3OYj.js.map +1 -0
- package/dist/cli/schemaReporting-K-me-3-v.js +199 -0
- package/dist/cli/schemaReporting-K-me-3-v.js.map +1 -0
- package/dist/cli/server-runtime.js +49879 -0
- package/dist/cli/server-runtime.js.map +1 -0
- package/dist/cli/traceTreeBuilder-BIcV2U7b.js +9118 -0
- package/dist/cli/traceTreeBuilder-BIcV2U7b.js.map +1 -0
- package/dist/cli/usageReporting-Bpl8vSZX.js +10201 -0
- package/dist/cli/usageReporting-Bpl8vSZX.js.map +1 -0
- package/dist/cli/v4-CBhFvC49.js +42 -0
- package/dist/cli/v4-CBhFvC49.js.map +1 -0
- package/dist/client.d.ts +5 -1
- package/dist/client.js +5 -1
- package/dist/components.d.ts +38 -9
- package/dist/components.js +42 -13
- package/dist/content-types.json +616 -0
- package/dist/core/dist/define-component.d.ts +43 -1
- package/dist/core/dist/index.d.ts +2 -2
- package/dist/docs/account-access-gate.md +4 -4
- package/dist/docs/account-address-book.md +519 -0
- package/dist/docs/account-entry-point.md +1 -1
- package/dist/docs/account-menu-identity.md +160 -0
- package/dist/docs/account-menu.md +107 -24
- package/dist/docs/alert-dialog.md +2 -2
- package/dist/docs/avatar.md +103 -0
- package/dist/docs/billing-address.md +17 -9
- package/dist/docs/card-entry.md +37 -6
- package/dist/docs/cardholder-document.md +16 -14
- package/dist/docs/cart-item.md +1 -1
- package/dist/docs/cart.md +8 -8
- package/dist/docs/client-profile-fieldset.md +7 -5
- package/dist/docs/copy-text.md +84 -0
- package/dist/docs/document-field.md +8 -8
- package/dist/docs/footer-link-group.md +2 -2
- package/dist/docs/header-root.md +1 -1
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/logo.md +5 -5
- package/dist/docs/my-account-profile.md +5 -5
- package/dist/docs/navigation-link-list.md +2 -2
- package/dist/docs/navigation-link.md +3 -3
- package/dist/docs/order-cancel.md +52 -0
- package/dist/docs/order-delivery-address.md +63 -0
- package/dist/docs/order-delivery-group.md +83 -0
- package/dist/docs/order-details-back.md +41 -0
- package/dist/docs/order-details-header.md +48 -0
- package/dist/docs/order-list-row.md +46 -0
- package/dist/docs/order-list-search.md +101 -0
- package/dist/docs/order-list-views.md +97 -0
- package/dist/docs/order-list.md +94 -0
- package/dist/docs/order-payment.md +94 -0
- package/dist/docs/order-placed-date.md +49 -0
- package/dist/docs/order-placed-payment-summary.md +13 -15
- package/dist/docs/order-placed.md +225 -0
- package/dist/docs/order-progress.md +88 -0
- package/dist/docs/order-status-badge.md +91 -0
- package/dist/docs/order-summary.md +53 -0
- package/dist/docs/payment-method-badges.md +14 -3
- package/dist/docs/place-order.md +13 -9
- package/dist/docs/product-shelf.md +20 -13
- package/dist/docs/saved-cards.md +2 -2
- package/dist/docs/select.md +19 -6
- package/dist/docs/session.md +1 -1
- package/dist/docs/shipping-address.md +1 -1
- package/dist/docs/sign-in-redirect.md +6 -6
- package/dist/docs/toast.md +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +2 -1
- package/dist/internal/client.d.ts +6 -1
- package/dist/internal/client.js +8 -3
- package/dist/internal/content.d.ts +2 -2
- package/dist/internal/server.d.ts +8 -1
- package/dist/internal/server.js +8 -1
- package/dist/matter/account-access-gate/account-access-gate.d.ts +2 -1
- package/dist/matter/account-access-gate/account-access-gate.js +19 -16
- package/dist/matter/account-access-gate/account-access-gate.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +60 -0
- package/dist/matter/account-address-book/account-address-book-delete.js +184 -0
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +19 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.js +50 -0
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +42 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.js +146 -0
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +25 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +72 -0
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -0
- package/dist/matter/account-address-book/account-address-book.d.ts +120 -0
- package/dist/matter/account-address-book/account-address-book.js +469 -0
- package/dist/matter/account-address-book/account-address-book.js.map +1 -0
- package/dist/matter/account-address-book/account-address-country-switch.js +59 -0
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -0
- package/dist/matter/account-address-book/account-address-country.d.ts +36 -0
- package/dist/matter/account-address-book/account-address-country.js +151 -0
- package/dist/matter/account-address-book/account-address-country.js.map +1 -0
- package/dist/matter/account-address-book/account-address-first-line.js +11 -0
- package/dist/matter/account-address-book/account-address-first-line.js.map +1 -0
- package/dist/matter/account-address-book/account-address-form-context.d.ts +55 -0
- package/dist/matter/account-address-book/account-address-form-context.js +14 -0
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -0
- package/dist/matter/account-address-book/account-address-form.d.ts +85 -0
- package/dist/matter/account-address-book/account-address-form.js +946 -0
- package/dist/matter/account-address-book/account-address-form.js.map +1 -0
- package/dist/matter/account-address-book/account-address-postal-autofill.js +189 -0
- package/dist/matter/account-address-book/account-address-postal-autofill.js.map +1 -0
- package/dist/matter/account-address-book/account-address-record.d.ts +26 -0
- package/dist/matter/account-address-book/account-address-record.js +138 -0
- package/dist/matter/account-address-book/account-address-record.js.map +1 -0
- package/dist/matter/account-entry-point/account-entry-point.js +11 -11
- package/dist/matter/account-entry-point/account-entry-point.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +77 -3
- package/dist/matter/account-menu/account-menu.js +252 -19
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-menu/sign-out-failure.js +50 -0
- package/dist/matter/account-menu/sign-out-failure.js.map +1 -0
- package/dist/matter/account-menu-identity/account-menu-identity.d.ts +21 -0
- package/dist/matter/account-menu-identity/account-menu-identity.js +88 -0
- package/dist/matter/account-menu-identity/account-menu-identity.js.map +1 -0
- package/dist/matter/billing-address/billing-address.d.ts +30 -17
- package/dist/matter/billing-address/billing-address.js +128 -33
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.js +2 -2
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +4 -3
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +5 -3
- package/dist/matter/card-entry/card-entry.js +78 -27
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cardholder-document/cardholder-document.d.ts +10 -9
- package/dist/matter/cardholder-document/cardholder-document.js +36 -16
- package/dist/matter/cardholder-document/cardholder-document.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +7 -2
- package/dist/matter/cart/cart.js +29 -26
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-item/cart-item.js +2 -2
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences-fieldset.js +2 -2
- package/dist/matter/client-profile-form/client-profile-fieldset.js +9 -6
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.js +3 -3
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.js +4 -3
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +6 -3
- package/dist/matter/my-account-profile/my-account-profile.js +6 -5
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +110 -0
- package/dist/matter/order-cancel/order-cancel.js +344 -0
- package/dist/matter/order-cancel/order-cancel.js.map +1 -0
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +73 -0
- package/dist/matter/order-delivery-address/order-delivery-address.js +172 -0
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -0
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +128 -0
- package/dist/matter/order-delivery-group/order-delivery-group.js +408 -0
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -0
- package/dist/matter/order-details-header/order-details-header.d.ts +104 -0
- package/dist/matter/order-details-header/order-details-header.js +190 -0
- package/dist/matter/order-details-header/order-details-header.js.map +1 -0
- package/dist/matter/order-list/customer-orders-filter.d.ts +12 -0
- package/dist/matter/order-list/customer-orders-filter.js +30 -0
- package/dist/matter/order-list/customer-orders-filter.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +121 -0
- package/dist/matter/order-list/order-list.js +395 -0
- package/dist/matter/order-list/order-list.js.map +1 -0
- package/dist/matter/order-list-row/order-list-row.d.ts +44 -0
- package/dist/matter/order-list-row/order-list-row.js +127 -0
- package/dist/matter/order-list-row/order-list-row.js.map +1 -0
- package/dist/matter/order-list-search/order-list-search.d.ts +72 -0
- package/dist/matter/order-list-search/order-list-search.js +296 -0
- package/dist/matter/order-list-search/order-list-search.js.map +1 -0
- package/dist/matter/order-list-views/order-list-views.d.ts +65 -0
- package/dist/matter/order-list-views/order-list-views.js +154 -0
- package/dist/matter/order-list-views/order-list-views.js.map +1 -0
- package/dist/matter/order-payment/order-payment.d.ts +83 -0
- package/dist/matter/order-payment/order-payment.js +258 -0
- package/dist/matter/order-payment/order-payment.js.map +1 -0
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +145 -0
- package/dist/matter/order-placed/order-placed-deliveries.js +380 -0
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -0
- package/dist/matter/order-placed/order-placed.d.ts +122 -0
- package/dist/matter/order-placed/order-placed.js +452 -0
- package/dist/matter/order-placed/order-placed.js.map +1 -0
- package/dist/matter/order-placed-date/order-placed-date.d.ts +45 -0
- package/dist/matter/order-placed-date/order-placed-date.js +92 -0
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -0
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +5 -8
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +29 -81
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +85 -0
- package/dist/matter/order-progress/order-progress.js +203 -0
- package/dist/matter/order-progress/order-progress.js.map +1 -0
- package/dist/matter/order-summary/order-summary.d.ts +81 -0
- package/dist/matter/order-summary/order-summary.js +192 -0
- package/dist/matter/order-summary/order-summary.js.map +1 -0
- package/dist/matter/payment/cardholder-document-rule.d.ts +35 -0
- package/dist/matter/payment/cardholder-document-rule.js +35 -0
- package/dist/matter/payment/cardholder-document-rule.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +38 -23
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.js +12 -0
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +4 -2
- package/dist/matter/payment/payment-method-badges.js.map +1 -1
- package/dist/matter/payment/payment.js +12 -0
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +39 -0
- package/dist/matter/payment/use-payment-method-selection.js +30 -2
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +16 -2
- package/dist/matter/payment/use-payment-submit-gate.js +42 -14
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +12 -7
- package/dist/matter/place-order/place-order.js +126 -103
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.js +5 -5
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +61 -31
- package/dist/matter/product-shelf/product-shelf.js +157 -57
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.js +1 -1
- package/dist/matter/saved-cards/saved-cards.js +27 -15
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/session/session.js +2 -2
- package/dist/matter/session/session.js.map +1 -1
- package/dist/matter/shipping-address/country-descriptors.d.ts +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +23 -1
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/shipping-address.js +63 -15
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in-redirect/sign-in-redirect.js +48 -10
- package/dist/matter/sign-in-redirect/sign-in-redirect.js.map +1 -1
- package/dist/matter/variant-selector/variant-selector.js +2 -2
- package/dist/matter/variant-selector/variant-selector.js.map +1 -1
- package/dist/particles/address-summary/address-summary.js +2 -2
- package/dist/particles/address-summary/address-summary.js.map +1 -1
- package/dist/particles/alert-dialog/alert-dialog.d.ts +5 -1
- package/dist/particles/alert-dialog/alert-dialog.js +5 -2
- package/dist/particles/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/particles/avatar/avatar.d.ts +17 -0
- package/dist/particles/avatar/avatar.js +65 -0
- package/dist/particles/avatar/avatar.js.map +1 -0
- package/dist/particles/copy-text/copy-text.d.ts +28 -0
- package/dist/particles/copy-text/copy-text.js +140 -0
- package/dist/particles/copy-text/copy-text.js.map +1 -0
- package/dist/particles/document-field/document-field.d.ts +34 -5
- package/dist/particles/document-field/document-field.js +115 -19
- package/dist/particles/document-field/document-field.js.map +1 -1
- package/dist/particles/field/field.js +1 -1
- package/dist/particles/field/field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.d.ts +6 -2
- package/dist/particles/footer-link-group/footer-link-group.js +18 -7
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/incentives/incentives.d.ts +6 -2
- package/dist/particles/incentives/incentives.js +7 -2
- package/dist/particles/incentives/incentives.js.map +1 -1
- package/dist/particles/logo/logo.d.ts +3 -2
- package/dist/particles/logo/logo.js +20 -8
- package/dist/particles/logo/logo.js.map +1 -1
- package/dist/particles/navigation-link/navigation-link.d.ts +2 -3
- package/dist/particles/navigation-link/navigation-link.js +4 -4
- package/dist/particles/navigation-link/navigation-link.js.map +1 -1
- package/dist/particles/navigation-link-list/navigation-link-list.d.ts +6 -2
- package/dist/particles/navigation-link-list/navigation-link-list.js +18 -7
- package/dist/particles/navigation-link-list/navigation-link-list.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +28 -0
- package/dist/particles/order-details-back/order-details-back.js +52 -0
- package/dist/particles/order-details-back/order-details-back.js.map +1 -0
- package/dist/particles/order-status-badge/order-status-badge.d.ts +19 -0
- package/dist/particles/order-status-badge/order-status-badge.js +50 -0
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -0
- package/dist/particles/phone-field/phone-field.js +2 -2
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/select/select.js +6 -6
- package/dist/particles/select/select.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +1 -1
- package/dist/particles/toast/toast.js +32 -6
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +1079 -54
- package/dist/sdk/actions/address-action-provider.d.ts +16 -0
- package/dist/sdk/actions/address-action-provider.js +20 -0
- package/dist/sdk/actions/address-action-provider.js.map +1 -0
- package/dist/sdk/actions/analytics-action-provider.js +1 -1
- package/dist/sdk/actions/index.d.ts +3 -1
- package/dist/sdk/actions/index.js +3 -1
- package/dist/sdk/actions/order-action-provider.d.ts +12 -0
- package/dist/sdk/actions/order-action-provider.js +16 -0
- package/dist/sdk/actions/order-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +6 -2
- package/dist/sdk/address/address-fields.js +38 -0
- package/dist/sdk/address/address-fields.js.map +1 -0
- package/dist/sdk/address/checkout-readiness.js +17 -0
- package/dist/sdk/address/checkout-readiness.js.map +1 -0
- package/dist/sdk/address/constants.js +60 -0
- package/dist/sdk/address/constants.js.map +1 -0
- package/dist/sdk/address/country-display.js +19 -0
- package/dist/sdk/address/country-display.js.map +1 -0
- package/dist/sdk/address/country-rules.js +30 -0
- package/dist/sdk/address/country-rules.js.map +1 -0
- package/dist/sdk/address/format-address.js +18 -0
- package/dist/sdk/address/format-address.js.map +1 -0
- package/dist/sdk/address/iso-countries.js +262 -0
- package/dist/sdk/address/iso-countries.js.map +1 -0
- package/dist/sdk/address/layouts.js +56 -0
- package/dist/sdk/address/layouts.js.map +1 -0
- package/dist/sdk/address/messages.js +97 -0
- package/dist/sdk/address/messages.js.map +1 -0
- package/dist/sdk/address/operations.d.ts +54 -0
- package/dist/sdk/address/operations.js +83 -0
- package/dist/sdk/address/operations.js.map +1 -0
- package/dist/sdk/address/postal-code-lookup-operations.js +23 -0
- package/dist/sdk/address/postal-code-lookup-operations.js.map +1 -0
- package/dist/sdk/address/postal-code.js +11 -0
- package/dist/sdk/address/postal-code.js.map +1 -0
- package/dist/sdk/address/schema.js +14 -0
- package/dist/sdk/address/schema.js.map +1 -0
- package/dist/sdk/address/server-fields.js +25 -0
- package/dist/sdk/address/server-fields.js.map +1 -0
- package/dist/sdk/address/switch-country.js +57 -0
- package/dist/sdk/address/switch-country.js.map +1 -0
- package/dist/sdk/address/types.d.ts +26 -0
- package/dist/sdk/address/use-address-actions.d.ts +29 -0
- package/dist/sdk/address/use-address-actions.js +247 -0
- package/dist/sdk/address/use-address-actions.js.map +1 -0
- package/dist/sdk/address/use-address-by-postal-code.js +57 -0
- package/dist/sdk/address/use-address-by-postal-code.js.map +1 -0
- package/dist/sdk/address/validate-address.js +62 -0
- package/dist/sdk/address/validate-address.js.map +1 -0
- package/dist/sdk/analytics/use-analytics-actions.js +2 -1
- package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
- package/dist/sdk/cache/storefront-cache.js +29 -4
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.js +9 -8
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-validate-on-open.js +2 -1
- package/dist/sdk/cart/use-cart-validate-on-open.js.map +1 -1
- package/dist/sdk/client/fetch-page-data.d.ts +11 -0
- package/dist/sdk/client/fetch-page-data.js +12 -1
- package/dist/sdk/client/fetch-page-data.js.map +1 -1
- package/dist/sdk/content/create-content-runtime.d.ts +22 -1
- package/dist/sdk/content/create-content-runtime.js +90 -9
- package/dist/sdk/content/create-content-runtime.js.map +1 -1
- package/dist/sdk/data/empty-content-value.js +16 -0
- package/dist/sdk/data/empty-content-value.js.map +1 -0
- package/dist/sdk/data/failed-fields.js +23 -0
- package/dist/sdk/data/failed-fields.js.map +1 -0
- package/dist/sdk/data/hot-data-provider.js +2 -1
- package/dist/sdk/data/hot-data-provider.js.map +1 -1
- package/dist/sdk/data/index.js +1 -1
- package/dist/sdk/data/page-reactive-data-root.d.ts +45 -7
- package/dist/sdk/data/page-reactive-data-root.js +88 -12
- package/dist/sdk/data/page-reactive-data-root.js.map +1 -1
- package/dist/sdk/data/variables-from-content.d.ts +43 -0
- package/dist/sdk/data/variables-from-content.js +57 -0
- package/dist/sdk/data/variables-from-content.js.map +1 -0
- package/dist/sdk/generated/fragment-types.js +2 -0
- package/dist/sdk/generated/fragment-types.js.map +1 -1
- package/dist/sdk/generated/gql.js +4 -1
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +8 -0
- package/dist/sdk/generated/graphql.js +296 -1
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/messages/en-US.js +138 -1
- package/dist/sdk/i18n/messages/en-US.json +138 -1
- package/dist/sdk/i18n/messages/en-US.json.d.ts +137 -0
- package/dist/sdk/i18n/messages/es-ES.js +138 -1
- package/dist/sdk/i18n/messages/es-ES.json +138 -1
- package/dist/sdk/i18n/messages/pt-BR.js +138 -1
- package/dist/sdk/i18n/messages/pt-BR.json +138 -1
- package/dist/sdk/identity/use-identity-actions.js +5 -4
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/navigation/current-page.js +30 -0
- package/dist/sdk/navigation/current-page.js.map +1 -0
- package/dist/sdk/navigation/not-found-log.d.ts +28 -0
- package/dist/sdk/navigation/not-found-log.js +133 -0
- package/dist/sdk/navigation/not-found-log.js.map +1 -0
- package/dist/sdk/navigation/path.js +25 -0
- package/dist/sdk/navigation/path.js.map +1 -0
- package/dist/sdk/navigation/redirect.d.ts +11 -0
- package/dist/sdk/navigation/redirect.js +22 -0
- package/dist/sdk/navigation/redirect.js.map +1 -0
- package/dist/sdk/navigation/report.js +70 -0
- package/dist/sdk/navigation/report.js.map +1 -0
- package/dist/sdk/navigation/resolve-storefront-href.d.ts +12 -0
- package/dist/sdk/navigation/resolve-storefront-href.js +214 -0
- package/dist/sdk/navigation/resolve-storefront-href.js.map +1 -0
- package/dist/sdk/navigation/route-identity-provider.d.ts +11 -0
- package/dist/sdk/navigation/route-identity-provider.js +20 -0
- package/dist/sdk/navigation/route-identity-provider.js.map +1 -0
- package/dist/sdk/navigation/route-map-provider.d.ts +19 -0
- package/dist/sdk/navigation/route-map-provider.js +29 -0
- package/dist/sdk/navigation/route-map-provider.js.map +1 -0
- package/dist/sdk/navigation/storefront-link.d.ts +16 -0
- package/dist/sdk/navigation/storefront-link.js +66 -0
- package/dist/sdk/navigation/storefront-link.js.map +1 -0
- package/dist/sdk/navigation/types.d.ts +45 -0
- package/dist/sdk/navigation/use-storefront-navigation.d.ts +26 -0
- package/dist/sdk/navigation/use-storefront-navigation.js +73 -0
- package/dist/sdk/navigation/use-storefront-navigation.js.map +1 -0
- package/dist/sdk/navigation/use-storefront-route.d.ts +26 -0
- package/dist/sdk/navigation/use-storefront-route.js +87 -0
- package/dist/sdk/navigation/use-storefront-route.js.map +1 -0
- package/dist/sdk/navigation/use-storefront-search-params.d.ts +11 -0
- package/dist/sdk/navigation/use-storefront-search-params.js +16 -0
- package/dist/sdk/navigation/use-storefront-search-params.js.map +1 -0
- package/dist/sdk/orders/completion-badge.d.ts +8 -0
- package/dist/sdk/orders/completion-badge.js +47 -0
- package/dist/sdk/orders/completion-badge.js.map +1 -0
- package/dist/sdk/orders/order-operations.d.ts +19 -0
- package/dist/sdk/orders/order-operations.js +21 -0
- package/dist/sdk/orders/order-operations.js.map +1 -0
- package/dist/sdk/orders/use-order-actions.d.ts +23 -0
- package/dist/sdk/orders/use-order-actions.js +62 -0
- package/dist/sdk/orders/use-order-actions.js.map +1 -0
- package/dist/sdk/payment/gateway-origin.js +26 -13
- package/dist/sdk/payment/gateway-origin.js.map +1 -1
- package/dist/sdk/payment/gateway.d.ts +14 -2
- package/dist/sdk/payment/gateway.js +32 -14
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.js +11 -0
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/submission-registry.d.ts +2 -1
- package/dist/sdk/payment/submission-registry.js +12 -8
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +5 -3
- package/dist/sdk/payment/use-payment-actions.js +6 -3
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +6 -3
- package/dist/sdk/payment/use-place-order.js +334 -144
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/region/use-region-actions.js +2 -1
- package/dist/sdk/region/use-region-actions.js.map +1 -1
- package/dist/sdk/seo/page-alternates.d.ts +55 -0
- package/dist/sdk/seo/page-alternates.js +132 -0
- package/dist/sdk/seo/page-alternates.js.map +1 -0
- package/dist/sdk/session/read-server-session.d.ts +21 -0
- package/dist/sdk/session/read-server-session.js +61 -0
- package/dist/sdk/session/read-server-session.js.map +1 -0
- package/dist/sdk/session/use-session-actions.js +5 -4
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/session/use-session-revalidation.js +2 -1
- package/dist/sdk/session/use-session-revalidation.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.js +3 -2
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/utils/own-value.js +19 -0
- package/dist/utils/own-value.js.map +1 -0
- package/dist/utils/safe-href.d.ts +11 -0
- package/dist/utils/safe-href.js +31 -22
- package/dist/utils/safe-href.js.map +1 -1
- package/package.json +17 -2
- package/skills/storefront-asset/SKILL.md +111 -0
- package/skills/storefront-asset/references/api-side.md +153 -0
- package/skills/storefront-asset/references/findings.md +40 -0
- package/skills/storefront-asset/references/ui-side.md +94 -0
- package/src/styles/tailwind.css +27 -0
|
@@ -1,8 +1,143 @@
|
|
|
1
1
|
{
|
|
2
2
|
"fs/a11y.close": "Cerrar",
|
|
3
|
+
"fs/address-book.empty": "Todavía no tienes direcciones guardadas.",
|
|
4
|
+
"fs/address-book.error": "No pudimos cargar tus direcciones.",
|
|
5
|
+
"fs/address-book.loading": "Cargando tus direcciones…",
|
|
6
|
+
"fs/address-book.profile-notice": "Tus direcciones guardadas no se ofrecerán al finalizar la compra hasta que tu perfil tenga un número de teléfono.",
|
|
7
|
+
"fs/address-book.profile-notice.link": "Completa tu perfil",
|
|
8
|
+
"fs/address-book.retry": "Intentar de nuevo",
|
|
9
|
+
"fs/address-book.undeliverable": "Por el momento, no hacemos entregas en este país.",
|
|
10
|
+
"fs/address-delete.cancel": "Cancelar",
|
|
11
|
+
"fs/address-delete.confirm": "Eliminar",
|
|
12
|
+
"fs/address-delete.deleted": "Dirección eliminada.",
|
|
13
|
+
"fs/address-delete.description": "Esta acción no se puede deshacer.",
|
|
14
|
+
"fs/address-delete.error.failed": "No pudimos eliminar esta dirección. Inténtalo de nuevo.",
|
|
15
|
+
"fs/address-delete.error.unauthorized": "Tu sesión caducó. Inicia sesión de nuevo para eliminar esta dirección.",
|
|
16
|
+
"fs/address-delete.title": "¿Eliminar esta dirección?",
|
|
17
|
+
"fs/address-delete.trigger": "Eliminar",
|
|
18
|
+
"fs/address-form.add": "Añadir dirección",
|
|
19
|
+
"fs/address-form.added": "Dirección añadida.",
|
|
20
|
+
"fs/address-form.cancel": "Cancelar",
|
|
21
|
+
"fs/address-form.country": "País",
|
|
22
|
+
"fs/address-form.country-notice": "{count, plural, one {Este campo no se pasa a una dirección en {country}: {fields}. Vuelve si cambias de nuevo a {previous}.} other {Estos campos no se pasan a una dirección en {country}: {fields}. Vuelven si cambias de nuevo a {previous}.}}",
|
|
23
|
+
"fs/address-form.edit": "Editar",
|
|
24
|
+
"fs/address-form.error.country-switch-failed": "No pudimos cambiar el país. Inténtalo de nuevo.",
|
|
25
|
+
"fs/address-form.error.not-found": "Esta dirección ya no existe.",
|
|
26
|
+
"fs/address-form.error.rules-failed": "No pudimos cargar este formulario. Ciérralo e inténtalo de nuevo.",
|
|
27
|
+
"fs/address-form.error.save-failed": "No pudimos guardar esta dirección. Inténtalo de nuevo.",
|
|
28
|
+
"fs/address-form.error.unauthorized": "Tu sesión expiró. Inicia sesión de nuevo para guardar esta dirección.",
|
|
29
|
+
"fs/address-form.error.unrendered-field": "Esta dirección necesita datos que este formulario no puede mostrar, por lo que no se guardó.",
|
|
30
|
+
"fs/address-form.error.unsupported-country": "La tienda no hace entregas a este país.",
|
|
31
|
+
"fs/address-form.saved": "Dirección guardada.",
|
|
32
|
+
"fs/address-form.status.failed": "Dirección no guardada.",
|
|
33
|
+
"fs/address-form.status.fields": "Dirección no guardada. {count, plural, one {# campo necesita atención.} other {# campos necesitan atención.}}",
|
|
34
|
+
"fs/address-form.status.filled": "{count, plural, one {# campo rellenado a partir del código postal.} other {# campos rellenados a partir del código postal.}}",
|
|
35
|
+
"fs/address-form.submit": "Guardar",
|
|
36
|
+
"fs/address-form.title.add": "Añadir dirección",
|
|
37
|
+
"fs/address-form.title.edit": "Editar dirección",
|
|
38
|
+
"fs/address-record.error": "No pudimos cargar esta dirección.",
|
|
39
|
+
"fs/address.error.cep": "Ingresa un CEP válido (ejemplo: {example}).",
|
|
40
|
+
"fs/address.error.invalid": "Revisa este campo.",
|
|
41
|
+
"fs/address.error.postal-code": "Ingresa un código postal válido (ejemplo: {example}).",
|
|
42
|
+
"fs/address.error.required": "Campo obligatorio.",
|
|
43
|
+
"fs/address.error.too-long": "Usa como máximo {maxLength, number} caracteres.",
|
|
44
|
+
"fs/address.field.cep": "CEP",
|
|
45
|
+
"fs/address.field.city": "Ciudad",
|
|
46
|
+
"fs/address.field.commune": "Comuna",
|
|
47
|
+
"fs/address.field.complement": "Información adicional (opcional)",
|
|
48
|
+
"fs/address.field.county": "Condado",
|
|
49
|
+
"fs/address.field.department": "Departamento",
|
|
50
|
+
"fs/address.field.district": "Distrito",
|
|
51
|
+
"fs/address.field.municipality": "Municipio",
|
|
52
|
+
"fs/address.field.name": "Nombre de la dirección (opcional)",
|
|
53
|
+
"fs/address.field.neighborhood": "Barrio",
|
|
54
|
+
"fs/address.field.number": "Número",
|
|
55
|
+
"fs/address.field.postal-code": "Código postal",
|
|
56
|
+
"fs/address.field.postcode": "Código postal",
|
|
57
|
+
"fs/address.field.province": "Provincia",
|
|
58
|
+
"fs/address.field.recipient-name": "Nombre del destinatario",
|
|
59
|
+
"fs/address.field.reference": "Referencia (opcional)",
|
|
60
|
+
"fs/address.field.region": "Región",
|
|
61
|
+
"fs/address.field.state": "Estado",
|
|
62
|
+
"fs/address.field.street": "Calle",
|
|
63
|
+
"fs/address.field.town": "Pueblo / ciudad",
|
|
64
|
+
"fs/address.placeholder.postal-code": "Ejemplo: {example}",
|
|
65
|
+
"fs/address.placeholder.street": "Dirección línea 1",
|
|
3
66
|
"fs/form.clear": "Limpiar",
|
|
4
67
|
"fs/form.reset": "Restablecer",
|
|
5
68
|
"fs/form.submit": "Continuar",
|
|
69
|
+
"fs/order-cancel.confirm": "Cancelar pedido",
|
|
70
|
+
"fs/order-cancel.description": "Esta acción no se puede deshacer.",
|
|
71
|
+
"fs/order-cancel.dismiss": "Conservar pedido",
|
|
72
|
+
"fs/order-cancel.dismiss-message": "Descartar",
|
|
73
|
+
"fs/order-cancel.failure": "No se pudo cancelar el pedido. Inténtalo de nuevo.",
|
|
74
|
+
"fs/order-cancel.other": "Otro",
|
|
75
|
+
"fs/order-cancel.other-field": "Motivo",
|
|
76
|
+
"fs/order-cancel.reason.better-price": "Encontré un mejor precio",
|
|
77
|
+
"fs/order-cancel.reason.bought-by-mistake": "Lo compré por error",
|
|
78
|
+
"fs/order-cancel.reason.changed-mind": "Cambié de opinión",
|
|
79
|
+
"fs/order-cancel.reason.slow-delivery": "La entrega está tardando",
|
|
80
|
+
"fs/order-cancel.success": "Tu pedido fue cancelado.",
|
|
81
|
+
"fs/order-cancel.title": "¿Cancelar este pedido?",
|
|
82
|
+
"fs/order-cancel.trigger": "Cancelar pedido",
|
|
83
|
+
"fs/order-delivery-address.delivery": "Dirección de entrega",
|
|
84
|
+
"fs/order-delivery-address.store": "Dirección de la tienda",
|
|
85
|
+
"fs/order-delivery-group.channel.delivery": "Entrega",
|
|
86
|
+
"fs/order-delivery-group.channel.pickup-in-point": "Retiro",
|
|
87
|
+
"fs/order-delivery-group.estimate": "Entrega estimada",
|
|
88
|
+
"fs/order-delivery-group.items": "{count, plural, one {# artículo} other {# artículos}}",
|
|
89
|
+
"fs/order-delivery-group.label": "Entregas",
|
|
90
|
+
"fs/order-delivery-group.list-price": "Precio de lista",
|
|
91
|
+
"fs/order-delivery-group.quantity": "Cantidad",
|
|
92
|
+
"fs/order-delivery-group.subtotal": "Subtotal",
|
|
93
|
+
"fs/order-delivery-group.tax": "Impuesto",
|
|
94
|
+
"fs/order-delivery-group.total": "Total",
|
|
95
|
+
"fs/order-delivery-group.unit-price": "Precio unitario",
|
|
96
|
+
"fs/order-list.column.estimate": "Estimación",
|
|
97
|
+
"fs/order-list.column.id": "Pedido",
|
|
98
|
+
"fs/order-list.column.items": "Artículos",
|
|
99
|
+
"fs/order-list.column.placed": "Fecha",
|
|
100
|
+
"fs/order-list.column.status": "Estado",
|
|
101
|
+
"fs/order-list.column.total": "Total",
|
|
102
|
+
"fs/order-payment.bank-invoice.number": "Número del recibo bancario",
|
|
103
|
+
"fs/order-payment.bank-invoice.print": "Imprimir recibo bancario",
|
|
104
|
+
"fs/order-payment.empty": "Ningún pago registrado",
|
|
105
|
+
"fs/order-payment.heading": "Pago",
|
|
106
|
+
"fs/order-payment.installments": "{count}x {amount}",
|
|
107
|
+
"fs/order-payment.method.placeholder": "Método de pago no disponible",
|
|
108
|
+
"fs/order-payment.redemption-code": "Código de la tarjeta regalo",
|
|
109
|
+
"fs/order-status.cancellation-requested": "Cancelación solicitada",
|
|
110
|
+
"fs/order-status.cancelled": "Cancelado",
|
|
111
|
+
"fs/order-status.collected": "Retirado",
|
|
112
|
+
"fs/order-status.delivered": "Entregado",
|
|
113
|
+
"fs/order-status.in-progress": "En curso",
|
|
114
|
+
"fs/order-status.placeholder": "Estado no disponible",
|
|
115
|
+
"fs/order-status.ready-for-pickup": "Listo para retirar",
|
|
116
|
+
"fs/order-status.shipped": "Enviado",
|
|
117
|
+
"fs/order.back-to-orders": "Volver a los pedidos",
|
|
118
|
+
"fs/order.copy.action": "Copiar",
|
|
119
|
+
"fs/order.copy.copied": "Copiado",
|
|
120
|
+
"fs/order.copy.dismiss": "Descartar",
|
|
121
|
+
"fs/order.copy.failure": "No se pudo copiar",
|
|
122
|
+
"fs/order.number.copy-name": "Copiar número de pedido",
|
|
123
|
+
"fs/order.number.prefix": "Pedido n.º",
|
|
124
|
+
"fs/order.placed-at": "Pedido realizado",
|
|
125
|
+
"fs/order.progress.label": "Progreso del pedido",
|
|
126
|
+
"fs/order.stage-state.current": "En curso",
|
|
127
|
+
"fs/order.stage-state.done": "Completado",
|
|
128
|
+
"fs/order.stage-state.pending": "No iniciado",
|
|
129
|
+
"fs/order.stage.payment": "Pago",
|
|
130
|
+
"fs/order.stage.placed": "Pedido realizado",
|
|
131
|
+
"fs/order.stage.processing": "Preparación",
|
|
132
|
+
"fs/order.stage.shipping": "Envío",
|
|
133
|
+
"fs/order.totals.change": "Cambio",
|
|
134
|
+
"fs/order.totals.discounts": "Descuentos",
|
|
135
|
+
"fs/order.totals.grand-total": "Total",
|
|
136
|
+
"fs/order.totals.heading": "Resumen",
|
|
137
|
+
"fs/order.totals.interest": "Intereses",
|
|
138
|
+
"fs/order.totals.items": "Productos",
|
|
139
|
+
"fs/order.totals.shipping": "Envío",
|
|
140
|
+
"fs/order.totals.tax": "Impuestos",
|
|
6
141
|
"fs/region.error.invalid-postal-code": "Introduce un código postal válido.",
|
|
7
142
|
"fs/region.error.network": "No se pudo definir tu región. Inténtalo de nuevo.",
|
|
8
143
|
"fs/region.error.unserved-postal-code": "Todavía no hacemos entregas en este código postal.",
|
|
@@ -18,5 +153,7 @@
|
|
|
18
153
|
"fs/shipping.free-price": "Gratis",
|
|
19
154
|
"fs/shipping.no-options": "No hay opciones de entrega disponibles para esta dirección.",
|
|
20
155
|
"fs/shipping.postal-code.aria-label": "Código postal",
|
|
21
|
-
"fs/shipping.postal-code.placeholder": "Introduce tu código postal"
|
|
156
|
+
"fs/shipping.postal-code.placeholder": "Introduce tu código postal",
|
|
157
|
+
"fs/toast.dismiss": "Cerrar",
|
|
158
|
+
"fs/toast.region": "Notificaciones"
|
|
22
159
|
}
|
|
@@ -1,9 +1,144 @@
|
|
|
1
1
|
//#region src/sdk/i18n/messages/pt-BR.json
|
|
2
2
|
var pt_BR_default = {
|
|
3
3
|
"fs/a11y.close": "Fechar",
|
|
4
|
+
"fs/address-book.empty": "Você ainda não tem endereços salvos.",
|
|
5
|
+
"fs/address-book.error": "Não foi possível carregar seus endereços.",
|
|
6
|
+
"fs/address-book.loading": "Carregando seus endereços…",
|
|
7
|
+
"fs/address-book.profile-notice": "Seus endereços salvos não serão oferecidos no checkout até que seu perfil tenha um telefone.",
|
|
8
|
+
"fs/address-book.profile-notice.link": "Complete seu perfil",
|
|
9
|
+
"fs/address-book.retry": "Tentar novamente",
|
|
10
|
+
"fs/address-book.undeliverable": "No momento, não entregamos neste país.",
|
|
11
|
+
"fs/address-delete.cancel": "Cancelar",
|
|
12
|
+
"fs/address-delete.confirm": "Excluir",
|
|
13
|
+
"fs/address-delete.deleted": "Endereço excluído.",
|
|
14
|
+
"fs/address-delete.description": "Esta ação não pode ser desfeita.",
|
|
15
|
+
"fs/address-delete.error.failed": "Não foi possível excluir este endereço. Tente novamente.",
|
|
16
|
+
"fs/address-delete.error.unauthorized": "Sua sessão expirou. Entre novamente para excluir este endereço.",
|
|
17
|
+
"fs/address-delete.title": "Excluir este endereço?",
|
|
18
|
+
"fs/address-delete.trigger": "Excluir",
|
|
19
|
+
"fs/address-form.add": "Adicionar endereço",
|
|
20
|
+
"fs/address-form.added": "Endereço adicionado.",
|
|
21
|
+
"fs/address-form.cancel": "Cancelar",
|
|
22
|
+
"fs/address-form.country": "País",
|
|
23
|
+
"fs/address-form.country-notice": "{count, plural, one {Este campo não passa para um endereço em {country}: {fields}. Ele volta se você trocar de novo para {previous}.} other {Estes campos não passam para um endereço em {country}: {fields}. Eles voltam se você trocar de novo para {previous}.}}",
|
|
24
|
+
"fs/address-form.edit": "Editar",
|
|
25
|
+
"fs/address-form.error.country-switch-failed": "Não foi possível trocar o país. Tente de novo.",
|
|
26
|
+
"fs/address-form.error.not-found": "Este endereço não existe mais.",
|
|
27
|
+
"fs/address-form.error.rules-failed": "Não foi possível carregar este formulário. Feche-o e tente novamente.",
|
|
28
|
+
"fs/address-form.error.save-failed": "Não foi possível salvar este endereço. Tente novamente.",
|
|
29
|
+
"fs/address-form.error.unauthorized": "Sua sessão expirou. Entre novamente para salvar este endereço.",
|
|
30
|
+
"fs/address-form.error.unrendered-field": "Este endereço precisa de informações que este formulário não consegue mostrar, então ele não foi salvo.",
|
|
31
|
+
"fs/address-form.error.unsupported-country": "A loja não entrega neste país.",
|
|
32
|
+
"fs/address-form.saved": "Endereço salvo.",
|
|
33
|
+
"fs/address-form.status.failed": "Endereço não salvo.",
|
|
34
|
+
"fs/address-form.status.fields": "Endereço não salvo. {count, plural, one {# campo precisa de atenção.} other {# campos precisam de atenção.}}",
|
|
35
|
+
"fs/address-form.status.filled": "{count, plural, one {# campo preenchido a partir do CEP.} other {# campos preenchidos a partir do CEP.}}",
|
|
36
|
+
"fs/address-form.submit": "Salvar",
|
|
37
|
+
"fs/address-form.title.add": "Adicionar endereço",
|
|
38
|
+
"fs/address-form.title.edit": "Editar endereço",
|
|
39
|
+
"fs/address-record.error": "Não foi possível carregar este endereço.",
|
|
40
|
+
"fs/address.error.cep": "Informe um CEP válido (exemplo: {example}).",
|
|
41
|
+
"fs/address.error.invalid": "Confira este campo.",
|
|
42
|
+
"fs/address.error.postal-code": "Informe um código postal válido (exemplo: {example}).",
|
|
43
|
+
"fs/address.error.required": "Campo obrigatório.",
|
|
44
|
+
"fs/address.error.too-long": "Use no máximo {maxLength, number} caracteres.",
|
|
45
|
+
"fs/address.field.cep": "CEP",
|
|
46
|
+
"fs/address.field.city": "Cidade",
|
|
47
|
+
"fs/address.field.commune": "Comuna",
|
|
48
|
+
"fs/address.field.complement": "Complemento (opcional)",
|
|
49
|
+
"fs/address.field.county": "Condado",
|
|
50
|
+
"fs/address.field.department": "Departamento",
|
|
51
|
+
"fs/address.field.district": "Distrito",
|
|
52
|
+
"fs/address.field.municipality": "Município",
|
|
53
|
+
"fs/address.field.name": "Nome do endereço (opcional)",
|
|
54
|
+
"fs/address.field.neighborhood": "Bairro",
|
|
55
|
+
"fs/address.field.number": "Número",
|
|
56
|
+
"fs/address.field.postal-code": "Código postal",
|
|
57
|
+
"fs/address.field.postcode": "Código postal",
|
|
58
|
+
"fs/address.field.province": "Província",
|
|
59
|
+
"fs/address.field.recipient-name": "Nome do destinatário",
|
|
60
|
+
"fs/address.field.reference": "Referência (opcional)",
|
|
61
|
+
"fs/address.field.region": "Região",
|
|
62
|
+
"fs/address.field.state": "Estado",
|
|
63
|
+
"fs/address.field.street": "Endereço",
|
|
64
|
+
"fs/address.field.town": "Cidade",
|
|
65
|
+
"fs/address.placeholder.postal-code": "Exemplo: {example}",
|
|
66
|
+
"fs/address.placeholder.street": "Endereço",
|
|
4
67
|
"fs/form.clear": "Limpar",
|
|
5
68
|
"fs/form.reset": "Redefinir",
|
|
6
69
|
"fs/form.submit": "Continuar",
|
|
70
|
+
"fs/order-cancel.confirm": "Cancelar pedido",
|
|
71
|
+
"fs/order-cancel.description": "Esta ação não pode ser desfeita.",
|
|
72
|
+
"fs/order-cancel.dismiss": "Manter pedido",
|
|
73
|
+
"fs/order-cancel.dismiss-message": "Dispensar",
|
|
74
|
+
"fs/order-cancel.failure": "Não foi possível cancelar o pedido. Tente novamente.",
|
|
75
|
+
"fs/order-cancel.other": "Outro",
|
|
76
|
+
"fs/order-cancel.other-field": "Motivo",
|
|
77
|
+
"fs/order-cancel.reason.better-price": "Encontrei um preço melhor",
|
|
78
|
+
"fs/order-cancel.reason.bought-by-mistake": "Comprei por engano",
|
|
79
|
+
"fs/order-cancel.reason.changed-mind": "Mudei de ideia",
|
|
80
|
+
"fs/order-cancel.reason.slow-delivery": "A entrega está demorando",
|
|
81
|
+
"fs/order-cancel.success": "Seu pedido foi cancelado.",
|
|
82
|
+
"fs/order-cancel.title": "Cancelar este pedido?",
|
|
83
|
+
"fs/order-cancel.trigger": "Cancelar pedido",
|
|
84
|
+
"fs/order-delivery-address.delivery": "Endereço de entrega",
|
|
85
|
+
"fs/order-delivery-address.store": "Endereço da loja",
|
|
86
|
+
"fs/order-delivery-group.channel.delivery": "Entrega",
|
|
87
|
+
"fs/order-delivery-group.channel.pickup-in-point": "Retirada",
|
|
88
|
+
"fs/order-delivery-group.estimate": "Previsão de entrega",
|
|
89
|
+
"fs/order-delivery-group.items": "{count, plural, one {# item} other {# itens}}",
|
|
90
|
+
"fs/order-delivery-group.label": "Entregas",
|
|
91
|
+
"fs/order-delivery-group.list-price": "Preço de lista",
|
|
92
|
+
"fs/order-delivery-group.quantity": "Quantidade",
|
|
93
|
+
"fs/order-delivery-group.subtotal": "Subtotal",
|
|
94
|
+
"fs/order-delivery-group.tax": "Imposto",
|
|
95
|
+
"fs/order-delivery-group.total": "Total",
|
|
96
|
+
"fs/order-delivery-group.unit-price": "Preço unitário",
|
|
97
|
+
"fs/order-list.column.estimate": "Previsão",
|
|
98
|
+
"fs/order-list.column.id": "Pedido",
|
|
99
|
+
"fs/order-list.column.items": "Itens",
|
|
100
|
+
"fs/order-list.column.placed": "Data",
|
|
101
|
+
"fs/order-list.column.status": "Status",
|
|
102
|
+
"fs/order-list.column.total": "Total",
|
|
103
|
+
"fs/order-payment.bank-invoice.number": "Número do boleto",
|
|
104
|
+
"fs/order-payment.bank-invoice.print": "Imprimir boleto",
|
|
105
|
+
"fs/order-payment.empty": "Nenhum pagamento registrado",
|
|
106
|
+
"fs/order-payment.heading": "Pagamento",
|
|
107
|
+
"fs/order-payment.installments": "{count}x {amount}",
|
|
108
|
+
"fs/order-payment.method.placeholder": "Forma de pagamento indisponível",
|
|
109
|
+
"fs/order-payment.redemption-code": "Código do vale-presente",
|
|
110
|
+
"fs/order-status.cancellation-requested": "Cancelamento solicitado",
|
|
111
|
+
"fs/order-status.cancelled": "Cancelado",
|
|
112
|
+
"fs/order-status.collected": "Retirado",
|
|
113
|
+
"fs/order-status.delivered": "Entregue",
|
|
114
|
+
"fs/order-status.in-progress": "Em andamento",
|
|
115
|
+
"fs/order-status.placeholder": "Status indisponível",
|
|
116
|
+
"fs/order-status.ready-for-pickup": "Pronto para retirada",
|
|
117
|
+
"fs/order-status.shipped": "Enviado",
|
|
118
|
+
"fs/order.back-to-orders": "Voltar aos pedidos",
|
|
119
|
+
"fs/order.copy.action": "Copiar",
|
|
120
|
+
"fs/order.copy.copied": "Copiado",
|
|
121
|
+
"fs/order.copy.dismiss": "Dispensar",
|
|
122
|
+
"fs/order.copy.failure": "Não foi possível copiar",
|
|
123
|
+
"fs/order.number.copy-name": "Copiar número do pedido",
|
|
124
|
+
"fs/order.number.prefix": "Pedido nº",
|
|
125
|
+
"fs/order.placed-at": "Pedido realizado",
|
|
126
|
+
"fs/order.progress.label": "Progresso do pedido",
|
|
127
|
+
"fs/order.stage-state.current": "Em andamento",
|
|
128
|
+
"fs/order.stage-state.done": "Concluído",
|
|
129
|
+
"fs/order.stage-state.pending": "Não iniciado",
|
|
130
|
+
"fs/order.stage.payment": "Pagamento",
|
|
131
|
+
"fs/order.stage.placed": "Pedido realizado",
|
|
132
|
+
"fs/order.stage.processing": "Preparação",
|
|
133
|
+
"fs/order.stage.shipping": "Envio",
|
|
134
|
+
"fs/order.totals.change": "Troco",
|
|
135
|
+
"fs/order.totals.discounts": "Descontos",
|
|
136
|
+
"fs/order.totals.grand-total": "Total",
|
|
137
|
+
"fs/order.totals.heading": "Resumo",
|
|
138
|
+
"fs/order.totals.interest": "Juros",
|
|
139
|
+
"fs/order.totals.items": "Itens",
|
|
140
|
+
"fs/order.totals.shipping": "Frete",
|
|
141
|
+
"fs/order.totals.tax": "Impostos",
|
|
7
142
|
"fs/region.error.invalid-postal-code": "Informe um CEP válido.",
|
|
8
143
|
"fs/region.error.network": "Não foi possível definir sua região. Tente novamente.",
|
|
9
144
|
"fs/region.error.unserved-postal-code": "Ainda não entregamos neste CEP.",
|
|
@@ -19,7 +154,9 @@ var pt_BR_default = {
|
|
|
19
154
|
"fs/shipping.free-price": "Grátis",
|
|
20
155
|
"fs/shipping.no-options": "Nenhuma opção de entrega disponível para este endereço.",
|
|
21
156
|
"fs/shipping.postal-code.aria-label": "CEP",
|
|
22
|
-
"fs/shipping.postal-code.placeholder": "Digite seu CEP"
|
|
157
|
+
"fs/shipping.postal-code.placeholder": "Digite seu CEP",
|
|
158
|
+
"fs/toast.dismiss": "Fechar",
|
|
159
|
+
"fs/toast.region": "Notificações"
|
|
23
160
|
};
|
|
24
161
|
//#endregion
|
|
25
162
|
export { pt_BR_default as default };
|
|
@@ -1,8 +1,143 @@
|
|
|
1
1
|
{
|
|
2
2
|
"fs/a11y.close": "Fechar",
|
|
3
|
+
"fs/address-book.empty": "Você ainda não tem endereços salvos.",
|
|
4
|
+
"fs/address-book.error": "Não foi possível carregar seus endereços.",
|
|
5
|
+
"fs/address-book.loading": "Carregando seus endereços…",
|
|
6
|
+
"fs/address-book.profile-notice": "Seus endereços salvos não serão oferecidos no checkout até que seu perfil tenha um telefone.",
|
|
7
|
+
"fs/address-book.profile-notice.link": "Complete seu perfil",
|
|
8
|
+
"fs/address-book.retry": "Tentar novamente",
|
|
9
|
+
"fs/address-book.undeliverable": "No momento, não entregamos neste país.",
|
|
10
|
+
"fs/address-delete.cancel": "Cancelar",
|
|
11
|
+
"fs/address-delete.confirm": "Excluir",
|
|
12
|
+
"fs/address-delete.deleted": "Endereço excluído.",
|
|
13
|
+
"fs/address-delete.description": "Esta ação não pode ser desfeita.",
|
|
14
|
+
"fs/address-delete.error.failed": "Não foi possível excluir este endereço. Tente novamente.",
|
|
15
|
+
"fs/address-delete.error.unauthorized": "Sua sessão expirou. Entre novamente para excluir este endereço.",
|
|
16
|
+
"fs/address-delete.title": "Excluir este endereço?",
|
|
17
|
+
"fs/address-delete.trigger": "Excluir",
|
|
18
|
+
"fs/address-form.add": "Adicionar endereço",
|
|
19
|
+
"fs/address-form.added": "Endereço adicionado.",
|
|
20
|
+
"fs/address-form.cancel": "Cancelar",
|
|
21
|
+
"fs/address-form.country": "País",
|
|
22
|
+
"fs/address-form.country-notice": "{count, plural, one {Este campo não passa para um endereço em {country}: {fields}. Ele volta se você trocar de novo para {previous}.} other {Estes campos não passam para um endereço em {country}: {fields}. Eles voltam se você trocar de novo para {previous}.}}",
|
|
23
|
+
"fs/address-form.edit": "Editar",
|
|
24
|
+
"fs/address-form.error.country-switch-failed": "Não foi possível trocar o país. Tente de novo.",
|
|
25
|
+
"fs/address-form.error.not-found": "Este endereço não existe mais.",
|
|
26
|
+
"fs/address-form.error.rules-failed": "Não foi possível carregar este formulário. Feche-o e tente novamente.",
|
|
27
|
+
"fs/address-form.error.save-failed": "Não foi possível salvar este endereço. Tente novamente.",
|
|
28
|
+
"fs/address-form.error.unauthorized": "Sua sessão expirou. Entre novamente para salvar este endereço.",
|
|
29
|
+
"fs/address-form.error.unrendered-field": "Este endereço precisa de informações que este formulário não consegue mostrar, então ele não foi salvo.",
|
|
30
|
+
"fs/address-form.error.unsupported-country": "A loja não entrega neste país.",
|
|
31
|
+
"fs/address-form.saved": "Endereço salvo.",
|
|
32
|
+
"fs/address-form.status.failed": "Endereço não salvo.",
|
|
33
|
+
"fs/address-form.status.fields": "Endereço não salvo. {count, plural, one {# campo precisa de atenção.} other {# campos precisam de atenção.}}",
|
|
34
|
+
"fs/address-form.status.filled": "{count, plural, one {# campo preenchido a partir do CEP.} other {# campos preenchidos a partir do CEP.}}",
|
|
35
|
+
"fs/address-form.submit": "Salvar",
|
|
36
|
+
"fs/address-form.title.add": "Adicionar endereço",
|
|
37
|
+
"fs/address-form.title.edit": "Editar endereço",
|
|
38
|
+
"fs/address-record.error": "Não foi possível carregar este endereço.",
|
|
39
|
+
"fs/address.error.cep": "Informe um CEP válido (exemplo: {example}).",
|
|
40
|
+
"fs/address.error.invalid": "Confira este campo.",
|
|
41
|
+
"fs/address.error.postal-code": "Informe um código postal válido (exemplo: {example}).",
|
|
42
|
+
"fs/address.error.required": "Campo obrigatório.",
|
|
43
|
+
"fs/address.error.too-long": "Use no máximo {maxLength, number} caracteres.",
|
|
44
|
+
"fs/address.field.cep": "CEP",
|
|
45
|
+
"fs/address.field.city": "Cidade",
|
|
46
|
+
"fs/address.field.commune": "Comuna",
|
|
47
|
+
"fs/address.field.complement": "Complemento (opcional)",
|
|
48
|
+
"fs/address.field.county": "Condado",
|
|
49
|
+
"fs/address.field.department": "Departamento",
|
|
50
|
+
"fs/address.field.district": "Distrito",
|
|
51
|
+
"fs/address.field.municipality": "Município",
|
|
52
|
+
"fs/address.field.name": "Nome do endereço (opcional)",
|
|
53
|
+
"fs/address.field.neighborhood": "Bairro",
|
|
54
|
+
"fs/address.field.number": "Número",
|
|
55
|
+
"fs/address.field.postal-code": "Código postal",
|
|
56
|
+
"fs/address.field.postcode": "Código postal",
|
|
57
|
+
"fs/address.field.province": "Província",
|
|
58
|
+
"fs/address.field.recipient-name": "Nome do destinatário",
|
|
59
|
+
"fs/address.field.reference": "Referência (opcional)",
|
|
60
|
+
"fs/address.field.region": "Região",
|
|
61
|
+
"fs/address.field.state": "Estado",
|
|
62
|
+
"fs/address.field.street": "Endereço",
|
|
63
|
+
"fs/address.field.town": "Cidade",
|
|
64
|
+
"fs/address.placeholder.postal-code": "Exemplo: {example}",
|
|
65
|
+
"fs/address.placeholder.street": "Endereço",
|
|
3
66
|
"fs/form.clear": "Limpar",
|
|
4
67
|
"fs/form.reset": "Redefinir",
|
|
5
68
|
"fs/form.submit": "Continuar",
|
|
69
|
+
"fs/order-cancel.confirm": "Cancelar pedido",
|
|
70
|
+
"fs/order-cancel.description": "Esta ação não pode ser desfeita.",
|
|
71
|
+
"fs/order-cancel.dismiss": "Manter pedido",
|
|
72
|
+
"fs/order-cancel.dismiss-message": "Dispensar",
|
|
73
|
+
"fs/order-cancel.failure": "Não foi possível cancelar o pedido. Tente novamente.",
|
|
74
|
+
"fs/order-cancel.other": "Outro",
|
|
75
|
+
"fs/order-cancel.other-field": "Motivo",
|
|
76
|
+
"fs/order-cancel.reason.better-price": "Encontrei um preço melhor",
|
|
77
|
+
"fs/order-cancel.reason.bought-by-mistake": "Comprei por engano",
|
|
78
|
+
"fs/order-cancel.reason.changed-mind": "Mudei de ideia",
|
|
79
|
+
"fs/order-cancel.reason.slow-delivery": "A entrega está demorando",
|
|
80
|
+
"fs/order-cancel.success": "Seu pedido foi cancelado.",
|
|
81
|
+
"fs/order-cancel.title": "Cancelar este pedido?",
|
|
82
|
+
"fs/order-cancel.trigger": "Cancelar pedido",
|
|
83
|
+
"fs/order-delivery-address.delivery": "Endereço de entrega",
|
|
84
|
+
"fs/order-delivery-address.store": "Endereço da loja",
|
|
85
|
+
"fs/order-delivery-group.channel.delivery": "Entrega",
|
|
86
|
+
"fs/order-delivery-group.channel.pickup-in-point": "Retirada",
|
|
87
|
+
"fs/order-delivery-group.estimate": "Previsão de entrega",
|
|
88
|
+
"fs/order-delivery-group.items": "{count, plural, one {# item} other {# itens}}",
|
|
89
|
+
"fs/order-delivery-group.label": "Entregas",
|
|
90
|
+
"fs/order-delivery-group.list-price": "Preço de lista",
|
|
91
|
+
"fs/order-delivery-group.quantity": "Quantidade",
|
|
92
|
+
"fs/order-delivery-group.subtotal": "Subtotal",
|
|
93
|
+
"fs/order-delivery-group.tax": "Imposto",
|
|
94
|
+
"fs/order-delivery-group.total": "Total",
|
|
95
|
+
"fs/order-delivery-group.unit-price": "Preço unitário",
|
|
96
|
+
"fs/order-list.column.estimate": "Previsão",
|
|
97
|
+
"fs/order-list.column.id": "Pedido",
|
|
98
|
+
"fs/order-list.column.items": "Itens",
|
|
99
|
+
"fs/order-list.column.placed": "Data",
|
|
100
|
+
"fs/order-list.column.status": "Status",
|
|
101
|
+
"fs/order-list.column.total": "Total",
|
|
102
|
+
"fs/order-payment.bank-invoice.number": "Número do boleto",
|
|
103
|
+
"fs/order-payment.bank-invoice.print": "Imprimir boleto",
|
|
104
|
+
"fs/order-payment.empty": "Nenhum pagamento registrado",
|
|
105
|
+
"fs/order-payment.heading": "Pagamento",
|
|
106
|
+
"fs/order-payment.installments": "{count}x {amount}",
|
|
107
|
+
"fs/order-payment.method.placeholder": "Forma de pagamento indisponível",
|
|
108
|
+
"fs/order-payment.redemption-code": "Código do vale-presente",
|
|
109
|
+
"fs/order-status.cancellation-requested": "Cancelamento solicitado",
|
|
110
|
+
"fs/order-status.cancelled": "Cancelado",
|
|
111
|
+
"fs/order-status.collected": "Retirado",
|
|
112
|
+
"fs/order-status.delivered": "Entregue",
|
|
113
|
+
"fs/order-status.in-progress": "Em andamento",
|
|
114
|
+
"fs/order-status.placeholder": "Status indisponível",
|
|
115
|
+
"fs/order-status.ready-for-pickup": "Pronto para retirada",
|
|
116
|
+
"fs/order-status.shipped": "Enviado",
|
|
117
|
+
"fs/order.back-to-orders": "Voltar aos pedidos",
|
|
118
|
+
"fs/order.copy.action": "Copiar",
|
|
119
|
+
"fs/order.copy.copied": "Copiado",
|
|
120
|
+
"fs/order.copy.dismiss": "Dispensar",
|
|
121
|
+
"fs/order.copy.failure": "Não foi possível copiar",
|
|
122
|
+
"fs/order.number.copy-name": "Copiar número do pedido",
|
|
123
|
+
"fs/order.number.prefix": "Pedido nº",
|
|
124
|
+
"fs/order.placed-at": "Pedido realizado",
|
|
125
|
+
"fs/order.progress.label": "Progresso do pedido",
|
|
126
|
+
"fs/order.stage-state.current": "Em andamento",
|
|
127
|
+
"fs/order.stage-state.done": "Concluído",
|
|
128
|
+
"fs/order.stage-state.pending": "Não iniciado",
|
|
129
|
+
"fs/order.stage.payment": "Pagamento",
|
|
130
|
+
"fs/order.stage.placed": "Pedido realizado",
|
|
131
|
+
"fs/order.stage.processing": "Preparação",
|
|
132
|
+
"fs/order.stage.shipping": "Envio",
|
|
133
|
+
"fs/order.totals.change": "Troco",
|
|
134
|
+
"fs/order.totals.discounts": "Descontos",
|
|
135
|
+
"fs/order.totals.grand-total": "Total",
|
|
136
|
+
"fs/order.totals.heading": "Resumo",
|
|
137
|
+
"fs/order.totals.interest": "Juros",
|
|
138
|
+
"fs/order.totals.items": "Itens",
|
|
139
|
+
"fs/order.totals.shipping": "Frete",
|
|
140
|
+
"fs/order.totals.tax": "Impostos",
|
|
6
141
|
"fs/region.error.invalid-postal-code": "Informe um CEP válido.",
|
|
7
142
|
"fs/region.error.network": "Não foi possível definir sua região. Tente novamente.",
|
|
8
143
|
"fs/region.error.unserved-postal-code": "Ainda não entregamos neste CEP.",
|
|
@@ -18,5 +153,7 @@
|
|
|
18
153
|
"fs/shipping.free-price": "Grátis",
|
|
19
154
|
"fs/shipping.no-options": "Nenhuma opção de entrega disponível para este endereço.",
|
|
20
155
|
"fs/shipping.postal-code.aria-label": "CEP",
|
|
21
|
-
"fs/shipping.postal-code.placeholder": "Digite seu CEP"
|
|
156
|
+
"fs/shipping.postal-code.placeholder": "Digite seu CEP",
|
|
157
|
+
"fs/toast.dismiss": "Fechar",
|
|
158
|
+
"fs/toast.region": "Notificações"
|
|
22
159
|
}
|
|
@@ -24,9 +24,10 @@ const UNAUTHORIZED_CUSTOMER_PROFILE_ERROR = {
|
|
|
24
24
|
message: "Your session has expired. Please sign in again."
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
|
-
* The profile
|
|
28
|
-
* a `userError
|
|
29
|
-
* gets its own code and the caller can
|
|
27
|
+
* The profile write answers an anonymous or expired session with a top-level `UNAUTHORIZED`, never
|
|
28
|
+
* a `userError` (the read answers an anonymous one with a null profile instead). Collapsing it into
|
|
29
|
+
* `NETWORK_ERROR` would offer a retry that cannot succeed, so it gets its own code and the caller can
|
|
30
|
+
* send the shopper back to sign-in.
|
|
30
31
|
*/
|
|
31
32
|
function toCustomerProfileError(error) {
|
|
32
33
|
if (CombinedGraphQLErrors.is(error)) {
|
|
@@ -63,7 +64,7 @@ function useIdentityActions() {
|
|
|
63
64
|
try {
|
|
64
65
|
return (await customerProfileMutation({ variables: { input: payload } })).data?.customerProfileUpdate?.userErrors ?? [];
|
|
65
66
|
} catch (error) {
|
|
66
|
-
console.error("[identity.customerProfileUpdate] customerProfileUpdate failed", error
|
|
67
|
+
console.error("[identity.customerProfileUpdate] customerProfileUpdate failed", loggableErrorName(error));
|
|
67
68
|
return [toCustomerProfileError(error)];
|
|
68
69
|
}
|
|
69
70
|
}, [customerProfileMutation]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-identity-actions.js","names":[],"sources":["../../../src/sdk/identity/use-identity-actions.ts"],"sourcesContent":["'use client';\n\nimport { CombinedGraphQLErrors } from '@apollo/client/errors';\nimport { useMutation } from '@apollo/client/react';\nimport { defineActions } from '@vtex/fs-core';\nimport { useCallback, useMemo } from 'react';\nimport { loggableErrorName } from '../../utils/loggable-error-name.js';\nimport {\n CLIENT_PREFERENCES_UPDATE,\n CLIENT_PROFILE_UPDATE,\n type ClientPreferenceKey,\n type ClientProfileUserError,\n CUSTOMER_PROFILE_UPDATE,\n type CustomerProfileUpdateInput,\n type CustomerProfileUserError,\n} from './operations.js';\n\n/**\n * The `identity` action namespace — the context-free owner of the shopper-profile,\n * consent-preference, and persistent-profile writes\n * (specs/fspg-859-email-field.md, specs/consent-opt-in-component.md,\n * docs/storefront-core/reference-free-particle-model.md § Write side — actions,\n * docs/storefront-core/adr-0010-actions-own-the-write-side.md).\n *\n * It mirrors `useCartActions`: a component anywhere in the tree dispatches the write through the\n * compiler-injected `$actions.identity.*` prop, and the handler calls the corresponding mutation.\n * Every write is **async / pessimistic** (Decision 1): the caller awaits the persisted result. Each\n * call returns its `userErrors` (empty on success) so the caller can surface server-side failures\n * inline; the returned entity self-updates the normalized cache and every reactive subscriber.\n *\n * The first two writes target the cart's sibling identity entities; `customerProfileUpdate` targets\n * the shopper's account profile, which needs no cart at all.\n */\n\n/**\n * Payload for the profile write. Callers persist only the fields they own; other fields are\n * untouched. The payload is passed through to `ClientProfileUpdateInput` unmapped, so this type\n * mirrors that input verbatim — a stacked field only needs a field to already exist here to reach\n * the wire.\n */\nexport type ClientProfileUpdatePayload = Readonly<{\n email?: string;\n firstName?: string;\n lastName?: string;\n phone?: string;\n document?: string;\n}>;\n\n/** Payload for the preferences write — one opt-in flag; the other flag is left untouched. */\nexport type ClientPreferencesUpdatePayload = Readonly<Partial<Record<ClientPreferenceKey, boolean>>>;\n\n/**\n * Payload for the persistent-profile write. Mirrors `CustomerProfileUpdateInput` verbatim and is\n * forwarded unmapped, so an omitted field stays untouched upstream and an empty string erases.\n */\nexport type CustomerProfileUpdatePayload = CustomerProfileUpdateInput;\n\nexport type IdentityActions = Readonly<{\n /**\n * Persist the provided profile fields (partial) to the active cart's `clientProfileData`.\n * Async — awaits the mutation before resolving. Returns the resulting `userErrors` (empty on\n * success).\n */\n clientProfileUpdate: (payload: ClientProfileUpdatePayload) => Promise<readonly ClientProfileUserError[]>;\n /**\n * Persist the provided consent opt-in flag(s) (partial) to the shopper's `ClientPreferences`\n * entity (order-form-backed). Async — awaits the mutation before resolving. Writes ONLY the\n * requested field. Returns the resulting `userErrors` (empty on success).\n */\n clientPreferencesUpdate: (payload: ClientPreferencesUpdatePayload) => Promise<readonly ClientProfileUserError[]>;\n /**\n * Persist the provided profile fields (partial) to the shopper's persistent, cart-independent\n * account profile. Async — awaits the mutation before resolving. Sends exactly the fields it is\n * given: an omitted field is left untouched, an empty string erases. Returns the resulting\n * `userErrors` (empty on success).\n */\n customerProfileUpdate: (payload: CustomerProfileUpdatePayload) => Promise<readonly CustomerProfileUserError[]>;\n}>;\n\nconst NETWORK_PROFILE_ERROR: ClientProfileUserError = {\n code: 'NETWORK_ERROR',\n message: 'Unable to save your details. Please try again.',\n};\n\nconst NETWORK_PREFERENCE_ERROR: ClientProfileUserError = {\n code: 'NETWORK_ERROR',\n message: 'Unable to save your preference. Please try again.',\n};\n\nconst NETWORK_CUSTOMER_PROFILE_ERROR: CustomerProfileUserError = {\n code: 'NETWORK_ERROR',\n message: 'Unable to save your profile. Please try again.',\n};\n\nconst UNAUTHORIZED_CUSTOMER_PROFILE_ERROR: CustomerProfileUserError = {\n code: 'UNAUTHORIZED',\n message: 'Your session has expired. Please sign in again.',\n};\n\n/**\n * The profile module answers an anonymous or expired session with a top-level `UNAUTHORIZED`, never\n * a `userError`. Collapsing it into `NETWORK_ERROR` would offer a retry that cannot succeed, so it\n * gets its own code and the caller can send the shopper back to sign-in.\n */\nfunction toCustomerProfileError(error: unknown): CustomerProfileUserError {\n if (CombinedGraphQLErrors.is(error)) {\n const unauthorized = error.errors.some(({ extensions }) => extensions?.code === 'UNAUTHORIZED');\n if (unauthorized) return UNAUTHORIZED_CUSTOMER_PROFILE_ERROR;\n }\n return NETWORK_CUSTOMER_PROFILE_ERROR;\n}\n\n/**\n * The `identity` namespace hook. Registered with the first-party action registry via `identityActions`\n * below; the compiler-emitted `IdentityActionProvider` calls it and threads the narrowed methods into\n * each consumer's `$actions.identity`.\n */\nexport function useIdentityActions(): IdentityActions {\n const [profileMutation] = useMutation(CLIENT_PROFILE_UPDATE);\n const [preferencesMutation] = useMutation(CLIENT_PREFERENCES_UPDATE);\n const [customerProfileMutation] = useMutation(CUSTOMER_PROFILE_UPDATE);\n\n const clientProfileUpdate = useCallback<IdentityActions['clientProfileUpdate']>(\n async (payload) => {\n try {\n const result = await profileMutation({ variables: { input: payload } });\n return result.data?.clientProfileUpdate?.userErrors ?? [];\n } catch (error) {\n // Log only the error name — the message can echo the submitted email (PII).\n console.error('[identity.clientProfileUpdate] clientProfileUpdate failed', loggableErrorName(error));\n return [NETWORK_PROFILE_ERROR];\n }\n },\n [profileMutation],\n );\n\n const clientPreferencesUpdate = useCallback<IdentityActions['clientPreferencesUpdate']>(\n async (payload) => {\n try {\n const result = await preferencesMutation({ variables: { input: payload } });\n return result.data?.clientPreferencesUpdate?.userErrors ?? [];\n } catch (error) {\n // Log only the error name — mirrors the profile write's PII-safe logging.\n console.error('[identity.clientPreferencesUpdate] clientPreferencesUpdate failed', loggableErrorName(error));\n return [NETWORK_PREFERENCE_ERROR];\n }\n },\n [preferencesMutation],\n );\n\n const customerProfileUpdate = useCallback<IdentityActions['customerProfileUpdate']>(\n async (payload) => {\n try {\n // Forwarded unmapped: an empty string is an explicit erase and must survive to the wire.\n const result = await customerProfileMutation({ variables: { input: payload } });\n return result.data?.customerProfileUpdate?.userErrors ?? [];\n } catch (error) {\n // Log only the error name — the message can echo a submitted profile value (PII).\n console.error(\n '[identity.customerProfileUpdate] customerProfileUpdate failed',\n error instanceof Error ? error.name : 'UnknownError',\n );\n return [toCustomerProfileError(error)];\n }\n },\n [customerProfileMutation],\n );\n\n return useMemo(\n () => ({ clientProfileUpdate, clientPreferencesUpdate, customerProfileUpdate }),\n [clientProfileUpdate, clientPreferencesUpdate, customerProfileUpdate],\n );\n}\n\n/**\n * Declares the `identity` action namespace — the single source of truth for its method/payload\n * metadata, runtime provider, and `use` hook (mirrors `cartActions`). The native catalog builder\n * (`scripts/build-catalog.mjs`) statically reads this call to emit `actions.json`; at runtime\n * `IdentityActionProvider` calls `useIdentityActions` directly.\n */\nexport const identityActions = defineActions({\n namespace: 'identity',\n description:\n 'Mutation-backed writes against the shopper identity entities (client profile, consent preferences, account profile).',\n provider: { name: 'IdentityActionProvider', importPath: '@vtex/faststore/internal/client' },\n methods: {\n clientProfileUpdate: {\n description:\n 'Persist profile fields (partial) to the active cart (async strategy). Sending email flips Session.isIdentified.',\n payload: [\n { name: 'email', type: 'string', optional: true },\n { name: 'firstName', type: 'string', optional: true },\n { name: 'lastName', type: 'string', optional: true },\n { name: 'phone', type: 'string', optional: true },\n { name: 'document', type: 'string', optional: true },\n ],\n },\n clientPreferencesUpdate: {\n description:\n 'Persist consent opt-in flags (partial) to the active cart (async strategy). Writes only the provided flag(s).',\n payload: [\n { name: 'optinNewsLetter', type: 'boolean', optional: true },\n { name: 'savePersonalData', type: 'boolean', optional: true },\n ],\n },\n customerProfileUpdate: {\n description:\n 'Persist profile fields (partial) to the persistent account profile, not the cart (async strategy). Omitted fields are untouched; an empty string erases.',\n payload: [\n { name: 'firstName', type: 'string', optional: true },\n { name: 'lastName', type: 'string', optional: true },\n { name: 'homePhone', type: 'string', optional: true },\n { name: 'mobilePhone', type: 'string', optional: true },\n { name: 'document', type: 'string', optional: true },\n { name: 'documentType', type: 'string', optional: true },\n { name: 'birthDate', type: 'string', optional: true },\n { name: 'gender', type: 'string', optional: true },\n ],\n },\n },\n use: useIdentityActions,\n});\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"use-identity-actions.js","names":[],"sources":["../../../src/sdk/identity/use-identity-actions.ts"],"sourcesContent":["'use client';\n\nimport { CombinedGraphQLErrors } from '@apollo/client/errors';\nimport { useMutation } from '@apollo/client/react';\nimport { defineActions } from '@vtex/fs-core';\nimport { useCallback, useMemo } from 'react';\nimport { loggableErrorName } from '../../utils/loggable-error-name.js';\nimport {\n CLIENT_PREFERENCES_UPDATE,\n CLIENT_PROFILE_UPDATE,\n type ClientPreferenceKey,\n type ClientProfileUserError,\n CUSTOMER_PROFILE_UPDATE,\n type CustomerProfileUpdateInput,\n type CustomerProfileUserError,\n} from './operations.js';\n\n/**\n * The `identity` action namespace — the context-free owner of the shopper-profile,\n * consent-preference, and persistent-profile writes\n * (specs/fspg-859-email-field.md, specs/consent-opt-in-component.md,\n * docs/storefront-core/reference-free-particle-model.md § Write side — actions,\n * docs/storefront-core/adr-0010-actions-own-the-write-side.md).\n *\n * It mirrors `useCartActions`: a component anywhere in the tree dispatches the write through the\n * compiler-injected `$actions.identity.*` prop, and the handler calls the corresponding mutation.\n * Every write is **async / pessimistic** (Decision 1): the caller awaits the persisted result. Each\n * call returns its `userErrors` (empty on success) so the caller can surface server-side failures\n * inline; the returned entity self-updates the normalized cache and every reactive subscriber.\n *\n * The first two writes target the cart's sibling identity entities; `customerProfileUpdate` targets\n * the shopper's account profile, which needs no cart at all.\n */\n\n/**\n * Payload for the profile write. Callers persist only the fields they own; other fields are\n * untouched. The payload is passed through to `ClientProfileUpdateInput` unmapped, so this type\n * mirrors that input verbatim — a stacked field only needs a field to already exist here to reach\n * the wire.\n */\nexport type ClientProfileUpdatePayload = Readonly<{\n email?: string;\n firstName?: string;\n lastName?: string;\n phone?: string;\n document?: string;\n}>;\n\n/** Payload for the preferences write — one opt-in flag; the other flag is left untouched. */\nexport type ClientPreferencesUpdatePayload = Readonly<Partial<Record<ClientPreferenceKey, boolean>>>;\n\n/**\n * Payload for the persistent-profile write. Mirrors `CustomerProfileUpdateInput` verbatim and is\n * forwarded unmapped, so an omitted field stays untouched upstream and an empty string erases.\n */\nexport type CustomerProfileUpdatePayload = CustomerProfileUpdateInput;\n\nexport type IdentityActions = Readonly<{\n /**\n * Persist the provided profile fields (partial) to the active cart's `clientProfileData`.\n * Async — awaits the mutation before resolving. Returns the resulting `userErrors` (empty on\n * success).\n */\n clientProfileUpdate: (payload: ClientProfileUpdatePayload) => Promise<readonly ClientProfileUserError[]>;\n /**\n * Persist the provided consent opt-in flag(s) (partial) to the shopper's `ClientPreferences`\n * entity (order-form-backed). Async — awaits the mutation before resolving. Writes ONLY the\n * requested field. Returns the resulting `userErrors` (empty on success).\n */\n clientPreferencesUpdate: (payload: ClientPreferencesUpdatePayload) => Promise<readonly ClientProfileUserError[]>;\n /**\n * Persist the provided profile fields (partial) to the shopper's persistent, cart-independent\n * account profile. Async — awaits the mutation before resolving. Sends exactly the fields it is\n * given: an omitted field is left untouched, an empty string erases. Returns the resulting\n * `userErrors` (empty on success).\n */\n customerProfileUpdate: (payload: CustomerProfileUpdatePayload) => Promise<readonly CustomerProfileUserError[]>;\n}>;\n\nconst NETWORK_PROFILE_ERROR: ClientProfileUserError = {\n code: 'NETWORK_ERROR',\n message: 'Unable to save your details. Please try again.',\n};\n\nconst NETWORK_PREFERENCE_ERROR: ClientProfileUserError = {\n code: 'NETWORK_ERROR',\n message: 'Unable to save your preference. Please try again.',\n};\n\nconst NETWORK_CUSTOMER_PROFILE_ERROR: CustomerProfileUserError = {\n code: 'NETWORK_ERROR',\n message: 'Unable to save your profile. Please try again.',\n};\n\nconst UNAUTHORIZED_CUSTOMER_PROFILE_ERROR: CustomerProfileUserError = {\n code: 'UNAUTHORIZED',\n message: 'Your session has expired. Please sign in again.',\n};\n\n/**\n * The profile write answers an anonymous or expired session with a top-level `UNAUTHORIZED`, never\n * a `userError` (the read answers an anonymous one with a null profile instead). Collapsing it into\n * `NETWORK_ERROR` would offer a retry that cannot succeed, so it gets its own code and the caller can\n * send the shopper back to sign-in.\n */\nfunction toCustomerProfileError(error: unknown): CustomerProfileUserError {\n if (CombinedGraphQLErrors.is(error)) {\n const unauthorized = error.errors.some(({ extensions }) => extensions?.code === 'UNAUTHORIZED');\n if (unauthorized) return UNAUTHORIZED_CUSTOMER_PROFILE_ERROR;\n }\n return NETWORK_CUSTOMER_PROFILE_ERROR;\n}\n\n/**\n * The `identity` namespace hook. Registered with the first-party action registry via `identityActions`\n * below; the compiler-emitted `IdentityActionProvider` calls it and threads the narrowed methods into\n * each consumer's `$actions.identity`.\n */\nexport function useIdentityActions(): IdentityActions {\n const [profileMutation] = useMutation(CLIENT_PROFILE_UPDATE);\n const [preferencesMutation] = useMutation(CLIENT_PREFERENCES_UPDATE);\n const [customerProfileMutation] = useMutation(CUSTOMER_PROFILE_UPDATE);\n\n const clientProfileUpdate = useCallback<IdentityActions['clientProfileUpdate']>(\n async (payload) => {\n try {\n const result = await profileMutation({ variables: { input: payload } });\n return result.data?.clientProfileUpdate?.userErrors ?? [];\n } catch (error) {\n // Log only the error name — the message can echo the submitted email (PII).\n console.error('[identity.clientProfileUpdate] clientProfileUpdate failed', loggableErrorName(error));\n return [NETWORK_PROFILE_ERROR];\n }\n },\n [profileMutation],\n );\n\n const clientPreferencesUpdate = useCallback<IdentityActions['clientPreferencesUpdate']>(\n async (payload) => {\n try {\n const result = await preferencesMutation({ variables: { input: payload } });\n return result.data?.clientPreferencesUpdate?.userErrors ?? [];\n } catch (error) {\n // Log only the error name — mirrors the profile write's PII-safe logging.\n console.error('[identity.clientPreferencesUpdate] clientPreferencesUpdate failed', loggableErrorName(error));\n return [NETWORK_PREFERENCE_ERROR];\n }\n },\n [preferencesMutation],\n );\n\n const customerProfileUpdate = useCallback<IdentityActions['customerProfileUpdate']>(\n async (payload) => {\n try {\n // Forwarded unmapped: an empty string is an explicit erase and must survive to the wire.\n const result = await customerProfileMutation({ variables: { input: payload } });\n return result.data?.customerProfileUpdate?.userErrors ?? [];\n } catch (error) {\n // Log only the error name — the message can echo a submitted profile value (PII).\n console.error('[identity.customerProfileUpdate] customerProfileUpdate failed', loggableErrorName(error));\n return [toCustomerProfileError(error)];\n }\n },\n [customerProfileMutation],\n );\n\n return useMemo(\n () => ({ clientProfileUpdate, clientPreferencesUpdate, customerProfileUpdate }),\n [clientProfileUpdate, clientPreferencesUpdate, customerProfileUpdate],\n );\n}\n\n/**\n * Declares the `identity` action namespace — the single source of truth for its method/payload\n * metadata, runtime provider, and `use` hook (mirrors `cartActions`). The native catalog builder\n * (`scripts/build-catalog.mjs`) statically reads this call to emit `actions.json`; at runtime\n * `IdentityActionProvider` calls `useIdentityActions` directly.\n */\nexport const identityActions = defineActions({\n namespace: 'identity',\n description:\n 'Mutation-backed writes against the shopper identity entities (client profile, consent preferences, account profile).',\n provider: { name: 'IdentityActionProvider', importPath: '@vtex/faststore/internal/client' },\n methods: {\n clientProfileUpdate: {\n description:\n 'Persist profile fields (partial) to the active cart (async strategy). Sending email flips Session.isIdentified.',\n payload: [\n { name: 'email', type: 'string', optional: true },\n { name: 'firstName', type: 'string', optional: true },\n { name: 'lastName', type: 'string', optional: true },\n { name: 'phone', type: 'string', optional: true },\n { name: 'document', type: 'string', optional: true },\n ],\n },\n clientPreferencesUpdate: {\n description:\n 'Persist consent opt-in flags (partial) to the active cart (async strategy). Writes only the provided flag(s).',\n payload: [\n { name: 'optinNewsLetter', type: 'boolean', optional: true },\n { name: 'savePersonalData', type: 'boolean', optional: true },\n ],\n },\n customerProfileUpdate: {\n description:\n 'Persist profile fields (partial) to the persistent account profile, not the cart (async strategy). Omitted fields are untouched; an empty string erases.',\n payload: [\n { name: 'firstName', type: 'string', optional: true },\n { name: 'lastName', type: 'string', optional: true },\n { name: 'homePhone', type: 'string', optional: true },\n { name: 'mobilePhone', type: 'string', optional: true },\n { name: 'document', type: 'string', optional: true },\n { name: 'documentType', type: 'string', optional: true },\n { name: 'birthDate', type: 'string', optional: true },\n { name: 'gender', type: 'string', optional: true },\n ],\n },\n },\n use: useIdentityActions,\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/sdk/navigation/current-page.ts
|
|
2
|
+
/**
|
|
3
|
+
* The current page with `query` as its whole query: a page reference inside a Route Marker, and the
|
|
4
|
+
* Logical Path plus the query outside one, where a layout has no page.
|
|
5
|
+
*/
|
|
6
|
+
function currentPageWith(route, query) {
|
|
7
|
+
const text = query.toString();
|
|
8
|
+
if (route.page === null) return text.length === 0 ? route.path : `${route.path}?${text}`;
|
|
9
|
+
const target = {
|
|
10
|
+
page: route.page.name,
|
|
11
|
+
params: route.params
|
|
12
|
+
};
|
|
13
|
+
return text.length === 0 ? target : {
|
|
14
|
+
...target,
|
|
15
|
+
query: queryRecord(query)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** The query as a record, keeping every value of a repeated key in order. */
|
|
19
|
+
function queryRecord(query) {
|
|
20
|
+
const record = {};
|
|
21
|
+
for (const key of new Set(query.keys())) {
|
|
22
|
+
const values = query.getAll(key);
|
|
23
|
+
record[key] = values.length === 1 ? values[0] ?? "" : values;
|
|
24
|
+
}
|
|
25
|
+
return record;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { currentPageWith };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=current-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"current-page.js","names":[],"sources":["../../../src/sdk/navigation/current-page.ts"],"sourcesContent":["import type { PageRef } from './types.js';\nimport type { StorefrontRoute } from './use-storefront-route.js';\n\nexport type CurrentRoute = Pick<StorefrontRoute, 'page' | 'params' | 'path'>;\n\n/**\n * The current page with `query` as its whole query: a page reference inside a Route Marker, and the\n * Logical Path plus the query outside one, where a layout has no page.\n */\nexport function currentPageWith(route: CurrentRoute, query: URLSearchParams): PageRef | string {\n const text = query.toString();\n if (route.page === null) return text.length === 0 ? route.path : `${route.path}?${text}`;\n const target: PageRef = { page: route.page.name, params: route.params };\n return text.length === 0 ? target : { ...target, query: queryRecord(query) };\n}\n\n/** The query as a record, keeping every value of a repeated key in order. */\nfunction queryRecord(query: URLSearchParams): Record<string, string | string[]> {\n const record: Record<string, string | string[]> = {};\n for (const key of new Set(query.keys())) {\n const values = query.getAll(key);\n record[key] = values.length === 1 ? (values[0] ?? '') : values;\n }\n return record;\n}\n"],"mappings":";;;;;AASA,SAAgB,gBAAgB,OAAqB,OAA0C;CAC7F,MAAM,OAAO,MAAM,SAAS;CAC5B,IAAI,MAAM,SAAS,MAAM,OAAO,KAAK,WAAW,IAAI,MAAM,OAAO,GAAG,MAAM,KAAK,GAAG;CAClF,MAAM,SAAkB;EAAE,MAAM,MAAM,KAAK;EAAM,QAAQ,MAAM;CAAO;CACtE,OAAO,KAAK,WAAW,IAAI,SAAS;EAAE,GAAG;EAAQ,OAAO,YAAY,KAAK;CAAE;AAC7E;;AAGA,SAAS,YAAY,OAA2D;CAC9E,MAAM,SAA4C,CAAC;CACnD,KAAK,MAAM,OAAO,IAAI,IAAI,MAAM,KAAK,CAAC,GAAG;EACvC,MAAM,SAAS,MAAM,OAAO,GAAG;EAC/B,OAAO,OAAO,OAAO,WAAW,IAAK,OAAO,MAAM,KAAM;CAC1D;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RouteMap } from "./types.js";
|
|
2
|
+
import { ToLogicalPath } from "./route-map-provider.js";
|
|
3
|
+
//#region src/sdk/navigation/not-found-log.d.ts
|
|
4
|
+
type ResolvedBinding = {
|
|
5
|
+
context: {
|
|
6
|
+
basePath: string;
|
|
7
|
+
bindingId: string;
|
|
8
|
+
};
|
|
9
|
+
} | null;
|
|
10
|
+
type ReportNotFoundRequestInput = Readonly<{
|
|
11
|
+
referer: string | null;
|
|
12
|
+
requestHost: string;
|
|
13
|
+
requestPath: string;
|
|
14
|
+
routeMap: RouteMap;
|
|
15
|
+
knownHost: (host: string) => boolean;
|
|
16
|
+
resolveBinding: (host: string, pathname: string) => ResolvedBinding;
|
|
17
|
+
toLogicalPath: ToLogicalPath;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Logs `link.not-found` for a request whose referrer is a page of this store and whose path is not
|
|
21
|
+
* a page the store declared. Silent for an external referrer, a reload of this 404, a reserved
|
|
22
|
+
* first segment (`api`, `_next`), and an entity or content 404 whose path is one the binding serves
|
|
23
|
+
* a page at.
|
|
24
|
+
* Not deduplicated.
|
|
25
|
+
*/
|
|
26
|
+
export declare function reportNotFoundRequest({ referer, requestHost, requestPath, routeMap, knownHost, resolveBinding, toLogicalPath }: ReportNotFoundRequestInput): void;
|
|
27
|
+
//#endregion
|
|
28
|
+
//# sourceMappingURL=not-found-log.d.ts.map
|