@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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/checkout/src/index.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-contract.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/one-app-page.d.ts +61 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-feed-viewer/src/index.d.ts +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +34 -9
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +28 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +573 -73
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members-feed-viewer.mjs +18 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-social-feed.mjs +24 -1
- package/dist/cli.mjs +466 -90
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/index.json +7 -0
- package/guides/map-one-app-coverage.js +117 -0
- package/guides/one-app-to-himi-app.md +141 -7
- package/guides/recipe-one-app-coverage-mapping.md +74 -0
- package/guides/sdk-reference.json +34 -4
- package/guides/webview-page-sdk.md +68 -3
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/beauty-salon/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +5 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/beauty-salon-owner/dev/index.ts +2 -3
- package/templates/branded-lite/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/branded-lite/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-programs/index.ts +28 -11
- package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/community-club/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/community-club/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/community-club/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/community-club-owner/dev/index.ts +2 -3
- package/templates/events-meetups/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/events-meetups/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/events-meetups-owner/dev/index.ts +2 -3
- package/templates/gym-fitness/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/gym-fitness/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +5 -2
- package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/gym-fitness-owner/dev/index.ts +2 -3
- package/templates/nonprofit-cause/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/nonprofit-cause/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/nonprofit-cause-owner/dev/index.ts +2 -3
- package/templates/owner-lite/dev/index.ts +2 -3
- package/templates/podcast-creator/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/podcast-creator/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/podcast-creator-owner/dev/index.ts +2 -3
- package/templates/portfolio-creative/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/portfolio-creative/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/portfolio-creative-owner/dev/index.ts +2 -3
- package/templates/restaurant/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/restaurant/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/restaurant/tier5-src/himi-events-detail/index.ts +9 -4
- package/templates/restaurant-owner/dev/index.ts +2 -3
- package/templates/retail-store/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/retail-store/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +5 -2
- package/templates/retail-store-owner/dev/index.ts +2 -3
- package/templates/yoga-studio/tier5-src/_shared/iap-worker.ts +2 -0
- package/templates/yoga-studio/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +5 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +5 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +5 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-programs/index.ts +28 -11
- package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +9 -4
- 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 =
|
|
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
|