@wix/himalaya-cli 0.1391.0 → 0.1393.0
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/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +7 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +4 -4
- package/dist/cli.mjs +31 -23
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/sdk-reference.json +4 -4
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +52 -28
- package/templates/beauty-salon-owner/dev/index.ts +545 -100
- package/templates/beauty-salon-owner/himalaya.content.json +6 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-appointments/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-order/index.ts +3 -3
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-orders/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-product/index.ts +31 -32
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-product-form/index.ts +23 -43
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-products/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-service/index.ts +18 -20
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-service-form/index.ts +16 -29
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-services/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/branded-lite/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +52 -28
- package/templates/branded-lite/tier5-src/himi-branded-lite-group/index.ts +24 -24
- package/templates/community-club/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/community-club/tier5-src/himi-branded-lite-group/index.ts +24 -24
- package/templates/community-club-owner/dev/index.ts +317 -100
- package/templates/community-club-owner/himalaya.content.json +6 -0
- package/templates/community-club-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/community-club-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/community-club-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/community-club-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/community-club-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/community-club-owner/tier5-src/himi-owner-lite-event/index.ts +18 -20
- package/templates/community-club-owner/tier5-src/himi-owner-lite-event-form/index.ts +20 -28
- package/templates/community-club-owner/tier5-src/himi-owner-lite-events/index.ts +2 -2
- package/templates/community-club-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/community-club-owner/tier5-src/himi-owner-lite-order/index.ts +3 -3
- package/templates/community-club-owner/tier5-src/himi-owner-lite-orders/index.ts +2 -2
- package/templates/community-club-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/community-club-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/community-club-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/community-club-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/community-club-owner/tier5-src/himi-owner-lite-product/index.ts +31 -32
- package/templates/community-club-owner/tier5-src/himi-owner-lite-product-form/index.ts +23 -43
- package/templates/community-club-owner/tier5-src/himi-owner-lite-products/index.ts +2 -2
- package/templates/community-club-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/community-club-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/events-meetups/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/events-meetups/tier5-src/himi-branded-lite-group/index.ts +24 -24
- package/templates/events-meetups-owner/dev/index.ts +275 -100
- package/templates/events-meetups-owner/himalaya.content.json +6 -0
- package/templates/events-meetups-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/events-meetups-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/events-meetups-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event/index.ts +18 -20
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event-form/index.ts +20 -28
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-events/index.ts +2 -2
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/gym-fitness/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +52 -28
- package/templates/gym-fitness-owner/dev/index.ts +545 -100
- package/templates/gym-fitness-owner/himalaya.content.json +6 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-appointments/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event/index.ts +18 -20
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event-form/index.ts +20 -28
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-events/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-order/index.ts +3 -3
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-orders/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-product/index.ts +31 -32
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-product-form/index.ts +23 -43
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-products/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-service/index.ts +18 -20
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-service-form/index.ts +16 -29
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-services/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/himi-chat/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/nonprofit-cause/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-group/index.ts +24 -24
- package/templates/nonprofit-cause-owner/dev/index.ts +503 -100
- package/templates/nonprofit-cause-owner/himalaya.content.json +6 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-appointments/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event/index.ts +18 -20
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event-form/index.ts +20 -28
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-events/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-service/index.ts +18 -20
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-service-form/index.ts +16 -29
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-services/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/owner-lite/dev/index.ts +545 -100
- package/templates/owner-lite/himalaya.content.json +6 -0
- package/templates/owner-lite/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/owner-lite/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/owner-lite/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/owner-lite/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/owner-lite/tier5-src/himi-owner-lite-appointments/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/owner-lite/tier5-src/himi-owner-lite-event/index.ts +18 -20
- package/templates/owner-lite/tier5-src/himi-owner-lite-event-form/index.ts +20 -28
- package/templates/owner-lite/tier5-src/himi-owner-lite-events/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-order/index.ts +3 -3
- package/templates/owner-lite/tier5-src/himi-owner-lite-orders/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/owner-lite/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/owner-lite/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-product/index.ts +31 -32
- package/templates/owner-lite/tier5-src/himi-owner-lite-product-form/index.ts +23 -43
- package/templates/owner-lite/tier5-src/himi-owner-lite-products/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-service/index.ts +18 -20
- package/templates/owner-lite/tier5-src/himi-owner-lite-service-form/index.ts +16 -29
- package/templates/owner-lite/tier5-src/himi-owner-lite-services/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/podcast-creator/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/podcast-creator-owner/dev/index.ts +317 -100
- package/templates/podcast-creator-owner/himalaya.content.json +6 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event/index.ts +18 -20
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event-form/index.ts +20 -28
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-events/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-order/index.ts +3 -3
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-orders/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-product/index.ts +31 -32
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-product-form/index.ts +23 -43
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-products/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/portfolio-creative/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +52 -28
- package/templates/portfolio-creative-owner/dev/index.ts +545 -100
- package/templates/portfolio-creative-owner/himalaya.content.json +6 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-appointments/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-order/index.ts +3 -3
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-orders/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-product/index.ts +31 -32
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-product-form/index.ts +23 -43
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-products/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-service/index.ts +18 -20
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-service-form/index.ts +16 -29
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-services/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/restaurant/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/restaurant-owner/dev/index.ts +545 -100
- package/templates/restaurant-owner/himalaya.content.json +6 -0
- package/templates/restaurant-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/restaurant-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/restaurant-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-appointments/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-event/index.ts +18 -20
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-event-form/index.ts +20 -28
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-events/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-order/index.ts +3 -3
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-orders/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-product/index.ts +31 -32
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-product-form/index.ts +23 -43
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-products/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-service/index.ts +18 -20
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-service-form/index.ts +16 -29
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-services/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/retail-store/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +52 -28
- package/templates/retail-store-owner/dev/index.ts +317 -100
- package/templates/retail-store-owner/himalaya.content.json +6 -0
- package/templates/retail-store-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/retail-store-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/retail-store-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-order/index.ts +3 -3
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-orders/index.ts +2 -2
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-product/index.ts +31 -32
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-product-form/index.ts +23 -43
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-products/index.ts +2 -2
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
- package/templates/yoga-studio/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/yoga-studio-owner/dev/index.ts +503 -100
- package/templates/yoga-studio-owner/himalaya.content.json +6 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-account.ts +6 -2
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-booking-respond.ts +82 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-load-error.ts +115 -12
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-account/index.ts +7 -4
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-appointments/index.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-ask/live.ts +3 -3
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event/index.ts +18 -20
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event-form/index.ts +20 -28
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-events/index.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-home/index.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-overview/index.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-post/index.ts +60 -43
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-post-form/index.ts +10 -23
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-posts/index.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-service/index.ts +18 -20
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-service-form/index.ts +16 -29
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-services/index.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-sites/index.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-today/index.ts +315 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-wrist/index.ts +42 -15
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Accept / Decline ONE booking request — the write shared by the two __HIMI_APP_NAME__ surfaces that
|
|
2
|
+
// answer a request without opening the booking screen: the paired watch (`himi-owner-lite-wrist`)
|
|
3
|
+
// and the notification's action buttons (`himi-owner-lite-nav`).
|
|
4
|
+
//
|
|
5
|
+
// Both follow the same rules:
|
|
6
|
+
// • the press names the business it was shown for, and is REFUSED unless that is the business
|
|
7
|
+
// the phone has active — a site switched between delivery and press must never confirm
|
|
8
|
+
// another business's booking;
|
|
9
|
+
// • the write itself is addressed at that business (`wix-site-id`), so even a switch that lands
|
|
10
|
+
// between the check and the request cannot move it;
|
|
11
|
+
// • only a request still pending is written, at the revision Wix last reported.
|
|
12
|
+
|
|
13
|
+
import { getBooking, confirmBooking, declineBooking } from "@himalaya/wix-bookings";
|
|
14
|
+
|
|
15
|
+
type Rec = Record<string, unknown>;
|
|
16
|
+
|
|
17
|
+
/** The statuses that are waiting on the owner. */
|
|
18
|
+
export const PENDING_BOOKING_STATUSES: ReadonlySet<string> = new Set(["PENDING", "PENDING_APPROVAL", "WAITING_LIST"]);
|
|
19
|
+
|
|
20
|
+
export type BookingResponse = "confirm" | "decline";
|
|
21
|
+
|
|
22
|
+
/** A press may write only for the business the phone has active. Fails CLOSED: a press that
|
|
23
|
+
* names no business, or a host that cannot say which one is active, writes nothing. */
|
|
24
|
+
export function isForActiveBusiness(siteId: string, activeSiteId: string): boolean {
|
|
25
|
+
return !!siteId && !!activeSiteId && siteId === activeSiteId;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Wix refused the write because the booking moved on (another revision, already handled). */
|
|
29
|
+
export function isStaleBookingWrite(e: unknown): boolean {
|
|
30
|
+
return /revision|\b409\b|ABORTED|conflict/i.test(String((e as Error)?.message ?? e));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Confirm or decline `bookingId` at `revision`, addressed at `siteId`. Rejects without a
|
|
34
|
+
* request when `siteId` is empty: an unaddressed write would land on whatever business the
|
|
35
|
+
* ambient bridge is scoped to. */
|
|
36
|
+
export function writeBookingResponse(kind: BookingResponse, bookingId: string, revision: string, siteId: string): Promise<unknown> {
|
|
37
|
+
const site = siteId.trim();
|
|
38
|
+
if (!site) return Promise.reject(new Error("writeBookingResponse: a booking write must name its business"));
|
|
39
|
+
const opts = { site };
|
|
40
|
+
return kind === "confirm" ? confirmBooking(bookingId, revision, opts) : declineBooking(bookingId, revision, false, opts);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type BookingResponseOutcome =
|
|
44
|
+
| "confirmed" | "declined"
|
|
45
|
+
/** Not written: no booking id, or a press for a business other than the active one. */
|
|
46
|
+
| "refused"
|
|
47
|
+
/** Not written: the booking is no longer waiting on the owner (or no longer exists). */
|
|
48
|
+
| "notPending"
|
|
49
|
+
/** Not written: Wix reported a newer revision between the read and the write. */
|
|
50
|
+
| "stale"
|
|
51
|
+
/** Not written: the read or the write failed. */
|
|
52
|
+
| "failed";
|
|
53
|
+
|
|
54
|
+
function str(r: Rec | undefined, key: string): string {
|
|
55
|
+
const v = r?.[key];
|
|
56
|
+
return typeof v === "string" ? v : typeof v === "number" ? String(v) : "";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Answer a request known only by id — a notification carries no revision, so the booking is
|
|
60
|
+
* read first (from the business the press names) and written only while it is still pending. */
|
|
61
|
+
export async function respondToBookingById(
|
|
62
|
+
kind: BookingResponse,
|
|
63
|
+
bookingId: string,
|
|
64
|
+
siteId: string,
|
|
65
|
+
activeSiteId: string,
|
|
66
|
+
): Promise<BookingResponseOutcome> {
|
|
67
|
+
if (!bookingId || !isForActiveBusiness(siteId, activeSiteId)) return "refused";
|
|
68
|
+
let booking: Rec | undefined;
|
|
69
|
+
try {
|
|
70
|
+
booking = ((await getBooking(bookingId, { site: siteId })) as unknown as { booking?: Rec } | undefined)?.booking;
|
|
71
|
+
} catch {
|
|
72
|
+
return "failed";
|
|
73
|
+
}
|
|
74
|
+
const revision = str(booking, "revision");
|
|
75
|
+
if (!booking || !revision || !PENDING_BOOKING_STATUSES.has(str(booking, "status"))) return "notPending";
|
|
76
|
+
try {
|
|
77
|
+
await writeBookingResponse(kind, bookingId, revision, siteId);
|
|
78
|
+
} catch (e) {
|
|
79
|
+
return isStaleBookingWrite(e) ? "stale" : "failed";
|
|
80
|
+
}
|
|
81
|
+
return kind === "confirm" ? "confirmed" : "declined";
|
|
82
|
+
}
|
|
@@ -20,10 +20,9 @@ export function isOwnerPreviewLive(): boolean {
|
|
|
20
20
|
*
|
|
21
21
|
* `isBridgeUnavailable` cannot answer this: it reads "not live" as "preview",
|
|
22
22
|
* and on NATIVE there is no input at all, so `undefined` satisfies it. That is
|
|
23
|
-
*
|
|
24
|
-
* write
|
|
25
|
-
*
|
|
26
|
-
* their failures the same way (`"HTTP \(code): \(body)"`, JSWorker.swift;
|
|
23
|
+
* left alone for the other apps that use it to pick a demo fallback or to queue
|
|
24
|
+
* a write. Owner-lite reads ask `ownerDemoFallback` instead. It is NOT
|
|
25
|
+
* harmless for choosing COPY: native workers format their failures the same way (`"HTTP \(code): \(body)"`, JSWorker.swift;
|
|
27
26
|
* `"HTTP ${e.code}: ..."`, WebViewJSWorker.kt), so a transient `HTTP 503` on a
|
|
28
27
|
* phone would otherwise be answered with "open this app on a device" — on the
|
|
29
28
|
* device. Callers that pick a SENTENCE ask this instead.
|
|
@@ -43,11 +42,89 @@ export function isBridgeUnavailable(e: unknown): boolean {
|
|
|
43
42
|
return /HTTP (405|501|502|503)\b/.test(String((e as Error)?.message ?? e));
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Whether a failed owner-lite READ may answer with the built-in demo records.
|
|
47
|
+
*
|
|
48
|
+
* Only where a demo was asked for: a web preview host that is not live. On a phone no
|
|
49
|
+
* mode is injected, so `isBridgeUnavailable` alone is `true` for a transient Wix
|
|
50
|
+
* `HTTP 503` — and the owner was shown sample appointments, orders and sites as if
|
|
51
|
+
* they were their business. Native falls through to the screen's error state.
|
|
52
|
+
* `isBridgeUnavailable` keeps its semantics: other apps' callers depend on it.
|
|
53
|
+
*/
|
|
54
|
+
export function ownerDemoFallback(e: unknown): boolean {
|
|
55
|
+
return isOwnerPreviewHost() && !isOwnerPreviewLive() && isBridgeUnavailable(e);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The sentence for an owner WRITE that failed because the device could not reach Wix at
|
|
60
|
+
* all (a transport failure). Nothing replays a queued write on any platform — every host's
|
|
61
|
+
* `drain` passes an empty closure — so the honest answer is that nothing was saved.
|
|
62
|
+
* Copy-as-configuration under `ownerCommon.`, which every owner screen forwards.
|
|
63
|
+
*/
|
|
64
|
+
export function ownerOfflineNotSaved(): string {
|
|
65
|
+
return copyParam(
|
|
66
|
+
"ownerCommon.offlineNotSaved",
|
|
67
|
+
"You’re offline — nothing was saved. Try again when you reconnect.",
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The sentence for an owner WRITE that Wix answered with an unavailable status: the
|
|
72
|
+
* device is online, so it is not "offline" — but nothing was saved all the same. */
|
|
73
|
+
/**
|
|
74
|
+
* Whether a failed WRITE may have landed on Wix anyway, so the user must not be told it
|
|
75
|
+
* was not saved: a transport failure mid-request (timeout, reset, fetch rejection), the web
|
|
76
|
+
* host's after-send envelope (`HTTP 502 {…"sent":true}`), the serve bridge's mid-request
|
|
77
|
+
* `webwix_bridge_upstream_failed`, or a gateway status (502/503/504) that can arrive after
|
|
78
|
+
* the backend already ran. Only connect-time failures (`isOfflineFailure`) and the designed
|
|
79
|
+
* 405/501 bridge refusals prove nothing happened.
|
|
80
|
+
*/
|
|
81
|
+
export function writeMayHaveLanded(e: unknown): boolean {
|
|
82
|
+
if (isOfflineFailure(e)) return false;
|
|
83
|
+
if (isTransportFailure(e)) return true;
|
|
84
|
+
const msg = String((e as Error)?.message ?? e ?? "");
|
|
85
|
+
if (/"sent"\s*:\s*true/.test(msg)) return true;
|
|
86
|
+
// The web host's own envelope WITHOUT `sent: true` failed before the request left it, and
|
|
87
|
+
// a disabled owner rung / bridge refuses by design without sending anything.
|
|
88
|
+
if (/\bwebwix_(?:direct_failed|owner_disabled|bridge_disabled)\b/.test(msg)) return false;
|
|
89
|
+
// `webwix_bridge_upstream_failed` stays ambiguous: the same code covers a lookup that failed
|
|
90
|
+
// before sending and a serve-bridge failure mid-request, and nothing in it says which.
|
|
91
|
+
return /\bwebwix_bridge_upstream_failed\b/.test(msg) || /HTTP (502|503|504)\b/.test(msg);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Wix answered that the record does not exist (`HTTP 404`). A detail must not fall back to
|
|
95
|
+
* its cached row then: that row is what a delete whose reply was lost leaves behind. */
|
|
96
|
+
export function isNotFound(e: unknown): boolean {
|
|
97
|
+
if (/HTTP 404\b/.test(String((e as Error)?.message ?? e ?? ""))) return true;
|
|
98
|
+
// An SDK that answers a 404 with its own "not found" error keeps the HTTP one as `cause`
|
|
99
|
+
// (the blog SDK's getPost, after its query fallback also finds nothing).
|
|
100
|
+
const cause = (e as { cause?: unknown } | null | undefined)?.cause;
|
|
101
|
+
return cause !== undefined && cause !== e && /HTTP 404\b/.test(String((cause as Error)?.message ?? cause));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function ownerUnavailableNotSaved(): string {
|
|
105
|
+
return copyParam(
|
|
106
|
+
"ownerCommon.unavailableNotSaved",
|
|
107
|
+
"Wix isn’t available right now — nothing was saved. Try again in a moment.",
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** The sentence for an owner WRITE that may have landed (`writeMayHaveLanded`): it can't
|
|
112
|
+
* be called saved or not saved. */
|
|
113
|
+
export function ownerWriteUnconfirmed(): string {
|
|
114
|
+
return copyParam(
|
|
115
|
+
"ownerCommon.writeUnconfirmed",
|
|
116
|
+
"Wix didn’t confirm this, so it may or may not have been saved. Check before trying again.",
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Display copy for a failed owner write: `ownerOfflineNotSaved` when the request never
|
|
121
|
+
* left the device, `ownerWriteUnconfirmed` when it may have landed, `ownerUnavailableNotSaved`
|
|
122
|
+
* for the designed 405/501 bridge refusals outside a live preview, else `ownerLoadError`. */
|
|
123
|
+
export function ownerWriteError(e: unknown): string {
|
|
124
|
+
if (isOfflineFailure(e)) return ownerOfflineNotSaved();
|
|
125
|
+
if (writeMayHaveLanded(e)) return ownerWriteUnconfirmed();
|
|
126
|
+
if (!isOwnerPreviewLive() && /HTTP (405|501)\b/.test(String((e as Error)?.message ?? e))) return ownerUnavailableNotSaved();
|
|
127
|
+
return ownerLoadError(e);
|
|
51
128
|
}
|
|
52
129
|
|
|
53
130
|
/** `HTTP 403: …` → "403", when the message carries a status at all. */
|
|
@@ -99,6 +176,10 @@ const TRANSPORT = [
|
|
|
99
176
|
/^Failed to connect to \S/,
|
|
100
177
|
/^Unable to resolve host\b/,
|
|
101
178
|
/\b(?:Connection refused|Network is unreachable|Software caused connection abort)\b/,
|
|
179
|
+
// OkHttp / HttpURLConnection messages a dropped connection produces mid-request, which
|
|
180
|
+
// Android's bridge forwards without the exception class.
|
|
181
|
+
/\b(?:Connection reset|ECONNRESET|ETIMEDOUT|EPIPE|Broken pipe|stream was reset)\b/,
|
|
182
|
+
/^unexpected end of stream\b/i,
|
|
102
183
|
/^(?:timeout|Read timed out|connect timed out)$/i,
|
|
103
184
|
/\bFailed to fetch\b/,
|
|
104
185
|
/\bNetworkError when attempting to fetch\b/,
|
|
@@ -113,6 +194,27 @@ export function isTransportFailure(e: unknown): boolean {
|
|
|
113
194
|
return TRANSPORT.some((re) => re.test(msg));
|
|
114
195
|
}
|
|
115
196
|
|
|
197
|
+
/** Transport failures that happen while CONNECTING — no connection, no route, no such host,
|
|
198
|
+
* connection refused — so the request provably never left the device. Every other
|
|
199
|
+
* transport failure (a timeout, a reset, a bad or truncated response, a browser's fetch
|
|
200
|
+
* rejection, which says nothing about when it failed) may come after Wix took the write. */
|
|
201
|
+
const NEVER_SENT = [
|
|
202
|
+
/\bNSURLErrorDomain Code=-10(?:09|04|03|06|20|18)\b/, // not connected / cannot connect / no host / DNS / data not allowed / roaming off
|
|
203
|
+
/\b(?:UnknownHost|Connect|NoRouteToHost)Exception\b/,
|
|
204
|
+
/^Failed to connect to \S/,
|
|
205
|
+
/^Unable to resolve host\b/,
|
|
206
|
+
/\b(?:Connection refused|Network is unreachable)\b/,
|
|
207
|
+
/\bnet::ERR_(?:INTERNET_DISCONNECTED|NAME_NOT_RESOLVED|CONNECTION_REFUSED|ADDRESS_UNREACHABLE|NETWORK_ACCESS_DENIED)\b/,
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
/** No HTTP answer, and the request provably never left the device: the user is offline, and
|
|
211
|
+
* a write certainly did not happen. Anything else may have landed (see `NEVER_SENT`). */
|
|
212
|
+
export function isOfflineFailure(e: unknown): boolean {
|
|
213
|
+
if (!isTransportFailure(e)) return false;
|
|
214
|
+
const msg = String((e as Error)?.message ?? e ?? "");
|
|
215
|
+
return NEVER_SENT.some((re) => re.test(msg));
|
|
216
|
+
}
|
|
217
|
+
|
|
116
218
|
/** The one sentence for a transport failure. Copy-as-configuration: the key is
|
|
117
219
|
* under `ownerCommon.`, which every owner screen (Aria included) forwards. */
|
|
118
220
|
export function ownerTransportFailureText(): string {
|
|
@@ -194,8 +296,8 @@ export function ownerPreviewUnavailable(): string {
|
|
|
194
296
|
* error says: this names the web preview when there IS one. `isBridgeUnavailable`
|
|
195
297
|
* reads "not live" as "preview", and native injects no mode at all, so the
|
|
196
298
|
* default would answer a device-side `HTTP 503` with "open this app on a device"
|
|
197
|
-
* — on the device. That predicate is deliberately left alone:
|
|
198
|
-
* write-
|
|
299
|
+
* — on the device. That predicate is deliberately left alone: other apps'
|
|
300
|
+
* demo and write-queue decisions depend on exactly it.
|
|
199
301
|
*
|
|
200
302
|
* The reductions this used to add are now in `humanWireError`, so every owner
|
|
201
303
|
* screen gets them rather than the two that happened to call this.
|
|
@@ -232,6 +334,7 @@ export function ownerDisplayError(e: unknown): string {
|
|
|
232
334
|
*/
|
|
233
335
|
export function ownerLoadError(e: unknown): string {
|
|
234
336
|
const msg = String((e as Error)?.message ?? e);
|
|
235
|
-
|
|
337
|
+
// Same host guard as `ownerDisplayError`: on a phone, "open this app on a device" is false.
|
|
338
|
+
if (isOwnerPreviewHost() && isBridgeUnavailable(e)) return ownerPreviewUnavailable();
|
|
236
339
|
return humanWireError(msg);
|
|
237
340
|
}
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
// which goes stale the moment the binary is bumped);
|
|
10
10
|
// • the help / privacy / terms links, which arrive as onAppear params baked
|
|
11
11
|
// from provisioning.json `identity` — so a branded template ships ITS links,
|
|
12
|
-
// and `openLink` can only ever open one of those
|
|
12
|
+
// and `openLink` can only ever open one of those URLs — plus Wix's own
|
|
13
|
+
// account-deletion page (`deleteAccountUrl`, App Store 5.1.1(v)).
|
|
13
14
|
//
|
|
14
15
|
// • which business this is — the one the owner picked on Sites (see
|
|
15
16
|
// `_shared/owner-selected-site.ts`), not the build-time provisioning name,
|
|
@@ -27,7 +28,7 @@ import { stashCopy, copyTemplate } from "../_shared/himi-copy.js";
|
|
|
27
28
|
import { ownerLineOf, shapeAccount, type AccountState } from "../_shared/owner-account.js";
|
|
28
29
|
import { fallbackNameFrom, selectedSiteName } from "../_shared/owner-selected-site.js";
|
|
29
30
|
|
|
30
|
-
type LinkKind = "support" | "privacy" | "terms";
|
|
31
|
+
type LinkKind = "support" | "privacy" | "terms" | "deleteAccount";
|
|
31
32
|
|
|
32
33
|
const obj = (v: unknown): Record<string, unknown> => (v && typeof v === "object" ? v as Record<string, unknown> : {});
|
|
33
34
|
|
|
@@ -44,7 +45,8 @@ const svc = defineService<AccountState, {
|
|
|
44
45
|
fallbackBusinessName = fallbackNameFrom(arg, fallbackBusinessName);
|
|
45
46
|
const businessName = selectedSiteName(fallbackBusinessName);
|
|
46
47
|
const p = obj(arg);
|
|
47
|
-
const links = { supportUrl: String(p.supportUrl ?? s.supportUrl), privacyUrl: String(p.privacyUrl ?? s.privacyUrl), termsUrl: String(p.termsUrl ?? s.termsUrl)
|
|
48
|
+
const links = { supportUrl: String(p.supportUrl ?? s.supportUrl), privacyUrl: String(p.privacyUrl ?? s.privacyUrl), termsUrl: String(p.termsUrl ?? s.termsUrl),
|
|
49
|
+
deleteAccountUrl: String(p.deleteAccountUrl ?? s.deleteAccountUrl) };
|
|
48
50
|
let ownerLine = "";
|
|
49
51
|
// Why the identity line is missing, when it is. Kept in state (the failure is
|
|
50
52
|
// modelled, not swallowed) but not painted: a settings screen that cannot name
|
|
@@ -68,7 +70,8 @@ const svc = defineService<AccountState, {
|
|
|
68
70
|
},
|
|
69
71
|
openLink: async (s, arg) => {
|
|
70
72
|
const kind = String(obj(arg).kind ?? arg ?? "") as LinkKind;
|
|
71
|
-
const url = kind === "support" ? s.supportUrl : kind === "privacy" ? s.privacyUrl : kind === "terms" ? s.termsUrl
|
|
73
|
+
const url = kind === "support" ? s.supportUrl : kind === "privacy" ? s.privacyUrl : kind === "terms" ? s.termsUrl
|
|
74
|
+
: kind === "deleteAccount" ? s.deleteAccountUrl : "";
|
|
72
75
|
if (url) await open(url);
|
|
73
76
|
return s;
|
|
74
77
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// `loadEntityRows` calls the SAME owner-scoped Wix clients the sibling
|
|
4
4
|
// list/detail workers use (searchOrders, queryStoreProducts, …), with the
|
|
5
|
-
// identical `
|
|
5
|
+
// identical `ownerDemoFallback` → owner-preview-demo fallback (preview hosts only).
|
|
6
6
|
//
|
|
7
7
|
// That is not a nicety. A generated row carries its record `id` into
|
|
8
8
|
// `tier5.ask.openEntity`, which navigates to `himi_owner_lite_<entity>` — and
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// alias map to resolve a bare "@himalaya/wix-*" with.
|
|
17
17
|
import { wixMediaUrl } from "@himalaya/wix-media";
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import { isOwnerPreviewDemo, ownerDemoFallback } from "../_shared/owner-load-error.js";
|
|
20
20
|
import { queryStoreProducts, productPrice, type StoreProduct } from "../_shared/himi-store.js";
|
|
21
21
|
import { updateProduct, deleteProduct } from "@himalaya/wix-stores";
|
|
22
22
|
import { deleteDraftPost } from "@himalaya/wix-blog";
|
|
@@ -362,7 +362,7 @@ export async function loadEntityRows(entity: EntityName): Promise<{ rows: Row[];
|
|
|
362
362
|
// labelled demo row keeps the web preview useful; for a measure it would be
|
|
363
363
|
// fabricated traffic and revenue, which is the one thing this screen family
|
|
364
364
|
// refuses. It takes the error arm below instead, exactly as a timeout does.
|
|
365
|
-
if (
|
|
365
|
+
if (ownerDemoFallback(e) && entity !== "metrics") return { rows: demoRows(entity), demo: true, error: "" };
|
|
366
366
|
return { rows: [], demo: false, error: `${entity} couldn't be read` };
|
|
367
367
|
}
|
|
368
368
|
}
|
|
@@ -8,25 +8,24 @@
|
|
|
8
8
|
import { defineService } from "@himalaya/state";
|
|
9
9
|
import { getEvent, deleteEvent, type WixEvent } from "@himalaya/wix-events";
|
|
10
10
|
import { normalizeEvent, eventDescription } from "../_shared/himi-events.js";
|
|
11
|
-
import { ownerLoadError,
|
|
11
|
+
import { ownerLoadError, isOwnerPreviewDemo, ownerDemoFallback, ownerWriteError, isNotFound } from "../_shared/owner-load-error.js";
|
|
12
12
|
import { DEMO_EVENTS, DEMO_NOTE, DEMO_SAVE_NOTE } from "../_shared/owner-preview-demo.js";
|
|
13
13
|
import { stashCopy, copyParam } from "../_shared/himi-copy.js";
|
|
14
14
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
15
15
|
import { richBody } from "../_shared/rich-body.js";
|
|
16
|
-
import { get as dbGet, upsert as dbUpsert, remove as dbRemove,
|
|
16
|
+
import { get as dbGet, upsert as dbUpsert, remove as dbRemove, type DbEntity } from "../_shared/owner-local-db.js";
|
|
17
17
|
import { blankFlags } from "../_shared/detail-facts.js";
|
|
18
18
|
|
|
19
19
|
// Offline-first (data-offline): the event DETAIL falls back to the last-synced
|
|
20
|
-
// local `owner_events` row
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
20
|
+
// local `owner_events` row on a failed fetch. Its delete is SERVER-CONFIRMED: the
|
|
21
|
+
// local row is dropped only after Wix deletes the event; a failed delete leaves it
|
|
22
|
+
// and tells the owner why. No host replays a queued write, so nothing is queued.
|
|
23
|
+
// Every local-db call is wrapped so a build without the `local_database` grant
|
|
24
|
+
// behaves exactly as before (online-only).
|
|
25
25
|
const ENTITY = "owner_events";
|
|
26
26
|
async function cachePut(row: DbEntity): Promise<void> { try { await dbUpsert(ENTITY, row); } catch { /* capability not granted */ } }
|
|
27
27
|
async function cacheDrop(id: string): Promise<void> { try { await dbRemove(ENTITY, id); } catch { /* capability not granted */ } }
|
|
28
28
|
async function cacheGet(id: string): Promise<DbEntity | null> { try { return await dbGet(ENTITY, id); } catch { return null; } }
|
|
29
|
-
async function queueWrite(actionId: string, params: Record<string, string>): Promise<void> { try { await dbEnqueue(actionId, params); } catch { /* capability not granted */ } }
|
|
30
29
|
|
|
31
30
|
interface EventState {
|
|
32
31
|
id: string;
|
|
@@ -281,9 +280,10 @@ const svc = defineService<EventState, {
|
|
|
281
280
|
return loaded;
|
|
282
281
|
} catch (e) {
|
|
283
282
|
// Offline: fall back to the last-synced local row before the demo/error paths.
|
|
284
|
-
|
|
283
|
+
// Wix says it is gone (e.g. a delete whose reply was lost): drop the row, never show it.
|
|
284
|
+
const cached = isNotFound(e) ? (await cacheDrop(id), null) : await cacheGet(id);
|
|
285
285
|
if (cached) return cachedDetail(s, cached);
|
|
286
|
-
if (
|
|
286
|
+
if (ownerDemoFallback(e)) {
|
|
287
287
|
const demo = demoDetail(s, id);
|
|
288
288
|
if (demo) return demo;
|
|
289
289
|
}
|
|
@@ -304,9 +304,10 @@ const svc = defineService<EventState, {
|
|
|
304
304
|
await cacheBodyText(loaded);
|
|
305
305
|
return loaded;
|
|
306
306
|
} catch (e) {
|
|
307
|
-
|
|
307
|
+
// Wix says it is gone (e.g. a delete whose reply was lost): drop the row, never show it.
|
|
308
|
+
const cached = isNotFound(e) ? (await cacheDrop(s.id), null) : await cacheGet(s.id);
|
|
308
309
|
if (cached) return cachedDetail(s, cached);
|
|
309
|
-
if (
|
|
310
|
+
if (ownerDemoFallback(e)) {
|
|
310
311
|
const demo = demoDetail(s, s.id);
|
|
311
312
|
if (demo) return demo;
|
|
312
313
|
}
|
|
@@ -328,18 +329,15 @@ const svc = defineService<EventState, {
|
|
|
328
329
|
const s = disarm(s0);
|
|
329
330
|
if (isOwnerPreviewDemo() || s.demoNote) return shape({ ...s, actionMessage: copyParam("ownerCommon.demoSaveNote", DEMO_SAVE_NOTE) });
|
|
330
331
|
if (!s.id) return shape({ ...s, actionMessage: copyParam("ownerEvent.noIdMessage", "No event id.") });
|
|
331
|
-
// Optimistic local delete — the list drops the row immediately.
|
|
332
|
-
await cacheDrop(s.id);
|
|
333
332
|
try {
|
|
334
333
|
await deleteEvent(s.id);
|
|
335
|
-
return shape({ ...s, status: "deleted", title: "", emptyText: copyParam("ownerEvent.deletedEmpty", "Event deleted."), actionMessage: "" });
|
|
336
334
|
} catch (e) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return shape({ ...s, status: "deleted", title: "", emptyText: copyParam("ownerEvent.deletedEmpty", "Event deleted."), actionMessage: copyParam("ownerCommon.demoSaveNote", DEMO_SAVE_NOTE) });
|
|
340
|
-
}
|
|
341
|
-
return shape({ ...s, actionMessage: ownerLoadError(e) });
|
|
335
|
+
// Nothing replays a queued write: the record stays, and the owner is told why.
|
|
336
|
+
return shape({ ...s, actionMessage: ownerWriteError(e) });
|
|
342
337
|
}
|
|
338
|
+
// Only a delete Wix confirmed leaves the local list.
|
|
339
|
+
await cacheDrop(s.id);
|
|
340
|
+
return shape({ ...s, status: "deleted", title: "", emptyText: copyParam("ownerEvent.deletedEmpty", "Event deleted."), actionMessage: "" });
|
|
343
341
|
} finally {
|
|
344
342
|
deleteInFlight = false;
|
|
345
343
|
}
|
|
@@ -13,22 +13,20 @@ import { postBodyText, plainPostBody } from "../_shared/owner-post-content.js";
|
|
|
13
13
|
import { editorSubmitValue, queuedDocument, editorChanged, cachedRichVerdict, editorRunKeys, resetHydratedEditorOnOlderRuntime, editorAfterSave, liveState, settleOverLive } from "../_shared/owner-editor-value.js";
|
|
14
14
|
import { parseRicosJson } from "@himalaya/wix-rich-content";
|
|
15
15
|
import { ricosUploadService } from "@himalaya/wix-rich-content-editor";
|
|
16
|
-
import { ownerLoadError,
|
|
16
|
+
import { ownerLoadError, isOwnerPreviewDemo, ownerDemoFallback, ownerWriteError } from "../_shared/owner-load-error.js";
|
|
17
17
|
import { DEMO_EVENTS, DEMO_NOTE, DEMO_SAVE_NOTE, demoRefusalPatch } from "../_shared/owner-preview-demo.js";
|
|
18
18
|
import { stashCopy, copyParam } from "../_shared/himi-copy.js";
|
|
19
|
-
import { get as dbGet, upsert as dbUpsert,
|
|
19
|
+
import { get as dbGet, upsert as dbUpsert, type DbEntity } from "../_shared/owner-local-db.js";
|
|
20
20
|
|
|
21
|
-
// Offline-first (data-offline):
|
|
22
|
-
// `owner_events`
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
// behaves exactly as before (online-only, no cache/queue).
|
|
21
|
+
// Offline-first (data-offline): load prefills from the last-synced local
|
|
22
|
+
// `owner_events` row when offline, and the edit is SERVER-CONFIRMED — the local row
|
|
23
|
+
// changes only after Wix accepts it; a failed save leaves it alone, keeps the form,
|
|
24
|
+
// and tells the owner why. No host replays a queued write, so nothing is queued.
|
|
25
|
+
// Every local-db call is wrapped (try/catch) so a build that ships without the
|
|
26
|
+
// `local_database` grant behaves exactly as before (online-only, no cache).
|
|
28
27
|
const ENTITY = "owner_events";
|
|
29
28
|
async function cachePut(row: DbEntity): Promise<void> { try { await dbUpsert(ENTITY, row); } catch { /* capability not granted */ } }
|
|
30
29
|
async function cacheGet(id: string): Promise<DbEntity | null> { try { return await dbGet(ENTITY, id); } catch { return null; } }
|
|
31
|
-
async function queueWrite(actionId: string, params: Record<string, string>): Promise<void> { try { await dbEnqueue(actionId, params); } catch { /* capability not granted */ } }
|
|
32
30
|
|
|
33
31
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
34
32
|
|
|
@@ -248,7 +246,7 @@ const svc = defineService<EventFormState, {
|
|
|
248
246
|
status: "idle", error: "", savedMessage: "",
|
|
249
247
|
});
|
|
250
248
|
}
|
|
251
|
-
if (
|
|
249
|
+
if (ownerDemoFallback(e)) {
|
|
252
250
|
const d = DEMO_EVENTS.find((x) => x.id === id);
|
|
253
251
|
if (d) {
|
|
254
252
|
return shape({
|
|
@@ -308,7 +306,7 @@ const svc = defineService<EventFormState, {
|
|
|
308
306
|
// PUBLISHED SDK until its next release.
|
|
309
307
|
const event: { title: string; description?: { nodes: unknown[] } } = { title, ...(doc ? { description: doc } : {}) };
|
|
310
308
|
|
|
311
|
-
//
|
|
309
|
+
// The row the cache gets once Wix accepts the save. The document the record
|
|
312
310
|
// now holds, when known, rides along so an offline reopen seeds the editor with it.
|
|
313
311
|
const loadedJson = s.descriptionMode === "editor" && !s.descriptionPending ? s.descriptionJson : "";
|
|
314
312
|
const heldJson = docRaw || (doc ? JSON.stringify(doc) : loadedJson);
|
|
@@ -319,13 +317,13 @@ const svc = defineService<EventFormState, {
|
|
|
319
317
|
const cached = replay && !s.id ? await cacheGet(targetId) : null;
|
|
320
318
|
// A queued metadata edit omitted the event body and read-only details. Keep their cached
|
|
321
319
|
// values rather than replacing them with a fresh worker's empty/default state.
|
|
322
|
-
|
|
320
|
+
const localRow: DbEntity = {
|
|
323
321
|
...(cached ?? {}), id: targetId, name: title, title,
|
|
324
322
|
description: doc ? description : String(cached?.description ?? description),
|
|
325
323
|
descriptionProtected: doc ? cachedRichVerdict(heldDoc as never, knownPlain) : String(cached?.descriptionProtected ?? cachedRichVerdict(heldDoc as never, knownPlain)),
|
|
326
324
|
...(heldJson ? { descriptionJson: heldJson } : {}),
|
|
327
325
|
when: String(cached?.when ?? s.when), location: String(cached?.location ?? s.location),
|
|
328
|
-
}
|
|
326
|
+
};
|
|
329
327
|
const savedState = (savedMessage: string) => {
|
|
330
328
|
// An edit typed while this save was in flight stays unsaved work ([rico] #3644).
|
|
331
329
|
const after = editorAfterSave("description", s as never, liveState(svc), !!doc);
|
|
@@ -341,22 +339,16 @@ const svc = defineService<EventFormState, {
|
|
|
341
339
|
};
|
|
342
340
|
try {
|
|
343
341
|
await updateEvent(targetId, event);
|
|
342
|
+
// The local row follows only what Wix confirmed.
|
|
343
|
+
await cachePut(localRow);
|
|
344
344
|
return savedState(copyParam("ownerEventForm.savedMessage", "Event saved."));
|
|
345
345
|
} catch (e) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
// (WriteQueue, idempotent) when connectivity returns. A document rides as `descriptionJson`
|
|
353
|
-
// with descriptionEdited "false", so a bundle rolled back past this change leaves the
|
|
354
|
-
// description rather than flattening it to text.
|
|
355
|
-
await queueWrite("tier5.himiOwnerLiteEventForm.submit", { id: targetId, title, description,
|
|
356
|
-
...(docRaw ? { descriptionJson: docRaw, descriptionEdited: "false" } : { descriptionEdited: String(doc !== null) }) });
|
|
357
|
-
return savedState(copyParam("ownerEventForm.savedOffline", "Saved offline — will sync when you reconnect."));
|
|
358
|
-
}
|
|
359
|
-
return shape({ ...s, status: "error", error: ownerLoadError(e), savedMessage: "" });
|
|
346
|
+
// Never "saved offline": nothing replays a queued write on any platform. The cache was
|
|
347
|
+
// not touched, and the typed values stay in the form (the body in its editor) so a retry
|
|
348
|
+
// is one tap.
|
|
349
|
+
// Demo / web-preview: the record came from demo sample data (marked by demoNote).
|
|
350
|
+
if (s.demoNote) return demoRefusal(s);
|
|
351
|
+
return shape({ ...s, title, ...(s.descriptionMode === "editor" ? {} : { description }), status: "error", error: ownerWriteError(e), savedMessage: "" });
|
|
360
352
|
}
|
|
361
353
|
})()),
|
|
362
354
|
},
|
|
@@ -6,7 +6,7 @@ import { offsetPage } from "../_shared/offset-page.js";
|
|
|
6
6
|
import { defineBackendCollection } from "../_shared/collection-service.js";
|
|
7
7
|
import { queryEvents } from "@himalaya/wix-events";
|
|
8
8
|
import { normalizeEvent, type EventRow } from "../_shared/himi-events.js";
|
|
9
|
-
import { ownerLoadError,
|
|
9
|
+
import { ownerLoadError, isOwnerPreviewDemo, ownerDemoFallback } from "../_shared/owner-load-error.js";
|
|
10
10
|
import { DEMO_EVENTS, DEMO_NOTE } from "../_shared/owner-preview-demo.js";
|
|
11
11
|
import { copyParam } from "../_shared/himi-copy.js";
|
|
12
12
|
import { getAll, upsert, type DbEntity } from "../_shared/owner-local-db.js";
|
|
@@ -152,7 +152,7 @@ const svc = defineBackendCollection("himiOwnerLiteEvents", {
|
|
|
152
152
|
const cached = await readCachedRows();
|
|
153
153
|
if (cached.length) return { items: cached, nextCursor: "", complete: false, metadata: { fromCache: true } };
|
|
154
154
|
}
|
|
155
|
-
if (!cursor &&
|
|
155
|
+
if (!cursor && ownerDemoFallback(error)) return demo();
|
|
156
156
|
throw error;
|
|
157
157
|
}
|
|
158
158
|
},
|
|
@@ -19,7 +19,7 @@ import { getSiteAnalytics, getSiteTimeZone, localDateRange, localDateOf, localMi
|
|
|
19
19
|
// `text(...)` and never matched on — the RAW reason is kept beside it in
|
|
20
20
|
// `<part>Reason` for anything that needs it — so the display-only reduction is
|
|
21
21
|
// both safe here and the reason a 428 reason code stopped reaching the owner.
|
|
22
|
-
import { ownerDisplayError,
|
|
22
|
+
import { ownerDisplayError, isOwnerPreviewDemo, ownerDemoFallback } from "../_shared/owner-load-error.js";
|
|
23
23
|
import { DEMO_DASHBOARD, DEMO_NOTE, DEMO_TODAY } from "../_shared/owner-preview-demo.js";
|
|
24
24
|
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
25
25
|
import { fallbackNameFrom, selectedSiteName } from "../_shared/owner-selected-site.js";
|
|
@@ -803,7 +803,7 @@ async function loadDashboard(s: HomeState, sources: HomeSourceId[]): Promise<Hom
|
|
|
803
803
|
const successfulParts = results.flatMap(({ value }) => [value.primary, value.metrics, value.activity]).filter(Boolean);
|
|
804
804
|
const failedReasons = results.flatMap(({ value }) => [value.primaryReason, value.metricsReason, value.activityReason]).filter((reason) => reason !== undefined);
|
|
805
805
|
if (successfulParts.length === 0) {
|
|
806
|
-
if (failedReasons.length > 0 && failedReasons.every((reason) =>
|
|
806
|
+
if (failedReasons.length > 0 && failedReasons.every((reason) => ownerDemoFallback(reason))) {
|
|
807
807
|
return demoDashboard(shape({ ...s, sourceStates: [], sourceFailures: [] }));
|
|
808
808
|
}
|
|
809
809
|
return shape({ ...composeState(), status: "error", error: ownerDisplayError(failedReasons[0]) });
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { defineService } from "@himalaya/state";
|
|
10
10
|
import { getOrder, type WixOrder, type WixOrderLineItem } from "@himalaya/wix-ecom";
|
|
11
|
-
import { ownerLoadError,
|
|
11
|
+
import { ownerLoadError, isOwnerPreviewDemo, ownerDemoFallback } from "../_shared/owner-load-error.js";
|
|
12
12
|
import { DEMO_ORDERS, DEMO_NOTE, demoOrderDate } from "../_shared/owner-preview-demo.js";
|
|
13
13
|
import { stashCopy, copyParam } from "../_shared/himi-copy.js";
|
|
14
14
|
import { formatDateMedium } from "../_shared/engine-intl.js";
|
|
@@ -298,7 +298,7 @@ const svc = defineService<OrderState, {
|
|
|
298
298
|
try {
|
|
299
299
|
return await refresh(shape({ ...s, id, status: "loading" }), id);
|
|
300
300
|
} catch (e) {
|
|
301
|
-
if (
|
|
301
|
+
if (ownerDemoFallback(e)) {
|
|
302
302
|
const demo = demoDetail(s, id);
|
|
303
303
|
if (demo) return demo;
|
|
304
304
|
}
|
|
@@ -356,7 +356,7 @@ const svc = defineService<OrderState, {
|
|
|
356
356
|
try {
|
|
357
357
|
return await refresh(shape({ ...s, status: "loading" }), s.id);
|
|
358
358
|
} catch (e) {
|
|
359
|
-
if (
|
|
359
|
+
if (ownerDemoFallback(e)) {
|
|
360
360
|
const demo = demoDetail(s, s.id);
|
|
361
361
|
if (demo) return demo;
|
|
362
362
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { defineBackendCollection } from "../_shared/collection-service.js";
|
|
10
10
|
import { searchOrders, type WixOrder } from "@himalaya/wix-ecom";
|
|
11
|
-
import { ownerLoadError,
|
|
11
|
+
import { ownerLoadError, isOwnerPreviewDemo, ownerDemoFallback } from "../_shared/owner-load-error.js";
|
|
12
12
|
import { DEMO_ORDERS, DEMO_NOTE, demoOrderDate } from "../_shared/owner-preview-demo.js";
|
|
13
13
|
import { copyParam } from "../_shared/himi-copy.js";
|
|
14
14
|
import { compareText, formatMonthDay } from "../_shared/engine-intl.js";
|
|
@@ -276,7 +276,7 @@ const svc = defineBackendCollection("himiOwnerLiteOrders", {
|
|
|
276
276
|
if (metadata?.hasNext && !nextCursor) throw new Error("Orders response is missing its next-page cursor");
|
|
277
277
|
return { items: (response.orders ?? []).filter(order => !!order?.id).map(normalize), nextCursor, metadata: { demoNote: "" } };
|
|
278
278
|
} catch (error) {
|
|
279
|
-
if (!cursor &&
|
|
279
|
+
if (!cursor && ownerDemoFallback(error)) return demoPage();
|
|
280
280
|
throw error;
|
|
281
281
|
}
|
|
282
282
|
},
|
|
@@ -27,7 +27,7 @@ import { defineService } from "@himalaya/state";
|
|
|
27
27
|
import { querySites, type WixSite } from "@himalaya/wix-site-list";
|
|
28
28
|
import { site } from "@himalaya/wix-platform";
|
|
29
29
|
import { searchOrders } from "@himalaya/wix-ecom";
|
|
30
|
-
import { ownerLoadError,
|
|
30
|
+
import { ownerLoadError, isOwnerPreviewDemo, ownerDemoFallback } from "../_shared/owner-load-error.js";
|
|
31
31
|
import { DEMO_SITES, DEMO_NOTE } from "../_shared/owner-preview-demo.js";
|
|
32
32
|
import { stashCopy, copyParam } from "../_shared/himi-copy.js";
|
|
33
33
|
import { pickSite, pickedSite } from "../_shared/owner-site-pick.js";
|
|
@@ -203,7 +203,7 @@ async function loadRollup(): Promise<OverviewState> {
|
|
|
203
203
|
return shape({ status: "ready", rows });
|
|
204
204
|
} catch (e) {
|
|
205
205
|
// Only the ACCOUNT-level list failing gets here; a per-business failure is a row.
|
|
206
|
-
if (
|
|
206
|
+
if (ownerDemoFallback(e)) return demoRollup();
|
|
207
207
|
return shape({ status: "error", rows: [], error: ownerLoadError(e) });
|
|
208
208
|
}
|
|
209
209
|
}
|