@wix/himalaya-cli 0.1323.0 → 0.1325.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 (193) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/checkout/src/index.d.ts +6 -10
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/order-refs.d.ts +1 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/purchase-fields.d.ts +1 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +9 -35
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/extensions.d.ts +79 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/extensions.d.ts +221 -14
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/index.d.ts +0 -2
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +38 -21
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/display.d.ts +1 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +30 -13
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +20 -2
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +2890 -54
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +80 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +45 -17
  15. package/dist/cli.mjs +5 -4
  16. package/fixtures/wix-canned.json +61 -6
  17. package/guides/iap-pricing.md +9 -0
  18. package/guides/iap-screen-adoption.md +77 -0
  19. package/guides/importable-sdks.md +2 -0
  20. package/guides/index.json +6 -0
  21. package/guides/release-notes.md +25 -0
  22. package/guides/sdk-reference.json +539 -32
  23. package/guides/wix-api-usage.md +5 -0
  24. package/package.json +2 -2
  25. package/templates/beauty-salon/config.ts +1 -1
  26. package/templates/beauty-salon/dev/index.ts +46 -18
  27. package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +1 -1
  28. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +3 -2
  29. package/templates/beauty-salon/tier5-src/_shared/himi-store-collection.ts +1 -1
  30. package/templates/beauty-salon/tier5-src/_shared/home-service.ts +2 -1
  31. package/templates/beauty-salon/tier5-src/_shared/iap-presentation.ts +53 -0
  32. package/templates/beauty-salon/tier5-src/_shared/iap-worker.ts +42 -0
  33. package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +48 -1
  34. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +16 -2
  35. package/templates/beauty-salon/tier5-src/himi-branded-lite-order/index.ts +24 -3
  36. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +153 -64
  37. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +24 -3
  38. package/templates/beauty-salon/tier5-src/himi-store-saved/index.ts +8 -3
  39. package/templates/beauty-salon/tier5-src/himi-store-shop/index.ts +10 -0
  40. package/templates/beauty-salon/tier5-src/wix-spaces-plan-detail/index.ts +8 -3
  41. package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +1 -1
  42. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +3 -2
  43. package/templates/beauty-salon-owner/tier5-src/_shared/home-service.ts +2 -1
  44. package/templates/branded-lite/config.ts +1 -8
  45. package/templates/branded-lite/dev/index.ts +46 -134
  46. package/templates/branded-lite/himalaya.content.json +0 -3
  47. package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +1 -1
  48. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +3 -2
  49. package/templates/branded-lite/tier5-src/_shared/himi-store-collection.ts +1 -1
  50. package/templates/branded-lite/tier5-src/_shared/home-service.ts +2 -1
  51. package/templates/branded-lite/tier5-src/_shared/iap-presentation.ts +53 -0
  52. package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +48 -1
  53. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +16 -2
  54. package/templates/branded-lite/tier5-src/himi-branded-lite-order/index.ts +24 -3
  55. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +153 -64
  56. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +24 -3
  57. package/templates/branded-lite/tier5-src/himi-store-saved/index.ts +8 -3
  58. package/templates/branded-lite/tier5-src/himi-store-shop/index.ts +10 -0
  59. package/templates/branded-lite/tier5-src/wix-spaces-plan-detail/index.ts +8 -3
  60. package/templates/community-club/config.ts +1 -8
  61. package/templates/community-club/dev/index.ts +3 -117
  62. package/templates/community-club/himalaya.content.json +0 -3
  63. package/templates/community-club/tier5-src/_shared/collection-contract.ts +1 -1
  64. package/templates/community-club/tier5-src/_shared/collection-service.ts +3 -2
  65. package/templates/community-club/tier5-src/_shared/home-service.ts +2 -1
  66. package/templates/community-club/tier5-src/_shared/iap-presentation.ts +53 -0
  67. package/templates/community-club/tier5-src/_shared/iap-worker.ts +42 -0
  68. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +16 -2
  69. package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +1 -1
  70. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +3 -2
  71. package/templates/community-club-owner/tier5-src/_shared/home-service.ts +2 -1
  72. package/templates/events-meetups/config.ts +1 -8
  73. package/templates/events-meetups/dev/index.ts +3 -117
  74. package/templates/events-meetups/himalaya.content.json +0 -3
  75. package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +1 -1
  76. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +3 -2
  77. package/templates/events-meetups/tier5-src/_shared/home-service.ts +2 -1
  78. package/templates/events-meetups/tier5-src/_shared/iap-presentation.ts +53 -0
  79. package/templates/events-meetups/tier5-src/_shared/iap-worker.ts +42 -0
  80. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +16 -2
  81. package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +1 -1
  82. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +3 -2
  83. package/templates/events-meetups-owner/tier5-src/_shared/home-service.ts +2 -1
  84. package/templates/gym-fitness/config.ts +1 -1
  85. package/templates/gym-fitness/dev/index.ts +46 -18
  86. package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +1 -1
  87. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +3 -2
  88. package/templates/gym-fitness/tier5-src/_shared/himi-store-collection.ts +1 -1
  89. package/templates/gym-fitness/tier5-src/_shared/home-service.ts +2 -1
  90. package/templates/gym-fitness/tier5-src/_shared/iap-presentation.ts +53 -0
  91. package/templates/gym-fitness/tier5-src/_shared/iap-worker.ts +42 -0
  92. package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +48 -1
  93. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +16 -2
  94. package/templates/gym-fitness/tier5-src/himi-branded-lite-order/index.ts +24 -3
  95. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +153 -64
  96. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +24 -3
  97. package/templates/gym-fitness/tier5-src/himi-store-saved/index.ts +8 -3
  98. package/templates/gym-fitness/tier5-src/himi-store-shop/index.ts +10 -0
  99. package/templates/gym-fitness/tier5-src/wix-spaces-plan-detail/index.ts +8 -3
  100. package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +1 -1
  101. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +3 -2
  102. package/templates/gym-fitness-owner/tier5-src/_shared/home-service.ts +2 -1
  103. package/templates/nonprofit-cause/config.ts +1 -8
  104. package/templates/nonprofit-cause/dev/index.ts +29 -129
  105. package/templates/nonprofit-cause/himalaya.content.json +0 -3
  106. package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +1 -1
  107. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +3 -2
  108. package/templates/nonprofit-cause/tier5-src/_shared/home-service.ts +2 -1
  109. package/templates/nonprofit-cause/tier5-src/_shared/iap-presentation.ts +53 -0
  110. package/templates/nonprofit-cause/tier5-src/_shared/iap-worker.ts +42 -0
  111. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +16 -2
  112. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +153 -64
  113. package/templates/nonprofit-cause/tier5-src/wix-spaces-plan-detail/index.ts +8 -3
  114. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +1 -1
  115. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +3 -2
  116. package/templates/nonprofit-cause-owner/tier5-src/_shared/home-service.ts +2 -1
  117. package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +1 -1
  118. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +3 -2
  119. package/templates/owner-lite/tier5-src/_shared/home-service.ts +2 -1
  120. package/templates/podcast-creator/config.ts +1 -1
  121. package/templates/podcast-creator/dev/index.ts +29 -13
  122. package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +1 -1
  123. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +3 -2
  124. package/templates/podcast-creator/tier5-src/_shared/home-service.ts +2 -1
  125. package/templates/podcast-creator/tier5-src/_shared/iap-presentation.ts +53 -0
  126. package/templates/podcast-creator/tier5-src/_shared/iap-worker.ts +42 -0
  127. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +16 -2
  128. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +153 -64
  129. package/templates/podcast-creator/tier5-src/wix-spaces-plan-detail/index.ts +8 -3
  130. package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +1 -1
  131. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +3 -2
  132. package/templates/podcast-creator-owner/tier5-src/_shared/home-service.ts +2 -1
  133. package/templates/portfolio-creative/config.ts +1 -1
  134. package/templates/portfolio-creative/dev/index.ts +20 -6
  135. package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +1 -1
  136. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +3 -2
  137. package/templates/portfolio-creative/tier5-src/_shared/himi-store-collection.ts +1 -1
  138. package/templates/portfolio-creative/tier5-src/_shared/home-service.ts +2 -1
  139. package/templates/portfolio-creative/tier5-src/_shared/iap-presentation.ts +53 -0
  140. package/templates/portfolio-creative/tier5-src/_shared/iap-worker.ts +42 -0
  141. package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +48 -1
  142. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +16 -2
  143. package/templates/portfolio-creative/tier5-src/himi-branded-lite-order/index.ts +24 -3
  144. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +24 -3
  145. package/templates/portfolio-creative/tier5-src/himi-store-saved/index.ts +8 -3
  146. package/templates/portfolio-creative/tier5-src/himi-store-shop/index.ts +10 -0
  147. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +1 -1
  148. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +3 -2
  149. package/templates/portfolio-creative-owner/tier5-src/_shared/home-service.ts +2 -1
  150. package/templates/restaurant/config.ts +1 -1
  151. package/templates/restaurant/dev/index.ts +3 -1
  152. package/templates/restaurant/tier5-src/_shared/collection-contract.ts +1 -1
  153. package/templates/restaurant/tier5-src/_shared/collection-service.ts +3 -2
  154. package/templates/restaurant/tier5-src/_shared/home-service.ts +2 -1
  155. package/templates/restaurant/tier5-src/_shared/iap-presentation.ts +53 -0
  156. package/templates/restaurant/tier5-src/_shared/iap-worker.ts +42 -0
  157. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +16 -2
  158. package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +1 -1
  159. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +3 -2
  160. package/templates/restaurant-owner/tier5-src/_shared/home-service.ts +2 -1
  161. package/templates/retail-store/config.ts +1 -1
  162. package/templates/retail-store/dev/index.ts +20 -6
  163. package/templates/retail-store/tier5-src/_shared/collection-contract.ts +1 -1
  164. package/templates/retail-store/tier5-src/_shared/collection-service.ts +3 -2
  165. package/templates/retail-store/tier5-src/_shared/himi-store-collection.ts +1 -1
  166. package/templates/retail-store/tier5-src/_shared/home-service.ts +2 -1
  167. package/templates/retail-store/tier5-src/_shared/iap-presentation.ts +53 -0
  168. package/templates/retail-store/tier5-src/_shared/iap-worker.ts +42 -0
  169. package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +48 -1
  170. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +16 -2
  171. package/templates/retail-store/tier5-src/himi-branded-lite-order/index.ts +24 -3
  172. package/templates/retail-store/tier5-src/himi-store-product/index.ts +24 -3
  173. package/templates/retail-store/tier5-src/himi-store-saved/index.ts +8 -3
  174. package/templates/retail-store/tier5-src/himi-store-shop/index.ts +10 -0
  175. package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +1 -1
  176. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +3 -2
  177. package/templates/retail-store-owner/tier5-src/_shared/home-service.ts +2 -1
  178. package/templates/yoga-studio/config.ts +1 -1
  179. package/templates/yoga-studio/dev/index.ts +29 -13
  180. package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +1 -1
  181. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +3 -2
  182. package/templates/yoga-studio/tier5-src/_shared/home-service.ts +2 -1
  183. package/templates/yoga-studio/tier5-src/_shared/iap-presentation.ts +53 -0
  184. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +16 -2
  185. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +153 -64
  186. package/templates/yoga-studio/tier5-src/wix-spaces-plan-detail/index.ts +8 -3
  187. package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +1 -1
  188. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +3 -2
  189. package/templates/yoga-studio-owner/tier5-src/_shared/home-service.ts +2 -1
  190. package/templates/branded-lite/tier5-src/wix-spaces-create-group/index.ts +0 -29
  191. package/templates/community-club/tier5-src/wix-spaces-create-group/index.ts +0 -29
  192. package/templates/events-meetups/tier5-src/wix-spaces-create-group/index.ts +0 -29
  193. package/templates/nonprofit-cause/tier5-src/wix-spaces-create-group/index.ts +0 -29
@@ -2779,8 +2779,26 @@ var pricingPlanOrders = {
2779
2779
  eligibility: (item) => singleUnitOf(KIND2, item),
2780
2780
  openOrder: openOrder2,
2781
2781
  reopenOrder: reopenOrder2,
2782
- readAccess: readAccess2
2782
+ readAccess: readAccess2,
2783
+ currentAccess: currentAccess2
2783
2784
  };
2785
+ async function currentAccess2(item, bridge) {
2786
+ let pending = false;
2787
+ const pages = /* @__PURE__ */ new Set();
2788
+ for (let offset = 0; ; offset += 50) {
2789
+ const answer = await bridge.call("GET", `${MEMBER_ORDERS}?orderStatuses=ACTIVE&orderStatuses=PENDING&orderStatuses=DRAFT&limit=50&offset=${offset}`);
2790
+ if (isRefusal(answer)) return accessRefused(answer);
2791
+ const orders = answer.body?.orders;
2792
+ if (!Array.isArray(orders)) return "unavailable";
2793
+ const page = JSON.stringify(orders.map((order) => [order.id, order.planId, order.status]));
2794
+ if (orders.length === 50 && pages.has(page)) return "unavailable";
2795
+ pages.add(page);
2796
+ const selected = orders.filter((order) => order.planId === item.reference.id);
2797
+ if (selected.some((order) => order.status === "ACTIVE")) return "granted";
2798
+ pending || (pending = selected.some((order) => order.status === "PENDING" || order.status === "DRAFT"));
2799
+ if (orders.length < 50) return pending ? "pending" : "none";
2800
+ }
2801
+ }
2784
2802
  async function openOrder2(item, bridge) {
2785
2803
  const planId = item.reference.id;
2786
2804
  const preview = await bridge.call("POST", `${CHECKOUT}/preview-online`, { planId });
@@ -2805,7 +2823,7 @@ async function readAccess2(verticalRef, bridge) {
2805
2823
  }
2806
2824
  function accessOf2(order) {
2807
2825
  if (order.status === "ACTIVE") return "granted";
2808
- if (order.status === "PENDING") return order.lastPaymentStatus === "PAID" ? "granted" : "pending";
2826
+ if (order.status === "PENDING") return "pending";
2809
2827
  if (order.status === "DRAFT") return "pending";
2810
2828
  return NO_ACCESS.has(String(order.status)) ? "none" : "unavailable";
2811
2829
  }