@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.
Files changed (39) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +2 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +52 -2
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/index.d.ts +180 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +4 -2
  5. package/dist/cli.mjs +30 -29
  6. package/dist/preview-assets.generated.bin +0 -0
  7. package/guides/qa-builds.md +2 -2
  8. package/guides/sdk-reference.json +256 -11
  9. package/package.json +2 -2
  10. package/templates/beauty-salon/dev/index.ts +1624 -270
  11. package/templates/beauty-salon/tier5-src/_shared/wix-service-price.ts +18 -0
  12. package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +514 -117
  13. package/templates/beauty-salon/tokens.json +6 -0
  14. package/templates/branded-lite/dev/index.ts +1621 -260
  15. package/templates/branded-lite/tier5-src/_shared/wix-service-price.ts +18 -0
  16. package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +514 -117
  17. package/templates/branded-lite/tokens.json +1 -0
  18. package/templates/community-club/tier5-src/_shared/wix-service-price.ts +18 -0
  19. package/templates/community-club/tokens.json +6 -0
  20. package/templates/events-meetups/tier5-src/_shared/wix-service-price.ts +18 -0
  21. package/templates/events-meetups/tokens.json +6 -0
  22. package/templates/gym-fitness/dev/index.ts +1623 -269
  23. package/templates/gym-fitness/tier5-src/_shared/wix-service-price.ts +18 -0
  24. package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +514 -117
  25. package/templates/gym-fitness/tokens.json +6 -0
  26. package/templates/nonprofit-cause/tier5-src/_shared/wix-service-price.ts +18 -0
  27. package/templates/nonprofit-cause/tokens.json +6 -0
  28. package/templates/podcast-creator/tier5-src/_shared/wix-service-price.ts +18 -0
  29. package/templates/podcast-creator/tokens.json +6 -0
  30. package/templates/portfolio-creative/tier5-src/_shared/wix-service-price.ts +18 -0
  31. package/templates/portfolio-creative/tokens.json +6 -0
  32. package/templates/restaurant/tier5-src/_shared/wix-service-price.ts +18 -0
  33. package/templates/restaurant/tokens.json +6 -0
  34. package/templates/retail-store/tier5-src/_shared/wix-service-price.ts +18 -0
  35. package/templates/retail-store/tokens.json +6 -0
  36. package/templates/yoga-studio/dev/index.ts +1617 -263
  37. package/templates/yoga-studio/tier5-src/_shared/wix-service-price.ts +18 -0
  38. package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +514 -117
  39. 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
  *