@wix/himalaya-cli 0.1345.0 → 0.1348.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/sdk/presigned-upload/src/index.d.ts +5 -12
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/checkout/src/index.d.ts +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +7 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +7 -2
- package/dist/cli.mjs +102 -47
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/sdk-reference.json +1 -1
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/hosted-checkout.ts +42 -0
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +9 -3
- package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +11 -3
- package/templates/branded-lite/tier5-src/_shared/hosted-checkout.ts +42 -0
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +9 -3
- package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +11 -3
- package/templates/gym-fitness/tier5-src/_shared/hosted-checkout.ts +42 -0
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +9 -3
- package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +11 -3
- package/templates/portfolio-creative/tier5-src/_shared/hosted-checkout.ts +42 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +11 -3
- package/templates/retail-store/tier5-src/_shared/hosted-checkout.ts +42 -0
- package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +11 -3
- package/templates/yoga-studio/tier5-src/_shared/hosted-checkout.ts +42 -0
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +9 -3
|
@@ -54,18 +54,11 @@ export declare function put(url: string, bytes: {
|
|
|
54
54
|
* `@himalaya/files` substrate — the bytes never cross the worker bridge, so this is
|
|
55
55
|
* the path for photos and voice notes.
|
|
56
56
|
*
|
|
57
|
-
* DECLARE "files" TOO. This verb reads the app's document substrate, so
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* the action name, so `capability.presigned_upload.putFile` is admitted by declaring
|
|
63
|
-
* `presigned_upload` alone: today a bundle can reach a substrate path without declaring
|
|
64
|
-
* `files`. That is a gap in the gate, not a licence — and it is deliberately NOT closed
|
|
65
|
-
* by adding `presigned_upload → files` to CAPABILITY_IMPLIES, because that table grants
|
|
66
|
-
* supersets, and granting the WHOLE files capability (write, remove, list) to anything
|
|
67
|
-
* that can upload would be a wider hole than the one it patched. Closing it properly
|
|
68
|
-
* needs a requires-relation the gate does not have yet.
|
|
57
|
+
* DECLARE "files" TOO — it is REQUIRED. This verb reads the app's document substrate, so
|
|
58
|
+
* the worker gate on every runtime (iOS, macOS, Android, web) refuses
|
|
59
|
+
* `capability.presigned_upload.putFile` to a bundle that does not also declare `files`.
|
|
60
|
+
* Deliberately a requirement and NOT a `presigned_upload → files` implication:
|
|
61
|
+
* declaring `presigned_upload` grants none of the files surface (write, remove, list).
|
|
69
62
|
*/
|
|
70
63
|
export declare function putFile(url: string, ref: FileHandle | string, opts?: UploadOptions): Promise<UploadResult>;
|
|
71
64
|
/** Capability version, for bundles that gate on min binary version. */
|
|
@@ -62,6 +62,13 @@ export interface PayRequest {
|
|
|
62
62
|
currency?: string;
|
|
63
63
|
/** Mints the in-app cashier URL. Called ONLY when the wallet rail cannot settle. */
|
|
64
64
|
cashierUrl?: () => Promise<string | undefined>;
|
|
65
|
+
/** Opens the cashier ITSELF, in place of `cashierUrl` + an in-app browser: a host that must sign
|
|
66
|
+
* the member in on the site first (a hosted app's checkout, RFC 0071 §4 Step 4b) owns the URL,
|
|
67
|
+
* which carries a session token no worker may see. Resolves whether the cashier opened, or
|
|
68
|
+
* "withdrawn" when [stillMayCharge] — the caller's `mayCharge`, re-read — said no once the host had
|
|
69
|
+
* prepared it: preparing takes network round trips, during which the caller's route can change, so
|
|
70
|
+
* the host asks again right before it opens. */
|
|
71
|
+
openCashier?: (stillMayCharge: () => Promise<boolean>) => Promise<boolean | "withdrawn">;
|
|
65
72
|
/** Re-read immediately before money moves (the wallet charge, the cashier opening). The caller's
|
|
66
73
|
* own route can change while a rail is being chosen; false stops the flow with nothing charged. */
|
|
67
74
|
mayCharge?: () => boolean | Promise<boolean>;
|
|
@@ -140,7 +140,7 @@ async function isEntitled() {
|
|
|
140
140
|
}
|
|
141
141
|
var WITHDRAWN = { kind: "failed", reason: "the caller withdrew the charge" };
|
|
142
142
|
async function payOrder(req) {
|
|
143
|
-
if (!req.snapshotId && !req.cashierUrl) {
|
|
143
|
+
if (!req.snapshotId && !req.cashierUrl && !req.openCashier) {
|
|
144
144
|
return { kind: "failed", reason: "no order to settle" };
|
|
145
145
|
}
|
|
146
146
|
const availability = await isAvailable().catch(() => "unavailable");
|
|
@@ -163,7 +163,12 @@ async function payOrder(req) {
|
|
|
163
163
|
}
|
|
164
164
|
if (r.status === "cancelled") return { kind: "cancelled" };
|
|
165
165
|
}
|
|
166
|
-
if (req.
|
|
166
|
+
if (req.openCashier) {
|
|
167
|
+
if (await req.mayCharge?.() === false) return WITHDRAWN;
|
|
168
|
+
const opened = await req.openCashier(async () => await req.mayCharge?.() !== false).catch(() => false);
|
|
169
|
+
if (opened === "withdrawn") return WITHDRAWN;
|
|
170
|
+
if (opened === true) return { kind: "handoff" };
|
|
171
|
+
} else if (req.cashierUrl) {
|
|
167
172
|
const url = await req.cashierUrl().catch(() => void 0);
|
|
168
173
|
if (url) {
|
|
169
174
|
if (await req.mayCharge?.() === false) return WITHDRAWN;
|
|
@@ -224,7 +224,7 @@ async function entitlement(planId) {
|
|
|
224
224
|
}
|
|
225
225
|
var WITHDRAWN = { kind: "failed", reason: "the caller withdrew the charge" };
|
|
226
226
|
async function payOrder(req) {
|
|
227
|
-
if (!req.snapshotId && !req.cashierUrl) {
|
|
227
|
+
if (!req.snapshotId && !req.cashierUrl && !req.openCashier) {
|
|
228
228
|
return { kind: "failed", reason: "no order to settle" };
|
|
229
229
|
}
|
|
230
230
|
const availability = await isAvailable().catch(() => "unavailable");
|
|
@@ -247,7 +247,12 @@ async function payOrder(req) {
|
|
|
247
247
|
}
|
|
248
248
|
if (r.status === "cancelled") return { kind: "cancelled" };
|
|
249
249
|
}
|
|
250
|
-
if (req.
|
|
250
|
+
if (req.openCashier) {
|
|
251
|
+
if (await req.mayCharge?.() === false) return WITHDRAWN;
|
|
252
|
+
const opened = await req.openCashier(async () => await req.mayCharge?.() !== false).catch(() => false);
|
|
253
|
+
if (opened === "withdrawn") return WITHDRAWN;
|
|
254
|
+
if (opened === true) return { kind: "handoff" };
|
|
255
|
+
} else if (req.cashierUrl) {
|
|
251
256
|
const url = await req.cashierUrl().catch(() => void 0);
|
|
252
257
|
if (url) {
|
|
253
258
|
if (await req.mayCharge?.() === false) return WITHDRAWN;
|