@redneckz/wildless-cms-uni-blocks 0.14.669 → 0.14.671

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 (367) hide show
  1. package/bundle/api/RetailAPI/checkCaptcha.d.ts +1 -1
  2. package/bundle/api/RetailAPI/createCaptcha.d.ts +1 -1
  3. package/bundle/api/RetailAPI/createUserProfile.d.ts +1 -1
  4. package/bundle/api/RetailAPI/doRequest.d.ts +2 -1
  5. package/bundle/api/RetailAPI/getLink.d.ts +1 -1
  6. package/bundle/api/RetailAPI/getTaskStatus.d.ts +2 -3
  7. package/bundle/api/RetailAPI/regionOffices.d.ts +1 -1
  8. package/bundle/api/RetailAPI/sendCode.d.ts +1 -4
  9. package/bundle/api/RetailAPI/sendSignalToProcess.d.ts +1 -5
  10. package/bundle/api/RetailAPI/updateProfileEsia.d.ts +1 -1
  11. package/bundle/api/RetailAPI/updateUserProfile.d.ts +1 -1
  12. package/bundle/api/RetailAPI/updateUserTask.d.ts +1 -1
  13. package/bundle/bundle.umd.js +96 -98
  14. package/bundle/bundle.umd.min.js +1 -1
  15. package/dist/api/RetailAPI/checkCaptcha.d.ts +1 -1
  16. package/dist/api/RetailAPI/checkCaptcha.js +3 -1
  17. package/dist/api/RetailAPI/checkCaptcha.js.map +1 -1
  18. package/dist/api/RetailAPI/checkCode.js +5 -3
  19. package/dist/api/RetailAPI/checkCode.js.map +1 -1
  20. package/dist/api/RetailAPI/createCaptcha.d.ts +1 -1
  21. package/dist/api/RetailAPI/createCaptcha.js +1 -1
  22. package/dist/api/RetailAPI/createCaptcha.js.map +1 -1
  23. package/dist/api/RetailAPI/createDraftTask.js +4 -1
  24. package/dist/api/RetailAPI/createDraftTask.js.map +1 -1
  25. package/dist/api/RetailAPI/createUserProfile.d.ts +1 -1
  26. package/dist/api/RetailAPI/createUserProfile.js +1 -1
  27. package/dist/api/RetailAPI/createUserProfile.js.map +1 -1
  28. package/dist/api/RetailAPI/doRequest.d.ts +2 -1
  29. package/dist/api/RetailAPI/doRequest.js +13 -6
  30. package/dist/api/RetailAPI/doRequest.js.map +1 -1
  31. package/dist/api/RetailAPI/feedbackById.js +1 -1
  32. package/dist/api/RetailAPI/feedbackById.js.map +1 -1
  33. package/dist/api/RetailAPI/getLink.d.ts +1 -1
  34. package/dist/api/RetailAPI/getLink.js +1 -1
  35. package/dist/api/RetailAPI/getLink.js.map +1 -1
  36. package/dist/api/RetailAPI/getTaskStatus.d.ts +2 -3
  37. package/dist/api/RetailAPI/getTaskStatus.js +1 -1
  38. package/dist/api/RetailAPI/getTaskStatus.js.map +1 -1
  39. package/dist/api/RetailAPI/regionOffices.d.ts +1 -1
  40. package/dist/api/RetailAPI/regionOffices.js +9 -8
  41. package/dist/api/RetailAPI/regionOffices.js.map +1 -1
  42. package/dist/api/RetailAPI/sendCode.d.ts +1 -4
  43. package/dist/api/RetailAPI/sendCode.js +4 -1
  44. package/dist/api/RetailAPI/sendCode.js.map +1 -1
  45. package/dist/api/RetailAPI/sendSignalToProcess.d.ts +1 -5
  46. package/dist/api/RetailAPI/sendSignalToProcess.js.map +1 -1
  47. package/dist/api/RetailAPI/updateProfileEsia.d.ts +1 -1
  48. package/dist/api/RetailAPI/updateProfileEsia.js +1 -1
  49. package/dist/api/RetailAPI/updateProfileEsia.js.map +1 -1
  50. package/dist/api/RetailAPI/updateRefreshToken.js +4 -4
  51. package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
  52. package/dist/api/RetailAPI/updateUserProfile.d.ts +1 -1
  53. package/dist/api/RetailAPI/updateUserProfile.js +1 -1
  54. package/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
  55. package/dist/api/RetailAPI/updateUserTask.d.ts +1 -1
  56. package/dist/api/RetailAPI/updateUserTask.js +1 -1
  57. package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  58. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +1 -1
  59. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  60. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +5 -4
  61. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  62. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +4 -3
  63. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  64. package/dist/components/CreditForm/CreditFormStatusTracker.js +1 -1
  65. package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  66. package/dist/ui-kit/CaptchaDialog/CaptchaDialog.js +16 -5
  67. package/dist/ui-kit/CaptchaDialog/CaptchaDialog.js.map +1 -1
  68. package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  69. package/dist/ui-kit/FormField/Fields/AddressRetailField.js +2 -3
  70. package/dist/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  71. package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +17 -12
  72. package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  73. package/dist/ui-kit/YandexMap/YandexMap.js +3 -2
  74. package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
  75. package/lib/api/RetailAPI/checkCaptcha.d.ts +1 -1
  76. package/lib/api/RetailAPI/checkCaptcha.js +3 -1
  77. package/lib/api/RetailAPI/checkCaptcha.js.map +1 -1
  78. package/lib/api/RetailAPI/checkCode.js +6 -4
  79. package/lib/api/RetailAPI/checkCode.js.map +1 -1
  80. package/lib/api/RetailAPI/createCaptcha.d.ts +1 -1
  81. package/lib/api/RetailAPI/createCaptcha.js +1 -1
  82. package/lib/api/RetailAPI/createCaptcha.js.map +1 -1
  83. package/lib/api/RetailAPI/createDraftTask.js +5 -2
  84. package/lib/api/RetailAPI/createDraftTask.js.map +1 -1
  85. package/lib/api/RetailAPI/createUserProfile.d.ts +1 -1
  86. package/lib/api/RetailAPI/createUserProfile.js +2 -2
  87. package/lib/api/RetailAPI/createUserProfile.js.map +1 -1
  88. package/lib/api/RetailAPI/doRequest.d.ts +2 -1
  89. package/lib/api/RetailAPI/doRequest.js +11 -5
  90. package/lib/api/RetailAPI/doRequest.js.map +1 -1
  91. package/lib/api/RetailAPI/feedbackById.js +1 -1
  92. package/lib/api/RetailAPI/feedbackById.js.map +1 -1
  93. package/lib/api/RetailAPI/getLink.d.ts +1 -1
  94. package/lib/api/RetailAPI/getLink.js +2 -2
  95. package/lib/api/RetailAPI/getLink.js.map +1 -1
  96. package/lib/api/RetailAPI/getTaskStatus.d.ts +2 -3
  97. package/lib/api/RetailAPI/getTaskStatus.js +2 -2
  98. package/lib/api/RetailAPI/getTaskStatus.js.map +1 -1
  99. package/lib/api/RetailAPI/regionOffices.d.ts +1 -1
  100. package/lib/api/RetailAPI/regionOffices.js +8 -7
  101. package/lib/api/RetailAPI/regionOffices.js.map +1 -1
  102. package/lib/api/RetailAPI/sendCode.d.ts +1 -4
  103. package/lib/api/RetailAPI/sendCode.js +5 -2
  104. package/lib/api/RetailAPI/sendCode.js.map +1 -1
  105. package/lib/api/RetailAPI/sendSignalToProcess.d.ts +1 -5
  106. package/lib/api/RetailAPI/sendSignalToProcess.js.map +1 -1
  107. package/lib/api/RetailAPI/updateProfileEsia.d.ts +1 -1
  108. package/lib/api/RetailAPI/updateProfileEsia.js +2 -2
  109. package/lib/api/RetailAPI/updateProfileEsia.js.map +1 -1
  110. package/lib/api/RetailAPI/updateRefreshToken.js +4 -4
  111. package/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
  112. package/lib/api/RetailAPI/updateUserProfile.d.ts +1 -1
  113. package/lib/api/RetailAPI/updateUserProfile.js +2 -2
  114. package/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
  115. package/lib/api/RetailAPI/updateUserTask.d.ts +1 -1
  116. package/lib/api/RetailAPI/updateUserTask.js +2 -2
  117. package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  118. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +1 -1
  119. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  120. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +5 -4
  121. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  122. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +5 -4
  123. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  124. package/lib/components/CreditForm/CreditFormStatusTracker.js +1 -1
  125. package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  126. package/lib/ui-kit/CaptchaDialog/CaptchaDialog.js +17 -6
  127. package/lib/ui-kit/CaptchaDialog/CaptchaDialog.js.map +1 -1
  128. package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  129. package/lib/ui-kit/FormField/Fields/AddressRetailField.js +3 -4
  130. package/lib/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  131. package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +17 -12
  132. package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  133. package/lib/ui-kit/YandexMap/YandexMap.js +3 -2
  134. package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
  135. package/mobile/bundle/api/RetailAPI/checkCaptcha.d.ts +1 -1
  136. package/mobile/bundle/api/RetailAPI/createCaptcha.d.ts +1 -1
  137. package/mobile/bundle/api/RetailAPI/createUserProfile.d.ts +1 -1
  138. package/mobile/bundle/api/RetailAPI/doRequest.d.ts +2 -1
  139. package/mobile/bundle/api/RetailAPI/getLink.d.ts +1 -1
  140. package/mobile/bundle/api/RetailAPI/getTaskStatus.d.ts +2 -3
  141. package/mobile/bundle/api/RetailAPI/regionOffices.d.ts +1 -1
  142. package/mobile/bundle/api/RetailAPI/sendCode.d.ts +1 -4
  143. package/mobile/bundle/api/RetailAPI/sendSignalToProcess.d.ts +1 -5
  144. package/mobile/bundle/api/RetailAPI/updateProfileEsia.d.ts +1 -1
  145. package/mobile/bundle/api/RetailAPI/updateUserProfile.d.ts +1 -1
  146. package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +1 -1
  147. package/mobile/bundle/bundle.umd.js +96 -98
  148. package/mobile/bundle/bundle.umd.min.js +1 -1
  149. package/mobile/dist/api/RetailAPI/checkCaptcha.d.ts +1 -1
  150. package/mobile/dist/api/RetailAPI/checkCaptcha.js +3 -1
  151. package/mobile/dist/api/RetailAPI/checkCaptcha.js.map +1 -1
  152. package/mobile/dist/api/RetailAPI/checkCode.js +5 -3
  153. package/mobile/dist/api/RetailAPI/checkCode.js.map +1 -1
  154. package/mobile/dist/api/RetailAPI/createCaptcha.d.ts +1 -1
  155. package/mobile/dist/api/RetailAPI/createCaptcha.js +1 -1
  156. package/mobile/dist/api/RetailAPI/createCaptcha.js.map +1 -1
  157. package/mobile/dist/api/RetailAPI/createDraftTask.js +4 -1
  158. package/mobile/dist/api/RetailAPI/createDraftTask.js.map +1 -1
  159. package/mobile/dist/api/RetailAPI/createUserProfile.d.ts +1 -1
  160. package/mobile/dist/api/RetailAPI/createUserProfile.js +1 -1
  161. package/mobile/dist/api/RetailAPI/createUserProfile.js.map +1 -1
  162. package/mobile/dist/api/RetailAPI/doRequest.d.ts +2 -1
  163. package/mobile/dist/api/RetailAPI/doRequest.js +13 -6
  164. package/mobile/dist/api/RetailAPI/doRequest.js.map +1 -1
  165. package/mobile/dist/api/RetailAPI/feedbackById.js +1 -1
  166. package/mobile/dist/api/RetailAPI/feedbackById.js.map +1 -1
  167. package/mobile/dist/api/RetailAPI/getLink.d.ts +1 -1
  168. package/mobile/dist/api/RetailAPI/getLink.js +1 -1
  169. package/mobile/dist/api/RetailAPI/getLink.js.map +1 -1
  170. package/mobile/dist/api/RetailAPI/getTaskStatus.d.ts +2 -3
  171. package/mobile/dist/api/RetailAPI/getTaskStatus.js +1 -1
  172. package/mobile/dist/api/RetailAPI/getTaskStatus.js.map +1 -1
  173. package/mobile/dist/api/RetailAPI/regionOffices.d.ts +1 -1
  174. package/mobile/dist/api/RetailAPI/regionOffices.js +9 -8
  175. package/mobile/dist/api/RetailAPI/regionOffices.js.map +1 -1
  176. package/mobile/dist/api/RetailAPI/sendCode.d.ts +1 -4
  177. package/mobile/dist/api/RetailAPI/sendCode.js +4 -1
  178. package/mobile/dist/api/RetailAPI/sendCode.js.map +1 -1
  179. package/mobile/dist/api/RetailAPI/sendSignalToProcess.d.ts +1 -5
  180. package/mobile/dist/api/RetailAPI/sendSignalToProcess.js.map +1 -1
  181. package/mobile/dist/api/RetailAPI/updateProfileEsia.d.ts +1 -1
  182. package/mobile/dist/api/RetailAPI/updateProfileEsia.js +1 -1
  183. package/mobile/dist/api/RetailAPI/updateProfileEsia.js.map +1 -1
  184. package/mobile/dist/api/RetailAPI/updateRefreshToken.js +4 -4
  185. package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
  186. package/mobile/dist/api/RetailAPI/updateUserProfile.d.ts +1 -1
  187. package/mobile/dist/api/RetailAPI/updateUserProfile.js +1 -1
  188. package/mobile/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
  189. package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +1 -1
  190. package/mobile/dist/api/RetailAPI/updateUserTask.js +1 -1
  191. package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  192. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +1 -1
  193. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  194. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +5 -4
  195. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  196. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +4 -3
  197. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  198. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +1 -1
  199. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  200. package/mobile/dist/ui-kit/CaptchaDialog/CaptchaDialog.js +16 -5
  201. package/mobile/dist/ui-kit/CaptchaDialog/CaptchaDialog.js.map +1 -1
  202. package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  203. package/mobile/dist/ui-kit/FormField/Fields/AddressRetailField.js +2 -3
  204. package/mobile/dist/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  205. package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +17 -12
  206. package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  207. package/mobile/dist/ui-kit/YandexMap/YandexMap.js +3 -2
  208. package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
  209. package/mobile/lib/api/RetailAPI/checkCaptcha.d.ts +1 -1
  210. package/mobile/lib/api/RetailAPI/checkCaptcha.js +3 -1
  211. package/mobile/lib/api/RetailAPI/checkCaptcha.js.map +1 -1
  212. package/mobile/lib/api/RetailAPI/checkCode.js +6 -4
  213. package/mobile/lib/api/RetailAPI/checkCode.js.map +1 -1
  214. package/mobile/lib/api/RetailAPI/createCaptcha.d.ts +1 -1
  215. package/mobile/lib/api/RetailAPI/createCaptcha.js +1 -1
  216. package/mobile/lib/api/RetailAPI/createCaptcha.js.map +1 -1
  217. package/mobile/lib/api/RetailAPI/createDraftTask.js +5 -2
  218. package/mobile/lib/api/RetailAPI/createDraftTask.js.map +1 -1
  219. package/mobile/lib/api/RetailAPI/createUserProfile.d.ts +1 -1
  220. package/mobile/lib/api/RetailAPI/createUserProfile.js +2 -2
  221. package/mobile/lib/api/RetailAPI/createUserProfile.js.map +1 -1
  222. package/mobile/lib/api/RetailAPI/doRequest.d.ts +2 -1
  223. package/mobile/lib/api/RetailAPI/doRequest.js +11 -5
  224. package/mobile/lib/api/RetailAPI/doRequest.js.map +1 -1
  225. package/mobile/lib/api/RetailAPI/feedbackById.js +1 -1
  226. package/mobile/lib/api/RetailAPI/feedbackById.js.map +1 -1
  227. package/mobile/lib/api/RetailAPI/getLink.d.ts +1 -1
  228. package/mobile/lib/api/RetailAPI/getLink.js +2 -2
  229. package/mobile/lib/api/RetailAPI/getLink.js.map +1 -1
  230. package/mobile/lib/api/RetailAPI/getTaskStatus.d.ts +2 -3
  231. package/mobile/lib/api/RetailAPI/getTaskStatus.js +2 -2
  232. package/mobile/lib/api/RetailAPI/getTaskStatus.js.map +1 -1
  233. package/mobile/lib/api/RetailAPI/regionOffices.d.ts +1 -1
  234. package/mobile/lib/api/RetailAPI/regionOffices.js +8 -7
  235. package/mobile/lib/api/RetailAPI/regionOffices.js.map +1 -1
  236. package/mobile/lib/api/RetailAPI/sendCode.d.ts +1 -4
  237. package/mobile/lib/api/RetailAPI/sendCode.js +5 -2
  238. package/mobile/lib/api/RetailAPI/sendCode.js.map +1 -1
  239. package/mobile/lib/api/RetailAPI/sendSignalToProcess.d.ts +1 -5
  240. package/mobile/lib/api/RetailAPI/sendSignalToProcess.js.map +1 -1
  241. package/mobile/lib/api/RetailAPI/updateProfileEsia.d.ts +1 -1
  242. package/mobile/lib/api/RetailAPI/updateProfileEsia.js +2 -2
  243. package/mobile/lib/api/RetailAPI/updateProfileEsia.js.map +1 -1
  244. package/mobile/lib/api/RetailAPI/updateRefreshToken.js +4 -4
  245. package/mobile/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
  246. package/mobile/lib/api/RetailAPI/updateUserProfile.d.ts +1 -1
  247. package/mobile/lib/api/RetailAPI/updateUserProfile.js +2 -2
  248. package/mobile/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
  249. package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +1 -1
  250. package/mobile/lib/api/RetailAPI/updateUserTask.js +2 -2
  251. package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  252. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +1 -1
  253. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  254. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +5 -4
  255. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  256. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +5 -4
  257. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  258. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +1 -1
  259. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  260. package/mobile/lib/ui-kit/CaptchaDialog/CaptchaDialog.js +17 -6
  261. package/mobile/lib/ui-kit/CaptchaDialog/CaptchaDialog.js.map +1 -1
  262. package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  263. package/mobile/lib/ui-kit/FormField/Fields/AddressRetailField.js +3 -4
  264. package/mobile/lib/ui-kit/FormField/Fields/AddressRetailField.js.map +1 -1
  265. package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +17 -12
  266. package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  267. package/mobile/lib/ui-kit/YandexMap/YandexMap.js +3 -2
  268. package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
  269. package/mobile/src/api/RetailAPI/checkCaptcha.ts +3 -1
  270. package/mobile/src/api/RetailAPI/checkCode.ts +7 -5
  271. package/mobile/src/api/RetailAPI/createCaptcha.ts +3 -1
  272. package/mobile/src/api/RetailAPI/createDraftTask.ts +12 -3
  273. package/mobile/src/api/RetailAPI/createUserProfile.ts +4 -2
  274. package/mobile/src/api/RetailAPI/doRequest.ts +19 -9
  275. package/mobile/src/api/RetailAPI/feedbackById.ts +2 -2
  276. package/mobile/src/api/RetailAPI/getLink.ts +2 -2
  277. package/mobile/src/api/RetailAPI/getTaskStatus.ts +3 -3
  278. package/mobile/src/api/RetailAPI/regionOffices.ts +18 -12
  279. package/mobile/src/api/RetailAPI/sendCode.ts +14 -2
  280. package/mobile/src/api/RetailAPI/sendSignalToProcess.ts +1 -6
  281. package/mobile/src/api/RetailAPI/updateProfileEsia.ts +2 -2
  282. package/mobile/src/api/RetailAPI/updateRefreshToken.ts +6 -6
  283. package/mobile/src/api/RetailAPI/updateUserProfile.ts +2 -2
  284. package/mobile/src/api/RetailAPI/updateUserTask.ts +2 -2
  285. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +3 -3
  286. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +5 -4
  287. package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +9 -8
  288. package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +1 -1
  289. package/mobile/src/ui-kit/CaptchaDialog/CaptchaDialog.tsx +20 -12
  290. package/mobile/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +1 -0
  291. package/mobile/src/ui-kit/FormField/Fields/AddressRetailField.tsx +3 -4
  292. package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +18 -13
  293. package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +4 -2
  294. package/package.json +1 -1
  295. package/src/api/RetailAPI/checkCaptcha.ts +3 -1
  296. package/src/api/RetailAPI/checkCode.ts +7 -5
  297. package/src/api/RetailAPI/createCaptcha.ts +3 -1
  298. package/src/api/RetailAPI/createDraftTask.ts +12 -3
  299. package/src/api/RetailAPI/createUserProfile.ts +4 -2
  300. package/src/api/RetailAPI/doRequest.ts +19 -9
  301. package/src/api/RetailAPI/feedbackById.ts +2 -2
  302. package/src/api/RetailAPI/getLink.ts +2 -2
  303. package/src/api/RetailAPI/getTaskStatus.ts +3 -3
  304. package/src/api/RetailAPI/regionOffices.ts +18 -12
  305. package/src/api/RetailAPI/sendCode.ts +14 -2
  306. package/src/api/RetailAPI/sendSignalToProcess.ts +1 -6
  307. package/src/api/RetailAPI/updateProfileEsia.ts +2 -2
  308. package/src/api/RetailAPI/updateRefreshToken.ts +6 -6
  309. package/src/api/RetailAPI/updateUserProfile.ts +2 -2
  310. package/src/api/RetailAPI/updateUserTask.ts +2 -2
  311. package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +3 -3
  312. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +5 -4
  313. package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +9 -8
  314. package/src/components/CreditForm/CreditFormStatusTracker.tsx +1 -1
  315. package/src/ui-kit/CaptchaDialog/CaptchaDialog.tsx +20 -12
  316. package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +1 -0
  317. package/src/ui-kit/FormField/Fields/AddressRetailField.tsx +3 -4
  318. package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +18 -13
  319. package/src/ui-kit/YandexMap/YandexMap.tsx +4 -2
  320. package/bundle/ui-kit/CaptchaDialog/handleCheckCaptcha.d.ts +0 -8
  321. package/bundle/ui-kit/CaptchaDialog/handleCreateCaptcha.d.ts +0 -1
  322. package/bundle/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +0 -15
  323. package/dist/ui-kit/CaptchaDialog/handleCheckCaptcha.d.ts +0 -8
  324. package/dist/ui-kit/CaptchaDialog/handleCheckCaptcha.js +0 -16
  325. package/dist/ui-kit/CaptchaDialog/handleCheckCaptcha.js.map +0 -1
  326. package/dist/ui-kit/CaptchaDialog/handleCreateCaptcha.d.ts +0 -1
  327. package/dist/ui-kit/CaptchaDialog/handleCreateCaptcha.js +0 -9
  328. package/dist/ui-kit/CaptchaDialog/handleCreateCaptcha.js.map +0 -1
  329. package/dist/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +0 -15
  330. package/dist/ui-kit/VerifyPhoneDialog/handleSendCode.js +0 -25
  331. package/dist/ui-kit/VerifyPhoneDialog/handleSendCode.js.map +0 -1
  332. package/lib/ui-kit/CaptchaDialog/handleCheckCaptcha.d.ts +0 -8
  333. package/lib/ui-kit/CaptchaDialog/handleCheckCaptcha.js +0 -13
  334. package/lib/ui-kit/CaptchaDialog/handleCheckCaptcha.js.map +0 -1
  335. package/lib/ui-kit/CaptchaDialog/handleCreateCaptcha.d.ts +0 -1
  336. package/lib/ui-kit/CaptchaDialog/handleCreateCaptcha.js +0 -6
  337. package/lib/ui-kit/CaptchaDialog/handleCreateCaptcha.js.map +0 -1
  338. package/lib/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +0 -15
  339. package/lib/ui-kit/VerifyPhoneDialog/handleSendCode.js +0 -22
  340. package/lib/ui-kit/VerifyPhoneDialog/handleSendCode.js.map +0 -1
  341. package/mobile/bundle/ui-kit/CaptchaDialog/handleCheckCaptcha.d.ts +0 -8
  342. package/mobile/bundle/ui-kit/CaptchaDialog/handleCreateCaptcha.d.ts +0 -1
  343. package/mobile/bundle/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +0 -15
  344. package/mobile/dist/ui-kit/CaptchaDialog/handleCheckCaptcha.d.ts +0 -8
  345. package/mobile/dist/ui-kit/CaptchaDialog/handleCheckCaptcha.js +0 -16
  346. package/mobile/dist/ui-kit/CaptchaDialog/handleCheckCaptcha.js.map +0 -1
  347. package/mobile/dist/ui-kit/CaptchaDialog/handleCreateCaptcha.d.ts +0 -1
  348. package/mobile/dist/ui-kit/CaptchaDialog/handleCreateCaptcha.js +0 -9
  349. package/mobile/dist/ui-kit/CaptchaDialog/handleCreateCaptcha.js.map +0 -1
  350. package/mobile/dist/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +0 -15
  351. package/mobile/dist/ui-kit/VerifyPhoneDialog/handleSendCode.js +0 -25
  352. package/mobile/dist/ui-kit/VerifyPhoneDialog/handleSendCode.js.map +0 -1
  353. package/mobile/lib/ui-kit/CaptchaDialog/handleCheckCaptcha.d.ts +0 -8
  354. package/mobile/lib/ui-kit/CaptchaDialog/handleCheckCaptcha.js +0 -13
  355. package/mobile/lib/ui-kit/CaptchaDialog/handleCheckCaptcha.js.map +0 -1
  356. package/mobile/lib/ui-kit/CaptchaDialog/handleCreateCaptcha.d.ts +0 -1
  357. package/mobile/lib/ui-kit/CaptchaDialog/handleCreateCaptcha.js +0 -6
  358. package/mobile/lib/ui-kit/CaptchaDialog/handleCreateCaptcha.js.map +0 -1
  359. package/mobile/lib/ui-kit/VerifyPhoneDialog/handleSendCode.d.ts +0 -15
  360. package/mobile/lib/ui-kit/VerifyPhoneDialog/handleSendCode.js +0 -22
  361. package/mobile/lib/ui-kit/VerifyPhoneDialog/handleSendCode.js.map +0 -1
  362. package/mobile/src/ui-kit/CaptchaDialog/handleCheckCaptcha.ts +0 -25
  363. package/mobile/src/ui-kit/CaptchaDialog/handleCreateCaptcha.ts +0 -9
  364. package/mobile/src/ui-kit/VerifyPhoneDialog/handleSendCode.ts +0 -43
  365. package/src/ui-kit/CaptchaDialog/handleCheckCaptcha.ts +0 -25
  366. package/src/ui-kit/CaptchaDialog/handleCreateCaptcha.ts +0 -9
  367. package/src/ui-kit/VerifyPhoneDialog/handleSendCode.ts +0 -43
@@ -1,5 +1,5 @@
1
1
  import { type Option } from '../../ui-kit/Select/Option';
2
- import { doRequest } from './doRequest';
2
+ import { fetchRetailJSON } from './doRequest';
3
3
 
4
4
  type ParticipantAddress = {
5
5
  addressType: {
@@ -140,4 +140,4 @@ export type CreateUserProfileResponse = {
140
140
  };
141
141
 
142
142
  export const updateUserTask = (body: UpdateUserTaskBody) =>
143
- doRequest<CreateUserProfileResponse>('/user-data/updateUserTask', 'PUT', body);
143
+ fetchRetailJSON<CreateUserProfileResponse>('/user-data/updateUserTask', 'PUT', body);
@@ -52,9 +52,7 @@ export const useApplicationLeadApi = ({
52
52
  }
53
53
 
54
54
  try {
55
- const {
56
- profile: { id: profileId },
57
- } = await createUserProfile({
55
+ const profileId = await createUserProfile({
58
56
  profile: { phone: formatPhone(formData.phone as string) },
59
57
  });
60
58
 
@@ -111,6 +109,7 @@ const updateUserData = async ({
111
109
  const transformedForm = transformOtherConsentsField(formData);
112
110
 
113
111
  await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
112
+
114
113
  const { taskId, participantId } = await createDraftTask({
115
114
  profileId,
116
115
  programId,
@@ -124,6 +123,7 @@ const updateUserData = async ({
124
123
  formData: transformedForm,
125
124
  }),
126
125
  );
126
+
127
127
  saveUserData(participantId, taskId, profileId);
128
128
  saveForm(formData);
129
129
  };
@@ -22,10 +22,11 @@ export const useInitApplicationLead = (nextStepLink: string) => {
22
22
  redirectUri: globalThis.location?.href,
23
23
  });
24
24
 
25
- setLeadForm({
26
- ...leadForm,
27
- ...parseEsiaProfile(data),
28
- });
25
+ data &&
26
+ setLeadForm({
27
+ ...leadForm,
28
+ ...parseEsiaProfile(data),
29
+ });
29
30
 
30
31
  globalThis.location.href = nextStepLink;
31
32
  }
@@ -1,5 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { getTaskStatus, STATUS_TYPE } from '../../api/RetailAPI/getTaskStatus';
4
4
  import { sendSignalToProcess, type SignalType } from '../../api/RetailAPI/sendSignalToProcess';
5
5
  import { useLocalStorage } from '../../hooks/useLocalStorage';
@@ -24,13 +24,14 @@ export const CreditCardFormStatusTracker = JSX(() => {
24
24
  }
25
25
  })();
26
26
 
27
- const trackStatus = () =>
28
- getTaskStatus({ taskId }).then((res) => {
29
- if (res.statusCd && res.statusCd !== STATUS_TYPE.process) {
30
- clearInterval(pullingInterval);
31
- setStatus(res.statusCd);
32
- }
33
- });
27
+ const trackStatus = useCallback(async () => {
28
+ const res = await getTaskStatus({ taskId });
29
+
30
+ if (res && res?.statusCd !== STATUS_TYPE.process) {
31
+ clearInterval(pullingInterval);
32
+ setStatus(res.statusCd);
33
+ }
34
+ }, []);
34
35
 
35
36
  const pullingInterval = setInterval(trackStatus, 30000);
36
37
  }, []);
@@ -27,7 +27,7 @@ export const CreditFormStatusTracker = JSX(() => {
27
27
  const trackStatus = () =>
28
28
  taskId &&
29
29
  getTaskStatus({ taskId }).then((res) => {
30
- if (res.statusCd && res.statusCd !== STATUS_TYPE.process) {
30
+ if (res?.statusCd && res.statusCd !== STATUS_TYPE.process) {
31
31
  clearInterval(pullingInterval);
32
32
  setStatus(res.statusCd);
33
33
  }
@@ -1,12 +1,12 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
2
+ import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { checkCaptcha } from '../../api/RetailAPI/checkCaptcha';
4
+ import { createCaptcha } from '../../api/RetailAPI/createCaptcha';
3
5
  import { Button } from '../Button/Button';
4
6
  import { Dialog } from '../DialogManager/Dialog';
5
7
  import { Icon } from '../Icon/Icon';
6
8
  import { Input } from '../Input/Input';
7
9
  import { Logo } from '../Logo/Logo';
8
- import { handleCheckCaptcha } from './handleCheckCaptcha';
9
- import { handleCreateCaptcha } from './handleCreateCaptcha';
10
10
 
11
11
  export interface CaptchaDialogProps {
12
12
  phoneNumber: string;
@@ -21,10 +21,23 @@ export const CaptchaDialog = JSX<CaptchaDialogProps>(
21
21
  const [code, setCode] = useState('');
22
22
  const [hasError, setHasError] = useState(false);
23
23
 
24
- useEffect(() => {
25
- handleCreateCaptcha(setCaptcha, phoneNumber);
24
+ const handleCheckCaptcha = useCallback(async () => {
25
+ const isValidCode = await checkCaptcha({ captchaText: code });
26
+
27
+ if (isValidCode) {
28
+ sendCode?.();
29
+ close?.();
30
+ } else {
31
+ setHasError(isValidCode);
32
+ }
33
+ }, []);
34
+
35
+ const handleCreateCaptcha = useCallback(() => {
36
+ (async () => setCaptcha(URL.createObjectURL(await createCaptcha(phoneNumber))))();
26
37
  }, []);
27
38
 
39
+ useEffect(handleCreateCaptcha, []);
40
+
28
41
  return (
29
42
  <Dialog
30
43
  head={<Logo />}
@@ -35,7 +48,7 @@ export const CaptchaDialog = JSX<CaptchaDialogProps>(
35
48
  <div className="flex h-36 w-72">
36
49
  <img className="grow" src={captcha}></img>
37
50
  <div
38
- onClick={() => handleCreateCaptcha(setCaptcha, phoneNumber)}
51
+ onClick={handleCreateCaptcha}
39
52
  className="flex w-8 items-center justify-center cursor-pointer"
40
53
  >
41
54
  <Icon iconVersion="normal" name="RefreshIcon" />
@@ -52,12 +65,7 @@ export const CaptchaDialog = JSX<CaptchaDialogProps>(
52
65
  <Button onClick={close} version="secondary">
53
66
  Вернуться
54
67
  </Button>
55
- <Button
56
- type="submit"
57
- disabled={!code}
58
- onClick={() => handleCheckCaptcha({ code, setHasError, close, sendCode })}
59
- version="secondary"
60
- >
68
+ <Button type="submit" disabled={!code} onClick={handleCheckCaptcha} version="secondary">
61
69
  Отправить
62
70
  </Button>
63
71
  </div>
@@ -14,6 +14,7 @@ export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(function ({ handleClose
14
14
  const resp = await getLink({
15
15
  redirectUri: globalThis.location.href,
16
16
  });
17
+
17
18
  if (resp) {
18
19
  globalThis.location.href = resp.link;
19
20
  }
@@ -1,6 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
- import { regionOffices, type OfficeType } from '../../../api/RetailAPI/regionOffices';
3
+ import { fetchRegionOffices, type OfficeType } from '../../../api/RetailAPI/regionOffices';
4
4
  import { getOfficePoint } from '../../../components/OfficesAtmsMap/renderOfficeCard';
5
5
  import { useOfficesAtmsMapData } from '../../../components/OfficesAtmsMap/useOfficesAtmsMapData';
6
6
  import { useLeadFormData } from '../../../hooks/useLeadFormData';
@@ -21,9 +21,8 @@ export const AddressRetailField = JSX<CustomFieldProps>(({ field, input }) => {
21
21
 
22
22
  useEffect(() => {
23
23
  (async () => {
24
- const officesList = await regionOffices((regionValue?.key as string) ?? '');
25
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
26
- setOffices(officesList || []);
24
+ const officesList = await fetchRegionOffices((regionValue?.key as string) ?? '');
25
+ setOffices(officesList);
27
26
  })();
28
27
 
29
28
  if (regionValue?.key) {
@@ -1,5 +1,6 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { sendCode } from '../../api/RetailAPI/sendCode';
3
4
  import { Headline } from '../../components/Headline/Headline';
4
5
  import { noop } from '../../utils/noop';
5
6
  import { useCaptchaDialog } from '../CaptchaDialog/useCaptchaDialog';
@@ -8,7 +9,6 @@ import { LinkButton } from '../LinkButton/LinkButton';
8
9
  import { Loader } from '../Loader/Loader';
9
10
  import { RichText } from '../RichText/RichText';
10
11
  import { Timer } from '../TimerCircle/Timer';
11
- import { handleSendCode } from './handleSendCode';
12
12
  import { InputCode } from './InputCode';
13
13
  import { SubmitButton } from './SubmitButton';
14
14
  import { useVerifyPhoneDialogSubmit } from './useVerifyPhoneDialogSubmit';
@@ -51,19 +51,24 @@ export const VerifyPhoneDialog = JSX<VerifyPhoneDialogProps>(
51
51
  setAttemps,
52
52
  } = useVerifyPhoneDialogSubmit({ values, close });
53
53
 
54
- const sendCode = useCallback(() => {
55
- handleSendCode({
56
- phoneNumber,
57
- captchaDialog,
58
- setTimeNextReq,
59
- setIsTimerStarted,
60
- setAttemps,
54
+ const handleSendCode = useCallback(async () => {
55
+ const isSuccessSendCode = await sendCode({
56
+ phoneNumber: phoneNumber,
57
+ smsCodesSetName: { key: 'AUTHENTICATION' },
61
58
  });
59
+
60
+ if (isSuccessSendCode) {
61
+ setAttemps(0);
62
+ setTimeNextReq(180);
63
+ setIsTimerStarted(true);
64
+ } else {
65
+ captchaDialog.open();
66
+ }
62
67
  }, []);
63
- const captchaDialog = useCaptchaDialog({ phoneNumber, sendCode }, onClose);
68
+ const captchaDialog = useCaptchaDialog({ phoneNumber, sendCode: handleSendCode }, onClose);
64
69
 
65
70
  useEffect(() => {
66
- sendCode();
71
+ handleSendCode();
67
72
  }, []);
68
73
 
69
74
  return (
@@ -85,7 +90,7 @@ export const VerifyPhoneDialog = JSX<VerifyPhoneDialogProps>(
85
90
  hasError={hasError}
86
91
  />
87
92
  ) : null}
88
- {renderText(timeNextReq, setTimeNextReq, sendCode)}
93
+ {renderText(timeNextReq, setTimeNextReq, handleSendCode)}
89
94
 
90
95
  <RichText itemSize="list-s" __html={__html} />
91
96
 
@@ -106,7 +111,7 @@ const renderTextButton = (textButton: string, isDisabled: boolean, handleSubmit:
106
111
  const renderText = (
107
112
  timeNextReq: number,
108
113
  setTimeNextReq: React.Dispatch<React.SetStateAction<number>>,
109
- sendCode: () => void,
114
+ handleSendCode: () => void,
110
115
  ) =>
111
116
  timeNextReq ? (
112
117
  <div className="flex flex-row text-l font-light text-base">
@@ -114,7 +119,7 @@ const renderText = (
114
119
  <Timer className="text-base ml-1" time={timeNextReq} setTime={setTimeNextReq} />
115
120
  </div>
116
121
  ) : (
117
- <LinkButton onClick={sendCode} className="text-primary-main">
122
+ <LinkButton onClick={handleSendCode} className="text-primary-main">
118
123
  Получить новый код
119
124
  </LinkButton>
120
125
  );
@@ -27,6 +27,8 @@ export const DEFAULT_CENTER_COORDS = [55.753995, 37.614069];
27
27
  export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5, isLoad }) => {
28
28
  const map = useRef<ymaps.Map | null>(null);
29
29
 
30
+ const parentDiv = useRef<HTMLElement>(null);
31
+
30
32
  const yandexMaps = useYandexMaps();
31
33
 
32
34
  useEffect(() => {
@@ -41,7 +43,7 @@ export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5
41
43
  return;
42
44
  }
43
45
 
44
- map.current = new yandexMaps.Map('map', {
46
+ map.current = new yandexMaps.Map(parentDiv.current, {
45
47
  center: getCenterPoint(points),
46
48
  zoom,
47
49
  controls: [],
@@ -60,7 +62,7 @@ export const YandexMap = JSX<YandexMapProps>(({ points, className = '', zoom = 5
60
62
  const zIndex = 'z-10';
61
63
 
62
64
  return (
63
- <div id="map" className={style('relative', 'w-full', className)}>
65
+ <div ref={parentDiv} className={style('relative', 'w-full', className)}>
64
66
  {isLoad ? <Loader /> : null}
65
67
  <div
66
68
  className={style(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.669",
3
+ "version": "0.14.671",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -5,4 +5,6 @@ export type CapchaTextType = {
5
5
  };
6
6
 
7
7
  export const checkCaptcha = (body: CapchaTextType) =>
8
- doRequest<Response>('/sms/checkCaptcha', 'POST', body);
8
+ doRequest('/sms/checkCaptcha', 'POST', body)
9
+ .then((res) => res.text())
10
+ .then((text) => text !== 'ERROR');
@@ -1,4 +1,4 @@
1
- import { doRequest } from './doRequest';
1
+ import { fetchRetailJSON } from './doRequest';
2
2
 
3
3
  export type CheckCodeBody = {
4
4
  smsText: string;
@@ -14,9 +14,11 @@ export type CheckCodeResponse = {
14
14
  };
15
15
 
16
16
  export const checkCode = async (body: CheckCodeBody) =>
17
- doRequest<CheckCodeResponse>('/sms/checkCode', 'POST', body).then(saveToken);
17
+ fetchRetailJSON<CheckCodeResponse>('/sms/checkCode', 'POST', body).then(saveToken);
18
18
 
19
- const saveToken = (data: CheckCodeResponse) => {
20
- globalThis.sessionStorage.setItem('accessToken', data.access_token);
21
- globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
19
+ const saveToken = (data: CheckCodeResponse | null) => {
20
+ if (data) {
21
+ globalThis.sessionStorage.setItem('accessToken', data.access_token);
22
+ globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
23
+ }
22
24
  };
@@ -1,4 +1,6 @@
1
1
  import { doRequest } from './doRequest';
2
2
 
3
3
  export const createCaptcha = (phoneNumber: string) =>
4
- doRequest<Response>(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(phoneNumber)}`, 'GET');
4
+ doRequest(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(phoneNumber)}`, 'GET').then(
5
+ async (res) => (res ? await res.blob() : new Blob()),
6
+ );
@@ -1,4 +1,4 @@
1
- import { doRequest } from './doRequest';
1
+ import { fetchRetailJSON } from './doRequest';
2
2
 
3
3
  export type CreateDraftTaskBody = {
4
4
  profileId: number;
@@ -10,5 +10,14 @@ export type CreateDraftTaskResponse = {
10
10
  participantId: number;
11
11
  };
12
12
 
13
- export const createDraftTask = (body: CreateDraftTaskBody) =>
14
- doRequest<CreateDraftTaskResponse>('/user-data/createDraftTask', 'POST', body);
13
+ export const createDraftTask = async (
14
+ body: CreateDraftTaskBody,
15
+ ): Promise<CreateDraftTaskResponse> => {
16
+ const res = await fetchRetailJSON<CreateDraftTaskResponse>(
17
+ '/user-data/createDraftTask',
18
+ 'POST',
19
+ body,
20
+ );
21
+
22
+ return res || ({} as CreateDraftTaskResponse);
23
+ };
@@ -1,4 +1,4 @@
1
- import { doRequest } from './doRequest';
1
+ import { fetchRetailJSON } from './doRequest';
2
2
 
3
3
  export interface RetailUserProfile {
4
4
  id?: number;
@@ -10,4 +10,6 @@ interface CreateUserProfileType {
10
10
  }
11
11
 
12
12
  export const createUserProfile = (body: CreateUserProfileType) =>
13
- doRequest<CreateUserProfileType>('/public-data/createUserProfile', 'POST', body);
13
+ fetchRetailJSON<CreateUserProfileType>('/public-data/createUserProfile', 'POST', body).then(
14
+ (res) => res?.profile?.id || null,
15
+ );
@@ -1,11 +1,27 @@
1
1
  import { API_BASE_URI } from '../apiBaseUrl';
2
2
 
3
- export async function doRequest<R>(
3
+ export const fetchRetailJSON = async <R>(
4
4
  url: string,
5
5
  method: 'POST' | 'GET' | 'PUT',
6
6
  body?: any,
7
- ): Promise<R> {
8
- const response = await fetch(`${API_BASE_URI}${url}`, {
7
+ ): Promise<R | null> => {
8
+ try {
9
+ const response = await doRequest(url, method, body);
10
+
11
+ return response.json();
12
+ } catch (err) {
13
+ console.error(err);
14
+
15
+ return null;
16
+ }
17
+ };
18
+
19
+ export async function doRequest(
20
+ url: string,
21
+ method: 'POST' | 'GET' | 'PUT',
22
+ body?: any,
23
+ ): Promise<Response> {
24
+ return await fetch(`${API_BASE_URI}${url}`, {
9
25
  method,
10
26
  headers: {
11
27
  'Content-Type': 'application/json',
@@ -14,14 +30,8 @@ export async function doRequest<R>(
14
30
  credentials: 'include',
15
31
  body: body ? JSON.stringify(body) : null,
16
32
  });
17
-
18
- // TODO: add error handling
19
- return isJSON(response) ? response.json() : response;
20
33
  }
21
34
 
22
- // TODO: Need delete isJSON
23
- const isJSON = (response: Response) => response.headers.get('Content-Type') === 'application/json';
24
-
25
35
  const getAuthorizationHeaders = () => {
26
36
  const token = sessionStorage.getItem('accessToken');
27
37
 
@@ -1,10 +1,10 @@
1
1
  import { doRequest } from './doRequest';
2
2
 
3
3
  export const feedbackById = async (id: number, convertToPng = false) => {
4
- const response: Response = await doRequest(
4
+ const response = await doRequest(
5
5
  `/feedback/file?id=${encodeURIComponent(id)}&convertToPngFlg=${convertToPng}`,
6
6
  'GET',
7
7
  );
8
8
 
9
- return await response.blob();
9
+ return response ? await response.blob() : new Blob();
10
10
  };
@@ -1,4 +1,4 @@
1
- import { doRequest } from './doRequest';
1
+ import { fetchRetailJSON } from './doRequest';
2
2
 
3
3
  export type GetLinkBody = {
4
4
  redirectUri: string;
@@ -9,4 +9,4 @@ export type GetLinkResponse = {
9
9
  };
10
10
 
11
11
  export const getLink = (body: GetLinkBody) =>
12
- doRequest<GetLinkResponse>('/esia/getLink', 'POST', body);
12
+ fetchRetailJSON<GetLinkResponse>('/esia/getLink', 'POST', body);
@@ -1,4 +1,4 @@
1
- import { doRequest } from './doRequest';
1
+ import { fetchRetailJSON } from './doRequest';
2
2
 
3
3
  export enum STATUS_TYPE {
4
4
  process = 'IN_PROCESS',
@@ -7,10 +7,10 @@ export enum STATUS_TYPE {
7
7
  rework = 'REVISION',
8
8
  }
9
9
 
10
- interface GetTaskStatusResponse {
10
+ export interface GetTaskStatusResponse {
11
11
  statusCd: STATUS_TYPE;
12
12
  taskId: number;
13
13
  }
14
14
 
15
15
  export const getTaskStatus = (body: { taskId: number | null }) =>
16
- doRequest<GetTaskStatusResponse>('/user-data/getTaskStatus', 'POST', body);
16
+ fetchRetailJSON<GetTaskStatusResponse>('/user-data/getTaskStatus', 'POST', body);
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_CENTER_COORDS } from './../../ui-kit/YandexMap/YandexMap';
2
- import { doRequest } from './doRequest';
2
+ import { fetchRetailJSON } from './doRequest';
3
3
 
4
4
  export type OfficeType = {
5
5
  address?: string;
@@ -18,19 +18,25 @@ export interface RegionOfficesResponseType {
18
18
  offices: OfficeType[];
19
19
  }
20
20
 
21
- export const regionOffices = async (regionKey: string) => {
22
- const response: Response = await doRequest('/public-data/regionOffices', 'POST', {
23
- regionRfCd: {
24
- key: regionKey,
21
+ export const fetchRegionOffices = async (regionKey: string): Promise<OfficeType[]> => {
22
+ const response = await fetchRetailJSON<RegionOfficesResponseType>(
23
+ '/public-data/regionOffices',
24
+ 'POST',
25
+ {
26
+ regionRfCd: {
27
+ key: regionKey,
28
+ },
29
+ cashCardFlg: true,
25
30
  },
26
- cashCardFlg: true,
27
- });
31
+ );
28
32
 
29
- return await response.json().then((_) =>
30
- _?.offices?.map((office: OfficeType) => ({
33
+ return (
34
+ response?.offices?.map((office: OfficeType) => ({
31
35
  ...office,
32
- gpsLatitude: (office.latitude ?? DEFAULT_CENTER_COORDS[0]).toString().replace(',', '.'),
33
- gpsLongitude: (office.longitude ?? DEFAULT_CENTER_COORDS[1]).toString().replace(',', '.'),
34
- })),
36
+ gpsLatitude: formatCoordinate(office.latitude ?? DEFAULT_CENTER_COORDS[0]),
37
+ gpsLongitude: formatCoordinate(office.longitude ?? DEFAULT_CENTER_COORDS[1]),
38
+ })) || []
35
39
  );
36
40
  };
41
+
42
+ const formatCoordinate = (coordinate: number) => Number(coordinate.toString().replace(',', '.'));
@@ -1,4 +1,4 @@
1
- import { doRequest } from './doRequest';
1
+ import { fetchRetailJSON } from './doRequest';
2
2
  import { type StatusType } from './StatusType';
3
3
 
4
4
  export type SendCodeBody = {
@@ -8,5 +8,17 @@ export type SendCodeBody = {
8
8
  };
9
9
  };
10
10
 
11
+ type SendCodeErrorResult = { errorMessage: string };
12
+
11
13
  export const sendCode = (body: SendCodeBody) =>
12
- doRequest<StatusType | { errorMessage: string }>('/sms/sendCode', 'POST', body);
14
+ fetchRetailJSON<StatusType | SendCodeErrorResult>('/sms/sendCode', 'POST', body).then(
15
+ (res) => !isErrorResult(res, body.phoneNumber),
16
+ );
17
+
18
+ const isErrorResult = (
19
+ res: StatusType | SendCodeErrorResult | null,
20
+ phoneNumber: string,
21
+ ): res is SendCodeErrorResult =>
22
+ Boolean(res) &&
23
+ typeof res !== 'string' &&
24
+ Boolean(res?.errorMessage.startsWith(`Too many request for phoneNumber [${phoneNumber}]`));
@@ -10,10 +10,5 @@ interface SendSignalToProcess {
10
10
  taskId: number | null;
11
11
  }
12
12
 
13
- interface SendSignalToProcessResponse {
14
- statusCd: string;
15
- taskId: number;
16
- }
17
-
18
13
  export const sendSignalToProcess = (body: SendSignalToProcess) =>
19
- doRequest<SendSignalToProcessResponse>('/user-data/sendSignalToProcess', 'POST', body);
14
+ doRequest('/user-data/sendSignalToProcess', 'POST', body);
@@ -1,4 +1,4 @@
1
- import { doRequest } from './doRequest';
1
+ import { fetchRetailJSON } from './doRequest';
2
2
 
3
3
  export type UpdateProfileEsiaBody = {
4
4
  code: string;
@@ -68,4 +68,4 @@ export type UpdateProfileEsiaResponse = {
68
68
  };
69
69
 
70
70
  export const updateProfileEsia = (body: UpdateProfileEsiaBody) =>
71
- doRequest<UpdateProfileEsiaResponse>('/esia/updateProfileEsia', 'POST', body);
71
+ fetchRetailJSON<UpdateProfileEsiaResponse>('/esia/updateProfileEsia', 'POST', body);
@@ -21,21 +21,21 @@ export const updateRefreshToken = () => {
21
21
  }
22
22
 
23
23
  const updateTokenRequest = async () => {
24
- const res = await doRequest<UpdateRefreshTokenBody | Response>('/auth/refresh', 'POST', {
24
+ const res = await doRequest('/auth/refresh', 'POST', {
25
25
  // eslint-disable-next-line camelcase
26
26
  refresh_token: refreshToken,
27
27
  // eslint-disable-next-line camelcase
28
28
  access_token: accessToken,
29
29
  });
30
30
 
31
- if (res instanceof Response) {
31
+ if (res) {
32
32
  handleStatus(res.status);
33
33
 
34
- return;
35
- }
34
+ const data: UpdateRefreshTokenBody = await res.json();
36
35
 
37
- globalThis.sessionStorage.setItem('refreshToken', res.refresh_token);
38
- globalThis.sessionStorage.setItem('accessToken', res.access_token);
36
+ globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
37
+ globalThis.sessionStorage.setItem('accessToken', data.access_token);
38
+ }
39
39
  };
40
40
 
41
41
  updateTokenRequest();
@@ -1,4 +1,4 @@
1
- import { doRequest } from './doRequest';
1
+ import { fetchRetailJSON } from './doRequest';
2
2
  import { type CreateUserProfileResponse } from './updateUserTask';
3
3
 
4
4
  export type UpdateUserProfileBody = {
@@ -23,4 +23,4 @@ export type UpdateUserProfileBody = {
23
23
  };
24
24
 
25
25
  export const updateUserProfile = (body: UpdateUserProfileBody) =>
26
- doRequest<CreateUserProfileResponse>('/user-data/updateUserProfile', 'PUT', body);
26
+ fetchRetailJSON<CreateUserProfileResponse>('/user-data/updateUserProfile', 'PUT', body);
@@ -1,5 +1,5 @@
1
1
  import { type Option } from '../../ui-kit/Select/Option';
2
- import { doRequest } from './doRequest';
2
+ import { fetchRetailJSON } from './doRequest';
3
3
 
4
4
  type ParticipantAddress = {
5
5
  addressType: {
@@ -140,4 +140,4 @@ export type CreateUserProfileResponse = {
140
140
  };
141
141
 
142
142
  export const updateUserTask = (body: UpdateUserTaskBody) =>
143
- doRequest<CreateUserProfileResponse>('/user-data/updateUserTask', 'PUT', body);
143
+ fetchRetailJSON<CreateUserProfileResponse>('/user-data/updateUserTask', 'PUT', body);
@@ -52,9 +52,7 @@ export const useApplicationLeadApi = ({
52
52
  }
53
53
 
54
54
  try {
55
- const {
56
- profile: { id: profileId },
57
- } = await createUserProfile({
55
+ const profileId = await createUserProfile({
58
56
  profile: { phone: formatPhone(formData.phone as string) },
59
57
  });
60
58
 
@@ -111,6 +109,7 @@ const updateUserData = async ({
111
109
  const transformedForm = transformOtherConsentsField(formData);
112
110
 
113
111
  await updateUserProfile(getUpdateUserProfileData(profileId, transformedForm));
112
+
114
113
  const { taskId, participantId } = await createDraftTask({
115
114
  profileId,
116
115
  programId,
@@ -124,6 +123,7 @@ const updateUserData = async ({
124
123
  formData: transformedForm,
125
124
  }),
126
125
  );
126
+
127
127
  saveUserData(participantId, taskId, profileId);
128
128
  saveForm(formData);
129
129
  };