@wix/himalaya-cli 0.1543.0 → 0.1545.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/core/sdk/agent/src/index.d.ts +5 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/index.d.ts +14 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/read.d.ts +60 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +3 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/activity-counters-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ai-site-chat/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/analytics/src/index.d.ts +42 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/async-jobs/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/automations-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/badges-v2/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/billing-tax-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/extensions.d.ts +5 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +4 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/business-feed/src/index.d.ts +11 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/business-tools-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/chat-web/src/index.d.ts +22 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/contacts/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/coupons/src/index.d.ts +24 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/crm-tasks/src/index.d.ts +11 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/dashboard-setup/src/index.d.ts +11 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/data-collections-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/donations/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ecom/src/extensions.d.ts +6 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ecom/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/email-marketing-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/events/src/index.d.ts +24 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/faq-v2/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/forms/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/forum/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/genie-chat/src/index.d.ts +11 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/gift-cards/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/inbox/src/extensions.d.ts +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/inbox/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/invoices/src/index.d.ts +24 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/loyalty/src/index.d.ts +28 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/marketing-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-feed-viewer/src/index.d.ts +23 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +25 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/new-releases/src/index.d.ts +23 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/notification-preferences/src/index.d.ts +23 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/notifications-v3/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/online-programs/src/index.d.ts +25 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/portfolio/src/index.d.ts +25 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/pricing-plans/src/index.d.ts +28 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/redirects-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/restaurants/src/extensions.d.ts +2 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/restaurants/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/reviews/src/index.d.ts +24 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/seo-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/site-list/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/site-media/src/index.d.ts +11 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +23 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-collections/src/display.d.ts +3 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-collections/src/index.d.ts +27 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/catalog.d.ts +7 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/display.d.ts +4 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/extensions.d.ts +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/table-reservations/src/index.d.ts +25 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/users/src/index.d.ts +23 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/video/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/wix-data/src/index.d.ts +27 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/workflows-v1/src/index.d.ts +19 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/_shared/runtime.generated.d.ts +8 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +12 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +36 -11
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/state.mjs +206 -12
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-activity-counters.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ai-site-chat.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-analytics.mjs +21 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-async-jobs.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-automations.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-badges.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-billing-tax.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-blog.mjs +31 -14
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +26 -12
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-business-tools.mjs +20 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-chat-web.mjs +29 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +28 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-contacts.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-coupons.mjs +14 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data-collections.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data.mjs +15 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-donations.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ecom.mjs +33 -16
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-email-marketing.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-events.mjs +14 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-faq.mjs +20 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-forms.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-forum.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-gift-cards.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-inbox.mjs +21 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-invoices.mjs +14 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-loyalty.mjs +16 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-marketing.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members-feed-viewer.mjs +21 -10
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +17 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-new-releases.mjs +17 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-notification-preferences.mjs +20 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-notifications.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-online-programs.mjs +16 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-portfolio.mjs +16 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-pricing-plans.mjs +22 -14
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-redirects.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-restaurants.mjs +22 -7
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-reviews.mjs +14 -6
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-rich-content-editor.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-seo.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-site-list.mjs +19 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-social-feed.mjs +15 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores-collections.mjs +20 -10
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores.mjs +116 -83
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-table-reservations.mjs +16 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-users.mjs +15 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-video.mjs +9 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-workflows.mjs +19 -5
- package/dist/cli.mjs +90 -57
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +8 -8
- package/guides/dynamic-list.service.ts +38 -29
- package/guides/form-submit.service.ts +2 -1
- package/guides/index.json +6 -0
- package/guides/offline-reading.md +63 -0
- package/guides/one-app-to-himi-app.md +5 -3
- package/guides/recipe-dynamic-list.md +2 -0
- package/guides/recipe-four-state.md +1 -0
- package/guides/sdk-reference.json +225 -99
- package/guides/testing-himi-apps.md +2 -0
- package/guides/tier-5-add-a-screen.md +2 -0
- package/guides/wix-api-usage.md +9 -2
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +4 -3
- package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/beauty-salon/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/beauty-salon/tier5-src/himi-branded-lite-orders/index.ts +3 -0
- package/templates/beauty-salon-owner/dev/index.ts +19 -19
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/branded-lite/dev/index.ts +38 -20
- package/templates/branded-lite/tier5-src/_shared/collection-query-legacy.ts +194 -0
- package/templates/branded-lite/tier5-src/_shared/collection-query.ts +158 -99
- package/templates/branded-lite/tier5-src/_shared/collection-service.ts +31 -11
- package/templates/branded-lite/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/branded-lite/tier5-src/_shared/read-service.ts +255 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-orders/index.ts +3 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-shop/index.ts +202 -159
- package/templates/branded-lite/tier5-src/himi-store-product/index.ts +130 -201
- package/templates/community-club/dev/index.ts +4 -4
- package/templates/community-club/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/community-club/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/community-club-owner/dev/index.ts +19 -19
- package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/community-club-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/events-meetups/dev/index.ts +3 -3
- package/templates/events-meetups/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/events-meetups/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/events-meetups-owner/dev/index.ts +17 -17
- package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/events-meetups-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/gym-fitness/dev/index.ts +5 -4
- package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/gym-fitness/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/gym-fitness/tier5-src/himi-branded-lite-orders/index.ts +3 -0
- package/templates/gym-fitness-owner/dev/index.ts +20 -20
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/nonprofit-cause/dev/index.ts +4 -4
- package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/nonprofit-cause/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/nonprofit-cause-owner/dev/index.ts +18 -18
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/owner-lite/dev/index.ts +20 -20
- package/templates/owner-lite/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/owner-lite/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/podcast-creator/dev/index.ts +4 -4
- package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/podcast-creator/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/podcast-creator-owner/dev/index.ts +19 -19
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/portfolio-creative/dev/index.ts +5 -4
- package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/portfolio-creative/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-orders/index.ts +3 -0
- package/templates/portfolio-creative-owner/dev/index.ts +19 -19
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/restaurant/dev/index.ts +3 -3
- package/templates/restaurant/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/restaurant/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/restaurant-owner/dev/index.ts +20 -20
- package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/restaurant-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/retail-store/dev/index.ts +19 -1
- package/templates/retail-store/tier5-src/_shared/collection-query-legacy.ts +194 -0
- package/templates/retail-store/tier5-src/_shared/collection-query.ts +158 -99
- package/templates/retail-store/tier5-src/_shared/collection-service.ts +31 -11
- package/templates/retail-store/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/retail-store/tier5-src/_shared/read-service.ts +255 -0
- package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/retail-store/tier5-src/himi-branded-lite-orders/index.ts +3 -0
- package/templates/retail-store/tier5-src/himi-branded-lite-shop/index.ts +202 -159
- package/templates/retail-store/tier5-src/himi-store-product/index.ts +130 -201
- package/templates/retail-store-owner/dev/index.ts +18 -18
- package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/retail-store-owner/tier5-src/_shared/owner-module-data.ts +1 -1
- package/templates/yoga-studio/dev/index.ts +4 -4
- package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/yoga-studio/tier5-src/_shared/iap-presentation.ts +7 -3
- package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +1 -1
- package/templates/yoga-studio-owner/dev/index.ts +18 -18
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +6 -9
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-module-data.ts +1 -1
|
@@ -2,6 +2,17 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
@@ -14,6 +25,14 @@ declare global {
|
|
|
14
25
|
* it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
|
|
15
26
|
export interface WixCallOptions {
|
|
16
27
|
site?: string;
|
|
28
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
29
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
30
|
+
onCacheResult?: (metadata: {
|
|
31
|
+
source: "cache" | "network";
|
|
32
|
+
fetchedAt: number;
|
|
33
|
+
expiresAt?: number;
|
|
34
|
+
cacheable: boolean;
|
|
35
|
+
}) => void;
|
|
17
36
|
}
|
|
18
37
|
export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
|
|
19
38
|
export interface WixCursorPaging {
|
|
@@ -2,6 +2,17 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
@@ -2,9 +2,31 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
19
|
+
export interface WixCallOptions {
|
|
20
|
+
site?: string;
|
|
21
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
22
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
23
|
+
onCacheResult?: (metadata: {
|
|
24
|
+
source: "cache" | "network";
|
|
25
|
+
fetchedAt: number;
|
|
26
|
+
expiresAt?: number;
|
|
27
|
+
cacheable: boolean;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
8
30
|
export interface WixFeedItem {
|
|
9
31
|
feedItemId?: string;
|
|
10
32
|
author?: {
|
|
@@ -73,7 +95,7 @@ export interface WixListFeedItemsResponse {
|
|
|
73
95
|
* @scope member — verified live with a signed-in member session; visitor/anonymous
|
|
74
96
|
* readability of a public group's feed is unconfirmed.
|
|
75
97
|
*/
|
|
76
|
-
export declare function listFeedItems(groupId: string, limit?: number): Promise<WixListFeedItemsResponse>;
|
|
98
|
+
export declare function listFeedItems(groupId: string, limit?: number, options?: WixCallOptions): Promise<WixListFeedItemsResponse>;
|
|
77
99
|
/**
|
|
78
100
|
* Create a feed post in a group as the signed-in member — POST
|
|
79
101
|
* https://social.wix.com/api/v1/feed/items. `content` is the post text (modern
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type WixCallOptions } from "./index.js";
|
|
1
2
|
import { type WixImageSize } from "@wix/himalaya/wix-media";
|
|
2
3
|
export interface StoreCategoryImage {
|
|
3
4
|
id?: string;
|
|
@@ -32,10 +33,10 @@ export interface StoreGetCategoryResponse {
|
|
|
32
33
|
}
|
|
33
34
|
/** V3 visitor read: list store categories (the V3 replacement for `queryCollections`).
|
|
34
35
|
* POST /categories/v1/categories/query — `treeReference.appNamespace` is REQUIRED. */
|
|
35
|
-
export declare function queryStoreCategories(limit?: number, cursor?: string): Promise<StoreCategoriesResponse>;
|
|
36
|
+
export declare function queryStoreCategories(limit?: number, cursor?: string, options?: WixCallOptions): Promise<StoreCategoriesResponse>;
|
|
36
37
|
/** V3 visitor read: one store category by id (the V3 replacement for `getCollection`).
|
|
37
38
|
* GET /categories/v1/categories/{id} — `treeReference.appNamespace` passed as a query param. */
|
|
38
|
-
export declare function getStoreCategory(categoryId: string): Promise<StoreGetCategoryResponse>;
|
|
39
|
+
export declare function getStoreCategory(categoryId: string, options?: WixCallOptions): Promise<StoreGetCategoryResponse>;
|
|
39
40
|
/** "3 products" / "1 product" / "" — the count subtitle collection rows already render
|
|
40
41
|
* (from the V3 `itemCounter`, mirroring the v1 `numberOfProducts` helper). */
|
|
41
42
|
export declare function categoryCount(c: StoreCategory): string;
|
|
@@ -2,10 +2,34 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
8
|
-
export
|
|
19
|
+
export interface WixCallOptions {
|
|
20
|
+
site?: string;
|
|
21
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
22
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
23
|
+
onCacheResult?: (metadata: {
|
|
24
|
+
source: "cache" | "network";
|
|
25
|
+
fetchedAt: number;
|
|
26
|
+
expiresAt?: number;
|
|
27
|
+
cacheable: boolean;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
30
|
+
/** The per-call header map for `opts`, or undefined when there is nothing to add — so
|
|
31
|
+
* the no-options path calls the bridge with exactly the 3 arguments it always did. */
|
|
32
|
+
export declare function wixCall<T>(method: string, path: string, body?: unknown, readOptions?: WixCallOptions): Promise<T>;
|
|
9
33
|
export interface WixCollectionsPaging {
|
|
10
34
|
limit?: number;
|
|
11
35
|
offset?: number;
|
|
@@ -61,10 +85,10 @@ export interface WixGetCollectionResponse {
|
|
|
61
85
|
/** Fetch a single collection by id — the detail screen's data source.
|
|
62
86
|
* ⚠️ Catalog **V1 only**: `/stores/v1/collections/*` returns HTTP 428 on modern
|
|
63
87
|
* ("stores-v3") sites. For the V3 visitor read use `getStoreCategory` (./display). */
|
|
64
|
-
export declare function getCollection(collectionId: string): Promise<WixGetCollectionResponse>;
|
|
88
|
+
export declare function getCollection(collectionId: string, options?: WixCallOptions): Promise<WixGetCollectionResponse>;
|
|
65
89
|
/** ⚠️ Catalog **V1 only**: `/stores/v1/collections/query` returns HTTP 428 on modern
|
|
66
90
|
* ("stores-v3") sites. For the V3 visitor read use `queryStoreCategories` (./display). */
|
|
67
|
-
export declare function queryCollections(req?: WixQueryCollectionsRequest): Promise<WixQueryCollectionsResponse>;
|
|
91
|
+
export declare function queryCollections(req?: WixQueryCollectionsRequest, options?: WixCallOptions): Promise<WixQueryCollectionsResponse>;
|
|
68
92
|
/** Writable collection fields for create/update. */
|
|
69
93
|
export interface WixCollectionWrite {
|
|
70
94
|
/** Required on create. */
|
|
@@ -5,9 +5,9 @@ export type CatalogVersion = "v1" | "v3";
|
|
|
5
5
|
* belongs to the site that produced it, and the SDK has no way to notice the swap
|
|
6
6
|
* on its own. Without it, the next worker starts on the previous site's catalog
|
|
7
7
|
* and only the backstop 428 rescues it. */
|
|
8
|
-
export declare function forgetCatalogVersion(): void;
|
|
9
|
-
/**
|
|
10
|
-
export declare function observedCatalogVersion(): CatalogVersion | undefined;
|
|
8
|
+
export declare function forgetCatalogVersion(site?: string): void;
|
|
9
|
+
/** The requested site's resolved version, or its app-scoped answer from a sibling worker. */
|
|
10
|
+
export declare function observedCatalogVersion(site?: string): CatalogVersion | undefined;
|
|
11
11
|
/** Either catalog's "you are on the wrong version" rejection (both directions). */
|
|
12
12
|
export declare function isCatalogMismatch(e: unknown): boolean;
|
|
13
13
|
/** The catalog the REJECTION names, which is the site's real one:
|
|
@@ -24,11 +24,11 @@ export declare function catalogVersionFromMismatch(e: unknown): CatalogVersion |
|
|
|
24
24
|
* `witness` is the raw stored value from before the rejected call went out. A 428
|
|
25
25
|
* that crossed a site switch describes the PREVIOUS site just as a late provision
|
|
26
26
|
* reply does, so the same compare-and-set applies. */
|
|
27
|
-
export declare function noteCatalogMismatch(attempted: CatalogVersion, error?: unknown, witness?: string): void;
|
|
27
|
+
export declare function noteCatalogMismatch(attempted: CatalogVersion, error?: unknown, witness?: string, site?: string): void;
|
|
28
28
|
/** Run `attempt` against the site's catalog — RESOLVED, not guessed — keeping the
|
|
29
29
|
* mismatch 428 as a backstop for the cases resolution cannot cover (the provision
|
|
30
30
|
* endpoint unavailable, or the site switched under a persisted answer). */
|
|
31
|
-
export declare function readWithCatalogFallback<T>(attempt: (version: CatalogVersion) => Promise<T
|
|
31
|
+
export declare function readWithCatalogFallback<T>(attempt: (version: CatalogVersion) => Promise<T>, cacheOnly?: boolean, site?: string): Promise<T>;
|
|
32
32
|
/**
|
|
33
33
|
* Resolve the site's catalog version, asking Wix when it isn't already known.
|
|
34
34
|
* Every caller routes through this now — writes, which must never guess, and
|
|
@@ -37,11 +37,11 @@ export declare function readWithCatalogFallback<T>(attempt: (version: CatalogVer
|
|
|
37
37
|
* The provision endpoint needs a catalog-read scope. If it is unavailable — an
|
|
38
38
|
* older token, a site without Stores, an offline worker — we do NOT fail the
|
|
39
39
|
* caller: we fall back to `"v3"`, the default every new site gets, and leave the
|
|
40
|
-
* memo unset so a later mismatch can still correct it. That fallback is the one
|
|
40
|
+
* state.memo unset so a later mismatch can still correct it. That fallback is the one
|
|
41
41
|
* remaining guess, and it is exactly why reads keep the 428 backstop. A write
|
|
42
42
|
* routed that way still surfaces its own 428 rather than being silently retried.
|
|
43
43
|
*/
|
|
44
|
-
export declare function resolveCatalogVersion(): Promise<CatalogVersion>;
|
|
44
|
+
export declare function resolveCatalogVersion(site?: string): Promise<CatalogVersion>;
|
|
45
45
|
/** Test seam — clears everything this module remembers, INCLUDING the persisted
|
|
46
46
|
* hint. Leaving the hint behind would leak one test's site into the next (and,
|
|
47
47
|
* on a runtime that exposes a global web-storage object, across whole suites).
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type WixCallOptions } from "./index.js";
|
|
1
2
|
/**
|
|
2
3
|
* One media slot as the wire actually sends it: `{ url }`, a nested `{ image: {...} }`,
|
|
3
4
|
* or the reference STRING itself. The string form is real — `mediaSlot()` in the
|
|
@@ -127,7 +128,7 @@ export interface StoreGetProductResponse {
|
|
|
127
128
|
}
|
|
128
129
|
/** List products from whichever catalog this site runs. `fields` is additive — it
|
|
129
130
|
* WIDENS the default v3 display fieldset rather than replacing it. */
|
|
130
|
-
export declare function queryStoreProducts(limit?: number, cursor?: string, fields?: readonly string[]): Promise<StoreProductsResponse>;
|
|
131
|
+
export declare function queryStoreProducts(limit?: number, cursor?: string, fields?: readonly string[], options?: WixCallOptions): Promise<StoreProductsResponse>;
|
|
131
132
|
/** User-facing product discovery. V3 name search/sorting belong to Search
|
|
132
133
|
* Products; Query Products deliberately does not support the name field.
|
|
133
134
|
* V1 uses its documented JSON-string filter/sort dialect. */
|
|
@@ -161,10 +162,10 @@ export interface StoreProductSearch {
|
|
|
161
162
|
* contract on both catalogs: pass back `pagingMetadata.cursors.next` as `cursor`.
|
|
162
163
|
* A non-catalog failure (401/403, offline) rejects; it is never retried on V1.
|
|
163
164
|
*/
|
|
164
|
-
export declare function searchStoreProducts(options?: StoreProductSearch): Promise<StoreProductsResponse>;
|
|
165
|
+
export declare function searchStoreProducts(options?: StoreProductSearch, readOptions?: WixCallOptions): Promise<StoreProductsResponse>;
|
|
165
166
|
/** Read one product from whichever catalog this site runs. `fields` is additive —
|
|
166
167
|
* it WIDENS the default v3 display fieldset rather than replacing it. */
|
|
167
|
-
export declare function getStoreProduct(productId: string, fields?: readonly string[]): Promise<StoreGetProductResponse>;
|
|
168
|
+
export declare function getStoreProduct(productId: string, fields?: readonly string[], readOptions?: WixCallOptions): Promise<StoreGetProductResponse>;
|
|
168
169
|
export { wixMediaUrl, isUnsizedWixMedia, WIX_LIST_IMAGE, WIX_DETAIL_IMAGE, type WixImageSize, } from "@wix/himalaya/wix-media";
|
|
169
170
|
import { type WixImageSize } from "@wix/himalaya/wix-media";
|
|
170
171
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type WixCallOptions } from "./index.js";
|
|
1
2
|
import type { WixProductWrite, WixCreateProductResponse, WixUpdateProductResponse, WixDeleteProductResponse } from "./index.js";
|
|
2
3
|
import type { WixQueryProductsRequest, WixQueryProductsResponse, WixGetProductResponse } from "./index.js";
|
|
3
4
|
import { type V3RichContent } from "./products-v3.js";
|
|
@@ -15,7 +16,7 @@ export declare function queryProducts(req?: WixQueryProductsRequest): Promise<Wi
|
|
|
15
16
|
* none). The key is ABSENT on a V1 catalog, which has no Ricos description, and without the option. */
|
|
16
17
|
export declare function getProduct(productId: string, opts?: {
|
|
17
18
|
richDescription?: boolean;
|
|
18
|
-
}): Promise<WixGetProductResponse>;
|
|
19
|
+
}, readOptions?: WixCallOptions): Promise<WixGetProductResponse>;
|
|
19
20
|
/** Create a product. V1: `POST /stores/v1/products`. V3: `POST /stores/v3/products`
|
|
20
21
|
* with the write model mapped onto V3's variants shape (see products-v3.ts). */
|
|
21
22
|
export declare function createProduct(product: WixProductWrite): Promise<WixCreateProductResponse>;
|
|
@@ -2,6 +2,17 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
@@ -14,6 +25,14 @@ declare global {
|
|
|
14
25
|
* it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
|
|
15
26
|
export interface WixCallOptions {
|
|
16
27
|
site?: string;
|
|
28
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
29
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
30
|
+
onCacheResult?: (metadata: {
|
|
31
|
+
source: "cache" | "network";
|
|
32
|
+
fetchedAt: number;
|
|
33
|
+
expiresAt?: number;
|
|
34
|
+
cacheable: boolean;
|
|
35
|
+
}) => void;
|
|
17
36
|
}
|
|
18
37
|
export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
|
|
19
38
|
export interface WixProductsPaging {
|
|
@@ -2,9 +2,31 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
19
|
+
export interface WixCallOptions {
|
|
20
|
+
site?: string;
|
|
21
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
22
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
23
|
+
onCacheResult?: (metadata: {
|
|
24
|
+
source: "cache" | "network";
|
|
25
|
+
fetchedAt: number;
|
|
26
|
+
expiresAt?: number;
|
|
27
|
+
cacheable: boolean;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
8
30
|
export interface WixReservation {
|
|
9
31
|
id: string;
|
|
10
32
|
/** HELD | RESERVED | REQUESTED | DECLINED | CANCELED | NO_SHOW | FINISHED | SEATED */
|
|
@@ -52,12 +74,12 @@ export interface WixQueryReservationsResponse {
|
|
|
52
74
|
};
|
|
53
75
|
}
|
|
54
76
|
/** POST /table-reservations/reservations/v1/reservations/query — list reservations. */
|
|
55
|
-
export declare function queryReservations(query: WixReservationQuery): Promise<WixQueryReservationsResponse>;
|
|
77
|
+
export declare function queryReservations(query: WixReservationQuery, readOptions?: WixCallOptions): Promise<WixQueryReservationsResponse>;
|
|
56
78
|
export interface WixGetReservationResponse {
|
|
57
79
|
reservation?: WixReservation;
|
|
58
80
|
}
|
|
59
81
|
/** GET /table-reservations/reservations/v1/reservations/{id} — single reservation (proto GetReservation; perm RESERVATION_READ). */
|
|
60
|
-
export declare function getReservation(reservationId: string): Promise<WixGetReservationResponse>;
|
|
82
|
+
export declare function getReservation(reservationId: string, readOptions?: WixCallOptions): Promise<WixGetReservationResponse>;
|
|
61
83
|
/**
|
|
62
84
|
* PATCH /table-reservations/reservations/v1/reservations/{id} — change status via
|
|
63
85
|
* the proto UpdateReservation (fieldmask field = `mask`). Used for approve
|
|
@@ -89,7 +111,7 @@ export interface WixListReservationLocationsResponse {
|
|
|
89
111
|
}
|
|
90
112
|
/** GET /table-reservations/reservation-locations/v1/reservation-locations — up to
|
|
91
113
|
* 100 locations (proto ListReservationLocations; perm RESERVATION_LOCATION_READ). */
|
|
92
|
-
export declare function listReservationLocations(): Promise<WixListReservationLocationsResponse>;
|
|
114
|
+
export declare function listReservationLocations(readOptions?: WixCallOptions): Promise<WixListReservationLocationsResponse>;
|
|
93
115
|
export interface WixHeldReservationDetails {
|
|
94
116
|
reservationLocationId: string;
|
|
95
117
|
/** ISO-8601 start of the requested slot, e.g. "2026-08-01T19:00:00Z". */
|
|
@@ -2,9 +2,31 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
19
|
+
export interface WixCallOptions {
|
|
20
|
+
site?: string;
|
|
21
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
22
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
23
|
+
onCacheResult?: (metadata: {
|
|
24
|
+
source: "cache" | "network";
|
|
25
|
+
fetchedAt: number;
|
|
26
|
+
expiresAt?: number;
|
|
27
|
+
cacheable: boolean;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
8
30
|
export interface WixUserProfile {
|
|
9
31
|
firstName?: string;
|
|
10
32
|
lastName?: string;
|
|
@@ -37,7 +59,7 @@ export interface WixMyData {
|
|
|
37
59
|
* it silently falls back to guest (#676). For a visitor-facing member directory,
|
|
38
60
|
* query the Members Area instead: `@himalaya/wix-members` `queryMembers`
|
|
39
61
|
* (`POST /members/v1/members/query`), which surfaces the real roster. */
|
|
40
|
-
export declare function getMyData(): Promise<WixMyData>;
|
|
62
|
+
export declare function getMyData(options?: WixCallOptions): Promise<WixMyData>;
|
|
41
63
|
/** Display name from my-data: full name (firstName + lastName) if present, else
|
|
42
64
|
* the userName handle, else the email. */
|
|
43
65
|
export declare function displayName(d: WixMyData): string;
|
|
@@ -3,6 +3,17 @@ declare global {
|
|
|
3
3
|
var himalaya: {
|
|
4
4
|
wixApi?: {
|
|
5
5
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
6
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
7
|
+
cache: string;
|
|
8
|
+
}) => Promise<{
|
|
9
|
+
data: unknown;
|
|
10
|
+
cache: {
|
|
11
|
+
source: "cache" | "network";
|
|
12
|
+
fetchedAt: number;
|
|
13
|
+
expiresAt?: number;
|
|
14
|
+
cacheable: boolean;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
6
17
|
};
|
|
7
18
|
};
|
|
8
19
|
}
|
|
@@ -11,6 +22,14 @@ export declare const WIX_VIDEO_GRAPHQL_URL = "https://manage.wix.com/_api/vod/pu
|
|
|
11
22
|
/** Per-call options. `site` reads a business other than the app's active one. */
|
|
12
23
|
export interface WixCallOptions {
|
|
13
24
|
site?: string;
|
|
25
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
26
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
27
|
+
onCacheResult?: (metadata: {
|
|
28
|
+
source: "cache" | "network";
|
|
29
|
+
fetchedAt: number;
|
|
30
|
+
expiresAt?: number;
|
|
31
|
+
cacheable: boolean;
|
|
32
|
+
}) => void;
|
|
14
33
|
}
|
|
15
34
|
/** One price option of a channel (`SUBSCRIPTION` | `PRICING_PLAN`) or a video (`SALE` | `RENT`). */
|
|
16
35
|
export interface WixVideoPricing {
|
|
@@ -2,10 +2,34 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
8
|
-
|
|
19
|
+
export interface WixCallOptions {
|
|
20
|
+
site?: string;
|
|
21
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
22
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
23
|
+
onCacheResult?: (metadata: {
|
|
24
|
+
source: "cache" | "network";
|
|
25
|
+
fetchedAt: number;
|
|
26
|
+
expiresAt?: number;
|
|
27
|
+
cacheable: boolean;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
30
|
+
/** The per-call header map for `opts`, or undefined when there is nothing to add — so
|
|
31
|
+
* the no-options path calls the bridge with exactly the 3 arguments it always did. */
|
|
32
|
+
declare function wixCall<T>(method: string, path: string, body?: unknown, readOptions?: WixCallOptions): Promise<T>;
|
|
9
33
|
export interface WixDataItem {
|
|
10
34
|
id?: string;
|
|
11
35
|
dataCollectionId?: string;
|
|
@@ -33,7 +57,7 @@ export interface WixIncludeReference {
|
|
|
33
57
|
}
|
|
34
58
|
/** The rarely-needed read parameters of `queryDataItems`. Every field is omitted from the wire
|
|
35
59
|
* body unless set, so a caller that passes none sends the exact body it always sent. */
|
|
36
|
-
export interface WixQueryOptions {
|
|
60
|
+
export interface WixQueryOptions extends WixCallOptions {
|
|
37
61
|
/** Read from the primary database instance instead of the nearest mirror. Slower, but a read
|
|
38
62
|
* right after your own write sees it — the default is eventually consistent. */
|
|
39
63
|
consistentRead?: boolean;
|
|
@@ -183,7 +207,7 @@ export declare function queryDataItems(dataCollectionId: string, limit?: number,
|
|
|
183
207
|
* gateway drops a GET body — and the string is built with `encodeURIComponent`
|
|
184
208
|
* rather than `URLSearchParams`, which the bare Tier-5 worker runtimes (JSCore /
|
|
185
209
|
* Hermes / QuickJS-ng) do not provide. */
|
|
186
|
-
export declare function getDataItem(dataCollectionId: string, dataItemId: string): Promise<{
|
|
210
|
+
export declare function getDataItem(dataCollectionId: string, dataItemId: string, options?: WixCallOptions): Promise<{
|
|
187
211
|
dataItem?: WixDataItem;
|
|
188
212
|
}>;
|
|
189
213
|
/** Insert an item — POST /wix-data/v2/items.
|
|
@@ -2,6 +2,17 @@ declare global {
|
|
|
2
2
|
var himalaya: {
|
|
3
3
|
wixApi?: {
|
|
4
4
|
call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
|
|
5
|
+
read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
|
|
6
|
+
cache: string;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
data: unknown;
|
|
9
|
+
cache: {
|
|
10
|
+
source: "cache" | "network";
|
|
11
|
+
fetchedAt: number;
|
|
12
|
+
expiresAt?: number;
|
|
13
|
+
cacheable: boolean;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
5
16
|
};
|
|
6
17
|
};
|
|
7
18
|
}
|
|
@@ -14,6 +25,14 @@ declare global {
|
|
|
14
25
|
* it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
|
|
15
26
|
export interface WixCallOptions {
|
|
16
27
|
site?: string;
|
|
28
|
+
/** Explicit cache reads never touch the network; reload waits for a server response. */
|
|
29
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
30
|
+
onCacheResult?: (metadata: {
|
|
31
|
+
source: "cache" | "network";
|
|
32
|
+
fetchedAt: number;
|
|
33
|
+
expiresAt?: number;
|
|
34
|
+
cacheable: boolean;
|
|
35
|
+
}) => void;
|
|
17
36
|
}
|
|
18
37
|
export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
|
|
19
38
|
/** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
* one (`site.forSite(msid)` from `@himalaya/wix-platform` returns this shape). */
|
|
3
3
|
export interface WixCallOptions {
|
|
4
4
|
site?: string;
|
|
5
|
+
/** Cache-only reads and forced-network recovery reads. */
|
|
6
|
+
cache?: "default" | "only-if-cached" | "reload";
|
|
7
|
+
onCacheResult?: (metadata: {
|
|
8
|
+
source: "cache" | "network";
|
|
9
|
+
fetchedAt: number;
|
|
10
|
+
expiresAt?: number;
|
|
11
|
+
cacheable: boolean;
|
|
12
|
+
}) => void;
|
|
5
13
|
}
|
|
6
14
|
/** The endpoint answered: `value` is what the call returns without `{ offline: "queue" }`. */
|
|
7
15
|
export interface WixSent<T> {
|
|
@@ -84,22 +84,30 @@ async function open(url, mode) {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// ../../stdlib/wix-sdk/pricing-plans/src/index.ts
|
|
87
|
-
function wixCall(method, path, body) {
|
|
87
|
+
function wixCall(method, path, body, readOptions) {
|
|
88
88
|
if (!globalThis.himalaya?.wixApi) {
|
|
89
89
|
return Promise.reject(
|
|
90
90
|
new Error("@himalaya/wix-pricing-plans: host did not install the wixApi bridge")
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
const api = globalThis.himalaya.wixApi;
|
|
94
|
+
if (readOptions?.cache || readOptions?.onCacheResult) {
|
|
95
|
+
if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
|
|
96
|
+
return api.read(method, path, body, readOptions.site ? { "wix-site-id": readOptions.site } : void 0, { cache: readOptions.cache ?? "default" }).then((result) => {
|
|
97
|
+
readOptions.onCacheResult?.(result.cache);
|
|
98
|
+
return result.data;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
|
|
94
102
|
}
|
|
95
|
-
function listMyPlanOrders(opts = {}) {
|
|
103
|
+
function listMyPlanOrders(opts = {}, readOptions) {
|
|
96
104
|
const qs = [
|
|
97
105
|
...(opts.statuses ?? []).map((s2) => `orderStatuses=${encodeURIComponent(s2)}`),
|
|
98
106
|
...opts.limit === void 0 ? [] : [`limit=${opts.limit}`],
|
|
99
107
|
...opts.offset === void 0 ? [] : [`offset=${opts.offset}`]
|
|
100
108
|
];
|
|
101
109
|
const path = "/pricing-plans/v2/member/orders" + (qs.length ? `?${qs.join("&")}` : "");
|
|
102
|
-
return wixCall("GET", path);
|
|
110
|
+
return wixCall("GET", path, void 0, readOptions);
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
// ../../stdlib/flows/checkout/src/index.ts
|
|
@@ -120,6 +120,9 @@ function defineService(name, def) {
|
|
|
120
120
|
"@himalaya/state: defineService called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5)."
|
|
121
121
|
);
|
|
122
122
|
}
|
|
123
|
+
if (def.readLifecycle && (himalaya.readLifecycleVersion ?? 0) < 1) {
|
|
124
|
+
throw new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime before installing this screen");
|
|
125
|
+
}
|
|
123
126
|
return himalaya.defineService(name, def);
|
|
124
127
|
}
|
|
125
128
|
|
|
@@ -468,25 +471,33 @@ async function open(url, mode) {
|
|
|
468
471
|
}
|
|
469
472
|
|
|
470
473
|
// ../../stdlib/wix-sdk/pricing-plans/src/index.ts
|
|
471
|
-
function wixCall(method, path, body) {
|
|
474
|
+
function wixCall(method, path, body, readOptions) {
|
|
472
475
|
if (!globalThis.himalaya?.wixApi) {
|
|
473
476
|
return Promise.reject(
|
|
474
477
|
new Error("@himalaya/wix-pricing-plans: host did not install the wixApi bridge")
|
|
475
478
|
);
|
|
476
479
|
}
|
|
477
|
-
|
|
480
|
+
const api = globalThis.himalaya.wixApi;
|
|
481
|
+
if (readOptions?.cache || readOptions?.onCacheResult) {
|
|
482
|
+
if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
|
|
483
|
+
return api.read(method, path, body, readOptions.site ? { "wix-site-id": readOptions.site } : void 0, { cache: readOptions.cache ?? "default" }).then((result) => {
|
|
484
|
+
readOptions.onCacheResult?.(result.cache);
|
|
485
|
+
return result.data;
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
|
|
478
489
|
}
|
|
479
|
-
function listPublicPlans() {
|
|
480
|
-
return wixCall("GET", "/pricing-plans/v2/plans/public");
|
|
490
|
+
function listPublicPlans(readOptions) {
|
|
491
|
+
return wixCall("GET", "/pricing-plans/v2/plans/public", void 0, readOptions);
|
|
481
492
|
}
|
|
482
|
-
function listMyPlanOrders(opts = {}) {
|
|
493
|
+
function listMyPlanOrders(opts = {}, readOptions) {
|
|
483
494
|
const qs = [
|
|
484
495
|
...(opts.statuses ?? []).map((s2) => `orderStatuses=${encodeURIComponent(s2)}`),
|
|
485
496
|
...opts.limit === void 0 ? [] : [`limit=${opts.limit}`],
|
|
486
497
|
...opts.offset === void 0 ? [] : [`offset=${opts.offset}`]
|
|
487
498
|
];
|
|
488
499
|
const path = "/pricing-plans/v2/member/orders" + (qs.length ? `?${qs.join("&")}` : "");
|
|
489
|
-
return wixCall("GET", path);
|
|
500
|
+
return wixCall("GET", path, void 0, readOptions);
|
|
490
501
|
}
|
|
491
502
|
function createOnlineOrder(planId, couponCode) {
|
|
492
503
|
return wixCall("POST", "/pricing-plans/v2/checkout/orders/online", couponCode ? { planId, couponCode } : { planId });
|
|
@@ -3864,12 +3875,26 @@ function wixCall2(method, path, body, opts) {
|
|
|
3864
3875
|
)
|
|
3865
3876
|
);
|
|
3866
3877
|
}
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
wixCallHeaders(opts)
|
|
3878
|
+
const api = globalThis.himalaya.wixApi;
|
|
3879
|
+
const verb = method.toUpperCase();
|
|
3880
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
3881
|
+
path.split("#")[0]
|
|
3872
3882
|
);
|
|
3883
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
3884
|
+
if (!api.read)
|
|
3885
|
+
return Promise.reject(
|
|
3886
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
3887
|
+
);
|
|
3888
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
3889
|
+
cache: opts.cache ?? "default"
|
|
3890
|
+
}).then((result) => {
|
|
3891
|
+
opts.onCacheResult?.(result.cache);
|
|
3892
|
+
return result.data;
|
|
3893
|
+
});
|
|
3894
|
+
}
|
|
3895
|
+
if (opts?.cache === "only-if-cached")
|
|
3896
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
3897
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
3873
3898
|
}
|
|
3874
3899
|
function createRedirectSession(req = {}, opts) {
|
|
3875
3900
|
return wixCall2(
|