@wix/himalaya-cli 0.1571.0 → 0.1573.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 (83) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +2 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/checkout/src/index.d.ts +4 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +1 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-contract.d.ts +2 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +1 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/one-app-page.d.ts +61 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-feed-viewer/src/index.d.ts +6 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +34 -9
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +28 -3
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +2 -1
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +573 -73
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members-feed-viewer.mjs +18 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-social-feed.mjs +24 -1
  14. package/dist/cli.mjs +466 -90
  15. package/dist/preview-assets.generated.bin +0 -0
  16. package/guides/index.json +7 -0
  17. package/guides/map-one-app-coverage.js +117 -0
  18. package/guides/one-app-to-himi-app.md +141 -7
  19. package/guides/recipe-one-app-coverage-mapping.md +74 -0
  20. package/guides/sdk-reference.json +34 -4
  21. package/guides/webview-page-sdk.md +68 -3
  22. package/package.json +2 -2
  23. package/templates/beauty-salon/tier5-src/_shared/iap-worker.ts +2 -0
  24. package/templates/beauty-salon/tier5-src/_shared/payment-setup.ts +6 -0
  25. package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +5 -2
  26. package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +5 -2
  27. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +5 -2
  28. package/templates/beauty-salon-owner/dev/index.ts +2 -3
  29. package/templates/branded-lite/tier5-src/_shared/iap-worker.ts +2 -0
  30. package/templates/branded-lite/tier5-src/_shared/payment-setup.ts +6 -0
  31. package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +5 -2
  32. package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +5 -2
  33. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +5 -2
  34. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +5 -2
  35. package/templates/branded-lite/tier5-src/himi-branded-lite-programs/index.ts +28 -11
  36. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +9 -4
  37. package/templates/community-club/tier5-src/_shared/iap-worker.ts +2 -0
  38. package/templates/community-club/tier5-src/_shared/payment-setup.ts +6 -0
  39. package/templates/community-club/tier5-src/himi-events-detail/index.ts +9 -4
  40. package/templates/community-club-owner/dev/index.ts +2 -3
  41. package/templates/events-meetups/tier5-src/_shared/iap-worker.ts +2 -0
  42. package/templates/events-meetups/tier5-src/_shared/payment-setup.ts +6 -0
  43. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +9 -4
  44. package/templates/events-meetups-owner/dev/index.ts +2 -3
  45. package/templates/gym-fitness/tier5-src/_shared/iap-worker.ts +2 -0
  46. package/templates/gym-fitness/tier5-src/_shared/payment-setup.ts +6 -0
  47. package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +5 -2
  48. package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +5 -2
  49. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +5 -2
  50. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +9 -4
  51. package/templates/gym-fitness-owner/dev/index.ts +2 -3
  52. package/templates/nonprofit-cause/tier5-src/_shared/iap-worker.ts +2 -0
  53. package/templates/nonprofit-cause/tier5-src/_shared/payment-setup.ts +6 -0
  54. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +5 -2
  55. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +9 -4
  56. package/templates/nonprofit-cause-owner/dev/index.ts +2 -3
  57. package/templates/owner-lite/dev/index.ts +2 -3
  58. package/templates/podcast-creator/tier5-src/_shared/iap-worker.ts +2 -0
  59. package/templates/podcast-creator/tier5-src/_shared/payment-setup.ts +6 -0
  60. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +5 -2
  61. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +9 -4
  62. package/templates/podcast-creator-owner/dev/index.ts +2 -3
  63. package/templates/portfolio-creative/tier5-src/_shared/iap-worker.ts +2 -0
  64. package/templates/portfolio-creative/tier5-src/_shared/payment-setup.ts +6 -0
  65. package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +5 -2
  66. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +9 -4
  67. package/templates/portfolio-creative-owner/dev/index.ts +2 -3
  68. package/templates/restaurant/tier5-src/_shared/iap-worker.ts +2 -0
  69. package/templates/restaurant/tier5-src/_shared/payment-setup.ts +6 -0
  70. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +9 -4
  71. package/templates/restaurant-owner/dev/index.ts +2 -3
  72. package/templates/retail-store/tier5-src/_shared/iap-worker.ts +2 -0
  73. package/templates/retail-store/tier5-src/_shared/payment-setup.ts +6 -0
  74. package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +5 -2
  75. package/templates/retail-store-owner/dev/index.ts +2 -3
  76. package/templates/yoga-studio/tier5-src/_shared/iap-worker.ts +2 -0
  77. package/templates/yoga-studio/tier5-src/_shared/payment-setup.ts +6 -0
  78. package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +5 -2
  79. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +5 -2
  80. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +5 -2
  81. package/templates/yoga-studio/tier5-src/himi-branded-lite-programs/index.ts +28 -11
  82. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +9 -4
  83. package/templates/yoga-studio-owner/dev/index.ts +2 -3
@@ -61,6 +61,23 @@ async function queryNotifications(limit = 25, options) {
61
61
  );
62
62
  return res.viewerFeedNotifications ?? [];
63
63
  }
64
+ async function countUnseenNotifications(options) {
65
+ const site = options?.site;
66
+ if (typeof site !== "string" || !/^[a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12}$/i.test(site)) {
67
+ throw new Error("@himalaya/wix-members-feed-viewer: notification count requires its bound site");
68
+ }
69
+ const res = await wixCall(
70
+ "POST",
71
+ "https://apps.wix.com/_api/members-feed-viewer/v1/members-viewer-feed-notifications/count",
72
+ { filter: { channel: "MOBILE", status: "UNSEEN" }, maxCount: 100 },
73
+ { site }
74
+ );
75
+ const count = res?.count;
76
+ if (typeof count !== "number" || !Number.isSafeInteger(count) || count < 0 || count > 100) {
77
+ throw new Error("@himalaya/wix-members-feed-viewer: unavailable unseen notification count");
78
+ }
79
+ return count;
80
+ }
64
81
  async function markRead(ids) {
65
82
  if (!ids.length) return;
66
83
  await mfvCall(
@@ -78,6 +95,7 @@ async function markAllRead() {
78
95
  }
79
96
  export {
80
97
  __resetMfvRouteForTests,
98
+ countUnseenNotifications,
81
99
  markAllRead,
82
100
  markRead,
83
101
  queryNotifications
@@ -18,11 +18,33 @@ function wixCall(method, path, body, readOptions) {
18
18
  var FEED_BASE = "https://social.wix.com/api/v1/feed";
19
19
  var FEED_SERVERLESS = "https://social.wix.com/serverless/mobile/feed";
20
20
  var GROUPS_APP_DEF_ID = "148c2287-c669-d849-d153-463c7486a694";
21
+ function feedQuery(fields) {
22
+ return Object.entries(fields).filter(([, value]) => value !== void 0).map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`).join("&");
23
+ }
21
24
  function listFeedItems(groupId, limit = 20, options) {
22
25
  if (!groupId) throw new Error("listFeedItems: groupId is required");
23
- const qs = `containerId=${encodeURIComponent(groupId)}&appDefId=${GROUPS_APP_DEF_ID}&limit=${limit}&feedType=all&contentType=DRAFTJS`;
26
+ const qs = feedQuery({
27
+ containerId: groupId,
28
+ appDefId: GROUPS_APP_DEF_ID,
29
+ limit,
30
+ feedType: "all",
31
+ contentType: "DRAFTJS",
32
+ topicId: options?.topicId,
33
+ cursor: options?.cursor,
34
+ invalidatePermissionsCache: options?.invalidatePermissionsCache
35
+ });
24
36
  return wixCall("GET", `${FEED_SERVERLESS}/v4/feedPosts/?${qs}`, void 0, options);
25
37
  }
38
+ function listCentralFeedItems(limit = 20, options) {
39
+ const qs = feedQuery({
40
+ limit,
41
+ cursor: options?.cursor,
42
+ invalidatePermissionsCache: options?.invalidatePermissionsCache,
43
+ withSuggestedPosts: options?.withSuggestedPosts,
44
+ contentType: options?.contentType
45
+ });
46
+ return wixCall("GET", `${FEED_SERVERLESS}/v4/centralFeedPosts?${qs}`, void 0, options);
47
+ }
26
48
  function createFeedItem(groupId, content) {
27
49
  if (!groupId) throw new Error("createFeedItem: groupId is required");
28
50
  return wixCall("POST", `${FEED_BASE}/items`, {
@@ -55,6 +77,7 @@ function unreactFeedItem(feedItemId, groupId, reactionCode = DEFAULT_REACTION) {
55
77
  export {
56
78
  DEFAULT_REACTION,
57
79
  createFeedItem,
80
+ listCentralFeedItems,
58
81
  listFeedItems,
59
82
  reactToFeedItem,
60
83
  unreactFeedItem