@wix/himalaya-cli 0.1748.0 → 0.1750.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/bin/himi +16 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +9 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/l10n.mjs +1 -1
- package/dist/browser-plane/assets.json +7 -7
- package/dist/browser-plane/preview-deferred/{63821bbb8f637899037252154a5587f0596e4b537173c7f50551f9e44f7c22c0.bin → b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin} +1 -1
- package/dist/browser-plane/sw.js +6 -6
- package/dist/browser-plane/t5-frame.html +1 -1
- package/dist/browser-plane/t5-worker-frame.html +1 -1
- package/dist/cli.mjs +13464 -8217
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +9 -0
- package/guides/getting-started.md +3 -1
- package/guides/himi-json-output.md +54 -1
- package/guides/himi-skill.md +3 -1
- package/guides/one-app-to-himi-app.md +31 -8
- package/guides/skill.md +3 -1
- package/guides/store-submission.md +149 -34
- package/guides/wix-business-context.md +14 -0
- package/package.json +10 -10
- package/template-icons/medical-services.png +0 -0
- package/template-icons/personal-fitness-trainer.png +0 -0
- package/templates/beauty-salon/config.ts +12 -0
- package/templates/beauty-salon/dev/index.ts +1 -0
- package/templates/beauty-salon/l10n/en.json +6 -0
- package/templates/beauty-salon/l10n/fr.json +11 -0
- package/templates/beauty-salon/l10n/he.json +9 -0
- package/templates/beauty-salon/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/beauty-salon/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/beauty-salon/tier5-src/_shared/header-badges.ts +113 -0
- package/templates/beauty-salon/tier5-src/_shared/location-pin.ts +97 -0
- package/templates/beauty-salon/tier5-src/_shared/member-access.ts +17 -6
- package/templates/beauty-salon/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/beauty-salon/tier5-src/_shared/source-badges.ts +72 -0
- package/templates/beauty-salon/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/beauty-salon/tier5-src/himi-branded-lite-nav/index.ts +152 -0
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/beauty-salon/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/beauty-salon-owner/dev/index.ts +54 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/branded-lite/config.ts +12 -0
- package/templates/branded-lite/dev/index.ts +1 -0
- package/templates/branded-lite/l10n/fr.json +10 -0
- package/templates/branded-lite/l10n/he.json +8 -0
- package/templates/branded-lite/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/branded-lite/tier5-src/_shared/location-pin.ts +97 -0
- package/templates/branded-lite/tier5-src/_shared/member-access.ts +17 -6
- package/templates/branded-lite/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/branded-lite/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +10 -5
- package/templates/branded-lite/tier5-src/himi-branded-lite-nav/index.ts +152 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +12 -1
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/branded-lite/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/community-club/dev/index.ts +1 -0
- package/templates/community-club/tier5-src/_shared/member-access.ts +17 -6
- package/templates/community-club/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/community-club/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/community-club/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/community-club-owner/dev/index.ts +54 -0
- package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/conference/dev/index.ts +1 -0
- package/templates/conference/tier5-src/_shared/member-access.ts +17 -6
- package/templates/conference/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/events-meetups/dev/index.ts +1 -0
- package/templates/events-meetups/tier5-src/_shared/member-access.ts +17 -6
- package/templates/events-meetups/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/events-meetups/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/events-meetups-owner/dev/index.ts +54 -0
- package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/gym-fitness/config.ts +12 -0
- package/templates/gym-fitness/dev/index.ts +1 -0
- package/templates/gym-fitness/l10n/en.json +6 -0
- package/templates/gym-fitness/l10n/fr.json +11 -0
- package/templates/gym-fitness/l10n/he.json +9 -0
- package/templates/gym-fitness/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/gym-fitness/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/gym-fitness/tier5-src/_shared/header-badges.ts +113 -0
- package/templates/gym-fitness/tier5-src/_shared/location-pin.ts +97 -0
- package/templates/gym-fitness/tier5-src/_shared/member-access.ts +17 -6
- package/templates/gym-fitness/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/gym-fitness/tier5-src/_shared/source-badges.ts +72 -0
- package/templates/gym-fitness/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/gym-fitness/tier5-src/himi-branded-lite-nav/index.ts +152 -0
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/gym-fitness/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/gym-fitness-owner/dev/index.ts +54 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/medical-services/README.md +53 -0
- package/templates/medical-services/config.ts +320 -0
- package/templates/medical-services/dev/index.ts +17783 -0
- package/templates/medical-services/himalaya.content.json +46 -0
- package/templates/medical-services/himalaya.template.json +14 -0
- package/templates/medical-services/icon.png +0 -0
- package/templates/medical-services/platforms.json +1 -0
- package/templates/medical-services/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/medical-services/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/medical-services/tier5-src/_shared/booking-session.ts +224 -0
- package/templates/medical-services/tier5-src/_shared/branded-lite-hosted.ts +280 -0
- package/templates/medical-services/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/medical-services/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/medical-services/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/medical-services/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/medical-services/tier5-src/_shared/engine-intl.ts +523 -0
- package/templates/medical-services/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/medical-services/tier5-src/_shared/himi-account.ts +194 -0
- package/templates/medical-services/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/medical-services/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/medical-services/tier5-src/_shared/himi-copy.ts +116 -0
- package/templates/medical-services/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/medical-services/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/medical-services/tier5-src/_shared/host-events.ts +66 -0
- package/templates/medical-services/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/medical-services/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/medical-services/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
- package/templates/medical-services/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/medical-services/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/medical-services/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/medical-services/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/medical-services/tier5-src/_shared/member-access.ts +63 -0
- package/templates/medical-services/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/medical-services/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/medical-services/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/medical-services/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/medical-services/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/medical-services/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/medical-services/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/medical-services/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/medical-services/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/medical-services/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/medical-services/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/medical-services/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/medical-services/tier5-src/_shared/weekly-goal.ts +107 -0
- package/templates/medical-services/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/medical-services/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/medical-services/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/medical-services/tier5-src/business-chat/index.ts +732 -0
- package/templates/medical-services/tier5-src/himi-booking-account/index.ts +252 -0
- package/templates/medical-services/tier5-src/himi-booking-bookings/index.ts +468 -0
- package/templates/medical-services/tier5-src/himi-booking-service/index.ts +1190 -0
- package/templates/medical-services/tier5-src/himi-booking-services/index.ts +791 -0
- package/templates/medical-services/tier5-src/himi-booking-time/index.ts +1729 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-faq/index.ts +6 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
- package/templates/medical-services/tier5-src/himi-clinic-home/index.ts +389 -0
- package/templates/medical-services/tier5-src/himi-store-account/index.ts +1007 -0
- package/templates/medical-services/tokens.json +418 -0
- package/templates/nonprofit-cause/dev/index.ts +1 -0
- package/templates/nonprofit-cause/tier5-src/_shared/member-access.ts +17 -6
- package/templates/nonprofit-cause/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/nonprofit-cause/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/nonprofit-cause-owner/dev/index.ts +54 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/owner-lite/dev/index.ts +54 -0
- package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/personal-fitness-trainer/README.md +51 -0
- package/templates/personal-fitness-trainer/config.ts +343 -0
- package/templates/personal-fitness-trainer/dev/index.ts +24813 -0
- package/templates/personal-fitness-trainer/himalaya.content.json +79 -0
- package/templates/personal-fitness-trainer/himalaya.template.json +14 -0
- package/templates/personal-fitness-trainer/icon.png +0 -0
- package/templates/personal-fitness-trainer/platforms.json +3 -0
- package/templates/personal-fitness-trainer/splash.json +3 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/booking-session.ts +224 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/branded-lite-hosted.ts +280 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/engine-intl.ts +523 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-account.ts +194 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-copy.ts +116 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-layouts.ts +142 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/host-events.ts +66 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-access.ts +63 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/pricing-plan-display.ts +64 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/video-caption.ts +21 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/weekly-goal.ts +107 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/personal-fitness-trainer/tier5-src/business-chat/index.ts +732 -0
- package/templates/personal-fitness-trainer/tier5-src/business-contact/index.ts +6 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-bookings/index.ts +468 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-service/index.ts +1190 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-services/index.ts +791 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +1729 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/index.ts +1094 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +955 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-appearance/index.ts +94 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-plans/index.ts +495 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-splash/index.ts +35 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +226 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-videos/index.ts +145 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-home/index.ts +70 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-profile/index.ts +53 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +1007 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-app-language/index.ts +73 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-view-profile/index.ts +119 -0
- package/templates/personal-fitness-trainer/tokens.json +381 -0
- package/templates/podcast-creator/dev/index.ts +1 -0
- package/templates/podcast-creator/tier5-src/_shared/member-access.ts +17 -6
- package/templates/podcast-creator/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/podcast-creator/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/podcast-creator-owner/dev/index.ts +54 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/portfolio-creative/dev/index.ts +1 -0
- package/templates/portfolio-creative/tier5-src/_shared/member-access.ts +17 -6
- package/templates/portfolio-creative/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/portfolio-creative/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/portfolio-creative-owner/dev/index.ts +54 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/restaurant/dev/index.ts +1 -0
- package/templates/restaurant/tier5-src/_shared/member-access.ts +17 -6
- package/templates/restaurant/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/restaurant/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/restaurant-owner/dev/index.ts +54 -0
- package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/retail-store/dev/index.ts +1 -0
- package/templates/retail-store/tier5-src/_shared/member-access.ts +17 -6
- package/templates/retail-store/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/retail-store/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/retail-store-owner/dev/index.ts +54 -0
- package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/salon-spa/dev/index.ts +1 -0
- package/templates/salon-spa/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/salon-spa/tier5-src/_shared/member-access.ts +17 -6
- package/templates/salon-spa/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/salon-spa/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/salon-spa/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/wholesale-store/dev/index.ts +1 -0
- package/templates/wholesale-store/tier5-src/_shared/member-access.ts +17 -6
- package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/yoga-studio/config.ts +12 -0
- package/templates/yoga-studio/dev/index.ts +1 -0
- package/templates/yoga-studio/l10n/en.json +6 -0
- package/templates/yoga-studio/l10n/fr.json +11 -0
- package/templates/yoga-studio/l10n/he.json +9 -0
- package/templates/yoga-studio/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/yoga-studio/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/yoga-studio/tier5-src/_shared/header-badges.ts +113 -0
- package/templates/yoga-studio/tier5-src/_shared/location-pin.ts +97 -0
- package/templates/yoga-studio/tier5-src/_shared/member-access.ts +17 -6
- package/templates/yoga-studio/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/yoga-studio/tier5-src/_shared/source-badges.ts +72 -0
- package/templates/yoga-studio/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/yoga-studio/tier5-src/himi-branded-lite-nav/index.ts +152 -0
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/yoga-studio/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/yoga-studio-owner/dev/index.ts +54 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
|
@@ -565,6 +565,9 @@ interface S extends IapRestoreFields {
|
|
|
565
565
|
lastNameFocus: string;
|
|
566
566
|
emailFocus: string;
|
|
567
567
|
message: string;
|
|
568
|
+
hideMessage: boolean;
|
|
569
|
+
messageKind: "error" | "success";
|
|
570
|
+
resetSent: boolean;
|
|
568
571
|
isLoading: boolean;
|
|
569
572
|
notLoading: boolean;
|
|
570
573
|
isRegistering: boolean;
|
|
@@ -640,6 +643,9 @@ function derive(s: S): S {
|
|
|
640
643
|
const name = s.isMember ? greetingName(s.memberName) : "";
|
|
641
644
|
return {
|
|
642
645
|
...s,
|
|
646
|
+
hideMessage: !s.message,
|
|
647
|
+
messageKind: s.resetSent ? "success" : "error",
|
|
648
|
+
resetSent: !!s.message && !!s.resetSent,
|
|
643
649
|
greeting: name
|
|
644
650
|
? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
|
|
645
651
|
: copyParam("storeAccount.greetingGuest", "Hey, guest"),
|
|
@@ -815,7 +821,7 @@ const svc = defineService<S, {
|
|
|
815
821
|
restorePublish: (s: S) => S;
|
|
816
822
|
iapRestore: (s: S) => Promise<undefined>;
|
|
817
823
|
}>("himiStoreAccount", {
|
|
818
|
-
notHydrated: ["password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
824
|
+
notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
819
825
|
state: derive({
|
|
820
826
|
status: "loading",
|
|
821
827
|
isMember: false,
|
|
@@ -846,6 +852,9 @@ const svc = defineService<S, {
|
|
|
846
852
|
lastNameFocus: "",
|
|
847
853
|
emailFocus: "",
|
|
848
854
|
message: "",
|
|
855
|
+
hideMessage: true,
|
|
856
|
+
messageKind: "error",
|
|
857
|
+
resetSent: false,
|
|
849
858
|
isLoading: true,
|
|
850
859
|
notLoading: false,
|
|
851
860
|
// The form's first paint is already on its route's mode: only sign-in's route has `mode`.
|
|
@@ -942,10 +951,10 @@ const svc = defineService<S, {
|
|
|
942
951
|
rejectResult(raw, "reset");
|
|
943
952
|
if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
|
|
944
953
|
return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
|
|
945
|
-
message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
|
|
954
|
+
resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
|
|
946
955
|
} catch (error) {
|
|
947
956
|
return derive({ ...svc.getState(), authBusy: false,
|
|
948
|
-
message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
|
|
957
|
+
resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
|
|
949
958
|
} finally { authInFlight = false; }
|
|
950
959
|
},
|
|
951
960
|
signIn: (s) => authenticate(s, "signIn"),
|
|
@@ -991,7 +1000,7 @@ const svc = defineService<S, {
|
|
|
991
1000
|
},
|
|
992
1001
|
});
|
|
993
1002
|
|
|
994
|
-
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), [...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
1003
|
+
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
995
1004
|
// `boot` tells settle this is not a visit: the host drops this call's navigation, and the
|
|
996
1005
|
// appear refresh does the visit's moves.
|
|
997
1006
|
svc.load({ boot: "1" });
|
|
@@ -7,6 +7,7 @@ import config from "../config.js";
|
|
|
7
7
|
const runtimeSetting = (value: unknown): unknown => {
|
|
8
8
|
if (value === "__HIMI_PODCAST_FEED_URL__") return process.env.PODCAST_FEED_URL?.trim() || "";
|
|
9
9
|
if (value === "__HIMI_MEMBER_SITE_URL__") return String((config as { auth?: { config?: { siteUrl?: unknown } } }).auth?.config?.siteUrl ?? "").trim();
|
|
10
|
+
if (typeof value === "string" && value.startsWith("__HIMI_MEMBER_SITE_URL__/")) return String((config as { auth?: { config?: { siteUrl?: unknown } } }).auth?.config?.siteUrl ?? "").trim().replace(/\/+$/, "") + value.slice(24);
|
|
10
11
|
if (Array.isArray(value)) return value.map(runtimeSetting);
|
|
11
12
|
if (!value || typeof value !== "object") return value;
|
|
12
13
|
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, runtimeSetting(child)]));
|
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
import { dispatch } from "@himalaya/dispatch";
|
|
2
2
|
import { getMyData } from "@himalaya/wix-users";
|
|
3
3
|
|
|
4
|
-
export interface MemberAccess { email: string; scope: string; }
|
|
4
|
+
export interface MemberAccess { email: string; scope: string; signedIn?: boolean; }
|
|
5
5
|
export function memberAccessChanged(): Error {
|
|
6
6
|
const error = new Error("Member access changed"); error.name = "MemberAccessChanged"; return error;
|
|
7
7
|
}
|
|
8
|
-
export async function memberAccess(): Promise<MemberAccess> {
|
|
8
|
+
export async function memberAccess(options: { throwOnUnavailable?: boolean } = {}): Promise<MemberAccess> {
|
|
9
9
|
let email = "";
|
|
10
|
+
let signedIn = false;
|
|
10
11
|
let identityUnavailable = false;
|
|
11
12
|
try {
|
|
12
|
-
const value = await dispatch("himi.wix.memberIdentity") as { email?: unknown; payload?: { email?: unknown } } | null;
|
|
13
|
+
const value = await dispatch("himi.wix.memberIdentity") as { status?: unknown; ok?: unknown; email?: unknown; signedIn?: unknown; payload?: { email?: unknown; signedIn?: unknown } } | null;
|
|
14
|
+
if (value?.status === "error" || value?.ok === false) throw value;
|
|
13
15
|
const raw = value?.email ?? value?.payload?.email;
|
|
14
16
|
email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
17
|
+
signedIn = (value?.signedIn ?? value?.payload?.signedIn) === true;
|
|
15
18
|
} catch { identityUnavailable = true; }
|
|
16
19
|
// Older native hosts predate the memberIdentity action but can still expose
|
|
17
20
|
// the authenticated profile through wix-users. Only a missing action uses
|
|
18
|
-
// that rung
|
|
21
|
+
// that rung. A successful host response is authoritative, including a signed-in
|
|
22
|
+
// session whose email has not arrived yet; it must not consult owner records.
|
|
19
23
|
if (!email && identityUnavailable) {
|
|
20
24
|
try {
|
|
21
25
|
const profile = await getMyData();
|
|
22
26
|
const raw = profile.email ?? profile.contactEmail;
|
|
23
27
|
email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
24
|
-
} catch {
|
|
28
|
+
} catch (error) {
|
|
29
|
+
const failure = error as { status?: unknown; statusCode?: unknown; code?: unknown } | null;
|
|
30
|
+
const anonymous = failure?.status === 401 || failure?.statusCode === 401 || failure?.code === "UNAUTHENTICATED";
|
|
31
|
+
// Legacy bridges can lose the structured status. An unknown failure is
|
|
32
|
+
// unavailable in strict consumers, never evidence of a signed-out session.
|
|
33
|
+
if (options.throwOnUnavailable && !anonymous) throw error;
|
|
34
|
+
}
|
|
25
35
|
}
|
|
26
36
|
const input = (globalThis as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input;
|
|
27
37
|
const account = input?.__himiPreferenceAccount, business = input?.__himiPreferenceBusiness;
|
|
28
38
|
const valid = (v: unknown): v is string => typeof v === "string" && /^[A-Za-z0-9_.:-]{1,128}$/.test(v) && v !== "default";
|
|
29
39
|
// These fields are overwritten by authenticated hosts. Older binaries stay online-only.
|
|
30
|
-
|
|
40
|
+
// A session signal does not grant an email-scoped cache or private query.
|
|
41
|
+
return { email, signedIn: signedIn || Boolean(email), scope: email && valid(account) && valid(business) ? JSON.stringify([account, business, email]) : "" };
|
|
31
42
|
}
|
|
32
43
|
export async function assertMemberAccess(member: MemberAccess): Promise<void> {
|
|
33
44
|
const current = await memberAccess();
|
|
@@ -565,6 +565,9 @@ interface S extends IapRestoreFields {
|
|
|
565
565
|
lastNameFocus: string;
|
|
566
566
|
emailFocus: string;
|
|
567
567
|
message: string;
|
|
568
|
+
hideMessage: boolean;
|
|
569
|
+
messageKind: "error" | "success";
|
|
570
|
+
resetSent: boolean;
|
|
568
571
|
isLoading: boolean;
|
|
569
572
|
notLoading: boolean;
|
|
570
573
|
isRegistering: boolean;
|
|
@@ -640,6 +643,9 @@ function derive(s: S): S {
|
|
|
640
643
|
const name = s.isMember ? greetingName(s.memberName) : "";
|
|
641
644
|
return {
|
|
642
645
|
...s,
|
|
646
|
+
hideMessage: !s.message,
|
|
647
|
+
messageKind: s.resetSent ? "success" : "error",
|
|
648
|
+
resetSent: !!s.message && !!s.resetSent,
|
|
643
649
|
greeting: name
|
|
644
650
|
? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
|
|
645
651
|
: copyParam("storeAccount.greetingGuest", "Hey, guest"),
|
|
@@ -815,7 +821,7 @@ const svc = defineService<S, {
|
|
|
815
821
|
restorePublish: (s: S) => S;
|
|
816
822
|
iapRestore: (s: S) => Promise<undefined>;
|
|
817
823
|
}>("himiStoreAccount", {
|
|
818
|
-
notHydrated: ["password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
824
|
+
notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
819
825
|
state: derive({
|
|
820
826
|
status: "loading",
|
|
821
827
|
isMember: false,
|
|
@@ -846,6 +852,9 @@ const svc = defineService<S, {
|
|
|
846
852
|
lastNameFocus: "",
|
|
847
853
|
emailFocus: "",
|
|
848
854
|
message: "",
|
|
855
|
+
hideMessage: true,
|
|
856
|
+
messageKind: "error",
|
|
857
|
+
resetSent: false,
|
|
849
858
|
isLoading: true,
|
|
850
859
|
notLoading: false,
|
|
851
860
|
// The form's first paint is already on its route's mode: only sign-in's route has `mode`.
|
|
@@ -942,10 +951,10 @@ const svc = defineService<S, {
|
|
|
942
951
|
rejectResult(raw, "reset");
|
|
943
952
|
if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
|
|
944
953
|
return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
|
|
945
|
-
message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
|
|
954
|
+
resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
|
|
946
955
|
} catch (error) {
|
|
947
956
|
return derive({ ...svc.getState(), authBusy: false,
|
|
948
|
-
message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
|
|
957
|
+
resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
|
|
949
958
|
} finally { authInFlight = false; }
|
|
950
959
|
},
|
|
951
960
|
signIn: (s) => authenticate(s, "signIn"),
|
|
@@ -991,7 +1000,7 @@ const svc = defineService<S, {
|
|
|
991
1000
|
},
|
|
992
1001
|
});
|
|
993
1002
|
|
|
994
|
-
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), [...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
1003
|
+
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
995
1004
|
// `boot` tells settle this is not a visit: the host drops this call's navigation, and the
|
|
996
1005
|
// appear refresh does the visit's moves.
|
|
997
1006
|
svc.load({ boot: "1" });
|
|
@@ -63,6 +63,18 @@ export default defineApp({
|
|
|
63
63
|
"maxHoldMs": 5000
|
|
64
64
|
},
|
|
65
65
|
navigation: {
|
|
66
|
+
"navLogicBundle": {
|
|
67
|
+
"url": "/v1/bundles/himi-branded-lite-nav",
|
|
68
|
+
"integrity": "",
|
|
69
|
+
"contentType": "application/javascript+ts-bundle",
|
|
70
|
+
"declaredCapabilities": [
|
|
71
|
+
"push",
|
|
72
|
+
"theme",
|
|
73
|
+
"wix_api"
|
|
74
|
+
],
|
|
75
|
+
"minBinaryVersion": "0.1.0",
|
|
76
|
+
"bundleVersion": "0.0.1"
|
|
77
|
+
},
|
|
66
78
|
"navKind": "responsive",
|
|
67
79
|
"scheme": "himalaya-__HIMI_APP_SLUG__",
|
|
68
80
|
"deepLinkPatterns": [],
|
|
@@ -8,6 +8,7 @@ const runtimeSetting = (value: unknown): unknown => {
|
|
|
8
8
|
if (value === "__HIMI_PODCAST_FEED_URL__") return process.env.PODCAST_FEED_URL?.trim() || "";
|
|
9
9
|
if (value === "__HIMI_MEMBER_PHOTO_UPLOAD_FUNCTION__") return process.env.HIMI_BRANDED_LITE_MEMBER_PHOTO_UPLOAD_FUNCTION?.trim() || "";
|
|
10
10
|
if (value === "__HIMI_MEMBER_SITE_URL__") return String((config as { auth?: { config?: { siteUrl?: unknown } } }).auth?.config?.siteUrl ?? "").trim();
|
|
11
|
+
if (typeof value === "string" && value.startsWith("__HIMI_MEMBER_SITE_URL__/")) return String((config as { auth?: { config?: { siteUrl?: unknown } } }).auth?.config?.siteUrl ?? "").trim().replace(/\/+$/, "") + value.slice(24);
|
|
11
12
|
if (Array.isArray(value)) return value.map(runtimeSetting);
|
|
12
13
|
if (!value || typeof value !== "object") return value;
|
|
13
14
|
return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, runtimeSetting(child)]));
|
|
@@ -1346,6 +1346,12 @@
|
|
|
1346
1346
|
"key": "account.viewProfileLink",
|
|
1347
1347
|
"keyOrigin": "string-table"
|
|
1348
1348
|
},
|
|
1349
|
+
"h_b9e09ae263fb": {
|
|
1350
|
+
"source": "Not confirmed",
|
|
1351
|
+
"kind": "Worker.copy",
|
|
1352
|
+
"translation": "",
|
|
1353
|
+
"key": "businessChat.unconfirmed"
|
|
1354
|
+
},
|
|
1349
1355
|
"h_badd385121c5": {
|
|
1350
1356
|
"source": "View details",
|
|
1351
1357
|
"kind": "Button.title",
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
"translation": "Choisissez la langue utilisée dans cette appli.",
|
|
15
15
|
"origin": "machine"
|
|
16
16
|
},
|
|
17
|
+
"h_b9e09ae263fb": {
|
|
18
|
+
"key": "businessChat.unconfirmed",
|
|
19
|
+
"source": "Not confirmed",
|
|
20
|
+
"translation": "Non confirmé",
|
|
21
|
+
"origin": "machine"
|
|
22
|
+
},
|
|
17
23
|
"h_24345a14377f": {
|
|
18
24
|
"key": "businessChat.today",
|
|
19
25
|
"source": "Today",
|
|
@@ -3461,6 +3467,11 @@
|
|
|
3461
3467
|
"translation": "Vous êtes sur la liste d'attente. Vous recevrez un e-mail si une place se libère.",
|
|
3462
3468
|
"origin": "machine"
|
|
3463
3469
|
},
|
|
3470
|
+
"h_146bd1c44b1c": {
|
|
3471
|
+
"source": "This booking is not confirmed. If you did not finish checkout, the business did not get it.",
|
|
3472
|
+
"translation": "Cette réservation n'est pas confirmée. Si vous n'avez pas terminé le paiement, l'établissement ne l'a pas reçue.",
|
|
3473
|
+
"origin": "machine"
|
|
3474
|
+
},
|
|
3464
3475
|
"h_014a590b30b1": {
|
|
3465
3476
|
"source": "Get directions to {place}",
|
|
3466
3477
|
"translation": "Obtenir l'itinéraire vers {place}",
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
"key": "appLanguage.subtitle",
|
|
12
12
|
"translation": "בחרו את השפה שבה האפליקציה מוצגת."
|
|
13
13
|
},
|
|
14
|
+
"h_b9e09ae263fb": {
|
|
15
|
+
"source": "Not confirmed",
|
|
16
|
+
"key": "businessChat.unconfirmed",
|
|
17
|
+
"translation": "לא אושר"
|
|
18
|
+
},
|
|
14
19
|
"h_24345a14377f": {
|
|
15
20
|
"source": "Today",
|
|
16
21
|
"key": "businessChat.today",
|
|
@@ -2838,6 +2843,10 @@
|
|
|
2838
2843
|
"source": "You are on the waitlist. You get an email if a spot opens.",
|
|
2839
2844
|
"translation": "אתם ברשימת ההמתנה. תקבלו אימייל אם יתפנה מקום."
|
|
2840
2845
|
},
|
|
2846
|
+
"h_146bd1c44b1c": {
|
|
2847
|
+
"source": "This booking is not confirmed. If you did not finish checkout, the business did not get it.",
|
|
2848
|
+
"translation": "התור הזה לא אושר. אם לא סיימתם את התשלום, העסק לא קיבל אותו."
|
|
2849
|
+
},
|
|
2841
2850
|
"h_014a590b30b1": {
|
|
2842
2851
|
"source": "Get directions to {place}",
|
|
2843
2852
|
"translation": "הוראות הגעה אל {place}"
|
|
@@ -190,7 +190,9 @@ export async function placesIn(start: string, end: string, inWindow: Session[],
|
|
|
190
190
|
// Every page, not the first 100: a booking past it would read Book again. Bounded.
|
|
191
191
|
const bookings: WixBooking[] = [];
|
|
192
192
|
for (let page = 0; page < 5; page++) {
|
|
193
|
-
|
|
193
|
+
// Bookings v2 rejects two comparisons in one field expression (INVALID_FILTER).
|
|
194
|
+
// Keep the half-open window as independent AND clauses, with the same member scope.
|
|
195
|
+
const res = await queryBookings({ query: { filter: { "contactDetails.email": { $eq: who.email }, $and: [{ startDate: { $gte: from } }, { startDate: { $lt: to } }] }, paging: { limit: 100, offset: page * 100 } } } as never);
|
|
194
196
|
const batch = res.bookings ?? [];
|
|
195
197
|
bookings.push(...batch);
|
|
196
198
|
if (batch.length < 100) break;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// The business chat's Wix calls: the member-role chat-web SDK for rooms and history, plus the calls the SDKs have
|
|
2
|
+
// no helper for (a typed message sent through Smart Chat, a tapped button, a private attachment's download URL).
|
|
3
|
+
import { getChatToken, getMessagesPage, listChatroomsPage } from "@himalaya/wix-chat-web";
|
|
4
|
+
import { assertMemberAccess, memberAccess } from "./member-access.js";
|
|
5
|
+
|
|
6
|
+
const MANAGE = "https://manage.wix.com";
|
|
7
|
+
const MEMBER = { role: "member" } as const;
|
|
8
|
+
type Raw = Record<string, unknown>;
|
|
9
|
+
type Bridge = { call(method: string, path: string, body?: unknown, headers?: Record<string, string>): Promise<unknown> };
|
|
10
|
+
|
|
11
|
+
/** Who is signed in. `userId` is empty until the host reports it; the chat then tells the business
|
|
12
|
+
* side apart by the room's participant id instead. */
|
|
13
|
+
export interface ChatIdentity { authenticated: boolean; userId: string; email: string; scope: string }
|
|
14
|
+
export async function chatIdentity(): Promise<ChatIdentity> {
|
|
15
|
+
const member = await memberAccess();
|
|
16
|
+
return { authenticated: !!member.email, userId: "", email: member.email, scope: member.scope };
|
|
17
|
+
}
|
|
18
|
+
export const assertChatIdentity = (identity: ChatIdentity): Promise<void> => assertMemberAccess(identity);
|
|
19
|
+
|
|
20
|
+
/** Every request is fenced: the member is re-checked before it goes out and again before its response is
|
|
21
|
+
* used, so a sign-out or account switch mid-request never leaks one member's data to the next. */
|
|
22
|
+
async function fenced<T>(identity: ChatIdentity, run: () => Promise<T>): Promise<T> {
|
|
23
|
+
await assertChatIdentity(identity);
|
|
24
|
+
const result = await run();
|
|
25
|
+
await assertChatIdentity(identity);
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Any other member-scoped call (the AI chat's) goes through the same fence. */
|
|
30
|
+
export const fence = fenced;
|
|
31
|
+
|
|
32
|
+
// Minting a chat token is a network round trip, and every chat call used to mint its own. One token
|
|
33
|
+
// per member is reused until the member changes or a request using it is refused.
|
|
34
|
+
let cachedToken: { key: string; token: string } | null = null;
|
|
35
|
+
const tokenKey = (identity: ChatIdentity): string => `${identity.email}|${identity.scope}`;
|
|
36
|
+
async function chatTokenFor(identity: ChatIdentity): Promise<string> {
|
|
37
|
+
const key = tokenKey(identity);
|
|
38
|
+
if (cachedToken?.key === key) return cachedToken.token;
|
|
39
|
+
const { chatToken } = await getChatToken(MEMBER);
|
|
40
|
+
// The host mints for whoever is signed in NOW: a token minted while the member switched belongs to the
|
|
41
|
+
// new member and must not be cached under the old one.
|
|
42
|
+
await assertChatIdentity(identity);
|
|
43
|
+
cachedToken = { key, token: chatToken };
|
|
44
|
+
return chatToken;
|
|
45
|
+
}
|
|
46
|
+
/** Runs `run` with the member's cached token; a refused request mints a fresh token and tries once more. */
|
|
47
|
+
async function withToken<T>(identity: ChatIdentity, run: (chatToken: string) => Promise<T>): Promise<T> {
|
|
48
|
+
const reused = cachedToken?.key === tokenKey(identity);
|
|
49
|
+
try {
|
|
50
|
+
return await run(await chatTokenFor(identity));
|
|
51
|
+
} catch (error) {
|
|
52
|
+
cachedToken = null;
|
|
53
|
+
if (!reused || !/\b(?:401|403)\b|token/i.test(String((error as Error)?.message ?? error))) throw error;
|
|
54
|
+
return run(await chatTokenFor(identity));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const MAX_ROOM_PAGES = 20;
|
|
59
|
+
/** Every chatroom the member can see: the cursor is followed so the business room is found on any page. */
|
|
60
|
+
export const listRooms = (identity: ChatIdentity): Promise<{ items: Raw[]; more: boolean }> => fenced(identity, async () => {
|
|
61
|
+
const items: Raw[] = [];
|
|
62
|
+
let nextPointer: number | string | undefined;
|
|
63
|
+
for (let page = 0; page < MAX_ROOM_PAGES; page++) {
|
|
64
|
+
const result = await withToken(identity, (chatToken) => listChatroomsPage({ ...MEMBER, chatToken, pageSize: 50, ...(nextPointer !== undefined ? { nextPointer } : {}) }));
|
|
65
|
+
items.push(...(result.items as unknown as Raw[]));
|
|
66
|
+
nextPointer = result.nextPointer;
|
|
67
|
+
if (nextPointer === undefined) return { items, more: false };
|
|
68
|
+
}
|
|
69
|
+
return { items, more: true };
|
|
70
|
+
});
|
|
71
|
+
/** How many of the member's BUSINESS chatrooms have unread messages, as the server counts them (capped at 100).
|
|
72
|
+
* Not the rooms themselves: the header badge needs only the total. A response without a valid count is
|
|
73
|
+
* unavailable, never zero. */
|
|
74
|
+
export const unreadRoomCount = (identity: ChatIdentity): Promise<number> => fenced(identity, async () => {
|
|
75
|
+
const page = await withToken(identity, (chatToken) => listChatroomsPage({ ...MEMBER, chatToken, pageSize: 1, onlyUnread: true, participantType: "business" }));
|
|
76
|
+
const count = page.unreadChatroomCount;
|
|
77
|
+
if (typeof count !== "number" || !Number.isSafeInteger(count) || count < 0) throw new Error("unavailable unread chat count");
|
|
78
|
+
return count;
|
|
79
|
+
});
|
|
80
|
+
export const messagesPage = (identity: ChatIdentity, roomId: string): Promise<Raw[]> => fenced(identity, async () =>
|
|
81
|
+
(await withToken(identity, (chatToken) => getMessagesPage(roomId, { ...MEMBER, chatToken, pageSize: 50, ordering: "Desc" }))).items as unknown as Raw[]);
|
|
82
|
+
|
|
83
|
+
function bridge(): Bridge {
|
|
84
|
+
const api = (globalThis as unknown as { himalaya?: { wixApi?: Bridge } }).himalaya?.wixApi;
|
|
85
|
+
if (!api) throw new Error("wix_api_bridge_unavailable");
|
|
86
|
+
return api;
|
|
87
|
+
}
|
|
88
|
+
/** A typed message goes through Smart Chat, exactly as the site's chat widget sends it. The Inbox then files it under
|
|
89
|
+
* Wix Smart Chat and the AI can answer it; a message posted straight into the room has no channel, so the AI never
|
|
90
|
+
* saw it and the owner's reply went out by email. Smart Chat chooses the conversation and stored message id.
|
|
91
|
+
* The bridge resolves once the AI has finished answering, not when the message is stored. */
|
|
92
|
+
export const sendMessage = (identity: ChatIdentity, text: string): Promise<string | undefined> => fenced(identity, async () => {
|
|
93
|
+
const response = await bridge().call("POST", "/wix-assistant-widget/v1/messages/stream", {
|
|
94
|
+
message: { sender: "SITE_VISITOR", messageType: "QUESTION", body: { mainText: text } },
|
|
95
|
+
});
|
|
96
|
+
// The first stream frame names the persisted question. Keep its exact id so a send
|
|
97
|
+
// that moves from an old Members transcript to Smart Chat never relies on a text match.
|
|
98
|
+
let frames: unknown = response;
|
|
99
|
+
if (typeof frames === "string") {
|
|
100
|
+
const raw = frames;
|
|
101
|
+
try { frames = JSON.parse(raw); }
|
|
102
|
+
catch {
|
|
103
|
+
frames = [];
|
|
104
|
+
// The bridge buffers SSE verbatim. Ignore event/comment lines and decode the
|
|
105
|
+
// data of each frame; some hosts instead hand over NDJSON or parsed frames.
|
|
106
|
+
for (const block of raw.split(/\r?\n\r?\n/)) {
|
|
107
|
+
const lines = block.split(/\r?\n/);
|
|
108
|
+
const event = lines.find(line => line.startsWith('event:'))?.slice(6).trim();
|
|
109
|
+
const data = lines.filter(line => line.startsWith('data:')).map(line => line.slice(5).trimStart()).join('\n');
|
|
110
|
+
try {
|
|
111
|
+
const value = JSON.parse(data || block);
|
|
112
|
+
(frames as unknown[]).push(event === 'inputMessage' && !value?.inputMessage ? { inputMessage: value } : value);
|
|
113
|
+
} catch { /* Comments and other non-JSON frames carry no stored question id. */ }
|
|
114
|
+
}
|
|
115
|
+
// A buffered NDJSON response has no SSE separators.
|
|
116
|
+
if (!(frames as unknown[]).length) {
|
|
117
|
+
try { frames = [JSON.parse(raw.split('\n', 1)[0]!)]; } catch { return undefined; }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
for (const frame of Array.isArray(frames) ? frames : [frames]) {
|
|
122
|
+
const input = (frame as { inputMessage?: { id?: unknown; sender?: unknown; messageType?: unknown } } | null)?.inputMessage;
|
|
123
|
+
if (input?.sender === "SITE_VISITOR" && input.messageType === "QUESTION" && typeof input.id === "string" && input.id) return `smart-chat:${input.id}`;
|
|
124
|
+
}
|
|
125
|
+
return undefined;
|
|
126
|
+
});
|
|
127
|
+
/** A tapped button is a silent, ephemeral message carrying the button's chat action. */
|
|
128
|
+
export const sendButton = (identity: ChatIdentity, roomId: string, input: { id: string; text: string; appId: string; interactionId: string }): Promise<void> => fenced(identity, async () => {
|
|
129
|
+
await withToken(identity, (chatToken) => bridge().call("POST", `${MANAGE}/_api/chat-web/v2/chatrooms/${encodeURIComponent(roomId)}/messages`, {
|
|
130
|
+
sendMessageBody: { id: input.id, messageType: "message", messageTypeVersion: 1, summary: input.text, isEphemeral: true, isSilent: true, data: [{ mimeType: "text/plain", data: { text: input.text } }] },
|
|
131
|
+
sendMessageOptions: { chatAction: { actionType: "BUTTON_INTERACTION", appId: input.appId, interactionId: input.interactionId } },
|
|
132
|
+
}, { ChatToken: chatToken }));
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const https = (value: unknown): string => (typeof value === "string" && /^https:\/\/[^\s\\]+$/.test(value) ? value : "");
|
|
136
|
+
/** A fresh, authorized URL for an attachment. A private file is always fetched by its id. */
|
|
137
|
+
export const attachmentUrl = (identity: ChatIdentity, media: { mediaId?: string; mediaProvider?: string; url?: string; fileName?: string }): Promise<string> => fenced(identity, async () => {
|
|
138
|
+
if (media.mediaProvider === "WixMediaPrivate") {
|
|
139
|
+
if (!media.mediaId) throw new Error("attachment_has_no_media_id");
|
|
140
|
+
const response = await bridge().call("POST", "/communication-channels-media/v1/download-url", {
|
|
141
|
+
fileId: media.mediaId, ...(media.fileName ? { downloadFileName: media.fileName } : {}),
|
|
142
|
+
}) as Raw | null;
|
|
143
|
+
const url = https(response?.downloadUrl);
|
|
144
|
+
if (!url) throw new Error("attachment_download_url_invalid");
|
|
145
|
+
return url;
|
|
146
|
+
}
|
|
147
|
+
return https(media.url);
|
|
148
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// The header badge counts (bell, chat, cart) as one service piece, shared by the app-level nav workers that
|
|
2
|
+
// bind them: `himi-branded-lite-nav` (the full nav worker of the Branded Lite app) and `himi-branded-lite-header-badges`
|
|
3
|
+
// (the badges-only worker a scaffold ships). Both name their service `brandedLiteNav`, so a top-bar action binds the
|
|
4
|
+
// same `$service:brandedLiteNav.<field>` path in either.
|
|
5
|
+
//
|
|
6
|
+
// `null` is unavailable and never a zero (see source-badges.ts). The counts refresh at launch, whenever the
|
|
7
|
+
// signed-in identity changes (the native host session clock, or the reserved `onIdentityChange` hook a web host
|
|
8
|
+
// delivers), on every foreground (`onForeground`), and whenever the worker is asked to. A read that finishes after
|
|
9
|
+
// the identity changed, or after a newer read began, is dropped.
|
|
10
|
+
import { hostSessionFromGlobal } from "@himalaya/iap";
|
|
11
|
+
import { readSourceBadges } from "./source-badges.js";
|
|
12
|
+
|
|
13
|
+
export interface HeaderBadgeState {
|
|
14
|
+
notificationsBadge: number | null;
|
|
15
|
+
chatBadge: number | null;
|
|
16
|
+
cartBadge: number | null;
|
|
17
|
+
/** Which counts the last refresh tried and failed to read ("" when it read every count it could). A count that is
|
|
18
|
+
* unavailable by design (a Visitor's bell and chat, offline) is not an error. Diagnostic: it says why a badge is
|
|
19
|
+
* missing, so a migration can be checked. */
|
|
20
|
+
errorText: string;
|
|
21
|
+
}
|
|
22
|
+
export const HEADER_BADGES_INITIAL: HeaderBadgeState = { notificationsBadge: null, chatBadge: null, cartBadge: null, errorText: "" };
|
|
23
|
+
|
|
24
|
+
/** The counts describe THIS run: a snapshot from the last one (the web store persists an app worker's state per
|
|
25
|
+
* account) would show another day's numbers until the first read lands. Declare them `notPersisted` and
|
|
26
|
+
* `notHydrated` on the service. */
|
|
27
|
+
export const HEADER_BADGE_KEYS: ("notificationsBadge" | "chatBadge" | "cartBadge" | "errorText")[] = ["notificationsBadge", "chatBadge", "cartBadge", "errorText"];
|
|
28
|
+
|
|
29
|
+
/** The action signatures a service that uses `headerBadges` declares in its `defineService` generic. */
|
|
30
|
+
// A `type`, not an `interface`: `defineService` constrains its actions to `Record<string, fn>`, which only a type
|
|
31
|
+
// alias satisfies (an interface has no implicit index signature).
|
|
32
|
+
export type HeaderBadgeActionSignatures<S> = {
|
|
33
|
+
/** Re-read the header badge counts. Only the newest read lands. */
|
|
34
|
+
refreshBadges: (s: S) => Promise<S>;
|
|
35
|
+
/** Drop every badge count (a new identity), committed at once so no stale number waits on a network read. */
|
|
36
|
+
dropBadges: (s: S) => Promise<S>;
|
|
37
|
+
/** Reserved lifecycle hooks the app-service host delivers to every service that declares them. */
|
|
38
|
+
onForeground: (s: S) => Promise<S>;
|
|
39
|
+
onIdentityChange: (s: S) => Promise<S>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** What `headerBadges` hands a worker. Named (not inferred) so a worker can annotate its `badges`, which breaks the
|
|
43
|
+
* loop between that value and the service handle it is built from. */
|
|
44
|
+
export interface HeaderBadges<S> {
|
|
45
|
+
actions: HeaderBadgeActionSignatures<S>;
|
|
46
|
+
/** Call once after `defineService`: the launch read, and the session clock's notifications. */
|
|
47
|
+
start(): void;
|
|
48
|
+
/** Re-read after something that may have changed a count (a notification receipt). */
|
|
49
|
+
refresh(): void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type Update<S> = (s: S, change: (current: S) => Promise<S>) => Promise<S>;
|
|
53
|
+
type Self = () => { refreshBadges(): Promise<unknown>; dropBadges(): Promise<unknown> };
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @param update serializes state changes for the worker, so overlapping actions build on the preceding result
|
|
57
|
+
* @param self the worker's own service handle (read lazily: it does not exist yet when this is called)
|
|
58
|
+
*/
|
|
59
|
+
export function headerBadges<S extends HeaderBadgeState>(update: Update<S>, self: Self): HeaderBadges<S> {
|
|
60
|
+
/** Which read is the newest: an older one that finishes later must not overwrite a newer answer. */
|
|
61
|
+
let read = 0;
|
|
62
|
+
/** The host session generation the badges on show were read under. */
|
|
63
|
+
let generation = -1;
|
|
64
|
+
/** The clock the native runtime publishes for the signed-in identity: it names the site the bridge is bound to
|
|
65
|
+
* and notifies on every sign-in, sign-out and member switch. A host without one (web, older binaries) reads a
|
|
66
|
+
* signed-out stub that never notifies. */
|
|
67
|
+
const session = hostSessionFromGlobal();
|
|
68
|
+
const cleared = (current: S): S => ({ ...current, ...HEADER_BADGES_INITIAL });
|
|
69
|
+
|
|
70
|
+
const actions: HeaderBadgeActionSignatures<S> = {
|
|
71
|
+
refreshBadges: async (s) => {
|
|
72
|
+
const mine = ++read;
|
|
73
|
+
const badges = await readSourceBadges(session.current().kind === "member");
|
|
74
|
+
return update(s, async (current) => mine === read
|
|
75
|
+
? { ...current, notificationsBadge: badges.notifications, chatBadge: badges.chat, cartBadge: badges.cart, errorText: badges.failed.length ? `could not read: ${badges.failed.join(", ")}` : "" }
|
|
76
|
+
: current);
|
|
77
|
+
},
|
|
78
|
+
dropBadges: async (s) => {
|
|
79
|
+
++read; // a read already in flight belongs to the previous identity
|
|
80
|
+
return update(s, async (current) => cleared(current));
|
|
81
|
+
},
|
|
82
|
+
onForeground: async (s) => update(s, async (current) => current).finally(() => { void self().refreshBadges(); }),
|
|
83
|
+
onIdentityChange: async (s) => {
|
|
84
|
+
++read;
|
|
85
|
+
const dropped = await update(s, async (current) => cleared(current));
|
|
86
|
+
void self().refreshBadges();
|
|
87
|
+
return dropped;
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** A session notification: a new generation is a new identity, so the previous one's numbers go first. */
|
|
92
|
+
async function onSession(): Promise<void> {
|
|
93
|
+
const now = session.current().generation;
|
|
94
|
+
if (now !== generation) {
|
|
95
|
+
generation = now;
|
|
96
|
+
await self().dropBadges();
|
|
97
|
+
}
|
|
98
|
+
await self().refreshBadges();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
actions,
|
|
103
|
+
/** Call once after `defineService`: the launch read, and the session clock's notifications. */
|
|
104
|
+
start(): void {
|
|
105
|
+
// Subscribing notifies at once, which is the launch read; a host with no clock needs the explicit one.
|
|
106
|
+
let notified = false;
|
|
107
|
+
session.subscribe(() => { notified = true; void onSession(); });
|
|
108
|
+
if (!notified) void self().refreshBadges();
|
|
109
|
+
},
|
|
110
|
+
/** Re-read after something that may have changed a count (a notification receipt). */
|
|
111
|
+
refresh(): void { void self().refreshBadges(); },
|
|
112
|
+
};
|
|
113
|
+
}
|