@wix/himalaya-cli 0.1589.0 → 0.1591.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 (178) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/wix-platform/src/index.d.ts +9 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +9 -5
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +9 -8
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-platform.mjs +2 -0
  5. package/dist/cli.mjs +90 -48
  6. package/dist/preview-assets.generated.bin +0 -0
  7. package/guides/one-app-to-himi-app.md +18 -4
  8. package/guides/sdk-reference.json +14 -2
  9. package/guides/tier-5-add-a-screen.md +48 -0
  10. package/package.json +2 -2
  11. package/templates/beauty-salon/tier5-src/_shared/app-locale.ts +61 -0
  12. package/templates/beauty-salon/tier5-src/_shared/engine-intl.ts +5 -3
  13. package/templates/beauty-salon/tier5-src/_shared/group-member-count.ts +15 -0
  14. package/templates/beauty-salon/tier5-src/_shared/himi-bookings.ts +54 -13
  15. package/templates/beauty-salon/tier5-src/_shared/himi-copy.ts +10 -2
  16. package/templates/beauty-salon/tier5-src/_shared/himi-restaurants.ts +2 -2
  17. package/templates/beauty-salon/tier5-src/_shared/restaurant-ordering.ts +1 -1
  18. package/templates/beauty-salon/tier5-src/_shared/wix-service-price.ts +2 -2
  19. package/templates/beauty-salon/tier5-src/himi-booking-services/index.ts +8 -3
  20. package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  21. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +2 -1
  22. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  23. package/templates/beauty-salon-owner/tier5-src/_shared/app-locale.ts +61 -0
  24. package/templates/beauty-salon-owner/tier5-src/_shared/engine-intl.ts +5 -3
  25. package/templates/beauty-salon-owner/tier5-src/_shared/himi-copy.ts +10 -2
  26. package/templates/branded-lite/tier5-src/_shared/app-locale.ts +61 -0
  27. package/templates/branded-lite/tier5-src/_shared/engine-intl.ts +5 -3
  28. package/templates/branded-lite/tier5-src/_shared/group-member-count.ts +15 -0
  29. package/templates/branded-lite/tier5-src/_shared/himi-bookings.ts +54 -13
  30. package/templates/branded-lite/tier5-src/_shared/himi-copy.ts +10 -2
  31. package/templates/branded-lite/tier5-src/_shared/himi-restaurants.ts +2 -2
  32. package/templates/branded-lite/tier5-src/_shared/restaurant-ordering.ts +1 -1
  33. package/templates/branded-lite/tier5-src/_shared/wix-service-price.ts +2 -2
  34. package/templates/branded-lite/tier5-src/himi-booking-services/index.ts +8 -3
  35. package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  36. package/templates/branded-lite/tier5-src/himi-branded-lite-group/index.ts +9 -3
  37. package/templates/branded-lite/tier5-src/himi-branded-lite-group-about/index.ts +2 -1
  38. package/templates/branded-lite/tier5-src/himi-branded-lite-groups/index.ts +6 -2
  39. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +2 -1
  40. package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty/index.ts +3 -2
  41. package/templates/branded-lite/tier5-src/himi-branded-lite-my-groups/index.ts +2 -1
  42. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  43. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +1 -1
  44. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +5 -5
  45. package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +5 -1
  46. package/templates/brandy/tier5-src/_shared/app-locale.ts +61 -0
  47. package/templates/brandy/tier5-src/_shared/himi-copy.ts +10 -2
  48. package/templates/community-club/tier5-src/_shared/app-locale.ts +61 -0
  49. package/templates/community-club/tier5-src/_shared/engine-intl.ts +5 -3
  50. package/templates/community-club/tier5-src/_shared/group-member-count.ts +15 -0
  51. package/templates/community-club/tier5-src/_shared/himi-copy.ts +10 -2
  52. package/templates/community-club/tier5-src/_shared/himi-restaurants.ts +2 -2
  53. package/templates/community-club/tier5-src/_shared/wix-service-price.ts +2 -2
  54. package/templates/community-club/tier5-src/himi-branded-lite-group/index.ts +9 -3
  55. package/templates/community-club/tier5-src/himi-branded-lite-group-about/index.ts +2 -1
  56. package/templates/community-club/tier5-src/himi-branded-lite-groups/index.ts +6 -2
  57. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +2 -1
  58. package/templates/community-club/tier5-src/himi-branded-lite-my-groups/index.ts +2 -1
  59. package/templates/community-club/tier5-src/himi-events-detail/index.ts +5 -5
  60. package/templates/community-club-owner/tier5-src/_shared/app-locale.ts +61 -0
  61. package/templates/community-club-owner/tier5-src/_shared/engine-intl.ts +5 -3
  62. package/templates/community-club-owner/tier5-src/_shared/himi-copy.ts +10 -2
  63. package/templates/events-meetups/tier5-src/_shared/app-locale.ts +61 -0
  64. package/templates/events-meetups/tier5-src/_shared/engine-intl.ts +5 -3
  65. package/templates/events-meetups/tier5-src/_shared/group-member-count.ts +15 -0
  66. package/templates/events-meetups/tier5-src/_shared/himi-copy.ts +10 -2
  67. package/templates/events-meetups/tier5-src/_shared/himi-restaurants.ts +2 -2
  68. package/templates/events-meetups/tier5-src/_shared/wix-service-price.ts +2 -2
  69. package/templates/events-meetups/tier5-src/himi-branded-lite-group/index.ts +9 -3
  70. package/templates/events-meetups/tier5-src/himi-branded-lite-group-about/index.ts +2 -1
  71. package/templates/events-meetups/tier5-src/himi-branded-lite-groups/index.ts +6 -2
  72. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +2 -1
  73. package/templates/events-meetups/tier5-src/himi-branded-lite-my-groups/index.ts +2 -1
  74. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +5 -5
  75. package/templates/events-meetups-owner/tier5-src/_shared/app-locale.ts +61 -0
  76. package/templates/events-meetups-owner/tier5-src/_shared/engine-intl.ts +5 -3
  77. package/templates/events-meetups-owner/tier5-src/_shared/himi-copy.ts +10 -2
  78. package/templates/gym-fitness/tier5-src/_shared/app-locale.ts +61 -0
  79. package/templates/gym-fitness/tier5-src/_shared/engine-intl.ts +5 -3
  80. package/templates/gym-fitness/tier5-src/_shared/group-member-count.ts +15 -0
  81. package/templates/gym-fitness/tier5-src/_shared/himi-bookings.ts +54 -13
  82. package/templates/gym-fitness/tier5-src/_shared/himi-copy.ts +10 -2
  83. package/templates/gym-fitness/tier5-src/_shared/himi-restaurants.ts +2 -2
  84. package/templates/gym-fitness/tier5-src/_shared/restaurant-ordering.ts +1 -1
  85. package/templates/gym-fitness/tier5-src/_shared/wix-service-price.ts +2 -2
  86. package/templates/gym-fitness/tier5-src/himi-booking-services/index.ts +8 -3
  87. package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  88. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +2 -1
  89. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  90. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +5 -5
  91. package/templates/gym-fitness-owner/tier5-src/_shared/app-locale.ts +61 -0
  92. package/templates/gym-fitness-owner/tier5-src/_shared/engine-intl.ts +5 -3
  93. package/templates/gym-fitness-owner/tier5-src/_shared/himi-copy.ts +10 -2
  94. package/templates/himi-chat/tier5-src/_shared/app-locale.ts +61 -0
  95. package/templates/himi-chat/tier5-src/_shared/himi-copy.ts +10 -2
  96. package/templates/nonprofit-cause/tier5-src/_shared/app-locale.ts +61 -0
  97. package/templates/nonprofit-cause/tier5-src/_shared/engine-intl.ts +5 -3
  98. package/templates/nonprofit-cause/tier5-src/_shared/group-member-count.ts +15 -0
  99. package/templates/nonprofit-cause/tier5-src/_shared/himi-copy.ts +10 -2
  100. package/templates/nonprofit-cause/tier5-src/_shared/himi-restaurants.ts +2 -2
  101. package/templates/nonprofit-cause/tier5-src/_shared/wix-service-price.ts +2 -2
  102. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-group/index.ts +9 -3
  103. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-group-about/index.ts +2 -1
  104. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-groups/index.ts +6 -2
  105. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +2 -1
  106. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-my-groups/index.ts +2 -1
  107. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  108. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +5 -5
  109. package/templates/nonprofit-cause-owner/tier5-src/_shared/app-locale.ts +61 -0
  110. package/templates/nonprofit-cause-owner/tier5-src/_shared/engine-intl.ts +5 -3
  111. package/templates/nonprofit-cause-owner/tier5-src/_shared/himi-copy.ts +10 -2
  112. package/templates/owner-lite/tier5-src/_shared/app-locale.ts +61 -0
  113. package/templates/owner-lite/tier5-src/_shared/engine-intl.ts +5 -3
  114. package/templates/owner-lite/tier5-src/_shared/himi-copy.ts +10 -2
  115. package/templates/podcast-creator/tier5-src/_shared/app-locale.ts +61 -0
  116. package/templates/podcast-creator/tier5-src/_shared/engine-intl.ts +5 -3
  117. package/templates/podcast-creator/tier5-src/_shared/group-member-count.ts +15 -0
  118. package/templates/podcast-creator/tier5-src/_shared/himi-copy.ts +10 -2
  119. package/templates/podcast-creator/tier5-src/_shared/himi-restaurants.ts +2 -2
  120. package/templates/podcast-creator/tier5-src/_shared/wix-service-price.ts +2 -2
  121. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +2 -1
  122. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  123. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +5 -5
  124. package/templates/podcast-creator-owner/tier5-src/_shared/app-locale.ts +61 -0
  125. package/templates/podcast-creator-owner/tier5-src/_shared/engine-intl.ts +5 -3
  126. package/templates/podcast-creator-owner/tier5-src/_shared/himi-copy.ts +10 -2
  127. package/templates/portfolio-creative/tier5-src/_shared/app-locale.ts +61 -0
  128. package/templates/portfolio-creative/tier5-src/_shared/engine-intl.ts +5 -3
  129. package/templates/portfolio-creative/tier5-src/_shared/group-member-count.ts +15 -0
  130. package/templates/portfolio-creative/tier5-src/_shared/himi-copy.ts +10 -2
  131. package/templates/portfolio-creative/tier5-src/_shared/himi-restaurants.ts +2 -2
  132. package/templates/portfolio-creative/tier5-src/_shared/restaurant-ordering.ts +1 -1
  133. package/templates/portfolio-creative/tier5-src/_shared/wix-service-price.ts +2 -2
  134. package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  135. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +2 -1
  136. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +5 -5
  137. package/templates/portfolio-creative-owner/tier5-src/_shared/app-locale.ts +61 -0
  138. package/templates/portfolio-creative-owner/tier5-src/_shared/engine-intl.ts +5 -3
  139. package/templates/portfolio-creative-owner/tier5-src/_shared/himi-copy.ts +10 -2
  140. package/templates/restaurant/tier5-src/_shared/app-locale.ts +61 -0
  141. package/templates/restaurant/tier5-src/_shared/engine-intl.ts +5 -3
  142. package/templates/restaurant/tier5-src/_shared/group-member-count.ts +15 -0
  143. package/templates/restaurant/tier5-src/_shared/himi-copy.ts +10 -2
  144. package/templates/restaurant/tier5-src/_shared/himi-restaurants.ts +2 -2
  145. package/templates/restaurant/tier5-src/_shared/restaurant-ordering.ts +1 -1
  146. package/templates/restaurant/tier5-src/_shared/wix-service-price.ts +2 -2
  147. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +2 -1
  148. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +5 -5
  149. package/templates/restaurant-owner/tier5-src/_shared/app-locale.ts +61 -0
  150. package/templates/restaurant-owner/tier5-src/_shared/engine-intl.ts +5 -3
  151. package/templates/restaurant-owner/tier5-src/_shared/himi-copy.ts +10 -2
  152. package/templates/retail-store/tier5-src/_shared/app-locale.ts +61 -0
  153. package/templates/retail-store/tier5-src/_shared/engine-intl.ts +5 -3
  154. package/templates/retail-store/tier5-src/_shared/group-member-count.ts +15 -0
  155. package/templates/retail-store/tier5-src/_shared/himi-copy.ts +10 -2
  156. package/templates/retail-store/tier5-src/_shared/himi-restaurants.ts +2 -2
  157. package/templates/retail-store/tier5-src/_shared/restaurant-ordering.ts +1 -1
  158. package/templates/retail-store/tier5-src/_shared/wix-service-price.ts +2 -2
  159. package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  160. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +2 -1
  161. package/templates/retail-store-owner/tier5-src/_shared/app-locale.ts +61 -0
  162. package/templates/retail-store-owner/tier5-src/_shared/engine-intl.ts +5 -3
  163. package/templates/retail-store-owner/tier5-src/_shared/himi-copy.ts +10 -2
  164. package/templates/yoga-studio/tier5-src/_shared/app-locale.ts +61 -0
  165. package/templates/yoga-studio/tier5-src/_shared/engine-intl.ts +5 -3
  166. package/templates/yoga-studio/tier5-src/_shared/group-member-count.ts +15 -0
  167. package/templates/yoga-studio/tier5-src/_shared/himi-bookings.ts +54 -13
  168. package/templates/yoga-studio/tier5-src/_shared/himi-copy.ts +10 -2
  169. package/templates/yoga-studio/tier5-src/_shared/himi-restaurants.ts +2 -2
  170. package/templates/yoga-studio/tier5-src/_shared/wix-service-price.ts +2 -2
  171. package/templates/yoga-studio/tier5-src/himi-booking-services/index.ts +8 -3
  172. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +2 -1
  173. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  174. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +1 -1
  175. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +5 -5
  176. package/templates/yoga-studio-owner/tier5-src/_shared/app-locale.ts +61 -0
  177. package/templates/yoga-studio-owner/tier5-src/_shared/engine-intl.ts +5 -3
  178. package/templates/yoga-studio-owner/tier5-src/_shared/himi-copy.ts +10 -2
@@ -87,6 +87,15 @@ export interface WixIdentity {
87
87
  userId: string | null;
88
88
  email: string | null;
89
89
  }
90
+ /** The reserved action a worker defines to hear sign-in, sign-out and
91
+ * member switch while it is alive: `actions: { [IDENTITY_CHANGE_ACTION]: (s, c: IdentityChange) => … }`.
92
+ * Ambient: a returned `_nav` is dropped. Bounded at 2 s, and runs before a sign-out's purge. */
93
+ export declare const IDENTITY_CHANGE_ACTION = "onIdentityChange";
94
+ /** The `onIdentityChange` argument. `userId` is null whenever `signedIn` is false. */
95
+ export interface IdentityChange {
96
+ signedIn: boolean;
97
+ userId: string | null;
98
+ }
90
99
  export declare const auth: {
91
100
  /** Current identity (visitor vs member vs owner) + who. */
92
101
  getIdentity(): Promise<WixIdentity>;
@@ -200,8 +200,9 @@ export interface WixActivityCountersQueryResponse {
200
200
  activityCounters?: WixActivityCounter[];
201
201
  }
202
202
  export interface WixFollowCounts {
203
- followers: number;
204
- following: number;
203
+ /** `null` when Wix returned no total for this direction: unavailable, never an assumed 0. */
204
+ followers: number | null;
205
+ following: number | null;
205
206
  }
206
207
  export interface WixMemberConnection {
207
208
  memberId?: string;
@@ -212,9 +213,12 @@ export interface WixMyConnectionsResponse {
212
213
  connectedMembers?: WixMemberConnection[];
213
214
  }
214
215
  /** Followers / following totals for a member — POST
215
- * /members/v1/activity-counters/query. Requires explicit nonnegative safe integer
216
- * totals for this member's Followers-app entry. Missing/invalid totals reject,
217
- * as do permission failures; callers should hide unavailable counts, never invent zero. */
216
+ * /members/v1/activity-counters/query. Wix keeps ONE counter per direction and creates it on the
217
+ * first change (live, amit1: a followed member's entry holds only `followerCount`, the follower's
218
+ * only `followingCount`), so each direction is reported on its own: an explicit nonnegative safe
219
+ * integer, or `null` when Wix returned none. A counter that is present but malformed makes the
220
+ * whole answer untrusted and rejects, as does an entry with neither counter or a permission
221
+ * failure. Callers hide an unavailable counter; a missing one is never shown as zero. */
218
222
  export declare function getFollowCounts(memberId: string, options?: WixCallOptions): Promise<WixFollowCounts>;
219
223
  /** Whether the signed-in member follows `targetId` — POST
220
224
  * /members/v3/followers/my/connections. Returns false on any miss. May 403 →
@@ -87,15 +87,16 @@ async function getFollowCounts(memberId, options) {
87
87
  const entry = (res.activityCounters ?? []).find((c) => c.appId === MEMBERS_FOLLOWERS_APP_ID && c.memberId === memberId);
88
88
  const counters = entry?.counters;
89
89
  const value = (key) => Array.isArray(counters) ? counters.find((counter) => counter?.key === key)?.count : counters?.[key]?.count;
90
- const followers = value("followerCount");
91
- const following = value("followingCount");
92
- if (typeof followers !== "number" || !Number.isSafeInteger(followers) || followers < 0 || typeof following !== "number" || !Number.isSafeInteger(following) || following < 0) {
93
- throw new Error("getFollowCounts: explicit member totals are unavailable");
94
- }
95
- return {
96
- followers,
97
- following
90
+ const total = (key) => {
91
+ const count = value(key);
92
+ if (count === void 0 || count === null) return null;
93
+ if (typeof count !== "number" || !Number.isSafeInteger(count) || count < 0) throw new Error("getFollowCounts: a member total is malformed");
94
+ return count;
98
95
  };
96
+ const followers = total("followerCount");
97
+ const following = total("followingCount");
98
+ if (followers === null && following === null) throw new Error("getFollowCounts: explicit member totals are unavailable");
99
+ return { followers, following };
99
100
  }
100
101
  async function isFollowingMember(targetId) {
101
102
  if (!targetId) throw new Error("isFollowingMember: targetId is required");
@@ -216,6 +216,7 @@ var session = {
216
216
  return { present: r?.present ?? false, msid: r?.msid ?? null };
217
217
  }
218
218
  };
219
+ var IDENTITY_CHANGE_ACTION = "onIdentityChange";
219
220
  var AUTH_REFUSAL_CODES = /* @__PURE__ */ new Set(["cancelled", "sign_in_in_progress", "sign_in_unavailable"]);
220
221
  async function authTransition(method, params) {
221
222
  const r = await call2(method, params).catch((e) => {
@@ -418,6 +419,7 @@ var monitoring = {
418
419
  };
419
420
  var version = 2;
420
421
  export {
422
+ IDENTITY_CHANGE_ACTION,
421
423
  auth,
422
424
  bi,
423
425
  deeplink,