@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.
Files changed (228) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/agent/src/index.d.ts +5 -2
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/index.d.ts +14 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/state/src/read.d.ts +60 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +3 -2
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/activity-counters-v1/src/index.d.ts +19 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ai-site-chat/src/index.d.ts +19 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/analytics/src/index.d.ts +42 -2
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/async-jobs/src/index.d.ts +19 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/automations-v1/src/index.d.ts +19 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/badges-v2/src/index.d.ts +19 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/billing-tax-v1/src/index.d.ts +19 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/extensions.d.ts +5 -4
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/index.d.ts +19 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +4 -4
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/index.d.ts +19 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/business-feed/src/index.d.ts +11 -0
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/business-tools-v1/src/index.d.ts +19 -0
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/chat-web/src/index.d.ts +22 -1
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/index.d.ts +19 -0
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/contacts/src/index.d.ts +19 -0
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/coupons/src/index.d.ts +24 -2
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/crm-tasks/src/index.d.ts +11 -0
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/dashboard-setup/src/index.d.ts +11 -0
  24. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/data-collections-v1/src/index.d.ts +19 -0
  25. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/donations/src/index.d.ts +19 -0
  26. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ecom/src/extensions.d.ts +6 -5
  27. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ecom/src/index.d.ts +19 -0
  28. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/email-marketing-v1/src/index.d.ts +19 -0
  29. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/events/src/index.d.ts +24 -2
  30. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/faq-v2/src/index.d.ts +19 -0
  31. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/forms/src/index.d.ts +19 -0
  32. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/forum/src/index.d.ts +19 -0
  33. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/genie-chat/src/index.d.ts +11 -0
  34. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/gift-cards/src/index.d.ts +19 -0
  35. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/index.d.ts +19 -0
  36. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/inbox/src/extensions.d.ts +2 -1
  37. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/inbox/src/index.d.ts +19 -0
  38. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/invoices/src/index.d.ts +24 -2
  39. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/loyalty/src/index.d.ts +28 -4
  40. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/marketing-v1/src/index.d.ts +19 -0
  41. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-feed-viewer/src/index.d.ts +23 -1
  42. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +25 -3
  43. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/new-releases/src/index.d.ts +23 -1
  44. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/notification-preferences/src/index.d.ts +23 -2
  45. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/notifications-v3/src/index.d.ts +19 -0
  46. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/online-programs/src/index.d.ts +25 -3
  47. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/portfolio/src/index.d.ts +25 -3
  48. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/pricing-plans/src/index.d.ts +28 -6
  49. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/redirects-v1/src/index.d.ts +19 -0
  50. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/restaurants/src/extensions.d.ts +2 -2
  51. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/restaurants/src/index.d.ts +19 -0
  52. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/reviews/src/index.d.ts +24 -2
  53. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/seo-v1/src/index.d.ts +19 -0
  54. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/site-list/src/index.d.ts +19 -0
  55. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/site-media/src/index.d.ts +11 -0
  56. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +23 -1
  57. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-collections/src/display.d.ts +3 -2
  58. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-collections/src/index.d.ts +27 -3
  59. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/catalog.d.ts +7 -7
  60. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/display.d.ts +4 -3
  61. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/extensions.d.ts +2 -1
  62. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/index.d.ts +19 -0
  63. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/table-reservations/src/index.d.ts +25 -3
  64. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/users/src/index.d.ts +23 -1
  65. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/video/src/index.d.ts +19 -0
  66. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/wix-data/src/index.d.ts +27 -3
  67. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/workflows-v1/src/index.d.ts +19 -0
  68. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/_shared/runtime.generated.d.ts +8 -0
  69. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +12 -4
  70. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +36 -11
  71. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/state.mjs +206 -12
  72. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-activity-counters.mjs +19 -5
  73. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ai-site-chat.mjs +19 -5
  74. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-analytics.mjs +21 -7
  75. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-async-jobs.mjs +19 -5
  76. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-automations.mjs +19 -5
  77. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-badges.mjs +19 -5
  78. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-billing-tax.mjs +19 -5
  79. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-blog.mjs +31 -14
  80. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +26 -12
  81. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-business-tools.mjs +20 -6
  82. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-chat-web.mjs +29 -7
  83. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +28 -5
  84. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-contacts.mjs +19 -5
  85. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-coupons.mjs +14 -6
  86. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data-collections.mjs +19 -5
  87. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data.mjs +15 -5
  88. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-donations.mjs +19 -5
  89. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ecom.mjs +33 -16
  90. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-email-marketing.mjs +19 -5
  91. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-events.mjs +14 -6
  92. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-faq.mjs +20 -6
  93. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-forms.mjs +19 -5
  94. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-forum.mjs +19 -5
  95. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-gift-cards.mjs +19 -5
  96. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +19 -5
  97. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-inbox.mjs +21 -7
  98. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-invoices.mjs +14 -6
  99. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-loyalty.mjs +16 -8
  100. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-marketing.mjs +19 -5
  101. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members-feed-viewer.mjs +21 -10
  102. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +17 -8
  103. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-new-releases.mjs +17 -5
  104. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-notification-preferences.mjs +20 -6
  105. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-notifications.mjs +19 -5
  106. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-online-programs.mjs +16 -8
  107. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-portfolio.mjs +16 -8
  108. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-pricing-plans.mjs +22 -14
  109. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-redirects.mjs +19 -5
  110. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-restaurants.mjs +22 -7
  111. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-reviews.mjs +14 -6
  112. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-rich-content-editor.mjs +3 -0
  113. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-seo.mjs +19 -5
  114. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-site-list.mjs +19 -5
  115. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-social-feed.mjs +15 -5
  116. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores-collections.mjs +20 -10
  117. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores.mjs +116 -83
  118. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-table-reservations.mjs +16 -8
  119. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-users.mjs +15 -5
  120. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-video.mjs +9 -1
  121. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-workflows.mjs +19 -5
  122. package/dist/cli.mjs +90 -57
  123. package/dist/preview-assets.generated.bin +0 -0
  124. package/fixtures/wix-canned.json +8 -8
  125. package/guides/dynamic-list.service.ts +38 -29
  126. package/guides/form-submit.service.ts +2 -1
  127. package/guides/index.json +6 -0
  128. package/guides/offline-reading.md +63 -0
  129. package/guides/one-app-to-himi-app.md +5 -3
  130. package/guides/recipe-dynamic-list.md +2 -0
  131. package/guides/recipe-four-state.md +1 -0
  132. package/guides/sdk-reference.json +225 -99
  133. package/guides/testing-himi-apps.md +2 -0
  134. package/guides/tier-5-add-a-screen.md +2 -0
  135. package/guides/wix-api-usage.md +9 -2
  136. package/package.json +2 -2
  137. package/templates/beauty-salon/dev/index.ts +4 -3
  138. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +6 -9
  139. package/templates/beauty-salon/tier5-src/_shared/iap-presentation.ts +7 -3
  140. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +1 -1
  141. package/templates/beauty-salon/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  142. package/templates/beauty-salon-owner/dev/index.ts +19 -19
  143. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +6 -9
  144. package/templates/beauty-salon-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  145. package/templates/branded-lite/dev/index.ts +38 -20
  146. package/templates/branded-lite/tier5-src/_shared/collection-query-legacy.ts +194 -0
  147. package/templates/branded-lite/tier5-src/_shared/collection-query.ts +158 -99
  148. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +31 -11
  149. package/templates/branded-lite/tier5-src/_shared/iap-presentation.ts +7 -3
  150. package/templates/branded-lite/tier5-src/_shared/read-service.ts +255 -0
  151. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +1 -1
  152. package/templates/branded-lite/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  153. package/templates/branded-lite/tier5-src/himi-branded-lite-shop/index.ts +202 -159
  154. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +130 -201
  155. package/templates/community-club/dev/index.ts +4 -4
  156. package/templates/community-club/tier5-src/_shared/collection-service.ts +6 -9
  157. package/templates/community-club/tier5-src/_shared/iap-presentation.ts +7 -3
  158. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +1 -1
  159. package/templates/community-club-owner/dev/index.ts +19 -19
  160. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +6 -9
  161. package/templates/community-club-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  162. package/templates/events-meetups/dev/index.ts +3 -3
  163. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +6 -9
  164. package/templates/events-meetups/tier5-src/_shared/iap-presentation.ts +7 -3
  165. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +1 -1
  166. package/templates/events-meetups-owner/dev/index.ts +17 -17
  167. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +6 -9
  168. package/templates/events-meetups-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  169. package/templates/gym-fitness/dev/index.ts +5 -4
  170. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +6 -9
  171. package/templates/gym-fitness/tier5-src/_shared/iap-presentation.ts +7 -3
  172. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +1 -1
  173. package/templates/gym-fitness/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  174. package/templates/gym-fitness-owner/dev/index.ts +20 -20
  175. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +6 -9
  176. package/templates/gym-fitness-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  177. package/templates/nonprofit-cause/dev/index.ts +4 -4
  178. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +6 -9
  179. package/templates/nonprofit-cause/tier5-src/_shared/iap-presentation.ts +7 -3
  180. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +1 -1
  181. package/templates/nonprofit-cause-owner/dev/index.ts +18 -18
  182. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +6 -9
  183. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  184. package/templates/owner-lite/dev/index.ts +20 -20
  185. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +6 -9
  186. package/templates/owner-lite/tier5-src/_shared/owner-module-data.ts +1 -1
  187. package/templates/podcast-creator/dev/index.ts +4 -4
  188. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +6 -9
  189. package/templates/podcast-creator/tier5-src/_shared/iap-presentation.ts +7 -3
  190. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +1 -1
  191. package/templates/podcast-creator-owner/dev/index.ts +19 -19
  192. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +6 -9
  193. package/templates/podcast-creator-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  194. package/templates/portfolio-creative/dev/index.ts +5 -4
  195. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +6 -9
  196. package/templates/portfolio-creative/tier5-src/_shared/iap-presentation.ts +7 -3
  197. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +1 -1
  198. package/templates/portfolio-creative/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  199. package/templates/portfolio-creative-owner/dev/index.ts +19 -19
  200. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +6 -9
  201. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  202. package/templates/restaurant/dev/index.ts +3 -3
  203. package/templates/restaurant/tier5-src/_shared/collection-service.ts +6 -9
  204. package/templates/restaurant/tier5-src/_shared/iap-presentation.ts +7 -3
  205. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +1 -1
  206. package/templates/restaurant-owner/dev/index.ts +20 -20
  207. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +6 -9
  208. package/templates/restaurant-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  209. package/templates/retail-store/dev/index.ts +19 -1
  210. package/templates/retail-store/tier5-src/_shared/collection-query-legacy.ts +194 -0
  211. package/templates/retail-store/tier5-src/_shared/collection-query.ts +158 -99
  212. package/templates/retail-store/tier5-src/_shared/collection-service.ts +31 -11
  213. package/templates/retail-store/tier5-src/_shared/iap-presentation.ts +7 -3
  214. package/templates/retail-store/tier5-src/_shared/read-service.ts +255 -0
  215. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +1 -1
  216. package/templates/retail-store/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  217. package/templates/retail-store/tier5-src/himi-branded-lite-shop/index.ts +202 -159
  218. package/templates/retail-store/tier5-src/himi-store-product/index.ts +130 -201
  219. package/templates/retail-store-owner/dev/index.ts +18 -18
  220. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +6 -9
  221. package/templates/retail-store-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  222. package/templates/yoga-studio/dev/index.ts +4 -4
  223. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +6 -9
  224. package/templates/yoga-studio/tier5-src/_shared/iap-presentation.ts +7 -3
  225. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +1 -1
  226. package/templates/yoga-studio-owner/dev/index.ts +18 -18
  227. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +6 -9
  228. package/templates/yoga-studio-owner/tier5-src/_shared/owner-module-data.ts +1 -1
@@ -72,12 +72,26 @@ function wixCall(method, path, body, opts) {
72
72
  new Error("@himalaya/wix-groups: host did not install the wixApi bridge")
73
73
  );
74
74
  }
75
- return globalThis.himalaya.wixApi.call(
76
- method,
77
- path,
78
- body,
79
- wixCallHeaders(opts)
75
+ const api = globalThis.himalaya.wixApi;
76
+ const verb = method.toUpperCase();
77
+ const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
78
+ path.split("#")[0]
80
79
  );
80
+ if (readShaped && (opts?.cache || opts?.onCacheResult)) {
81
+ if (!api.read)
82
+ return Promise.reject(
83
+ new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
84
+ );
85
+ return api.read(method, path, body, wixCallHeaders(opts), {
86
+ cache: opts.cache ?? "default"
87
+ }).then((result) => {
88
+ opts.onCacheResult?.(result.cache);
89
+ return result.data;
90
+ });
91
+ }
92
+ if (opts?.cache === "only-if-cached")
93
+ return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
94
+ return api.call(method, path, body, wixCallHeaders(opts));
81
95
  }
82
96
  export {
83
97
  approveJoinGroupRequests,
@@ -1,8 +1,8 @@
1
1
  // ../../stdlib/wix-sdk/inbox/src/extensions.ts
2
- function listConversations(req = {}) {
2
+ function listConversations(req = {}, opts) {
3
3
  const limit = req.paging?.limit;
4
4
  const qs = limit ? `?paging.limit=${limit}` : "";
5
- return wixCall("GET", `/inbox/v2/conversations${qs}`);
5
+ return wixCall("GET", `/inbox/v2/conversations${qs}`, void 0, opts);
6
6
  }
7
7
 
8
8
  // ../../stdlib/wix-sdk/inbox/src/index.ts
@@ -16,12 +16,26 @@ function wixCall(method, path, body, opts) {
16
16
  new Error("@himalaya/wix-inbox: host did not install the wixApi bridge")
17
17
  );
18
18
  }
19
- return globalThis.himalaya.wixApi.call(
20
- method,
21
- path,
22
- body,
23
- wixCallHeaders(opts)
19
+ const api = globalThis.himalaya.wixApi;
20
+ const verb = method.toUpperCase();
21
+ const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
22
+ path.split("#")[0]
24
23
  );
24
+ if (readShaped && (opts?.cache || opts?.onCacheResult)) {
25
+ if (!api.read)
26
+ return Promise.reject(
27
+ new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
28
+ );
29
+ return api.read(method, path, body, wixCallHeaders(opts), {
30
+ cache: opts.cache ?? "default"
31
+ }).then((result) => {
32
+ opts.onCacheResult?.(result.cache);
33
+ return result.data;
34
+ });
35
+ }
36
+ if (opts?.cache === "only-if-cached")
37
+ return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
38
+ return api.call(method, path, body, wixCallHeaders(opts));
25
39
  }
26
40
  function getOrCreateConversation(req = {}, opts) {
27
41
  return wixCall(
@@ -1,17 +1,25 @@
1
1
  // ../../stdlib/wix-sdk/invoices/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-invoices: host did not install the wixApi bridge")
6
6
  );
7
7
  }
8
- return globalThis.himalaya.wixApi.call(method, path, body);
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 queryInvoices(req = {}) {
11
- return wixCall("POST", "/invoices/v4/invoices/query", req);
18
+ function queryInvoices(req = {}, readOptions) {
19
+ return wixCall("POST", "/invoices/v4/invoices/query", req, readOptions);
12
20
  }
13
- function getInvoice(invoiceId) {
14
- return wixCall("GET", `/invoices/v4/invoices/${encodeURIComponent(invoiceId)}`);
21
+ function getInvoice(invoiceId, options) {
22
+ return wixCall("GET", `/invoices/v4/invoices/${encodeURIComponent(invoiceId)}`, void 0, options);
15
23
  }
16
24
  function publishInvoice(invoiceId) {
17
25
  return wixCall("POST", `/invoices/v4/invoices/${encodeURIComponent(invoiceId)}/publish`, { invoiceId });
@@ -5,20 +5,28 @@ function getLoyaltyBffDashboard(limit = 25) {
5
5
  }
6
6
 
7
7
  // ../../stdlib/wix-sdk/loyalty/src/index.ts
8
- function wixCall(method, path, body) {
8
+ function wixCall(method, path, body, readOptions) {
9
9
  if (!globalThis.himalaya?.wixApi) {
10
10
  return Promise.reject(new Error("@himalaya/wix-loyalty: host did not install the wixApi bridge"));
11
11
  }
12
- return globalThis.himalaya.wixApi.call(method, path, body);
12
+ const api = globalThis.himalaya.wixApi;
13
+ if (readOptions?.cache || readOptions?.onCacheResult) {
14
+ if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
15
+ return api.read(method, path, body, readOptions.site ? { "wix-site-id": readOptions.site } : void 0, { cache: readOptions.cache ?? "default" }).then((result) => {
16
+ readOptions.onCacheResult?.(result.cache);
17
+ return result.data;
18
+ });
19
+ }
20
+ return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
13
21
  }
14
- function getLoyaltyProgram() {
15
- return wixCall("GET", "/loyalty/v1/program");
22
+ function getLoyaltyProgram(readOptions) {
23
+ return wixCall("GET", "/loyalty/v1/program", void 0, readOptions);
16
24
  }
17
- function listLoyaltyRewards() {
18
- return wixCall("GET", "/loyalty/v1/rewards");
25
+ function listLoyaltyRewards(readOptions) {
26
+ return wixCall("GET", "/loyalty/v1/rewards", void 0, readOptions);
19
27
  }
20
- function listLoyaltyTiers() {
21
- return wixCall("GET", "/loyalty/v1/tiers");
28
+ function listLoyaltyTiers(readOptions) {
29
+ return wixCall("GET", "/loyalty/v1/tiers", void 0, readOptions);
22
30
  }
23
31
  export {
24
32
  getLoyaltyBffDashboard,
@@ -11,12 +11,26 @@ function wixCall(method, path, body, opts) {
11
11
  )
12
12
  );
13
13
  }
14
- return globalThis.himalaya.wixApi.call(
15
- method,
16
- path,
17
- body,
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 = [];
@@ -1,9 +1,19 @@
1
1
  // ../../stdlib/wix-sdk/members-feed-viewer/src/index.ts
2
- function wixCall(method, path, body, headers) {
2
+ function wixCall(method, path, body, readOptions) {
3
3
  if (!globalThis.himalaya?.wixApi) {
4
- return Promise.reject(new Error("@himalaya/wix-members-feed-viewer: host did not install the wixApi bridge"));
4
+ return Promise.reject(
5
+ new Error("@himalaya/wix-members-feed-viewer: host did not install the wixApi bridge")
6
+ );
5
7
  }
6
- return globalThis.himalaya.wixApi.call(method, path, body, headers);
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);
7
17
  }
8
18
  var BASE = "/members-feed-viewer/v1";
9
19
  var PROXY_PREFIX = "/_api";
@@ -16,18 +26,18 @@ function __resetMfvRouteForTests() {
16
26
  function isNotFound(err) {
17
27
  return /\bHTTP 404\b/.test(err instanceof Error ? err.message : String(err));
18
28
  }
19
- async function mfvCall(method, suffix, body) {
29
+ async function mfvCall(method, suffix, body, options) {
20
30
  const bare = `${BASE}${suffix}`;
21
31
  const proxy = `${PROXY_PREFIX}${BASE}${suffix}`;
22
- if (route === "proxy") return wixCall(method, proxy, body);
32
+ if (route === "proxy") return wixCall(method, proxy, body, options);
23
33
  try {
24
- const res = await wixCall(method, bare, body);
34
+ const res = await wixCall(method, bare, body, options);
25
35
  route = "bare";
26
36
  return res;
27
37
  } catch (err) {
28
- if (route === "bare" || proxyRefused || !isNotFound(err)) throw err;
38
+ if (route === "bare" || proxyRefused || !(isNotFound(err) || options?.cache === "only-if-cached" && /OFFLINE_CACHE_MISS/.test(String(err)))) throw err;
29
39
  try {
30
- const res = await wixCall(method, proxy, body);
40
+ const res = await wixCall(method, proxy, body, options);
31
41
  route = "proxy";
32
42
  return res;
33
43
  } catch (proxyErr) {
@@ -36,7 +46,7 @@ async function mfvCall(method, suffix, body) {
36
46
  }
37
47
  }
38
48
  }
39
- async function queryNotifications(limit = 25) {
49
+ async function queryNotifications(limit = 25, options) {
40
50
  const res = await mfvCall(
41
51
  "POST",
42
52
  "/members-viewer-feed-notifications/query",
@@ -46,7 +56,8 @@ async function queryNotifications(limit = 25) {
46
56
  sort: [{ fieldName: "sentDate", order: "DESC" }],
47
57
  filter: { channel: "MOBILE" }
48
58
  }
49
- }
59
+ },
60
+ options
50
61
  );
51
62
  return res.viewerFeedNotifications ?? [];
52
63
  }
@@ -1,18 +1,26 @@
1
1
  // ../../stdlib/wix-sdk/members-v1/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-members-v1: host did not install the wixApi bridge")
6
6
  );
7
7
  }
8
- return globalThis.himalaya.wixApi.call(method, path, body);
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 queryMembers(req = {}) {
11
- return wixCall("POST", "/members/v1/members/query", req);
18
+ function queryMembers(req = {}, readOptions) {
19
+ return wixCall("POST", "/members/v1/members/query", req, readOptions);
12
20
  }
13
- function getMember(id) {
21
+ function getMember(id, options) {
14
22
  if (!id) throw new Error("getMember: id is required");
15
- return wixCall("GET", `/members/v1/members/${encodeURIComponent(id)}?fieldsets=FULL`);
23
+ return wixCall("GET", `/members/v1/members/${encodeURIComponent(id)}?fieldsets=FULL`, void 0, options);
16
24
  }
17
25
  function getMyMember(req = {}) {
18
26
  const fieldsets = req.fieldsets?.length ? req.fieldsets.map((fieldset) => `fieldsets=${encodeURIComponent(fieldset)}`).join("&") : "fieldsets=FULL";
@@ -68,12 +76,13 @@ function unfollowMember(id) {
68
76
  return wixCall("DELETE", `/members/v3/followers/${encodeURIComponent(id)}`);
69
77
  }
70
78
  var MEMBERS_FOLLOWERS_APP_ID = "14ebe801-d78a-daa9-c9e5-0286a891e46f";
71
- async function getFollowCounts(memberId) {
79
+ async function getFollowCounts(memberId, options) {
72
80
  if (!memberId) throw new Error("getFollowCounts: memberId is required");
73
81
  const res = await wixCall(
74
82
  "POST",
75
83
  "/members/v1/activity-counters/query",
76
- { query: { filter: { memberId: { $in: [memberId] } } } }
84
+ { query: { filter: { memberId: { $in: [memberId] } } } },
85
+ options
77
86
  );
78
87
  const entry = (res.activityCounters ?? []).find((c) => c.appId === MEMBERS_FOLLOWERS_APP_ID);
79
88
  return {
@@ -1,14 +1,26 @@
1
1
  // ../../stdlib/wix-sdk/new-releases/src/index.ts
2
- function wixCall(method, path, body) {
2
+ function wixCall(method, path, body, readOptions) {
3
3
  if (!globalThis.himalaya?.wixApi) {
4
- return Promise.reject(new Error("@himalaya/wix-new-releases: host did not install the wixApi bridge"));
4
+ return Promise.reject(
5
+ new Error("@himalaya/wix-new-releases: host did not install the wixApi bridge")
6
+ );
5
7
  }
6
- return globalThis.himalaya.wixApi.call(method, path, body);
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);
7
17
  }
8
- function listAnnouncements(limit = 20) {
18
+ function listAnnouncements(limit = 20, options) {
9
19
  return wixCall(
10
20
  "GET",
11
- `https://www.wix.com/_api/wix-new-releases-service/v1/announcements?paging.limit=${limit}`
21
+ `https://www.wix.com/_api/wix-new-releases-service/v1/announcements?paging.limit=${limit}`,
22
+ void 0,
23
+ options
12
24
  );
13
25
  }
14
26
  export {
@@ -1,9 +1,17 @@
1
1
  // ../../stdlib/wix-sdk/notification-preferences/src/index.ts
2
- function wixCall(method, path, body, headers) {
2
+ function wixCall(method, path, body, headers, options) {
3
3
  if (!globalThis.himalaya?.wixApi) {
4
4
  return Promise.reject(new Error("@himalaya/wix-notification-preferences: host did not install the wixApi bridge"));
5
5
  }
6
- return globalThis.himalaya.wixApi.call(method, path, body, headers);
6
+ const api = globalThis.himalaya.wixApi;
7
+ if (options?.cache || options?.onCacheResult) {
8
+ if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
9
+ return api.read(method, path, body, headers, { cache: options.cache ?? "default" }).then((result) => {
10
+ options.onCacheResult?.(result.cache);
11
+ return result.data;
12
+ });
13
+ }
14
+ return api.call(method, path, body, headers);
7
15
  }
8
16
  var NOTIFICATION_PREFERENCES_BASE = "/notification-preferences/v1";
9
17
  function readTopics(res) {
@@ -44,10 +52,13 @@ function deliveredByTopic(prefs, channel = "MOBILE") {
44
52
  }
45
53
  return out;
46
54
  }
47
- function getNotificationTopics() {
55
+ function getNotificationTopics(options) {
48
56
  return wixCall(
49
57
  "GET",
50
- `${NOTIFICATION_PREFERENCES_BASE}/preferences/topics`
58
+ `${NOTIFICATION_PREFERENCES_BASE}/preferences/topics`,
59
+ void 0,
60
+ void 0,
61
+ options
51
62
  );
52
63
  }
53
64
  function getPreferencesForRecipient(recipient) {
@@ -62,10 +73,13 @@ function getPreferencesForRecipient(recipient) {
62
73
  `${NOTIFICATION_PREFERENCES_BASE}/preferences?${query}`
63
74
  );
64
75
  }
65
- function getMyNotificationPreferences() {
76
+ function getMyNotificationPreferences(options) {
66
77
  return wixCall(
67
78
  "GET",
68
- `${NOTIFICATION_PREFERENCES_BASE}/preferences-by-implicit-recipient`
79
+ `${NOTIFICATION_PREFERENCES_BASE}/preferences-by-implicit-recipient`,
80
+ void 0,
81
+ void 0,
82
+ options
69
83
  );
70
84
  }
71
85
  function upsertMyNotificationPreferences(preferencesInfo) {
@@ -11,12 +11,26 @@ function wixCall(method, path, body, opts) {
11
11
  )
12
12
  );
13
13
  }
14
- return globalThis.himalaya.wixApi.call(
15
- method,
16
- path,
17
- body,
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 notify(req = {}, opts) {
22
36
  return wixCall(
@@ -1,17 +1,25 @@
1
1
  // ../../stdlib/wix-sdk/online-programs/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(new Error("@himalaya/wix-online-programs: host did not install the wixApi bridge"));
5
5
  }
6
- return globalThis.himalaya.wixApi.call(method, path, body);
6
+ const api = globalThis.himalaya.wixApi;
7
+ if (readOptions?.cache || readOptions?.onCacheResult) {
8
+ if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
9
+ return api.read(method, path, body, readOptions.site ? { "wix-site-id": readOptions.site } : void 0, { cache: readOptions.cache ?? "default" }).then((result) => {
10
+ readOptions.onCacheResult?.(result.cache);
11
+ return result.data;
12
+ });
13
+ }
14
+ return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
7
15
  }
8
- function queryPrograms(query) {
9
- return wixCall("POST", "/online-programs/v3/programs/query", { query });
16
+ function queryPrograms(query, readOptions) {
17
+ return wixCall("POST", "/online-programs/v3/programs/query", { query }, readOptions);
10
18
  }
11
- function getProgram(id) {
12
- return wixCall("GET", `/online-programs/v3/programs/${encodeURIComponent(id)}`);
19
+ function getProgram(id, readOptions) {
20
+ return wixCall("GET", `/online-programs/v3/programs/${encodeURIComponent(id)}`, void 0, readOptions);
13
21
  }
14
- function queryParticipants(programId, opts) {
22
+ function queryParticipants(programId, opts, readOptions) {
15
23
  const and = [{ programId: { $eq: programId } }];
16
24
  if (opts?.progressStatus) and.push({ progressStatus: { $eq: opts.progressStatus } });
17
25
  const query = {
@@ -19,7 +27,7 @@ function queryParticipants(programId, opts) {
19
27
  sort: [{ fieldName: "createdDate", order: "DESC" }],
20
28
  paging: { limit: opts?.limit ?? 50 }
21
29
  };
22
- return wixCall("POST", "/online-programs/v3/participants/query", { query, fields: ["PROGRESS"] });
30
+ return wixCall("POST", "/online-programs/v3/participants/query", { query, fields: ["PROGRESS"] }, readOptions);
23
31
  }
24
32
  function joinProgram(programId) {
25
33
  if (!programId) throw new Error("joinProgram: programId is required");
@@ -4,11 +4,19 @@ function pagingQuery(limit, cursor) {
4
4
  if (cursor) parts.push(`paging.cursor=${encodeURIComponent(cursor)}`);
5
5
  return parts.join("&");
6
6
  }
7
- function wixCall(method, path, body) {
7
+ function wixCall(method, path, body, readOptions) {
8
8
  if (!globalThis.himalaya?.wixApi) {
9
9
  return Promise.reject(new Error("@himalaya/wix-portfolio: host did not install the wixApi bridge"));
10
10
  }
11
- return globalThis.himalaya.wixApi.call(method, path, body);
11
+ const api = globalThis.himalaya.wixApi;
12
+ if (readOptions?.cache || readOptions?.onCacheResult) {
13
+ if (!api.read) return Promise.reject(new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime"));
14
+ return api.read(method, path, body, readOptions.site ? { "wix-site-id": readOptions.site } : void 0, { cache: readOptions.cache ?? "default" }).then((result) => {
15
+ readOptions.onCacheResult?.(result.cache);
16
+ return result.data;
17
+ });
18
+ }
19
+ return readOptions?.site ? api.call(method, path, body, { "wix-site-id": readOptions.site }) : api.call(method, path, body);
12
20
  }
13
21
  function portfolioCoverRef(cover) {
14
22
  if (typeof cover === "string") return cover.trim();
@@ -18,15 +26,15 @@ function portfolioCoverRef(cover) {
18
26
  if (url) return url;
19
27
  return typeof info?.id === "string" ? info.id.trim() : "";
20
28
  }
21
- function listProjects(limit = 100, cursor) {
22
- return wixCall("GET", `/portfolio/v1/projects?${pagingQuery(limit, cursor)}`);
29
+ function listProjects(limit = 100, cursor, readOptions) {
30
+ return wixCall("GET", `/portfolio/v1/projects?${pagingQuery(limit, cursor)}`, void 0, readOptions);
23
31
  }
24
- function listCollections(limit = 100, cursor) {
25
- return wixCall("GET", `/portfolio/v1/collections?${pagingQuery(limit, cursor)}`);
32
+ function listCollections(limit = 100, cursor, readOptions) {
33
+ return wixCall("GET", `/portfolio/v1/collections?${pagingQuery(limit, cursor)}`, void 0, readOptions);
26
34
  }
27
- function listProjectItems(projectId, limit = 100, cursor) {
35
+ function listProjectItems(projectId, limit = 100, cursor, readOptions) {
28
36
  const query = cursor ? { cursorPaging: { limit, cursor } } : { filter: { projectId }, paging: { limit } };
29
- return wixCall("POST", "/portfolio/v1/items/query", { query }).then(
37
+ return wixCall("POST", "/portfolio/v1/items/query", { query }, readOptions).then(
30
38
  (response) => response && !response.pagingMetadata && response.metadata ? { ...response, pagingMetadata: response.metadata } : response
31
39
  );
32
40
  }
@@ -1,20 +1,28 @@
1
1
  // ../../stdlib/wix-sdk/pricing-plans/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-pricing-plans: host did not install the wixApi bridge")
6
6
  );
7
7
  }
8
- return globalThis.himalaya.wixApi.call(method, path, body);
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 listPlans() {
11
- return wixCall("GET", "/pricing-plans/v2/plans");
18
+ function listPlans(readOptions) {
19
+ return wixCall("GET", "/pricing-plans/v2/plans", void 0, readOptions);
12
20
  }
13
- function listPublicPlans() {
14
- return wixCall("GET", "/pricing-plans/v2/plans/public");
21
+ function listPublicPlans(readOptions) {
22
+ return wixCall("GET", "/pricing-plans/v2/plans/public", void 0, readOptions);
15
23
  }
16
- function getPlan(planId) {
17
- return wixCall("GET", `/pricing-plans/v2/plans/${encodeURIComponent(planId)}`);
24
+ function getPlan(planId, readOptions) {
25
+ return wixCall("GET", `/pricing-plans/v2/plans/${encodeURIComponent(planId)}`, void 0, readOptions);
18
26
  }
19
27
  function archivePlan(planId) {
20
28
  return wixCall("POST", `/pricing-plans/v2/plans/${encodeURIComponent(planId)}/archive`, {});
@@ -22,20 +30,20 @@ function archivePlan(planId) {
22
30
  function setPlanVisibility(planId, visible) {
23
31
  return wixCall("PATCH", `/pricing-plans/v2/plans/${encodeURIComponent(planId)}/visibility`, { visible });
24
32
  }
25
- function listPlanOrders() {
26
- return wixCall("GET", "/pricing-plans/v2/orders");
33
+ function listPlanOrders(readOptions) {
34
+ return wixCall("GET", "/pricing-plans/v2/orders", void 0, readOptions);
27
35
  }
28
- function listMyPlanOrders(opts = {}) {
36
+ function listMyPlanOrders(opts = {}, readOptions) {
29
37
  const qs = [
30
38
  ...(opts.statuses ?? []).map((s) => `orderStatuses=${encodeURIComponent(s)}`),
31
39
  ...opts.limit === void 0 ? [] : [`limit=${opts.limit}`],
32
40
  ...opts.offset === void 0 ? [] : [`offset=${opts.offset}`]
33
41
  ];
34
42
  const path = "/pricing-plans/v2/member/orders" + (qs.length ? `?${qs.join("&")}` : "");
35
- return wixCall("GET", path);
43
+ return wixCall("GET", path, void 0, readOptions);
36
44
  }
37
- function getPlanOrder(orderId) {
38
- return wixCall("GET", `/pricing-plans/v2/orders/${encodeURIComponent(orderId)}`);
45
+ function getPlanOrder(orderId, readOptions) {
46
+ return wixCall("GET", `/pricing-plans/v2/orders/${encodeURIComponent(orderId)}`, void 0, readOptions);
39
47
  }
40
48
  function cancelPlanOrder(orderId, effectiveAt = "IMMEDIATELY") {
41
49
  return wixCall("POST", `/pricing-plans/v2/orders/${encodeURIComponent(orderId)}/cancel`, { effectiveAt });
@@ -11,12 +11,26 @@ function wixCall(method, path, body, opts) {
11
11
  )
12
12
  );
13
13
  }
14
- return globalThis.himalaya.wixApi.call(
15
- method,
16
- path,
17
- body,
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 createRedirectSession(req = {}, opts) {
22
36
  return wixCall(
@@ -1,9 +1,10 @@
1
1
  // ../../stdlib/wix-sdk/restaurants/src/extensions.ts
2
- function querySections(req = {}) {
2
+ function querySections(req = {}, opts) {
3
3
  return wixCall(
4
4
  "POST",
5
5
  "/restaurants/menus/v1/sections/query",
6
- req
6
+ req,
7
+ opts
7
8
  );
8
9
  }
9
10
  function listOperations() {
@@ -40,12 +41,26 @@ function wixCall(method, path, body, opts) {
40
41
  )
41
42
  );
42
43
  }
43
- return globalThis.himalaya.wixApi.call(
44
- method,
45
- path,
46
- body,
47
- wixCallHeaders(opts)
44
+ const api = globalThis.himalaya.wixApi;
45
+ const verb = method.toUpperCase();
46
+ const readShaped = verb === "GET" || verb === "HEAD" || verb === "POST" && /\/(query|query-cursor|search|list|count)(\?|$)/.test(
47
+ path.split("#")[0]
48
48
  );
49
+ if (readShaped && (opts?.cache || opts?.onCacheResult)) {
50
+ if (!api.read)
51
+ return Promise.reject(
52
+ new Error("READ_LIFECYCLE_UNSUPPORTED: update the Himalaya runtime")
53
+ );
54
+ return api.read(method, path, body, wixCallHeaders(opts), {
55
+ cache: opts.cache ?? "default"
56
+ }).then((result) => {
57
+ opts.onCacheResult?.(result.cache);
58
+ return result.data;
59
+ });
60
+ }
61
+ if (opts?.cache === "only-if-cached")
62
+ return Promise.reject(new Error("OFFLINE_CACHE_MISS"));
63
+ return api.call(method, path, body, wixCallHeaders(opts));
49
64
  }
50
65
  function queryMenus(req = {}, opts) {
51
66
  return wixCall(