@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.
Files changed (225) 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/wix-sdk/activity-counters-v1/src/index.d.ts +19 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ai-site-chat/src/index.d.ts +19 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/analytics/src/index.d.ts +42 -2
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/async-jobs/src/index.d.ts +19 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/automations-v1/src/index.d.ts +19 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/badges-v2/src/index.d.ts +19 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/billing-tax-v1/src/index.d.ts +19 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/extensions.d.ts +5 -4
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/index.d.ts +19 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +4 -4
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/index.d.ts +19 -0
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/business-feed/src/index.d.ts +11 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/business-tools-v1/src/index.d.ts +19 -0
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/chat-web/src/index.d.ts +22 -1
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/index.d.ts +19 -0
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/contacts/src/index.d.ts +19 -0
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/coupons/src/index.d.ts +24 -2
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/crm-tasks/src/index.d.ts +11 -0
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/dashboard-setup/src/index.d.ts +11 -0
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/data-collections-v1/src/index.d.ts +19 -0
  24. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/donations/src/index.d.ts +19 -0
  25. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ecom/src/extensions.d.ts +6 -5
  26. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ecom/src/index.d.ts +19 -0
  27. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/email-marketing-v1/src/index.d.ts +19 -0
  28. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/events/src/index.d.ts +24 -2
  29. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/faq-v2/src/index.d.ts +19 -0
  30. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/forms/src/index.d.ts +19 -0
  31. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/forum/src/index.d.ts +19 -0
  32. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/genie-chat/src/index.d.ts +11 -0
  33. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/gift-cards/src/index.d.ts +19 -0
  34. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/index.d.ts +19 -0
  35. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/inbox/src/extensions.d.ts +2 -1
  36. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/inbox/src/index.d.ts +19 -0
  37. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/invoices/src/index.d.ts +24 -2
  38. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/loyalty/src/index.d.ts +28 -4
  39. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/marketing-v1/src/index.d.ts +19 -0
  40. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-feed-viewer/src/index.d.ts +23 -1
  41. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +25 -3
  42. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/new-releases/src/index.d.ts +23 -1
  43. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/notification-preferences/src/index.d.ts +23 -2
  44. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/notifications-v3/src/index.d.ts +19 -0
  45. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/online-programs/src/index.d.ts +25 -3
  46. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/portfolio/src/index.d.ts +25 -3
  47. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/pricing-plans/src/index.d.ts +28 -6
  48. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/redirects-v1/src/index.d.ts +19 -0
  49. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/restaurants/src/extensions.d.ts +2 -2
  50. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/restaurants/src/index.d.ts +19 -0
  51. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/reviews/src/index.d.ts +24 -2
  52. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/seo-v1/src/index.d.ts +19 -0
  53. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/site-list/src/index.d.ts +19 -0
  54. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/site-media/src/index.d.ts +11 -0
  55. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +23 -1
  56. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-collections/src/display.d.ts +3 -2
  57. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-collections/src/index.d.ts +27 -3
  58. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/catalog.d.ts +7 -7
  59. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/display.d.ts +4 -3
  60. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/extensions.d.ts +2 -1
  61. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/index.d.ts +19 -0
  62. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/table-reservations/src/index.d.ts +25 -3
  63. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/users/src/index.d.ts +23 -1
  64. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/video/src/index.d.ts +19 -0
  65. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/wix-data/src/index.d.ts +27 -3
  66. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/workflows-v1/src/index.d.ts +19 -0
  67. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk-auto/_shared/runtime.generated.d.ts +8 -0
  68. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +12 -4
  69. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +36 -11
  70. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/state.mjs +206 -12
  71. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-activity-counters.mjs +19 -5
  72. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ai-site-chat.mjs +19 -5
  73. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-analytics.mjs +21 -7
  74. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-async-jobs.mjs +19 -5
  75. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-automations.mjs +19 -5
  76. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-badges.mjs +19 -5
  77. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-billing-tax.mjs +19 -5
  78. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-blog.mjs +31 -14
  79. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +26 -12
  80. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-business-tools.mjs +20 -6
  81. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-chat-web.mjs +29 -7
  82. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +28 -5
  83. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-contacts.mjs +19 -5
  84. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-coupons.mjs +14 -6
  85. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data-collections.mjs +19 -5
  86. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-data.mjs +15 -5
  87. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-donations.mjs +19 -5
  88. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ecom.mjs +33 -16
  89. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-email-marketing.mjs +19 -5
  90. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-events.mjs +14 -6
  91. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-faq.mjs +20 -6
  92. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-forms.mjs +19 -5
  93. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-forum.mjs +19 -5
  94. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-gift-cards.mjs +19 -5
  95. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +19 -5
  96. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-inbox.mjs +21 -7
  97. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-invoices.mjs +14 -6
  98. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-loyalty.mjs +16 -8
  99. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-marketing.mjs +19 -5
  100. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members-feed-viewer.mjs +21 -10
  101. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +17 -8
  102. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-new-releases.mjs +17 -5
  103. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-notification-preferences.mjs +20 -6
  104. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-notifications.mjs +19 -5
  105. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-online-programs.mjs +16 -8
  106. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-portfolio.mjs +16 -8
  107. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-pricing-plans.mjs +22 -14
  108. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-redirects.mjs +19 -5
  109. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-restaurants.mjs +22 -7
  110. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-reviews.mjs +14 -6
  111. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-rich-content-editor.mjs +3 -0
  112. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-seo.mjs +19 -5
  113. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-site-list.mjs +19 -5
  114. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-social-feed.mjs +15 -5
  115. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores-collections.mjs +20 -10
  116. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores.mjs +116 -83
  117. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-table-reservations.mjs +16 -8
  118. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-users.mjs +15 -5
  119. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-video.mjs +9 -1
  120. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-workflows.mjs +19 -5
  121. package/dist/cli.mjs +90 -57
  122. package/dist/preview-assets.generated.bin +0 -0
  123. package/fixtures/wix-canned.json +8 -8
  124. package/guides/dynamic-list.service.ts +38 -29
  125. package/guides/form-submit.service.ts +2 -1
  126. package/guides/index.json +6 -0
  127. package/guides/offline-reading.md +63 -0
  128. package/guides/recipe-dynamic-list.md +2 -0
  129. package/guides/recipe-four-state.md +1 -0
  130. package/guides/sdk-reference.json +225 -99
  131. package/guides/testing-himi-apps.md +2 -0
  132. package/guides/tier-5-add-a-screen.md +2 -0
  133. package/package.json +2 -2
  134. package/templates/beauty-salon/dev/index.ts +4 -3
  135. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +6 -9
  136. package/templates/beauty-salon/tier5-src/_shared/iap-presentation.ts +7 -3
  137. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +1 -1
  138. package/templates/beauty-salon/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  139. package/templates/beauty-salon-owner/dev/index.ts +19 -19
  140. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +6 -9
  141. package/templates/beauty-salon-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  142. package/templates/branded-lite/dev/index.ts +38 -20
  143. package/templates/branded-lite/tier5-src/_shared/collection-query-legacy.ts +194 -0
  144. package/templates/branded-lite/tier5-src/_shared/collection-query.ts +158 -99
  145. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +31 -11
  146. package/templates/branded-lite/tier5-src/_shared/iap-presentation.ts +7 -3
  147. package/templates/branded-lite/tier5-src/_shared/read-service.ts +255 -0
  148. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +1 -1
  149. package/templates/branded-lite/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  150. package/templates/branded-lite/tier5-src/himi-branded-lite-shop/index.ts +202 -159
  151. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +130 -201
  152. package/templates/community-club/dev/index.ts +4 -4
  153. package/templates/community-club/tier5-src/_shared/collection-service.ts +6 -9
  154. package/templates/community-club/tier5-src/_shared/iap-presentation.ts +7 -3
  155. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +1 -1
  156. package/templates/community-club-owner/dev/index.ts +19 -19
  157. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +6 -9
  158. package/templates/community-club-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  159. package/templates/events-meetups/dev/index.ts +3 -3
  160. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +6 -9
  161. package/templates/events-meetups/tier5-src/_shared/iap-presentation.ts +7 -3
  162. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +1 -1
  163. package/templates/events-meetups-owner/dev/index.ts +17 -17
  164. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +6 -9
  165. package/templates/events-meetups-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  166. package/templates/gym-fitness/dev/index.ts +5 -4
  167. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +6 -9
  168. package/templates/gym-fitness/tier5-src/_shared/iap-presentation.ts +7 -3
  169. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +1 -1
  170. package/templates/gym-fitness/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  171. package/templates/gym-fitness-owner/dev/index.ts +20 -20
  172. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +6 -9
  173. package/templates/gym-fitness-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  174. package/templates/nonprofit-cause/dev/index.ts +4 -4
  175. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +6 -9
  176. package/templates/nonprofit-cause/tier5-src/_shared/iap-presentation.ts +7 -3
  177. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +1 -1
  178. package/templates/nonprofit-cause-owner/dev/index.ts +18 -18
  179. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +6 -9
  180. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  181. package/templates/owner-lite/dev/index.ts +20 -20
  182. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +6 -9
  183. package/templates/owner-lite/tier5-src/_shared/owner-module-data.ts +1 -1
  184. package/templates/podcast-creator/dev/index.ts +4 -4
  185. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +6 -9
  186. package/templates/podcast-creator/tier5-src/_shared/iap-presentation.ts +7 -3
  187. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +1 -1
  188. package/templates/podcast-creator-owner/dev/index.ts +19 -19
  189. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +6 -9
  190. package/templates/podcast-creator-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  191. package/templates/portfolio-creative/dev/index.ts +5 -4
  192. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +6 -9
  193. package/templates/portfolio-creative/tier5-src/_shared/iap-presentation.ts +7 -3
  194. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +1 -1
  195. package/templates/portfolio-creative/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  196. package/templates/portfolio-creative-owner/dev/index.ts +19 -19
  197. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +6 -9
  198. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  199. package/templates/restaurant/dev/index.ts +3 -3
  200. package/templates/restaurant/tier5-src/_shared/collection-service.ts +6 -9
  201. package/templates/restaurant/tier5-src/_shared/iap-presentation.ts +7 -3
  202. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +1 -1
  203. package/templates/restaurant-owner/dev/index.ts +20 -20
  204. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +6 -9
  205. package/templates/restaurant-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  206. package/templates/retail-store/dev/index.ts +19 -1
  207. package/templates/retail-store/tier5-src/_shared/collection-query-legacy.ts +194 -0
  208. package/templates/retail-store/tier5-src/_shared/collection-query.ts +158 -99
  209. package/templates/retail-store/tier5-src/_shared/collection-service.ts +31 -11
  210. package/templates/retail-store/tier5-src/_shared/iap-presentation.ts +7 -3
  211. package/templates/retail-store/tier5-src/_shared/read-service.ts +255 -0
  212. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +1 -1
  213. package/templates/retail-store/tier5-src/himi-branded-lite-orders/index.ts +3 -0
  214. package/templates/retail-store/tier5-src/himi-branded-lite-shop/index.ts +202 -159
  215. package/templates/retail-store/tier5-src/himi-store-product/index.ts +130 -201
  216. package/templates/retail-store-owner/dev/index.ts +18 -18
  217. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +6 -9
  218. package/templates/retail-store-owner/tier5-src/_shared/owner-module-data.ts +1 -1
  219. package/templates/yoga-studio/dev/index.ts +4 -4
  220. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +6 -9
  221. package/templates/yoga-studio/tier5-src/_shared/iap-presentation.ts +7 -3
  222. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +1 -1
  223. package/templates/yoga-studio-owner/dev/index.ts +18 -18
  224. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +6 -9
  225. package/templates/yoga-studio-owner/tier5-src/_shared/owner-module-data.ts +1 -1
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * Hint the platform that worker state is at a meaningful boundary worth
3
- * writing to disk. Optionally supply a `snapshot` — an opaque JSON-friendly
4
- * value the platform can include alongside the auto-generated state dump.
3
+ * writing to disk. Optionally supply a JSON-friendly map from registered service
4
+ * names to their next state, for a flush before an action commits that state.
5
+ * Omit it to flush current state. Unknown services, read-lifecycle services,
6
+ * transient fields and fields declared `notPersisted` are excluded. Keep authored
7
+ * metadata inside its service state; arbitrary top-level metadata is not persisted.
5
8
  *
6
9
  * Returns immediately; the actual write is async and platform-managed.
7
10
  */
@@ -1,4 +1,6 @@
1
1
  import type { Component } from "@wix/himalaya/core";
2
+ export { createReadController, initialReadStatus } from './read.js';
3
+ export type { ReadMetadata, ReadStatus, ReadSnapshot } from './read.js';
2
4
  export interface ServiceDefinition<S> {
3
5
  /** Initial state for the service. Must be JSON-serializable. */
4
6
  state: S;
@@ -15,6 +17,18 @@ export interface ServiceDefinition<S> {
15
17
  * Runtimes that honour it set `himalaya.hydrationOptOut`; an older one ignores the option.
16
18
  */
17
19
  notHydrated?: readonly (keyof S & string)[];
20
+ /** Applies a presentation decorator after a retained read snapshot is committed. */
21
+ readPresentation?: (state: any) => any;
22
+ /** Explicitly safe read action, invoked on reconnect while this screen is visible.
23
+ * statusPath addresses a ReadStatus in this service (e.g. "readStatus"). */
24
+ readLifecycle?: {
25
+ refreshAction: string;
26
+ statusPath: string;
27
+ };
28
+ /** Data governed by a separate cache policy must not also enter the generic
29
+ * worker snapshot. These keys are neither persisted nor hydrated by a runtime with
30
+ * `himalaya.readLifecycleVersion >= 1`; an older runtime ignores the option. */
31
+ notPersisted?: readonly (keyof S & string)[];
18
32
  /**
19
33
  * Keys that start each VISIT from `state`: when a cached embed shows the screen again (its warm worker
20
34
  * reclaimed), these go back to their declared values before the screen reloads. For the same kind of
@@ -0,0 +1,60 @@
1
+ /** The provenance of one policy-approved read. Times are Unix milliseconds. */
2
+ export interface ReadMetadata {
3
+ source: 'cache' | 'network' | 'local';
4
+ fetchedAt: number;
5
+ expiresAt?: number;
6
+ cacheable: boolean;
7
+ }
8
+ export interface ReadStatus {
9
+ hasSnapshot: boolean;
10
+ fromCache: boolean;
11
+ refreshing: boolean;
12
+ stale: boolean;
13
+ offline: boolean;
14
+ lastSuccessAt?: number;
15
+ expiresAt?: number;
16
+ error: string;
17
+ /** Authored local content has no server freshness claim and is never persisted as a response. */
18
+ hasLocalContent?: boolean;
19
+ }
20
+ export interface ReadSnapshot<T> {
21
+ data: T;
22
+ metadata: ReadMetadata;
23
+ }
24
+ export declare const initialReadStatus: () => ReadStatus;
25
+ /** Read-only lifecycle. The adapter owns policy and identity scoping; this controller
26
+ * never persists data or queues an action. A snapshot may legitimately contain [] or null.
27
+ * Change the key when route/query/identity changes; late completions then cannot publish.
28
+ */
29
+ export declare function createReadController<T>(options: {
30
+ cached?(key: string): Promise<ReadSnapshot<T> | undefined>;
31
+ fetch(key: string): Promise<ReadSnapshot<T>>;
32
+ publish(data: T | undefined, status: ReadStatus): void;
33
+ online?(): boolean;
34
+ clearOnError?(error: unknown): boolean;
35
+ /** A domain-safe explanation (never a raw response body) for an unavailable read. */
36
+ errorMessage?(error: unknown): string;
37
+ now?(): number;
38
+ allowLocal?: boolean;
39
+ }): {
40
+ load: (nextKey: string) => Promise<void>;
41
+ refresh: () => Promise<void>;
42
+ getStatus: () => {
43
+ hasSnapshot: boolean;
44
+ fromCache: boolean;
45
+ refreshing: boolean;
46
+ stale: boolean;
47
+ offline: boolean;
48
+ lastSuccessAt?: number;
49
+ expiresAt?: number;
50
+ error: string;
51
+ /** Authored local content has no server freshness claim and is never persisted as a response. */
52
+ hasLocalContent?: boolean;
53
+ };
54
+ /** Revision for adapters that coalesce the read and their final state projection. */
55
+ getRevision: () => number;
56
+ connectivityChanged(connected: boolean): void;
57
+ replace(snapshot: ReadSnapshot<T>, nextKey?: string): void;
58
+ invalidate(): void;
59
+ dispose(): void;
60
+ };
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  export interface WixActivityCounter {
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  /** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or
@@ -2,9 +2,49 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
19
+ /**
20
+ * Every path below is RELATIVE, starting with `/`. That is the wixApi bridge's
21
+ * contract — "paths are relative to https://www.wixapis.com" — and what the other
22
+ * 27 call sites across `@himalaya/wix-*` do.
23
+ *
24
+ * This domain used to spell its three paths as absolute `https://www.wixapis.com/…`
25
+ * URLs. Native tolerates that (its request policy allows any `wixapis.com` host),
26
+ * so it worked everywhere anyone looked. The web preview does not: its bridge
27
+ * is host-locked to the gateway and refuses an absolute URL outright, and
28
+ * `*.wixapis.com` deliberately does NOT get the owner-host exemption — the gateway
29
+ * is precisely the thing you are supposed to reach with a relative path. So every
30
+ * analytics call returned `400 absolute_urls_not_allowed`, and owner-lite's
31
+ * Analytics and Build-a-report screens showed that raw JSON in their error arm on
32
+ * the web preview while both worked on device.
33
+ *
34
+ * Keep them relative. An absolute URL here is not a style choice — it is a screen
35
+ * that only works on half its surfaces.
36
+ */
37
+ export interface WixCallOptions {
38
+ site?: string;
39
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
40
+ cache?: "default" | "only-if-cached" | "reload";
41
+ onCacheResult?: (metadata: {
42
+ source: "cache" | "network";
43
+ fetchedAt: number;
44
+ expiresAt?: number;
45
+ cacheable: boolean;
46
+ }) => void;
47
+ }
8
48
  /**
9
49
  * The zone these helpers can actually honour: the requested one where ECMA-402
10
50
  * exists, UTC where it does not. Callers must send THIS to the API, not the zone
@@ -138,7 +178,7 @@ export interface GetSiteAnalyticsOptions {
138
178
  * that materially changes the result and the list was already at its readable
139
179
  * limit.
140
180
  */
141
- export declare function getSiteAnalytics(opts: GetSiteAnalyticsOptions): Promise<WixAnalyticsResponse>;
181
+ export declare function getSiteAnalytics(opts: GetSiteAnalyticsOptions, options?: WixCallOptions): Promise<WixAnalyticsResponse>;
142
182
  /**
143
183
  * The site's IANA time zone, for `timeZone` / `interval.timezone`.
144
184
  *
@@ -148,7 +188,7 @@ export declare function getSiteAnalytics(opts: GetSiteAnalyticsOptions): Promise
148
188
  * hand-rolling the same raw `wixApi` request. A deliberate trade-off, recorded so
149
189
  * the next reader does not take it for an accident.
150
190
  */
151
- export declare function getSiteTimeZone(): Promise<string | undefined>;
191
+ export declare function getSiteTimeZone(options?: WixCallOptions): Promise<string | undefined>;
152
192
  export type SemanticFieldType = "STRING" | "NUMBER" | "BOOLEAN" | "DATE" | "DATE_TIME" | "OBJECT" | "ARRAY";
153
193
  export type FilterPrefix = "IS" | "NOT";
154
194
  export type FilterCondition = "EQUAL" | "GREATER_THAN" | "GREATER_THAN_OR_EQUAL" | "LESS_THAN" | "LESS_THAN_OR_EQUAL" | "NULL" | "EMPTY" | "START_WITH" | "END_WITH" | "CONTAINS_ANY" | "CONTAINS_ALL" | "RANGE_II" | "RANGE_IE" | "RANGE_EI" | "RANGE_EE";
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  /** Send a typed request through the host's authenticated Wix API bridge.
19
38
  * The host supplies the owner session; callers supply the HTTP method, gateway path and optional body.
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  /** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  /** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  /** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or
@@ -1,6 +1,7 @@
1
+ import { type WixCallOptions } from "./index.js";
1
2
  import type { WixPost, WixRichContent, WixDraftPostWrite, WixDraftPost, WixGetDraftPostResponse, WixCreateDraftPostResponse, WixUpdateDraftPostResponse, WixDeleteDraftPostResponse } from "./index.js";
2
3
  /** Fetch a single draft post by id — the editor/settings prefill source. */
3
- export declare function getDraftPost(postId: string): Promise<WixGetDraftPostResponse>;
4
+ export declare function getDraftPost(postId: string, options?: WixCallOptions): Promise<WixGetDraftPostResponse>;
4
5
  /** A published post that MAY carry its body. The generated `WixPost` is the
5
6
  * list projection (no body), so the body-bearing fields live here on the read
6
7
  * shape `getPost` returns once the body fieldsets are requested. */
@@ -49,7 +50,7 @@ export interface WixGetPostRequest {
49
50
  * `catch`, or an `allSettled` filter), so rejecting is what routes them into the
50
51
  * graceful degrade they already implement. The originating failure travels as
51
52
  * `cause`, so the 404-vs-network distinction is not lost. */
52
- export declare function getPost(postId: string, req?: WixGetPostRequest): Promise<WixGetPostResponse>;
53
+ export declare function getPost(postId: string, req?: WixGetPostRequest, readOptions?: WixCallOptions): Promise<WixGetPostResponse>;
53
54
  export interface WixBlogCategory {
54
55
  id: string;
55
56
  label?: string;
@@ -67,7 +68,7 @@ export declare function queryCategories(req?: {
67
68
  limit?: number;
68
69
  offset?: number;
69
70
  };
70
- }): Promise<WixQueryCategoriesResponse>;
71
+ }, opts?: WixCallOptions): Promise<WixQueryCategoriesResponse>;
71
72
  /** Create a draft post — POST /draft-posts. `title` + `richContent` are the core fields. */
72
73
  export declare function createDraftPost(draftPost: WixDraftPostWrite): Promise<WixCreateDraftPostResponse>;
73
74
  /** Update a draft post — PATCH /draft-posts/{id}. Only the supplied fields change.
@@ -110,6 +111,6 @@ export interface WixQueryDraftPostsResponse {
110
111
  offset?: number;
111
112
  };
112
113
  }
113
- export declare function queryDraftPosts(req?: WixQueryDraftPostsRequest): Promise<WixQueryDraftPostsResponse>;
114
+ export declare function queryDraftPosts(req?: WixQueryDraftPostsRequest, opts?: WixCallOptions): Promise<WixQueryDraftPostsResponse>;
114
115
  /** Cancel a post's schedule — PATCH /draft-posts/{id} {action:"UPDATE_CANCEL_SCHEDULE"}. */
115
116
  export declare function cancelScheduleDraftPost(postId: string): Promise<WixUpdateDraftPostResponse>;
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  export interface WixBlogPaging {
@@ -125,7 +125,7 @@ export interface WixQueryServicesResponse {
125
125
  * PUBLIC GA route (audience MEMBERS_AND_VISITORS), so a visitor/consumer token can
126
126
  * read it — NOT the owner/BO `_api/` gateway (which fails for visitors, #463). Takes
127
127
  * the standard query envelope (filter/sort/paging). */
128
- export declare function queryServices(req?: WixQueryServicesRequest): Promise<WixQueryServicesResponse>;
128
+ export declare function queryServices(req?: WixQueryServicesRequest, readOptions?: WixCallOptions): Promise<WixQueryServicesResponse>;
129
129
  /** One service category, as the categories query returns it. `sortOrder` is the business's
130
130
  * own order; the response is already in it. */
131
131
  export interface WixServiceCategory {
@@ -151,7 +151,7 @@ export interface WixGetServiceResponse {
151
151
  * ("STAFF_MEMBER_DETAILS", "DISCOUNT_INFO_DETAILS"), each sent as a repeated
152
152
  * `conditionalFields` query parameter. Without `options` the request is the one this
153
153
  * function always sent. */
154
- export declare function getService(serviceId: string, options?: WixGetServiceOptions): Promise<WixGetServiceResponse>;
154
+ export declare function getService(serviceId: string, options?: WixGetServiceOptions & WixCallOptions): Promise<WixGetServiceResponse>;
155
155
  /** Writable service fields for create/update, in the ERGONOMIC shape a form has. The helpers
156
156
  * below encode it onto the Bookings v2 entity — they never send these flat fields as-is,
157
157
  * because v2 silently ignores a flat `price`/`duration` (HTTP 200, revision bumps, nothing
@@ -370,7 +370,7 @@ export interface WixServiceAvailabilityOptions {
370
370
  * worked. Narrow the window instead, until the level can be confirmed against a
371
371
  * schema or a live call.
372
372
  */
373
- export declare function queryServiceAvailability(serviceId: string, startDate: string, endDate: string, options?: WixServiceAvailabilityOptions): Promise<WixQueryAvailabilityResponse>;
373
+ export declare function queryServiceAvailability(serviceId: string, startDate: string, endDate: string, options?: WixServiceAvailabilityOptions, readOptions?: WixCallOptions): Promise<WixQueryAvailabilityResponse>;
374
374
  export interface WixResource {
375
375
  id?: string;
376
376
  name?: string;
@@ -514,7 +514,7 @@ export interface WixGetBookingFullResponse {
514
514
  * booking (payment/intake/location/staff/attendance). The booking-detail data source.
515
515
  * Owner-scoped: needs an owner/BO session; a visitor or member token gets 403. A
516
516
  * member-facing screen reads its own bookings via `queryBookings` instead. */
517
- export declare function getBookingFull(bookingId: string): Promise<WixGetBookingFullResponse>;
517
+ export declare function getBookingFull(bookingId: string, options?: WixCallOptions): Promise<WixGetBookingFullResponse>;
518
518
  /** Set attendance for a booking (class/course check-in / no-show) —
519
519
  * POST /bookings/v1/bookings/{id}/setAttendance. Body repeats bookingId +
520
520
  * attendanceInfo {attendanceStatus, numberOfAttendees}. Confirmed against the
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  /** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  /** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -21,7 +32,17 @@ export declare function chatWebError(code: ChatWebErrorCode, message: string, ca
21
32
  /** Returns whether a value is a typed Wix chat SDK error. */
22
33
  export declare function isChatWebError(e: unknown): e is ChatWebError;
23
34
  export type ChatRole = "owner" | "member";
24
- export interface ChatOptions {
35
+ export interface WixCallOptions {
36
+ /** Cache-only reads never use the network; reload waits for a successful server response. */
37
+ cache?: "default" | "only-if-cached" | "reload";
38
+ onCacheResult?: (metadata: {
39
+ source: "cache" | "network";
40
+ fetchedAt: number;
41
+ expiresAt?: number;
42
+ cacheable: boolean;
43
+ }) => void;
44
+ }
45
+ export interface ChatOptions extends WixCallOptions {
25
46
  /** `owner` (default) mints with isForUnifiedList=true; `member` with false. */
26
47
  role?: ChatRole;
27
48
  /** A caller-supplied chatToken; skips the mint. Never stored by this module. */
@@ -2,6 +2,17 @@ declare global {
2
2
  var himalaya: {
3
3
  wixApi?: {
4
4
  call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown>;
5
+ read?: (method: string, path: string, body: unknown, headers: Record<string, string> | undefined, options: {
6
+ cache: string;
7
+ }) => Promise<{
8
+ data: unknown;
9
+ cache: {
10
+ source: "cache" | "network";
11
+ fetchedAt: number;
12
+ expiresAt?: number;
13
+ cacheable: boolean;
14
+ };
15
+ }>;
5
16
  };
6
17
  };
7
18
  }
@@ -14,6 +25,14 @@ declare global {
14
25
  * it can be passed straight through: `someMethod(req, site.forSite(msid))`. */
15
26
  export interface WixCallOptions {
16
27
  site?: string;
28
+ /** Explicit cache reads never touch the network; reload waits for a server response. */
29
+ cache?: "default" | "only-if-cached" | "reload";
30
+ onCacheResult?: (metadata: {
31
+ source: "cache" | "network";
32
+ fetchedAt: number;
33
+ expiresAt?: number;
34
+ cacheable: boolean;
35
+ }) => void;
17
36
  }
18
37
  export declare function wixCall<T>(method: string, path: string, body?: unknown, opts?: WixCallOptions): Promise<T>;
19
38
  /** `path` with `req` appended as the query string Wix's RPC gateway reads a GET or