@wix/himalaya-cli 0.1658.0 → 0.1660.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 (66) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/attendance-classifier.d.ts +3 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/delivery-contract.d.ts +3 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/index.d.ts +7 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-contract.d.ts +19 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/wix-payments-wire.d.ts +2 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +22 -5
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/commerce-contract.d.ts +4 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-order-backend.d.ts +5 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance-orders.d.ts +10 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/attendance.d.ts +4 -5
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/index.d.ts +13 -3
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs-orders.d.ts +2 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/online-programs.d.ts +2 -2
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans-orders.d.ts +2 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/pricing-plans.d.ts +4 -2
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/iap-verticals/shared.d.ts +3 -1
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +545 -166
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +52 -8
  24. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
  25. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
  26. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
  27. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +423 -88
  28. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
  29. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
  30. package/dist/browser-plane/assets.json +5 -5
  31. package/dist/browser-plane/preview-deferred/{c04dd5fc5ad48e6b19678d4313159302e9a513ada94bfe515d8dfd5a54d46f5d.bin → fcafca348b6b973cfc2eadc938ddec3c515c641874cbca1667a43b22e1bf7a39.bin} +1 -1
  32. package/dist/browser-plane/sw.js +1 -1
  33. package/dist/cli.mjs +1457 -228
  34. package/dist/preview-assets.generated.bin +0 -0
  35. package/guides/himi-json-output.md +39 -0
  36. package/guides/qa-builds.md +20 -0
  37. package/guides/sdk-reference.json +79 -9
  38. package/guides/skill.md +3 -1
  39. package/guides/web-page-sdk-reference.md +1 -1
  40. package/package.json +2 -2
  41. package/templates/beauty-salon/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  42. package/templates/beauty-salon/tier5-src/_shared/iap-worker.ts +2 -0
  43. package/templates/branded-lite/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  44. package/templates/branded-lite/tier5-src/_shared/iap-worker.ts +2 -0
  45. package/templates/community-club/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  46. package/templates/community-club/tier5-src/_shared/iap-worker.ts +2 -0
  47. package/templates/conference/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  48. package/templates/conference/tier5-src/_shared/iap-worker.ts +2 -0
  49. package/templates/events-meetups/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  50. package/templates/events-meetups/tier5-src/_shared/iap-worker.ts +2 -0
  51. package/templates/gym-fitness/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  52. package/templates/gym-fitness/tier5-src/_shared/iap-worker.ts +2 -0
  53. package/templates/nonprofit-cause/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  54. package/templates/nonprofit-cause/tier5-src/_shared/iap-worker.ts +2 -0
  55. package/templates/podcast-creator/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  56. package/templates/podcast-creator/tier5-src/_shared/iap-worker.ts +2 -0
  57. package/templates/portfolio-creative/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  58. package/templates/portfolio-creative/tier5-src/_shared/iap-worker.ts +2 -0
  59. package/templates/restaurant/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  60. package/templates/restaurant/tier5-src/_shared/iap-worker.ts +2 -0
  61. package/templates/retail-store/tier5-src/_shared/iap-worker.ts +2 -0
  62. package/templates/salon-spa/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  63. package/templates/salon-spa/tier5-src/_shared/iap-worker.ts +2 -0
  64. package/templates/wholesale-store/tier5-src/_shared/iap-worker.ts +2 -0
  65. package/templates/yoga-studio/tier5-src/_shared/iap-attendance-purchase.ts +6 -1
  66. package/templates/yoga-studio/tier5-src/_shared/iap-worker.ts +2 -0
@@ -92,9 +92,18 @@ function createPurchaseCoordinator(deps) {
92
92
  else if (result.status === "failed") failStore(result.code, false);
93
93
  else if (result.status === "pending") {
94
94
  if (!await awaitApproval(session, context)) return !disposed;
95
- } else setOutcome("cancelled");
95
+ } else {
96
+ setOutcome("cancelled");
97
+ void abandon(session, catalogRef);
98
+ }
96
99
  return false;
97
100
  }
101
+ async function abandon(session, catalogRef) {
102
+ try {
103
+ await deps.backend.abandonPurchase?.(session, catalogRef);
104
+ } catch {
105
+ }
106
+ }
98
107
  async function deliverPurchase(session, transaction, context) {
99
108
  const item = upsert(transaction, null);
100
109
  applyDelivered(await deliver(session, [item], context));
@@ -673,6 +682,11 @@ var ONLINE_PROGRAM_SALE_RULE = { appProductId: (id) => id, productType: "NON_CON
673
682
  var PRICING_PLAN_APPLE_SALES_ENABLED = true;
674
683
  var PRICING_PLAN_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
675
684
  var VIDEOS_APPLE_SALES_ENABLED = false;
685
+ var PRICING_PLAN_ITEM_PAYMENT_ENABLED = false;
686
+ var ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED = false;
687
+ var BOOKINGS_ITEM_PAYMENT_ENABLED = false;
688
+ var EVENTS_ITEM_PAYMENT_ENABLED = false;
689
+ var CANCEL_PAYMENT_ENABLED = false;
676
690
  var VIDEO_SALE_RULE = { appProductId: (id) => id, productType: "NON_CONSUMABLE" };
677
691
  function appleSaleRules(options = {}) {
678
692
  return {
@@ -1124,10 +1138,21 @@ function decodeStartedItem(raw, expected) {
1124
1138
  if (!isObject3(raw)) return null;
1125
1139
  const ecomOrderId = optionalId(raw.ecomOrderId);
1126
1140
  const joinApplicationId = optionalId(raw.joinApplicationId);
1127
- if (ecomOrderId === null || joinApplicationId === null || !ecomOrderId && !joinApplicationId) return null;
1141
+ const eventsOrderNumber = optionalOrderNumber(raw.eventsOrderNumber);
1142
+ if (ecomOrderId === null || joinApplicationId === null || eventsOrderNumber === null) return null;
1143
+ if (!ecomOrderId && !joinApplicationId && !eventsOrderNumber) return null;
1128
1144
  const started = decodeStarted(raw, expected);
1129
1145
  if (!started || started.payment.appProductId !== expected.catalogItemId) return null;
1130
- return { ...started, ...ecomOrderId ? { ecomOrderId } : {}, ...joinApplicationId ? { joinApplicationId } : {} };
1146
+ return {
1147
+ ...started,
1148
+ ...ecomOrderId ? { ecomOrderId } : {},
1149
+ ...joinApplicationId ? { joinApplicationId } : {},
1150
+ ...eventsOrderNumber ? { eventsOrderNumber } : {}
1151
+ };
1152
+ }
1153
+ function optionalOrderNumber(value) {
1154
+ if (value === void 0 || value === "") return void 0;
1155
+ return typeof value === "string" && value.length <= 36 ? value : null;
1131
1156
  }
1132
1157
  function optionalId(value) {
1133
1158
  if (value === void 0 || value === "") return void 0;
@@ -1428,7 +1453,8 @@ var START_ITEM_PAYMENT_CODES = [
1428
1453
  "BILLING_COUNTRY_REQUIRED",
1429
1454
  "APP_NOT_CONFIGURED",
1430
1455
  "NOT_BOOKING_OWNER",
1431
- "BOOKING_PAYMENT_PENDING"
1456
+ "BOOKING_PAYMENT_PENDING",
1457
+ "MEMBER_DETAILS_REQUIRED"
1432
1458
  ];
1433
1459
  var CANCEL_PAYMENT_CODES = ["NOT_PENDING", "APP_NOT_CONFIGURED", "NOT_FOUND"];
1434
1460
  var UNDECIDED = /* @__PURE__ */ new Set(["unavailable", "sessionChanged", "invalidResponse"]);
@@ -1549,15 +1575,18 @@ function ticketAttendanceOf(event, definition) {
1549
1575
  function availableTicketAttendanceOf(event, ticket) {
1550
1576
  const e = object(event);
1551
1577
  const t = object(ticket);
1552
- const pricing = object(t.pricing);
1578
+ const v3 = t.pricingMethod !== void 0;
1579
+ const pricing = object(v3 ? t.pricingMethod : t.pricing);
1553
1580
  const fixed = object(pricing.fixedPrice);
1581
+ const amount = v3 ? fixed.value : fixed.amount;
1554
1582
  const price = object(t.price);
1555
- const visible = Array.isArray(t.state) && t.state.length === 0 && object(t.dashboard).hidden !== true && typeof t.id === "string" && t.id.length > 0 && typeof e.id === "string" && e.id.length > 0 && t.eventId === e.id;
1556
- const fixedPrice = t.free === false && pricing.pricingType === "STANDARD" && sameTicketAmount(fixed.amount, price.amount) && fixed.currency === price.currency;
1583
+ const listed = v3 ? t.hidden === false && t.state === void 0 : Array.isArray(t.state) && t.state.length === 0;
1584
+ const visible = listed && object(t.dashboard).hidden !== true && typeof t.id === "string" && t.id.length > 0 && typeof e.id === "string" && e.id.length > 0 && t.eventId === e.id;
1585
+ const fixedPrice = t.free === false && (!v3 || pricing.free === false) && pricing.pricingType === "STANDARD" && sameTicketAmount(amount, price.amount) && fixed.currency === price.currency;
1557
1586
  return ticketAttendanceOf(e, {
1558
1587
  hidden: visible ? false : void 0,
1559
1588
  saleStatus: t.saleStatus,
1560
- pricingMethod: { pricingType: fixedPrice ? "STANDARD" : void 0, fixedPrice: { value: fixed.amount, currency: fixed.currency } }
1589
+ pricingMethod: { pricingType: fixedPrice ? "STANDARD" : void 0, fixedPrice: { value: amount, currency: fixed.currency } }
1561
1590
  });
1562
1591
  }
1563
1592
  function sameTicketAmount(left, right) {
@@ -1583,6 +1612,15 @@ async function getPaywallConfig() {
1583
1612
  products: Array.isArray(r?.products) ? r.products : []
1584
1613
  };
1585
1614
  }
1615
+ async function storefrontCountryCode() {
1616
+ try {
1617
+ const r = await dispatch("capability.iap.storefront");
1618
+ const code = r?.countryCode;
1619
+ return typeof code === "string" && /^[A-Z]{3}$/.test(code) ? code : null;
1620
+ } catch {
1621
+ return null;
1622
+ }
1623
+ }
1586
1624
  async function getProducts(productIds) {
1587
1625
  if (!productIds || productIds.length === 0) return [];
1588
1626
  const r = await dispatch("capability.iap.getProducts", {
@@ -1707,12 +1745,17 @@ export {
1707
1745
  APPLE_PROVISIONING_RULES,
1708
1746
  APPLE_SALE_RULES,
1709
1747
  BOOKINGS_APPLE_SALES_ENABLED,
1748
+ BOOKINGS_ITEM_PAYMENT_ENABLED,
1749
+ CANCEL_PAYMENT_ENABLED,
1710
1750
  EVENTS_APPLE_SALES_ENABLED,
1751
+ EVENTS_ITEM_PAYMENT_ENABLED,
1711
1752
  HIMALAYA_SERVE_IAP_ROUTE,
1712
1753
  IAP_CATALOG_KINDS,
1713
1754
  MAX_AUTOMATIC_ATTEMPTS,
1714
1755
  MAX_RETRY_DELAY_MS,
1756
+ ONLINE_PROGRAM_ITEM_PAYMENT_ENABLED,
1715
1757
  PRICING_PLAN_APPLE_SALES_ENABLED,
1758
+ PRICING_PLAN_ITEM_PAYMENT_ENABLED,
1716
1759
  STORES_APPLE_SALES_ENABLED,
1717
1760
  STORES_PRODUCT_SALE_RULE,
1718
1761
  VIDEOS_APPLE_SALES_ENABLED,
@@ -1743,6 +1786,7 @@ export {
1743
1786
  readIdentityBound,
1744
1787
  restore,
1745
1788
  sharedHostAppBindingSource,
1789
+ storefrontCountryCode,
1746
1790
  ticketAttendanceOf,
1747
1791
  version,
1748
1792
  wixVideoItem
@@ -31,7 +31,7 @@ var CAPABILITY_REGISTRY = {
31
31
  "haptic": ["play", "sequence", "vibrate"],
32
32
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
33
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
- "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
34
+ "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
35
35
  "keyboard": ["dismiss"],
36
36
  "legacy_import": ["ack", "read"],
37
37
  "live_activity": ["end", "start", "update"],
@@ -31,7 +31,7 @@ var CAPABILITY_REGISTRY = {
31
31
  "haptic": ["play", "sequence", "vibrate"],
32
32
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
33
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
- "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
34
+ "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
35
35
  "keyboard": ["dismiss"],
36
36
  "legacy_import": ["ack", "read"],
37
37
  "live_activity": ["end", "start", "update"],
@@ -31,7 +31,7 @@ var CAPABILITY_REGISTRY = {
31
31
  "haptic": ["play", "sequence", "vibrate"],
32
32
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
33
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
- "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore"],
34
+ "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
35
35
  "keyboard": ["dismiss"],
36
36
  "legacy_import": ["ack", "read"],
37
37
  "live_activity": ["end", "start", "update"],