@merchi/sdk 1.40.2

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 (662) hide show
  1. package/.eslintrc.cjs +43 -0
  2. package/.turbo/turbo-build.log +1 -0
  3. package/.turbo/turbo-test.log +849 -0
  4. package/LICENSE +21 -0
  5. package/README.md +244 -0
  6. package/coverage/clover.xml +5057 -0
  7. package/coverage/coverage-final.json +133 -0
  8. package/coverage/lcov-report/base.css +224 -0
  9. package/coverage/lcov-report/block-navigation.js +87 -0
  10. package/coverage/lcov-report/favicon.png +0 -0
  11. package/coverage/lcov-report/index.html +191 -0
  12. package/coverage/lcov-report/prettify.css +1 -0
  13. package/coverage/lcov-report/prettify.js +2 -0
  14. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  15. package/coverage/lcov-report/sorter.js +210 -0
  16. package/coverage/lcov-report/src/constants/auto_assign_production_on_actions.ts.html +103 -0
  17. package/coverage/lcov-report/src/constants/call_to_actions.ts.html +127 -0
  18. package/coverage/lcov-report/src/constants/discount_types.ts.html +100 -0
  19. package/coverage/lcov-report/src/constants/domain_types.ts.html +121 -0
  20. package/coverage/lcov-report/src/constants/errors.ts.html +181 -0
  21. package/coverage/lcov-report/src/constants/event_types.ts.html +100 -0
  22. package/coverage/lcov-report/src/constants/field_types.ts.html +133 -0
  23. package/coverage/lcov-report/src/constants/index.html +551 -0
  24. package/coverage/lcov-report/src/constants/index.ts.html +238 -0
  25. package/coverage/lcov-report/src/constants/input_types.ts.html +124 -0
  26. package/coverage/lcov-report/src/constants/inventory_statuses.ts.html +103 -0
  27. package/coverage/lcov-report/src/constants/invoice_types.ts.html +100 -0
  28. package/coverage/lcov-report/src/constants/item_types.ts.html +100 -0
  29. package/coverage/lcov-report/src/constants/job/drafting_status.ts.html +106 -0
  30. package/coverage/lcov-report/src/constants/job/index.html +176 -0
  31. package/coverage/lcov-report/src/constants/job/payment_status.ts.html +106 -0
  32. package/coverage/lcov-report/src/constants/job/production_status.ts.html +121 -0
  33. package/coverage/lcov-report/src/constants/job/shipment_status.ts.html +118 -0
  34. package/coverage/lcov-report/src/constants/job/supply_chain_request_status.ts.html +103 -0
  35. package/coverage/lcov-report/src/constants/job_priorities.ts.html +103 -0
  36. package/coverage/lcov-report/src/constants/job_status.ts.html +232 -0
  37. package/coverage/lcov-report/src/constants/job_types.ts.html +133 -0
  38. package/coverage/lcov-report/src/constants/notification_sections.ts.html +124 -0
  39. package/coverage/lcov-report/src/constants/notification_types.ts.html +385 -0
  40. package/coverage/lcov-report/src/constants/notification_urgencies.ts.html +106 -0
  41. package/coverage/lcov-report/src/constants/payment_types.ts.html +115 -0
  42. package/coverage/lcov-report/src/constants/platform.ts.html +103 -0
  43. package/coverage/lcov-report/src/constants/product_types.ts.html +163 -0
  44. package/coverage/lcov-report/src/constants/rights.ts.html +100 -0
  45. package/coverage/lcov-report/src/constants/robots_meta_directives.ts.html +118 -0
  46. package/coverage/lcov-report/src/constants/roles.ts.html +223 -0
  47. package/coverage/lcov-report/src/constants/shipment_companies.ts.html +142 -0
  48. package/coverage/lcov-report/src/constants/shipment_services.ts.html +94 -0
  49. package/coverage/lcov-report/src/constants/system_roles.ts.html +94 -0
  50. package/coverage/lcov-report/src/constants/theme_status.ts.html +100 -0
  51. package/coverage/lcov-report/src/constants/user_types.ts.html +136 -0
  52. package/coverage/lcov-report/src/constants/white_label_accessibilities.ts.html +103 -0
  53. package/coverage/lcov-report/src/cookie.ts.html +133 -0
  54. package/coverage/lcov-report/src/entities/address.ts.html +280 -0
  55. package/coverage/lcov-report/src/entities/agent_conversation.ts.html +202 -0
  56. package/coverage/lcov-report/src/entities/agent_skill.ts.html +382 -0
  57. package/coverage/lcov-report/src/entities/agent_skill_approval.ts.html +163 -0
  58. package/coverage/lcov-report/src/entities/agent_skill_version.ts.html +277 -0
  59. package/coverage/lcov-report/src/entities/agent_token_usage.ts.html +349 -0
  60. package/coverage/lcov-report/src/entities/assignment.ts.html +382 -0
  61. package/coverage/lcov-report/src/entities/automatic_payment_relationship.ts.html +172 -0
  62. package/coverage/lcov-report/src/entities/bank.ts.html +220 -0
  63. package/coverage/lcov-report/src/entities/cart.ts.html +391 -0
  64. package/coverage/lcov-report/src/entities/cart_item.ts.html +340 -0
  65. package/coverage/lcov-report/src/entities/cart_shipment_group.ts.html +148 -0
  66. package/coverage/lcov-report/src/entities/cart_shipment_quote.ts.html +184 -0
  67. package/coverage/lcov-report/src/entities/category.ts.html +262 -0
  68. package/coverage/lcov-report/src/entities/company.ts.html +1276 -0
  69. package/coverage/lcov-report/src/entities/company_invitation.ts.html +184 -0
  70. package/coverage/lcov-report/src/entities/country_tax.ts.html +223 -0
  71. package/coverage/lcov-report/src/entities/discount.ts.html +235 -0
  72. package/coverage/lcov-report/src/entities/discount_group.ts.html +214 -0
  73. package/coverage/lcov-report/src/entities/domain.ts.html +3349 -0
  74. package/coverage/lcov-report/src/entities/domain_chat_settings.ts.html +331 -0
  75. package/coverage/lcov-report/src/entities/domain_invitation.ts.html +193 -0
  76. package/coverage/lcov-report/src/entities/domain_tag.ts.html +211 -0
  77. package/coverage/lcov-report/src/entities/draft.ts.html +322 -0
  78. package/coverage/lcov-report/src/entities/draft_comment.ts.html +274 -0
  79. package/coverage/lcov-report/src/entities/draft_preview.ts.html +196 -0
  80. package/coverage/lcov-report/src/entities/draft_preview_layer.ts.html +148 -0
  81. package/coverage/lcov-report/src/entities/draft_template.ts.html +328 -0
  82. package/coverage/lcov-report/src/entities/email_address.ts.html +157 -0
  83. package/coverage/lcov-report/src/entities/email_counter.ts.html +145 -0
  84. package/coverage/lcov-report/src/entities/enrolled_domain.ts.html +205 -0
  85. package/coverage/lcov-report/src/entities/exchange_rate.ts.html +151 -0
  86. package/coverage/lcov-report/src/entities/file.ts.html +580 -0
  87. package/coverage/lcov-report/src/entities/index.html +1271 -0
  88. package/coverage/lcov-report/src/entities/internal_tag.ts.html +238 -0
  89. package/coverage/lcov-report/src/entities/inventory.ts.html +274 -0
  90. package/coverage/lcov-report/src/entities/inventory_group.ts.html +193 -0
  91. package/coverage/lcov-report/src/entities/inventory_unit_variation.ts.html +172 -0
  92. package/coverage/lcov-report/src/entities/invoice.ts.html +661 -0
  93. package/coverage/lcov-report/src/entities/item.ts.html +262 -0
  94. package/coverage/lcov-report/src/entities/job.ts.html +1288 -0
  95. package/coverage/lcov-report/src/entities/job_comment.ts.html +244 -0
  96. package/coverage/lcov-report/src/entities/job_note.ts.html +205 -0
  97. package/coverage/lcov-report/src/entities/job_operation_log.ts.html +208 -0
  98. package/coverage/lcov-report/src/entities/matching_inventory.ts.html +172 -0
  99. package/coverage/lcov-report/src/entities/notification.ts.html +403 -0
  100. package/coverage/lcov-report/src/entities/payment.ts.html +316 -0
  101. package/coverage/lcov-report/src/entities/payment_device.ts.html +175 -0
  102. package/coverage/lcov-report/src/entities/phone_number.ts.html +193 -0
  103. package/coverage/lcov-report/src/entities/product.ts.html +1543 -0
  104. package/coverage/lcov-report/src/entities/product_form.ts.html +238 -0
  105. package/coverage/lcov-report/src/entities/product_form_version.ts.html +238 -0
  106. package/coverage/lcov-report/src/entities/product_review.ts.html +748 -0
  107. package/coverage/lcov-report/src/entities/production_comment.ts.html +244 -0
  108. package/coverage/lcov-report/src/entities/quote.ts.html +505 -0
  109. package/coverage/lcov-report/src/entities/quote_item.ts.html +298 -0
  110. package/coverage/lcov-report/src/entities/reminder.ts.html +307 -0
  111. package/coverage/lcov-report/src/entities/session.ts.html +169 -0
  112. package/coverage/lcov-report/src/entities/shipment.ts.html +673 -0
  113. package/coverage/lcov-report/src/entities/shipment_item.ts.html +130 -0
  114. package/coverage/lcov-report/src/entities/shipment_item_fulfillment.ts.html +130 -0
  115. package/coverage/lcov-report/src/entities/shipment_log.ts.html +196 -0
  116. package/coverage/lcov-report/src/entities/shipment_method.ts.html +268 -0
  117. package/coverage/lcov-report/src/entities/shipment_method_variation.ts.html +202 -0
  118. package/coverage/lcov-report/src/entities/short_url.ts.html +193 -0
  119. package/coverage/lcov-report/src/entities/subscription_plan.ts.html +304 -0
  120. package/coverage/lcov-report/src/entities/supply_domain.ts.html +166 -0
  121. package/coverage/lcov-report/src/entities/support_conversation.ts.html +280 -0
  122. package/coverage/lcov-report/src/entities/support_message.ts.html +175 -0
  123. package/coverage/lcov-report/src/entities/system_role.ts.html +136 -0
  124. package/coverage/lcov-report/src/entities/theme.ts.html +331 -0
  125. package/coverage/lcov-report/src/entities/theme_css_setting.ts.html +154 -0
  126. package/coverage/lcov-report/src/entities/user.ts.html +1369 -0
  127. package/coverage/lcov-report/src/entities/user_company.ts.html +166 -0
  128. package/coverage/lcov-report/src/entities/variation.ts.html +277 -0
  129. package/coverage/lcov-report/src/entities/variation_field.ts.html +889 -0
  130. package/coverage/lcov-report/src/entities/variation_fields_option.ts.html +406 -0
  131. package/coverage/lcov-report/src/entities/variation_option.ts.html +259 -0
  132. package/coverage/lcov-report/src/entities/variations_group.ts.html +208 -0
  133. package/coverage/lcov-report/src/entity.ts.html +3379 -0
  134. package/coverage/lcov-report/src/index.html +221 -0
  135. package/coverage/lcov-report/src/index.ts.html +652 -0
  136. package/coverage/lcov-report/src/merchi.ts.html +1420 -0
  137. package/coverage/lcov-report/src/pricing/discount.ts.html +136 -0
  138. package/coverage/lcov-report/src/pricing/estimate.ts.html +1015 -0
  139. package/coverage/lcov-report/src/pricing/index.html +206 -0
  140. package/coverage/lcov-report/src/pricing/index.ts.html +106 -0
  141. package/coverage/lcov-report/src/pricing/inventory.ts.html +352 -0
  142. package/coverage/lcov-report/src/pricing/matrix.ts.html +736 -0
  143. package/coverage/lcov-report/src/pricing/round.ts.html +166 -0
  144. package/coverage/lcov-report/src/pricing/visibility.ts.html +418 -0
  145. package/coverage/lcov-report/src/request.ts.html +673 -0
  146. package/coverage/lcov-report/src/test_util.ts.html +139 -0
  147. package/coverage/lcov-report/src/toasts.ts.html +187 -0
  148. package/coverage/lcov-report/src/util/float.ts.html +121 -0
  149. package/coverage/lcov-report/src/util/index.html +161 -0
  150. package/coverage/lcov-report/src/util/index.ts.html +106 -0
  151. package/coverage/lcov-report/src/util/query_string.ts.html +124 -0
  152. package/coverage/lcov-report/src/util/validation.ts.html +91 -0
  153. package/coverage/lcov-report/src/uuid.ts.html +109 -0
  154. package/coverage/lcov.info +7758 -0
  155. package/dist/constants/auto_assign_production_on_actions.js +7 -0
  156. package/dist/constants/call_to_actions.js +15 -0
  157. package/dist/constants/call_to_actions.test.js +4 -0
  158. package/dist/constants/discount_types.js +6 -0
  159. package/dist/constants/discount_types.test.js +4 -0
  160. package/dist/constants/domain_types.js +13 -0
  161. package/dist/constants/domain_types.test.js +4 -0
  162. package/dist/constants/errors.js +32 -0
  163. package/dist/constants/event_types.js +6 -0
  164. package/dist/constants/event_types.test.js +4 -0
  165. package/dist/constants/field_types.js +17 -0
  166. package/dist/constants/field_types.test.js +4 -0
  167. package/dist/constants/index.js +25 -0
  168. package/dist/constants/input_types.js +14 -0
  169. package/dist/constants/input_types.test.js +4 -0
  170. package/dist/constants/inventory_status.test.js +4 -0
  171. package/dist/constants/inventory_statuses.js +7 -0
  172. package/dist/constants/invoice_types.js +6 -0
  173. package/dist/constants/invoice_types.test.js +4 -0
  174. package/dist/constants/item_types.js +6 -0
  175. package/dist/constants/item_types.test.js +4 -0
  176. package/dist/constants/job/drafting_status.js +8 -0
  177. package/dist/constants/job/drafting_status.test.js +4 -0
  178. package/dist/constants/job/payment_status.js +8 -0
  179. package/dist/constants/job/payment_status.test.js +4 -0
  180. package/dist/constants/job/production_status.js +13 -0
  181. package/dist/constants/job/production_status.test.js +4 -0
  182. package/dist/constants/job/shipment_status.js +12 -0
  183. package/dist/constants/job/shipment_status.test.js +4 -0
  184. package/dist/constants/job/supply_chain_request_status.js +7 -0
  185. package/dist/constants/job/supply_chain_request_status.test.js +4 -0
  186. package/dist/constants/job_priorities.js +7 -0
  187. package/dist/constants/job_priorities.test.js +4 -0
  188. package/dist/constants/job_status.js +50 -0
  189. package/dist/constants/job_status.test.js +4 -0
  190. package/dist/constants/job_types.js +17 -0
  191. package/dist/constants/job_types.test.js +4 -0
  192. package/dist/constants/notification_sections.js +14 -0
  193. package/dist/constants/notification_sections.test.js +4 -0
  194. package/dist/constants/notification_types.js +101 -0
  195. package/dist/constants/notification_types.test.js +4 -0
  196. package/dist/constants/notification_urgencies.js +7 -0
  197. package/dist/constants/notification_urgencies.test.js +4 -0
  198. package/dist/constants/payment_types.js +11 -0
  199. package/dist/constants/payment_types.test.js +4 -0
  200. package/dist/constants/platform.js +5 -0
  201. package/dist/constants/platform.test.js +8 -0
  202. package/dist/constants/product_types.js +27 -0
  203. package/dist/constants/product_types.test.js +4 -0
  204. package/dist/constants/rights.js +6 -0
  205. package/dist/constants/rights.test.js +4 -0
  206. package/dist/constants/robots_meta_directives.js +11 -0
  207. package/dist/constants/robots_meta_directives.test.js +4 -0
  208. package/dist/constants/roles.js +64 -0
  209. package/dist/constants/roles.test.js +4 -0
  210. package/dist/constants/shipment_companies.js +20 -0
  211. package/dist/constants/shipment_companies.test.js +4 -0
  212. package/dist/constants/shipment_services.js +4 -0
  213. package/dist/constants/shipment_services.test.js +4 -0
  214. package/dist/constants/system_roles.js +4 -0
  215. package/dist/constants/system_roles.test.js +4 -0
  216. package/dist/constants/theme_status.js +6 -0
  217. package/dist/constants/theme_status.test.js +4 -0
  218. package/dist/constants/user_types.js +18 -0
  219. package/dist/constants/user_types.test.js +4 -0
  220. package/dist/constants/white_label_accessibilities.js +6 -0
  221. package/dist/constants/white_label_accessibilities.test.js +4 -0
  222. package/dist/cookie.js +15 -0
  223. package/dist/cookie.test.js +10 -0
  224. package/dist/entities/address.js +104 -0
  225. package/dist/entities/address.test.js +6 -0
  226. package/dist/entities/agent_conversation.js +78 -0
  227. package/dist/entities/agent_conversation.test.js +6 -0
  228. package/dist/entities/agent_skill.js +133 -0
  229. package/dist/entities/agent_skill.test.js +11 -0
  230. package/dist/entities/agent_skill_approval.js +61 -0
  231. package/dist/entities/agent_skill_version.js +99 -0
  232. package/dist/entities/agent_token_analytics.js +1 -0
  233. package/dist/entities/agent_token_usage.js +127 -0
  234. package/dist/entities/agent_token_usage.test.js +6 -0
  235. package/dist/entities/assignment.js +135 -0
  236. package/dist/entities/assignment.test.js +30 -0
  237. package/dist/entities/automatic_payment_relationship.js +65 -0
  238. package/dist/entities/automatic_payment_relationship.test.js +6 -0
  239. package/dist/entities/bank.js +85 -0
  240. package/dist/entities/bank.test.js +6 -0
  241. package/dist/entities/cart.js +173 -0
  242. package/dist/entities/cart.test.js +51 -0
  243. package/dist/entities/cart_item.js +125 -0
  244. package/dist/entities/cart_item.test.js +28 -0
  245. package/dist/entities/cart_shipment_group.js +53 -0
  246. package/dist/entities/cart_shipment_quote.js +70 -0
  247. package/dist/entities/category.js +101 -0
  248. package/dist/entities/category.test.js +52 -0
  249. package/dist/entities/company.js +509 -0
  250. package/dist/entities/company.test.js +6 -0
  251. package/dist/entities/company_invitation.js +70 -0
  252. package/dist/entities/company_invitation.test.js +6 -0
  253. package/dist/entities/country_tax.js +80 -0
  254. package/dist/entities/country_tax.test.js +11 -0
  255. package/dist/entities/discount.js +89 -0
  256. package/dist/entities/discount.test.js +34 -0
  257. package/dist/entities/discount_group.js +80 -0
  258. package/dist/entities/discount_group.test.js +6 -0
  259. package/dist/entities/domain.js +567 -0
  260. package/dist/entities/domain.test.js +356 -0
  261. package/dist/entities/domain_chat_settings.js +134 -0
  262. package/dist/entities/domain_chat_settings.test.js +15 -0
  263. package/dist/entities/domain_invitation.js +74 -0
  264. package/dist/entities/domain_invitation.test.js +6 -0
  265. package/dist/entities/domain_tag.js +77 -0
  266. package/dist/entities/domain_tag.test.js +6 -0
  267. package/dist/entities/draft.js +122 -0
  268. package/dist/entities/draft.test.js +26 -0
  269. package/dist/entities/draft_comment.js +107 -0
  270. package/dist/entities/draft_comment.test.js +6 -0
  271. package/dist/entities/draft_preview.js +74 -0
  272. package/dist/entities/draft_preview.test.js +36 -0
  273. package/dist/entities/draft_preview_layer.js +54 -0
  274. package/dist/entities/draft_preview_layer.test.js +6 -0
  275. package/dist/entities/draft_template.js +119 -0
  276. package/dist/entities/draft_template.test.js +12 -0
  277. package/dist/entities/email_address.js +56 -0
  278. package/dist/entities/email_address.test.js +6 -0
  279. package/dist/entities/email_counter.js +53 -0
  280. package/dist/entities/email_counter.test.js +6 -0
  281. package/dist/entities/enrolled_domain.js +74 -0
  282. package/dist/entities/enrolled_domain.test.js +6 -0
  283. package/dist/entities/exchange_rate.js +56 -0
  284. package/dist/entities/exchange_rate.test.js +6 -0
  285. package/dist/entities/file.js +218 -0
  286. package/dist/entities/file.test.js +38 -0
  287. package/dist/entities/internal_tag.js +84 -0
  288. package/dist/entities/internal_tag.test.js +6 -0
  289. package/dist/entities/inventory.js +97 -0
  290. package/dist/entities/inventory.test.js +22 -0
  291. package/dist/entities/inventory_group.js +69 -0
  292. package/dist/entities/inventory_group.test.js +6 -0
  293. package/dist/entities/inventory_unit_variation.js +61 -0
  294. package/dist/entities/inventory_unit_variation.test.js +6 -0
  295. package/dist/entities/invoice.js +268 -0
  296. package/dist/entities/invoice.test.js +45 -0
  297. package/dist/entities/item.js +96 -0
  298. package/dist/entities/item.test.js +17 -0
  299. package/dist/entities/job.js +519 -0
  300. package/dist/entities/job.test.js +83 -0
  301. package/dist/entities/job_comment.js +94 -0
  302. package/dist/entities/job_comment.test.js +6 -0
  303. package/dist/entities/job_note.js +78 -0
  304. package/dist/entities/job_operation_log.js +82 -0
  305. package/dist/entities/job_operation_log.test.js +6 -0
  306. package/dist/entities/matching_inventory.js +63 -0
  307. package/dist/entities/notification.js +163 -0
  308. package/dist/entities/notification.test.js +51 -0
  309. package/dist/entities/payment.js +122 -0
  310. package/dist/entities/payment.test.js +22 -0
  311. package/dist/entities/payment_device.js +65 -0
  312. package/dist/entities/payment_device.test.js +6 -0
  313. package/dist/entities/phone_number.js +72 -0
  314. package/dist/entities/phone_number.test.js +6 -0
  315. package/dist/entities/product.js +619 -0
  316. package/dist/entities/product.test.js +720 -0
  317. package/dist/entities/product_form.js +92 -0
  318. package/dist/entities/product_form_version.js +95 -0
  319. package/dist/entities/product_review.js +234 -0
  320. package/dist/entities/production_comment.js +94 -0
  321. package/dist/entities/production_comment.test.js +6 -0
  322. package/dist/entities/quote.js +168 -0
  323. package/dist/entities/quote.test.js +86 -0
  324. package/dist/entities/quote_item.js +99 -0
  325. package/dist/entities/quote_item.test.js +40 -0
  326. package/dist/entities/reminder.js +120 -0
  327. package/dist/entities/reminder.test.js +14 -0
  328. package/dist/entities/session.js +63 -0
  329. package/dist/entities/session.test.js +6 -0
  330. package/dist/entities/shipment.js +256 -0
  331. package/dist/entities/shipment.test.js +20 -0
  332. package/dist/entities/shipment_item.js +45 -0
  333. package/dist/entities/shipment_item.test.js +6 -0
  334. package/dist/entities/shipment_item_fulfillment.js +46 -0
  335. package/dist/entities/shipment_item_fulfillment.test.js +6 -0
  336. package/dist/entities/shipment_log.js +75 -0
  337. package/dist/entities/shipment_method.js +104 -0
  338. package/dist/entities/shipment_method.test.js +6 -0
  339. package/dist/entities/shipment_method_variation.js +77 -0
  340. package/dist/entities/shipment_method_variation.test.js +6 -0
  341. package/dist/entities/short_url.js +73 -0
  342. package/dist/entities/short_url.test.js +6 -0
  343. package/dist/entities/subscription_plan.js +122 -0
  344. package/dist/entities/subscription_plan.test.js +6 -0
  345. package/dist/entities/supply_domain.js +62 -0
  346. package/dist/entities/supply_domain.test.js +6 -0
  347. package/dist/entities/support_conversation.js +106 -0
  348. package/dist/entities/support_conversation.test.js +6 -0
  349. package/dist/entities/support_message.js +66 -0
  350. package/dist/entities/support_message.test.js +6 -0
  351. package/dist/entities/system_role.js +49 -0
  352. package/dist/entities/system_role.test.js +6 -0
  353. package/dist/entities/theme.js +125 -0
  354. package/dist/entities/theme.test.js +35 -0
  355. package/dist/entities/theme_css_setting.js +57 -0
  356. package/dist/entities/theme_css_setting.test.js +6 -0
  357. package/dist/entities/user.js +508 -0
  358. package/dist/entities/user.test.js +134 -0
  359. package/dist/entities/user_company.js +62 -0
  360. package/dist/entities/user_company.test.js +6 -0
  361. package/dist/entities/variation.js +108 -0
  362. package/dist/entities/variation.test.js +6 -0
  363. package/dist/entities/variation_field.js +381 -0
  364. package/dist/entities/variation_field.test.js +69 -0
  365. package/dist/entities/variation_fields_option.js +153 -0
  366. package/dist/entities/variation_fields_option.test.js +43 -0
  367. package/dist/entities/variation_option.js +104 -0
  368. package/dist/entities/variation_option.test.js +6 -0
  369. package/dist/entities/variations_group.js +79 -0
  370. package/dist/entities/variations_group.test.js +6 -0
  371. package/dist/entity.js +950 -0
  372. package/dist/index.js +86 -0
  373. package/dist/merchi.js +296 -0
  374. package/dist/merchi.test.js +21 -0
  375. package/dist/pricing/discount.js +11 -0
  376. package/dist/pricing/discount.test.js +35 -0
  377. package/dist/pricing/estimate.js +335 -0
  378. package/dist/pricing/estimate.test.js +403 -0
  379. package/dist/pricing/golden.test.js +61 -0
  380. package/dist/pricing/index.js +7 -0
  381. package/dist/pricing/index.test.js +8 -0
  382. package/dist/pricing/inventory.js +238 -0
  383. package/dist/pricing/inventory.test.js +188 -0
  384. package/dist/pricing/matrix.js +245 -0
  385. package/dist/pricing/matrix.test.js +437 -0
  386. package/dist/pricing/round.js +29 -0
  387. package/dist/pricing/round.test.js +27 -0
  388. package/dist/pricing/types.js +1 -0
  389. package/dist/pricing/visibility.js +227 -0
  390. package/dist/pricing/visibility.test.js +210 -0
  391. package/dist/request.js +169 -0
  392. package/dist/request.test.js +70 -0
  393. package/dist/test_util.js +17 -0
  394. package/dist/toasts.js +14 -0
  395. package/dist/toasts.test.js +28 -0
  396. package/dist/util/float.js +34 -0
  397. package/dist/util/index.js +3 -0
  398. package/dist/util/query_string.js +13 -0
  399. package/dist/util/query_string.test.js +6 -0
  400. package/dist/util/validation.js +3 -0
  401. package/dist/util/validation.test.js +12 -0
  402. package/dist/uuid.js +8 -0
  403. package/dist/uuid.test.js +11 -0
  404. package/jest.config.js +23 -0
  405. package/merchi_sdk_ts-1.13.1.tgz +0 -0
  406. package/package.json +41 -0
  407. package/src/constants/auto_assign_production_on_actions.ts +6 -0
  408. package/src/constants/call_to_actions.test.ts +5 -0
  409. package/src/constants/call_to_actions.ts +14 -0
  410. package/src/constants/discount_types.test.ts +5 -0
  411. package/src/constants/discount_types.ts +5 -0
  412. package/src/constants/domain_types.test.ts +5 -0
  413. package/src/constants/domain_types.ts +12 -0
  414. package/src/constants/errors.ts +32 -0
  415. package/src/constants/event_types.test.ts +5 -0
  416. package/src/constants/event_types.ts +5 -0
  417. package/src/constants/field_types.test.ts +5 -0
  418. package/src/constants/field_types.ts +16 -0
  419. package/src/constants/index.ts +51 -0
  420. package/src/constants/input_types.test.ts +5 -0
  421. package/src/constants/input_types.ts +13 -0
  422. package/src/constants/inventory_status.test.ts +5 -0
  423. package/src/constants/inventory_statuses.ts +6 -0
  424. package/src/constants/invoice_types.test.ts +5 -0
  425. package/src/constants/invoice_types.ts +5 -0
  426. package/src/constants/item_types.test.ts +5 -0
  427. package/src/constants/item_types.ts +5 -0
  428. package/src/constants/job/drafting_status.test.ts +5 -0
  429. package/src/constants/job/drafting_status.ts +7 -0
  430. package/src/constants/job/payment_status.test.ts +5 -0
  431. package/src/constants/job/payment_status.ts +7 -0
  432. package/src/constants/job/production_status.test.ts +5 -0
  433. package/src/constants/job/production_status.ts +12 -0
  434. package/src/constants/job/shipment_status.test.ts +5 -0
  435. package/src/constants/job/shipment_status.ts +11 -0
  436. package/src/constants/job/supply_chain_request_status.test.ts +5 -0
  437. package/src/constants/job/supply_chain_request_status.ts +6 -0
  438. package/src/constants/job_priorities.test.ts +5 -0
  439. package/src/constants/job_priorities.ts +6 -0
  440. package/src/constants/job_status.test.ts +5 -0
  441. package/src/constants/job_status.ts +49 -0
  442. package/src/constants/job_types.test.ts +5 -0
  443. package/src/constants/job_types.ts +16 -0
  444. package/src/constants/notification_sections.test.ts +5 -0
  445. package/src/constants/notification_sections.ts +13 -0
  446. package/src/constants/notification_types.test.ts +5 -0
  447. package/src/constants/notification_types.ts +100 -0
  448. package/src/constants/notification_urgencies.test.ts +5 -0
  449. package/src/constants/notification_urgencies.ts +7 -0
  450. package/src/constants/payment_types.test.ts +5 -0
  451. package/src/constants/payment_types.ts +10 -0
  452. package/src/constants/platform.test.ts +15 -0
  453. package/src/constants/platform.ts +6 -0
  454. package/src/constants/product_types.test.ts +6 -0
  455. package/src/constants/product_types.ts +26 -0
  456. package/src/constants/rights.test.ts +5 -0
  457. package/src/constants/rights.ts +5 -0
  458. package/src/constants/robots_meta_directives.test.ts +5 -0
  459. package/src/constants/robots_meta_directives.ts +11 -0
  460. package/src/constants/roles.test.ts +5 -0
  461. package/src/constants/roles.ts +46 -0
  462. package/src/constants/shipment_companies.test.ts +5 -0
  463. package/src/constants/shipment_companies.ts +19 -0
  464. package/src/constants/shipment_services.test.ts +5 -0
  465. package/src/constants/shipment_services.ts +3 -0
  466. package/src/constants/system_roles.test.ts +5 -0
  467. package/src/constants/system_roles.ts +3 -0
  468. package/src/constants/theme_status.test.ts +5 -0
  469. package/src/constants/theme_status.ts +5 -0
  470. package/src/constants/user_types.test.ts +5 -0
  471. package/src/constants/user_types.ts +17 -0
  472. package/src/constants/white_label_accessibilities.test.ts +5 -0
  473. package/src/constants/white_label_accessibilities.ts +6 -0
  474. package/src/cookie.test.ts +11 -0
  475. package/src/cookie.ts +16 -0
  476. package/src/entities/address.test.ts +7 -0
  477. package/src/entities/address.ts +65 -0
  478. package/src/entities/agent_conversation.test.ts +7 -0
  479. package/src/entities/agent_conversation.ts +39 -0
  480. package/src/entities/agent_skill.test.ts +13 -0
  481. package/src/entities/agent_skill.ts +99 -0
  482. package/src/entities/agent_skill_approval.ts +26 -0
  483. package/src/entities/agent_skill_version.ts +64 -0
  484. package/src/entities/agent_token_analytics.ts +49 -0
  485. package/src/entities/agent_token_usage.test.ts +7 -0
  486. package/src/entities/agent_token_usage.ts +88 -0
  487. package/src/entities/assignment.test.ts +39 -0
  488. package/src/entities/assignment.ts +99 -0
  489. package/src/entities/automatic_payment_relationship.test.ts +8 -0
  490. package/src/entities/automatic_payment_relationship.ts +29 -0
  491. package/src/entities/bank.test.ts +7 -0
  492. package/src/entities/bank.ts +45 -0
  493. package/src/entities/cart.test.ts +57 -0
  494. package/src/entities/cart.ts +102 -0
  495. package/src/entities/cart_item.test.ts +33 -0
  496. package/src/entities/cart_item.ts +85 -0
  497. package/src/entities/cart_shipment_group.ts +21 -0
  498. package/src/entities/cart_shipment_quote.ts +33 -0
  499. package/src/entities/category.test.ts +57 -0
  500. package/src/entities/category.ts +59 -0
  501. package/src/entities/company.test.ts +7 -0
  502. package/src/entities/company.ts +397 -0
  503. package/src/entities/company_invitation.test.ts +7 -0
  504. package/src/entities/company_invitation.ts +33 -0
  505. package/src/entities/country_tax.test.ts +13 -0
  506. package/src/entities/country_tax.ts +46 -0
  507. package/src/entities/discount.test.ts +36 -0
  508. package/src/entities/discount.ts +50 -0
  509. package/src/entities/discount_group.test.ts +7 -0
  510. package/src/entities/discount_group.ts +43 -0
  511. package/src/entities/domain.test.ts +393 -0
  512. package/src/entities/domain.ts +1088 -0
  513. package/src/entities/domain_chat_settings.test.ts +16 -0
  514. package/src/entities/domain_chat_settings.ts +82 -0
  515. package/src/entities/domain_invitation.test.ts +7 -0
  516. package/src/entities/domain_invitation.ts +36 -0
  517. package/src/entities/domain_tag.test.ts +7 -0
  518. package/src/entities/domain_tag.ts +42 -0
  519. package/src/entities/draft.test.ts +29 -0
  520. package/src/entities/draft.ts +79 -0
  521. package/src/entities/draft_comment.test.ts +7 -0
  522. package/src/entities/draft_comment.ts +63 -0
  523. package/src/entities/draft_preview.test.ts +42 -0
  524. package/src/entities/draft_preview.ts +37 -0
  525. package/src/entities/draft_preview_layer.test.ts +7 -0
  526. package/src/entities/draft_preview_layer.ts +21 -0
  527. package/src/entities/draft_template.test.ts +14 -0
  528. package/src/entities/draft_template.ts +81 -0
  529. package/src/entities/email_address.test.ts +7 -0
  530. package/src/entities/email_address.ts +24 -0
  531. package/src/entities/email_counter.test.ts +7 -0
  532. package/src/entities/email_counter.ts +20 -0
  533. package/src/entities/enrolled_domain.test.ts +7 -0
  534. package/src/entities/enrolled_domain.ts +40 -0
  535. package/src/entities/exchange_rate.test.ts +7 -0
  536. package/src/entities/exchange_rate.ts +22 -0
  537. package/src/entities/file.test.ts +43 -0
  538. package/src/entities/file.ts +165 -0
  539. package/src/entities/internal_tag.test.ts +7 -0
  540. package/src/entities/internal_tag.ts +51 -0
  541. package/src/entities/inventory.test.ts +28 -0
  542. package/src/entities/inventory.ts +63 -0
  543. package/src/entities/inventory_group.test.ts +7 -0
  544. package/src/entities/inventory_group.ts +36 -0
  545. package/src/entities/inventory_unit_variation.test.ts +7 -0
  546. package/src/entities/inventory_unit_variation.ts +29 -0
  547. package/src/entities/invoice.test.ts +50 -0
  548. package/src/entities/invoice.ts +192 -0
  549. package/src/entities/item.test.ts +19 -0
  550. package/src/entities/item.ts +59 -0
  551. package/src/entities/job.test.ts +95 -0
  552. package/src/entities/job.ts +401 -0
  553. package/src/entities/job_comment.test.ts +7 -0
  554. package/src/entities/job_comment.ts +53 -0
  555. package/src/entities/job_note.ts +40 -0
  556. package/src/entities/job_operation_log.test.ts +7 -0
  557. package/src/entities/job_operation_log.ts +41 -0
  558. package/src/entities/matching_inventory.ts +29 -0
  559. package/src/entities/notification.test.ts +58 -0
  560. package/src/entities/notification.ts +106 -0
  561. package/src/entities/payment.test.ts +27 -0
  562. package/src/entities/payment.ts +77 -0
  563. package/src/entities/payment_device.test.ts +7 -0
  564. package/src/entities/payment_device.ts +30 -0
  565. package/src/entities/phone_number.test.ts +7 -0
  566. package/src/entities/phone_number.ts +36 -0
  567. package/src/entities/product.test.ts +776 -0
  568. package/src/entities/product.ts +486 -0
  569. package/src/entities/product_form.ts +51 -0
  570. package/src/entities/product_form_version.ts +51 -0
  571. package/src/entities/product_review.ts +221 -0
  572. package/src/entities/production_comment.test.ts +7 -0
  573. package/src/entities/production_comment.ts +53 -0
  574. package/src/entities/quote.test.ts +98 -0
  575. package/src/entities/quote.ts +140 -0
  576. package/src/entities/quote_item.test.ts +50 -0
  577. package/src/entities/quote_item.ts +71 -0
  578. package/src/entities/reminder.test.ts +16 -0
  579. package/src/entities/reminder.ts +74 -0
  580. package/src/entities/session.test.ts +7 -0
  581. package/src/entities/session.ts +28 -0
  582. package/src/entities/shipment.test.ts +24 -0
  583. package/src/entities/shipment.ts +196 -0
  584. package/src/entities/shipment_item.test.ts +7 -0
  585. package/src/entities/shipment_item.ts +15 -0
  586. package/src/entities/shipment_item_fulfillment.test.ts +8 -0
  587. package/src/entities/shipment_item_fulfillment.ts +15 -0
  588. package/src/entities/shipment_log.ts +37 -0
  589. package/src/entities/shipment_method.test.ts +7 -0
  590. package/src/entities/shipment_method.ts +61 -0
  591. package/src/entities/shipment_method_variation.test.ts +7 -0
  592. package/src/entities/shipment_method_variation.ts +39 -0
  593. package/src/entities/short_url.test.ts +7 -0
  594. package/src/entities/short_url.ts +36 -0
  595. package/src/entities/subscription_plan.test.ts +7 -0
  596. package/src/entities/subscription_plan.ts +73 -0
  597. package/src/entities/supply_domain.test.ts +7 -0
  598. package/src/entities/supply_domain.ts +27 -0
  599. package/src/entities/support_conversation.test.ts +7 -0
  600. package/src/entities/support_conversation.ts +65 -0
  601. package/src/entities/support_message.test.ts +7 -0
  602. package/src/entities/support_message.ts +30 -0
  603. package/src/entities/system_role.test.ts +7 -0
  604. package/src/entities/system_role.ts +17 -0
  605. package/src/entities/theme.test.ts +38 -0
  606. package/src/entities/theme.ts +82 -0
  607. package/src/entities/theme_css_setting.test.ts +7 -0
  608. package/src/entities/theme_css_setting.ts +23 -0
  609. package/src/entities/user.test.ts +154 -0
  610. package/src/entities/user.ts +428 -0
  611. package/src/entities/user_company.test.ts +7 -0
  612. package/src/entities/user_company.ts +27 -0
  613. package/src/entities/variation.test.ts +7 -0
  614. package/src/entities/variation.ts +64 -0
  615. package/src/entities/variation_field.test.ts +76 -0
  616. package/src/entities/variation_field.ts +268 -0
  617. package/src/entities/variation_fields_option.test.ts +46 -0
  618. package/src/entities/variation_fields_option.ts +107 -0
  619. package/src/entities/variation_option.test.ts +7 -0
  620. package/src/entities/variation_option.ts +58 -0
  621. package/src/entities/variations_group.test.ts +7 -0
  622. package/src/entities/variations_group.ts +41 -0
  623. package/src/entity.ts +1098 -0
  624. package/src/index.ts +189 -0
  625. package/src/merchi.test.ts +25 -0
  626. package/src/merchi.ts +445 -0
  627. package/src/pricing/__fixtures__/conditional_field_hidden.json +112 -0
  628. package/src/pricing/__fixtures__/conditional_field_visible.json +113 -0
  629. package/src/pricing/__fixtures__/group_product.json +130 -0
  630. package/src/pricing/__fixtures__/non_selectable_number_field.json +108 -0
  631. package/src/pricing/__fixtures__/quantity_break_discount.json +104 -0
  632. package/src/pricing/__fixtures__/simple_selectable_field.json +110 -0
  633. package/src/pricing/discount.test.ts +47 -0
  634. package/src/pricing/discount.ts +17 -0
  635. package/src/pricing/estimate.test.ts +486 -0
  636. package/src/pricing/estimate.ts +310 -0
  637. package/src/pricing/golden.test.ts +51 -0
  638. package/src/pricing/index.test.ts +9 -0
  639. package/src/pricing/index.ts +7 -0
  640. package/src/pricing/inventory.test.ts +197 -0
  641. package/src/pricing/inventory.ts +89 -0
  642. package/src/pricing/matrix.test.ts +553 -0
  643. package/src/pricing/matrix.ts +217 -0
  644. package/src/pricing/round.test.ts +31 -0
  645. package/src/pricing/round.ts +27 -0
  646. package/src/pricing/types.ts +140 -0
  647. package/src/pricing/visibility.test.ts +223 -0
  648. package/src/pricing/visibility.ts +111 -0
  649. package/src/request.test.ts +79 -0
  650. package/src/request.ts +196 -0
  651. package/src/test_util.ts +18 -0
  652. package/src/toasts.test.ts +38 -0
  653. package/src/toasts.ts +34 -0
  654. package/src/util/float.ts +12 -0
  655. package/src/util/index.ts +7 -0
  656. package/src/util/query_string.test.ts +7 -0
  657. package/src/util/query_string.ts +13 -0
  658. package/src/util/validation.test.ts +16 -0
  659. package/src/util/validation.ts +2 -0
  660. package/src/uuid.test.ts +15 -0
  661. package/src/uuid.ts +8 -0
  662. package/tsconfig.json +29 -0
@@ -0,0 +1,227 @@
1
+ var __values = (this && this.__values) || function(o) {
2
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
+ if (m) return m.call(o);
4
+ if (o && typeof o.length === "number") return {
5
+ next: function () {
6
+ if (o && i >= o.length) o = void 0;
7
+ return { value: o && o[i++], done: !o };
8
+ }
9
+ };
10
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
+ };
12
+ var __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
28
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
29
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
30
+ if (ar || !(i in from)) {
31
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
32
+ ar[i] = from[i];
33
+ }
34
+ }
35
+ return to.concat(ar || Array.prototype.slice.call(from));
36
+ };
37
+ function collectSelectedOptionIds(selections) {
38
+ var e_1, _a;
39
+ var ids = [];
40
+ var addFrom = function (fieldValues) {
41
+ var e_2, _a;
42
+ try {
43
+ for (var _b = __values(Object.keys(fieldValues)), _c = _b.next(); !_c.done; _c = _b.next()) {
44
+ var key = _c.value;
45
+ var sel = fieldValues[Number(key)];
46
+ if (sel && sel.selectedOptionIds)
47
+ ids.push.apply(ids, __spreadArray([], __read(sel.selectedOptionIds), false));
48
+ }
49
+ }
50
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
51
+ finally {
52
+ try {
53
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
54
+ }
55
+ finally { if (e_2) throw e_2.error; }
56
+ }
57
+ };
58
+ addFrom(selections.fieldValues || {});
59
+ try {
60
+ for (var _b = __values(selections.groups || []), _c = _b.next(); !_c.done; _c = _b.next()) {
61
+ var group = _c.value;
62
+ addFrom(group.fieldValues || {});
63
+ }
64
+ }
65
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
66
+ finally {
67
+ try {
68
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
69
+ }
70
+ finally { if (e_1) throw e_1.error; }
71
+ }
72
+ return ids;
73
+ }
74
+ // Shared machinery for both field- and option-level conditional visibility.
75
+ // Mirrors the server's `check_selected_by_fullfilled` recursion: a `selectedBy`
76
+ // list is fulfilled when any of its trigger option ids is currently selected
77
+ // AND that selecting option is itself fulfilled (its own `selectedBy` and its
78
+ // owning field's `selectedBy`), with a `checked` accumulator to break cycles.
79
+ function buildResolver(rules, selections) {
80
+ var e_3, _a, e_4, _b;
81
+ var allFields = __spreadArray(__spreadArray([], __read(rules.fields), false), __read(rules.groupFields), false);
82
+ var optionsById = new Map();
83
+ var fieldByOptionId = new Map();
84
+ try {
85
+ for (var allFields_1 = __values(allFields), allFields_1_1 = allFields_1.next(); !allFields_1_1.done; allFields_1_1 = allFields_1.next()) {
86
+ var f = allFields_1_1.value;
87
+ try {
88
+ for (var _c = (e_4 = void 0, __values(f.options)), _d = _c.next(); !_d.done; _d = _c.next()) {
89
+ var o = _d.value;
90
+ optionsById.set(o.id, o);
91
+ fieldByOptionId.set(o.id, f);
92
+ if (o.originalId != null) {
93
+ optionsById.set(o.originalId, o);
94
+ fieldByOptionId.set(o.originalId, f);
95
+ }
96
+ }
97
+ }
98
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
99
+ finally {
100
+ try {
101
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
102
+ }
103
+ finally { if (e_4) throw e_4.error; }
104
+ }
105
+ }
106
+ }
107
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
108
+ finally {
109
+ try {
110
+ if (allFields_1_1 && !allFields_1_1.done && (_a = allFields_1.return)) _a.call(allFields_1);
111
+ }
112
+ finally { if (e_3) throw e_3.error; }
113
+ }
114
+ var selectedOptionIds = collectSelectedOptionIds(selections);
115
+ var sameOption = function (a, b) {
116
+ var oa = optionsById.get(a);
117
+ return oa != null && oa === optionsById.get(b);
118
+ };
119
+ var isFulfilled = function (selectedBy, checked) {
120
+ var e_5, _a, e_6, _b;
121
+ if (!selectedBy || selectedBy.length === 0)
122
+ return true;
123
+ try {
124
+ for (var selectedBy_1 = __values(selectedBy), selectedBy_1_1 = selectedBy_1.next(); !selectedBy_1_1.done; selectedBy_1_1 = selectedBy_1.next()) {
125
+ var triggerId = selectedBy_1_1.value;
126
+ try {
127
+ for (var selectedOptionIds_1 = (e_6 = void 0, __values(selectedOptionIds)), selectedOptionIds_1_1 = selectedOptionIds_1.next(); !selectedOptionIds_1_1.done; selectedOptionIds_1_1 = selectedOptionIds_1.next()) {
128
+ var selId = selectedOptionIds_1_1.value;
129
+ if (!sameOption(triggerId, selId))
130
+ continue;
131
+ if (checked.includes(selId))
132
+ return true;
133
+ // sameOption only returns true for ids present in optionsById, and
134
+ // fieldByOptionId is populated in the same loop, so both lookups are
135
+ // guaranteed non-null here (mirrors server dereferencing directly).
136
+ var opt = optionsById.get(selId);
137
+ var field = fieldByOptionId.get(selId);
138
+ var nextChecked = __spreadArray(__spreadArray([], __read(checked), false), [selId], false);
139
+ if (isFulfilled(opt.selectedBy, nextChecked) &&
140
+ isFulfilled(field.selectedBy, nextChecked)) {
141
+ return true;
142
+ }
143
+ }
144
+ }
145
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
146
+ finally {
147
+ try {
148
+ if (selectedOptionIds_1_1 && !selectedOptionIds_1_1.done && (_b = selectedOptionIds_1.return)) _b.call(selectedOptionIds_1);
149
+ }
150
+ finally { if (e_6) throw e_6.error; }
151
+ }
152
+ }
153
+ }
154
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
155
+ finally {
156
+ try {
157
+ if (selectedBy_1_1 && !selectedBy_1_1.done && (_a = selectedBy_1.return)) _a.call(selectedBy_1);
158
+ }
159
+ finally { if (e_5) throw e_5.error; }
160
+ }
161
+ return false;
162
+ };
163
+ // Group variation fields only materialise as variations when the job
164
+ // actually has groups (the server builds them inside each `variations_group`
165
+ // via `VariationsGroups.mapper_variations`; with no groups there are no group
166
+ // variations at all). Independent fields are always in play. This mirrors the
167
+ // server, where a non-group job exposes no group fields.
168
+ var hasGroups = Boolean(selections.groups && selections.groups.length > 0);
169
+ var fieldsToConsider = hasGroups ? allFields : rules.fields;
170
+ return { allFields: allFields, fieldsToConsider: fieldsToConsider, isFulfilled: isFulfilled };
171
+ }
172
+ export function resolveVisibleFields(rules, selections) {
173
+ var e_7, _a;
174
+ var _b = buildResolver(rules, selections), fieldsToConsider = _b.fieldsToConsider, isFulfilled = _b.isFulfilled;
175
+ var visible = new Set();
176
+ try {
177
+ for (var fieldsToConsider_1 = __values(fieldsToConsider), fieldsToConsider_1_1 = fieldsToConsider_1.next(); !fieldsToConsider_1_1.done; fieldsToConsider_1_1 = fieldsToConsider_1.next()) {
178
+ var f = fieldsToConsider_1_1.value;
179
+ if (isFulfilled(f.selectedBy, []))
180
+ visible.add(f.id);
181
+ }
182
+ }
183
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
184
+ finally {
185
+ try {
186
+ if (fieldsToConsider_1_1 && !fieldsToConsider_1_1.done && (_a = fieldsToConsider_1.return)) _a.call(fieldsToConsider_1);
187
+ }
188
+ finally { if (e_7) throw e_7.error; }
189
+ }
190
+ return visible;
191
+ }
192
+ // Returns the set of option ids whose own `selectedBy` is fulfilled — i.e. the
193
+ // options that should be visible/selectable given the current selections.
194
+ // Mirrors the server's per-option `isVisible = check_selected_by_fullfilled(
195
+ // option.selected_by)`. Options with no `selectedBy` are always visible.
196
+ export function resolveVisibleOptionIds(rules, selections) {
197
+ var e_8, _a, e_9, _b;
198
+ var _c = buildResolver(rules, selections), fieldsToConsider = _c.fieldsToConsider, isFulfilled = _c.isFulfilled;
199
+ var visible = new Set();
200
+ try {
201
+ for (var fieldsToConsider_2 = __values(fieldsToConsider), fieldsToConsider_2_1 = fieldsToConsider_2.next(); !fieldsToConsider_2_1.done; fieldsToConsider_2_1 = fieldsToConsider_2.next()) {
202
+ var f = fieldsToConsider_2_1.value;
203
+ try {
204
+ for (var _d = (e_9 = void 0, __values(f.options)), _e = _d.next(); !_e.done; _e = _d.next()) {
205
+ var o = _e.value;
206
+ if (isFulfilled(o.selectedBy, []))
207
+ visible.add(o.id);
208
+ }
209
+ }
210
+ catch (e_9_1) { e_9 = { error: e_9_1 }; }
211
+ finally {
212
+ try {
213
+ if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
214
+ }
215
+ finally { if (e_9) throw e_9.error; }
216
+ }
217
+ }
218
+ }
219
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
220
+ finally {
221
+ try {
222
+ if (fieldsToConsider_2_1 && !fieldsToConsider_2_1.done && (_a = fieldsToConsider_2.return)) _a.call(fieldsToConsider_2);
223
+ }
224
+ finally { if (e_8) throw e_8.error; }
225
+ }
226
+ return visible;
227
+ }
@@ -0,0 +1,210 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { resolveVisibleFields, resolveVisibleOptionIds } from './visibility.js';
13
+ function field(id, selectedBy, options) {
14
+ if (options === void 0) { options = []; }
15
+ return {
16
+ id: id,
17
+ originalId: id, position: 0, fieldType: 2, independent: true,
18
+ isSelectable: true,
19
+ selectedBy: selectedBy,
20
+ variationCost: 0, variationUnitCost: 0,
21
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
22
+ options: options.map(function (oid) { return ({
23
+ id: oid, originalId: oid, position: 0, default: false,
24
+ variationCost: 0, variationUnitCost: 0,
25
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
26
+ selectedBy: [],
27
+ }); }),
28
+ };
29
+ }
30
+ var rules = {
31
+ currency: 'AUD', taxPercent: 0,
32
+ product: { unitPrice: 0, minimumPrice: null, discountGroup: null },
33
+ fields: [
34
+ field(1, [], [101, 102]),
35
+ field(2, [101], [201]),
36
+ field(3, [201], [301]), // chained: visible if option 201 selected
37
+ ],
38
+ groupFields: [],
39
+ hasGroups: false,
40
+ };
41
+ test('field with no selectedBy is always visible', function () {
42
+ var v = resolveVisibleFields(rules, { fieldValues: {} });
43
+ expect(v.has(1)).toBe(true);
44
+ expect(v.has(2)).toBe(false);
45
+ expect(v.has(3)).toBe(false);
46
+ });
47
+ test('conditional field appears when its trigger option is selected', function () {
48
+ var v = resolveVisibleFields(rules, {
49
+ fieldValues: { 1: { selectedOptionIds: [101] } },
50
+ });
51
+ expect(v.has(2)).toBe(true);
52
+ expect(v.has(3)).toBe(false);
53
+ });
54
+ test('chained conditional field requires its parent to be fulfilled', function () {
55
+ var v = resolveVisibleFields(rules, {
56
+ fieldValues: { 1: { selectedOptionIds: [101] }, 2: { selectedOptionIds: [201] } },
57
+ });
58
+ expect(v.has(3)).toBe(true);
59
+ });
60
+ test('group fields are not visible when the job has no groups', function () {
61
+ var groupRules = __assign(__assign({}, rules), { fields: [field(1, [], [101])], hasGroups: true, groupFields: [field(20, []), field(21, [])] });
62
+ // No groups submitted -> the job is a single non-group job, so group fields
63
+ // never materialise as variations (mirrors the server).
64
+ var v = resolveVisibleFields(groupRules, { fieldValues: { 1: { selectedOptionIds: [101] } } });
65
+ expect(v.has(1)).toBe(true);
66
+ expect(v.has(20)).toBe(false);
67
+ expect(v.has(21)).toBe(false);
68
+ });
69
+ test('group field selections also drive visibility', function () {
70
+ var groupRules = __assign(__assign({}, rules), { fields: [], hasGroups: true, groupFields: [field(10, [], [110]), field(11, [110], [111])] });
71
+ var v = resolveVisibleFields(groupRules, {
72
+ fieldValues: {},
73
+ groups: [{ quantity: 5, fieldValues: { 10: { selectedOptionIds: [110] } } }],
74
+ });
75
+ expect(v.has(11)).toBe(true);
76
+ });
77
+ test('options/fields with null originalId still resolve by id', function () {
78
+ var noOrigOption = {
79
+ id: 401, originalId: null, position: 0, default: false,
80
+ variationCost: 0, variationUnitCost: 0,
81
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
82
+ selectedBy: [],
83
+ };
84
+ var trigger = {
85
+ id: 40, originalId: null, position: 0, fieldType: 2, independent: true,
86
+ isSelectable: true, selectedBy: [],
87
+ variationCost: 0, variationUnitCost: 0,
88
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
89
+ options: [noOrigOption],
90
+ };
91
+ var dependent = field(41, [401], []);
92
+ var noOrigRules = __assign(__assign({}, rules), { fields: [trigger, dependent] });
93
+ var v = resolveVisibleFields(noOrigRules, {
94
+ fieldValues: { 40: { selectedOptionIds: [401] } },
95
+ });
96
+ expect(v.has(41)).toBe(true);
97
+ });
98
+ test('cyclic selectedBy references terminate via the checked guard', function () {
99
+ function fieldWithOptSelectedBy(id, selectedBy, opts) {
100
+ return {
101
+ id: id,
102
+ originalId: id, position: 0, fieldType: 2, independent: true,
103
+ isSelectable: true,
104
+ selectedBy: selectedBy,
105
+ variationCost: 0, variationUnitCost: 0,
106
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
107
+ options: opts.map(function (o) { return ({
108
+ id: o.id, originalId: o.id, position: 0, default: false,
109
+ variationCost: 0, variationUnitCost: 0,
110
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
111
+ selectedBy: o.selectedBy,
112
+ }); }),
113
+ };
114
+ }
115
+ var cyclicRules = __assign(__assign({}, rules), { fields: [
116
+ fieldWithOptSelectedBy(20, [], [{ id: 120, selectedBy: [121] }]),
117
+ fieldWithOptSelectedBy(21, [], [{ id: 121, selectedBy: [120] }]),
118
+ field(22, [120], []),
119
+ ] });
120
+ var v = resolveVisibleFields(cyclicRules, {
121
+ fieldValues: { 20: { selectedOptionIds: [120] }, 21: { selectedOptionIds: [121] } },
122
+ });
123
+ expect(v.has(22)).toBe(true);
124
+ });
125
+ test('field selections without selectedOptionIds are ignored', function () {
126
+ var v = resolveVisibleFields(rules, {
127
+ fieldValues: { 1: { value: 'text-only' }, 9: undefined },
128
+ });
129
+ expect(v.has(1)).toBe(true);
130
+ expect(v.has(2)).toBe(false);
131
+ });
132
+ test('missing fieldValues falls back to an empty selection map', function () {
133
+ var v = resolveVisibleFields(rules, { fieldValues: undefined });
134
+ expect(v.has(1)).toBe(true);
135
+ expect(v.has(2)).toBe(false);
136
+ });
137
+ test('group without fieldValues falls back to an empty selection map', function () {
138
+ var v = resolveVisibleFields(rules, {
139
+ fieldValues: {},
140
+ groups: [{ quantity: 1, fieldValues: undefined }],
141
+ });
142
+ expect(v.has(1)).toBe(true);
143
+ expect(v.has(2)).toBe(false);
144
+ });
145
+ // --- resolveVisibleOptionIds (option-level conditional visibility) ---
146
+ // Mirrors the production case: a Size field with options (24mm=901, 25mm=902)
147
+ // and a Colour field whose Green option (912) is gated by `selectedBy: [902]`.
148
+ function sizeAndColourRules() {
149
+ var opt = function (id, selectedBy) {
150
+ if (selectedBy === void 0) { selectedBy = []; }
151
+ return ({
152
+ id: id,
153
+ originalId: id, position: id, default: false,
154
+ variationCost: 0, variationUnitCost: 0,
155
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
156
+ selectedBy: selectedBy,
157
+ });
158
+ };
159
+ var f = function (id, options) { return ({
160
+ id: id,
161
+ originalId: id, position: 0, fieldType: 2, independent: true,
162
+ isSelectable: true, selectedBy: [],
163
+ variationCost: 0, variationUnitCost: 0,
164
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
165
+ options: options,
166
+ }); };
167
+ return __assign(__assign({}, rules), { fields: [
168
+ f(900, [opt(901), opt(902)]),
169
+ f(910, [opt(911), opt(912, [902]), opt(913)]), // Colour: Red, Green(gated by 25mm), Blue
170
+ ], groupFields: [] });
171
+ }
172
+ test('option with no selectedBy is always visible', function () {
173
+ var v = resolveVisibleOptionIds(sizeAndColourRules(), { fieldValues: {} });
174
+ expect(v.has(901)).toBe(true);
175
+ expect(v.has(911)).toBe(true);
176
+ expect(v.has(913)).toBe(true);
177
+ });
178
+ test('gated option is hidden until its trigger option is selected', function () {
179
+ var r = sizeAndColourRules();
180
+ var hidden = resolveVisibleOptionIds(r, { fieldValues: { 900: { selectedOptionIds: [901] } } });
181
+ expect(hidden.has(912)).toBe(false); // 24mm selected -> Green hidden
182
+ var visible = resolveVisibleOptionIds(r, { fieldValues: { 900: { selectedOptionIds: [902] } } });
183
+ expect(visible.has(912)).toBe(true); // 25mm selected -> Green visible
184
+ });
185
+ test('group option visibility resolves from group selections', function () {
186
+ var opt = function (id, selectedBy) {
187
+ if (selectedBy === void 0) { selectedBy = []; }
188
+ return ({
189
+ id: id,
190
+ originalId: id, position: id, default: false,
191
+ variationCost: 0, variationUnitCost: 0,
192
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
193
+ selectedBy: selectedBy,
194
+ });
195
+ };
196
+ var f = function (id, options) { return ({
197
+ id: id,
198
+ originalId: id, position: 0, fieldType: 2, independent: true,
199
+ isSelectable: true, selectedBy: [],
200
+ variationCost: 0, variationUnitCost: 0,
201
+ variationCostDiscountGroup: null, variationUnitCostDiscountGroup: null,
202
+ options: options,
203
+ }); };
204
+ var groupRules = __assign(__assign({}, rules), { fields: [], hasGroups: true, groupFields: [f(800, [opt(801), opt(802)]), f(810, [opt(811, [802])])] });
205
+ var v = resolveVisibleOptionIds(groupRules, {
206
+ fieldValues: {},
207
+ groups: [{ quantity: 5, fieldValues: { 800: { selectedOptionIds: [802] } } }],
208
+ });
209
+ expect(v.has(811)).toBe(true);
210
+ });
@@ -0,0 +1,169 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __values = (this && this.__values) || function(o) {
17
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
18
+ if (m) return m.call(o);
19
+ if (o && typeof o.length === "number") return {
20
+ next: function () {
21
+ if (o && i >= o.length) o = void 0;
22
+ return { value: o && o[i++], done: !o };
23
+ }
24
+ };
25
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
26
+ };
27
+ // eslint-disable-next-line no-unused-vars
28
+ import { getErrorFromCode } from './constants/errors.js';
29
+ var ApiError = /** @class */ (function (_super) {
30
+ __extends(ApiError, _super);
31
+ function ApiError(err) {
32
+ var _this = this;
33
+ var message = JSON.stringify(err);
34
+ /* istanbul ignore next */
35
+ _this = _super.call(this, message) || this;
36
+ _this.statusCode = err.statusCode;
37
+ _this.errorCode = getErrorFromCode(err.errorCode);
38
+ _this.errorMessage = err.message ?
39
+ err.message : 'No error message';
40
+ _this.details = err.details;
41
+ _this.name = 'ApiError';
42
+ _this.original = err;
43
+ return _this;
44
+ }
45
+ return ApiError;
46
+ }(Error));
47
+ export { ApiError };
48
+ export var version = 'v6';
49
+ function ensureVersionInUri(baseUrl) {
50
+ // Ensure baseUrl ends with a slash
51
+ var uri = baseUrl;
52
+ if (!uri.endsWith('/')) {
53
+ uri += '/';
54
+ }
55
+ // Check if the URI already includes a version
56
+ var versionPattern = new RegExp('/v\\d+/?$');
57
+ var match = uri.match(versionPattern);
58
+ if (match) {
59
+ // Extract the version and remove it from the URI
60
+ var foundVersion = match[0].replace(/\//g, '');
61
+ var strippedUri = uri.replace(versionPattern, '/');
62
+ return {
63
+ baseUrl: strippedUri,
64
+ version: foundVersion
65
+ };
66
+ }
67
+ return {
68
+ baseUrl: uri,
69
+ version: version
70
+ };
71
+ }
72
+ export function backendFetch(baseUrl, resource, options) {
73
+ var e_1, _a;
74
+ var _b = ensureVersionInUri(baseUrl), cleanBaseUrl = _b.baseUrl, apiVersion = _b.version;
75
+ // Remove leading slash from resource if it exists to prevent double slashes
76
+ var cleanResource = resource.startsWith('/') ? resource.slice(1) : resource;
77
+ var url = new URL(cleanBaseUrl + apiVersion + '/' + cleanResource);
78
+ if (options && options.query) {
79
+ try {
80
+ for (var _c = __values(options.query), _d = _c.next(); !_d.done; _d = _c.next()) {
81
+ var entry = _d.value;
82
+ url.searchParams.append(entry[0], entry[1]);
83
+ }
84
+ }
85
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
86
+ finally {
87
+ try {
88
+ if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
89
+ }
90
+ finally { if (e_1) throw e_1.error; }
91
+ }
92
+ }
93
+ return fetch(url.toString(), options);
94
+ }
95
+ export function apiFetch(baseUrl, resource, options, expectEmptyResponse) {
96
+ return backendFetch(baseUrl, resource, options).then(function (response) {
97
+ if (response.status < 200 || response.status > 299) {
98
+ return response.json().then(function (json) {
99
+ var err = new ApiError(json);
100
+ return Promise.reject(err);
101
+ });
102
+ }
103
+ else {
104
+ return expectEmptyResponse ? '' : response.json();
105
+ }
106
+ });
107
+ }
108
+ /* istanbul ignore next */
109
+ export function apiFetchWithProgress(baseUrl, resource, options, progressCallback) {
110
+ return backendFetch(baseUrl, resource, options).then(function (response) {
111
+ if (!response.body) {
112
+ var err = new ApiError('empty response');
113
+ return Promise.reject(err);
114
+ }
115
+ var reader = response.body.getReader();
116
+ var bodyText = '';
117
+ var errorText = '';
118
+ var haveError = false;
119
+ var expected = '{"loadingBar": "' + '.'.repeat(100) + '"}';
120
+ function readChunk() {
121
+ return reader.read().then(function (_a) {
122
+ var done = _a.done, value = _a.value;
123
+ if (done) {
124
+ if (response.status < 200 || response.status > 299) {
125
+ var err = new ApiError('Unknown error');
126
+ return Promise.reject(err);
127
+ }
128
+ else if (haveError) {
129
+ try {
130
+ var jsonText = JSON.parse(errorText);
131
+ return Promise.reject(new ApiError(jsonText));
132
+ }
133
+ catch (e) {
134
+ return Promise.reject(new ApiError(errorText));
135
+ }
136
+ }
137
+ else {
138
+ return bodyText;
139
+ }
140
+ }
141
+ else {
142
+ var chunk = new TextDecoder().decode(value);
143
+ if (haveError) {
144
+ errorText += chunk;
145
+ }
146
+ else {
147
+ for (var i = 0; i < chunk.length; ++i) {
148
+ var char = chunk[i];
149
+ var expectedChar = expected[bodyText.length];
150
+ if (expectedChar == char && !haveError) {
151
+ bodyText += char;
152
+ }
153
+ else {
154
+ haveError = true;
155
+ errorText += char;
156
+ }
157
+ }
158
+ }
159
+ if (!haveError && progressCallback) {
160
+ var progress = Math.min(Math.max(0, bodyText.length - 16), 100);
161
+ progressCallback(progress);
162
+ }
163
+ return readChunk();
164
+ }
165
+ });
166
+ }
167
+ return readChunk();
168
+ });
169
+ }
@@ -0,0 +1,70 @@
1
+ import { apiFetch } from './request.js';
2
+ import { ErrorType } from './constants/errors.js';
3
+ import { setup, mockFetch } from './test_util.js';
4
+ setup();
5
+ test('can pass through data from server', function () {
6
+ mockFetch(true, { 'animal': 'turtle' }, 200);
7
+ return apiFetch('https://api.merchi.co/', '/test').then(function (data) {
8
+ expect(data.animal).toBe('turtle');
9
+ });
10
+ });
11
+ test('can pass through data from server with override url', function () {
12
+ window.merchiBackendUri = 'http://override.example.com/';
13
+ mockFetch(true, { 'animal': 'turtle' }, 200);
14
+ return apiFetch('https://api.merchi.co/', '/test').then(function (data) {
15
+ expect(data.animal).toBe('turtle');
16
+ });
17
+ });
18
+ test('404 creates ApiError', function () {
19
+ mockFetch(false, { 'statusCode': 404, 'errorCode': ErrorType.RESOURCE_NOT_FOUND }, 404);
20
+ apiFetch('https://api.merchi.co/', '/test').catch(function (e) {
21
+ expect(e.statusCode).toBe(404);
22
+ expect(e.name).toBe('ApiError');
23
+ expect(e.errorCode).toBe(ErrorType.RESOURCE_NOT_FOUND);
24
+ expect(e.errorMessage).toBe('No error message');
25
+ });
26
+ });
27
+ test('will get default errorCode', function () {
28
+ mockFetch(false, { 'statusCode': 404,
29
+ 'errorCode': -1,
30
+ 'message': 'just a test' }, 404);
31
+ apiFetch('https://api.merchi.co/', '/test').catch(function (e) {
32
+ expect(e.statusCode).toBe(404);
33
+ expect(e.name).toBe('ApiError');
34
+ expect(e.errorCode).toBe(ErrorType.UNKNOWN_ERROR);
35
+ expect(e.errorMessage).toBe('just a test');
36
+ });
37
+ });
38
+ test('ApiError exposes details when the server supplies them', function () {
39
+ var details = {
40
+ relation: 'file',
41
+ parentType: 'variation',
42
+ id: 'abc123',
43
+ index: 0,
44
+ provided: {
45
+ id: 'abc123',
46
+ uploadId: 'upload-xyz',
47
+ creationDate: '1776978388',
48
+ },
49
+ };
50
+ mockFetch(false, {
51
+ 'statusCode': 404,
52
+ 'errorCode': ErrorType.RESOURCE_NOT_FOUND,
53
+ 'message': 'no such file #abc123 on variation',
54
+ 'details': details,
55
+ }, 404);
56
+ return apiFetch('https://api.merchi.co/', '/test').catch(function (e) {
57
+ expect(e.name).toBe('ApiError');
58
+ expect(e.details).toEqual(details);
59
+ expect(e.details.provided.uploadId).toBe('upload-xyz');
60
+ });
61
+ });
62
+ test('ApiError leaves details undefined when the server omits them', function () {
63
+ mockFetch(false, { 'statusCode': 400,
64
+ 'errorCode': ErrorType.RESOURCE_NOT_FOUND,
65
+ 'message': 'plain error' }, 400);
66
+ return apiFetch('https://api.merchi.co/', '/test').catch(function (e) {
67
+ expect(e.name).toBe('ApiError');
68
+ expect(e.details).toBeUndefined();
69
+ });
70
+ });