merchi_sdk_ts 0.0.1-a

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 (444) hide show
  1. package/.babelrc +13 -0
  2. package/.eslintrc.cjs +43 -0
  3. package/LICENSE +21 -0
  4. package/README.md +2 -0
  5. package/dist/constants/auto_assign_production_on_actions.js +7 -0
  6. package/dist/constants/call_to_actions.js +15 -0
  7. package/dist/constants/call_to_actions.test.js +4 -0
  8. package/dist/constants/discount_types.js +4 -0
  9. package/dist/constants/discount_types.test.js +4 -0
  10. package/dist/constants/domain_types.js +13 -0
  11. package/dist/constants/domain_types.test.js +4 -0
  12. package/dist/constants/errors.js +32 -0
  13. package/dist/constants/event_types.js +6 -0
  14. package/dist/constants/event_types.test.js +4 -0
  15. package/dist/constants/field_types.js +14 -0
  16. package/dist/constants/field_types.test.js +4 -0
  17. package/dist/constants/input_types.js +14 -0
  18. package/dist/constants/input_types.test.js +4 -0
  19. package/dist/constants/inventory_status.test.js +4 -0
  20. package/dist/constants/inventory_statuses.js +7 -0
  21. package/dist/constants/invoice_types.js +6 -0
  22. package/dist/constants/invoice_types.test.js +4 -0
  23. package/dist/constants/item_types.js +6 -0
  24. package/dist/constants/item_types.test.js +4 -0
  25. package/dist/constants/job/drafting_status.js +8 -0
  26. package/dist/constants/job/drafting_status.test.js +4 -0
  27. package/dist/constants/job/payment_status.js +8 -0
  28. package/dist/constants/job/payment_status.test.js +4 -0
  29. package/dist/constants/job/production_status.js +13 -0
  30. package/dist/constants/job/production_status.test.js +4 -0
  31. package/dist/constants/job/shipment_status.js +12 -0
  32. package/dist/constants/job/shipment_status.test.js +4 -0
  33. package/dist/constants/job/supply_chain_request_status.js +7 -0
  34. package/dist/constants/job/supply_chain_request_status.test.js +4 -0
  35. package/dist/constants/job_priorities.js +7 -0
  36. package/dist/constants/job_priorities.test.js +4 -0
  37. package/dist/constants/job_status.js +50 -0
  38. package/dist/constants/job_status.test.js +4 -0
  39. package/dist/constants/job_types.js +16 -0
  40. package/dist/constants/job_types.test.js +4 -0
  41. package/dist/constants/notification_sections.js +14 -0
  42. package/dist/constants/notification_sections.test.js +4 -0
  43. package/dist/constants/notification_types.js +98 -0
  44. package/dist/constants/notification_types.test.js +4 -0
  45. package/dist/constants/notification_urgencies.js +7 -0
  46. package/dist/constants/notification_urgencies.test.js +4 -0
  47. package/dist/constants/payment_types.js +11 -0
  48. package/dist/constants/payment_types.test.js +4 -0
  49. package/dist/constants/platform.js +5 -0
  50. package/dist/constants/platform.test.js +8 -0
  51. package/dist/constants/product_types.js +26 -0
  52. package/dist/constants/product_types.test.js +4 -0
  53. package/dist/constants/rights.js +6 -0
  54. package/dist/constants/rights.test.js +4 -0
  55. package/dist/constants/robots_meta_directives.js +1 -0
  56. package/dist/constants/robots_meta_directives.test.js +4 -0
  57. package/dist/constants/roles.js +25 -0
  58. package/dist/constants/roles.test.js +4 -0
  59. package/dist/constants/shipment_companies.js +19 -0
  60. package/dist/constants/shipment_companies.test.js +4 -0
  61. package/dist/constants/shipment_services.js +4 -0
  62. package/dist/constants/shipment_services.test.js +4 -0
  63. package/dist/constants/system_roles.js +4 -0
  64. package/dist/constants/system_roles.test.js +4 -0
  65. package/dist/constants/theme_foundations.js +7 -0
  66. package/dist/constants/theme_foundations.test.js +4 -0
  67. package/dist/constants/theme_status.js +6 -0
  68. package/dist/constants/theme_status.test.js +4 -0
  69. package/dist/constants/user_types.js +18 -0
  70. package/dist/constants/user_types.test.js +4 -0
  71. package/dist/constants/white_label_accessibilities.js +6 -0
  72. package/dist/constants/white_label_accessibilities.test.js +4 -0
  73. package/dist/cookie.js +16 -0
  74. package/dist/cookie.test.js +12 -0
  75. package/dist/entities/address.js +166 -0
  76. package/dist/entities/address.test.js +6 -0
  77. package/dist/entities/assignment.js +185 -0
  78. package/dist/entities/assignment.test.js +38 -0
  79. package/dist/entities/automatic_payment_relationship.js +77 -0
  80. package/dist/entities/automatic_payment_relationship.test.js +6 -0
  81. package/dist/entities/backup.js +44 -0
  82. package/dist/entities/backup.test.js +6 -0
  83. package/dist/entities/bank.js +116 -0
  84. package/dist/entities/bank.test.js +6 -0
  85. package/dist/entities/cart.js +203 -0
  86. package/dist/entities/cart.test.js +52 -0
  87. package/dist/entities/cart_item.js +153 -0
  88. package/dist/entities/cart_item.test.js +34 -0
  89. package/dist/entities/cart_shipment_group.js +62 -0
  90. package/dist/entities/cart_shipment_quote.js +85 -0
  91. package/dist/entities/category.js +92 -0
  92. package/dist/entities/category.test.js +52 -0
  93. package/dist/entities/company.js +648 -0
  94. package/dist/entities/company.test.js +6 -0
  95. package/dist/entities/company_invitation.js +82 -0
  96. package/dist/entities/company_invitation.test.js +6 -0
  97. package/dist/entities/component.js +209 -0
  98. package/dist/entities/component.test.js +12 -0
  99. package/dist/entities/component_tag.js +50 -0
  100. package/dist/entities/component_tag.test.js +6 -0
  101. package/dist/entities/component_version.js +80 -0
  102. package/dist/entities/component_version.test.js +6 -0
  103. package/dist/entities/country_tax.js +110 -0
  104. package/dist/entities/country_tax.test.js +11 -0
  105. package/dist/entities/discount.js +77 -0
  106. package/dist/entities/discount.test.js +20 -0
  107. package/dist/entities/discount_group.js +74 -0
  108. package/dist/entities/discount_group.test.js +6 -0
  109. package/dist/entities/domain.js +535 -0
  110. package/dist/entities/domain.test.js +75 -0
  111. package/dist/entities/domain_invitation.js +90 -0
  112. package/dist/entities/domain_invitation.test.js +6 -0
  113. package/dist/entities/domain_tag.js +100 -0
  114. package/dist/entities/domain_tag.test.js +6 -0
  115. package/dist/entities/draft.js +180 -0
  116. package/dist/entities/draft.test.js +39 -0
  117. package/dist/entities/draft_comment.js +132 -0
  118. package/dist/entities/draft_comment.test.js +6 -0
  119. package/dist/entities/draft_template.js +105 -0
  120. package/dist/entities/draft_template.test.js +6 -0
  121. package/dist/entities/email_address.js +68 -0
  122. package/dist/entities/email_address.test.js +6 -0
  123. package/dist/entities/email_counter.js +56 -0
  124. package/dist/entities/email_counter.test.js +6 -0
  125. package/dist/entities/enrolled_domain.js +85 -0
  126. package/dist/entities/enrolled_domain.test.js +6 -0
  127. package/dist/entities/exchange_rate.js +62 -0
  128. package/dist/entities/exchange_rate.test.js +6 -0
  129. package/dist/entities/file.js +383 -0
  130. package/dist/entities/file.test.js +38 -0
  131. package/dist/entities/internal_tag.js +120 -0
  132. package/dist/entities/internal_tag.test.js +6 -0
  133. package/dist/entities/inventory.js +120 -0
  134. package/dist/entities/inventory.test.js +26 -0
  135. package/dist/entities/inventory_unit_variation.js +64 -0
  136. package/dist/entities/inventory_unit_variation.test.js +6 -0
  137. package/dist/entities/invoice.js +420 -0
  138. package/dist/entities/invoice.test.js +39 -0
  139. package/dist/entities/item.js +102 -0
  140. package/dist/entities/item.test.js +17 -0
  141. package/dist/entities/job.js +744 -0
  142. package/dist/entities/job.test.js +103 -0
  143. package/dist/entities/job_comment.js +120 -0
  144. package/dist/entities/job_comment.test.js +6 -0
  145. package/dist/entities/matching_inventory.js +77 -0
  146. package/dist/entities/menu.js +78 -0
  147. package/dist/entities/menu.test.js +6 -0
  148. package/dist/entities/menu_item.js +76 -0
  149. package/dist/entities/menu_item.test.js +6 -0
  150. package/dist/entities/notification.js +234 -0
  151. package/dist/entities/notification.test.js +6 -0
  152. package/dist/entities/page.js +84 -0
  153. package/dist/entities/page.test.js +6 -0
  154. package/dist/entities/payment.js +141 -0
  155. package/dist/entities/payment.test.js +18 -0
  156. package/dist/entities/payment_device.js +87 -0
  157. package/dist/entities/payment_device.test.js +6 -0
  158. package/dist/entities/phone_number.js +98 -0
  159. package/dist/entities/phone_number.test.js +6 -0
  160. package/dist/entities/product.js +806 -0
  161. package/dist/entities/product.test.js +811 -0
  162. package/dist/entities/production_comment.js +120 -0
  163. package/dist/entities/production_comment.test.js +6 -0
  164. package/dist/entities/quote.js +208 -0
  165. package/dist/entities/quote.test.js +107 -0
  166. package/dist/entities/quote_item.js +121 -0
  167. package/dist/entities/quote_item.test.js +56 -0
  168. package/dist/entities/seo_domain_page.js +82 -0
  169. package/dist/entities/seo_domain_page.test.js +6 -0
  170. package/dist/entities/session.js +77 -0
  171. package/dist/entities/session.test.js +6 -0
  172. package/dist/entities/shipment.js +401 -0
  173. package/dist/entities/shipment.test.js +28 -0
  174. package/dist/entities/shipment_item.js +49 -0
  175. package/dist/entities/shipment_item.test.js +6 -0
  176. package/dist/entities/shipment_item_fulfillment.js +48 -0
  177. package/dist/entities/shipment_item_fulfillment.test.js +6 -0
  178. package/dist/entities/shipment_method.js +146 -0
  179. package/dist/entities/shipment_method.test.js +6 -0
  180. package/dist/entities/shipment_method_variation.js +104 -0
  181. package/dist/entities/shipment_method_variation.test.js +6 -0
  182. package/dist/entities/short_url.js +95 -0
  183. package/dist/entities/short_url.test.js +6 -0
  184. package/dist/entities/subscription_plan.js +172 -0
  185. package/dist/entities/subscription_plan.test.js +6 -0
  186. package/dist/entities/supply_domain.js +73 -0
  187. package/dist/entities/supply_domain.test.js +6 -0
  188. package/dist/entities/system_role.js +50 -0
  189. package/dist/entities/system_role.test.js +6 -0
  190. package/dist/entities/theme.js +614 -0
  191. package/dist/entities/theme.test.js +39 -0
  192. package/dist/entities/theme_css_setting.js +67 -0
  193. package/dist/entities/theme_css_setting.test.js +6 -0
  194. package/dist/entities/user.js +749 -0
  195. package/dist/entities/user.test.js +157 -0
  196. package/dist/entities/user_company.js +78 -0
  197. package/dist/entities/user_company.test.js +6 -0
  198. package/dist/entities/variation.js +147 -0
  199. package/dist/entities/variation.test.js +6 -0
  200. package/dist/entities/variation_field.js +313 -0
  201. package/dist/entities/variation_field.test.js +69 -0
  202. package/dist/entities/variation_fields_option.js +190 -0
  203. package/dist/entities/variation_fields_option.test.js +47 -0
  204. package/dist/entities/variation_option.js +129 -0
  205. package/dist/entities/variation_option.test.js +6 -0
  206. package/dist/entities/variations_group.js +111 -0
  207. package/dist/entities/variations_group.test.js +6 -0
  208. package/dist/entity.js +888 -0
  209. package/dist/merchi.js +259 -0
  210. package/dist/merchi.test.js +35 -0
  211. package/dist/request.js +132 -0
  212. package/dist/request.test.js +46 -0
  213. package/dist/test_util.js +19 -0
  214. package/dist/toasts.js +27 -0
  215. package/dist/toasts.test.js +46 -0
  216. package/dist/util/float.js +24 -0
  217. package/dist/util/query_string.js +11 -0
  218. package/dist/util/query_string.test.js +6 -0
  219. package/dist/util/validation.js +3 -0
  220. package/dist/util/validation.test.js +12 -0
  221. package/dist/uuid.js +8 -0
  222. package/dist/uuid.test.js +13 -0
  223. package/jest.config.js +17 -0
  224. package/package.json +44 -0
  225. package/src/constants/auto_assign_production_on_actions.ts +6 -0
  226. package/src/constants/call_to_actions.test.ts +5 -0
  227. package/src/constants/call_to_actions.ts +14 -0
  228. package/src/constants/discount_types.test.ts +5 -0
  229. package/src/constants/discount_types.ts +3 -0
  230. package/src/constants/domain_types.test.ts +5 -0
  231. package/src/constants/domain_types.ts +12 -0
  232. package/src/constants/errors.ts +32 -0
  233. package/src/constants/event_types.test.ts +5 -0
  234. package/src/constants/event_types.ts +5 -0
  235. package/src/constants/field_types.test.ts +5 -0
  236. package/src/constants/field_types.ts +13 -0
  237. package/src/constants/input_types.test.ts +5 -0
  238. package/src/constants/input_types.ts +13 -0
  239. package/src/constants/inventory_status.test.ts +5 -0
  240. package/src/constants/inventory_statuses.ts +6 -0
  241. package/src/constants/invoice_types.test.ts +5 -0
  242. package/src/constants/invoice_types.ts +5 -0
  243. package/src/constants/item_types.test.ts +5 -0
  244. package/src/constants/item_types.ts +5 -0
  245. package/src/constants/job/drafting_status.test.ts +5 -0
  246. package/src/constants/job/drafting_status.ts +7 -0
  247. package/src/constants/job/payment_status.test.ts +5 -0
  248. package/src/constants/job/payment_status.ts +7 -0
  249. package/src/constants/job/production_status.test.ts +5 -0
  250. package/src/constants/job/production_status.ts +12 -0
  251. package/src/constants/job/shipment_status.test.ts +5 -0
  252. package/src/constants/job/shipment_status.ts +11 -0
  253. package/src/constants/job/supply_chain_request_status.test.ts +5 -0
  254. package/src/constants/job/supply_chain_request_status.ts +6 -0
  255. package/src/constants/job_priorities.test.ts +5 -0
  256. package/src/constants/job_priorities.ts +6 -0
  257. package/src/constants/job_status.test.ts +5 -0
  258. package/src/constants/job_status.ts +49 -0
  259. package/src/constants/job_types.test.ts +5 -0
  260. package/src/constants/job_types.ts +15 -0
  261. package/src/constants/notification_sections.test.ts +5 -0
  262. package/src/constants/notification_sections.ts +13 -0
  263. package/src/constants/notification_types.test.ts +5 -0
  264. package/src/constants/notification_types.ts +97 -0
  265. package/src/constants/notification_urgencies.test.ts +5 -0
  266. package/src/constants/notification_urgencies.ts +7 -0
  267. package/src/constants/payment_types.test.ts +5 -0
  268. package/src/constants/payment_types.ts +10 -0
  269. package/src/constants/platform.test.ts +15 -0
  270. package/src/constants/platform.ts +6 -0
  271. package/src/constants/product_types.test.ts +6 -0
  272. package/src/constants/product_types.ts +25 -0
  273. package/src/constants/rights.test.ts +5 -0
  274. package/src/constants/rights.ts +5 -0
  275. package/src/constants/robots_meta_directives.test.ts +5 -0
  276. package/src/constants/robots_meta_directives.ts +11 -0
  277. package/src/constants/roles.test.ts +5 -0
  278. package/src/constants/roles.ts +38 -0
  279. package/src/constants/shipment_companies.test.ts +5 -0
  280. package/src/constants/shipment_companies.ts +18 -0
  281. package/src/constants/shipment_services.test.ts +5 -0
  282. package/src/constants/shipment_services.ts +3 -0
  283. package/src/constants/system_roles.test.ts +5 -0
  284. package/src/constants/system_roles.ts +3 -0
  285. package/src/constants/theme_foundations.test.ts +5 -0
  286. package/src/constants/theme_foundations.ts +6 -0
  287. package/src/constants/theme_status.test.ts +5 -0
  288. package/src/constants/theme_status.ts +5 -0
  289. package/src/constants/user_types.test.ts +5 -0
  290. package/src/constants/user_types.ts +17 -0
  291. package/src/constants/white_label_accessibilities.test.ts +5 -0
  292. package/src/constants/white_label_accessibilities.ts +6 -0
  293. package/src/cookie.test.ts +11 -0
  294. package/src/cookie.ts +16 -0
  295. package/src/entities/address.test.ts +7 -0
  296. package/src/entities/address.ts +65 -0
  297. package/src/entities/assignment.test.ts +39 -0
  298. package/src/entities/assignment.ts +92 -0
  299. package/src/entities/automatic_payment_relationship.test.ts +8 -0
  300. package/src/entities/automatic_payment_relationship.ts +26 -0
  301. package/src/entities/backup.test.ts +7 -0
  302. package/src/entities/backup.ts +14 -0
  303. package/src/entities/bank.test.ts +7 -0
  304. package/src/entities/bank.ts +45 -0
  305. package/src/entities/cart.test.ts +50 -0
  306. package/src/entities/cart.ts +89 -0
  307. package/src/entities/cart_item.test.ts +33 -0
  308. package/src/entities/cart_item.ts +77 -0
  309. package/src/entities/cart_shipment_group.ts +21 -0
  310. package/src/entities/cart_shipment_quote.ts +33 -0
  311. package/src/entities/category.test.ts +57 -0
  312. package/src/entities/category.ts +37 -0
  313. package/src/entities/company.test.ts +7 -0
  314. package/src/entities/company.ts +275 -0
  315. package/src/entities/company_invitation.test.ts +7 -0
  316. package/src/entities/company_invitation.ts +33 -0
  317. package/src/entities/component.test.ts +14 -0
  318. package/src/entities/component.ts +92 -0
  319. package/src/entities/component_tag.test.ts +7 -0
  320. package/src/entities/component_tag.ts +17 -0
  321. package/src/entities/component_version.test.ts +7 -0
  322. package/src/entities/component_version.ts +30 -0
  323. package/src/entities/country_tax.test.ts +13 -0
  324. package/src/entities/country_tax.ts +46 -0
  325. package/src/entities/discount.test.ts +18 -0
  326. package/src/entities/discount.ts +34 -0
  327. package/src/entities/discount_group.test.ts +7 -0
  328. package/src/entities/discount_group.ts +28 -0
  329. package/src/entities/domain.test.ts +79 -0
  330. package/src/entities/domain.ts +246 -0
  331. package/src/entities/domain_invitation.test.ts +7 -0
  332. package/src/entities/domain_invitation.ts +36 -0
  333. package/src/entities/domain_tag.test.ts +7 -0
  334. package/src/entities/domain_tag.ts +42 -0
  335. package/src/entities/draft.test.ts +43 -0
  336. package/src/entities/draft.ts +88 -0
  337. package/src/entities/draft_comment.test.ts +7 -0
  338. package/src/entities/draft_comment.ts +54 -0
  339. package/src/entities/draft_template.test.ts +7 -0
  340. package/src/entities/draft_template.ts +40 -0
  341. package/src/entities/email_address.test.ts +7 -0
  342. package/src/entities/email_address.ts +24 -0
  343. package/src/entities/email_counter.test.ts +7 -0
  344. package/src/entities/email_counter.ts +20 -0
  345. package/src/entities/enrolled_domain.test.ts +7 -0
  346. package/src/entities/enrolled_domain.ts +40 -0
  347. package/src/entities/exchange_rate.test.ts +7 -0
  348. package/src/entities/exchange_rate.ts +22 -0
  349. package/src/entities/file.test.ts +43 -0
  350. package/src/entities/file.ts +172 -0
  351. package/src/entities/internal_tag.test.ts +7 -0
  352. package/src/entities/internal_tag.ts +51 -0
  353. package/src/entities/inventory.test.ts +28 -0
  354. package/src/entities/inventory.ts +56 -0
  355. package/src/entities/inventory_unit_variation.test.ts +7 -0
  356. package/src/entities/inventory_unit_variation.ts +29 -0
  357. package/src/entities/invoice.test.ts +43 -0
  358. package/src/entities/invoice.ts +179 -0
  359. package/src/entities/item.test.ts +19 -0
  360. package/src/entities/item.ts +44 -0
  361. package/src/entities/job.test.ts +95 -0
  362. package/src/entities/job.ts +349 -0
  363. package/src/entities/job_comment.test.ts +7 -0
  364. package/src/entities/job_comment.ts +50 -0
  365. package/src/entities/matching_inventory.ts +29 -0
  366. package/src/entities/menu.test.ts +7 -0
  367. package/src/entities/menu.ts +30 -0
  368. package/src/entities/menu_item.test.ts +7 -0
  369. package/src/entities/menu_item.ts +29 -0
  370. package/src/entities/notification.test.ts +7 -0
  371. package/src/entities/notification.ts +99 -0
  372. package/src/entities/page.test.ts +7 -0
  373. package/src/entities/page.ts +32 -0
  374. package/src/entities/payment.test.ts +19 -0
  375. package/src/entities/payment.ts +65 -0
  376. package/src/entities/payment_device.test.ts +7 -0
  377. package/src/entities/payment_device.ts +30 -0
  378. package/src/entities/phone_number.test.ts +7 -0
  379. package/src/entities/phone_number.ts +36 -0
  380. package/src/entities/product.test.ts +750 -0
  381. package/src/entities/product.ts +427 -0
  382. package/src/entities/production_comment.test.ts +7 -0
  383. package/src/entities/production_comment.ts +50 -0
  384. package/src/entities/quote.test.ts +98 -0
  385. package/src/entities/quote.ts +140 -0
  386. package/src/entities/quote_item.test.ts +50 -0
  387. package/src/entities/quote_item.ts +71 -0
  388. package/src/entities/seo_domain_page.test.ts +7 -0
  389. package/src/entities/seo_domain_page.ts +33 -0
  390. package/src/entities/session.test.ts +7 -0
  391. package/src/entities/session.ts +28 -0
  392. package/src/entities/shipment.test.ts +24 -0
  393. package/src/entities/shipment.ts +185 -0
  394. package/src/entities/shipment_item.test.ts +7 -0
  395. package/src/entities/shipment_item.ts +15 -0
  396. package/src/entities/shipment_item_fulfillment.test.ts +8 -0
  397. package/src/entities/shipment_item_fulfillment.ts +15 -0
  398. package/src/entities/shipment_method.test.ts +7 -0
  399. package/src/entities/shipment_method.ts +61 -0
  400. package/src/entities/shipment_method_variation.test.ts +7 -0
  401. package/src/entities/shipment_method_variation.ts +39 -0
  402. package/src/entities/short_url.test.ts +7 -0
  403. package/src/entities/short_url.ts +36 -0
  404. package/src/entities/subscription_plan.test.ts +7 -0
  405. package/src/entities/subscription_plan.ts +73 -0
  406. package/src/entities/supply_domain.test.ts +7 -0
  407. package/src/entities/supply_domain.ts +27 -0
  408. package/src/entities/system_role.test.ts +7 -0
  409. package/src/entities/system_role.ts +17 -0
  410. package/src/entities/theme.test.ts +38 -0
  411. package/src/entities/theme.ts +267 -0
  412. package/src/entities/theme_css_setting.test.ts +7 -0
  413. package/src/entities/theme_css_setting.ts +23 -0
  414. package/src/entities/user.test.ts +154 -0
  415. package/src/entities/user.ts +394 -0
  416. package/src/entities/user_company.test.ts +7 -0
  417. package/src/entities/user_company.ts +27 -0
  418. package/src/entities/variation.test.ts +7 -0
  419. package/src/entities/variation.ts +61 -0
  420. package/src/entities/variation_field.test.ts +76 -0
  421. package/src/entities/variation_field.ts +169 -0
  422. package/src/entities/variation_fields_option.test.ts +46 -0
  423. package/src/entities/variation_fields_option.ts +95 -0
  424. package/src/entities/variation_option.test.ts +7 -0
  425. package/src/entities/variation_option.ts +52 -0
  426. package/src/entities/variations_group.test.ts +7 -0
  427. package/src/entities/variations_group.ts +41 -0
  428. package/src/entity.ts +1002 -0
  429. package/src/merchi.test.ts +25 -0
  430. package/src/merchi.ts +379 -0
  431. package/src/request.test.ts +43 -0
  432. package/src/request.ts +124 -0
  433. package/src/test_util.ts +18 -0
  434. package/src/toasts.test.ts +38 -0
  435. package/src/toasts.ts +34 -0
  436. package/src/util/float.ts +12 -0
  437. package/src/util/query_string.test.ts +7 -0
  438. package/src/util/query_string.ts +11 -0
  439. package/src/util/validation.test.ts +16 -0
  440. package/src/util/validation.ts +2 -0
  441. package/src/uuid.test.ts +15 -0
  442. package/src/uuid.ts +8 -0
  443. package/tsconfig.json +23 -0
  444. package/webpack.config.cjs +27 -0
@@ -0,0 +1,11 @@
1
+ export var PaymentType = /*#__PURE__*/function (PaymentType) {
2
+ PaymentType[PaymentType["ONLINE_PAYMENT"] = 1] = "ONLINE_PAYMENT";
3
+ PaymentType[PaymentType["PAYPAL_PAYMENT"] = 2] = "PAYPAL_PAYMENT";
4
+ PaymentType[PaymentType["BANK_TRANSFER"] = 3] = "BANK_TRANSFER";
5
+ PaymentType[PaymentType["CASH"] = 4] = "CASH";
6
+ PaymentType[PaymentType["CHEQUE"] = 5] = "CHEQUE";
7
+ PaymentType[PaymentType["PHONE_PAYMENT"] = 6] = "PHONE_PAYMENT";
8
+ PaymentType[PaymentType["CREDIT_CARD"] = 7] = "CREDIT_CARD";
9
+ PaymentType[PaymentType["UTRUST_PAYMENT"] = 8] = "UTRUST_PAYMENT";
10
+ return PaymentType;
11
+ }({});
@@ -0,0 +1,4 @@
1
+ import { PaymentType } from './payment_types';
2
+ test('urgent notification urgency exists', function () {
3
+ expect(PaymentType.ONLINE_PAYMENT).toBe(1);
4
+ });
@@ -0,0 +1,5 @@
1
+ export var platformName = 'Merchi';
2
+ export var platformCopyright = 2021;
3
+ export var platformDomain = 'merchi.co';
4
+ export var platformSellerDomain = 'merchi.co';
5
+ export var platformSellerDomainPlus = 'merchi.co';
@@ -0,0 +1,8 @@
1
+ import { platformName, platformCopyright, platformDomain, platformSellerDomain, platformSellerDomainPlus } from './platform';
2
+ test('platform variables all there', function () {
3
+ expect(platformName).toBe('Merchi');
4
+ expect(platformCopyright).toBe(2021);
5
+ expect(platformDomain).toBe('merchi.co');
6
+ expect(platformSellerDomain).toBe('merchi.co');
7
+ expect(platformSellerDomainPlus).toBe('merchi.co');
8
+ });
@@ -0,0 +1,26 @@
1
+ export var ProductType = /*#__PURE__*/function (ProductType) {
2
+ ProductType[ProductType["SUPPLIER_MOD"] = 0] = "SUPPLIER_MOD";
3
+ ProductType[ProductType["SUPPLIER"] = 1] = "SUPPLIER";
4
+ ProductType[ProductType["SELLER"] = 2] = "SELLER";
5
+ ProductType[ProductType["SELLER_MOD"] = 3] = "SELLER_MOD";
6
+ ProductType[ProductType["CLONED_SUPPLIER_MOD"] = 4] = "CLONED_SUPPLIER_MOD";
7
+ ProductType[ProductType["CLONED_SELLER_MOD"] = 5] = "CLONED_SELLER_MOD";
8
+ ProductType[ProductType["PRODUCTION_MOD"] = 6] = "PRODUCTION_MOD";
9
+ ProductType[ProductType["CLONED_SUPPLIER"] = 7] = "CLONED_SUPPLIER";
10
+ ProductType[ProductType["INVENTORY_SELLER"] = 8] = "INVENTORY_SELLER";
11
+ ProductType[ProductType["INVENTORY_SUPPLIER"] = 9] = "INVENTORY_SUPPLIER";
12
+ ProductType[ProductType["SELLER_GROUP_BUY"] = 10] = "SELLER_GROUP_BUY";
13
+ ProductType[ProductType["SUPPLIER_RESELL_MOD"] = 11] = "SUPPLIER_RESELL_MOD";
14
+ ProductType[ProductType["SUPPLIER_RESELL"] = 12] = "SUPPLIER_RESELL";
15
+ ProductType[ProductType["SUPPLIER_GROUP_BUY_INVENTORY"] = 13] = "SUPPLIER_GROUP_BUY_INVENTORY";
16
+ ProductType[ProductType["CLONED_INVENTORY_SELLER"] = 14] = "CLONED_INVENTORY_SELLER";
17
+ ProductType[ProductType["CLONED_SELLER_GROUP_BUY_INVENTORY"] = 15] = "CLONED_SELLER_GROUP_BUY_INVENTORY";
18
+ ProductType[ProductType["CLONED_SUPPLIER_RESELL_MOD"] = 16] = "CLONED_SUPPLIER_RESELL_MOD";
19
+ ProductType[ProductType["SUPPLIER_TO_SUPPLIER_RESELL_MOD"] = 17] = "SUPPLIER_TO_SUPPLIER_RESELL_MOD";
20
+ ProductType[ProductType["CLONED_SUPPLIER_RESELL"] = 18] = "CLONED_SUPPLIER_RESELL";
21
+ ProductType[ProductType["SUPPLY_DOMAIN_REFERENCE"] = 19] = "SUPPLY_DOMAIN_REFERENCE";
22
+ ProductType[ProductType["SELLER_FILE_DOWNLOAD"] = 20] = "SELLER_FILE_DOWNLOAD";
23
+ ProductType[ProductType["SUPPLIER_MOD_SUPPLY_CHAIN_REQUEST"] = 21] = "SUPPLIER_MOD_SUPPLY_CHAIN_REQUEST";
24
+ ProductType[ProductType["SUPPLIER_SUPPLY_CHAIN_REQUEST"] = 22] = "SUPPLIER_SUPPLY_CHAIN_REQUEST";
25
+ return ProductType;
26
+ }({});
@@ -0,0 +1,4 @@
1
+ import { ProductType } from './product_types';
2
+ test('product types exists', function () {
3
+ expect(ProductType.SUPPLIER_MOD).toBe(0);
4
+ });
@@ -0,0 +1,6 @@
1
+ export var Right = /*#__PURE__*/function (Right) {
2
+ Right[Right["ACCESS"] = 1] = "ACCESS";
3
+ Right[Right["EDIT"] = 2] = "EDIT";
4
+ Right[Right["DELETE"] = 3] = "DELETE";
5
+ return Right;
6
+ }({});
@@ -0,0 +1,4 @@
1
+ import { Right } from './rights';
2
+ test('access right exists', function () {
3
+ expect(Right.ACCESS).toBe(1);
4
+ });
@@ -0,0 +1 @@
1
+ export var robotsMetaDirectives = ['noindex', 'index', 'follow', 'nofollow', 'noimageindex', 'none', 'noarchive', 'nocache', 'nosnippet'];
@@ -0,0 +1,4 @@
1
+ import { robotsMetaDirectives } from './robots_meta_directives';
2
+ test('robot meta directive exists', function () {
3
+ expect(robotsMetaDirectives[0]).toBe('noindex');
4
+ });
@@ -0,0 +1,25 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ export var Role = /*#__PURE__*/function (Role) {
8
+ Role[Role["PUBLIC"] = 0] = "PUBLIC";
9
+ Role[Role["ADMIN"] = 1] = "ADMIN";
10
+ Role[Role["SALES"] = 2] = "SALES";
11
+ Role[Role["DESIGNER"] = 3] = "DESIGNER";
12
+ Role[Role["SUPPLIER"] = 4] = "SUPPLIER";
13
+ Role[Role["CLIENT"] = 5] = "CLIENT";
14
+ Role[Role["MANAGER"] = 6] = "MANAGER";
15
+ Role[Role["ACCOUNTANT"] = 7] = "ACCOUNTANT";
16
+ Role[Role["THEME_EDITOR"] = 8] = "THEME_EDITOR";
17
+ return Role;
18
+ }({});
19
+ export var DOMAIN_MANAGERS = [Role.ADMIN, Role.MANAGER];
20
+ export var MANAGEMENT_TEAM = [].concat(DOMAIN_MANAGERS, [Role.SALES, Role.DESIGNER, Role.ACCOUNTANT]);
21
+ export var BUSINESS_ACCOUNTS = [].concat(_toConsumableArray(MANAGEMENT_TEAM), [Role.SUPPLIER]);
22
+ export var MANAGEMENT_ROLES = [Role.ADMIN, Role.MANAGER];
23
+ export var THEME_ROLES = [].concat(MANAGEMENT_ROLES, [Role.THEME_EDITOR]);
24
+ export var ROLES_RANK = [Role.PUBLIC, Role.CLIENT, Role.ACCOUNTANT, Role.SALES, Role.DESIGNER, Role.SUPPLIER, Role.MANAGER, Role.ADMIN];
25
+ export var ALL_ROLES = ROLES_RANK;
@@ -0,0 +1,4 @@
1
+ import { Role } from './roles';
2
+ test('admin role exists', function () {
3
+ expect(Role.ADMIN).toBe(1);
4
+ });
@@ -0,0 +1,19 @@
1
+ export var ShipmentCompany = /*#__PURE__*/function (ShipmentCompany) {
2
+ ShipmentCompany[ShipmentCompany["DHL"] = 0] = "DHL";
3
+ ShipmentCompany[ShipmentCompany["UPS"] = 1] = "UPS";
4
+ ShipmentCompany[ShipmentCompany["EMS"] = 2] = "EMS";
5
+ ShipmentCompany[ShipmentCompany["FED_EX"] = 3] = "FED_EX";
6
+ ShipmentCompany[ShipmentCompany["AUSTRALIA_POST"] = 4] = "AUSTRALIA_POST";
7
+ ShipmentCompany[ShipmentCompany["STAR_TRACK"] = 5] = "STAR_TRACK";
8
+ ShipmentCompany[ShipmentCompany["TOLL"] = 6] = "TOLL";
9
+ ShipmentCompany[ShipmentCompany["TNT"] = 7] = "TNT";
10
+ ShipmentCompany[ShipmentCompany["CUSTOM_TRACK_LINK"] = 8] = "CUSTOM_TRACK_LINK";
11
+ ShipmentCompany[ShipmentCompany["ARAMEX"] = 9] = "ARAMEX";
12
+ ShipmentCompany[ShipmentCompany["REALTIME_EXPRESS"] = 10] = "REALTIME_EXPRESS";
13
+ ShipmentCompany[ShipmentCompany["UBER"] = 11] = "UBER";
14
+ ShipmentCompany[ShipmentCompany["CIVIC_TRANSPORT_COURIERS"] = 12] = "CIVIC_TRANSPORT_COURIERS";
15
+ ShipmentCompany[ShipmentCompany["NZ_POST"] = 13] = "NZ_POST";
16
+ ShipmentCompany[ShipmentCompany["SENDLE"] = 14] = "SENDLE";
17
+ ShipmentCompany[ShipmentCompany["USPS"] = 15] = "USPS";
18
+ return ShipmentCompany;
19
+ }({});
@@ -0,0 +1,4 @@
1
+ import { ShipmentCompany } from './shipment_companies';
2
+ test('dhl exists', function () {
3
+ expect(ShipmentCompany.DHL).toBe(0);
4
+ });
@@ -0,0 +1,4 @@
1
+ export var ShipmentService = /*#__PURE__*/function (ShipmentService) {
2
+ ShipmentService[ShipmentService["SENDLE"] = 1] = "SENDLE";
3
+ return ShipmentService;
4
+ }({});
@@ -0,0 +1,4 @@
1
+ import { ShipmentService } from './shipment_services';
2
+ test('dhl exists', function () {
3
+ expect(ShipmentService.SENDLE).toBe(1);
4
+ });
@@ -0,0 +1,4 @@
1
+ export var SystemRoles = /*#__PURE__*/function (SystemRoles) {
2
+ SystemRoles[SystemRoles["SYSTEM_COMPONENT_BUILDER"] = 1] = "SYSTEM_COMPONENT_BUILDER";
3
+ return SystemRoles;
4
+ }({});
@@ -0,0 +1,4 @@
1
+ import { SystemRoles } from './system_roles';
2
+ test('system component builder role exists', function () {
3
+ expect(SystemRoles.SYSTEM_COMPONENT_BUILDER).toBe(1);
4
+ });
@@ -0,0 +1,7 @@
1
+ export var ThemeFoundations = /*#__PURE__*/function (ThemeFoundations) {
2
+ ThemeFoundations[ThemeFoundations["NO_FOUNDATION"] = 0] = "NO_FOUNDATION";
3
+ ThemeFoundations[ThemeFoundations["BOOTSTRAP_3"] = 1] = "BOOTSTRAP_3";
4
+ ThemeFoundations[ThemeFoundations["BOOTSTRAP_4"] = 2] = "BOOTSTRAP_4";
5
+ ThemeFoundations[ThemeFoundations["BOOTSTRAP_5"] = 3] = "BOOTSTRAP_5";
6
+ return ThemeFoundations;
7
+ }({});
@@ -0,0 +1,4 @@
1
+ import { ThemeFoundations } from './theme_foundations';
2
+ test('not valid status exists', function () {
3
+ expect(ThemeFoundations.BOOTSTRAP_3).toBe(1);
4
+ });
@@ -0,0 +1,6 @@
1
+ export var ThemeStatus = /*#__PURE__*/function (ThemeStatus) {
2
+ ThemeStatus[ThemeStatus["NOT_VALID"] = 1] = "NOT_VALID";
3
+ ThemeStatus[ThemeStatus["VALID_BUT_NOT_UPDATED"] = 2] = "VALID_BUT_NOT_UPDATED";
4
+ ThemeStatus[ThemeStatus["VALID_AND_UPDATED"] = 3] = "VALID_AND_UPDATED";
5
+ return ThemeStatus;
6
+ }({});
@@ -0,0 +1,4 @@
1
+ import { ThemeStatus } from './theme_status';
2
+ test('not valid status exists', function () {
3
+ expect(ThemeStatus.NOT_VALID).toBe(1);
4
+ });
@@ -0,0 +1,18 @@
1
+ export var UserType = /*#__PURE__*/function (UserType) {
2
+ UserType[UserType["PUBLIC"] = 0] = "PUBLIC";
3
+ UserType[UserType["CLIENT_GUEST"] = 1] = "CLIENT_GUEST";
4
+ UserType[UserType["CLIENT_DOMAIN"] = 2] = "CLIENT_DOMAIN";
5
+ UserType[UserType["CLIENT_MULTIPLE_DOMAINS"] = 3] = "CLIENT_MULTIPLE_DOMAINS";
6
+ UserType[UserType["CLIENT_MERCHI"] = 4] = "CLIENT_MERCHI";
7
+ UserType[UserType["SELLER_FREE_MERCHI"] = 5] = "SELLER_FREE_MERCHI";
8
+ UserType[UserType["SELLER_FREE_DOMAIN"] = 6] = "SELLER_FREE_DOMAIN";
9
+ UserType[UserType["SELLER_PAID"] = 7] = "SELLER_PAID";
10
+ UserType[UserType["SELLER_PAID_MULTIPLE_DOMAINS"] = 8] = "SELLER_PAID_MULTIPLE_DOMAINS";
11
+ UserType[UserType["SUPPLIER_THIRD_PARTY"] = 9] = "SUPPLIER_THIRD_PARTY";
12
+ UserType[UserType["SUPPLIER_RESTRICTED"] = 10] = "SUPPLIER_RESTRICTED";
13
+ UserType[UserType["SUPPLIER_MERCHI"] = 11] = "SUPPLIER_MERCHI";
14
+ UserType[UserType["UNRESTRICTED"] = 12] = "UNRESTRICTED";
15
+ UserType[UserType["SHOPIFY_REFERENCE"] = 13] = "SHOPIFY_REFERENCE";
16
+ UserType[UserType["RESERVED_FROM_SOCIAL"] = 14] = "RESERVED_FROM_SOCIAL";
17
+ return UserType;
18
+ }({}); // A user crawled from Social network
@@ -0,0 +1,4 @@
1
+ import { UserType } from './user_types';
2
+ test('not valid status exists', function () {
3
+ expect(UserType.CLIENT_GUEST).toBe(1);
4
+ });
@@ -0,0 +1,6 @@
1
+ export var WhiteLabelAccessibility = /*#__PURE__*/function (WhiteLabelAccessibility) {
2
+ WhiteLabelAccessibility[WhiteLabelAccessibility["UNREACHABLE"] = 0] = "UNREACHABLE";
3
+ WhiteLabelAccessibility[WhiteLabelAccessibility["NO_CERTIFICATE"] = 1] = "NO_CERTIFICATE";
4
+ WhiteLabelAccessibility[WhiteLabelAccessibility["REACHABLE"] = 2] = "REACHABLE";
5
+ return WhiteLabelAccessibility;
6
+ }({});
@@ -0,0 +1,4 @@
1
+ import { WhiteLabelAccessibility } from './white_label_accessibilities';
2
+ test('not reachable exists', function () {
3
+ expect(WhiteLabelAccessibility.UNREACHABLE).toBe(0);
4
+ });
package/dist/cookie.js ADDED
@@ -0,0 +1,16 @@
1
+ export function getCookie(name) {
2
+ // code might be executed during SSR
3
+ // istanbul ignore next
4
+ if (typeof document !== 'undefined') {
5
+ var searchPrefix = name + '=',
6
+ cookies = document.cookie.split(';');
7
+ for (var i = 0; i < cookies.length; ++i) {
8
+ var cookie = cookies[i];
9
+ cookie = cookie.replace(/^\s*/, '');
10
+ if (cookie.indexOf(searchPrefix) === 0) {
11
+ return cookie.substring(searchPrefix.length, cookie.length);
12
+ }
13
+ }
14
+ }
15
+ return undefined;
16
+ }
@@ -0,0 +1,12 @@
1
+ import { getCookie } from './cookie';
2
+ test('can get cookie', function () {
3
+ var token = 'IMiF7rpT$5ciUJ38QY';
4
+ var cookie = "session_token=".concat(token);
5
+ Object.defineProperty(document, 'cookie', {
6
+ get: jest.fn().mockImplementation(function () {
7
+ return cookie;
8
+ }),
9
+ set: jest.fn().mockImplementation(function () {})
10
+ });
11
+ expect(getCookie('session_token')).toBe('IMiF7rpT$5ciUJ38QY');
12
+ });
@@ -0,0 +1,166 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _Address;
3
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
4
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
11
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
16
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
18
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
19
+ import { Entity } from '../entity';
20
+ export var Address = (_dec = Address.property({
21
+ type: Date
22
+ }), _dec2 = Address.property(), _dec3 = Address.property({
23
+ type: String
24
+ }), _dec4 = Address.property({
25
+ type: String
26
+ }), _dec5 = Address.property({
27
+ type: String
28
+ }), _dec6 = Address.property({
29
+ type: String
30
+ }), _dec7 = Address.property({
31
+ type: String
32
+ }), _dec8 = Address.property({
33
+ type: String
34
+ }), _dec9 = Address.property({
35
+ arrayType: 'Shipment'
36
+ }), _dec10 = Address.property({
37
+ arrayType: 'Shipment'
38
+ }), _dec11 = Address.property({
39
+ arrayType: 'Bank'
40
+ }), _dec12 = Address.property({
41
+ arrayType: 'User'
42
+ }), _dec13 = Address.property({
43
+ arrayType: 'Inventory'
44
+ }), _dec14 = Address.property({
45
+ arrayType: 'Job'
46
+ }), _dec15 = Address.property({
47
+ arrayType: 'Job'
48
+ }), _dec16 = Address.property({
49
+ arrayType: 'Invoice'
50
+ }), _dec17 = Address.property({
51
+ arrayType: 'Company'
52
+ }), (_class = (_Address = /*#__PURE__*/function (_Entity) {
53
+ _inherits(Address, _Entity);
54
+ function Address() {
55
+ var _this;
56
+ _classCallCheck(this, Address);
57
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
58
+ args[_key] = arguments[_key];
59
+ }
60
+ _this = _callSuper(this, Address, [].concat(args));
61
+ _initializerDefineProperty(_assertThisInitialized(_this), "archived", _descriptor, _assertThisInitialized(_this));
62
+ _initializerDefineProperty(_assertThisInitialized(_this), "id", _descriptor2, _assertThisInitialized(_this));
63
+ _initializerDefineProperty(_assertThisInitialized(_this), "lineOne", _descriptor3, _assertThisInitialized(_this));
64
+ _initializerDefineProperty(_assertThisInitialized(_this), "lineTwo", _descriptor4, _assertThisInitialized(_this));
65
+ _initializerDefineProperty(_assertThisInitialized(_this), "city", _descriptor5, _assertThisInitialized(_this));
66
+ _initializerDefineProperty(_assertThisInitialized(_this), "state", _descriptor6, _assertThisInitialized(_this));
67
+ _initializerDefineProperty(_assertThisInitialized(_this), "country", _descriptor7, _assertThisInitialized(_this));
68
+ _initializerDefineProperty(_assertThisInitialized(_this), "postcode", _descriptor8, _assertThisInitialized(_this));
69
+ _initializerDefineProperty(_assertThisInitialized(_this), "shipmentAsSenderAddress", _descriptor9, _assertThisInitialized(_this));
70
+ _initializerDefineProperty(_assertThisInitialized(_this), "shipmentsAsReceiverAddress", _descriptor10, _assertThisInitialized(_this));
71
+ _initializerDefineProperty(_assertThisInitialized(_this), "banks", _descriptor11, _assertThisInitialized(_this));
72
+ _initializerDefineProperty(_assertThisInitialized(_this), "users", _descriptor12, _assertThisInitialized(_this));
73
+ _initializerDefineProperty(_assertThisInitialized(_this), "inventories", _descriptor13, _assertThisInitialized(_this));
74
+ _initializerDefineProperty(_assertThisInitialized(_this), "jobs", _descriptor14, _assertThisInitialized(_this));
75
+ _initializerDefineProperty(_assertThisInitialized(_this), "productedJobs", _descriptor15, _assertThisInitialized(_this));
76
+ _initializerDefineProperty(_assertThisInitialized(_this), "shippingTo", _descriptor16, _assertThisInitialized(_this));
77
+ _initializerDefineProperty(_assertThisInitialized(_this), "companies", _descriptor17, _assertThisInitialized(_this));
78
+ return _this;
79
+ }
80
+ return _createClass(Address);
81
+ }(Entity), _defineProperty(_Address, "resourceName", 'addresses'), _defineProperty(_Address, "singularName", 'address'), _defineProperty(_Address, "pluralName", 'addresses'), _Address), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "archived", [_dec], {
82
+ configurable: true,
83
+ enumerable: true,
84
+ writable: true,
85
+ initializer: null
86
+ }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "id", [_dec2], {
87
+ configurable: true,
88
+ enumerable: true,
89
+ writable: true,
90
+ initializer: null
91
+ }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, "lineOne", [_dec3], {
92
+ configurable: true,
93
+ enumerable: true,
94
+ writable: true,
95
+ initializer: null
96
+ }), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, "lineTwo", [_dec4], {
97
+ configurable: true,
98
+ enumerable: true,
99
+ writable: true,
100
+ initializer: null
101
+ }), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, "city", [_dec5], {
102
+ configurable: true,
103
+ enumerable: true,
104
+ writable: true,
105
+ initializer: null
106
+ }), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, "state", [_dec6], {
107
+ configurable: true,
108
+ enumerable: true,
109
+ writable: true,
110
+ initializer: null
111
+ }), _descriptor7 = _applyDecoratedDescriptor(_class.prototype, "country", [_dec7], {
112
+ configurable: true,
113
+ enumerable: true,
114
+ writable: true,
115
+ initializer: null
116
+ }), _descriptor8 = _applyDecoratedDescriptor(_class.prototype, "postcode", [_dec8], {
117
+ configurable: true,
118
+ enumerable: true,
119
+ writable: true,
120
+ initializer: null
121
+ }), _descriptor9 = _applyDecoratedDescriptor(_class.prototype, "shipmentAsSenderAddress", [_dec9], {
122
+ configurable: true,
123
+ enumerable: true,
124
+ writable: true,
125
+ initializer: null
126
+ }), _descriptor10 = _applyDecoratedDescriptor(_class.prototype, "shipmentsAsReceiverAddress", [_dec10], {
127
+ configurable: true,
128
+ enumerable: true,
129
+ writable: true,
130
+ initializer: null
131
+ }), _descriptor11 = _applyDecoratedDescriptor(_class.prototype, "banks", [_dec11], {
132
+ configurable: true,
133
+ enumerable: true,
134
+ writable: true,
135
+ initializer: null
136
+ }), _descriptor12 = _applyDecoratedDescriptor(_class.prototype, "users", [_dec12], {
137
+ configurable: true,
138
+ enumerable: true,
139
+ writable: true,
140
+ initializer: null
141
+ }), _descriptor13 = _applyDecoratedDescriptor(_class.prototype, "inventories", [_dec13], {
142
+ configurable: true,
143
+ enumerable: true,
144
+ writable: true,
145
+ initializer: null
146
+ }), _descriptor14 = _applyDecoratedDescriptor(_class.prototype, "jobs", [_dec14], {
147
+ configurable: true,
148
+ enumerable: true,
149
+ writable: true,
150
+ initializer: null
151
+ }), _descriptor15 = _applyDecoratedDescriptor(_class.prototype, "productedJobs", [_dec15], {
152
+ configurable: true,
153
+ enumerable: true,
154
+ writable: true,
155
+ initializer: null
156
+ }), _descriptor16 = _applyDecoratedDescriptor(_class.prototype, "shippingTo", [_dec16], {
157
+ configurable: true,
158
+ enumerable: true,
159
+ writable: true,
160
+ initializer: null
161
+ }), _descriptor17 = _applyDecoratedDescriptor(_class.prototype, "companies", [_dec17], {
162
+ configurable: true,
163
+ enumerable: true,
164
+ writable: true,
165
+ initializer: null
166
+ })), _class));
@@ -0,0 +1,6 @@
1
+ import { Merchi } from '../merchi';
2
+ test('can make Address', function () {
3
+ var merchi = new Merchi();
4
+ var address = new merchi.Address();
5
+ expect(address).toBeTruthy();
6
+ });