@wix/himalaya-cli 0.1493.0 → 0.1494.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/builder.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +52 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/index.d.ts +180 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +4 -2
- package/dist/cli.mjs +30 -29
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/qa-builds.md +2 -2
- package/guides/sdk-reference.json +256 -11
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +1624 -270
- package/templates/beauty-salon/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +514 -117
- package/templates/beauty-salon/tokens.json +6 -0
- package/templates/branded-lite/dev/index.ts +1621 -260
- package/templates/branded-lite/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +514 -117
- package/templates/branded-lite/tokens.json +1 -0
- package/templates/community-club/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/community-club/tokens.json +6 -0
- package/templates/events-meetups/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/events-meetups/tokens.json +6 -0
- package/templates/gym-fitness/dev/index.ts +1623 -269
- package/templates/gym-fitness/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +514 -117
- package/templates/gym-fitness/tokens.json +6 -0
- package/templates/nonprofit-cause/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/nonprofit-cause/tokens.json +6 -0
- package/templates/podcast-creator/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/podcast-creator/tokens.json +6 -0
- package/templates/portfolio-creative/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/portfolio-creative/tokens.json +6 -0
- package/templates/restaurant/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/restaurant/tokens.json +6 -0
- package/templates/retail-store/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/retail-store/tokens.json +6 -0
- package/templates/yoga-studio/dev/index.ts +1617 -263
- package/templates/yoga-studio/tier5-src/_shared/wix-service-price.ts +18 -0
- package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +514 -117
- package/templates/yoga-studio/tokens.json +6 -0
|
@@ -99,6 +99,24 @@ export function serviceIsChargeable(service: unknown): boolean {
|
|
|
99
99
|
return amount != null && amount > 0;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Format one Bookings v2 Money value (`{ value, currency }`, `value` a decimal string) — a
|
|
104
|
+
* price, a deposit, a VARIED minimum, a cancellation fee. A whole amount drops its cents
|
|
105
|
+
* ("₪90", not "₪90.00"), as the service screen shows it. "" when it carries no usable
|
|
106
|
+
* amount. The currency comes from the Money itself, then from `fallbackCurrency`.
|
|
107
|
+
*/
|
|
108
|
+
export function formatServiceMoney(money: unknown, fallbackCurrency = "USD"): string {
|
|
109
|
+
const m = (money ?? {}) as { value?: unknown; amount?: unknown; currency?: unknown };
|
|
110
|
+
const amount = numberOf(m.value ?? m.amount);
|
|
111
|
+
if (amount == null) return "";
|
|
112
|
+
const currency = stringOf(m.currency) || fallbackCurrency;
|
|
113
|
+
try {
|
|
114
|
+
return formatCurrency(amount, currency, "en", Number.isInteger(amount) ? 0 : undefined);
|
|
115
|
+
} catch {
|
|
116
|
+
return `${amount}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
102
120
|
/**
|
|
103
121
|
* Format a Wix Bookings service's price for display, e.g. "₪111" / "$20".
|
|
104
122
|
*
|
|
@@ -99,6 +99,24 @@ export function serviceIsChargeable(service: unknown): boolean {
|
|
|
99
99
|
return amount != null && amount > 0;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Format one Bookings v2 Money value (`{ value, currency }`, `value` a decimal string) — a
|
|
104
|
+
* price, a deposit, a VARIED minimum, a cancellation fee. A whole amount drops its cents
|
|
105
|
+
* ("₪90", not "₪90.00"), as the service screen shows it. "" when it carries no usable
|
|
106
|
+
* amount. The currency comes from the Money itself, then from `fallbackCurrency`.
|
|
107
|
+
*/
|
|
108
|
+
export function formatServiceMoney(money: unknown, fallbackCurrency = "USD"): string {
|
|
109
|
+
const m = (money ?? {}) as { value?: unknown; amount?: unknown; currency?: unknown };
|
|
110
|
+
const amount = numberOf(m.value ?? m.amount);
|
|
111
|
+
if (amount == null) return "";
|
|
112
|
+
const currency = stringOf(m.currency) || fallbackCurrency;
|
|
113
|
+
try {
|
|
114
|
+
return formatCurrency(amount, currency, "en", Number.isInteger(amount) ? 0 : undefined);
|
|
115
|
+
} catch {
|
|
116
|
+
return `${amount}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
102
120
|
/**
|
|
103
121
|
* Format a Wix Bookings service's price for display, e.g. "₪111" / "$20".
|
|
104
122
|
*
|
|
@@ -99,6 +99,24 @@ export function serviceIsChargeable(service: unknown): boolean {
|
|
|
99
99
|
return amount != null && amount > 0;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Format one Bookings v2 Money value (`{ value, currency }`, `value` a decimal string) — a
|
|
104
|
+
* price, a deposit, a VARIED minimum, a cancellation fee. A whole amount drops its cents
|
|
105
|
+
* ("₪90", not "₪90.00"), as the service screen shows it. "" when it carries no usable
|
|
106
|
+
* amount. The currency comes from the Money itself, then from `fallbackCurrency`.
|
|
107
|
+
*/
|
|
108
|
+
export function formatServiceMoney(money: unknown, fallbackCurrency = "USD"): string {
|
|
109
|
+
const m = (money ?? {}) as { value?: unknown; amount?: unknown; currency?: unknown };
|
|
110
|
+
const amount = numberOf(m.value ?? m.amount);
|
|
111
|
+
if (amount == null) return "";
|
|
112
|
+
const currency = stringOf(m.currency) || fallbackCurrency;
|
|
113
|
+
try {
|
|
114
|
+
return formatCurrency(amount, currency, "en", Number.isInteger(amount) ? 0 : undefined);
|
|
115
|
+
} catch {
|
|
116
|
+
return `${amount}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
102
120
|
/**
|
|
103
121
|
* Format a Wix Bookings service's price for display, e.g. "₪111" / "$20".
|
|
104
122
|
*
|
|
@@ -99,6 +99,24 @@ export function serviceIsChargeable(service: unknown): boolean {
|
|
|
99
99
|
return amount != null && amount > 0;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Format one Bookings v2 Money value (`{ value, currency }`, `value` a decimal string) — a
|
|
104
|
+
* price, a deposit, a VARIED minimum, a cancellation fee. A whole amount drops its cents
|
|
105
|
+
* ("₪90", not "₪90.00"), as the service screen shows it. "" when it carries no usable
|
|
106
|
+
* amount. The currency comes from the Money itself, then from `fallbackCurrency`.
|
|
107
|
+
*/
|
|
108
|
+
export function formatServiceMoney(money: unknown, fallbackCurrency = "USD"): string {
|
|
109
|
+
const m = (money ?? {}) as { value?: unknown; amount?: unknown; currency?: unknown };
|
|
110
|
+
const amount = numberOf(m.value ?? m.amount);
|
|
111
|
+
if (amount == null) return "";
|
|
112
|
+
const currency = stringOf(m.currency) || fallbackCurrency;
|
|
113
|
+
try {
|
|
114
|
+
return formatCurrency(amount, currency, "en", Number.isInteger(amount) ? 0 : undefined);
|
|
115
|
+
} catch {
|
|
116
|
+
return `${amount}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
102
120
|
/**
|
|
103
121
|
* Format a Wix Bookings service's price for display, e.g. "₪111" / "$20".
|
|
104
122
|
*
|
|
@@ -99,6 +99,24 @@ export function serviceIsChargeable(service: unknown): boolean {
|
|
|
99
99
|
return amount != null && amount > 0;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Format one Bookings v2 Money value (`{ value, currency }`, `value` a decimal string) — a
|
|
104
|
+
* price, a deposit, a VARIED minimum, a cancellation fee. A whole amount drops its cents
|
|
105
|
+
* ("₪90", not "₪90.00"), as the service screen shows it. "" when it carries no usable
|
|
106
|
+
* amount. The currency comes from the Money itself, then from `fallbackCurrency`.
|
|
107
|
+
*/
|
|
108
|
+
export function formatServiceMoney(money: unknown, fallbackCurrency = "USD"): string {
|
|
109
|
+
const m = (money ?? {}) as { value?: unknown; amount?: unknown; currency?: unknown };
|
|
110
|
+
const amount = numberOf(m.value ?? m.amount);
|
|
111
|
+
if (amount == null) return "";
|
|
112
|
+
const currency = stringOf(m.currency) || fallbackCurrency;
|
|
113
|
+
try {
|
|
114
|
+
return formatCurrency(amount, currency, "en", Number.isInteger(amount) ? 0 : undefined);
|
|
115
|
+
} catch {
|
|
116
|
+
return `${amount}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
102
120
|
/**
|
|
103
121
|
* Format a Wix Bookings service's price for display, e.g. "₪111" / "$20".
|
|
104
122
|
*
|