@wix/himalaya-cli 0.2047.0 → 0.2049.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 (308) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/index.d.ts +5 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/iap/src/monitoring.d.ts +81 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/apple-iap-contract.d.ts +7 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/iap-checkout/src/checkout-monitoring.d.ts +23 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -1
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap-checkout.mjs +530 -68
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/iap.mjs +198 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -1
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +532 -70
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
  18. package/dist/browser-plane/assets.json +5 -5
  19. package/dist/browser-plane/preview-deferred/{bfa6093b86d3106ef891a717dc0da1b1c0d9d1a456259753c25398bbafbcef8e.bin → 78e9187a8551e2a63e7bc9f5cda8449c6a39ba3d9bcfa40947713322e68a3e3b.bin} +1 -1
  20. package/dist/browser-plane/sw.js +7 -7
  21. package/dist/cli.mjs +51 -47
  22. package/dist/preview-assets.generated.bin +0 -0
  23. package/guides/sdk-reference.json +121 -2
  24. package/package.json +2 -2
  25. package/templates/beauty-salon/l10n/ar.json +6 -0
  26. package/templates/beauty-salon/l10n/cs.json +6 -0
  27. package/templates/beauty-salon/l10n/da.json +6 -0
  28. package/templates/beauty-salon/l10n/de.json +6 -0
  29. package/templates/beauty-salon/l10n/el.json +6 -0
  30. package/templates/beauty-salon/l10n/en.json +6 -0
  31. package/templates/beauty-salon/l10n/es.json +6 -0
  32. package/templates/beauty-salon/l10n/fi.json +6 -0
  33. package/templates/beauty-salon/l10n/fr.json +6 -0
  34. package/templates/beauty-salon/l10n/he.json +5 -0
  35. package/templates/beauty-salon/l10n/hu.json +6 -0
  36. package/templates/beauty-salon/l10n/id.json +6 -0
  37. package/templates/beauty-salon/l10n/it.json +6 -0
  38. package/templates/beauty-salon/l10n/ja.json +6 -0
  39. package/templates/beauty-salon/l10n/ko.json +6 -0
  40. package/templates/beauty-salon/l10n/lt.json +6 -0
  41. package/templates/beauty-salon/l10n/nl.json +6 -0
  42. package/templates/beauty-salon/l10n/no.json +6 -0
  43. package/templates/beauty-salon/l10n/pl.json +6 -0
  44. package/templates/beauty-salon/l10n/pt.json +6 -0
  45. package/templates/beauty-salon/l10n/ru.json +6 -0
  46. package/templates/beauty-salon/l10n/sv.json +6 -0
  47. package/templates/beauty-salon/l10n/th.json +6 -0
  48. package/templates/beauty-salon/l10n/tr.json +6 -0
  49. package/templates/beauty-salon/l10n/uk.json +6 -0
  50. package/templates/beauty-salon/l10n/vi.json +6 -0
  51. package/templates/beauty-salon/l10n/zh.json +6 -0
  52. package/templates/beauty-salon/tier5-src/_shared/relative-time.ts +35 -2
  53. package/templates/branded-lite/recipes/announcement-card.json +85 -34
  54. package/templates/branded-lite/tier5-src/_shared/announcement-section.ts +52 -10
  55. package/templates/branded-lite/tier5-src/_shared/relative-time.ts +35 -2
  56. package/templates/community-club/l10n/ar.json +6 -0
  57. package/templates/community-club/l10n/cs.json +6 -0
  58. package/templates/community-club/l10n/da.json +6 -0
  59. package/templates/community-club/l10n/de.json +6 -0
  60. package/templates/community-club/l10n/el.json +6 -0
  61. package/templates/community-club/l10n/en.json +6 -0
  62. package/templates/community-club/l10n/es.json +6 -0
  63. package/templates/community-club/l10n/fi.json +6 -0
  64. package/templates/community-club/l10n/fr.json +6 -0
  65. package/templates/community-club/l10n/he.json +5 -0
  66. package/templates/community-club/l10n/hu.json +6 -0
  67. package/templates/community-club/l10n/id.json +6 -0
  68. package/templates/community-club/l10n/it.json +6 -0
  69. package/templates/community-club/l10n/ja.json +6 -0
  70. package/templates/community-club/l10n/ko.json +6 -0
  71. package/templates/community-club/l10n/lt.json +6 -0
  72. package/templates/community-club/l10n/nl.json +6 -0
  73. package/templates/community-club/l10n/no.json +6 -0
  74. package/templates/community-club/l10n/pl.json +6 -0
  75. package/templates/community-club/l10n/pt.json +6 -0
  76. package/templates/community-club/l10n/ru.json +6 -0
  77. package/templates/community-club/l10n/sv.json +6 -0
  78. package/templates/community-club/l10n/th.json +6 -0
  79. package/templates/community-club/l10n/tr.json +6 -0
  80. package/templates/community-club/l10n/uk.json +6 -0
  81. package/templates/community-club/l10n/vi.json +6 -0
  82. package/templates/community-club/l10n/zh.json +6 -0
  83. package/templates/community-club/tier5-src/_shared/relative-time.ts +35 -2
  84. package/templates/events-meetups/l10n/ar.json +6 -0
  85. package/templates/events-meetups/l10n/cs.json +6 -0
  86. package/templates/events-meetups/l10n/da.json +6 -0
  87. package/templates/events-meetups/l10n/de.json +6 -0
  88. package/templates/events-meetups/l10n/el.json +6 -0
  89. package/templates/events-meetups/l10n/en.json +6 -0
  90. package/templates/events-meetups/l10n/es.json +6 -0
  91. package/templates/events-meetups/l10n/fi.json +6 -0
  92. package/templates/events-meetups/l10n/fr.json +6 -0
  93. package/templates/events-meetups/l10n/he.json +5 -0
  94. package/templates/events-meetups/l10n/hu.json +6 -0
  95. package/templates/events-meetups/l10n/id.json +6 -0
  96. package/templates/events-meetups/l10n/it.json +6 -0
  97. package/templates/events-meetups/l10n/ja.json +6 -0
  98. package/templates/events-meetups/l10n/ko.json +6 -0
  99. package/templates/events-meetups/l10n/lt.json +6 -0
  100. package/templates/events-meetups/l10n/nl.json +6 -0
  101. package/templates/events-meetups/l10n/no.json +6 -0
  102. package/templates/events-meetups/l10n/pl.json +6 -0
  103. package/templates/events-meetups/l10n/pt.json +6 -0
  104. package/templates/events-meetups/l10n/ru.json +6 -0
  105. package/templates/events-meetups/l10n/sv.json +6 -0
  106. package/templates/events-meetups/l10n/th.json +6 -0
  107. package/templates/events-meetups/l10n/tr.json +6 -0
  108. package/templates/events-meetups/l10n/uk.json +6 -0
  109. package/templates/events-meetups/l10n/vi.json +6 -0
  110. package/templates/events-meetups/l10n/zh.json +6 -0
  111. package/templates/events-meetups/tier5-src/_shared/relative-time.ts +35 -2
  112. package/templates/gym-fitness/l10n/ar.json +6 -0
  113. package/templates/gym-fitness/l10n/cs.json +6 -0
  114. package/templates/gym-fitness/l10n/da.json +6 -0
  115. package/templates/gym-fitness/l10n/de.json +6 -0
  116. package/templates/gym-fitness/l10n/el.json +6 -0
  117. package/templates/gym-fitness/l10n/en.json +6 -0
  118. package/templates/gym-fitness/l10n/es.json +6 -0
  119. package/templates/gym-fitness/l10n/fi.json +6 -0
  120. package/templates/gym-fitness/l10n/fr.json +6 -0
  121. package/templates/gym-fitness/l10n/he.json +5 -0
  122. package/templates/gym-fitness/l10n/hu.json +6 -0
  123. package/templates/gym-fitness/l10n/id.json +6 -0
  124. package/templates/gym-fitness/l10n/it.json +6 -0
  125. package/templates/gym-fitness/l10n/ja.json +6 -0
  126. package/templates/gym-fitness/l10n/ko.json +6 -0
  127. package/templates/gym-fitness/l10n/lt.json +6 -0
  128. package/templates/gym-fitness/l10n/nl.json +6 -0
  129. package/templates/gym-fitness/l10n/no.json +6 -0
  130. package/templates/gym-fitness/l10n/pl.json +6 -0
  131. package/templates/gym-fitness/l10n/pt.json +6 -0
  132. package/templates/gym-fitness/l10n/ru.json +6 -0
  133. package/templates/gym-fitness/l10n/sv.json +6 -0
  134. package/templates/gym-fitness/l10n/th.json +6 -0
  135. package/templates/gym-fitness/l10n/tr.json +6 -0
  136. package/templates/gym-fitness/l10n/uk.json +6 -0
  137. package/templates/gym-fitness/l10n/vi.json +6 -0
  138. package/templates/gym-fitness/l10n/zh.json +6 -0
  139. package/templates/gym-fitness/tier5-src/_shared/relative-time.ts +35 -2
  140. package/templates/nonprofit-cause/l10n/ar.json +6 -0
  141. package/templates/nonprofit-cause/l10n/cs.json +6 -0
  142. package/templates/nonprofit-cause/l10n/da.json +6 -0
  143. package/templates/nonprofit-cause/l10n/de.json +6 -0
  144. package/templates/nonprofit-cause/l10n/el.json +6 -0
  145. package/templates/nonprofit-cause/l10n/en.json +6 -0
  146. package/templates/nonprofit-cause/l10n/es.json +6 -0
  147. package/templates/nonprofit-cause/l10n/fi.json +6 -0
  148. package/templates/nonprofit-cause/l10n/fr.json +6 -0
  149. package/templates/nonprofit-cause/l10n/he.json +5 -0
  150. package/templates/nonprofit-cause/l10n/hu.json +6 -0
  151. package/templates/nonprofit-cause/l10n/id.json +6 -0
  152. package/templates/nonprofit-cause/l10n/it.json +6 -0
  153. package/templates/nonprofit-cause/l10n/ja.json +6 -0
  154. package/templates/nonprofit-cause/l10n/ko.json +6 -0
  155. package/templates/nonprofit-cause/l10n/lt.json +6 -0
  156. package/templates/nonprofit-cause/l10n/nl.json +6 -0
  157. package/templates/nonprofit-cause/l10n/no.json +6 -0
  158. package/templates/nonprofit-cause/l10n/pl.json +6 -0
  159. package/templates/nonprofit-cause/l10n/pt.json +6 -0
  160. package/templates/nonprofit-cause/l10n/ru.json +6 -0
  161. package/templates/nonprofit-cause/l10n/sv.json +6 -0
  162. package/templates/nonprofit-cause/l10n/th.json +6 -0
  163. package/templates/nonprofit-cause/l10n/tr.json +6 -0
  164. package/templates/nonprofit-cause/l10n/uk.json +6 -0
  165. package/templates/nonprofit-cause/l10n/vi.json +6 -0
  166. package/templates/nonprofit-cause/l10n/zh.json +6 -0
  167. package/templates/nonprofit-cause/tier5-src/_shared/relative-time.ts +35 -2
  168. package/templates/podcast-creator/l10n/ar.json +6 -0
  169. package/templates/podcast-creator/l10n/cs.json +6 -0
  170. package/templates/podcast-creator/l10n/da.json +6 -0
  171. package/templates/podcast-creator/l10n/de.json +6 -0
  172. package/templates/podcast-creator/l10n/el.json +6 -0
  173. package/templates/podcast-creator/l10n/en.json +6 -0
  174. package/templates/podcast-creator/l10n/es.json +6 -0
  175. package/templates/podcast-creator/l10n/fi.json +6 -0
  176. package/templates/podcast-creator/l10n/fr.json +6 -0
  177. package/templates/podcast-creator/l10n/he.json +5 -0
  178. package/templates/podcast-creator/l10n/hu.json +6 -0
  179. package/templates/podcast-creator/l10n/id.json +6 -0
  180. package/templates/podcast-creator/l10n/it.json +6 -0
  181. package/templates/podcast-creator/l10n/ja.json +6 -0
  182. package/templates/podcast-creator/l10n/ko.json +6 -0
  183. package/templates/podcast-creator/l10n/lt.json +6 -0
  184. package/templates/podcast-creator/l10n/nl.json +6 -0
  185. package/templates/podcast-creator/l10n/no.json +6 -0
  186. package/templates/podcast-creator/l10n/pl.json +6 -0
  187. package/templates/podcast-creator/l10n/pt.json +6 -0
  188. package/templates/podcast-creator/l10n/ru.json +6 -0
  189. package/templates/podcast-creator/l10n/sv.json +6 -0
  190. package/templates/podcast-creator/l10n/th.json +6 -0
  191. package/templates/podcast-creator/l10n/tr.json +6 -0
  192. package/templates/podcast-creator/l10n/uk.json +6 -0
  193. package/templates/podcast-creator/l10n/vi.json +6 -0
  194. package/templates/podcast-creator/l10n/zh.json +6 -0
  195. package/templates/podcast-creator/tier5-src/_shared/relative-time.ts +35 -2
  196. package/templates/portfolio-creative/l10n/ar.json +6 -0
  197. package/templates/portfolio-creative/l10n/cs.json +6 -0
  198. package/templates/portfolio-creative/l10n/da.json +6 -0
  199. package/templates/portfolio-creative/l10n/de.json +6 -0
  200. package/templates/portfolio-creative/l10n/el.json +6 -0
  201. package/templates/portfolio-creative/l10n/en.json +6 -0
  202. package/templates/portfolio-creative/l10n/es.json +6 -0
  203. package/templates/portfolio-creative/l10n/fi.json +6 -0
  204. package/templates/portfolio-creative/l10n/fr.json +6 -0
  205. package/templates/portfolio-creative/l10n/he.json +5 -0
  206. package/templates/portfolio-creative/l10n/hu.json +6 -0
  207. package/templates/portfolio-creative/l10n/id.json +6 -0
  208. package/templates/portfolio-creative/l10n/it.json +6 -0
  209. package/templates/portfolio-creative/l10n/ja.json +6 -0
  210. package/templates/portfolio-creative/l10n/ko.json +6 -0
  211. package/templates/portfolio-creative/l10n/lt.json +6 -0
  212. package/templates/portfolio-creative/l10n/nl.json +6 -0
  213. package/templates/portfolio-creative/l10n/no.json +6 -0
  214. package/templates/portfolio-creative/l10n/pl.json +6 -0
  215. package/templates/portfolio-creative/l10n/pt.json +6 -0
  216. package/templates/portfolio-creative/l10n/ru.json +6 -0
  217. package/templates/portfolio-creative/l10n/sv.json +6 -0
  218. package/templates/portfolio-creative/l10n/th.json +6 -0
  219. package/templates/portfolio-creative/l10n/tr.json +6 -0
  220. package/templates/portfolio-creative/l10n/uk.json +6 -0
  221. package/templates/portfolio-creative/l10n/vi.json +6 -0
  222. package/templates/portfolio-creative/l10n/zh.json +6 -0
  223. package/templates/portfolio-creative/tier5-src/_shared/relative-time.ts +35 -2
  224. package/templates/professional-services/tier5-src/_shared/relative-time.ts +35 -2
  225. package/templates/restaurant/l10n/ar.json +6 -0
  226. package/templates/restaurant/l10n/cs.json +6 -0
  227. package/templates/restaurant/l10n/da.json +6 -0
  228. package/templates/restaurant/l10n/de.json +6 -0
  229. package/templates/restaurant/l10n/el.json +6 -0
  230. package/templates/restaurant/l10n/en.json +6 -0
  231. package/templates/restaurant/l10n/es.json +6 -0
  232. package/templates/restaurant/l10n/fi.json +6 -0
  233. package/templates/restaurant/l10n/fr.json +6 -0
  234. package/templates/restaurant/l10n/he.json +5 -0
  235. package/templates/restaurant/l10n/hu.json +6 -0
  236. package/templates/restaurant/l10n/id.json +6 -0
  237. package/templates/restaurant/l10n/it.json +6 -0
  238. package/templates/restaurant/l10n/ja.json +6 -0
  239. package/templates/restaurant/l10n/ko.json +6 -0
  240. package/templates/restaurant/l10n/lt.json +6 -0
  241. package/templates/restaurant/l10n/nl.json +6 -0
  242. package/templates/restaurant/l10n/no.json +6 -0
  243. package/templates/restaurant/l10n/pl.json +6 -0
  244. package/templates/restaurant/l10n/pt.json +6 -0
  245. package/templates/restaurant/l10n/ru.json +6 -0
  246. package/templates/restaurant/l10n/sv.json +6 -0
  247. package/templates/restaurant/l10n/th.json +6 -0
  248. package/templates/restaurant/l10n/tr.json +6 -0
  249. package/templates/restaurant/l10n/uk.json +6 -0
  250. package/templates/restaurant/l10n/vi.json +6 -0
  251. package/templates/restaurant/l10n/zh.json +6 -0
  252. package/templates/restaurant/tier5-src/_shared/relative-time.ts +35 -2
  253. package/templates/retail-store/l10n/ar.json +6 -0
  254. package/templates/retail-store/l10n/cs.json +6 -0
  255. package/templates/retail-store/l10n/da.json +6 -0
  256. package/templates/retail-store/l10n/de.json +6 -0
  257. package/templates/retail-store/l10n/el.json +6 -0
  258. package/templates/retail-store/l10n/en.json +6 -0
  259. package/templates/retail-store/l10n/es.json +6 -0
  260. package/templates/retail-store/l10n/fi.json +6 -0
  261. package/templates/retail-store/l10n/fr.json +6 -0
  262. package/templates/retail-store/l10n/he.json +5 -0
  263. package/templates/retail-store/l10n/hu.json +6 -0
  264. package/templates/retail-store/l10n/id.json +6 -0
  265. package/templates/retail-store/l10n/it.json +6 -0
  266. package/templates/retail-store/l10n/ja.json +6 -0
  267. package/templates/retail-store/l10n/ko.json +6 -0
  268. package/templates/retail-store/l10n/lt.json +6 -0
  269. package/templates/retail-store/l10n/nl.json +6 -0
  270. package/templates/retail-store/l10n/no.json +6 -0
  271. package/templates/retail-store/l10n/pl.json +6 -0
  272. package/templates/retail-store/l10n/pt.json +6 -0
  273. package/templates/retail-store/l10n/ru.json +6 -0
  274. package/templates/retail-store/l10n/sv.json +6 -0
  275. package/templates/retail-store/l10n/th.json +6 -0
  276. package/templates/retail-store/l10n/tr.json +6 -0
  277. package/templates/retail-store/l10n/uk.json +6 -0
  278. package/templates/retail-store/l10n/vi.json +6 -0
  279. package/templates/retail-store/l10n/zh.json +6 -0
  280. package/templates/retail-store/tier5-src/_shared/relative-time.ts +35 -2
  281. package/templates/yoga-studio/l10n/ar.json +6 -0
  282. package/templates/yoga-studio/l10n/cs.json +6 -0
  283. package/templates/yoga-studio/l10n/da.json +6 -0
  284. package/templates/yoga-studio/l10n/de.json +6 -0
  285. package/templates/yoga-studio/l10n/el.json +6 -0
  286. package/templates/yoga-studio/l10n/en.json +6 -0
  287. package/templates/yoga-studio/l10n/es.json +6 -0
  288. package/templates/yoga-studio/l10n/fi.json +6 -0
  289. package/templates/yoga-studio/l10n/fr.json +6 -0
  290. package/templates/yoga-studio/l10n/he.json +5 -0
  291. package/templates/yoga-studio/l10n/hu.json +6 -0
  292. package/templates/yoga-studio/l10n/id.json +6 -0
  293. package/templates/yoga-studio/l10n/it.json +6 -0
  294. package/templates/yoga-studio/l10n/ja.json +6 -0
  295. package/templates/yoga-studio/l10n/ko.json +6 -0
  296. package/templates/yoga-studio/l10n/lt.json +6 -0
  297. package/templates/yoga-studio/l10n/nl.json +6 -0
  298. package/templates/yoga-studio/l10n/no.json +6 -0
  299. package/templates/yoga-studio/l10n/pl.json +6 -0
  300. package/templates/yoga-studio/l10n/pt.json +6 -0
  301. package/templates/yoga-studio/l10n/ru.json +6 -0
  302. package/templates/yoga-studio/l10n/sv.json +6 -0
  303. package/templates/yoga-studio/l10n/th.json +6 -0
  304. package/templates/yoga-studio/l10n/tr.json +6 -0
  305. package/templates/yoga-studio/l10n/uk.json +6 -0
  306. package/templates/yoga-studio/l10n/vi.json +6 -0
  307. package/templates/yoga-studio/l10n/zh.json +6 -0
  308. package/templates/yoga-studio/tier5-src/_shared/relative-time.ts +35 -2
@@ -1624,6 +1624,192 @@ var numeric = (value) => typeof value === "number" ? value : void 0;
1624
1624
  var boolean = (value) => typeof value === "boolean" ? value : void 0;
1625
1625
  var zeroPrice = (value) => typeof value === "string" && /^0+(?:\.0+)?$/.test(value);
1626
1626
 
1627
+ // ../../core/sdk/iap/src/monitoring.ts
1628
+ var FORBIDDEN_IAP_FIELDS = [
1629
+ "memberid",
1630
+ "contactid",
1631
+ "sitememberid",
1632
+ "userid",
1633
+ "appuserid",
1634
+ "uuid",
1635
+ "visitorid",
1636
+ "signedtransaction",
1637
+ "jws",
1638
+ "signedinstance",
1639
+ "instance",
1640
+ "signedpayload",
1641
+ "cookie",
1642
+ "cookies",
1643
+ "authorization",
1644
+ "token",
1645
+ "accesstoken",
1646
+ "appaccounttoken",
1647
+ "refreshtoken",
1648
+ "session",
1649
+ "email",
1650
+ "emailaddress",
1651
+ "name",
1652
+ "firstname",
1653
+ "lastname",
1654
+ "fullname",
1655
+ "nickname",
1656
+ "phone"
1657
+ ];
1658
+ var FORBIDDEN = new Set(FORBIDDEN_IAP_FIELDS);
1659
+ var JWS = /^[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}$/;
1660
+ var EMAIL = /[^\s@]+@[^\s@]+\.[^\s@]+/;
1661
+ var HTTP_FAILURE = /^HTTP (\d{3})(?: \[([A-Za-z0-9_]+)\])?/;
1662
+ var TRANSACTION = "IapPurchase";
1663
+ var isForbiddenKey = (key) => FORBIDDEN.has(key.toLowerCase().replace(/[_-]/g, ""));
1664
+ var isForbiddenValue = (value) => typeof value === "string" && (JWS.test(value) || EMAIL.test(value));
1665
+ function scrubIapData(data) {
1666
+ return scrubObject(data, 0);
1667
+ }
1668
+ var MAX_DEPTH = 3;
1669
+ function scrubObject(data, depth) {
1670
+ const kept = {};
1671
+ for (const [key, value] of Object.entries(data)) {
1672
+ if (isForbiddenKey(key)) continue;
1673
+ const scrubbed = scrubValue(value, depth);
1674
+ if (scrubbed !== void 0) kept[key] = scrubbed;
1675
+ }
1676
+ return kept;
1677
+ }
1678
+ function scrubValue(value, depth) {
1679
+ if (value === void 0 || isForbiddenValue(value)) return void 0;
1680
+ if (Array.isArray(value) || isPlainObject2(value)) {
1681
+ if (depth >= MAX_DEPTH) return void 0;
1682
+ return Array.isArray(value) ? value.map((item) => scrubValue(item, depth + 1)).filter((item) => item !== void 0) : scrubObject(value, depth + 1);
1683
+ }
1684
+ return value === null || ["string", "number", "boolean"].includes(typeof value) ? value : void 0;
1685
+ }
1686
+ function describeIapError(error) {
1687
+ try {
1688
+ if (error === void 0 || error === null) return {};
1689
+ const failure3 = typeof error === "object" ? error : {};
1690
+ const http = typeof failure3.message === "string" ? HTTP_FAILURE.exec(failure3.message) : null;
1691
+ const status = failure3.httpStatus ?? failure3.status ?? (http ? Number(http[1]) : void 0);
1692
+ const code = failure3.code ?? failure3.kind ?? http?.[2];
1693
+ return defined({
1694
+ // `httpStatus`, not `status`: an outcome's `status` is the purchase's (bought, failed…).
1695
+ httpStatus: typeof status === "number" ? status : void 0,
1696
+ code: typeof code === "string" ? code : void 0,
1697
+ requestId: typeof failure3.requestId === "string" ? failure3.requestId : void 0,
1698
+ // The error's type, never its message: the bridge copies part of the server's response into
1699
+ // the message, and no filter can recognise every id or token that text may echo.
1700
+ // Read by shape: a rejection can come from another realm.
1701
+ error: typeof failure3.name === "string" && typeof failure3.message === "string" ? failure3.name : void 0
1702
+ });
1703
+ } catch {
1704
+ return {};
1705
+ }
1706
+ }
1707
+ function outcomeLevel(outcome) {
1708
+ if (outcome.status === "failed" || outcome.status === "error") return outcome.charged === true ? "error" : "warn";
1709
+ return "info";
1710
+ }
1711
+ function createIapMonitor(options) {
1712
+ const { sink } = options;
1713
+ const now = options.now ?? Date.now;
1714
+ const newId = options.newId ?? newFlowId;
1715
+ let gateLogged = false;
1716
+ function log(type, data = {}, level = "info") {
1717
+ safely(() => {
1718
+ const shared2 = safeContext(options.context);
1719
+ sink({ type, level, data: scrubIapData({ ...shared2, ...data, eventAt: now() }) });
1720
+ });
1721
+ }
1722
+ function bug(fingerprint, error, data = {}) {
1723
+ log(`iap.bug.${fingerprint.replace("himi-iap-", "")}`, { ...data, ...describeIapError(error), fingerprint }, "error");
1724
+ }
1725
+ function gate(gate2) {
1726
+ if (gateLogged) return;
1727
+ gateLogged = true;
1728
+ log("iap.gate", gate2);
1729
+ }
1730
+ return { log, bug, gate, flow: (entry, ids = {}) => createIapFlow(entry, ids, { log, now, flowId: newId() }) };
1731
+ }
1732
+ function createIapFlow(entry, initial, host) {
1733
+ const { flowId } = host;
1734
+ const ids = {};
1735
+ const stepMs = {};
1736
+ const notes = {};
1737
+ const startedAt = host.now();
1738
+ let stepStartedAt = startedAt;
1739
+ let lastStep;
1740
+ const add = (next) => {
1741
+ Object.assign(ids, defined(next));
1742
+ };
1743
+ const data = (extra = {}) => ({ flowId, entry, ...ids, ...extra });
1744
+ const transaction = () => ({ transaction: TRANSACTION, id: flowId, flowId, entry });
1745
+ const closeStep = () => {
1746
+ const at = host.now();
1747
+ if (lastStep) stepMs[lastStep] = (stepMs[lastStep] ?? 0) + at - stepStartedAt;
1748
+ stepStartedAt = at;
1749
+ };
1750
+ add(initial);
1751
+ return {
1752
+ flowId,
1753
+ entry,
1754
+ add,
1755
+ get knownIds() {
1756
+ return { ...ids };
1757
+ },
1758
+ at(step) {
1759
+ closeStep();
1760
+ lastStep = step;
1761
+ },
1762
+ note(extra) {
1763
+ Object.assign(notes, defined(extra));
1764
+ },
1765
+ started(extra = {}) {
1766
+ host.log("iap.purchase.started", data(extra));
1767
+ host.log("iap.transaction.start", transaction());
1768
+ },
1769
+ failed(step, error, extra = {}, level = extra.charged === true ? "error" : "warn") {
1770
+ host.log(`iap.${step}.failed`, data({ ...describeIapError(error), ...extra }), level);
1771
+ },
1772
+ outcome(outcome, messageKey, extra = {}) {
1773
+ closeStep();
1774
+ host.log("iap.purchase.outcome", data({
1775
+ ...notes,
1776
+ ...outcome,
1777
+ messageKey,
1778
+ lastStep,
1779
+ stepMs: { ...stepMs },
1780
+ durationMs: host.now() - startedAt,
1781
+ ...extra
1782
+ }), outcomeLevel(outcome));
1783
+ if (outcome.status === "bought") host.log("iap.transaction.finish", transaction());
1784
+ }
1785
+ };
1786
+ }
1787
+ function safeContext(context) {
1788
+ try {
1789
+ return context ? { ...context() } : {};
1790
+ } catch {
1791
+ return {};
1792
+ }
1793
+ }
1794
+ function safely(run) {
1795
+ try {
1796
+ run();
1797
+ } catch {
1798
+ }
1799
+ }
1800
+ function defined(data) {
1801
+ return Object.fromEntries(Object.entries(data).filter(([, value]) => value !== void 0));
1802
+ }
1803
+ function isPlainObject2(value) {
1804
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
1805
+ const prototype = Object.getPrototypeOf(value);
1806
+ return prototype === Object.prototype || prototype === null;
1807
+ }
1808
+ function newFlowId() {
1809
+ const random = globalThis.crypto?.randomUUID?.();
1810
+ return random ?? `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
1811
+ }
1812
+
1627
1813
  // ../../core/sdk/iap/src/index.ts
1628
1814
  async function getPaywallConfig() {
1629
1815
  const r = await dispatch("capability.iap.getPaywallConfig");
@@ -1643,6 +1829,12 @@ async function storefrontCountryCode() {
1643
1829
  return null;
1644
1830
  }
1645
1831
  }
1832
+ var nativeIapEventSink = (event) => {
1833
+ try {
1834
+ dispatch("capability.iap.logEvent", { type: event.type, level: event.level, data: JSON.stringify(event.data) }).catch(() => void 0);
1835
+ } catch {
1836
+ }
1837
+ };
1646
1838
  async function getProducts(productIds) {
1647
1839
  if (!productIds || productIds.length === 0) return [];
1648
1840
  const r = await dispatch("capability.iap.getProducts", {
@@ -1766,6 +1958,7 @@ export {
1766
1958
  APPLE_PRICING_RULES,
1767
1959
  APPLE_PROVISIONING_RULES,
1768
1960
  APPLE_SALE_RULES,
1961
+ FORBIDDEN_IAP_FIELDS,
1769
1962
  HIMALAYA_SERVE_IAP_ROUTE,
1770
1963
  IAP_CATALOG_KINDS,
1771
1964
  MAX_AUTOMATIC_ATTEMPTS,
@@ -1782,9 +1975,11 @@ export {
1782
1975
  consume,
1783
1976
  createHostSession,
1784
1977
  createIapCatalogPricing,
1978
+ createIapMonitor,
1785
1979
  createPricingController,
1786
1980
  createPurchaseCoordinator,
1787
1981
  createWixIapClient,
1982
+ describeIapError,
1788
1983
  entitlements,
1789
1984
  finishTransaction,
1790
1985
  getPaywallConfig,
@@ -1794,11 +1989,14 @@ export {
1794
1989
  hostSessionFromGlobal,
1795
1990
  iapPriceFields,
1796
1991
  memberIdentityOf,
1992
+ nativeIapEventSink,
1797
1993
  onlineProgramItem,
1994
+ outcomeLevel,
1798
1995
  purchase,
1799
1996
  purchaseForVerification,
1800
1997
  readIdentityBound,
1801
1998
  restore,
1999
+ scrubIapData,
1802
2000
  sharedHostAppBindingSource,
1803
2001
  storefrontCountryCode,
1804
2002
  ticketAttendanceOf,
@@ -33,7 +33,7 @@ var CAPABILITY_REGISTRY = {
33
33
  "haptic": ["play", "sequence", "vibrate"],
34
34
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
35
35
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
36
- "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "logEvent", "purchase", "purchaseForVerification", "restore", "storefront"],
37
37
  "image_labeling": ["availability", "label"],
38
38
  "keyboard": ["dismiss"],
39
39
  "legacy_import": ["ack", "read"],
@@ -33,7 +33,7 @@ var CAPABILITY_REGISTRY = {
33
33
  "haptic": ["play", "sequence", "vibrate"],
34
34
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
35
35
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
36
- "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "logEvent", "purchase", "purchaseForVerification", "restore", "storefront"],
37
37
  "image_labeling": ["availability", "label"],
38
38
  "keyboard": ["dismiss"],
39
39
  "legacy_import": ["ack", "read"],
@@ -33,7 +33,7 @@ var CAPABILITY_REGISTRY = {
33
33
  "haptic": ["play", "sequence", "vibrate"],
34
34
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
35
35
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
36
- "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "logEvent", "purchase", "purchaseForVerification", "restore", "storefront"],
37
37
  "image_labeling": ["availability", "label"],
38
38
  "keyboard": ["dismiss"],
39
39
  "legacy_import": ["ack", "read"],