@wix/himalaya-cli 0.1544.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/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/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/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
|
@@ -11,12 +11,26 @@ function wixCall(method, path, body, opts) {
|
|
|
11
11
|
)
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
14
|
+
const api = globalThis.himalaya.wixApi;
|
|
15
|
+
const verb = method.toUpperCase();
|
|
16
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
17
|
+
path.split("#")[0]
|
|
18
|
+
);
|
|
19
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
20
|
+
if (!api.read)
|
|
21
|
+
return Promise.reject(
|
|
22
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
23
|
+
);
|
|
24
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
25
|
+
cache: opts.cache ?? "default"
|
|
26
|
+
}).then((result) => {
|
|
27
|
+
opts.onCacheResult?.(result.cache);
|
|
28
|
+
return result.data;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (opts?.cache === "only-if-cached")
|
|
32
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
33
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
20
34
|
}
|
|
21
35
|
function wixQueryPath(path, req) {
|
|
22
36
|
const parts = [];
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
// ../../stdlib/wix-sdk/chat-web/src/index.ts
|
|
2
|
-
function wixCall(method, path, body, headers) {
|
|
3
|
-
|
|
2
|
+
function wixCall(method, path, body, headers, options) {
|
|
3
|
+
const api = globalThis.himalaya?.wixApi;
|
|
4
|
+
if (!api) {
|
|
4
5
|
return Promise.reject(new Error("@himalaya/wix-chat-web: host did not install the wixApi bridge"));
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
+
const readShaped = method === "GET" || method === "HEAD" || method === "POST" && (/\/(query|search|list|count)(\?|$)/.test(path) || /\/_api\/chat-web\/v1\/chatrooms-for-list-view(?:\/(?:business|siteMember))?(?:[?#]|$)/.test(path));
|
|
8
|
+
if (readShaped && (options?.cache || options?.onCacheResult)) {
|
|
9
|
+
if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
|
|
10
|
+
return api.read(method, path, body ?? null, headers, { cache: options.cache ?? "default" }).then((result) => {
|
|
11
|
+
options.onCacheResult?.(result.cache);
|
|
12
|
+
return result.data;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return api.call(method, path, body, headers);
|
|
7
16
|
}
|
|
8
17
|
function uuid() {
|
|
9
18
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
@@ -92,10 +101,17 @@ async function getMessagesPage(chatroomId, params = {}) {
|
|
|
92
101
|
throw chatWebError("invalid_argument", "invalid ordering");
|
|
93
102
|
}
|
|
94
103
|
const { chatToken } = await getChatToken(params);
|
|
104
|
+
if (!chatToken) {
|
|
105
|
+
if (params.cache || params.onCacheResult) throw chatWebError("token_empty", "Chat authorization unavailable");
|
|
106
|
+
return { items: [], next: void 0, nextPointer: void 0 };
|
|
107
|
+
}
|
|
95
108
|
const query = queryString({ chatToken, pageSize: size, ordering, nextPointer });
|
|
96
109
|
const res = await wixCall(
|
|
97
110
|
"GET",
|
|
98
|
-
`${BASE}/_api/chat-web/v1/chatrooms/${room}/messages?${query}
|
|
111
|
+
`${BASE}/_api/chat-web/v1/chatrooms/${room}/messages?${query}`,
|
|
112
|
+
void 0,
|
|
113
|
+
void 0,
|
|
114
|
+
params
|
|
99
115
|
);
|
|
100
116
|
if (!res || typeof res !== "object") throw chatWebError("invalid_response", "history response is not an object");
|
|
101
117
|
const items = requiredArray(res.items, "items");
|
|
@@ -138,6 +154,9 @@ async function getChatToken(options = {}) {
|
|
|
138
154
|
}
|
|
139
155
|
return { chatToken: options.chatToken };
|
|
140
156
|
}
|
|
157
|
+
if (options.cache === "only-if-cached") {
|
|
158
|
+
throw chatWebError("token_empty", "Chat authorization unavailable offline");
|
|
159
|
+
}
|
|
141
160
|
const role = options.role ?? "owner";
|
|
142
161
|
if (role !== "owner" && role !== "member") {
|
|
143
162
|
throw chatWebError("invalid_argument", "invalid role");
|
|
@@ -156,14 +175,17 @@ async function getChatToken(options = {}) {
|
|
|
156
175
|
failure = e;
|
|
157
176
|
}
|
|
158
177
|
}
|
|
159
|
-
throw failure === void 0 ? chatWebError("token_empty",
|
|
178
|
+
throw failure === void 0 ? chatWebError("token_empty", "Chat authorization unavailable") : chatWebError("token_mint_failed", `chat token mint failed after ${TOKEN_MINT_ATTEMPTS} attempts`, failure);
|
|
160
179
|
}
|
|
161
180
|
async function listChatrooms(pageSize = 20, options = {}) {
|
|
162
181
|
if (options.role === "member") return (await listChatroomsPage({ ...options, pageSize })).items;
|
|
163
182
|
const { chatToken } = await getChatToken(options);
|
|
164
183
|
const res = await wixCall(
|
|
165
184
|
"GET",
|
|
166
|
-
`${BASE}/_api/chat-web/v2/chatrooms?chatToken=${encodeURIComponent(chatToken)}&pageSize=${pageSize}
|
|
185
|
+
`${BASE}/_api/chat-web/v2/chatrooms?chatToken=${encodeURIComponent(chatToken)}&pageSize=${pageSize}`,
|
|
186
|
+
void 0,
|
|
187
|
+
void 0,
|
|
188
|
+
options
|
|
167
189
|
);
|
|
168
190
|
return res.chatrooms?.items ?? [];
|
|
169
191
|
}
|
|
@@ -197,7 +219,7 @@ async function listChatroomsPage(params = {}) {
|
|
|
197
219
|
lastMessageLimit: LAST_MESSAGE_LIMIT,
|
|
198
220
|
unreadChatroomLimit: unreadLimit
|
|
199
221
|
});
|
|
200
|
-
const res = await wixCall("POST", `${BASE}/_api/chat-web/v1/chatrooms-for-list-view${type}?${query}`, { participantIds, labelIds: [] });
|
|
222
|
+
const res = await wixCall("POST", `${BASE}/_api/chat-web/v1/chatrooms-for-list-view${type}?${query}`, { participantIds, labelIds: [] }, void 0, params);
|
|
201
223
|
if (!res || typeof res !== "object" || !res.chatrooms || typeof res.chatrooms !== "object") {
|
|
202
224
|
throw chatWebError("invalid_response", "list response has no chatrooms");
|
|
203
225
|
}
|
|
@@ -189,12 +189,26 @@ function wixCall(method, path, body, opts) {
|
|
|
189
189
|
)
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
wixCallHeaders(opts)
|
|
192
|
+
const api = globalThis.himalaya.wixApi;
|
|
193
|
+
const verb = method.toUpperCase();
|
|
194
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
195
|
+
path.split("#")[0]
|
|
197
196
|
);
|
|
197
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
198
|
+
if (!api.read)
|
|
199
|
+
return Promise.reject(
|
|
200
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
201
|
+
);
|
|
202
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
203
|
+
cache: opts.cache ?? "default"
|
|
204
|
+
}).then((result) => {
|
|
205
|
+
opts.onCacheResult?.(result.cache);
|
|
206
|
+
return result.data;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (opts?.cache === "only-if-cached")
|
|
210
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
211
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
198
212
|
}
|
|
199
213
|
function wixQueryPath(path, req) {
|
|
200
214
|
const parts = [];
|
|
@@ -490,6 +504,15 @@ function send(verb, template, req, opts, route, queue) {
|
|
|
490
504
|
const headers = site ? { "wix-site-id": site } : void 0;
|
|
491
505
|
const target = route.query ? wixQueryPath2(path, withoutFields(req, fields)) : path;
|
|
492
506
|
const body = route.query ? void 0 : req;
|
|
507
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(?:\?|$)/i.test(target.split("#")[0]);
|
|
508
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
509
|
+
if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
|
|
510
|
+
return api.read(verb, target, body, headers, { cache: opts.cache ?? "default" }).then((result) => {
|
|
511
|
+
opts.onCacheResult?.(result.cache);
|
|
512
|
+
return result.data;
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
if (opts?.cache === "only-if-cached") return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
493
516
|
if (!queue) return api.call(verb, target, body, headers);
|
|
494
517
|
if (!api.offline) return api.call(verb, target, body, headers).then((value) => ({ status: "sent", value }));
|
|
495
518
|
return api.call(verb, target, body, headers, { offline: "queue" });
|
|
@@ -22,12 +22,26 @@ function wixCall(method, path, body, opts) {
|
|
|
22
22
|
)
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
wixCallHeaders(opts)
|
|
25
|
+
const api = globalThis.himalaya.wixApi;
|
|
26
|
+
const verb = method.toUpperCase();
|
|
27
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
28
|
+
path.split("#")[0]
|
|
30
29
|
);
|
|
30
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
31
|
+
if (!api.read)
|
|
32
|
+
return Promise.reject(
|
|
33
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
34
|
+
);
|
|
35
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
36
|
+
cache: opts.cache ?? "default"
|
|
37
|
+
}).then((result) => {
|
|
38
|
+
opts.onCacheResult?.(result.cache);
|
|
39
|
+
return result.data;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (opts?.cache === "only-if-cached")
|
|
43
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
44
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
31
45
|
}
|
|
32
46
|
function wixQueryPath(path, req) {
|
|
33
47
|
const parts = [];
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
// ../../stdlib/wix-sdk/coupons/src/index.ts
|
|
2
|
-
function wixCall(method, path, body) {
|
|
2
|
+
function wixCall(method, path, body, readOptions) {
|
|
3
3
|
if (!globalThis.himalaya?.wixApi) {
|
|
4
4
|
return Promise.reject(
|
|
5
5
|
new Error("@himalaya/wix-coupons: host did not install the wixApi bridge")
|
|
6
6
|
);
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
const api = globalThis.himalaya.wixApi;
|
|
9
|
+
if (readOptions?.cache || readOptions?.onCacheResult) {
|
|
10
|
+
if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
|
|
11
|
+
return api.read(method, path, body, readOptions.site ? { "wix-site-id": readOptions.site } : void 0, { cache: readOptions.cache ?? "default" }).then((result) => {
|
|
12
|
+
readOptions.onCacheResult?.(result.cache);
|
|
13
|
+
return result.data;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
|
|
9
17
|
}
|
|
10
|
-
function queryCoupons(req = {}) {
|
|
11
|
-
return wixCall("POST", "/stores/v2/coupons/query", { query: req });
|
|
18
|
+
function queryCoupons(req = {}, readOptions) {
|
|
19
|
+
return wixCall("POST", "/stores/v2/coupons/query", { query: req }, readOptions);
|
|
12
20
|
}
|
|
13
|
-
function getCoupon(id) {
|
|
21
|
+
function getCoupon(id, options) {
|
|
14
22
|
if (!id) throw new Error("getCoupon: id is required");
|
|
15
|
-
return wixCall("GET", `/stores/v2/coupons/${encodeURIComponent(id)}
|
|
23
|
+
return wixCall("GET", `/stores/v2/coupons/${encodeURIComponent(id)}`, void 0, options);
|
|
16
24
|
}
|
|
17
25
|
function createCoupon(specification) {
|
|
18
26
|
return wixCall("POST", "/stores/v2/coupons", { specification });
|
|
@@ -21,12 +21,26 @@ function wixCall(method, path, body, opts) {
|
|
|
21
21
|
)
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
wixCallHeaders(opts)
|
|
24
|
+
const api = globalThis.himalaya.wixApi;
|
|
25
|
+
const verb = method.toUpperCase();
|
|
26
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
27
|
+
path.split("#")[0]
|
|
29
28
|
);
|
|
29
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
30
|
+
if (!api.read)
|
|
31
|
+
return Promise.reject(
|
|
32
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
33
|
+
);
|
|
34
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
35
|
+
cache: opts.cache ?? "default"
|
|
36
|
+
}).then((result) => {
|
|
37
|
+
opts.onCacheResult?.(result.cache);
|
|
38
|
+
return result.data;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (opts?.cache === "only-if-cached")
|
|
42
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
43
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
30
44
|
}
|
|
31
45
|
function wixQueryPath(path, req) {
|
|
32
46
|
const parts = [];
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
// ../../stdlib/wix-sdk/wix-data/src/index.ts
|
|
2
|
-
function wixCall(method, path, body) {
|
|
2
|
+
function wixCall(method, path, body, readOptions) {
|
|
3
3
|
if (!globalThis.himalaya?.wixApi) {
|
|
4
4
|
return Promise.reject(
|
|
5
5
|
new Error("@himalaya/wix-data: host did not install the wixApi bridge")
|
|
6
6
|
);
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
const api = globalThis.himalaya.wixApi;
|
|
9
|
+
if (readOptions?.cache || readOptions?.onCacheResult) {
|
|
10
|
+
if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
|
|
11
|
+
return api.read(method, path, body, readOptions.site ? { "wix-site-id": readOptions.site } : void 0, { cache: readOptions.cache ?? "default" }).then((result) => {
|
|
12
|
+
readOptions.onCacheResult?.(result.cache);
|
|
13
|
+
return result.data;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
|
|
9
17
|
}
|
|
10
18
|
function queryDataItems(dataCollectionId, limit = 50, filter, returnTotalCount = false, offset = 0, sort, options) {
|
|
11
19
|
if (!dataCollectionId) throw new Error("queryDataItems: dataCollectionId is required");
|
|
@@ -32,14 +40,16 @@ function queryDataItems(dataCollectionId, limit = 50, filter, returnTotalCount =
|
|
|
32
40
|
...options?.language ? { language: options.language } : {},
|
|
33
41
|
...options?.includeDraftItems ? { publishPluginOptions: { includeDraftItems: true } } : {}
|
|
34
42
|
};
|
|
35
|
-
return wixCall("POST", "/wix-data/v2/items/query", body);
|
|
43
|
+
return wixCall("POST", "/wix-data/v2/items/query", body, options);
|
|
36
44
|
}
|
|
37
|
-
function getDataItem(dataCollectionId, dataItemId) {
|
|
45
|
+
function getDataItem(dataCollectionId, dataItemId, options) {
|
|
38
46
|
if (!dataCollectionId) throw new Error("getDataItem: dataCollectionId is required");
|
|
39
47
|
if (!dataItemId) throw new Error("getDataItem: dataItemId is required");
|
|
40
48
|
return wixCall(
|
|
41
49
|
"GET",
|
|
42
|
-
`/wix-data/v2/items/${encodeURIComponent(dataItemId)}?dataCollectionId=${encodeURIComponent(dataCollectionId)}
|
|
50
|
+
`/wix-data/v2/items/${encodeURIComponent(dataItemId)}?dataCollectionId=${encodeURIComponent(dataCollectionId)}`,
|
|
51
|
+
void 0,
|
|
52
|
+
options
|
|
43
53
|
);
|
|
44
54
|
}
|
|
45
55
|
function insertDataItem(dataCollectionId, data, options) {
|
|
@@ -11,12 +11,26 @@ function wixCall(method, path, body, opts) {
|
|
|
11
11
|
)
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
wixCallHeaders(opts)
|
|
14
|
+
const api = globalThis.himalaya.wixApi;
|
|
15
|
+
const verb = method.toUpperCase();
|
|
16
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
17
|
+
path.split("#")[0]
|
|
19
18
|
);
|
|
19
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
20
|
+
if (!api.read)
|
|
21
|
+
return Promise.reject(
|
|
22
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
23
|
+
);
|
|
24
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
25
|
+
cache: opts.cache ?? "default"
|
|
26
|
+
}).then((result) => {
|
|
27
|
+
opts.onCacheResult?.(result.cache);
|
|
28
|
+
return result.data;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (opts?.cache === "only-if-cached")
|
|
32
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
33
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
20
34
|
}
|
|
21
35
|
function createDonationCampaign(req = {}, opts) {
|
|
22
36
|
return wixCall(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// ../../stdlib/wix-sdk/ecom/src/extensions.ts
|
|
2
|
-
function getOrder(orderId) {
|
|
3
|
-
return wixCall("GET", `/ecom/v1/orders/${orderId}
|
|
2
|
+
function getOrder(orderId, options) {
|
|
3
|
+
return wixCall("GET", `/ecom/v1/orders/${orderId}`, void 0, options);
|
|
4
4
|
}
|
|
5
5
|
function archiveOrder(orderId) {
|
|
6
6
|
return wixCall("POST", `/ecom/v1/orders/${orderId}/archive`, {});
|
|
@@ -67,12 +67,15 @@ function isOrdersForbiddenError(error) {
|
|
|
67
67
|
const msg = error instanceof Error ? error.message : String(error ?? "");
|
|
68
68
|
return /READ_ORDER_FORBIDDEN|read order:\s*permission denied/i.test(msg);
|
|
69
69
|
}
|
|
70
|
-
async function getCurrentCart() {
|
|
70
|
+
async function getCurrentCart(opts) {
|
|
71
71
|
try {
|
|
72
|
-
const r = await wixCall("GET", "/ecom/v1/carts/current");
|
|
72
|
+
const r = await wixCall("GET", "/ecom/v1/carts/current", void 0, opts);
|
|
73
73
|
return r.cart ?? r;
|
|
74
74
|
} catch (e) {
|
|
75
|
-
if (isEmptyCurrentCartError(e))
|
|
75
|
+
if (isEmptyCurrentCartError(e)) {
|
|
76
|
+
opts?.onCacheResult?.({ source: "network", fetchedAt: Date.now(), cacheable: false });
|
|
77
|
+
return { lineItems: [] };
|
|
78
|
+
}
|
|
76
79
|
throw e;
|
|
77
80
|
}
|
|
78
81
|
}
|
|
@@ -135,11 +138,11 @@ function memberAddressFieldMask(patch) {
|
|
|
135
138
|
walk(patch, "");
|
|
136
139
|
return paths.join(",");
|
|
137
140
|
}
|
|
138
|
-
function listMemberAddresses() {
|
|
139
|
-
return wixCall("GET", MEMBER_ADDRESSES_URL);
|
|
141
|
+
function listMemberAddresses(options) {
|
|
142
|
+
return wixCall("GET", MEMBER_ADDRESSES_URL, void 0, options);
|
|
140
143
|
}
|
|
141
|
-
function getMemberAddress(addressId) {
|
|
142
|
-
return wixCall("GET", memberAddressUrl(addressId, "getMemberAddress"));
|
|
144
|
+
function getMemberAddress(addressId, options) {
|
|
145
|
+
return wixCall("GET", memberAddressUrl(addressId, "getMemberAddress"), void 0, options);
|
|
143
146
|
}
|
|
144
147
|
function getDefaultMemberAddress() {
|
|
145
148
|
return wixCall("GET", `${MEMBER_ADDRESSES_URL}/get-default-address`);
|
|
@@ -172,11 +175,11 @@ function savedPaymentMethodPath(savedPaymentMethodId, fn) {
|
|
|
172
175
|
if (!savedPaymentMethodId) throw new Error(`${fn}: savedPaymentMethodId is required`);
|
|
173
176
|
return `${SAVED_PAYMENT_METHODS_PATH}/${encodeURIComponent(savedPaymentMethodId)}`;
|
|
174
177
|
}
|
|
175
|
-
function listMySavedPaymentMethods(opts = {}) {
|
|
178
|
+
function listMySavedPaymentMethods(opts = {}, options) {
|
|
176
179
|
const query = ["siteMemberId=me"];
|
|
177
180
|
if (opts.limit) query.push(`paging.limit=${Math.max(1, Math.min(100, Math.floor(opts.limit)))}`);
|
|
178
181
|
if (opts.cursor) query.push(`paging.cursor=${encodeURIComponent(opts.cursor)}`);
|
|
179
|
-
return wixCall("GET", `${SAVED_PAYMENT_METHODS_PATH}?${query.join("&")}
|
|
182
|
+
return wixCall("GET", `${SAVED_PAYMENT_METHODS_PATH}?${query.join("&")}`, void 0, options);
|
|
180
183
|
}
|
|
181
184
|
function deleteSavedPaymentMethod(savedPaymentMethodId) {
|
|
182
185
|
return wixCall("DELETE", savedPaymentMethodPath(savedPaymentMethodId, "deleteSavedPaymentMethod"));
|
|
@@ -246,12 +249,26 @@ function wixCall(method, path, body, opts) {
|
|
|
246
249
|
new Error("@himalaya/wix-ecom: host did not install the wixApi bridge")
|
|
247
250
|
);
|
|
248
251
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
wixCallHeaders(opts)
|
|
252
|
+
const api = globalThis.himalaya.wixApi;
|
|
253
|
+
const verb = method.toUpperCase();
|
|
254
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
255
|
+
path.split("#")[0]
|
|
254
256
|
);
|
|
257
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
258
|
+
if (!api.read)
|
|
259
|
+
return Promise.reject(
|
|
260
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
261
|
+
);
|
|
262
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
263
|
+
cache: opts.cache ?? "default"
|
|
264
|
+
}).then((result) => {
|
|
265
|
+
opts.onCacheResult?.(result.cache);
|
|
266
|
+
return result.data;
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
if (opts?.cache === "only-if-cached")
|
|
270
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
271
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
255
272
|
}
|
|
256
273
|
function searchOrders(req = {}, opts) {
|
|
257
274
|
return wixCall(
|
|
@@ -11,12 +11,26 @@ function wixCall(method, path, body, opts) {
|
|
|
11
11
|
)
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
wixCallHeaders(opts)
|
|
14
|
+
const api = globalThis.himalaya.wixApi;
|
|
15
|
+
const verb = method.toUpperCase();
|
|
16
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
17
|
+
path.split("#")[0]
|
|
19
18
|
);
|
|
19
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
20
|
+
if (!api.read)
|
|
21
|
+
return Promise.reject(
|
|
22
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
23
|
+
);
|
|
24
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
25
|
+
cache: opts.cache ?? "default"
|
|
26
|
+
}).then((result) => {
|
|
27
|
+
opts.onCacheResult?.(result.cache);
|
|
28
|
+
return result.data;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (opts?.cache === "only-if-cached")
|
|
32
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
33
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
20
34
|
}
|
|
21
35
|
function wixQueryPath(path, req) {
|
|
22
36
|
const parts = [];
|
|
@@ -258,11 +258,19 @@ function eventDescription(e) {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
// ../../stdlib/wix-sdk/events/src/index.ts
|
|
261
|
-
function wixCall(method, path, body) {
|
|
261
|
+
function wixCall(method, path, body, readOptions) {
|
|
262
262
|
if (!globalThis.himalaya?.wixApi) {
|
|
263
263
|
return Promise.reject(new Error("@himalaya/wix-events: host did not install the wixApi bridge"));
|
|
264
264
|
}
|
|
265
|
-
|
|
265
|
+
const api = globalThis.himalaya.wixApi;
|
|
266
|
+
if (readOptions?.cache || readOptions?.onCacheResult) {
|
|
267
|
+
if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
|
|
268
|
+
return api.read(method, path, body, readOptions.site ? { "wix-site-id": readOptions.site } : void 0, { cache: readOptions.cache ?? "default" }).then((result) => {
|
|
269
|
+
readOptions.onCacheResult?.(result.cache);
|
|
270
|
+
return result.data;
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
|
|
266
274
|
}
|
|
267
275
|
var BASE = "https://manage.wix.com/_api/wix-one-events-server/events-in-clubs";
|
|
268
276
|
var EVENT_STATUSES = Object.freeze(["UPCOMING", "STARTED", "ENDED", "CANCELED", "DRAFT"]);
|
|
@@ -287,10 +295,10 @@ function eventStartMs(e) {
|
|
|
287
295
|
const ms = s ? new Date(s).getTime() : NaN;
|
|
288
296
|
return Number.isNaN(ms) ? Number.POSITIVE_INFINITY : ms;
|
|
289
297
|
}
|
|
290
|
-
async function queryEvents(opts = {}) {
|
|
298
|
+
async function queryEvents(opts = {}, readOptions) {
|
|
291
299
|
const limit = opts.limit ?? opts.query?.paging?.limit ?? 50;
|
|
292
300
|
const offset = opts.offset ?? opts.query?.paging?.offset ?? 0;
|
|
293
|
-
const res = await wixCall("POST", "/events/v3/events/query", { query: { ...opts.query, paging: { limit, offset } } });
|
|
301
|
+
const res = await wixCall("POST", "/events/v3/events/query", { query: { ...opts.query, paging: { limit, offset } } }, readOptions);
|
|
294
302
|
let events = (res.events ?? []).map(decodeEvent);
|
|
295
303
|
if (opts.statuses) {
|
|
296
304
|
const wanted = new Set(opts.statuses);
|
|
@@ -304,11 +312,11 @@ async function queryEvents(opts = {}) {
|
|
|
304
312
|
if (opts.order === "start") events = events.slice().sort((a, b) => eventStartMs(a) - eventStartMs(b));
|
|
305
313
|
return { ...res, events };
|
|
306
314
|
}
|
|
307
|
-
async function getEvent(eventId, opts = {}) {
|
|
315
|
+
async function getEvent(eventId, opts = {}, readOptions) {
|
|
308
316
|
if (!eventId) throw new Error("getEvent: eventId is required");
|
|
309
317
|
const fields = (opts.fields ?? []).map((f) => `fields=${encodeURIComponent(f)}`).join("&");
|
|
310
318
|
const query = fields ? `?${fields}` : "";
|
|
311
|
-
const res = await wixCall("GET", `/events/v3/events/${encodeURIComponent(eventId)}${query}
|
|
319
|
+
const res = await wixCall("GET", `/events/v3/events/${encodeURIComponent(eventId)}${query}`, void 0, readOptions);
|
|
312
320
|
return { ...res, event: decodeEvent(res.event) };
|
|
313
321
|
}
|
|
314
322
|
function deleteEvent(eventId) {
|
|
@@ -9,12 +9,26 @@ function wixCall(method, path, body, opts) {
|
|
|
9
9
|
new Error("@himalaya/wix-faq-v2: host did not install the wixApi bridge")
|
|
10
10
|
);
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
12
|
+
const api = globalThis.himalaya.wixApi;
|
|
13
|
+
const verb = method.toUpperCase();
|
|
14
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
15
|
+
path.split("#")[0]
|
|
16
|
+
);
|
|
17
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
18
|
+
if (!api.read)
|
|
19
|
+
return Promise.reject(
|
|
20
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
21
|
+
);
|
|
22
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
23
|
+
cache: opts.cache ?? "default"
|
|
24
|
+
}).then((result) => {
|
|
25
|
+
opts.onCacheResult?.(result.cache);
|
|
26
|
+
return result.data;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (opts?.cache === "only-if-cached")
|
|
30
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
31
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
18
32
|
}
|
|
19
33
|
function wixQueryPath(path, req) {
|
|
20
34
|
const parts = [];
|
|
@@ -9,12 +9,26 @@ function wixCall(method, path, body, opts) {
|
|
|
9
9
|
new Error("@himalaya/wix-forms: host did not install the wixApi bridge")
|
|
10
10
|
);
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
wixCallHeaders(opts)
|
|
12
|
+
const api = globalThis.himalaya.wixApi;
|
|
13
|
+
const verb = method.toUpperCase();
|
|
14
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
15
|
+
path.split("#")[0]
|
|
17
16
|
);
|
|
17
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
18
|
+
if (!api.read)
|
|
19
|
+
return Promise.reject(
|
|
20
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
21
|
+
);
|
|
22
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
23
|
+
cache: opts.cache ?? "default"
|
|
24
|
+
}).then((result) => {
|
|
25
|
+
opts.onCacheResult?.(result.cache);
|
|
26
|
+
return result.data;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (opts?.cache === "only-if-cached")
|
|
30
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
31
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
18
32
|
}
|
|
19
33
|
function queryForms(req, opts) {
|
|
20
34
|
if (req?.filter?.["namespace"] == null || req?.filter?.["namespace"] === "")
|
|
@@ -92,12 +92,26 @@ function wixCall(method, path, body, opts) {
|
|
|
92
92
|
new Error("@himalaya/wix-forum: host did not install the wixApi bridge")
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
wixCallHeaders(opts)
|
|
95
|
+
const api = globalThis.himalaya.wixApi;
|
|
96
|
+
const verb = method.toUpperCase();
|
|
97
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
98
|
+
path.split("#")[0]
|
|
100
99
|
);
|
|
100
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
101
|
+
if (!api.read)
|
|
102
|
+
return Promise.reject(
|
|
103
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
104
|
+
);
|
|
105
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
106
|
+
cache: opts.cache ?? "default"
|
|
107
|
+
}).then((result) => {
|
|
108
|
+
opts.onCacheResult?.(result.cache);
|
|
109
|
+
return result.data;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (opts?.cache === "only-if-cached")
|
|
113
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
114
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
101
115
|
}
|
|
102
116
|
function queryPosts(req = {}, opts) {
|
|
103
117
|
return wixCall(
|
|
@@ -11,12 +11,26 @@ function wixCall(method, path, body, opts) {
|
|
|
11
11
|
)
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
wixCallHeaders(opts)
|
|
14
|
+
const api = globalThis.himalaya.wixApi;
|
|
15
|
+
const verb = method.toUpperCase();
|
|
16
|
+
const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
|
|
17
|
+
path.split("#")[0]
|
|
19
18
|
);
|
|
19
|
+
if (readShaped && (opts?.cache || opts?.onCacheResult)) {
|
|
20
|
+
if (!api.read)
|
|
21
|
+
return Promise.reject(
|
|
22
|
+
new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
|
|
23
|
+
);
|
|
24
|
+
return api.read(method, path, body, wixCallHeaders(opts), {
|
|
25
|
+
cache: opts.cache ?? "default"
|
|
26
|
+
}).then((result) => {
|
|
27
|
+
opts.onCacheResult?.(result.cache);
|
|
28
|
+
return result.data;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (opts?.cache === "only-if-cached")
|
|
32
|
+
return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
|
|
33
|
+
return api.call(method, path, body, wixCallHeaders(opts));
|
|
20
34
|
}
|
|
21
35
|
function wixQueryPath(path, req) {
|
|
22
36
|
const parts = [];
|