@wix/himalaya-cli 0.1572.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/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-social-feed.mjs +24 -1
- package/dist/cli.mjs +123 -43
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/one-app-to-himi-app.md +54 -0
- package/guides/sdk-reference.json +28 -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/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-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/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/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/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/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/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/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/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/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-events-detail/index.ts +9 -4
|
@@ -112,6 +112,8 @@ export interface BundleSource {
|
|
|
112
112
|
* contract parity (spec invariants 18 + 19). OTA only revalidates the seed.
|
|
113
113
|
*/
|
|
114
114
|
export interface AppSeed {
|
|
115
|
+
/** Live-only exact screens to omit from the generated binary seed. They remain in OTA releases. */
|
|
116
|
+
excludeScreens?: readonly string[];
|
|
115
117
|
/** First-run screen descriptors, keyed by screenId. */
|
|
116
118
|
screens: Record<string, ScreenDescriptor>;
|
|
117
119
|
/** First-run entity snapshots (the per-app data substrate, e.g. data/*.json). */
|
|
@@ -52,7 +52,11 @@ export type PayOutcome =
|
|
|
52
52
|
| {
|
|
53
53
|
kind: "failed";
|
|
54
54
|
reason: string;
|
|
55
|
+
code?: "SITE_NOT_ACCEPTING_PAYMENTS";
|
|
55
56
|
};
|
|
57
|
+
/** Match Wix's application code, including the native HTTP bridge frame and a
|
|
58
|
+
* complete web HTTP JSON envelope. Prose and truncated bodies are not evidence. */
|
|
59
|
+
export declare function isPaymentSetupFailure(error: unknown): boolean;
|
|
56
60
|
export interface PayRequest {
|
|
57
61
|
appId: string;
|
|
58
62
|
/** Cashier order snapshot. May be empty — see `cashierUrl`. */
|
|
@@ -198,7 +198,7 @@ export interface OrderRefStore {
|
|
|
198
198
|
siteId: string;
|
|
199
199
|
}): boolean | null;
|
|
200
200
|
}
|
|
201
|
-
export type OrderFailureCode = "notEnabled" | "notConfigured" | "signInRequired" | "unsupportedItem" | "notAppleRoute" | "storageUnavailable" | "approvalRequired" | "orderClosed" | "orderRefused" | "chargeFailed" | "paymentRefused" | "paymentHeld" | "alreadyOwned" | "paymentInProgress" | "productChanged" | "invalidAssociation" | "needsSupport" | "unavailable" | "sessionChanged" | "outcomeUnknown";
|
|
201
|
+
export type OrderFailureCode = "notEnabled" | "notConfigured" | "signInRequired" | "unsupportedItem" | "notAppleRoute" | "storageUnavailable" | "approvalRequired" | "orderClosed" | "orderRefused" | "chargeFailed" | "paymentRefused" | "paymentHeld" | "alreadyOwned" | "paymentInProgress" | "productChanged" | "sitePaymentUnavailable" | "invalidAssociation" | "needsSupport" | "unavailable" | "sessionChanged" | "outcomeUnknown";
|
|
202
202
|
/** Progress of a payment this device handed to wix-iap, tracked from its durable reference. */
|
|
203
203
|
export type PaymentAccess = "processing" | "granted" | "accessUnknown" | "needsSupport";
|
|
204
204
|
export interface PaymentProgress {
|
|
@@ -92,6 +92,8 @@ export interface IapPurchaseCopy {
|
|
|
92
92
|
unavailable: string;
|
|
93
93
|
signInRequired: string;
|
|
94
94
|
retry: string;
|
|
95
|
+
/** Optional for existing SDK consumers; the app supplies a localized recovery message. */
|
|
96
|
+
sitePaymentUnavailable?: string;
|
|
95
97
|
priceChanged: string;
|
|
96
98
|
support: string;
|
|
97
99
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** A decoded editorial document, suitable for copying into editable app source. Root editor metadata is omitted. */
|
|
2
|
+
export interface OneAppPage {
|
|
3
|
+
pageId: string;
|
|
4
|
+
title: string;
|
|
5
|
+
contentType: "RICH_CONTENT" | "DRAFTJS" | "PLAIN_TEXT";
|
|
6
|
+
documentJson: string;
|
|
7
|
+
plainText: string;
|
|
8
|
+
empty: boolean;
|
|
9
|
+
normalizedWebsiteLinks: number;
|
|
10
|
+
}
|
|
11
|
+
export type OneAppPageContentError = Error & {
|
|
12
|
+
code: "invalid" | "unsupported";
|
|
13
|
+
};
|
|
14
|
+
/** Stable parse failures without a subclass: worker bundles deliberately forbid class syntax. */
|
|
15
|
+
export declare function oneAppPageContentErrorCode(error: unknown): "invalid" | "unsupported" | undefined;
|
|
16
|
+
/** Validate a UUID source page selector before constructing a Pages read. */
|
|
17
|
+
export declare const isOneAppPageId: (value: unknown) => value is string;
|
|
18
|
+
/** Decode the exact Pages response; malformed, mismatched and unsupported documents throw.
|
|
19
|
+
* A real empty document succeeds with empty=true. Renderer media sizing and link sanitization
|
|
20
|
+
* use the existing bounded RichContent encoder on every format. */
|
|
21
|
+
export declare function decodeOneAppPage(response: unknown, expectedPageId: string): OneAppPage;
|
|
22
|
+
/** Editable native RichContent at one source placement. A document is literal data,
|
|
23
|
+
* including dollar-prefixed prose; it is never interpreted as service bindings.
|
|
24
|
+
* The standard RichContent link handler opens http(s), mailto and tel on each host. */
|
|
25
|
+
export declare function oneAppPageSection(page: OneAppPage, options: {
|
|
26
|
+
id: string;
|
|
27
|
+
emptyTitle?: string;
|
|
28
|
+
emptyDescription?: string;
|
|
29
|
+
}): {
|
|
30
|
+
id: string;
|
|
31
|
+
body: {
|
|
32
|
+
package: string;
|
|
33
|
+
type: string;
|
|
34
|
+
props: {
|
|
35
|
+
spacing: number;
|
|
36
|
+
children: {
|
|
37
|
+
id: string;
|
|
38
|
+
body: {
|
|
39
|
+
package: string;
|
|
40
|
+
type: string;
|
|
41
|
+
props: {
|
|
42
|
+
text: string;
|
|
43
|
+
style: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}[];
|
|
47
|
+
documentJson?: undefined;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
id: string;
|
|
52
|
+
body: {
|
|
53
|
+
package: string;
|
|
54
|
+
type: string;
|
|
55
|
+
props: {
|
|
56
|
+
documentJson: string;
|
|
57
|
+
spacing?: undefined;
|
|
58
|
+
children?: undefined;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -84,18 +84,43 @@ export interface WixListFeedItemsResponse {
|
|
|
84
84
|
profiles?: WixFeedProfile[];
|
|
85
85
|
nextPageCursor?: string;
|
|
86
86
|
}
|
|
87
|
+
/** Read controls shared by the source's single-group and central feeds. */
|
|
88
|
+
export interface WixFeedPageOptions extends WixCallOptions {
|
|
89
|
+
/** Opaque server cursor; pass it back unchanged when loading the next page. */
|
|
90
|
+
cursor?: string;
|
|
91
|
+
invalidatePermissionsCache?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface WixGroupFeedOptions extends WixFeedPageOptions {
|
|
94
|
+
topicId?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface WixCentralFeedOptions extends WixFeedPageOptions {
|
|
97
|
+
withSuggestedPosts?: boolean;
|
|
98
|
+
/** Omit to use the central-feed service's default representation. */
|
|
99
|
+
contentType?: "DRAFTJS";
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* List one group's activity feed. Mirrors wix-one-app-feed getFeedPosts:
|
|
103
|
+
* containerId + Groups appDefId + feedType=all + contentType=DRAFTJS, with optional
|
|
104
|
+
* topic and opaque paging cursor. Existing site/cache options remain per-call.
|
|
105
|
+
* Reactions lists must not be treated as authoritative totals.
|
|
106
|
+
*
|
|
107
|
+
* @scope member — verified live with a signed-in member session; visitor readability
|
|
108
|
+
* depends on group permissions and is not established by the central-feed probe.
|
|
109
|
+
*/
|
|
110
|
+
export declare function listFeedItems(groupId: string, limit?: number, options?: WixGroupFeedOptions): Promise<WixListFeedItemsResponse>;
|
|
87
111
|
/**
|
|
88
|
-
* List
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* reactionsList (count = length); the response's top-level `profiles[]` resolves each
|
|
92
|
-
* item's author.id → userName + profileImage. Verified live (200). Replaces the lean
|
|
93
|
-
* GET /api/v1/feed/items read, which omitted counts + author.
|
|
112
|
+
* List the site's combined feed, rather than substituting a selected group's feed.
|
|
113
|
+
* Mirrors wix-one-app-feed getCentralFeedPosts: there is no containerId or appDefId.
|
|
114
|
+
* Authentication and business selection belong to the bridge (or per-call `site`).
|
|
94
115
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
116
|
+
* Source: wix-one-app-feed@6ef53170e94e27349d2a6c1cf08038b078d86228,
|
|
117
|
+
* src/services/feed-api.ts. A real Visitor read returned 200 with posts and a cursor.
|
|
118
|
+
* That establishes the server contract only: native consumers need a core release with the exact read-route guard, and
|
|
119
|
+
* production web still refuses social.wix.com. This SDK method does
|
|
120
|
+
* not change those policies or establish membership/write permission. Consumers must
|
|
121
|
+
* surface a transport refusal; they must not substitute a group directory or empty feed.
|
|
97
122
|
*/
|
|
98
|
-
export declare function
|
|
123
|
+
export declare function listCentralFeedItems(limit?: number, options?: WixCentralFeedOptions): Promise<WixListFeedItemsResponse>;
|
|
99
124
|
/**
|
|
100
125
|
* Create a feed post in a group as the signed-in member — POST
|
|
101
126
|
* https://social.wix.com/api/v1/feed/items. `content` is the post text (modern
|
|
@@ -146,6 +146,26 @@ async function entitlement(planId) {
|
|
|
146
146
|
async function isEntitled() {
|
|
147
147
|
return (await entitlement()).entitled;
|
|
148
148
|
}
|
|
149
|
+
function isPaymentSetupFailure(error) {
|
|
150
|
+
if (!error || typeof error !== "object") return false;
|
|
151
|
+
const value = error;
|
|
152
|
+
if (value.code === "SITE_NOT_ACCEPTING_PAYMENTS" || value.applicationError?.code === "SITE_NOT_ACCEPTING_PAYMENTS" || value.details?.applicationError?.code === "SITE_NOT_ACCEPTING_PAYMENTS") return true;
|
|
153
|
+
if (typeof value.message !== "string") return false;
|
|
154
|
+
if (/^HTTP \d{3} \[SITE_NOT_ACCEPTING_PAYMENTS\]:/.test(value.message)) return true;
|
|
155
|
+
const web = /^HTTP \d{3}: (\{[\s\S]*\})$/.exec(value.message);
|
|
156
|
+
if (!web) return false;
|
|
157
|
+
try {
|
|
158
|
+
const body = JSON.parse(web[1]);
|
|
159
|
+
return body?.code === "SITE_NOT_ACCEPTING_PAYMENTS" || body?.applicationError?.code === "SITE_NOT_ACCEPTING_PAYMENTS" || body?.details?.applicationError?.code === "SITE_NOT_ACCEPTING_PAYMENTS";
|
|
160
|
+
} catch {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
var PAYMENT_SETUP_FAILURE = {
|
|
165
|
+
kind: "failed",
|
|
166
|
+
code: "SITE_NOT_ACCEPTING_PAYMENTS",
|
|
167
|
+
reason: "the site is not accepting online payments"
|
|
168
|
+
};
|
|
149
169
|
var WITHDRAWN = { kind: "failed", reason: "the caller withdrew the charge" };
|
|
150
170
|
async function payOrder(req) {
|
|
151
171
|
if (!req.snapshotId && !req.cashierUrl && !req.openCashier) {
|
|
@@ -160,7 +180,9 @@ async function payOrder(req) {
|
|
|
160
180
|
msid: req.msid,
|
|
161
181
|
amount: req.amount,
|
|
162
182
|
currency: req.currency
|
|
163
|
-
}).catch(() => ({ status: "failed" }));
|
|
183
|
+
}).catch((error) => ({ status: "failed", setupUnavailable: isPaymentSetupFailure(error) }));
|
|
184
|
+
if ("setupUnavailable" in r && r.setupUnavailable) return PAYMENT_SETUP_FAILURE;
|
|
185
|
+
if (r.status === "failed" && isPaymentSetupFailure({ message: "error" in r ? r.error : void 0 })) return PAYMENT_SETUP_FAILURE;
|
|
164
186
|
if (r.status === "paid" || r.status === "pending") {
|
|
165
187
|
const chargeId = r.chargeId;
|
|
166
188
|
return {
|
|
@@ -173,11 +195,13 @@ async function payOrder(req) {
|
|
|
173
195
|
}
|
|
174
196
|
if (req.openCashier) {
|
|
175
197
|
if (await req.mayCharge?.() === false) return WITHDRAWN;
|
|
176
|
-
const opened = await req.openCashier(async () => await req.mayCharge?.() !== false).catch(() => false);
|
|
198
|
+
const opened = await req.openCashier(async () => await req.mayCharge?.() !== false).catch((error) => isPaymentSetupFailure(error) ? PAYMENT_SETUP_FAILURE : false);
|
|
199
|
+
if (typeof opened === "object") return opened;
|
|
177
200
|
if (opened === "withdrawn") return WITHDRAWN;
|
|
178
201
|
if (opened === true) return { kind: "handoff" };
|
|
179
202
|
} else if (req.cashierUrl) {
|
|
180
|
-
const url = await req.cashierUrl().catch(() => void 0);
|
|
203
|
+
const url = await req.cashierUrl().catch((error) => isPaymentSetupFailure(error) ? PAYMENT_SETUP_FAILURE : void 0);
|
|
204
|
+
if (typeof url === "object") return url;
|
|
181
205
|
if (url) {
|
|
182
206
|
if (await req.mayCharge?.() === false) return WITHDRAWN;
|
|
183
207
|
const opened = await open(url, "in_app_browser").catch(() => ({ opened: false }));
|
|
@@ -194,6 +218,7 @@ export {
|
|
|
194
218
|
activePlanIds,
|
|
195
219
|
entitlement,
|
|
196
220
|
isEntitled,
|
|
221
|
+
isPaymentSetupFailure,
|
|
197
222
|
payOrder as payCashierOrder,
|
|
198
223
|
payOrder
|
|
199
224
|
};
|
|
@@ -2308,7 +2308,7 @@ var ITEM_REFUSALS = {
|
|
|
2308
2308
|
PRODUCT_NOT_AVAILABLE: "paymentRefused",
|
|
2309
2309
|
ALREADY_OWNED: "paymentRefused",
|
|
2310
2310
|
ITEM_NOT_AVAILABLE: "orderRefused",
|
|
2311
|
-
SITE_NOT_ACCEPTING_PAYMENTS: "
|
|
2311
|
+
SITE_NOT_ACCEPTING_PAYMENTS: "sitePaymentUnavailable",
|
|
2312
2312
|
UNSUPPORTED_ORDER: "orderRefused"
|
|
2313
2313
|
};
|
|
2314
2314
|
var KIND_STOPS = {
|
|
@@ -2777,6 +2777,7 @@ function outcomeAction(state, copy) {
|
|
|
2777
2777
|
}
|
|
2778
2778
|
}
|
|
2779
2779
|
function refusalAction(failure3, copy) {
|
|
2780
|
+
if (failure3 === "sitePaymentUnavailable") return action(copy, "enabled", copy.sitePaymentUnavailable ?? copy.retry);
|
|
2780
2781
|
const [mode, note] = REFUSALS[failure3 ?? "unavailable"] ?? ["enabled", "retry"];
|
|
2781
2782
|
return action(copy, mode, note ? copy[note] ?? "" : "");
|
|
2782
2783
|
}
|