@merchi/sdk 1.40.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (662) hide show
  1. package/.eslintrc.cjs +43 -0
  2. package/.turbo/turbo-build.log +1 -0
  3. package/.turbo/turbo-test.log +849 -0
  4. package/LICENSE +21 -0
  5. package/README.md +244 -0
  6. package/coverage/clover.xml +5057 -0
  7. package/coverage/coverage-final.json +133 -0
  8. package/coverage/lcov-report/base.css +224 -0
  9. package/coverage/lcov-report/block-navigation.js +87 -0
  10. package/coverage/lcov-report/favicon.png +0 -0
  11. package/coverage/lcov-report/index.html +191 -0
  12. package/coverage/lcov-report/prettify.css +1 -0
  13. package/coverage/lcov-report/prettify.js +2 -0
  14. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  15. package/coverage/lcov-report/sorter.js +210 -0
  16. package/coverage/lcov-report/src/constants/auto_assign_production_on_actions.ts.html +103 -0
  17. package/coverage/lcov-report/src/constants/call_to_actions.ts.html +127 -0
  18. package/coverage/lcov-report/src/constants/discount_types.ts.html +100 -0
  19. package/coverage/lcov-report/src/constants/domain_types.ts.html +121 -0
  20. package/coverage/lcov-report/src/constants/errors.ts.html +181 -0
  21. package/coverage/lcov-report/src/constants/event_types.ts.html +100 -0
  22. package/coverage/lcov-report/src/constants/field_types.ts.html +133 -0
  23. package/coverage/lcov-report/src/constants/index.html +551 -0
  24. package/coverage/lcov-report/src/constants/index.ts.html +238 -0
  25. package/coverage/lcov-report/src/constants/input_types.ts.html +124 -0
  26. package/coverage/lcov-report/src/constants/inventory_statuses.ts.html +103 -0
  27. package/coverage/lcov-report/src/constants/invoice_types.ts.html +100 -0
  28. package/coverage/lcov-report/src/constants/item_types.ts.html +100 -0
  29. package/coverage/lcov-report/src/constants/job/drafting_status.ts.html +106 -0
  30. package/coverage/lcov-report/src/constants/job/index.html +176 -0
  31. package/coverage/lcov-report/src/constants/job/payment_status.ts.html +106 -0
  32. package/coverage/lcov-report/src/constants/job/production_status.ts.html +121 -0
  33. package/coverage/lcov-report/src/constants/job/shipment_status.ts.html +118 -0
  34. package/coverage/lcov-report/src/constants/job/supply_chain_request_status.ts.html +103 -0
  35. package/coverage/lcov-report/src/constants/job_priorities.ts.html +103 -0
  36. package/coverage/lcov-report/src/constants/job_status.ts.html +232 -0
  37. package/coverage/lcov-report/src/constants/job_types.ts.html +133 -0
  38. package/coverage/lcov-report/src/constants/notification_sections.ts.html +124 -0
  39. package/coverage/lcov-report/src/constants/notification_types.ts.html +385 -0
  40. package/coverage/lcov-report/src/constants/notification_urgencies.ts.html +106 -0
  41. package/coverage/lcov-report/src/constants/payment_types.ts.html +115 -0
  42. package/coverage/lcov-report/src/constants/platform.ts.html +103 -0
  43. package/coverage/lcov-report/src/constants/product_types.ts.html +163 -0
  44. package/coverage/lcov-report/src/constants/rights.ts.html +100 -0
  45. package/coverage/lcov-report/src/constants/robots_meta_directives.ts.html +118 -0
  46. package/coverage/lcov-report/src/constants/roles.ts.html +223 -0
  47. package/coverage/lcov-report/src/constants/shipment_companies.ts.html +142 -0
  48. package/coverage/lcov-report/src/constants/shipment_services.ts.html +94 -0
  49. package/coverage/lcov-report/src/constants/system_roles.ts.html +94 -0
  50. package/coverage/lcov-report/src/constants/theme_status.ts.html +100 -0
  51. package/coverage/lcov-report/src/constants/user_types.ts.html +136 -0
  52. package/coverage/lcov-report/src/constants/white_label_accessibilities.ts.html +103 -0
  53. package/coverage/lcov-report/src/cookie.ts.html +133 -0
  54. package/coverage/lcov-report/src/entities/address.ts.html +280 -0
  55. package/coverage/lcov-report/src/entities/agent_conversation.ts.html +202 -0
  56. package/coverage/lcov-report/src/entities/agent_skill.ts.html +382 -0
  57. package/coverage/lcov-report/src/entities/agent_skill_approval.ts.html +163 -0
  58. package/coverage/lcov-report/src/entities/agent_skill_version.ts.html +277 -0
  59. package/coverage/lcov-report/src/entities/agent_token_usage.ts.html +349 -0
  60. package/coverage/lcov-report/src/entities/assignment.ts.html +382 -0
  61. package/coverage/lcov-report/src/entities/automatic_payment_relationship.ts.html +172 -0
  62. package/coverage/lcov-report/src/entities/bank.ts.html +220 -0
  63. package/coverage/lcov-report/src/entities/cart.ts.html +391 -0
  64. package/coverage/lcov-report/src/entities/cart_item.ts.html +340 -0
  65. package/coverage/lcov-report/src/entities/cart_shipment_group.ts.html +148 -0
  66. package/coverage/lcov-report/src/entities/cart_shipment_quote.ts.html +184 -0
  67. package/coverage/lcov-report/src/entities/category.ts.html +262 -0
  68. package/coverage/lcov-report/src/entities/company.ts.html +1276 -0
  69. package/coverage/lcov-report/src/entities/company_invitation.ts.html +184 -0
  70. package/coverage/lcov-report/src/entities/country_tax.ts.html +223 -0
  71. package/coverage/lcov-report/src/entities/discount.ts.html +235 -0
  72. package/coverage/lcov-report/src/entities/discount_group.ts.html +214 -0
  73. package/coverage/lcov-report/src/entities/domain.ts.html +3349 -0
  74. package/coverage/lcov-report/src/entities/domain_chat_settings.ts.html +331 -0
  75. package/coverage/lcov-report/src/entities/domain_invitation.ts.html +193 -0
  76. package/coverage/lcov-report/src/entities/domain_tag.ts.html +211 -0
  77. package/coverage/lcov-report/src/entities/draft.ts.html +322 -0
  78. package/coverage/lcov-report/src/entities/draft_comment.ts.html +274 -0
  79. package/coverage/lcov-report/src/entities/draft_preview.ts.html +196 -0
  80. package/coverage/lcov-report/src/entities/draft_preview_layer.ts.html +148 -0
  81. package/coverage/lcov-report/src/entities/draft_template.ts.html +328 -0
  82. package/coverage/lcov-report/src/entities/email_address.ts.html +157 -0
  83. package/coverage/lcov-report/src/entities/email_counter.ts.html +145 -0
  84. package/coverage/lcov-report/src/entities/enrolled_domain.ts.html +205 -0
  85. package/coverage/lcov-report/src/entities/exchange_rate.ts.html +151 -0
  86. package/coverage/lcov-report/src/entities/file.ts.html +580 -0
  87. package/coverage/lcov-report/src/entities/index.html +1271 -0
  88. package/coverage/lcov-report/src/entities/internal_tag.ts.html +238 -0
  89. package/coverage/lcov-report/src/entities/inventory.ts.html +274 -0
  90. package/coverage/lcov-report/src/entities/inventory_group.ts.html +193 -0
  91. package/coverage/lcov-report/src/entities/inventory_unit_variation.ts.html +172 -0
  92. package/coverage/lcov-report/src/entities/invoice.ts.html +661 -0
  93. package/coverage/lcov-report/src/entities/item.ts.html +262 -0
  94. package/coverage/lcov-report/src/entities/job.ts.html +1288 -0
  95. package/coverage/lcov-report/src/entities/job_comment.ts.html +244 -0
  96. package/coverage/lcov-report/src/entities/job_note.ts.html +205 -0
  97. package/coverage/lcov-report/src/entities/job_operation_log.ts.html +208 -0
  98. package/coverage/lcov-report/src/entities/matching_inventory.ts.html +172 -0
  99. package/coverage/lcov-report/src/entities/notification.ts.html +403 -0
  100. package/coverage/lcov-report/src/entities/payment.ts.html +316 -0
  101. package/coverage/lcov-report/src/entities/payment_device.ts.html +175 -0
  102. package/coverage/lcov-report/src/entities/phone_number.ts.html +193 -0
  103. package/coverage/lcov-report/src/entities/product.ts.html +1543 -0
  104. package/coverage/lcov-report/src/entities/product_form.ts.html +238 -0
  105. package/coverage/lcov-report/src/entities/product_form_version.ts.html +238 -0
  106. package/coverage/lcov-report/src/entities/product_review.ts.html +748 -0
  107. package/coverage/lcov-report/src/entities/production_comment.ts.html +244 -0
  108. package/coverage/lcov-report/src/entities/quote.ts.html +505 -0
  109. package/coverage/lcov-report/src/entities/quote_item.ts.html +298 -0
  110. package/coverage/lcov-report/src/entities/reminder.ts.html +307 -0
  111. package/coverage/lcov-report/src/entities/session.ts.html +169 -0
  112. package/coverage/lcov-report/src/entities/shipment.ts.html +673 -0
  113. package/coverage/lcov-report/src/entities/shipment_item.ts.html +130 -0
  114. package/coverage/lcov-report/src/entities/shipment_item_fulfillment.ts.html +130 -0
  115. package/coverage/lcov-report/src/entities/shipment_log.ts.html +196 -0
  116. package/coverage/lcov-report/src/entities/shipment_method.ts.html +268 -0
  117. package/coverage/lcov-report/src/entities/shipment_method_variation.ts.html +202 -0
  118. package/coverage/lcov-report/src/entities/short_url.ts.html +193 -0
  119. package/coverage/lcov-report/src/entities/subscription_plan.ts.html +304 -0
  120. package/coverage/lcov-report/src/entities/supply_domain.ts.html +166 -0
  121. package/coverage/lcov-report/src/entities/support_conversation.ts.html +280 -0
  122. package/coverage/lcov-report/src/entities/support_message.ts.html +175 -0
  123. package/coverage/lcov-report/src/entities/system_role.ts.html +136 -0
  124. package/coverage/lcov-report/src/entities/theme.ts.html +331 -0
  125. package/coverage/lcov-report/src/entities/theme_css_setting.ts.html +154 -0
  126. package/coverage/lcov-report/src/entities/user.ts.html +1369 -0
  127. package/coverage/lcov-report/src/entities/user_company.ts.html +166 -0
  128. package/coverage/lcov-report/src/entities/variation.ts.html +277 -0
  129. package/coverage/lcov-report/src/entities/variation_field.ts.html +889 -0
  130. package/coverage/lcov-report/src/entities/variation_fields_option.ts.html +406 -0
  131. package/coverage/lcov-report/src/entities/variation_option.ts.html +259 -0
  132. package/coverage/lcov-report/src/entities/variations_group.ts.html +208 -0
  133. package/coverage/lcov-report/src/entity.ts.html +3379 -0
  134. package/coverage/lcov-report/src/index.html +221 -0
  135. package/coverage/lcov-report/src/index.ts.html +652 -0
  136. package/coverage/lcov-report/src/merchi.ts.html +1420 -0
  137. package/coverage/lcov-report/src/pricing/discount.ts.html +136 -0
  138. package/coverage/lcov-report/src/pricing/estimate.ts.html +1015 -0
  139. package/coverage/lcov-report/src/pricing/index.html +206 -0
  140. package/coverage/lcov-report/src/pricing/index.ts.html +106 -0
  141. package/coverage/lcov-report/src/pricing/inventory.ts.html +352 -0
  142. package/coverage/lcov-report/src/pricing/matrix.ts.html +736 -0
  143. package/coverage/lcov-report/src/pricing/round.ts.html +166 -0
  144. package/coverage/lcov-report/src/pricing/visibility.ts.html +418 -0
  145. package/coverage/lcov-report/src/request.ts.html +673 -0
  146. package/coverage/lcov-report/src/test_util.ts.html +139 -0
  147. package/coverage/lcov-report/src/toasts.ts.html +187 -0
  148. package/coverage/lcov-report/src/util/float.ts.html +121 -0
  149. package/coverage/lcov-report/src/util/index.html +161 -0
  150. package/coverage/lcov-report/src/util/index.ts.html +106 -0
  151. package/coverage/lcov-report/src/util/query_string.ts.html +124 -0
  152. package/coverage/lcov-report/src/util/validation.ts.html +91 -0
  153. package/coverage/lcov-report/src/uuid.ts.html +109 -0
  154. package/coverage/lcov.info +7758 -0
  155. package/dist/constants/auto_assign_production_on_actions.js +7 -0
  156. package/dist/constants/call_to_actions.js +15 -0
  157. package/dist/constants/call_to_actions.test.js +4 -0
  158. package/dist/constants/discount_types.js +6 -0
  159. package/dist/constants/discount_types.test.js +4 -0
  160. package/dist/constants/domain_types.js +13 -0
  161. package/dist/constants/domain_types.test.js +4 -0
  162. package/dist/constants/errors.js +32 -0
  163. package/dist/constants/event_types.js +6 -0
  164. package/dist/constants/event_types.test.js +4 -0
  165. package/dist/constants/field_types.js +17 -0
  166. package/dist/constants/field_types.test.js +4 -0
  167. package/dist/constants/index.js +25 -0
  168. package/dist/constants/input_types.js +14 -0
  169. package/dist/constants/input_types.test.js +4 -0
  170. package/dist/constants/inventory_status.test.js +4 -0
  171. package/dist/constants/inventory_statuses.js +7 -0
  172. package/dist/constants/invoice_types.js +6 -0
  173. package/dist/constants/invoice_types.test.js +4 -0
  174. package/dist/constants/item_types.js +6 -0
  175. package/dist/constants/item_types.test.js +4 -0
  176. package/dist/constants/job/drafting_status.js +8 -0
  177. package/dist/constants/job/drafting_status.test.js +4 -0
  178. package/dist/constants/job/payment_status.js +8 -0
  179. package/dist/constants/job/payment_status.test.js +4 -0
  180. package/dist/constants/job/production_status.js +13 -0
  181. package/dist/constants/job/production_status.test.js +4 -0
  182. package/dist/constants/job/shipment_status.js +12 -0
  183. package/dist/constants/job/shipment_status.test.js +4 -0
  184. package/dist/constants/job/supply_chain_request_status.js +7 -0
  185. package/dist/constants/job/supply_chain_request_status.test.js +4 -0
  186. package/dist/constants/job_priorities.js +7 -0
  187. package/dist/constants/job_priorities.test.js +4 -0
  188. package/dist/constants/job_status.js +50 -0
  189. package/dist/constants/job_status.test.js +4 -0
  190. package/dist/constants/job_types.js +17 -0
  191. package/dist/constants/job_types.test.js +4 -0
  192. package/dist/constants/notification_sections.js +14 -0
  193. package/dist/constants/notification_sections.test.js +4 -0
  194. package/dist/constants/notification_types.js +101 -0
  195. package/dist/constants/notification_types.test.js +4 -0
  196. package/dist/constants/notification_urgencies.js +7 -0
  197. package/dist/constants/notification_urgencies.test.js +4 -0
  198. package/dist/constants/payment_types.js +11 -0
  199. package/dist/constants/payment_types.test.js +4 -0
  200. package/dist/constants/platform.js +5 -0
  201. package/dist/constants/platform.test.js +8 -0
  202. package/dist/constants/product_types.js +27 -0
  203. package/dist/constants/product_types.test.js +4 -0
  204. package/dist/constants/rights.js +6 -0
  205. package/dist/constants/rights.test.js +4 -0
  206. package/dist/constants/robots_meta_directives.js +11 -0
  207. package/dist/constants/robots_meta_directives.test.js +4 -0
  208. package/dist/constants/roles.js +64 -0
  209. package/dist/constants/roles.test.js +4 -0
  210. package/dist/constants/shipment_companies.js +20 -0
  211. package/dist/constants/shipment_companies.test.js +4 -0
  212. package/dist/constants/shipment_services.js +4 -0
  213. package/dist/constants/shipment_services.test.js +4 -0
  214. package/dist/constants/system_roles.js +4 -0
  215. package/dist/constants/system_roles.test.js +4 -0
  216. package/dist/constants/theme_status.js +6 -0
  217. package/dist/constants/theme_status.test.js +4 -0
  218. package/dist/constants/user_types.js +18 -0
  219. package/dist/constants/user_types.test.js +4 -0
  220. package/dist/constants/white_label_accessibilities.js +6 -0
  221. package/dist/constants/white_label_accessibilities.test.js +4 -0
  222. package/dist/cookie.js +15 -0
  223. package/dist/cookie.test.js +10 -0
  224. package/dist/entities/address.js +104 -0
  225. package/dist/entities/address.test.js +6 -0
  226. package/dist/entities/agent_conversation.js +78 -0
  227. package/dist/entities/agent_conversation.test.js +6 -0
  228. package/dist/entities/agent_skill.js +133 -0
  229. package/dist/entities/agent_skill.test.js +11 -0
  230. package/dist/entities/agent_skill_approval.js +61 -0
  231. package/dist/entities/agent_skill_version.js +99 -0
  232. package/dist/entities/agent_token_analytics.js +1 -0
  233. package/dist/entities/agent_token_usage.js +127 -0
  234. package/dist/entities/agent_token_usage.test.js +6 -0
  235. package/dist/entities/assignment.js +135 -0
  236. package/dist/entities/assignment.test.js +30 -0
  237. package/dist/entities/automatic_payment_relationship.js +65 -0
  238. package/dist/entities/automatic_payment_relationship.test.js +6 -0
  239. package/dist/entities/bank.js +85 -0
  240. package/dist/entities/bank.test.js +6 -0
  241. package/dist/entities/cart.js +173 -0
  242. package/dist/entities/cart.test.js +51 -0
  243. package/dist/entities/cart_item.js +125 -0
  244. package/dist/entities/cart_item.test.js +28 -0
  245. package/dist/entities/cart_shipment_group.js +53 -0
  246. package/dist/entities/cart_shipment_quote.js +70 -0
  247. package/dist/entities/category.js +101 -0
  248. package/dist/entities/category.test.js +52 -0
  249. package/dist/entities/company.js +509 -0
  250. package/dist/entities/company.test.js +6 -0
  251. package/dist/entities/company_invitation.js +70 -0
  252. package/dist/entities/company_invitation.test.js +6 -0
  253. package/dist/entities/country_tax.js +80 -0
  254. package/dist/entities/country_tax.test.js +11 -0
  255. package/dist/entities/discount.js +89 -0
  256. package/dist/entities/discount.test.js +34 -0
  257. package/dist/entities/discount_group.js +80 -0
  258. package/dist/entities/discount_group.test.js +6 -0
  259. package/dist/entities/domain.js +567 -0
  260. package/dist/entities/domain.test.js +356 -0
  261. package/dist/entities/domain_chat_settings.js +134 -0
  262. package/dist/entities/domain_chat_settings.test.js +15 -0
  263. package/dist/entities/domain_invitation.js +74 -0
  264. package/dist/entities/domain_invitation.test.js +6 -0
  265. package/dist/entities/domain_tag.js +77 -0
  266. package/dist/entities/domain_tag.test.js +6 -0
  267. package/dist/entities/draft.js +122 -0
  268. package/dist/entities/draft.test.js +26 -0
  269. package/dist/entities/draft_comment.js +107 -0
  270. package/dist/entities/draft_comment.test.js +6 -0
  271. package/dist/entities/draft_preview.js +74 -0
  272. package/dist/entities/draft_preview.test.js +36 -0
  273. package/dist/entities/draft_preview_layer.js +54 -0
  274. package/dist/entities/draft_preview_layer.test.js +6 -0
  275. package/dist/entities/draft_template.js +119 -0
  276. package/dist/entities/draft_template.test.js +12 -0
  277. package/dist/entities/email_address.js +56 -0
  278. package/dist/entities/email_address.test.js +6 -0
  279. package/dist/entities/email_counter.js +53 -0
  280. package/dist/entities/email_counter.test.js +6 -0
  281. package/dist/entities/enrolled_domain.js +74 -0
  282. package/dist/entities/enrolled_domain.test.js +6 -0
  283. package/dist/entities/exchange_rate.js +56 -0
  284. package/dist/entities/exchange_rate.test.js +6 -0
  285. package/dist/entities/file.js +218 -0
  286. package/dist/entities/file.test.js +38 -0
  287. package/dist/entities/internal_tag.js +84 -0
  288. package/dist/entities/internal_tag.test.js +6 -0
  289. package/dist/entities/inventory.js +97 -0
  290. package/dist/entities/inventory.test.js +22 -0
  291. package/dist/entities/inventory_group.js +69 -0
  292. package/dist/entities/inventory_group.test.js +6 -0
  293. package/dist/entities/inventory_unit_variation.js +61 -0
  294. package/dist/entities/inventory_unit_variation.test.js +6 -0
  295. package/dist/entities/invoice.js +268 -0
  296. package/dist/entities/invoice.test.js +45 -0
  297. package/dist/entities/item.js +96 -0
  298. package/dist/entities/item.test.js +17 -0
  299. package/dist/entities/job.js +519 -0
  300. package/dist/entities/job.test.js +83 -0
  301. package/dist/entities/job_comment.js +94 -0
  302. package/dist/entities/job_comment.test.js +6 -0
  303. package/dist/entities/job_note.js +78 -0
  304. package/dist/entities/job_operation_log.js +82 -0
  305. package/dist/entities/job_operation_log.test.js +6 -0
  306. package/dist/entities/matching_inventory.js +63 -0
  307. package/dist/entities/notification.js +163 -0
  308. package/dist/entities/notification.test.js +51 -0
  309. package/dist/entities/payment.js +122 -0
  310. package/dist/entities/payment.test.js +22 -0
  311. package/dist/entities/payment_device.js +65 -0
  312. package/dist/entities/payment_device.test.js +6 -0
  313. package/dist/entities/phone_number.js +72 -0
  314. package/dist/entities/phone_number.test.js +6 -0
  315. package/dist/entities/product.js +619 -0
  316. package/dist/entities/product.test.js +720 -0
  317. package/dist/entities/product_form.js +92 -0
  318. package/dist/entities/product_form_version.js +95 -0
  319. package/dist/entities/product_review.js +234 -0
  320. package/dist/entities/production_comment.js +94 -0
  321. package/dist/entities/production_comment.test.js +6 -0
  322. package/dist/entities/quote.js +168 -0
  323. package/dist/entities/quote.test.js +86 -0
  324. package/dist/entities/quote_item.js +99 -0
  325. package/dist/entities/quote_item.test.js +40 -0
  326. package/dist/entities/reminder.js +120 -0
  327. package/dist/entities/reminder.test.js +14 -0
  328. package/dist/entities/session.js +63 -0
  329. package/dist/entities/session.test.js +6 -0
  330. package/dist/entities/shipment.js +256 -0
  331. package/dist/entities/shipment.test.js +20 -0
  332. package/dist/entities/shipment_item.js +45 -0
  333. package/dist/entities/shipment_item.test.js +6 -0
  334. package/dist/entities/shipment_item_fulfillment.js +46 -0
  335. package/dist/entities/shipment_item_fulfillment.test.js +6 -0
  336. package/dist/entities/shipment_log.js +75 -0
  337. package/dist/entities/shipment_method.js +104 -0
  338. package/dist/entities/shipment_method.test.js +6 -0
  339. package/dist/entities/shipment_method_variation.js +77 -0
  340. package/dist/entities/shipment_method_variation.test.js +6 -0
  341. package/dist/entities/short_url.js +73 -0
  342. package/dist/entities/short_url.test.js +6 -0
  343. package/dist/entities/subscription_plan.js +122 -0
  344. package/dist/entities/subscription_plan.test.js +6 -0
  345. package/dist/entities/supply_domain.js +62 -0
  346. package/dist/entities/supply_domain.test.js +6 -0
  347. package/dist/entities/support_conversation.js +106 -0
  348. package/dist/entities/support_conversation.test.js +6 -0
  349. package/dist/entities/support_message.js +66 -0
  350. package/dist/entities/support_message.test.js +6 -0
  351. package/dist/entities/system_role.js +49 -0
  352. package/dist/entities/system_role.test.js +6 -0
  353. package/dist/entities/theme.js +125 -0
  354. package/dist/entities/theme.test.js +35 -0
  355. package/dist/entities/theme_css_setting.js +57 -0
  356. package/dist/entities/theme_css_setting.test.js +6 -0
  357. package/dist/entities/user.js +508 -0
  358. package/dist/entities/user.test.js +134 -0
  359. package/dist/entities/user_company.js +62 -0
  360. package/dist/entities/user_company.test.js +6 -0
  361. package/dist/entities/variation.js +108 -0
  362. package/dist/entities/variation.test.js +6 -0
  363. package/dist/entities/variation_field.js +381 -0
  364. package/dist/entities/variation_field.test.js +69 -0
  365. package/dist/entities/variation_fields_option.js +153 -0
  366. package/dist/entities/variation_fields_option.test.js +43 -0
  367. package/dist/entities/variation_option.js +104 -0
  368. package/dist/entities/variation_option.test.js +6 -0
  369. package/dist/entities/variations_group.js +79 -0
  370. package/dist/entities/variations_group.test.js +6 -0
  371. package/dist/entity.js +950 -0
  372. package/dist/index.js +86 -0
  373. package/dist/merchi.js +296 -0
  374. package/dist/merchi.test.js +21 -0
  375. package/dist/pricing/discount.js +11 -0
  376. package/dist/pricing/discount.test.js +35 -0
  377. package/dist/pricing/estimate.js +335 -0
  378. package/dist/pricing/estimate.test.js +403 -0
  379. package/dist/pricing/golden.test.js +61 -0
  380. package/dist/pricing/index.js +7 -0
  381. package/dist/pricing/index.test.js +8 -0
  382. package/dist/pricing/inventory.js +238 -0
  383. package/dist/pricing/inventory.test.js +188 -0
  384. package/dist/pricing/matrix.js +245 -0
  385. package/dist/pricing/matrix.test.js +437 -0
  386. package/dist/pricing/round.js +29 -0
  387. package/dist/pricing/round.test.js +27 -0
  388. package/dist/pricing/types.js +1 -0
  389. package/dist/pricing/visibility.js +227 -0
  390. package/dist/pricing/visibility.test.js +210 -0
  391. package/dist/request.js +169 -0
  392. package/dist/request.test.js +70 -0
  393. package/dist/test_util.js +17 -0
  394. package/dist/toasts.js +14 -0
  395. package/dist/toasts.test.js +28 -0
  396. package/dist/util/float.js +34 -0
  397. package/dist/util/index.js +3 -0
  398. package/dist/util/query_string.js +13 -0
  399. package/dist/util/query_string.test.js +6 -0
  400. package/dist/util/validation.js +3 -0
  401. package/dist/util/validation.test.js +12 -0
  402. package/dist/uuid.js +8 -0
  403. package/dist/uuid.test.js +11 -0
  404. package/jest.config.js +23 -0
  405. package/merchi_sdk_ts-1.13.1.tgz +0 -0
  406. package/package.json +41 -0
  407. package/src/constants/auto_assign_production_on_actions.ts +6 -0
  408. package/src/constants/call_to_actions.test.ts +5 -0
  409. package/src/constants/call_to_actions.ts +14 -0
  410. package/src/constants/discount_types.test.ts +5 -0
  411. package/src/constants/discount_types.ts +5 -0
  412. package/src/constants/domain_types.test.ts +5 -0
  413. package/src/constants/domain_types.ts +12 -0
  414. package/src/constants/errors.ts +32 -0
  415. package/src/constants/event_types.test.ts +5 -0
  416. package/src/constants/event_types.ts +5 -0
  417. package/src/constants/field_types.test.ts +5 -0
  418. package/src/constants/field_types.ts +16 -0
  419. package/src/constants/index.ts +51 -0
  420. package/src/constants/input_types.test.ts +5 -0
  421. package/src/constants/input_types.ts +13 -0
  422. package/src/constants/inventory_status.test.ts +5 -0
  423. package/src/constants/inventory_statuses.ts +6 -0
  424. package/src/constants/invoice_types.test.ts +5 -0
  425. package/src/constants/invoice_types.ts +5 -0
  426. package/src/constants/item_types.test.ts +5 -0
  427. package/src/constants/item_types.ts +5 -0
  428. package/src/constants/job/drafting_status.test.ts +5 -0
  429. package/src/constants/job/drafting_status.ts +7 -0
  430. package/src/constants/job/payment_status.test.ts +5 -0
  431. package/src/constants/job/payment_status.ts +7 -0
  432. package/src/constants/job/production_status.test.ts +5 -0
  433. package/src/constants/job/production_status.ts +12 -0
  434. package/src/constants/job/shipment_status.test.ts +5 -0
  435. package/src/constants/job/shipment_status.ts +11 -0
  436. package/src/constants/job/supply_chain_request_status.test.ts +5 -0
  437. package/src/constants/job/supply_chain_request_status.ts +6 -0
  438. package/src/constants/job_priorities.test.ts +5 -0
  439. package/src/constants/job_priorities.ts +6 -0
  440. package/src/constants/job_status.test.ts +5 -0
  441. package/src/constants/job_status.ts +49 -0
  442. package/src/constants/job_types.test.ts +5 -0
  443. package/src/constants/job_types.ts +16 -0
  444. package/src/constants/notification_sections.test.ts +5 -0
  445. package/src/constants/notification_sections.ts +13 -0
  446. package/src/constants/notification_types.test.ts +5 -0
  447. package/src/constants/notification_types.ts +100 -0
  448. package/src/constants/notification_urgencies.test.ts +5 -0
  449. package/src/constants/notification_urgencies.ts +7 -0
  450. package/src/constants/payment_types.test.ts +5 -0
  451. package/src/constants/payment_types.ts +10 -0
  452. package/src/constants/platform.test.ts +15 -0
  453. package/src/constants/platform.ts +6 -0
  454. package/src/constants/product_types.test.ts +6 -0
  455. package/src/constants/product_types.ts +26 -0
  456. package/src/constants/rights.test.ts +5 -0
  457. package/src/constants/rights.ts +5 -0
  458. package/src/constants/robots_meta_directives.test.ts +5 -0
  459. package/src/constants/robots_meta_directives.ts +11 -0
  460. package/src/constants/roles.test.ts +5 -0
  461. package/src/constants/roles.ts +46 -0
  462. package/src/constants/shipment_companies.test.ts +5 -0
  463. package/src/constants/shipment_companies.ts +19 -0
  464. package/src/constants/shipment_services.test.ts +5 -0
  465. package/src/constants/shipment_services.ts +3 -0
  466. package/src/constants/system_roles.test.ts +5 -0
  467. package/src/constants/system_roles.ts +3 -0
  468. package/src/constants/theme_status.test.ts +5 -0
  469. package/src/constants/theme_status.ts +5 -0
  470. package/src/constants/user_types.test.ts +5 -0
  471. package/src/constants/user_types.ts +17 -0
  472. package/src/constants/white_label_accessibilities.test.ts +5 -0
  473. package/src/constants/white_label_accessibilities.ts +6 -0
  474. package/src/cookie.test.ts +11 -0
  475. package/src/cookie.ts +16 -0
  476. package/src/entities/address.test.ts +7 -0
  477. package/src/entities/address.ts +65 -0
  478. package/src/entities/agent_conversation.test.ts +7 -0
  479. package/src/entities/agent_conversation.ts +39 -0
  480. package/src/entities/agent_skill.test.ts +13 -0
  481. package/src/entities/agent_skill.ts +99 -0
  482. package/src/entities/agent_skill_approval.ts +26 -0
  483. package/src/entities/agent_skill_version.ts +64 -0
  484. package/src/entities/agent_token_analytics.ts +49 -0
  485. package/src/entities/agent_token_usage.test.ts +7 -0
  486. package/src/entities/agent_token_usage.ts +88 -0
  487. package/src/entities/assignment.test.ts +39 -0
  488. package/src/entities/assignment.ts +99 -0
  489. package/src/entities/automatic_payment_relationship.test.ts +8 -0
  490. package/src/entities/automatic_payment_relationship.ts +29 -0
  491. package/src/entities/bank.test.ts +7 -0
  492. package/src/entities/bank.ts +45 -0
  493. package/src/entities/cart.test.ts +57 -0
  494. package/src/entities/cart.ts +102 -0
  495. package/src/entities/cart_item.test.ts +33 -0
  496. package/src/entities/cart_item.ts +85 -0
  497. package/src/entities/cart_shipment_group.ts +21 -0
  498. package/src/entities/cart_shipment_quote.ts +33 -0
  499. package/src/entities/category.test.ts +57 -0
  500. package/src/entities/category.ts +59 -0
  501. package/src/entities/company.test.ts +7 -0
  502. package/src/entities/company.ts +397 -0
  503. package/src/entities/company_invitation.test.ts +7 -0
  504. package/src/entities/company_invitation.ts +33 -0
  505. package/src/entities/country_tax.test.ts +13 -0
  506. package/src/entities/country_tax.ts +46 -0
  507. package/src/entities/discount.test.ts +36 -0
  508. package/src/entities/discount.ts +50 -0
  509. package/src/entities/discount_group.test.ts +7 -0
  510. package/src/entities/discount_group.ts +43 -0
  511. package/src/entities/domain.test.ts +393 -0
  512. package/src/entities/domain.ts +1088 -0
  513. package/src/entities/domain_chat_settings.test.ts +16 -0
  514. package/src/entities/domain_chat_settings.ts +82 -0
  515. package/src/entities/domain_invitation.test.ts +7 -0
  516. package/src/entities/domain_invitation.ts +36 -0
  517. package/src/entities/domain_tag.test.ts +7 -0
  518. package/src/entities/domain_tag.ts +42 -0
  519. package/src/entities/draft.test.ts +29 -0
  520. package/src/entities/draft.ts +79 -0
  521. package/src/entities/draft_comment.test.ts +7 -0
  522. package/src/entities/draft_comment.ts +63 -0
  523. package/src/entities/draft_preview.test.ts +42 -0
  524. package/src/entities/draft_preview.ts +37 -0
  525. package/src/entities/draft_preview_layer.test.ts +7 -0
  526. package/src/entities/draft_preview_layer.ts +21 -0
  527. package/src/entities/draft_template.test.ts +14 -0
  528. package/src/entities/draft_template.ts +81 -0
  529. package/src/entities/email_address.test.ts +7 -0
  530. package/src/entities/email_address.ts +24 -0
  531. package/src/entities/email_counter.test.ts +7 -0
  532. package/src/entities/email_counter.ts +20 -0
  533. package/src/entities/enrolled_domain.test.ts +7 -0
  534. package/src/entities/enrolled_domain.ts +40 -0
  535. package/src/entities/exchange_rate.test.ts +7 -0
  536. package/src/entities/exchange_rate.ts +22 -0
  537. package/src/entities/file.test.ts +43 -0
  538. package/src/entities/file.ts +165 -0
  539. package/src/entities/internal_tag.test.ts +7 -0
  540. package/src/entities/internal_tag.ts +51 -0
  541. package/src/entities/inventory.test.ts +28 -0
  542. package/src/entities/inventory.ts +63 -0
  543. package/src/entities/inventory_group.test.ts +7 -0
  544. package/src/entities/inventory_group.ts +36 -0
  545. package/src/entities/inventory_unit_variation.test.ts +7 -0
  546. package/src/entities/inventory_unit_variation.ts +29 -0
  547. package/src/entities/invoice.test.ts +50 -0
  548. package/src/entities/invoice.ts +192 -0
  549. package/src/entities/item.test.ts +19 -0
  550. package/src/entities/item.ts +59 -0
  551. package/src/entities/job.test.ts +95 -0
  552. package/src/entities/job.ts +401 -0
  553. package/src/entities/job_comment.test.ts +7 -0
  554. package/src/entities/job_comment.ts +53 -0
  555. package/src/entities/job_note.ts +40 -0
  556. package/src/entities/job_operation_log.test.ts +7 -0
  557. package/src/entities/job_operation_log.ts +41 -0
  558. package/src/entities/matching_inventory.ts +29 -0
  559. package/src/entities/notification.test.ts +58 -0
  560. package/src/entities/notification.ts +106 -0
  561. package/src/entities/payment.test.ts +27 -0
  562. package/src/entities/payment.ts +77 -0
  563. package/src/entities/payment_device.test.ts +7 -0
  564. package/src/entities/payment_device.ts +30 -0
  565. package/src/entities/phone_number.test.ts +7 -0
  566. package/src/entities/phone_number.ts +36 -0
  567. package/src/entities/product.test.ts +776 -0
  568. package/src/entities/product.ts +486 -0
  569. package/src/entities/product_form.ts +51 -0
  570. package/src/entities/product_form_version.ts +51 -0
  571. package/src/entities/product_review.ts +221 -0
  572. package/src/entities/production_comment.test.ts +7 -0
  573. package/src/entities/production_comment.ts +53 -0
  574. package/src/entities/quote.test.ts +98 -0
  575. package/src/entities/quote.ts +140 -0
  576. package/src/entities/quote_item.test.ts +50 -0
  577. package/src/entities/quote_item.ts +71 -0
  578. package/src/entities/reminder.test.ts +16 -0
  579. package/src/entities/reminder.ts +74 -0
  580. package/src/entities/session.test.ts +7 -0
  581. package/src/entities/session.ts +28 -0
  582. package/src/entities/shipment.test.ts +24 -0
  583. package/src/entities/shipment.ts +196 -0
  584. package/src/entities/shipment_item.test.ts +7 -0
  585. package/src/entities/shipment_item.ts +15 -0
  586. package/src/entities/shipment_item_fulfillment.test.ts +8 -0
  587. package/src/entities/shipment_item_fulfillment.ts +15 -0
  588. package/src/entities/shipment_log.ts +37 -0
  589. package/src/entities/shipment_method.test.ts +7 -0
  590. package/src/entities/shipment_method.ts +61 -0
  591. package/src/entities/shipment_method_variation.test.ts +7 -0
  592. package/src/entities/shipment_method_variation.ts +39 -0
  593. package/src/entities/short_url.test.ts +7 -0
  594. package/src/entities/short_url.ts +36 -0
  595. package/src/entities/subscription_plan.test.ts +7 -0
  596. package/src/entities/subscription_plan.ts +73 -0
  597. package/src/entities/supply_domain.test.ts +7 -0
  598. package/src/entities/supply_domain.ts +27 -0
  599. package/src/entities/support_conversation.test.ts +7 -0
  600. package/src/entities/support_conversation.ts +65 -0
  601. package/src/entities/support_message.test.ts +7 -0
  602. package/src/entities/support_message.ts +30 -0
  603. package/src/entities/system_role.test.ts +7 -0
  604. package/src/entities/system_role.ts +17 -0
  605. package/src/entities/theme.test.ts +38 -0
  606. package/src/entities/theme.ts +82 -0
  607. package/src/entities/theme_css_setting.test.ts +7 -0
  608. package/src/entities/theme_css_setting.ts +23 -0
  609. package/src/entities/user.test.ts +154 -0
  610. package/src/entities/user.ts +428 -0
  611. package/src/entities/user_company.test.ts +7 -0
  612. package/src/entities/user_company.ts +27 -0
  613. package/src/entities/variation.test.ts +7 -0
  614. package/src/entities/variation.ts +64 -0
  615. package/src/entities/variation_field.test.ts +76 -0
  616. package/src/entities/variation_field.ts +268 -0
  617. package/src/entities/variation_fields_option.test.ts +46 -0
  618. package/src/entities/variation_fields_option.ts +107 -0
  619. package/src/entities/variation_option.test.ts +7 -0
  620. package/src/entities/variation_option.ts +58 -0
  621. package/src/entities/variations_group.test.ts +7 -0
  622. package/src/entities/variations_group.ts +41 -0
  623. package/src/entity.ts +1098 -0
  624. package/src/index.ts +189 -0
  625. package/src/merchi.test.ts +25 -0
  626. package/src/merchi.ts +445 -0
  627. package/src/pricing/__fixtures__/conditional_field_hidden.json +112 -0
  628. package/src/pricing/__fixtures__/conditional_field_visible.json +113 -0
  629. package/src/pricing/__fixtures__/group_product.json +130 -0
  630. package/src/pricing/__fixtures__/non_selectable_number_field.json +108 -0
  631. package/src/pricing/__fixtures__/quantity_break_discount.json +104 -0
  632. package/src/pricing/__fixtures__/simple_selectable_field.json +110 -0
  633. package/src/pricing/discount.test.ts +47 -0
  634. package/src/pricing/discount.ts +17 -0
  635. package/src/pricing/estimate.test.ts +486 -0
  636. package/src/pricing/estimate.ts +310 -0
  637. package/src/pricing/golden.test.ts +51 -0
  638. package/src/pricing/index.test.ts +9 -0
  639. package/src/pricing/index.ts +7 -0
  640. package/src/pricing/inventory.test.ts +197 -0
  641. package/src/pricing/inventory.ts +89 -0
  642. package/src/pricing/matrix.test.ts +553 -0
  643. package/src/pricing/matrix.ts +217 -0
  644. package/src/pricing/round.test.ts +31 -0
  645. package/src/pricing/round.ts +27 -0
  646. package/src/pricing/types.ts +140 -0
  647. package/src/pricing/visibility.test.ts +223 -0
  648. package/src/pricing/visibility.ts +111 -0
  649. package/src/request.test.ts +79 -0
  650. package/src/request.ts +196 -0
  651. package/src/test_util.ts +18 -0
  652. package/src/toasts.test.ts +38 -0
  653. package/src/toasts.ts +34 -0
  654. package/src/util/float.ts +12 -0
  655. package/src/util/index.ts +7 -0
  656. package/src/util/query_string.test.ts +7 -0
  657. package/src/util/query_string.ts +13 -0
  658. package/src/util/validation.test.ts +16 -0
  659. package/src/util/validation.ts +2 -0
  660. package/src/uuid.test.ts +15 -0
  661. package/src/uuid.ts +8 -0
  662. package/tsconfig.json +29 -0
@@ -0,0 +1,1088 @@
1
+ import { Cart } from './cart.js';
2
+ import { Category } from './category.js';
3
+ import { Company } from './company.js';
4
+ import { DomainInvitation } from './domain_invitation.js';
5
+ import { DomainTag } from './domain_tag.js';
6
+ import { EnrolledDomain } from './enrolled_domain.js';
7
+ import { Entity } from '../entity.js';
8
+ import type {
9
+ AgentTokenAnalyticsTimeseries,
10
+ DomainAnalyticsResponse,
11
+ } from './agent_token_analytics.js';
12
+ import { MerchiFile } from './file.js';
13
+ import { InternalTag } from './internal_tag.js';
14
+ import { Invoice } from './invoice.js';
15
+ import { Job } from './job.js';
16
+ import { User } from './user.js';
17
+ import { Notification } from './notification.js';
18
+ import { Product } from './product.js';
19
+ import { Reminder } from './reminder.js';
20
+ import { Session } from './session.js';
21
+ import { SupplyDomain } from './supply_domain.js';
22
+ import { DomainChatSettings } from './domain_chat_settings.js';
23
+ import { Theme } from './theme.js';
24
+ import { DomainType } from '../constants/domain_types.js';
25
+ import { ShipmentMethod } from './shipment_method.js';
26
+
27
+ // Sentinel for passthrough JSON columns. Must not be `Object` (decorator rejects it).
28
+ const jsonPropertyType = class {};
29
+ import { RequestOptions } from '../request.js';
30
+
31
+ export type StorefrontChangeRequestStatus =
32
+ | 'created'
33
+ | 'running'
34
+ | 'preview_ready'
35
+ | 'approved'
36
+ | 'rejected';
37
+
38
+ export interface StorefrontChecksSummary {
39
+ overall?: 'passing' | 'failing' | 'pending' | 'unknown';
40
+ statusState?: string;
41
+ counts?: {
42
+ total?: number;
43
+ passed?: number;
44
+ failed?: number;
45
+ pending?: number;
46
+ neutral?: number;
47
+ };
48
+ updatedAt?: string;
49
+ }
50
+
51
+ export interface StorefrontExecutionEvent {
52
+ timestamp: string;
53
+ stage: string;
54
+ level?: 'info' | 'error' | string;
55
+ message: string;
56
+ metadata?: Record<string, any>;
57
+ }
58
+
59
+ export interface StorefrontRequestContextImage {
60
+ name: string;
61
+ mimeType?: string | null;
62
+ dataUrl: string;
63
+ }
64
+
65
+ export interface StorefrontV2ChangeRequestPayload {
66
+ prompt: string;
67
+ contextFilePaths?: string[];
68
+ contextImages?: StorefrontRequestContextImage[];
69
+ branchName?: string;
70
+ startNewBranch?: boolean;
71
+ clarificationAnswers?: Record<string, string | string[]>;
72
+ generationBriefSummary?: string;
73
+ generationBoilerplateFit?: string;
74
+ clarificationSkipped?: boolean;
75
+ }
76
+
77
+ export interface StorefrontV2ChangeRequestRunPayload {
78
+ status?: 'running' | 'preview_ready';
79
+ branchName?: string;
80
+ commitSha?: string;
81
+ previewUrl?: string;
82
+ summary?: string;
83
+ pullRequestNumber?: number;
84
+ checksSummary?: StorefrontChecksSummary;
85
+ checksUpdatedAt?: string;
86
+ errorDetails?: string;
87
+ }
88
+
89
+ export interface StorefrontV2ChangeRequestRejectPayload {
90
+ errorDetails?: string;
91
+ }
92
+
93
+ export interface StorefrontV2ChangeRequest {
94
+ id: number;
95
+ domainId: number;
96
+ storefrontV2Id: number;
97
+ requestedByUserId?: number | null;
98
+ status: StorefrontChangeRequestStatus;
99
+ prompt: string;
100
+ branchName?: string | null;
101
+ commitSha?: string | null;
102
+ pullRequestNumber?: number | null;
103
+ previewUrl?: string | null;
104
+ summary?: string | null;
105
+ checksSummary?: StorefrontChecksSummary | null;
106
+ checksUpdatedAt?: string | null;
107
+ errorDetails?: string | null;
108
+ executionEvents?: StorefrontExecutionEvent[] | null;
109
+ creationDate?: string | null;
110
+ updatedAt?: string | null;
111
+ }
112
+
113
+ export interface StorefrontGoogleIntegrations {
114
+ ga4MeasurementId?: string;
115
+ ga4PropertyId?: string;
116
+ googleAdsId?: string;
117
+ googleAdsConversionLabel?: string;
118
+ googleAdsQuoteConversionLabel?: string;
119
+ }
120
+
121
+ export type StorefrontV2InfrastructureMode = 'platform' | 'byo';
122
+
123
+ /** Public BYO connection status (never includes encrypted tokens). */
124
+ export interface StorefrontV2ByoStatus {
125
+ infrastructureMode: StorefrontV2InfrastructureMode;
126
+ githubAppConfigured: boolean;
127
+ vercelOauthConfigured: boolean;
128
+ githubConnected: boolean;
129
+ vercelConnected: boolean;
130
+ githubAccountLogin?: string | null;
131
+ githubInstallationId?: string | null;
132
+ vercelTeamId?: string | null;
133
+ }
134
+
135
+ export interface StorefrontV2Config {
136
+ id?: number;
137
+ domainId?: number;
138
+ status?: 'provisioning' | 'ready' | 'failed' | 'archived' | string;
139
+ starterTemplate?: string | null;
140
+ urlStructure?: string | null;
141
+ defaultBranch?: string | null;
142
+ activePreviewBranchName?: string | null;
143
+ activePreviewStartedAt?: string | null;
144
+ activePreviewLastRequestId?: number | null;
145
+ repoProvider?: string | null;
146
+ repoOwner?: string | null;
147
+ repoName?: string | null;
148
+ vercelProjectId?: string | null;
149
+ vercelTeamId?: string | null;
150
+ infrastructureMode?: StorefrontV2InfrastructureMode | string | null;
151
+ githubInstallationId?: string | null;
152
+ githubAccountLogin?: string | null;
153
+ byo?: StorefrontV2ByoStatus | null;
154
+ lastSuccessfulCommitSha?: string | null;
155
+ googleIntegrations?: StorefrontGoogleIntegrations | null;
156
+ approvedStarterTemplates?: string[];
157
+ providerMode?: 'real' | 'deterministic' | 'unknown' | string;
158
+ isProvisioned?: boolean;
159
+ creationDate?: string | null;
160
+ updatedAt?: string | null;
161
+ }
162
+
163
+ export interface StorefrontV2GetResponse {
164
+ storefrontV2?: StorefrontV2Config;
165
+ isProvisioned?: boolean;
166
+ provisioned?: boolean;
167
+ providerMode?: string;
168
+ approvedStarterTemplates?: string[];
169
+ }
170
+
171
+ export interface StorefrontV2ProvisionPayload {
172
+ starterTemplate?: string;
173
+ urlStructure?: string;
174
+ }
175
+
176
+ export interface StorefrontV2StarterTemplateUrlStructureResult {
177
+ starterTemplate: string;
178
+ urlStructure: string;
179
+ }
180
+
181
+ export interface StorefrontV2SiteContextInput {
182
+ url?: string;
183
+ sourceUrl?: string;
184
+ }
185
+
186
+ export interface StorefrontV2GenerationBriefQuestionOption {
187
+ id: string;
188
+ label: string;
189
+ }
190
+
191
+ export interface StorefrontV2GenerationBriefQuestion {
192
+ id: string;
193
+ topicId: string;
194
+ prompt: string;
195
+ type: 'single' | 'multi' | 'text';
196
+ options?: StorefrontV2GenerationBriefQuestionOption[];
197
+ required?: boolean;
198
+ }
199
+
200
+ export interface StorefrontV2GenerationBriefGapTopic {
201
+ id: string;
202
+ category: string;
203
+ severity: 'high' | 'medium' | 'low' | string;
204
+ evidence: string;
205
+ suggestedOptions?: string[];
206
+ }
207
+
208
+ export interface StorefrontV2GenerationBrief {
209
+ planSummary: string;
210
+ boilerplateFit: string;
211
+ gapTopics: StorefrontV2GenerationBriefGapTopic[];
212
+ questions: StorefrontV2GenerationBriefQuestion[];
213
+ questionCount: number;
214
+ }
215
+
216
+ export interface StorefrontV2GenerationBriefPayload {
217
+ siteContext: StorefrontV2SiteContext;
218
+ urlStructure?: string;
219
+ starterTemplate?: string;
220
+ }
221
+
222
+ export interface StorefrontV2ResetResult {
223
+ status: string;
224
+ isProvisioned: boolean;
225
+ providerMode?: 'real' | 'deterministic' | 'unknown' | string;
226
+ approvedStarterTemplates?: string[];
227
+ }
228
+
229
+ export interface StorefrontV2RepositoryTreeEntry {
230
+ name: string;
231
+ path: string;
232
+ type: 'directory' | 'file';
233
+ }
234
+
235
+ export interface StorefrontV2RepositoryTree {
236
+ path: string;
237
+ ref: string;
238
+ entries: StorefrontV2RepositoryTreeEntry[];
239
+ }
240
+
241
+ export interface StorefrontV2RepositoryBranches {
242
+ defaultBranch: string;
243
+ activeBranchName?: string | null;
244
+ branches: string[];
245
+ }
246
+
247
+ export interface StorefrontV2RepositoryFile {
248
+ path: string;
249
+ ref: string;
250
+ sha?: string;
251
+ content: string;
252
+ }
253
+
254
+ export interface StorefrontV2RepositoryFileUpdate {
255
+ path: string;
256
+ branch: string;
257
+ commitSha: string;
258
+ }
259
+
260
+ export interface StorefrontV2RepositoryFileUpdatePayload {
261
+ path: string;
262
+ content: string;
263
+ message?: string;
264
+ branch?: string;
265
+ }
266
+
267
+ export interface StorefrontV2Deployment {
268
+ id: string;
269
+ environment: 'preview' | 'production' | string;
270
+ status: string;
271
+ commitSha?: string | null;
272
+ url?: string | null;
273
+ }
274
+
275
+ export interface StorefrontV2DeploymentLog {
276
+ timestamp: string;
277
+ level: string;
278
+ message: string;
279
+ }
280
+
281
+ export interface StorefrontV2RollbackResult {
282
+ status: string;
283
+ targetCommitSha: string;
284
+ deployment?: {
285
+ deploymentId: string;
286
+ status?: string;
287
+ };
288
+ }
289
+
290
+ export interface StorefrontV2ProductPublishResult {
291
+ action: 'deploy' | 'recache' | string;
292
+ productName?: string | null;
293
+ productId?: number | null;
294
+ lastDeployed?: number | null;
295
+ status?: string;
296
+ productUrl?: string;
297
+ deploymentId?: string;
298
+ previewUrl?: string;
299
+ branchName?: string;
300
+ message?: string;
301
+ httpStatus?: number;
302
+ }
303
+
304
+ export interface StorefrontV2ProductStatus {
305
+ activated: boolean;
306
+ outOfSync?: boolean;
307
+ lastUpdated?: number | null;
308
+ lastDeployed?: number | null;
309
+ }
310
+
311
+ export interface StorefrontV2CategoryPublishResult {
312
+ action: 'deploy' | 'recache' | string;
313
+ categoryName?: string | null;
314
+ status?: string;
315
+ categoryUrl?: string;
316
+ deploymentId?: string;
317
+ previewUrl?: string;
318
+ branchName?: string;
319
+ message?: string;
320
+ httpStatus?: number;
321
+ }
322
+
323
+ export interface StorefrontV2ProductPublishPayload {
324
+ productName?: string;
325
+ productUrl?: string;
326
+ productId?: number;
327
+ branchName?: string;
328
+ }
329
+
330
+ export interface StorefrontV2CategoryPublishPayload {
331
+ categoryName?: string;
332
+ categoryUrl?: string;
333
+ branchName?: string;
334
+ }
335
+
336
+ export interface StorefrontV2EmulationRoute {
337
+ name?: string;
338
+ path: string;
339
+ pageType?: string;
340
+ targetFile?: string;
341
+ }
342
+
343
+ export interface StorefrontV2EmulationSpec {
344
+ routeContract?: {
345
+ recommendedUrlStructure?: string;
346
+ dynamicParams?: string[];
347
+ routes?: StorefrontV2EmulationRoute[];
348
+ };
349
+ componentMapping?: Array<{
350
+ section?: string;
351
+ sourceSignals?: string[];
352
+ boilerplateTargets?: string[];
353
+ implementationNotes?: string;
354
+ }>;
355
+ }
356
+
357
+ export interface StorefrontV2PageAnalysisItem {
358
+ url: string;
359
+ title?: string | null;
360
+ description?: string | null;
361
+ h1?: string | null;
362
+ headings?: string[];
363
+ contentPreview?: string | null;
364
+ }
365
+
366
+ export interface StorefrontV2SiteContext {
367
+ sourceUrl: string;
368
+ style?: {
369
+ title?: string | null;
370
+ description?: string | null;
371
+ colors?: string[];
372
+ fontFamilies?: string[];
373
+ } | null;
374
+ sitemap?: string[];
375
+ navigation?: Array<{label?: string; url: string}>;
376
+ categories?: string[];
377
+ products?: string[];
378
+ scrapedCategories?: string[];
379
+ scrapedProducts?: string[];
380
+ domainCatalog?: {
381
+ categories?: Array<{id?: number; name?: string; slug?: string}>;
382
+ products?: Array<{
383
+ id?: number;
384
+ name?: string;
385
+ slug?: string;
386
+ categories?: Array<{id?: number; name?: string; slug?: string}>;
387
+ }>;
388
+ } | null;
389
+ catalogMapping?: {
390
+ categories?: Array<{
391
+ domainCategoryId?: number;
392
+ domainCategoryName?: string;
393
+ domainCategorySlug?: string;
394
+ scrapedCategoryLabel?: string | null;
395
+ matchedScrapedUrl?: string | null;
396
+ matchSource?: string | null;
397
+ }>;
398
+ products?: Array<{
399
+ domainProductId?: number;
400
+ domainProductName?: string;
401
+ domainProductSlug?: string;
402
+ domainCategoryIds?: number[];
403
+ domainCategoryNames?: string[];
404
+ scrapedProductLabel?: string | null;
405
+ matchedScrapedUrl?: string | null;
406
+ matchSource?: string | null;
407
+ }>;
408
+ } | null;
409
+ tracking?: Array<{provider?: string; value?: string}>;
410
+ wireframe?: string[];
411
+ stylesheets?: Array<{url: string; content: string}>;
412
+ pageAnalysis?: StorefrontV2PageAnalysisItem[];
413
+ emulationSpec?: StorefrontV2EmulationSpec | null;
414
+ analysisMarkdown?: string | null;
415
+ analysisFilePath?: string | null;
416
+ analysisJsonFilePath?: string | null;
417
+ analysisScreenshotPaths?: string[];
418
+ analysisScreenshots?: Array<{
419
+ name?: string;
420
+ pageUrl?: string;
421
+ path?: string;
422
+ viewport?: string;
423
+ width?: number;
424
+ height?: number;
425
+ screenshotUrl?: string;
426
+ mimeType?: string;
427
+ dataUrl?: string;
428
+ }>;
429
+ analysisBranch?: string | null;
430
+ analysisCommitSha?: string | null;
431
+ analysisJsonCommitSha?: string | null;
432
+ }
433
+
434
+ export class Domain extends Entity {
435
+ protected static resourceName = 'domains';
436
+ protected static singularName = 'domain';
437
+ protected static pluralName = 'domains';
438
+
439
+ @Domain.property({type: Date})
440
+ public archived?: Date | null;
441
+
442
+ @Domain.property()
443
+ public id?: number;
444
+
445
+ @Domain.property()
446
+ public domain?: string;
447
+
448
+ @Domain.property()
449
+ public country?: string;
450
+
451
+ @Domain.property()
452
+ public currency?: string;
453
+
454
+ @Domain.property()
455
+ public callToActions?: string;
456
+
457
+ @Domain.property()
458
+ public callToActionDetails?: any[];
459
+
460
+ @Domain.property()
461
+ public isMaster?: boolean;
462
+
463
+ @Domain.property()
464
+ public deploymentOnline?: boolean;
465
+
466
+ @Domain.property()
467
+ public deploymentInProgress?: boolean;
468
+
469
+ @Domain.property()
470
+ public deploymentSucceeded?: boolean;
471
+
472
+ @Domain.property()
473
+ public deploymentMessage?: string;
474
+
475
+ @Domain.property()
476
+ public deploymentKey?: string;
477
+
478
+ @Domain.property()
479
+ public internalUseNotes?: string;
480
+
481
+ @Domain.property()
482
+ public internalUseAiContext?: string;
483
+
484
+ @Domain.property()
485
+ public aiContext?: string;
486
+
487
+ @Domain.property()
488
+ public domainType?: DomainType;
489
+
490
+ @Domain.property()
491
+ public subDomain?: string;
492
+
493
+ @Domain.property()
494
+ public emailDomain?: string;
495
+
496
+ @Domain.property()
497
+ public smsName?: string;
498
+
499
+ @Domain.property()
500
+ public whatsappPhoneNumberId?: string;
501
+
502
+ @Domain.property()
503
+ public showDomainPublicly?: boolean;
504
+
505
+ @Domain.property()
506
+ public publicAccessRestricted?: boolean;
507
+
508
+ @Domain.property()
509
+ public showDomainToAccessibleEntitiesOnly?: boolean;
510
+
511
+ @Domain.property()
512
+ public enableEmailNotifications?: boolean;
513
+
514
+ @Domain.property()
515
+ public enableSmsNotifications?: boolean;
516
+
517
+ @Domain.property()
518
+ public enableWhatsappNotifications?: boolean;
519
+
520
+ @Domain.property()
521
+ public mailgunRecords?: any[];
522
+
523
+ @Domain.property()
524
+ public enableNotifications?: boolean;
525
+
526
+ @Domain.property()
527
+ public assignToAgent?: boolean;
528
+
529
+ @Domain.property({type: jsonPropertyType})
530
+ public jobAgentPolicy?: {
531
+ toneInstructions?: string;
532
+ outreach?: {
533
+ clientMessaging?: 'auto' | 'team_draft_only';
534
+ sendEmail?: boolean;
535
+ sendSms?: boolean;
536
+ proactiveChase?: boolean;
537
+ };
538
+ playbooks?: {
539
+ deadlineAsk?: boolean;
540
+ emailIntake?: boolean;
541
+ drafting?: boolean;
542
+ designerAssign?: boolean;
543
+ productionTender?: boolean;
544
+ shipment?: boolean;
545
+ invoice?: boolean;
546
+ };
547
+ } | null;
548
+
549
+ @Domain.property({ type: User })
550
+ public merchiAgentUser?: User | null;
551
+
552
+ @Domain.property({type: String})
553
+ public trackingCodeGoogleConversion?: string | null;
554
+
555
+ @Domain.property({type: String})
556
+ public trackingCodeGoogleGlobal?: string | null;
557
+
558
+ @Domain.property({type: String})
559
+ public apiSecret?: string | null;
560
+
561
+ @Domain.property({type: String})
562
+ public webflowApiKey?: string | null;
563
+
564
+ @Domain.property({type: String})
565
+ public telegramChatId?: string;
566
+
567
+ @Domain.property({type: String})
568
+ public shopifyShopUrl?: string | null;
569
+
570
+ @Domain.property()
571
+ public shopifyIsActive?: boolean;
572
+
573
+ @Domain.property({type: String})
574
+ public qrShopQrCode?: string | null;
575
+
576
+ @Domain.property({type: String})
577
+ public unltdAiApiOrganizationId?: string;
578
+
579
+ @Domain.property({type: String})
580
+ public unltdAiApiSecretKey?: string;
581
+
582
+ @Domain.property({type: String})
583
+ public scalablePressApiKey?: string;
584
+
585
+ @Domain.property({type: String})
586
+ public googleMerchantApiKey?: string;
587
+
588
+ @Domain.property({type: String})
589
+ public googleMerchantId?: string;
590
+
591
+ @Domain.property({type: Boolean})
592
+ public googleProductReviewsFeedEnabled?: boolean;
593
+
594
+ @Domain.property({type: String})
595
+ public googleProductReviewsFeedToken?: string | null;
596
+
597
+ @Domain.property({type: String})
598
+ public googleProductReviewsFeedUrl?: string | null;
599
+
600
+ @Domain.property({type: String})
601
+ public socialBitchute?: string | null;
602
+
603
+ @Domain.property({type: String})
604
+ public socialDiscord?: string | null;
605
+
606
+ @Domain.property({type: String})
607
+ public socialFacebook?: string | null;
608
+
609
+ @Domain.property({type: String})
610
+ public socialGoogle?: string | null;
611
+
612
+ @Domain.property({type: String})
613
+ public socialInstagram?: string | null;
614
+
615
+ @Domain.property({type: String})
616
+ public socialLinkedin?: string | null;
617
+
618
+ @Domain.property({type: String})
619
+ public socialRumble?: string | null;
620
+
621
+ @Domain.property({type: String})
622
+ public socialTelegram?: string | null;
623
+
624
+ @Domain.property({type: String})
625
+ public socialTiktok?: string | null;
626
+
627
+ @Domain.property({type: String})
628
+ public socialX?: string | null;
629
+
630
+ @Domain.property({type: String})
631
+ public socialYoutube?: string | null;
632
+
633
+ @Domain.property()
634
+ public ownedBy?: Company;
635
+
636
+ @Domain.property()
637
+ public company?: Company;
638
+
639
+ @Domain.property({type: MerchiFile})
640
+ public logo?: MerchiFile | null;
641
+
642
+ @Domain.property({type: MerchiFile})
643
+ public favicon?: MerchiFile | null;
644
+
645
+ @Domain.property({arrayType: 'ShipmentMethod'})
646
+ public shipmentMethods?: ShipmentMethod[];
647
+
648
+ @Domain.property()
649
+ public activeTheme?: Theme;
650
+
651
+ @Domain.property({arrayType: 'InternalTag'})
652
+ public internalTags?: InternalTag[];
653
+
654
+ @Domain.property({arrayType: 'DomainTag'})
655
+ public tags?: DomainTag[];
656
+
657
+ @Domain.property({arrayType: 'Domain'})
658
+ public canSupply?: Domain[];
659
+
660
+ @Domain.property({arrayType: 'Domain'})
661
+ public suppliedBy?: Domain[];
662
+
663
+ @Domain.property({arrayType: 'User'})
664
+ public accessibleClients?: User[];
665
+
666
+ @Domain.property({arrayType: 'Company'})
667
+ public accessibleClientCompanies?: Company[];
668
+
669
+ @Domain.property({arrayType: 'Session'})
670
+ public sessions?: Session[];
671
+
672
+ @Domain.property({arrayType: 'Category'})
673
+ public categories?: Category[];
674
+
675
+ @Domain.property({arrayType: 'Notification'})
676
+ public notifications?: Notification[];
677
+
678
+ @Domain.property({arrayType: 'Reminder'})
679
+ public reminders?: Reminder[];
680
+
681
+ @Domain.property({arrayType: 'Product'})
682
+ public products?: Product[];
683
+
684
+ @Domain.property({arrayType: 'SupplyDomain'})
685
+ public supplyProducts?: SupplyDomain[];
686
+
687
+ @Domain.property({arrayType: 'Job'})
688
+ public jobs?: Job[];
689
+
690
+ @Domain.property({arrayType: 'User'})
691
+ public jobsAssignees?: User[];
692
+
693
+ @Domain.property({arrayType: 'Cart'})
694
+ public carts?: Cart[];
695
+
696
+ @Domain.property({arrayType: 'EnrolledDomain'})
697
+ public enrollments?: EnrolledDomain[];
698
+
699
+ @Domain.property({arrayType: 'Invoice'})
700
+ public invoices?: Invoice[];
701
+
702
+ @Domain.property({arrayType: 'DomainInvitation'})
703
+ public domainInvitations?: DomainInvitation[];
704
+
705
+ @Domain.property({ type: DomainChatSettings })
706
+ public domainChatSettings?: DomainChatSettings | null;
707
+
708
+ @Domain.property({arrayType: 'Theme'})
709
+ public themes?: Theme[];
710
+
711
+ public defaultTaxType = () => {
712
+ if (this.company === undefined) {
713
+ throw new Error('company is undefined, did you forget to embed it?');
714
+ }
715
+ if (this.company.defaultTaxType === undefined) {
716
+ const err = 'company.defaultTaxType is undefined, did you forget to' +
717
+ ' embed it?';
718
+ throw new Error(err);
719
+ }
720
+ return this.company.defaultTaxType;
721
+ };
722
+
723
+ public getActiveTheme = (): Theme => {
724
+ if (this.activeTheme === undefined) {
725
+ throw new Error('activeTheme is undefined, did you forget to embed it?');
726
+ }
727
+ return this.activeTheme!;
728
+ };
729
+
730
+ private getDomainId = () => {
731
+ if (this.id === undefined || this.id === null) {
732
+ throw new Error('id is undefined, did you forget to set it?');
733
+ }
734
+ return this.id;
735
+ };
736
+
737
+ private storefrontV2DomainResource = (suffix = '') => {
738
+ return `/domains/${this.getDomainId()}/storefront_v2/${suffix}`;
739
+ };
740
+
741
+ private storefrontV2Request = (
742
+ resource: string,
743
+ method: 'GET' | 'POST',
744
+ payload?: Record<string, any>,
745
+ queryParams?: Record<string, string | undefined>
746
+ ) => {
747
+ const query: Array<[string, string]> = [['skip_rights', 'y']];
748
+ if (queryParams) {
749
+ Object.entries(queryParams).forEach(([key, value]) => {
750
+ if (value !== undefined && value !== '') {
751
+ query.push([key, value]);
752
+ }
753
+ });
754
+ }
755
+ const fetchOptions: RequestOptions = {
756
+ method: method,
757
+ query: query
758
+ };
759
+ if (payload !== undefined) {
760
+ fetchOptions.body = JSON.stringify(payload);
761
+ fetchOptions.headers = {'Content-Type': 'application/json'};
762
+ }
763
+ return this.merchi.authenticatedFetch(resource, fetchOptions);
764
+ };
765
+
766
+ public getStorefrontV2 = (): Promise<StorefrontV2GetResponse> => {
767
+ return this.storefrontV2Request(this.storefrontV2DomainResource(), 'GET');
768
+ };
769
+
770
+ public provisionStorefrontV2 = (
771
+ payload?: StorefrontV2ProvisionPayload
772
+ ): Promise<{storefrontV2: StorefrontV2Config}> => {
773
+ return this.storefrontV2Request(
774
+ this.storefrontV2DomainResource('provision/'),
775
+ 'POST',
776
+ payload
777
+ );
778
+ };
779
+
780
+ public resolveStarterTemplateUrlStructure = (
781
+ payload: {starterTemplate: string}
782
+ ): Promise<StorefrontV2StarterTemplateUrlStructureResult> => {
783
+ return this.storefrontV2Request(
784
+ this.storefrontV2DomainResource('starter_template/url_structure/'),
785
+ 'POST',
786
+ payload
787
+ ) as Promise<StorefrontV2StarterTemplateUrlStructureResult>;
788
+ };
789
+
790
+ public extractStorefrontV2SiteContext = (
791
+ payload: StorefrontV2SiteContextInput
792
+ ): Promise<{siteContext: StorefrontV2SiteContext}> => {
793
+ return this.storefrontV2Request(
794
+ this.storefrontV2DomainResource('site_context/extract/'),
795
+ 'POST',
796
+ payload
797
+ ) as Promise<{siteContext: StorefrontV2SiteContext}>;
798
+ };
799
+
800
+ public createStorefrontV2GenerationBrief = (
801
+ payload: StorefrontV2GenerationBriefPayload
802
+ ): Promise<{generationBrief: StorefrontV2GenerationBrief}> => {
803
+ return this.storefrontV2Request(
804
+ this.storefrontV2DomainResource('generation_brief/'),
805
+ 'POST',
806
+ payload
807
+ ) as Promise<{generationBrief: StorefrontV2GenerationBrief}>;
808
+ };
809
+
810
+ public resetStorefrontV2 = (): Promise<StorefrontV2ResetResult> => {
811
+ return this.storefrontV2Request(
812
+ this.storefrontV2DomainResource('reset/'),
813
+ 'POST'
814
+ ) as Promise<StorefrontV2ResetResult>;
815
+ };
816
+
817
+ public getStorefrontV2GoogleIntegrations = (): Promise<{
818
+ googleIntegrations: StorefrontGoogleIntegrations;
819
+ }> => {
820
+ return this.storefrontV2Request(
821
+ this.storefrontV2DomainResource('google_integrations/'),
822
+ 'GET'
823
+ ) as Promise<{googleIntegrations: StorefrontGoogleIntegrations}>;
824
+ };
825
+
826
+ public saveStorefrontV2GoogleIntegrations = (
827
+ payload: StorefrontGoogleIntegrations | {googleIntegrations: StorefrontGoogleIntegrations}
828
+ ): Promise<{googleIntegrations: StorefrontGoogleIntegrations}> => {
829
+ const body =
830
+ payload &&
831
+ typeof payload === 'object' &&
832
+ ('googleIntegrations' in payload || 'google_integrations' in payload)
833
+ ? payload
834
+ : {googleIntegrations: payload};
835
+ return this.storefrontV2Request(
836
+ this.storefrontV2DomainResource('google_integrations/'),
837
+ 'POST',
838
+ body
839
+ ) as Promise<{googleIntegrations: StorefrontGoogleIntegrations}>;
840
+ };
841
+
842
+ public getStorefrontV2GaStatus = (): Promise<{gaStatus: Record<string, any>}> => {
843
+ return this.storefrontV2Request(
844
+ this.storefrontV2DomainResource('ga/status/'),
845
+ 'GET'
846
+ ) as Promise<{gaStatus: Record<string, any>}>;
847
+ };
848
+
849
+ public verifyStorefrontV2GaInstallation = (): Promise<{
850
+ gaVerification: Record<string, any>;
851
+ }> => {
852
+ return this.storefrontV2Request(
853
+ this.storefrontV2DomainResource('ga/verify/'),
854
+ 'POST'
855
+ ) as Promise<{gaVerification: Record<string, any>}>;
856
+ };
857
+
858
+ public analyzeStorefrontV2Ga = (
859
+ payload?: {days?: number}
860
+ ): Promise<{gaAnalysis: Record<string, any>}> => {
861
+ return this.storefrontV2Request(
862
+ this.storefrontV2DomainResource('ga/analyze/'),
863
+ 'POST',
864
+ payload
865
+ ) as Promise<{gaAnalysis: Record<string, any>}>;
866
+ };
867
+
868
+ public applyStorefrontV2GaRecommendations = (payload: {
869
+ recommendationIds: string[];
870
+ recommendations?: Array<Record<string, any>>;
871
+ narrative?: string;
872
+ days?: number;
873
+ startNewBranch?: boolean;
874
+ branchName?: string;
875
+ }): Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}> => {
876
+ return this.storefrontV2Request(
877
+ this.storefrontV2DomainResource('ga/apply/'),
878
+ 'POST',
879
+ payload
880
+ ) as Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}>;
881
+ };
882
+
883
+ public getStorefrontV2GscStatus = (): Promise<{gscStatus: Record<string, any>}> => {
884
+ return this.storefrontV2Request(
885
+ this.storefrontV2DomainResource('gsc/status/'),
886
+ 'GET'
887
+ ) as Promise<{gscStatus: Record<string, any>}>;
888
+ };
889
+
890
+ public analyzeStorefrontV2Gsc = (
891
+ payload?: {days?: number}
892
+ ): Promise<{gscAnalysis: Record<string, any>}> => {
893
+ return this.storefrontV2Request(
894
+ this.storefrontV2DomainResource('gsc/analyze/'),
895
+ 'POST',
896
+ payload
897
+ ) as Promise<{gscAnalysis: Record<string, any>}>;
898
+ };
899
+
900
+ public applyStorefrontV2GscRecommendations = (payload: {
901
+ recommendationIds: string[];
902
+ recommendations?: Array<Record<string, any>>;
903
+ narrative?: string;
904
+ days?: number;
905
+ startNewBranch?: boolean;
906
+ branchName?: string;
907
+ }): Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}> => {
908
+ return this.storefrontV2Request(
909
+ this.storefrontV2DomainResource('gsc/apply/'),
910
+ 'POST',
911
+ payload
912
+ ) as Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}>;
913
+ };
914
+
915
+ public createStorefrontChangeRequest = (
916
+ payload?: StorefrontV2ChangeRequestPayload
917
+ ): Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}> => {
918
+ return this.storefrontV2Request(
919
+ this.storefrontV2DomainResource('requests/'),
920
+ 'POST',
921
+ payload
922
+ ) as Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}>;
923
+ };
924
+
925
+ public getStorefrontChangeRequest = (
926
+ requestId: number | string
927
+ ): Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}> => {
928
+ return this.storefrontV2Request(
929
+ `/storefront_change_requests/${String(requestId)}/`,
930
+ 'GET'
931
+ ) as Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}>;
932
+ };
933
+
934
+ public getStorefrontChangeRequestEvents = (
935
+ requestId: number | string
936
+ ): Promise<{requestId: number; events: StorefrontExecutionEvent[]}> => {
937
+ return this.storefrontV2Request(
938
+ `/storefront_change_requests/${String(requestId)}/events/`,
939
+ 'GET'
940
+ ) as Promise<{requestId: number; events: StorefrontExecutionEvent[]}>;
941
+ };
942
+
943
+ public runStorefrontChangeRequest = (
944
+ requestId: number | string,
945
+ payload?: StorefrontV2ChangeRequestRunPayload
946
+ ): Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}> => {
947
+ return this.storefrontV2Request(
948
+ `/storefront_change_requests/${String(requestId)}/run/`,
949
+ 'POST',
950
+ payload
951
+ ) as Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}>;
952
+ };
953
+
954
+ public approveStorefrontChangeRequest = (
955
+ requestId: number | string,
956
+ payload?: Record<string, any>
957
+ ): Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}> => {
958
+ return this.storefrontV2Request(
959
+ `/storefront_change_requests/${String(requestId)}/approve/`,
960
+ 'POST',
961
+ payload
962
+ ) as Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}>;
963
+ };
964
+
965
+ public rejectStorefrontChangeRequest = (
966
+ requestId: number | string,
967
+ payload?: StorefrontV2ChangeRequestRejectPayload
968
+ ): Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}> => {
969
+ return this.storefrontV2Request(
970
+ `/storefront_change_requests/${String(requestId)}/reject/`,
971
+ 'POST',
972
+ payload
973
+ ) as Promise<{storefrontChangeRequest: StorefrontV2ChangeRequest}>;
974
+ };
975
+
976
+ public getStorefrontV2Deployments = (): Promise<{deployments: StorefrontV2Deployment[]}> => {
977
+ return this.storefrontV2Request(
978
+ this.storefrontV2DomainResource('deployments/'),
979
+ 'GET'
980
+ ) as Promise<{deployments: StorefrontV2Deployment[]}>;
981
+ };
982
+
983
+ public getStorefrontV2DeploymentLogs = (
984
+ deploymentId: number | string
985
+ ): Promise<{deploymentId: string; logs: StorefrontV2DeploymentLog[]}> => {
986
+ return this.storefrontV2Request(
987
+ this.storefrontV2DomainResource(`deployments/${String(deploymentId)}/logs/`),
988
+ 'GET'
989
+ ) as Promise<{deploymentId: string; logs: StorefrontV2DeploymentLog[]}>;
990
+ };
991
+
992
+ public rollbackStorefrontV2 = (): Promise<{rollback: StorefrontV2RollbackResult}> => {
993
+ return this.storefrontV2Request(
994
+ this.storefrontV2DomainResource('rollback/'),
995
+ 'POST'
996
+ ) as Promise<{rollback: StorefrontV2RollbackResult}>;
997
+ };
998
+
999
+ public getStorefrontV2RepositoryTree = (input?: {
1000
+ path?: string;
1001
+ ref?: string;
1002
+ }): Promise<{repositoryTree: StorefrontV2RepositoryTree}> => {
1003
+ return this.storefrontV2Request(
1004
+ this.storefrontV2DomainResource('repository_tree/'),
1005
+ 'GET',
1006
+ undefined,
1007
+ input
1008
+ ) as Promise<{repositoryTree: StorefrontV2RepositoryTree}>;
1009
+ };
1010
+
1011
+ public getStorefrontV2RepositoryBranches = (): Promise<{
1012
+ repositoryBranches: StorefrontV2RepositoryBranches;
1013
+ }> => {
1014
+ return this.storefrontV2Request(
1015
+ this.storefrontV2DomainResource('repository_branches/'),
1016
+ 'GET'
1017
+ ) as Promise<{repositoryBranches: StorefrontV2RepositoryBranches}>;
1018
+ };
1019
+
1020
+ public getStorefrontV2RepositoryFile = (
1021
+ path: string,
1022
+ input?: {ref?: string}
1023
+ ): Promise<{repositoryFile: StorefrontV2RepositoryFile}> => {
1024
+ return this.storefrontV2Request(
1025
+ this.storefrontV2DomainResource('repository_file/'),
1026
+ 'GET',
1027
+ undefined,
1028
+ {path, ...input}
1029
+ ) as Promise<{repositoryFile: StorefrontV2RepositoryFile}>;
1030
+ };
1031
+
1032
+ public updateStorefrontV2RepositoryFile = (
1033
+ payload: StorefrontV2RepositoryFileUpdatePayload
1034
+ ): Promise<{repositoryFileUpdate: StorefrontV2RepositoryFileUpdate}> => {
1035
+ return this.storefrontV2Request(
1036
+ this.storefrontV2DomainResource('repository_file/'),
1037
+ 'POST',
1038
+ payload
1039
+ ) as Promise<{repositoryFileUpdate: StorefrontV2RepositoryFileUpdate}>;
1040
+ };
1041
+
1042
+ public getStorefrontV2ProductStatus = (
1043
+ productId: number
1044
+ ): Promise<{storefrontProductStatus: StorefrontV2ProductStatus}> => {
1045
+ return this.storefrontV2Request(
1046
+ this.storefrontV2DomainResource(`products/${String(productId)}/status/`),
1047
+ 'GET'
1048
+ ) as Promise<{storefrontProductStatus: StorefrontV2ProductStatus}>;
1049
+ };
1050
+
1051
+ public publishStorefrontV2Product = (
1052
+ payload?: StorefrontV2ProductPublishPayload
1053
+ ): Promise<{productPublish: StorefrontV2ProductPublishResult}> => {
1054
+ return this.storefrontV2Request(
1055
+ this.storefrontV2DomainResource('products/publish/'),
1056
+ 'POST',
1057
+ payload
1058
+ ) as Promise<{productPublish: StorefrontV2ProductPublishResult}>;
1059
+ };
1060
+
1061
+ public publishStorefrontV2Category = (
1062
+ payload?: StorefrontV2CategoryPublishPayload
1063
+ ): Promise<{categoryPublish: StorefrontV2CategoryPublishResult}> => {
1064
+ return this.storefrontV2Request(
1065
+ this.storefrontV2DomainResource('categories/publish/'),
1066
+ 'POST',
1067
+ payload
1068
+ ) as Promise<{categoryPublish: StorefrontV2CategoryPublishResult}>;
1069
+ };
1070
+
1071
+ public getAnalytics = (): Promise<DomainAnalyticsResponse> => {
1072
+ return this.storefrontV2Request(
1073
+ `/domains/${this.getDomainId()}/analytics/`,
1074
+ 'GET'
1075
+ ) as Promise<DomainAnalyticsResponse>;
1076
+ };
1077
+
1078
+ public getAgentTokenAnalytics = (
1079
+ queryParams?: Record<string, string | undefined>
1080
+ ): Promise<AgentTokenAnalyticsTimeseries> => {
1081
+ return this.storefrontV2Request(
1082
+ `/domains/${this.getDomainId()}/agent_token_analytics/`,
1083
+ 'GET',
1084
+ undefined,
1085
+ queryParams
1086
+ ) as Promise<AgentTokenAnalyticsTimeseries>;
1087
+ };
1088
+ }