merchi_sdk_ts 1.32.1 → 1.34.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 (692) hide show
  1. package/.eslintrc.cjs +43 -43
  2. package/LICENSE +21 -21
  3. package/README.md +244 -244
  4. package/coverage/clover.xml +366 -4870
  5. package/coverage/coverage-final.json +7 -131
  6. package/coverage/lcov-report/block-navigation.js +1 -1
  7. package/coverage/lcov-report/discount.ts.html +136 -0
  8. package/coverage/lcov-report/estimate.ts.html +1015 -0
  9. package/coverage/lcov-report/index.html +91 -76
  10. package/coverage/lcov-report/index.ts.html +106 -0
  11. package/coverage/lcov-report/inventory.ts.html +352 -0
  12. package/coverage/lcov-report/matrix.ts.html +736 -0
  13. package/coverage/lcov-report/round.ts.html +166 -0
  14. package/coverage/lcov-report/sorter.js +7 -21
  15. package/coverage/lcov-report/src/constants/auto_assign_production_on_actions.ts.html +7 -7
  16. package/coverage/lcov-report/src/constants/call_to_actions.ts.html +37 -37
  17. package/coverage/lcov-report/src/constants/discount_types.ts.html +19 -19
  18. package/coverage/lcov-report/src/constants/domain_types.ts.html +13 -13
  19. package/coverage/lcov-report/src/constants/errors.ts.html +43 -43
  20. package/coverage/lcov-report/src/constants/event_types.ts.html +19 -19
  21. package/coverage/lcov-report/src/constants/field_types.ts.html +23 -17
  22. package/coverage/lcov-report/src/constants/index.html +221 -221
  23. package/coverage/lcov-report/src/constants/index.ts.html +103 -103
  24. package/coverage/lcov-report/src/constants/input_types.ts.html +35 -35
  25. package/coverage/lcov-report/src/constants/inventory_statuses.ts.html +7 -7
  26. package/coverage/lcov-report/src/constants/invoice_types.ts.html +19 -19
  27. package/coverage/lcov-report/src/constants/item_types.ts.html +19 -19
  28. package/coverage/lcov-report/src/constants/job/drafting_status.ts.html +23 -23
  29. package/coverage/lcov-report/src/constants/job/index.html +66 -66
  30. package/coverage/lcov-report/src/constants/job/payment_status.ts.html +23 -23
  31. package/coverage/lcov-report/src/constants/job/production_status.ts.html +33 -33
  32. package/coverage/lcov-report/src/constants/job/shipment_status.ts.html +31 -31
  33. package/coverage/lcov-report/src/constants/job/supply_chain_request_status.ts.html +21 -21
  34. package/coverage/lcov-report/src/constants/job_priorities.ts.html +21 -21
  35. package/coverage/lcov-report/src/constants/job_status.ts.html +91 -91
  36. package/coverage/lcov-report/src/constants/job_types.ts.html +41 -41
  37. package/coverage/lcov-report/src/constants/notification_sections.ts.html +14 -14
  38. package/coverage/lcov-report/src/constants/notification_types.ts.html +98 -98
  39. package/coverage/lcov-report/src/constants/notification_urgencies.ts.html +21 -21
  40. package/coverage/lcov-report/src/constants/payment_types.ts.html +29 -29
  41. package/coverage/lcov-report/src/constants/platform.ts.html +17 -17
  42. package/coverage/lcov-report/src/constants/product_types.ts.html +61 -61
  43. package/coverage/lcov-report/src/constants/rights.ts.html +19 -19
  44. package/coverage/lcov-report/src/constants/robots_meta_directives.ts.html +9 -9
  45. package/coverage/lcov-report/src/constants/roles.ts.html +19 -19
  46. package/coverage/lcov-report/src/constants/shipment_companies.ts.html +47 -47
  47. package/coverage/lcov-report/src/constants/shipment_services.ts.html +4 -4
  48. package/coverage/lcov-report/src/constants/system_roles.ts.html +15 -15
  49. package/coverage/lcov-report/src/constants/theme_foundations.ts.html +103 -0
  50. package/coverage/lcov-report/src/constants/theme_status.ts.html +6 -6
  51. package/coverage/lcov-report/src/constants/user_types.ts.html +18 -18
  52. package/coverage/lcov-report/src/constants/white_label_accessibilities.ts.html +19 -19
  53. package/coverage/lcov-report/src/cookie.ts.html +4 -4
  54. package/coverage/lcov-report/src/entities/address.ts.html +25 -25
  55. package/coverage/lcov-report/src/entities/agent_conversation.ts.html +20 -20
  56. package/coverage/lcov-report/src/entities/agent_skill.ts.html +31 -31
  57. package/coverage/lcov-report/src/entities/agent_skill_approval.ts.html +15 -15
  58. package/coverage/lcov-report/src/entities/agent_skill_version.ts.html +31 -31
  59. package/coverage/lcov-report/src/entities/agent_token_usage.ts.html +31 -31
  60. package/coverage/lcov-report/src/entities/assignment.ts.html +63 -63
  61. package/coverage/lcov-report/src/entities/automatic_payment_relationship.ts.html +16 -16
  62. package/coverage/lcov-report/src/entities/bank.ts.html +21 -21
  63. package/coverage/lcov-report/src/entities/cart.ts.html +58 -58
  64. package/coverage/lcov-report/src/entities/cart_item.ts.html +67 -67
  65. package/coverage/lcov-report/src/entities/cart_shipment_group.ts.html +13 -13
  66. package/coverage/lcov-report/src/entities/cart_shipment_quote.ts.html +18 -18
  67. package/coverage/lcov-report/src/entities/category.ts.html +25 -25
  68. package/coverage/lcov-report/src/entities/company.ts.html +129 -129
  69. package/coverage/lcov-report/src/entities/company_invitation.ts.html +18 -18
  70. package/coverage/lcov-report/src/entities/component.ts.html +361 -0
  71. package/coverage/lcov-report/src/entities/component_tag.ts.html +136 -0
  72. package/coverage/lcov-report/src/entities/component_version.ts.html +175 -0
  73. package/coverage/lcov-report/src/entities/country_tax.ts.html +37 -37
  74. package/coverage/lcov-report/src/entities/discount.ts.html +41 -41
  75. package/coverage/lcov-report/src/entities/discount_group.ts.html +19 -19
  76. package/coverage/lcov-report/src/entities/domain.ts.html +385 -259
  77. package/coverage/lcov-report/src/entities/domain_chat_settings.ts.html +34 -34
  78. package/coverage/lcov-report/src/entities/domain_invitation.ts.html +19 -19
  79. package/coverage/lcov-report/src/entities/domain_tag.ts.html +19 -19
  80. package/coverage/lcov-report/src/entities/draft.ts.html +51 -51
  81. package/coverage/lcov-report/src/entities/draft_comment.ts.html +27 -27
  82. package/coverage/lcov-report/src/entities/draft_preview.ts.html +19 -19
  83. package/coverage/lcov-report/src/entities/draft_preview_layer.ts.html +14 -14
  84. package/coverage/lcov-report/src/entities/draft_template.ts.html +50 -32
  85. package/coverage/lcov-report/src/entities/email_address.ts.html +13 -13
  86. package/coverage/lcov-report/src/entities/email_counter.ts.html +13 -13
  87. package/coverage/lcov-report/src/entities/enrolled_domain.ts.html +40 -40
  88. package/coverage/lcov-report/src/entities/exchange_rate.ts.html +13 -13
  89. package/coverage/lcov-report/src/entities/file.ts.html +84 -84
  90. package/coverage/lcov-report/src/entities/index.html +274 -274
  91. package/coverage/lcov-report/src/entities/internal_tag.ts.html +20 -20
  92. package/coverage/lcov-report/src/entities/inventory.ts.html +43 -43
  93. package/coverage/lcov-report/src/entities/inventory_group.ts.html +17 -17
  94. package/coverage/lcov-report/src/entities/inventory_unit_variation.ts.html +32 -32
  95. package/coverage/lcov-report/src/entities/invoice.ts.html +70 -70
  96. package/coverage/lcov-report/src/entities/item.ts.html +45 -45
  97. package/coverage/lcov-report/src/entities/job.ts.html +188 -188
  98. package/coverage/lcov-report/src/entities/job_comment.ts.html +23 -23
  99. package/coverage/lcov-report/src/entities/job_note.ts.html +20 -20
  100. package/coverage/lcov-report/src/entities/job_operation_log.ts.html +20 -20
  101. package/coverage/lcov-report/src/entities/matching_inventory.ts.html +17 -17
  102. package/coverage/lcov-report/src/entities/menu.ts.html +175 -0
  103. package/coverage/lcov-report/src/entities/menu_item.ts.html +172 -0
  104. package/coverage/lcov-report/src/entities/notification.ts.html +48 -48
  105. package/coverage/lcov-report/src/entities/page.ts.html +181 -0
  106. package/coverage/lcov-report/src/entities/payment.ts.html +48 -48
  107. package/coverage/lcov-report/src/entities/payment_device.ts.html +16 -16
  108. package/coverage/lcov-report/src/entities/phone_number.ts.html +17 -17
  109. package/coverage/lcov-report/src/entities/product.ts.html +276 -285
  110. package/coverage/lcov-report/src/entities/product_form.ts.html +22 -22
  111. package/coverage/lcov-report/src/entities/product_form_version.ts.html +22 -22
  112. package/coverage/lcov-report/src/entities/product_review.ts.html +26 -26
  113. package/coverage/lcov-report/src/entities/production_comment.ts.html +23 -23
  114. package/coverage/lcov-report/src/entities/quote.ts.html +163 -163
  115. package/coverage/lcov-report/src/entities/quote_item.ts.html +61 -61
  116. package/coverage/lcov-report/src/entities/reminder.ts.html +35 -35
  117. package/coverage/lcov-report/src/entities/seo_domain_page.ts.html +184 -0
  118. package/coverage/lcov-report/src/entities/session.ts.html +17 -17
  119. package/coverage/lcov-report/src/entities/shipment.ts.html +98 -98
  120. package/coverage/lcov-report/src/entities/shipment_item.ts.html +11 -11
  121. package/coverage/lcov-report/src/entities/shipment_item_fulfillment.ts.html +12 -12
  122. package/coverage/lcov-report/src/entities/shipment_log.ts.html +17 -17
  123. package/coverage/lcov-report/src/entities/shipment_method.ts.html +28 -28
  124. package/coverage/lcov-report/src/entities/shipment_method_variation.ts.html +19 -19
  125. package/coverage/lcov-report/src/entities/short_url.ts.html +18 -18
  126. package/coverage/lcov-report/src/entities/subscription_plan.ts.html +31 -31
  127. package/coverage/lcov-report/src/entities/supply_domain.ts.html +16 -16
  128. package/coverage/lcov-report/src/entities/support_conversation.ts.html +27 -27
  129. package/coverage/lcov-report/src/entities/support_message.ts.html +17 -17
  130. package/coverage/lcov-report/src/entities/system_role.ts.html +12 -12
  131. package/coverage/lcov-report/src/entities/theme.ts.html +66 -66
  132. package/coverage/lcov-report/src/entities/theme_css_setting.ts.html +14 -14
  133. package/coverage/lcov-report/src/entities/user.ts.html +250 -250
  134. package/coverage/lcov-report/src/entities/user_company.ts.html +16 -16
  135. package/coverage/lcov-report/src/entities/variation.ts.html +29 -29
  136. package/coverage/lcov-report/src/entities/variation_field.ts.html +359 -128
  137. package/coverage/lcov-report/src/entities/variation_fields_option.ts.html +95 -86
  138. package/coverage/lcov-report/src/entities/variation_option.ts.html +25 -25
  139. package/coverage/lcov-report/src/entities/variations_group.ts.html +21 -21
  140. package/coverage/lcov-report/src/entity.ts.html +941 -917
  141. package/coverage/lcov-report/src/index.html +68 -68
  142. package/coverage/lcov-report/src/index.ts.html +349 -349
  143. package/coverage/lcov-report/src/merchi.ts.html +236 -236
  144. package/coverage/lcov-report/src/pricing/discount.ts.html +29 -29
  145. package/coverage/lcov-report/src/pricing/estimate.ts.html +463 -232
  146. package/coverage/lcov-report/src/pricing/index.html +90 -75
  147. package/coverage/lcov-report/src/pricing/index.ts.html +24 -21
  148. package/coverage/lcov-report/src/pricing/inventory.ts.html +103 -103
  149. package/coverage/lcov-report/src/pricing/matrix.ts.html +736 -0
  150. package/coverage/lcov-report/src/pricing/round.ts.html +33 -33
  151. package/coverage/lcov-report/src/pricing/visibility.ts.html +113 -113
  152. package/coverage/lcov-report/src/request.ts.html +76 -76
  153. package/coverage/lcov-report/src/test_util.ts.html +26 -26
  154. package/coverage/lcov-report/src/toasts.ts.html +30 -30
  155. package/coverage/lcov-report/src/util/float.ts.html +27 -27
  156. package/coverage/lcov-report/src/util/index.html +49 -49
  157. package/coverage/lcov-report/src/util/index.ts.html +15 -15
  158. package/coverage/lcov-report/src/util/query_string.ts.html +29 -29
  159. package/coverage/lcov-report/src/util/validation.ts.html +15 -15
  160. package/coverage/lcov-report/src/uuid.ts.html +8 -8
  161. package/coverage/lcov-report/visibility.ts.html +418 -0
  162. package/coverage/lcov.info +722 -7332
  163. package/dist/constants/auto_assign_production_on_actions.js +7 -7
  164. package/dist/constants/call_to_actions.js +15 -15
  165. package/dist/constants/call_to_actions.test.js +4 -4
  166. package/dist/constants/discount_types.js +6 -6
  167. package/dist/constants/discount_types.test.js +4 -4
  168. package/dist/constants/domain_types.js +13 -13
  169. package/dist/constants/domain_types.test.js +4 -4
  170. package/dist/constants/errors.js +32 -32
  171. package/dist/constants/event_types.js +6 -6
  172. package/dist/constants/event_types.test.js +4 -4
  173. package/dist/constants/field_types.js +17 -17
  174. package/dist/constants/field_types.test.js +4 -4
  175. package/dist/constants/index.js +25 -25
  176. package/dist/constants/input_types.js +14 -14
  177. package/dist/constants/input_types.test.js +4 -4
  178. package/dist/constants/inventory_status.test.js +4 -4
  179. package/dist/constants/inventory_statuses.js +7 -7
  180. package/dist/constants/invoice_types.js +6 -6
  181. package/dist/constants/invoice_types.test.js +4 -4
  182. package/dist/constants/item_types.js +6 -6
  183. package/dist/constants/item_types.test.js +4 -4
  184. package/dist/constants/job/drafting_status.js +8 -8
  185. package/dist/constants/job/drafting_status.test.js +4 -4
  186. package/dist/constants/job/payment_status.js +8 -8
  187. package/dist/constants/job/payment_status.test.js +4 -4
  188. package/dist/constants/job/production_status.js +13 -13
  189. package/dist/constants/job/production_status.test.js +4 -4
  190. package/dist/constants/job/shipment_status.js +12 -12
  191. package/dist/constants/job/shipment_status.test.js +4 -4
  192. package/dist/constants/job/supply_chain_request_status.js +7 -7
  193. package/dist/constants/job/supply_chain_request_status.test.js +4 -4
  194. package/dist/constants/job_priorities.js +7 -7
  195. package/dist/constants/job_priorities.test.js +4 -4
  196. package/dist/constants/job_status.js +50 -50
  197. package/dist/constants/job_status.test.js +4 -4
  198. package/dist/constants/job_types.js +17 -17
  199. package/dist/constants/job_types.test.js +4 -4
  200. package/dist/constants/notification_sections.js +14 -14
  201. package/dist/constants/notification_sections.test.js +4 -4
  202. package/dist/constants/notification_types.js +98 -98
  203. package/dist/constants/notification_types.test.js +4 -4
  204. package/dist/constants/notification_urgencies.js +7 -7
  205. package/dist/constants/notification_urgencies.test.js +4 -4
  206. package/dist/constants/payment_types.js +11 -11
  207. package/dist/constants/payment_types.test.js +4 -4
  208. package/dist/constants/platform.js +5 -5
  209. package/dist/constants/platform.test.js +8 -8
  210. package/dist/constants/product_types.js +27 -27
  211. package/dist/constants/product_types.test.js +4 -4
  212. package/dist/constants/rights.js +6 -6
  213. package/dist/constants/rights.test.js +4 -4
  214. package/dist/constants/robots_meta_directives.js +11 -11
  215. package/dist/constants/robots_meta_directives.test.js +4 -4
  216. package/dist/constants/roles.js +57 -57
  217. package/dist/constants/roles.test.js +4 -4
  218. package/dist/constants/shipment_companies.js +20 -20
  219. package/dist/constants/shipment_companies.test.js +4 -4
  220. package/dist/constants/shipment_services.js +4 -4
  221. package/dist/constants/shipment_services.test.js +4 -4
  222. package/dist/constants/system_roles.js +4 -4
  223. package/dist/constants/system_roles.test.js +4 -4
  224. package/dist/constants/theme_foundations.js +7 -0
  225. package/dist/constants/theme_foundations.test.js +4 -0
  226. package/dist/constants/theme_status.js +6 -6
  227. package/dist/constants/theme_status.test.js +4 -4
  228. package/dist/constants/user_types.js +18 -18
  229. package/dist/constants/user_types.test.js +4 -4
  230. package/dist/constants/white_label_accessibilities.js +6 -6
  231. package/dist/constants/white_label_accessibilities.test.js +4 -4
  232. package/dist/cookie.js +15 -15
  233. package/dist/cookie.test.js +10 -10
  234. package/dist/entities/address.js +104 -104
  235. package/dist/entities/address.test.js +6 -6
  236. package/dist/entities/agent_conversation.js +78 -78
  237. package/dist/entities/agent_conversation.test.js +6 -6
  238. package/dist/entities/agent_skill.js +133 -133
  239. package/dist/entities/agent_skill.test.js +11 -11
  240. package/dist/entities/agent_skill_approval.js +61 -61
  241. package/dist/entities/agent_skill_version.js +99 -99
  242. package/dist/entities/agent_token_analytics.js +1 -1
  243. package/dist/entities/agent_token_usage.js +127 -127
  244. package/dist/entities/agent_token_usage.test.js +6 -6
  245. package/dist/entities/assignment.js +135 -135
  246. package/dist/entities/assignment.test.js +30 -30
  247. package/dist/entities/automatic_payment_relationship.js +65 -65
  248. package/dist/entities/automatic_payment_relationship.test.js +6 -6
  249. package/dist/entities/backup.js +45 -0
  250. package/dist/entities/backup.test.js +6 -0
  251. package/dist/entities/bank.js +85 -85
  252. package/dist/entities/bank.test.js +6 -6
  253. package/dist/entities/cart.js +169 -169
  254. package/dist/entities/cart.test.js +45 -45
  255. package/dist/entities/cart_item.js +125 -125
  256. package/dist/entities/cart_item.test.js +28 -28
  257. package/dist/entities/cart_shipment_group.js +53 -53
  258. package/dist/entities/cart_shipment_quote.js +70 -70
  259. package/dist/entities/category.js +101 -101
  260. package/dist/entities/category.test.js +52 -52
  261. package/dist/entities/company.js +509 -509
  262. package/dist/entities/company.test.js +6 -6
  263. package/dist/entities/company_invitation.js +70 -70
  264. package/dist/entities/company_invitation.test.js +6 -6
  265. package/dist/entities/company_invoice_settings.js +80 -0
  266. package/dist/entities/company_invoice_settings_version.js +64 -0
  267. package/dist/entities/component.js +141 -0
  268. package/dist/entities/component.test.js +12 -0
  269. package/dist/entities/component_tag.js +49 -0
  270. package/dist/entities/component_tag.test.js +6 -0
  271. package/dist/entities/component_version.js +65 -0
  272. package/dist/entities/component_version.test.js +6 -0
  273. package/dist/entities/country_tax.js +80 -80
  274. package/dist/entities/country_tax.test.js +11 -11
  275. package/dist/entities/discount.js +84 -80
  276. package/dist/entities/discount.test.js +25 -16
  277. package/dist/entities/discount_group.js +80 -80
  278. package/dist/entities/discount_group.test.js +6 -6
  279. package/dist/entities/domain.js +564 -564
  280. package/dist/entities/domain.test.js +348 -348
  281. package/dist/entities/domain_chat_settings.js +134 -134
  282. package/dist/entities/domain_chat_settings.test.js +15 -15
  283. package/dist/entities/domain_invitation.js +74 -74
  284. package/dist/entities/domain_invitation.test.js +6 -6
  285. package/dist/entities/domain_tag.js +77 -77
  286. package/dist/entities/domain_tag.test.js +6 -6
  287. package/dist/entities/draft.js +122 -122
  288. package/dist/entities/draft.test.js +26 -26
  289. package/dist/entities/draft_comment.js +107 -107
  290. package/dist/entities/draft_comment.test.js +6 -6
  291. package/dist/entities/draft_preview.js +74 -74
  292. package/dist/entities/draft_preview.test.js +36 -36
  293. package/dist/entities/draft_preview_layer.js +54 -54
  294. package/dist/entities/draft_preview_layer.test.js +6 -6
  295. package/dist/entities/draft_template.js +119 -119
  296. package/dist/entities/draft_template.test.js +12 -12
  297. package/dist/entities/email_address.js +56 -56
  298. package/dist/entities/email_address.test.js +6 -6
  299. package/dist/entities/email_counter.js +53 -53
  300. package/dist/entities/email_counter.test.js +6 -6
  301. package/dist/entities/enrolled_domain.js +74 -74
  302. package/dist/entities/enrolled_domain.test.js +6 -6
  303. package/dist/entities/exchange_rate.js +56 -56
  304. package/dist/entities/exchange_rate.test.js +6 -6
  305. package/dist/entities/file.js +218 -218
  306. package/dist/entities/file.test.js +38 -38
  307. package/dist/entities/internal_tag.js +84 -84
  308. package/dist/entities/internal_tag.test.js +6 -6
  309. package/dist/entities/inventory.js +97 -97
  310. package/dist/entities/inventory.test.js +22 -22
  311. package/dist/entities/inventory_group.js +69 -69
  312. package/dist/entities/inventory_group.test.js +6 -6
  313. package/dist/entities/inventory_unit_variation.js +61 -61
  314. package/dist/entities/inventory_unit_variation.test.js +6 -6
  315. package/dist/entities/invoice.js +264 -264
  316. package/dist/entities/invoice.test.js +39 -39
  317. package/dist/entities/invoice_template.js +60 -0
  318. package/dist/entities/invoice_template_version.js +52 -0
  319. package/dist/entities/item.js +96 -96
  320. package/dist/entities/item.test.js +17 -17
  321. package/dist/entities/job.js +519 -515
  322. package/dist/entities/job.test.js +83 -83
  323. package/dist/entities/job_comment.js +94 -94
  324. package/dist/entities/job_comment.test.js +6 -6
  325. package/dist/entities/job_note.js +78 -78
  326. package/dist/entities/job_operation_log.js +82 -82
  327. package/dist/entities/job_operation_log.test.js +6 -6
  328. package/dist/entities/matching_inventory.js +63 -63
  329. package/dist/entities/menu.js +65 -0
  330. package/dist/entities/menu.test.js +6 -0
  331. package/dist/entities/menu_item.js +65 -0
  332. package/dist/entities/menu_item.test.js +6 -0
  333. package/dist/entities/notification.js +163 -163
  334. package/dist/entities/notification.test.js +51 -51
  335. package/dist/entities/page.js +69 -0
  336. package/dist/entities/page.test.js +6 -0
  337. package/dist/entities/payment.js +106 -106
  338. package/dist/entities/payment.test.js +16 -16
  339. package/dist/entities/payment_device.js +65 -65
  340. package/dist/entities/payment_device.test.js +6 -6
  341. package/dist/entities/phone_number.js +72 -72
  342. package/dist/entities/phone_number.test.js +6 -6
  343. package/dist/entities/product.js +611 -611
  344. package/dist/entities/product.test.js +716 -716
  345. package/dist/entities/product_form.js +92 -92
  346. package/dist/entities/product_form_version.js +95 -95
  347. package/dist/entities/product_review.js +234 -234
  348. package/dist/entities/production_comment.js +94 -94
  349. package/dist/entities/production_comment.test.js +6 -6
  350. package/dist/entities/quote.js +168 -168
  351. package/dist/entities/quote.test.js +86 -86
  352. package/dist/entities/quote_item.js +99 -99
  353. package/dist/entities/quote_item.test.js +40 -40
  354. package/dist/entities/reminder.js +120 -120
  355. package/dist/entities/reminder.test.js +14 -14
  356. package/dist/entities/seo_domain_page.js +70 -0
  357. package/dist/entities/seo_domain_page.test.js +6 -0
  358. package/dist/entities/session.js +63 -63
  359. package/dist/entities/session.test.js +6 -6
  360. package/dist/entities/shipment.js +256 -256
  361. package/dist/entities/shipment.test.js +20 -20
  362. package/dist/entities/shipment_item.js +45 -45
  363. package/dist/entities/shipment_item.test.js +6 -6
  364. package/dist/entities/shipment_item_fulfillment.js +46 -46
  365. package/dist/entities/shipment_item_fulfillment.test.js +6 -6
  366. package/dist/entities/shipment_log.js +75 -75
  367. package/dist/entities/shipment_method.js +104 -104
  368. package/dist/entities/shipment_method.test.js +6 -6
  369. package/dist/entities/shipment_method_variation.js +77 -77
  370. package/dist/entities/shipment_method_variation.test.js +6 -6
  371. package/dist/entities/short_url.js +73 -73
  372. package/dist/entities/short_url.test.js +6 -6
  373. package/dist/entities/subscription_plan.js +122 -122
  374. package/dist/entities/subscription_plan.test.js +6 -6
  375. package/dist/entities/supply_domain.js +62 -62
  376. package/dist/entities/supply_domain.test.js +6 -6
  377. package/dist/entities/support_conversation.js +106 -106
  378. package/dist/entities/support_conversation.test.js +6 -6
  379. package/dist/entities/support_message.js +66 -66
  380. package/dist/entities/support_message.test.js +6 -6
  381. package/dist/entities/system_role.js +49 -49
  382. package/dist/entities/system_role.test.js +6 -6
  383. package/dist/entities/theme.js +125 -125
  384. package/dist/entities/theme.test.js +35 -35
  385. package/dist/entities/theme_css_setting.js +57 -57
  386. package/dist/entities/theme_css_setting.test.js +6 -6
  387. package/dist/entities/user.js +508 -508
  388. package/dist/entities/user.test.js +134 -134
  389. package/dist/entities/user_company.js +62 -62
  390. package/dist/entities/user_company.test.js +6 -6
  391. package/dist/entities/variation.js +108 -108
  392. package/dist/entities/variation.test.js +6 -6
  393. package/dist/entities/variation_field.js +381 -381
  394. package/dist/entities/variation_field.test.js +69 -69
  395. package/dist/entities/variation_fields_option.js +153 -153
  396. package/dist/entities/variation_fields_option.test.js +43 -43
  397. package/dist/entities/variation_option.js +104 -104
  398. package/dist/entities/variation_option.test.js +6 -6
  399. package/dist/entities/variations_group.js +79 -79
  400. package/dist/entities/variations_group.test.js +6 -6
  401. package/dist/entity.js +947 -947
  402. package/dist/index.js +86 -86
  403. package/dist/merchi.js +296 -296
  404. package/dist/merchi.test.js +21 -21
  405. package/dist/pricing/discount.js +11 -11
  406. package/dist/pricing/discount.test.js +35 -35
  407. package/dist/pricing/estimate.js +335 -335
  408. package/dist/pricing/estimate.test.js +403 -403
  409. package/dist/pricing/golden.test.js +61 -61
  410. package/dist/pricing/index.js +7 -7
  411. package/dist/pricing/index.test.js +8 -8
  412. package/dist/pricing/inventory.js +238 -238
  413. package/dist/pricing/inventory.test.js +188 -188
  414. package/dist/pricing/matrix.js +245 -245
  415. package/dist/pricing/matrix.test.js +437 -437
  416. package/dist/pricing/round.js +29 -29
  417. package/dist/pricing/round.test.js +27 -27
  418. package/dist/pricing/types.js +1 -1
  419. package/dist/pricing/visibility.js +227 -227
  420. package/dist/pricing/visibility.test.js +210 -210
  421. package/dist/request.js +169 -169
  422. package/dist/request.test.js +70 -70
  423. package/dist/test_util.js +17 -17
  424. package/dist/toasts.js +14 -14
  425. package/dist/toasts.test.js +28 -28
  426. package/dist/util/float.js +34 -34
  427. package/dist/util/index.js +3 -3
  428. package/dist/util/query_string.js +13 -13
  429. package/dist/util/query_string.test.js +6 -6
  430. package/dist/util/validation.js +3 -3
  431. package/dist/util/validation.test.js +12 -12
  432. package/dist/uuid.js +8 -8
  433. package/dist/uuid.test.js +11 -11
  434. package/jest.config.js +23 -23
  435. package/package.json +34 -34
  436. package/src/constants/auto_assign_production_on_actions.ts +6 -6
  437. package/src/constants/call_to_actions.test.ts +5 -5
  438. package/src/constants/call_to_actions.ts +14 -14
  439. package/src/constants/discount_types.test.ts +5 -5
  440. package/src/constants/discount_types.ts +5 -5
  441. package/src/constants/domain_types.test.ts +5 -5
  442. package/src/constants/domain_types.ts +12 -12
  443. package/src/constants/errors.ts +32 -32
  444. package/src/constants/event_types.test.ts +5 -5
  445. package/src/constants/event_types.ts +5 -5
  446. package/src/constants/field_types.test.ts +5 -5
  447. package/src/constants/field_types.ts +16 -16
  448. package/src/constants/index.ts +51 -51
  449. package/src/constants/input_types.test.ts +5 -5
  450. package/src/constants/input_types.ts +13 -13
  451. package/src/constants/inventory_status.test.ts +5 -5
  452. package/src/constants/inventory_statuses.ts +6 -6
  453. package/src/constants/invoice_types.test.ts +5 -5
  454. package/src/constants/invoice_types.ts +5 -5
  455. package/src/constants/item_types.test.ts +5 -5
  456. package/src/constants/item_types.ts +5 -5
  457. package/src/constants/job/drafting_status.test.ts +5 -5
  458. package/src/constants/job/drafting_status.ts +7 -7
  459. package/src/constants/job/payment_status.test.ts +5 -5
  460. package/src/constants/job/payment_status.ts +7 -7
  461. package/src/constants/job/production_status.test.ts +5 -5
  462. package/src/constants/job/production_status.ts +12 -12
  463. package/src/constants/job/shipment_status.test.ts +5 -5
  464. package/src/constants/job/shipment_status.ts +11 -11
  465. package/src/constants/job/supply_chain_request_status.test.ts +5 -5
  466. package/src/constants/job/supply_chain_request_status.ts +6 -6
  467. package/src/constants/job_priorities.test.ts +5 -5
  468. package/src/constants/job_priorities.ts +6 -6
  469. package/src/constants/job_status.test.ts +5 -5
  470. package/src/constants/job_status.ts +49 -49
  471. package/src/constants/job_types.test.ts +5 -5
  472. package/src/constants/job_types.ts +16 -16
  473. package/src/constants/notification_sections.test.ts +5 -5
  474. package/src/constants/notification_sections.ts +13 -13
  475. package/src/constants/notification_types.test.ts +5 -5
  476. package/src/constants/notification_types.ts +97 -97
  477. package/src/constants/notification_urgencies.test.ts +5 -5
  478. package/src/constants/notification_urgencies.ts +7 -7
  479. package/src/constants/payment_types.test.ts +5 -5
  480. package/src/constants/payment_types.ts +10 -10
  481. package/src/constants/platform.test.ts +15 -15
  482. package/src/constants/platform.ts +6 -6
  483. package/src/constants/product_types.test.ts +6 -6
  484. package/src/constants/product_types.ts +26 -26
  485. package/src/constants/rights.test.ts +5 -5
  486. package/src/constants/rights.ts +5 -5
  487. package/src/constants/robots_meta_directives.test.ts +5 -5
  488. package/src/constants/robots_meta_directives.ts +11 -11
  489. package/src/constants/roles.test.ts +5 -5
  490. package/src/constants/roles.ts +38 -38
  491. package/src/constants/shipment_companies.test.ts +5 -5
  492. package/src/constants/shipment_companies.ts +19 -19
  493. package/src/constants/shipment_services.test.ts +5 -5
  494. package/src/constants/shipment_services.ts +3 -3
  495. package/src/constants/system_roles.test.ts +5 -5
  496. package/src/constants/system_roles.ts +3 -3
  497. package/src/constants/theme_status.test.ts +5 -5
  498. package/src/constants/theme_status.ts +5 -5
  499. package/src/constants/user_types.test.ts +5 -5
  500. package/src/constants/user_types.ts +17 -17
  501. package/src/constants/white_label_accessibilities.test.ts +5 -5
  502. package/src/constants/white_label_accessibilities.ts +6 -6
  503. package/src/cookie.test.ts +11 -11
  504. package/src/cookie.ts +16 -16
  505. package/src/entities/address.test.ts +7 -7
  506. package/src/entities/address.ts +65 -65
  507. package/src/entities/agent_conversation.test.ts +7 -7
  508. package/src/entities/agent_conversation.ts +39 -39
  509. package/src/entities/agent_skill.test.ts +13 -13
  510. package/src/entities/agent_skill.ts +99 -99
  511. package/src/entities/agent_skill_approval.ts +26 -26
  512. package/src/entities/agent_skill_version.ts +64 -64
  513. package/src/entities/agent_token_analytics.ts +49 -49
  514. package/src/entities/agent_token_usage.test.ts +7 -7
  515. package/src/entities/agent_token_usage.ts +88 -88
  516. package/src/entities/assignment.test.ts +39 -39
  517. package/src/entities/assignment.ts +99 -99
  518. package/src/entities/automatic_payment_relationship.test.ts +8 -8
  519. package/src/entities/automatic_payment_relationship.ts +29 -29
  520. package/src/entities/bank.test.ts +7 -7
  521. package/src/entities/bank.ts +45 -45
  522. package/src/entities/cart.test.ts +50 -50
  523. package/src/entities/cart.ts +99 -99
  524. package/src/entities/cart_item.test.ts +33 -33
  525. package/src/entities/cart_item.ts +85 -85
  526. package/src/entities/cart_shipment_group.ts +21 -21
  527. package/src/entities/cart_shipment_quote.ts +33 -33
  528. package/src/entities/category.test.ts +57 -57
  529. package/src/entities/category.ts +59 -59
  530. package/src/entities/company.test.ts +7 -7
  531. package/src/entities/company.ts +397 -397
  532. package/src/entities/company_invitation.test.ts +7 -7
  533. package/src/entities/company_invitation.ts +33 -33
  534. package/src/entities/country_tax.test.ts +13 -13
  535. package/src/entities/country_tax.ts +46 -46
  536. package/src/entities/discount.test.ts +27 -18
  537. package/src/entities/discount.ts +47 -43
  538. package/src/entities/discount_group.test.ts +7 -7
  539. package/src/entities/discount_group.ts +43 -43
  540. package/src/entities/domain.test.ts +382 -382
  541. package/src/entities/domain.ts +1069 -1069
  542. package/src/entities/domain_chat_settings.test.ts +16 -16
  543. package/src/entities/domain_chat_settings.ts +82 -82
  544. package/src/entities/domain_invitation.test.ts +7 -7
  545. package/src/entities/domain_invitation.ts +36 -36
  546. package/src/entities/domain_tag.test.ts +7 -7
  547. package/src/entities/domain_tag.ts +42 -42
  548. package/src/entities/draft.test.ts +29 -29
  549. package/src/entities/draft.ts +79 -79
  550. package/src/entities/draft_comment.test.ts +7 -7
  551. package/src/entities/draft_comment.ts +63 -63
  552. package/src/entities/draft_preview.test.ts +42 -42
  553. package/src/entities/draft_preview.ts +37 -37
  554. package/src/entities/draft_preview_layer.test.ts +7 -7
  555. package/src/entities/draft_preview_layer.ts +21 -21
  556. package/src/entities/draft_template.test.ts +14 -14
  557. package/src/entities/draft_template.ts +81 -81
  558. package/src/entities/email_address.test.ts +7 -7
  559. package/src/entities/email_address.ts +24 -24
  560. package/src/entities/email_counter.test.ts +7 -7
  561. package/src/entities/email_counter.ts +20 -20
  562. package/src/entities/enrolled_domain.test.ts +7 -7
  563. package/src/entities/enrolled_domain.ts +40 -40
  564. package/src/entities/exchange_rate.test.ts +7 -7
  565. package/src/entities/exchange_rate.ts +22 -22
  566. package/src/entities/file.test.ts +43 -43
  567. package/src/entities/file.ts +165 -165
  568. package/src/entities/internal_tag.test.ts +7 -7
  569. package/src/entities/internal_tag.ts +51 -51
  570. package/src/entities/inventory.test.ts +28 -28
  571. package/src/entities/inventory.ts +63 -63
  572. package/src/entities/inventory_group.test.ts +7 -7
  573. package/src/entities/inventory_group.ts +36 -36
  574. package/src/entities/inventory_unit_variation.test.ts +7 -7
  575. package/src/entities/inventory_unit_variation.ts +29 -29
  576. package/src/entities/invoice.test.ts +43 -43
  577. package/src/entities/invoice.ts +189 -189
  578. package/src/entities/item.test.ts +19 -19
  579. package/src/entities/item.ts +59 -59
  580. package/src/entities/job.test.ts +95 -95
  581. package/src/entities/job.ts +401 -398
  582. package/src/entities/job_comment.test.ts +7 -7
  583. package/src/entities/job_comment.ts +53 -53
  584. package/src/entities/job_note.ts +40 -40
  585. package/src/entities/job_operation_log.test.ts +7 -7
  586. package/src/entities/job_operation_log.ts +41 -41
  587. package/src/entities/matching_inventory.ts +29 -29
  588. package/src/entities/notification.test.ts +58 -58
  589. package/src/entities/notification.ts +106 -106
  590. package/src/entities/payment.test.ts +19 -19
  591. package/src/entities/payment.ts +65 -65
  592. package/src/entities/payment_device.test.ts +7 -7
  593. package/src/entities/payment_device.ts +30 -30
  594. package/src/entities/phone_number.test.ts +7 -7
  595. package/src/entities/phone_number.ts +36 -36
  596. package/src/entities/product.test.ts +772 -772
  597. package/src/entities/product.ts +480 -480
  598. package/src/entities/product_form.ts +51 -51
  599. package/src/entities/product_form_version.ts +51 -51
  600. package/src/entities/product_review.ts +221 -221
  601. package/src/entities/production_comment.test.ts +7 -7
  602. package/src/entities/production_comment.ts +53 -53
  603. package/src/entities/quote.test.ts +98 -98
  604. package/src/entities/quote.ts +140 -140
  605. package/src/entities/quote_item.test.ts +50 -50
  606. package/src/entities/quote_item.ts +71 -71
  607. package/src/entities/reminder.test.ts +16 -16
  608. package/src/entities/reminder.ts +74 -74
  609. package/src/entities/session.test.ts +7 -7
  610. package/src/entities/session.ts +28 -28
  611. package/src/entities/shipment.test.ts +24 -24
  612. package/src/entities/shipment.ts +196 -196
  613. package/src/entities/shipment_item.test.ts +7 -7
  614. package/src/entities/shipment_item.ts +15 -15
  615. package/src/entities/shipment_item_fulfillment.test.ts +8 -8
  616. package/src/entities/shipment_item_fulfillment.ts +15 -15
  617. package/src/entities/shipment_log.ts +37 -37
  618. package/src/entities/shipment_method.test.ts +7 -7
  619. package/src/entities/shipment_method.ts +61 -61
  620. package/src/entities/shipment_method_variation.test.ts +7 -7
  621. package/src/entities/shipment_method_variation.ts +39 -39
  622. package/src/entities/short_url.test.ts +7 -7
  623. package/src/entities/short_url.ts +36 -36
  624. package/src/entities/subscription_plan.test.ts +7 -7
  625. package/src/entities/subscription_plan.ts +73 -73
  626. package/src/entities/supply_domain.test.ts +7 -7
  627. package/src/entities/supply_domain.ts +27 -27
  628. package/src/entities/support_conversation.test.ts +7 -7
  629. package/src/entities/support_conversation.ts +65 -65
  630. package/src/entities/support_message.test.ts +7 -7
  631. package/src/entities/support_message.ts +30 -30
  632. package/src/entities/system_role.test.ts +7 -7
  633. package/src/entities/system_role.ts +17 -17
  634. package/src/entities/theme.test.ts +38 -38
  635. package/src/entities/theme.ts +82 -82
  636. package/src/entities/theme_css_setting.test.ts +7 -7
  637. package/src/entities/theme_css_setting.ts +23 -23
  638. package/src/entities/user.test.ts +154 -154
  639. package/src/entities/user.ts +428 -428
  640. package/src/entities/user_company.test.ts +7 -7
  641. package/src/entities/user_company.ts +27 -27
  642. package/src/entities/variation.test.ts +7 -7
  643. package/src/entities/variation.ts +64 -64
  644. package/src/entities/variation_field.test.ts +76 -76
  645. package/src/entities/variation_field.ts +268 -268
  646. package/src/entities/variation_fields_option.test.ts +46 -46
  647. package/src/entities/variation_fields_option.ts +107 -107
  648. package/src/entities/variation_option.test.ts +7 -7
  649. package/src/entities/variation_option.ts +58 -58
  650. package/src/entities/variations_group.test.ts +7 -7
  651. package/src/entities/variations_group.ts +41 -41
  652. package/src/entity.ts +1094 -1094
  653. package/src/index.ts +189 -189
  654. package/src/merchi.test.ts +25 -25
  655. package/src/merchi.ts +445 -445
  656. package/src/pricing/__fixtures__/conditional_field_hidden.json +111 -111
  657. package/src/pricing/__fixtures__/conditional_field_visible.json +112 -112
  658. package/src/pricing/__fixtures__/group_product.json +129 -129
  659. package/src/pricing/__fixtures__/non_selectable_number_field.json +107 -107
  660. package/src/pricing/__fixtures__/quantity_break_discount.json +103 -103
  661. package/src/pricing/__fixtures__/simple_selectable_field.json +109 -109
  662. package/src/pricing/discount.test.ts +47 -47
  663. package/src/pricing/discount.ts +17 -17
  664. package/src/pricing/estimate.test.ts +486 -486
  665. package/src/pricing/estimate.ts +310 -310
  666. package/src/pricing/golden.test.ts +51 -51
  667. package/src/pricing/index.test.ts +9 -9
  668. package/src/pricing/index.ts +7 -7
  669. package/src/pricing/inventory.test.ts +197 -197
  670. package/src/pricing/inventory.ts +89 -89
  671. package/src/pricing/matrix.test.ts +553 -553
  672. package/src/pricing/matrix.ts +217 -217
  673. package/src/pricing/round.test.ts +31 -31
  674. package/src/pricing/round.ts +27 -27
  675. package/src/pricing/types.ts +140 -140
  676. package/src/pricing/visibility.test.ts +223 -223
  677. package/src/pricing/visibility.ts +111 -111
  678. package/src/request.test.ts +79 -79
  679. package/src/request.ts +196 -196
  680. package/src/test_util.ts +18 -18
  681. package/src/toasts.test.ts +38 -38
  682. package/src/toasts.ts +34 -34
  683. package/src/util/float.ts +12 -12
  684. package/src/util/index.ts +7 -7
  685. package/src/util/query_string.test.ts +7 -7
  686. package/src/util/query_string.ts +13 -13
  687. package/src/util/validation.test.ts +16 -16
  688. package/src/util/validation.ts +2 -2
  689. package/src/uuid.test.ts +15 -15
  690. package/src/uuid.ts +8 -8
  691. package/tsconfig.json +29 -29
  692. package/yarn-error.log +4718 -0
package/.eslintrc.cjs CHANGED
@@ -1,43 +1,43 @@
1
- module.exports = {
2
- 'parser': '@typescript-eslint/parser',
3
- 'plugins': ['@typescript-eslint'],
4
- 'env': {
5
- 'browser': true,
6
- 'es6': true,
7
- 'jest': true
8
- },
9
- 'extends': ['eslint:recommended',
10
- 'plugin:@typescript-eslint/eslint-recommended',
11
- 'plugin:@typescript-eslint/recommended'],
12
- 'globals': {
13
- 'Atomics': 'readonly',
14
- 'SharedArrayBuffer': 'readonly',
15
- 'global': 'writable'
16
- },
17
- 'parserOptions': {
18
- 'ecmaVersion': 2018,
19
- 'sourceType': 'module'
20
- },
21
- 'rules': {
22
- 'indent': 'off',
23
- '@typescript-eslint/indent': ['error', 2],
24
- '@typescript-eslint/explicit-function-return-type': 'off',
25
- '@typescript-eslint/no-explicit-any': 'off',
26
- '@typescript-eslint/no-non-null-assertion': 'off',
27
- '@typescript-eslint/no-empty-function': 'off',
28
- '@typescript-eslint/no-this-alias': 'off',
29
- '@typescript-eslint/ban-types': 'off',
30
- 'linebreak-style': [
31
- 'error',
32
- 'unix'
33
- ],
34
- 'quotes': [
35
- 'error',
36
- 'single'
37
- ],
38
- 'semi': [
39
- 'error',
40
- 'always'
41
- ]
42
- }
43
- };
1
+ module.exports = {
2
+ 'parser': '@typescript-eslint/parser',
3
+ 'plugins': ['@typescript-eslint'],
4
+ 'env': {
5
+ 'browser': true,
6
+ 'es6': true,
7
+ 'jest': true
8
+ },
9
+ 'extends': ['eslint:recommended',
10
+ 'plugin:@typescript-eslint/eslint-recommended',
11
+ 'plugin:@typescript-eslint/recommended'],
12
+ 'globals': {
13
+ 'Atomics': 'readonly',
14
+ 'SharedArrayBuffer': 'readonly',
15
+ 'global': 'writable'
16
+ },
17
+ 'parserOptions': {
18
+ 'ecmaVersion': 2018,
19
+ 'sourceType': 'module'
20
+ },
21
+ 'rules': {
22
+ 'indent': 'off',
23
+ '@typescript-eslint/indent': ['error', 2],
24
+ '@typescript-eslint/explicit-function-return-type': 'off',
25
+ '@typescript-eslint/no-explicit-any': 'off',
26
+ '@typescript-eslint/no-non-null-assertion': 'off',
27
+ '@typescript-eslint/no-empty-function': 'off',
28
+ '@typescript-eslint/no-this-alias': 'off',
29
+ '@typescript-eslint/ban-types': 'off',
30
+ 'linebreak-style': [
31
+ 'error',
32
+ 'unix'
33
+ ],
34
+ 'quotes': [
35
+ 'error',
36
+ 'single'
37
+ ],
38
+ 'semi': [
39
+ 'error',
40
+ 'always'
41
+ ]
42
+ }
43
+ };
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Merchi
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Merchi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,244 +1,244 @@
1
- # Merchi TypeScript SDK
2
-
3
- A TypeScript SDK for interacting with the Merchi API.
4
-
5
- [![npm version](https://img.shields.io/npm/v/merchi_sdk_ts.svg)](https://www.npmjs.com/package/merchi_sdk_ts)
6
- [![License: GPL-3.0](https://img.shields.io/badge/License-GPL%203.0-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
7
-
8
- ## Table of Contents
9
-
10
- - [Installation](#installation)
11
- - [Quick Start](#quick-start)
12
- - [Configuration](#configuration)
13
- - [Authentication](#authentication)
14
- - [Basic Usage](#basic-usage)
15
- - [Entity Operations](#entity-operations)
16
- - [Embedding Related Entities](#embedding-related-entities)
17
- - [Available Entities](#available-entities)
18
- - [Examples](#examples)
19
- - [TypeScript Support](#typescript-support)
20
- - [License](#license)
21
-
22
- ## Installation
23
-
24
- ```bash
25
- # Using npm
26
- npm install merchi_sdk_ts
27
-
28
- # Using yarn
29
- yarn add merchi_sdk_ts
30
- ```
31
-
32
- ## Quick Start
33
-
34
- ```typescript
35
- import { Merchi, Product } from 'merchi_sdk_ts';
36
-
37
- // Initialize the SDK
38
- const merchi = new Merchi();
39
-
40
- // Fetch a product by ID
41
- Product.get(123).then(product => {
42
- console.log(product.name);
43
- });
44
- ```
45
-
46
- ## Configuration
47
-
48
- The SDK by default is set up to make requests to the Merchi production server at `https://api.merchi.co/v6/`.
49
-
50
- You can customize the API endpoint by:
51
-
52
- 1. Setting `process.env.MERCHI_BACKEND_URI` in your Node.js environment.
53
- 2. Setting `window.merchiBackendUri` in the browser.
54
- 3. Passing the `backendUri` directly to the `Merchi` constructor (highest precedence).
55
-
56
- The SDK will look for these in the order of 3, 2, 1, and finally use the default production URL if none are found.
57
- The API version (e.g., `/v6/`) will be appended automatically if not included in your custom URI, assuming the URI ends with the base domain (e.g. `https://custom.merchi.co`). If your custom URI already includes a path (e.g., `https://custom.merchi.co/api/`), ensure it ends with a trailing slash for the version to be appended correctly (e.g., `https://custom.merchi.co/api/v6/`).
58
-
59
- **Example: Passing `backendUri` to the constructor**
60
-
61
- ```typescript
62
- import { Merchi } from 'merchi_sdk_ts';
63
-
64
- // Initialize the SDK with a custom backend URI
65
- // This URI should be the base path to your Merchi backend instance.
66
- // The API version (e.g., /v6/) will be appended.
67
- const customBackend = 'https://my-custom-merchi-instance.com/';
68
- const merchi = new Merchi(undefined, undefined, undefined, undefined, customBackend);
69
-
70
- // If your custom URI already includes a specific path and you want to control the full endpoint:
71
- const specificCustomBackend = 'https://my-custom-merchi-instance.com/api/custom_version/';
72
- const merchiSpecific = new Merchi(undefined, undefined, undefined, undefined, specificCustomBackend);
73
-
74
- // Now, all API calls made using this 'merchi' or 'merchiSpecific' instance
75
- // will be directed to your specified backend.
76
- // For example:
77
- // merchi.Product.get(1) will call https://my-custom-merchi-instance.com/v6/products/1/
78
- // merchiSpecific.Product.get(1) will call https://my-custom-merchi-instance.com/api/custom_version/products/1/
79
- ```
80
-
81
- ## Authentication
82
-
83
- The SDK supports several authentication methods:
84
-
85
- ```typescript
86
- // Session token authentication (most common)
87
- const merchi = new Merchi('your-session-token');
88
-
89
- // Alternative methods
90
- const merchi = new Merchi(
91
- 'your-session-token', // Session token
92
- 'your-client-token', // Client token
93
- 'your-invoice-token', // Invoice token
94
- 'your-cart-token' // Cart token
95
- );
96
-
97
- // The SDK will also attempt to read session_token from cookies
98
- // if no token is provided
99
- ```
100
-
101
- ## Basic Usage
102
-
103
- ### Entity Operations
104
-
105
- Each entity supports standard CRUD operations:
106
-
107
- ```typescript
108
- // Fetch a single entity
109
- Product.get(123).then(product => {
110
- console.log(product);
111
- });
112
-
113
- // List entities with filtering
114
- Product.list({
115
- limit: 10,
116
- offset: 0,
117
- q: 'search-term'
118
- }).then(response => {
119
- console.log(response.items); // Array of products
120
- console.log(response.metadata); // Metadata including count, limit, offset
121
- });
122
-
123
- // Create a new entity
124
- const product = new Product();
125
- product.name = 'New Product';
126
- product.description = 'Product description';
127
- product.create().then(newProduct => {
128
- console.log(newProduct.id);
129
- });
130
-
131
- // Update an entity
132
- product.name = 'Updated Product Name';
133
- product.save().then(updatedProduct => {
134
- console.log(updatedProduct);
135
- });
136
-
137
- // Delete an entity
138
- product.delete().then(() => {
139
- console.log('Product deleted');
140
- });
141
- ```
142
-
143
- ### Embedding Related Entities
144
-
145
- You can request related entities be included in responses:
146
-
147
- ```typescript
148
- Product.get(123, {
149
- embed: {
150
- domain: {},
151
- variations: {
152
- variationFields: {}
153
- }
154
- }
155
- }).then(product => {
156
- console.log(product.domain); // Domain entity is included
157
- console.log(product.variations); // Variations are included
158
- console.log(product.variations[0].variationFields); // Fields are included
159
- });
160
- ```
161
-
162
- ## Available Entities
163
-
164
- The SDK provides access to all Merchi entities, including but not limited to:
165
-
166
- - User, Company, Domain
167
- - Product, Category, Variation
168
- - Cart, CartItem
169
- - Job, Assignment, Invoice
170
- - File, Draft, DraftTemplate
171
- - Payment, Shipment
172
- - And many more...
173
-
174
- Each entity maps directly to the corresponding API endpoint and data structure.
175
-
176
- ## Examples
177
-
178
- ### Working with Products
179
-
180
- ```typescript
181
- import { Merchi, Product } from 'merchi_sdk_ts';
182
-
183
- // Initialize Merchi
184
- const merchi = new Merchi('your-session-token');
185
-
186
- // Create a new product
187
- const product = new Product();
188
- product.name = 'Custom T-Shirt';
189
- product.description = 'High-quality custom printed t-shirt';
190
- product.public = true;
191
-
192
- product.create().then(newProduct => {
193
- console.log(`Created product with ID: ${newProduct.id}`);
194
- });
195
- ```
196
-
197
- ### Managing a Cart
198
-
199
- ```typescript
200
- import { Merchi, Cart, CartItem } from 'merchi_sdk_ts';
201
-
202
- // Initialize Merchi
203
- const merchi = new Merchi('your-session-token');
204
-
205
- // Create a new cart
206
- const cart = new Cart();
207
- cart.create().then(newCart => {
208
- // Add an item to the cart
209
- const cartItem = new CartItem();
210
- cartItem.productId = 123;
211
- cartItem.quantity = 2;
212
- cartItem.cartId = newCart.id;
213
-
214
- return cartItem.create();
215
- }).then(newCartItem => {
216
- console.log('Item added to cart!');
217
- });
218
- ```
219
-
220
- ## TypeScript Support
221
-
222
- This SDK is built with TypeScript and provides full type definitions for all entities and operations.
223
-
224
- ```typescript
225
- import { Product, EmbedDescriptor } from 'merchi_sdk_ts';
226
-
227
- // TypeScript will provide intellisense for all properties
228
- const product = new Product();
229
- product.name = 'New Product';
230
-
231
- // Type checking for embed options
232
- const embedOptions: EmbedDescriptor = {
233
- domain: {},
234
- variations: {
235
- variationFields: {}
236
- }
237
- };
238
-
239
- Product.get(123, { embed: embedOptions });
240
- ```
241
-
242
- ## License
243
-
244
- This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
1
+ # Merchi TypeScript SDK
2
+
3
+ A TypeScript SDK for interacting with the Merchi API.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/merchi_sdk_ts.svg)](https://www.npmjs.com/package/merchi_sdk_ts)
6
+ [![License: GPL-3.0](https://img.shields.io/badge/License-GPL%203.0-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
7
+
8
+ ## Table of Contents
9
+
10
+ - [Installation](#installation)
11
+ - [Quick Start](#quick-start)
12
+ - [Configuration](#configuration)
13
+ - [Authentication](#authentication)
14
+ - [Basic Usage](#basic-usage)
15
+ - [Entity Operations](#entity-operations)
16
+ - [Embedding Related Entities](#embedding-related-entities)
17
+ - [Available Entities](#available-entities)
18
+ - [Examples](#examples)
19
+ - [TypeScript Support](#typescript-support)
20
+ - [License](#license)
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ # Using npm
26
+ npm install merchi_sdk_ts
27
+
28
+ # Using yarn
29
+ yarn add merchi_sdk_ts
30
+ ```
31
+
32
+ ## Quick Start
33
+
34
+ ```typescript
35
+ import { Merchi, Product } from 'merchi_sdk_ts';
36
+
37
+ // Initialize the SDK
38
+ const merchi = new Merchi();
39
+
40
+ // Fetch a product by ID
41
+ Product.get(123).then(product => {
42
+ console.log(product.name);
43
+ });
44
+ ```
45
+
46
+ ## Configuration
47
+
48
+ The SDK by default is set up to make requests to the Merchi production server at `https://api.merchi.co/v6/`.
49
+
50
+ You can customize the API endpoint by:
51
+
52
+ 1. Setting `process.env.MERCHI_BACKEND_URI` in your Node.js environment.
53
+ 2. Setting `window.merchiBackendUri` in the browser.
54
+ 3. Passing the `backendUri` directly to the `Merchi` constructor (highest precedence).
55
+
56
+ The SDK will look for these in the order of 3, 2, 1, and finally use the default production URL if none are found.
57
+ The API version (e.g., `/v6/`) will be appended automatically if not included in your custom URI, assuming the URI ends with the base domain (e.g. `https://custom.merchi.co`). If your custom URI already includes a path (e.g., `https://custom.merchi.co/api/`), ensure it ends with a trailing slash for the version to be appended correctly (e.g., `https://custom.merchi.co/api/v6/`).
58
+
59
+ **Example: Passing `backendUri` to the constructor**
60
+
61
+ ```typescript
62
+ import { Merchi } from 'merchi_sdk_ts';
63
+
64
+ // Initialize the SDK with a custom backend URI
65
+ // This URI should be the base path to your Merchi backend instance.
66
+ // The API version (e.g., /v6/) will be appended.
67
+ const customBackend = 'https://my-custom-merchi-instance.com/';
68
+ const merchi = new Merchi(undefined, undefined, undefined, undefined, customBackend);
69
+
70
+ // If your custom URI already includes a specific path and you want to control the full endpoint:
71
+ const specificCustomBackend = 'https://my-custom-merchi-instance.com/api/custom_version/';
72
+ const merchiSpecific = new Merchi(undefined, undefined, undefined, undefined, specificCustomBackend);
73
+
74
+ // Now, all API calls made using this 'merchi' or 'merchiSpecific' instance
75
+ // will be directed to your specified backend.
76
+ // For example:
77
+ // merchi.Product.get(1) will call https://my-custom-merchi-instance.com/v6/products/1/
78
+ // merchiSpecific.Product.get(1) will call https://my-custom-merchi-instance.com/api/custom_version/products/1/
79
+ ```
80
+
81
+ ## Authentication
82
+
83
+ The SDK supports several authentication methods:
84
+
85
+ ```typescript
86
+ // Session token authentication (most common)
87
+ const merchi = new Merchi('your-session-token');
88
+
89
+ // Alternative methods
90
+ const merchi = new Merchi(
91
+ 'your-session-token', // Session token
92
+ 'your-client-token', // Client token
93
+ 'your-invoice-token', // Invoice token
94
+ 'your-cart-token' // Cart token
95
+ );
96
+
97
+ // The SDK will also attempt to read session_token from cookies
98
+ // if no token is provided
99
+ ```
100
+
101
+ ## Basic Usage
102
+
103
+ ### Entity Operations
104
+
105
+ Each entity supports standard CRUD operations:
106
+
107
+ ```typescript
108
+ // Fetch a single entity
109
+ Product.get(123).then(product => {
110
+ console.log(product);
111
+ });
112
+
113
+ // List entities with filtering
114
+ Product.list({
115
+ limit: 10,
116
+ offset: 0,
117
+ q: 'search-term'
118
+ }).then(response => {
119
+ console.log(response.items); // Array of products
120
+ console.log(response.metadata); // Metadata including count, limit, offset
121
+ });
122
+
123
+ // Create a new entity
124
+ const product = new Product();
125
+ product.name = 'New Product';
126
+ product.description = 'Product description';
127
+ product.create().then(newProduct => {
128
+ console.log(newProduct.id);
129
+ });
130
+
131
+ // Update an entity
132
+ product.name = 'Updated Product Name';
133
+ product.save().then(updatedProduct => {
134
+ console.log(updatedProduct);
135
+ });
136
+
137
+ // Delete an entity
138
+ product.delete().then(() => {
139
+ console.log('Product deleted');
140
+ });
141
+ ```
142
+
143
+ ### Embedding Related Entities
144
+
145
+ You can request related entities be included in responses:
146
+
147
+ ```typescript
148
+ Product.get(123, {
149
+ embed: {
150
+ domain: {},
151
+ variations: {
152
+ variationFields: {}
153
+ }
154
+ }
155
+ }).then(product => {
156
+ console.log(product.domain); // Domain entity is included
157
+ console.log(product.variations); // Variations are included
158
+ console.log(product.variations[0].variationFields); // Fields are included
159
+ });
160
+ ```
161
+
162
+ ## Available Entities
163
+
164
+ The SDK provides access to all Merchi entities, including but not limited to:
165
+
166
+ - User, Company, Domain
167
+ - Product, Category, Variation
168
+ - Cart, CartItem
169
+ - Job, Assignment, Invoice
170
+ - File, Draft, DraftTemplate
171
+ - Payment, Shipment
172
+ - And many more...
173
+
174
+ Each entity maps directly to the corresponding API endpoint and data structure.
175
+
176
+ ## Examples
177
+
178
+ ### Working with Products
179
+
180
+ ```typescript
181
+ import { Merchi, Product } from 'merchi_sdk_ts';
182
+
183
+ // Initialize Merchi
184
+ const merchi = new Merchi('your-session-token');
185
+
186
+ // Create a new product
187
+ const product = new Product();
188
+ product.name = 'Custom T-Shirt';
189
+ product.description = 'High-quality custom printed t-shirt';
190
+ product.public = true;
191
+
192
+ product.create().then(newProduct => {
193
+ console.log(`Created product with ID: ${newProduct.id}`);
194
+ });
195
+ ```
196
+
197
+ ### Managing a Cart
198
+
199
+ ```typescript
200
+ import { Merchi, Cart, CartItem } from 'merchi_sdk_ts';
201
+
202
+ // Initialize Merchi
203
+ const merchi = new Merchi('your-session-token');
204
+
205
+ // Create a new cart
206
+ const cart = new Cart();
207
+ cart.create().then(newCart => {
208
+ // Add an item to the cart
209
+ const cartItem = new CartItem();
210
+ cartItem.productId = 123;
211
+ cartItem.quantity = 2;
212
+ cartItem.cartId = newCart.id;
213
+
214
+ return cartItem.create();
215
+ }).then(newCartItem => {
216
+ console.log('Item added to cart!');
217
+ });
218
+ ```
219
+
220
+ ## TypeScript Support
221
+
222
+ This SDK is built with TypeScript and provides full type definitions for all entities and operations.
223
+
224
+ ```typescript
225
+ import { Product, EmbedDescriptor } from 'merchi_sdk_ts';
226
+
227
+ // TypeScript will provide intellisense for all properties
228
+ const product = new Product();
229
+ product.name = 'New Product';
230
+
231
+ // Type checking for embed options
232
+ const embedOptions: EmbedDescriptor = {
233
+ domain: {},
234
+ variations: {
235
+ variationFields: {}
236
+ }
237
+ };
238
+
239
+ Product.get(123, { embed: embedOptions });
240
+ ```
241
+
242
+ ## License
243
+
244
+ This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.