@computools/react-native-template-controller 0.0.4 → 0.0.6

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 (252) hide show
  1. package/package.json +1 -1
  2. package/template/android/app/build/intermediates/desugar_graph/debug/out/currentProject/dirs_bucket_1/graph.bin +0 -0
  3. package/template/android/app/build/intermediates/desugar_graph/debug/out/currentProject/dirs_bucket_2/graph.bin +0 -0
  4. package/template/android/app/build/intermediates/desugar_graph/debug/out/currentProject/dirs_bucket_3/graph.bin +0 -0
  5. package/template/android/app/build/intermediates/desugar_graph/debug/out/currentProject/dirs_bucket_4/graph.bin +0 -0
  6. package/template/android/app/build/intermediates/desugar_graph/debug/out/currentProject/dirs_bucket_5/graph.bin +0 -0
  7. package/template/android/app/build/intermediates/dex/debug/mergeExtDexDebug/classes.dex +0 -0
  8. package/template/android/app/build/intermediates/incremental/debug/mergeDebugResources/compile-file-map.properties +1 -1
  9. package/template/android/app/build/intermediates/incremental/debug/mergeDebugResources/merger.xml +34 -34
  10. package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  11. package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{SrqR9ZmTcC9AnlxQuLXLEZV7OH8= → HQ+Y4TikyAJSYTRdBn0yPUpVvBI=} +0 -0
  12. package/template/android/app/build/intermediates/incremental/packageDebug/tmp/debug/dex-renamer-state.txt +1 -1
  13. package/template/android/app/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +13 -13
  14. package/template/android/app/build/intermediates/merged_native_libs/debug/out/lib/arm64-v8a/libhermes.so +0 -0
  15. package/template/android/app/build/intermediates/merged_native_libs/debug/out/lib/arm64-v8a/libreactnativemmkv.so +0 -0
  16. package/template/android/app/build/intermediates/merged_native_libs/debug/out/lib/armeabi-v7a/libhermes.so +0 -0
  17. package/template/android/app/build/intermediates/merged_native_libs/debug/out/lib/armeabi-v7a/libreactnativemmkv.so +0 -0
  18. package/template/android/app/build/intermediates/merged_native_libs/debug/out/lib/x86/libhermes.so +0 -0
  19. package/template/android/app/build/intermediates/merged_native_libs/debug/out/lib/x86/libreactnativemmkv.so +0 -0
  20. package/template/android/app/build/intermediates/merged_native_libs/debug/out/lib/x86_64/libhermes.so +0 -0
  21. package/template/android/app/build/intermediates/merged_native_libs/debug/out/lib/x86_64/libreactnativemmkv.so +0 -0
  22. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/debug.json +939 -939
  23. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-af.json +11 -11
  24. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-am.json +2 -2
  25. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ar.json +11 -11
  26. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-as.json +11 -11
  27. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-az.json +11 -11
  28. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-b+sr+Latn.json +2 -2
  29. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-be.json +2 -2
  30. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-bg.json +2 -2
  31. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-bn.json +11 -11
  32. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-bs.json +11 -11
  33. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ca.json +11 -11
  34. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-cs.json +2 -2
  35. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-da.json +11 -11
  36. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-de.json +2 -2
  37. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-el.json +11 -11
  38. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-en-rAU.json +2 -2
  39. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-en-rCA.json +2 -2
  40. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-en-rGB.json +11 -11
  41. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-en-rIN.json +2 -2
  42. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-en-rXC.json +11 -11
  43. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-es-rUS.json +2 -2
  44. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-es.json +11 -11
  45. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-et.json +11 -11
  46. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-eu.json +2 -2
  47. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-fa.json +11 -11
  48. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-fi.json +11 -11
  49. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-fr-rCA.json +2 -2
  50. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-fr.json +2 -2
  51. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-gl.json +2 -2
  52. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-gu.json +11 -11
  53. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-h360dp-land-v13.json +1 -1
  54. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-h480dp-land-v13.json +1 -1
  55. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-h720dp-v13.json +1 -1
  56. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-hdpi-v4.json +1 -1
  57. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-hi.json +11 -11
  58. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-hr.json +11 -11
  59. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-hu.json +2 -2
  60. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-hy.json +11 -11
  61. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-in.json +2 -2
  62. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-is.json +2 -2
  63. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-it.json +11 -11
  64. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-iw.json +2 -2
  65. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ja.json +11 -11
  66. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ka.json +11 -11
  67. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-kk.json +11 -11
  68. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-km.json +11 -11
  69. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-kn.json +11 -11
  70. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ko.json +2 -2
  71. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ky.json +2 -2
  72. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-land.json +2 -2
  73. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-large-v4.json +2 -2
  74. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ldltr-v21.json +1 -1
  75. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-lo.json +11 -11
  76. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-lt.json +2 -2
  77. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-lv.json +11 -11
  78. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-mk.json +2 -2
  79. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ml.json +11 -11
  80. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-mn.json +11 -11
  81. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-mr.json +2 -2
  82. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ms.json +11 -11
  83. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-my.json +2 -2
  84. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-nb.json +11 -11
  85. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ne.json +11 -11
  86. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-night-v8.json +19 -19
  87. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-nl.json +2 -2
  88. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-or.json +11 -11
  89. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-pa.json +11 -11
  90. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-pl.json +11 -11
  91. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-port.json +1 -1
  92. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-pt-rBR.json +2 -2
  93. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-pt-rPT.json +2 -2
  94. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-pt.json +2 -2
  95. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ro.json +11 -11
  96. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ru.json +11 -11
  97. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-si.json +11 -11
  98. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-sk.json +11 -11
  99. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-sl.json +2 -2
  100. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-small-v4.json +1 -1
  101. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-sq.json +2 -2
  102. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-sr.json +2 -2
  103. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-sv.json +11 -11
  104. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-sw.json +2 -2
  105. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-sw600dp-v13.json +11 -11
  106. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ta.json +11 -11
  107. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-te.json +2 -2
  108. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-th.json +2 -2
  109. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-tl.json +2 -2
  110. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-tr.json +11 -11
  111. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-uk.json +11 -11
  112. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-ur.json +2 -2
  113. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-uz.json +11 -11
  114. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v16.json +11 -11
  115. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v17.json +1 -1
  116. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v18.json +1 -1
  117. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v21.json +21 -21
  118. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v22.json +1 -1
  119. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v23.json +21 -21
  120. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v24.json +1 -1
  121. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v25.json +1 -1
  122. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v26.json +1 -1
  123. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v27.json +1 -1
  124. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v28.json +2 -2
  125. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v29.json +1 -1
  126. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-v31.json +1 -1
  127. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-vi.json +11 -11
  128. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-w360dp-port-v13.json +1 -1
  129. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-w480dp-port-v13.json +1 -1
  130. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-watch-v20.json +1 -1
  131. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-watch-v21.json +1 -1
  132. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-xlarge-v4.json +1 -1
  133. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-zh-rCN.json +2 -2
  134. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-zh-rHK.json +11 -11
  135. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-zh-rTW.json +2 -2
  136. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values-zu.json +11 -11
  137. package/template/android/app/build/intermediates/merged_res_blame_folder/debug/out/multi-v2/values.json +233 -233
  138. package/template/android/app/build/intermediates/source_set_path_map/debug/file-map.txt +25 -25
  139. package/template/android/app/build/intermediates/stripped_native_libs/debug/out/lib/arm64-v8a/libhermes.so +0 -0
  140. package/template/android/app/build/intermediates/stripped_native_libs/debug/out/lib/arm64-v8a/libreactnativemmkv.so +0 -0
  141. package/template/android/app/build/intermediates/stripped_native_libs/debug/out/lib/armeabi-v7a/libhermes.so +0 -0
  142. package/template/android/app/build/intermediates/stripped_native_libs/debug/out/lib/armeabi-v7a/libreactnativemmkv.so +0 -0
  143. package/template/android/app/build/intermediates/stripped_native_libs/debug/out/lib/x86/libhermes.so +0 -0
  144. package/template/android/app/build/intermediates/stripped_native_libs/debug/out/lib/x86/libreactnativemmkv.so +0 -0
  145. package/template/android/app/build/intermediates/stripped_native_libs/debug/out/lib/x86_64/libhermes.so +0 -0
  146. package/template/android/app/build/intermediates/stripped_native_libs/debug/out/lib/x86_64/libreactnativemmkv.so +0 -0
  147. package/template/android/app/build/outputs/apk/debug/app-debug.apk +0 -0
  148. package/template/android/app/build/outputs/logs/manifest-merger-debug-report.txt +225 -225
  149. package/template/ios/build/generated/ios/React-Codegen.podspec.json +1 -1
  150. package/template/package.json +30 -3
  151. package/template/src/app/config/__tests__/http.test.ts +148 -0
  152. package/template/src/app/config/__tests__/injector.test.ts +17 -0
  153. package/template/src/app/config/__tests__/memory.test.ts +37 -0
  154. package/template/src/app/config/__tests__/mocks/picsum_response.json +82 -0
  155. package/template/src/app/config/__tests__/mocks/token.json +3 -0
  156. package/template/src/app/config/__tests__/mocks/user.json +7 -0
  157. package/template/src/app/config/injector.ts +1 -1
  158. package/template/src/app/config/memory.ts +1 -1
  159. package/template/src/app/infrastructure/__tests__/init-logic.test.ts +24 -0
  160. package/template/src/app/infrastructure/auth/__tests__/auth.repo.impl.test.ts +49 -0
  161. package/template/src/app/infrastructure/auth/__tests__/auth.service.test.ts +59 -0
  162. package/template/src/app/infrastructure/auth/__tests__/login.controller.test.ts +42 -0
  163. package/template/src/app/infrastructure/auth/auth.repo.impl.ts +2 -2
  164. package/template/src/app/infrastructure/auth/auth.repo.ts +1 -1
  165. package/template/src/app/infrastructure/auth/auth.service.ts +1 -1
  166. package/template/src/app/infrastructure/auth/screens/login/Login.screen.tsx +1 -1
  167. package/template/yarn.lock +8008 -0
  168. package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/iNXSZwA8tLLOqr25CL5j54fHtRY= +0 -0
  169. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{Pmw_fnLZD1jwbj5SQmodDt+YKTQ= → 3UreB+8zKWZPMaKe1eT9is1xG8U=} +0 -0
  170. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{oP7ahuiXhIj8_89ysFcJoXuM2WE= → 3nZDsrs3PCoLSlHW15m5wDzdXsA=} +0 -0
  171. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{TGexUjmp2wtHPnrh0q5D+Uxo_90= → 3qg+fdJyBJeBspSGBbuzsJw4dGc=} +0 -0
  172. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{Ntw6srjpV2c4H6NbEZckbaYRbPE= → 49wy5xPBuch8iB1cHVBFBlsyESs=} +0 -0
  173. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{b_GP2tE2UBxMN_aPfl59toyhEd8= → 4hZk3h0nfDVrwoyuez86v4GU3VM=} +0 -0
  174. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{2KxSATBc2SFTKrx9QuERqHJa0OM= → 5sFaH0QvQajCnTlgodWuY0gcsGg=} +0 -0
  175. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{6BjC+brlbRVTsIjC_kMXSto0yPQ= → 5suE_TO7j80V5qS1l+cihNJNnuw=} +0 -0
  176. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{bY98I+6CtYeBlOeumJglwpmEKjU= → 74NQfQxzXYJlAzCqZemM04drQ24=} +0 -0
  177. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{XM0HuDJWXMGQbZseNYkeBeJ6DY0= → 7r7wYXKKltJu0LIv6JATHDVWgTA=} +0 -0
  178. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{BvRp7ht4iUZHRn6b7OqkxYnIapQ= → 82tISh_5MZjCB4Kt0kV8Q3NngYQ=} +0 -0
  179. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{+O8VjoM1BN8RF7zJRyTuL4AGwq8= → 9EaCQ69FQf5CIbLSKdSp44_chK4=} +0 -0
  180. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{nimHfulrhrv4dJsc6Uonh+PWum8= → BnXrVLN5RomHfByNG3_vPIyJQyA=} +0 -0
  181. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{EJRoL2fho60XEh5ugdlhGj9d4Zs= → CxTbysrbDJvkVKyxMoUL+woOqSU=} +0 -0
  182. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{pac2BxJn7Ml3phmT3nDuBhEmXF4= → D+rAaK1WRw93gp0mRx_sY5Lt9Po=} +0 -0
  183. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{xczjx5tttHM+nQcTBJQRysespGA= → DCRODPmQicHU1N43oFjfVQgRQn0=} +0 -0
  184. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{IV0_rXCPDYvnMqbGRZe_GmJUxEQ= → EDnVgYsdPEE6ybJhdQetnIMDPyI=} +0 -0
  185. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{M9ANDI3JQGeSRZKC3c8MbaTm2AY= → EIHTjo1lTshvNAbrMyyyLgQ+oT8=} +0 -0
  186. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{ImiqPo+VDVhZg31vtusXPJNpakw= → EcNu2FEwIzSZKT3yFdj0oGSzb3M=} +0 -0
  187. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{pOcOeQGZocASLlXqh1u6eZu6MNc= → FVJHloSnFEK_+xZIlaPPBDgXy3g=} +0 -0
  188. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{HE6DiRpCJmh919Ibnjz0DvJTHaw= → G+aODu+gaGa_7Y8PIVDehsGZea8=} +0 -0
  189. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{JFxcrY147vZ9KzXemhSUtq9IC+M= → G5+SLnLkZWBDv3FlIYJNZN1goiE=} +0 -0
  190. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{EaXx9Em6qVeckRWtOENZfoNq63E= → GniLb_n_WrA9n7aZZ5fKmTkOpnA=} +0 -0
  191. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{tOOXMoB7554pZNw9KTQPTRbpN7U= → H2nNCuTi0OZV7b0eUC544Q_T66E=} +0 -0
  192. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{+GoE5M1JgGXADlvEAtT8kqqUwQs= → JM6wLwZkVAEdNxFpmb_2AdZv6+Y=} +0 -0
  193. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{V9HNiqvGOcvtTdLHN7Sp0OL4j2c= → JRSOC4FxkyGLz30HdkiRi8LifPM=} +0 -0
  194. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{Jj70pVGMqqa6sJhRFh2jq00Vt_4= → JjwyW0jDMC_00uvf+9bdVOhFh4w=} +0 -0
  195. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{_m7HGIXEyzQ3KPVulbAfVxPalYY= → L7XN1HwiToLs2bkYI+fUqDCBgXs=} +0 -0
  196. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{6vgf0MNHhsGpwYPkGPKOirFy5h8= → MbtNcdecliQq0Ujvw53PqO6SOUE=} +0 -0
  197. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{bNoEnbFzmkL8u4p35ykRnUcD3DM= → NIcTlnFubpH1XB1aF8RgLiKpac0=} +0 -0
  198. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{QKCXnGiN_N0Qad1TF2ckxveVvuA= → OF_QRlDckE0V5ZgoXyHrIMkFeG4=} +0 -0
  199. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{r9_kFGWOtdqD4Va6yL45WmYNGVs= → OFddxXfppWV+lK2hIJtC_aWrUYc=} +0 -0
  200. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{Ju7ysdwUmZX_h3J25vIrVZGn7Qc= → P6vKOoQIE_fyKELgpn5d4QousjM=} +0 -0
  201. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{yg7RMwvDRzRXFBPTxcivY4l5NMU= → PBjA8VMyOKbaGkhYcmixGXIl2UQ=} +0 -0
  202. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{XCfnJT22l_TLWXIDuqs378Q1NMY= → Qhv+sT_IexQndYEO5TALgdtVkaw=} +0 -0
  203. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{LYRs9f_qpUggr7bEPM8amOOppkQ= → Qw+dmA3QNt84H8RExZ2hPTSk0IM=} +0 -0
  204. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{W2zITpCGaeKkr2Yk_vx6CnxB4GQ= → SepmcIY1PMd_6iXE1f_p_1Kbl+s=} +0 -0
  205. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{TQdgWuvku5SA2DlAQ_kFtSqhMcA= → UfSqxFKcb_l0rutCcl3CNyQeCek=} +0 -0
  206. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{AO+nivCGN3NPCPTWZevqsm4e7yY= → VXDpxUidyFqSdl2HQ5JPzCVOVwE=} +0 -0
  207. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{NyisAL+cwsapEVsRI+3kj7e4dJw= → WGdYhgbvoEKlT_QqP8FSWBiexNQ=} +0 -0
  208. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{E2XzTq83lb9Gz2SuRFP277EsIOs= → W_iosSN14eKa6sKmgJt4iVLea4w=} +0 -0
  209. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{fI9OiPUZlXwuDYImUC8bD4V5Mag= → X09SkUytTtub7j+8xowbAaQtIL8=} +0 -0
  210. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{YY3pF4aBinBXGv1VaF5FHDien74= → Xg3D3XJ4XQHiyTfmzkA0lNoAJj4=} +0 -0
  211. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{SftO0IV3eCqlgQnQve0DS6I44dc= → Y0BOUAmacbxmY1rD+04SO+lW4hU=} +0 -0
  212. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{HJ7T9_R5vTGmzLH63NuA+weZUQA= → YC277NpXBC052_6+BK5PctC76rE=} +0 -0
  213. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{0Ii3EcS5dUS_olPQPafoE5l_pr8= → YkjXNqgGPK4g1kETB7EeSY8k2UA=} +0 -0
  214. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{OBoirVt06rGwBcMgaWQY1MDHrIs= → ZC75OJFRpcuUI_VjHq1rxGfWBQI=} +0 -0
  215. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{objAIx9OgzcsaXllx_96tSAsJ_M= → ZusYDIKimjyO8X5dTm7O3u_Gmco=} +0 -0
  216. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{1NGN8WqKIVtXICoJACvvUor027A= → _jiobzA_iO49UT+xg6muemZu9zg=} +0 -0
  217. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{+B+GMVsQp4CBkD2VdfjQOghlksw= → aVqhLwbaiIGyJZgmND5XoZ+WYVM=} +0 -0
  218. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{Fld61o3fTse0hkuhcujMDXMOcSg= → acFTCbV_M+yBHdjEYP13h28Nwx0=} +0 -0
  219. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{_p3kgKc+_mrtT+ZFwH+dJR5Xftw= → bHfQ7TGfMUI_W0OU3OjuMEM02wk=} +0 -0
  220. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{j4O9k5FUhoQQq_UaeKpRf62LudM= → cRzM6zSnI3WoAKBsMO0IeiAtSho=} +0 -0
  221. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{k3FSjL3iLcGwRUd9wwV6eVzqyCg= → d2MkXi5nc+m_yHGZr59v3W3jI2Q=} +0 -0
  222. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{wnfIH2zUeGPSYZ0QEdV849+uG2g= → ehKdliS1ZpwJ1u2MWlfRQysuJkc=} +0 -0
  223. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{onn60q7NqnT9kXC8Xa71AFs0YPc= → fZE48ZGVFQY_X_gNmwA0+dqJfZg=} +0 -0
  224. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{sueRb2oVstSdJj5iTEb1_RYOw9E= → fle2XSO_hchnNNgffdsRxqahE88=} +0 -0
  225. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{Ot2INHHHCEd8sN18lgAlSZ8pLyw= → gJNQHMEzx1AitzW6z5gbv9wJw5M=} +0 -0
  226. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{ZtmWWggyh5NkZoFSMsltQ1ulrRM= → hbKwQTRPXnfEH3O18psuR2AMvvo=} +0 -0
  227. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{0vsQWRvn5wQXLbmIcymZO5Wynxw= → htohcNiIOOKQ+mkPZ00z8Lw9RF8=} +0 -0
  228. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{wV1Lna5exDDyskkxRaOzsreolCo= → jeE3v03qIfxqX8ovHRect2X_r0Q=} +0 -0
  229. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{YN0tzHEGKXB4joJP9+yjXC3m_Wg= → kKxWJRB0KTS34ZE7j2rGgqTN5vI=} +0 -0
  230. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{qADp_HlyGWD_exSQHlGahS2wGpw= → krwmqG6WZkUbKugXMzjrb14rjwk=} +0 -0
  231. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{6pI5sxHFZL0nV0jU0ZuDv9CPQp0= → lBeLl3WiUNrI4xCJhEeXezSZlt8=} +0 -0
  232. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{+OWTJkaeuoudsJX1InHQMzFGYhg= → nEglzveRkgbQlviFCTJMI15g_A4=} +0 -0
  233. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{mff2ttQtQKuy66IK9KusUxPFrao= → niRpIUFGlGaC_xBE_fJucNsuTYQ=} +0 -0
  234. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{DWQeJ5X402U33vYKVMiRDt_b5gY= → q6aJo94uksIMt3pOdEiFM4DGy5w=} +0 -0
  235. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{U+ELr35VTlA3XzTR4CC_pFCgeso= → q_6xBQp4fMW8li3PgGkWC+Zw28o=} +0 -0
  236. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{RWrTeSC_IBncrcaBjdohUcq5oBo= → qshOsR+lBb5VFGEs7KXDYXET9H4=} +0 -0
  237. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{RUJH_3hhartEU2puqUFjT96zNo4= → sCraGHDMIxgs+UpLCkL2eDOAadA=} +0 -0
  238. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{vW+AFg+eVCx2SyQKGO_PfxQhstg= → sI_fumdiBCf3_KXLyevD3aPo6W0=} +0 -0
  239. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{QogDZPJYUNauOuP0FVGvCAoDRNE= → sMkb_BpdJWmH8BqYhE5Rsqa0gyk=} +0 -0
  240. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{shTeWLP_9+mOmBj__ztZ_PAlBkk= → sXsiX_hg4gJEVURUb3rGGkibsDA=} +0 -0
  241. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{4S6moJm4cWCOvvmZpmb5gVWD6VE= → sfg5NtX7LK5cBhyj3JDc_oSv9lY=} +0 -0
  242. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{2+C2xmeXNkCYqUDqaQQL9ysthDM= → sschyQ+ETuydcDZhI6s+3E_YltY=} +0 -0
  243. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{8Sk2YGQRuO1SauXz6omw384vhKM= → tBxXFC0HvhwRtxTicARReAspPe8=} +0 -0
  244. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{2GiR1ja7iAxFIf3lJRHwUqsODnk= → uLdZO0GnlCuSjTgtq7Z9JYI+ZyA=} +0 -0
  245. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{Rgm69buQKWV3boG5M617w15UJmw= → vL7+gH4ALjt_FkIt6GkbpD41K04=} +0 -0
  246. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{fJLM5VxWP_VG4I38RuKPlA_fraw= → wU3TnjDliq4fxfOnboGj7lUFHiE=} +0 -0
  247. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{PSZw9xMg0CornJ88ifZ79zt1PYA= → wr1m2b7T5Oynf_BBhvQf8S0XQdU=} +0 -0
  248. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{MJpCYtEUdp5NqLQgf3suKw4OI10= → x9n50A6RJUFtfPr6OXuOCX6gBr8=} +0 -0
  249. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{wsM3Pb1HNaXS_yeGwRjsj_A2QCU= → xzY141CrZ2NrAg9fRsJAfjXo9gA=} +0 -0
  250. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{BIDwISuiWHUNwg3zazvgE7klCqo= → yfb7bTQxoUzDS8JvWp_6Yjfg0JM=} +0 -0
  251. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{+LWVuZVCdOaipLNOClquAVWn8EA= → z5ETiX_j3ytFouq1_sR6jM_ttS0=} +0 -0
  252. /package/template/android/app/build/intermediates/incremental/debug-mergeJavaRes/zip-cache/{XZ4APnhcCnwlAVt_IjP031wwiDQ= → zzXcZg5AyvHxxOJAjXRXTAEFBJY=} +0 -0
@@ -1 +1 @@
1
- {"name":"React-Codegen","version":"0.71.7","summary":"Temp pod for generated files for React Native","homepage":"https://facebook.com/","license":"Unlicense","authors":"Facebook","compiler_flags":"-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation -Wno-nullability-completeness -std=c++17","source":{"git":""},"header_mappings_dir":"./","platforms":{"ios":"12.4"},"source_files":"**/*.{h,mm,cpp}","pod_target_xcconfig":{"HEADER_SEARCH_PATHS":"\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"$(PODS_ROOT)/Headers/Private/React-Fabric\" \"$(PODS_ROOT)/Headers/Private/React-RCTFabric\""},"dependencies":{"FBReactNativeSpec":[],"React-jsiexecutor":[],"RCT-Folly":[],"RCTRequired":[],"RCTTypeSafety":[],"React-Core":[],"React-jsi":[],"ReactCommon/turbomodule/bridging":[],"ReactCommon/turbomodule/core":[],"hermes-engine":[]}}
1
+ {"name":"React-Codegen","version":"0.71.8","summary":"Temp pod for generated files for React Native","homepage":"https://facebook.com/","license":"Unlicense","authors":"Facebook","compiler_flags":"-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation -Wno-nullability-completeness -std=c++17","source":{"git":""},"header_mappings_dir":"./","platforms":{"ios":"12.4"},"source_files":"**/*.{h,mm,cpp}","pod_target_xcconfig":{"HEADER_SEARCH_PATHS":"\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\" \"$(PODS_ROOT)/Headers/Private/React-Fabric\" \"$(PODS_ROOT)/Headers/Private/React-RCTFabric\""},"dependencies":{"FBReactNativeSpec":[],"React-jsiexecutor":[],"RCT-Folly":[],"RCTRequired":[],"RCTTypeSafety":[],"React-Core":[],"React-jsi":[],"ReactCommon/turbomodule/bridging":[],"ReactCommon/turbomodule/core":[],"hermes-engine":[]}}
@@ -7,7 +7,8 @@
7
7
  "ios": "react-native run-ios",
8
8
  "lint": "eslint .",
9
9
  "start": "react-native start",
10
- "test": "jest"
10
+ "test": "jest",
11
+ "test-coverage": "jest test --coverage --watchAll=false"
11
12
  },
12
13
  "dependencies": {
13
14
  "@hookform/resolvers": "2.9.11",
@@ -18,7 +19,7 @@
18
19
  "mobx-react-lite": "3.4.3",
19
20
  "react": "18.2.0",
20
21
  "react-hook-form": "7.43.5",
21
- "react-native": "0.71.7",
22
+ "react-native": "0.71.8",
22
23
  "react-native-bootsplash": "4.5.3",
23
24
  "react-native-mmkv": "2.6.3",
24
25
  "react-native-safe-area-context": "4.5.0",
@@ -48,6 +49,32 @@
48
49
  "typescript": "4.8.4"
49
50
  },
50
51
  "jest": {
51
- "preset": "react-native"
52
+ "preset": "react-native",
53
+ "collectCoverageFrom": [
54
+ "**/*.ts",
55
+ "**/*.controller.ts",
56
+ "**/*.impl.ts",
57
+ "**/*.repo.ts",
58
+ "**/*.service.ts",
59
+ "!node_modules/*",
60
+ "!**/types/*",
61
+ "!**/*.routes.ts"
62
+ ],
63
+ "moduleFileExtensions": [
64
+ "ts",
65
+ "tsx",
66
+ "js",
67
+ "jsx",
68
+ "json",
69
+ "node"
70
+ ],
71
+ "coverageThreshold": {
72
+ "global": {
73
+ "branches": 100,
74
+ "functions": 100,
75
+ "lines": 100,
76
+ "statements": 100
77
+ }
78
+ }
52
79
  }
53
80
  }
@@ -0,0 +1,148 @@
1
+ import {Http} from '../http';
2
+ import JSONResponse from './mocks/picsum_response.json';
3
+ import {token} from './mocks/token.json';
4
+
5
+ interface HttpConstructor {
6
+ baseURL?: string;
7
+ headers?: {[headerName: string]: string | number};
8
+ }
9
+
10
+ interface AxiosResponse {
11
+ url: string;
12
+ someData: Object;
13
+ config: HttpConstructor;
14
+ }
15
+
16
+ const mockedResponse = (config: HttpConstructor) => (url: string) => {
17
+ if (url.includes('error')) {
18
+ throw new Error(url);
19
+ }
20
+
21
+ return {data: {config, url, someData: JSONResponse}};
22
+ };
23
+
24
+ jest.mock('axios', () => ({
25
+ create: jest.fn((config: HttpConstructor) => ({
26
+ get: mockedResponse(config),
27
+ post: mockedResponse(config),
28
+ put: mockedResponse(config),
29
+ delete: mockedResponse(config),
30
+ })),
31
+ }));
32
+
33
+ describe('Http', () => {
34
+ it('empty constructor', async () => {
35
+ const http = new Http();
36
+
37
+ await checkSuccessHttpRequests({baseURL: '', headers: {}}, http);
38
+ await checkFaildHttpRequests(http);
39
+ });
40
+
41
+ it('base URL constructor', async () => {
42
+ const baseURL = 'https://picsum.photos/v2/list';
43
+ const http = new Http(baseURL);
44
+
45
+ await checkSuccessHttpRequests({baseURL, headers: {}}, http);
46
+ await checkFaildHttpRequests(http);
47
+ });
48
+
49
+ it('base URL & default headers constructor', async () => {
50
+ const baseURL = 'https://picsum.photos/v2/list';
51
+ const headers = {'Content-Type': 'multipart/form-data'};
52
+ const http = new Http(baseURL, headers);
53
+
54
+ await checkSuccessHttpRequests({baseURL, headers}, http);
55
+ await checkFaildHttpRequests(http);
56
+ });
57
+
58
+ it('setBaseURL method', async () => {
59
+ const http = new Http();
60
+
61
+ const baseURL = 'http://www.redmine.com';
62
+ http.setBaseURL(baseURL);
63
+
64
+ await checkSuccessHttpRequests({baseURL, headers: {}}, http);
65
+ await checkFaildHttpRequests(http);
66
+ });
67
+
68
+ it('addBearerToken method', async () => {
69
+ const baseURL = 'http://www.redmine.com';
70
+ const http = new Http(baseURL);
71
+ http.addBearerToken(token);
72
+
73
+ await checkSuccessHttpRequests({baseURL, headers: {Authorization: `Bearer ${token}`}}, http);
74
+ await checkFaildHttpRequests(http);
75
+ });
76
+
77
+ it('addHeader method', async () => {
78
+ const http = new Http();
79
+
80
+ const headerName = 'AppVersion';
81
+ const headerValue = 'AppVersion';
82
+ http.addHeader(headerName, headerValue);
83
+
84
+ await checkSuccessHttpRequests({baseURL: '', headers: {[headerName]: headerValue}}, http);
85
+ await checkFaildHttpRequests(http);
86
+ });
87
+
88
+ it('cleanHeaders method', async () => {
89
+ const baseURL = 'http://redmine.com';
90
+ const headers = {'Content-Type': 'multipart/form-data'};
91
+ const http = new Http(baseURL, headers);
92
+
93
+ await checkSuccessHttpRequests({baseURL, headers}, http);
94
+
95
+ http.cleanHeaders();
96
+
97
+ await checkSuccessHttpRequests({baseURL, headers: {}}, http);
98
+ await checkFaildHttpRequests(http);
99
+ });
100
+
101
+ const checkSuccessHttpRequests = async (expectConfig: HttpConstructor, http: Http) => {
102
+ const reqGetUrl = 'https://picsum.photos/v2/list';
103
+ const getRes = await http.get<AxiosResponse>(reqGetUrl);
104
+
105
+ expect(getRes.config).toStrictEqual(expectConfig);
106
+ expect(getRes.url).toStrictEqual(reqGetUrl);
107
+ expect(getRes.someData).toStrictEqual(JSONResponse);
108
+
109
+ const reqPostUrl = 'https://picsum.photos/v2/list/1';
110
+ const postRes = await http.post<AxiosResponse>(reqPostUrl);
111
+
112
+ expect(postRes.config).toStrictEqual(expectConfig);
113
+ expect(postRes.url).toStrictEqual(reqPostUrl);
114
+ expect(postRes.someData).toStrictEqual(JSONResponse);
115
+
116
+ const reqPutUrl = 'https://picsum.photos/v2/list/1';
117
+ const putRes = await http.put<AxiosResponse>(reqPutUrl);
118
+
119
+ expect(putRes.config).toStrictEqual(expectConfig);
120
+ expect(putRes.url).toStrictEqual(reqPutUrl);
121
+ expect(putRes.someData).toStrictEqual(JSONResponse);
122
+
123
+ const reqDeleteUrl = 'https://picsum.photos/v2/list/1';
124
+ const deleteRes = await http.delete<AxiosResponse>(reqDeleteUrl);
125
+
126
+ expect(deleteRes.config).toStrictEqual(expectConfig);
127
+ expect(deleteRes.url).toStrictEqual(reqDeleteUrl);
128
+ expect(deleteRes.someData).toStrictEqual(JSONResponse);
129
+ };
130
+
131
+ const checkFaildHttpRequests = async (http: Http) => {
132
+ const reqGetUrl = 'https://picsum.photos/v2/list_error';
133
+ const getRes = http.get<AxiosResponse>(reqGetUrl);
134
+ await expect(getRes).rejects.toThrow(reqGetUrl);
135
+
136
+ const reqPostUrl = 'https://picsum.photos/v2/list/1_error';
137
+ const postRes = http.post<AxiosResponse>(reqPostUrl);
138
+ await expect(postRes).rejects.toThrow(reqPostUrl);
139
+
140
+ const reqPutUrl = 'https://picsum.photos/v2/list_error/1';
141
+ const putRes = http.put<AxiosResponse>(reqPutUrl);
142
+ await expect(putRes).rejects.toThrow(reqPutUrl);
143
+
144
+ const reqDeleteUrl = 'https://picsum.photos/v2/list_error/1';
145
+ const deleteRes = http.delete<AxiosResponse>(reqDeleteUrl);
146
+ await expect(deleteRes).rejects.toThrow(reqDeleteUrl);
147
+ };
148
+ });
@@ -0,0 +1,17 @@
1
+ import {injector} from '../injector';
2
+
3
+ describe('Injector', () => {
4
+ it('check with abstract class', async () => {
5
+ abstract class SomeAbstractClass {
6
+ public name: string = 'John Doy';
7
+ }
8
+ class SomeClass implements SomeAbstractClass {
9
+ public name: string = 'Test Jhon';
10
+ }
11
+
12
+ const value = new SomeClass();
13
+
14
+ injector.set(SomeAbstractClass, value);
15
+ expect(injector.get(SomeAbstractClass).name).toStrictEqual(value.name);
16
+ });
17
+ });
@@ -0,0 +1,37 @@
1
+ import {MMKVMemory} from '../memory';
2
+ import JSONUser from './mocks/user.json';
3
+
4
+ describe('Memory', () => {
5
+ let memory: MMKVMemory;
6
+
7
+ beforeEach(() => {
8
+ memory = new MMKVMemory();
9
+ });
10
+
11
+ it('success save/get', () => {
12
+ const key = 'TEST_USER';
13
+ memory.save(key, JSONUser);
14
+
15
+ const user = memory.get(key);
16
+ expect(user).toStrictEqual(JSONUser);
17
+ });
18
+
19
+ it('success remove/get', () => {
20
+ const key = 'TEST_USER';
21
+ memory.save(key, JSONUser);
22
+
23
+ const user = memory.get(key);
24
+ expect(user).toStrictEqual(JSONUser);
25
+
26
+ memory.remove(key);
27
+ const removedUser = memory.get(key);
28
+ expect(removedUser).toStrictEqual(null);
29
+ });
30
+
31
+ it('fail get', () => {
32
+ const key = 'NOT_EXISTING_USER_KEY';
33
+
34
+ const user = memory.get(key);
35
+ expect(user).toStrictEqual(null);
36
+ });
37
+ });
@@ -0,0 +1,82 @@
1
+ [
2
+ {
3
+ "id": "0",
4
+ "author": "Alejandro Escamilla",
5
+ "width": 5616,
6
+ "height": 3744,
7
+ "url": "https://unsplash.com/photos/yC-Yzbqy7PY",
8
+ "download_url": "https://picsum.photos/id/0/5616/3744"
9
+ },
10
+ {
11
+ "id": "1",
12
+ "author": "Alejandro Escamilla",
13
+ "width": 5616,
14
+ "height": 3744,
15
+ "url": "https://unsplash.com/photos/LNRyGwIJr5c",
16
+ "download_url": "https://picsum.photos/id/1/5616/3744"
17
+ },
18
+ {
19
+ "id": "10",
20
+ "author": "Paul Jarvis",
21
+ "width": 2500,
22
+ "height": 1667,
23
+ "url": "https://unsplash.com/photos/6J--NXulQCs",
24
+ "download_url": "https://picsum.photos/id/10/2500/1667"
25
+ },
26
+ {
27
+ "id": "100",
28
+ "author": "Tina Rataj",
29
+ "width": 2500,
30
+ "height": 1656,
31
+ "url": "https://unsplash.com/photos/pwaaqfoMibI",
32
+ "download_url": "https://picsum.photos/id/100/2500/1656"
33
+ },
34
+ {
35
+ "id": "1000",
36
+ "author": "Lukas Budimaier",
37
+ "width": 5626,
38
+ "height": 3635,
39
+ "url": "https://unsplash.com/photos/6cY-FvMlmkQ",
40
+ "download_url": "https://picsum.photos/id/1000/5626/3635"
41
+ },
42
+ {
43
+ "id": "1001",
44
+ "author": "Danielle MacInnes",
45
+ "width": 5616,
46
+ "height": 3744,
47
+ "url": "https://unsplash.com/photos/1DkWWN1dr-s",
48
+ "download_url": "https://picsum.photos/id/1001/5616/3744"
49
+ },
50
+ {
51
+ "id": "1002",
52
+ "author": "NASA",
53
+ "width": 4312,
54
+ "height": 2868,
55
+ "url": "https://unsplash.com/photos/6-jTZysYY_U",
56
+ "download_url": "https://picsum.photos/id/1002/4312/2868"
57
+ },
58
+ {
59
+ "id": "1003",
60
+ "author": "E+N Photographies",
61
+ "width": 1181,
62
+ "height": 1772,
63
+ "url": "https://unsplash.com/photos/GYumuBnTqKc",
64
+ "download_url": "https://picsum.photos/id/1003/1181/1772"
65
+ },
66
+ {
67
+ "id": "1004",
68
+ "author": "Greg Rakozy",
69
+ "width": 5616,
70
+ "height": 3744,
71
+ "url": "https://unsplash.com/photos/SSxIGsySh8o",
72
+ "download_url": "https://picsum.photos/id/1004/5616/3744"
73
+ },
74
+ {
75
+ "id": "1005",
76
+ "author": "Matthew Wiebe",
77
+ "width": 5760,
78
+ "height": 3840,
79
+ "url": "https://unsplash.com/photos/tBtuxtLvAZs",
80
+ "download_url": "https://picsum.photos/id/1005/5760/3840"
81
+ }
82
+ ]
@@ -0,0 +1,3 @@
1
+ {
2
+ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
3
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "id": 123,
3
+ "email": "kekek@awxwax.com",
4
+ "first_name": "Kek",
5
+ "last_name": "Lol",
6
+ "avatar": "https://reqres.in/img/faces/2-image.jpg"
7
+ }
@@ -1,6 +1,6 @@
1
1
  type AnyClass<T> = abstract new (...args: never[]) => T;
2
2
 
3
- export class Injector {
3
+ class Injector {
4
4
  private map: Map<Object, InstanceType<typeof Object>> = new Map();
5
5
 
6
6
  public get = <C extends AnyClass<Object>>(key: C) => this.map.get(key) as InstanceType<C>;
@@ -8,7 +8,7 @@ export abstract class Memory {
8
8
  public abstract get: <T>(key: string) => T | null;
9
9
  }
10
10
 
11
- export class MMKVMemory implements Memory {
11
+ export class MMKVMemory extends Memory {
12
12
  private storage: MMKV = new MMKV();
13
13
 
14
14
  public save = <T>(key: string, value: T) => this.storage.set(key, JSON.stringify(value));
@@ -0,0 +1,24 @@
1
+ import {Http} from '@config/http';
2
+ import {Memory} from '@config/memory';
3
+ import {initLogic} from '../init-logic';
4
+ import {injector} from '@config/injector';
5
+ import {AuthRepo} from '../auth/auth.repo';
6
+ import {AuthService} from '../auth/auth.service';
7
+
8
+ describe('init-logic', () => {
9
+ beforeAll(() => {
10
+ jest.spyOn(AuthService.prototype, 'authInit');
11
+ });
12
+
13
+ it('check init-logic', async () => {
14
+ initLogic();
15
+
16
+ expect(injector.get(Http)).toBeInstanceOf(Http);
17
+
18
+ expect(injector.get(Memory)).toBeInstanceOf(Memory);
19
+ expect(injector.get(AuthRepo)).toBeInstanceOf(AuthRepo);
20
+ expect(injector.get(AuthService)).toBeInstanceOf(AuthService);
21
+
22
+ expect(injector.get(AuthService).authInit).toHaveBeenCalled();
23
+ });
24
+ });
@@ -0,0 +1,49 @@
1
+ import {Http} from '@config/http';
2
+ import {injector} from '@config/injector';
3
+ import {AuthRepoImpl} from '../auth.repo.impl';
4
+ import {MMKVMemory, Memory} from '@config/memory';
5
+
6
+ describe('AuthRepo', () => {
7
+ let http: Http;
8
+ let memory: Memory;
9
+
10
+ let authRepo: AuthRepoImpl;
11
+
12
+ beforeEach(() => {
13
+ http = new Http();
14
+ memory = new MMKVMemory();
15
+
16
+ injector.set(Http, http);
17
+ injector.set(Memory, memory);
18
+
19
+ authRepo = new AuthRepoImpl();
20
+ });
21
+
22
+ it('success loginFromMemory', () => {
23
+ const expectedToken = 'SomeTokenMock';
24
+
25
+ jest.spyOn(memory, 'get').mockImplementationOnce(() => expectedToken);
26
+ jest.spyOn(http, 'addBearerToken');
27
+ const res = authRepo.loginFromMemory();
28
+
29
+ expect(res).toStrictEqual(expectedToken);
30
+ expect(http.addBearerToken).toHaveBeenCalled();
31
+ });
32
+
33
+ it('success/no user in memory, loginFromMemory', () => {
34
+ jest.spyOn(memory, 'get').mockImplementationOnce(() => null);
35
+ jest.spyOn(http, 'addBearerToken');
36
+ const res = authRepo.loginFromMemory();
37
+
38
+ expect(res).toStrictEqual(null);
39
+ expect(http.addBearerToken).not.toHaveBeenCalled();
40
+ });
41
+
42
+ it('login', async () => {
43
+ await expect(authRepo.login('', '')).rejects.toThrow(Error);
44
+ });
45
+
46
+ it('logout', async () => {
47
+ await expect(authRepo.logout()).rejects.toThrow(Error);
48
+ });
49
+ });
@@ -0,0 +1,59 @@
1
+ import {Http} from '@config/http';
2
+ import {injector} from '@config/injector';
3
+ import {AuthService} from '../auth.service';
4
+ import {AuthRepoImpl} from '../auth.repo.impl';
5
+ import {MMKVMemory, Memory} from '@config/memory';
6
+ import {AuthRepo} from '../auth.repo';
7
+
8
+ describe('AuthService', () => {
9
+ let http: Http;
10
+ let memory: Memory;
11
+ let authRepo: AuthRepoImpl;
12
+
13
+ let authService: AuthService;
14
+
15
+ beforeEach(() => {
16
+ http = new Http();
17
+ memory = new MMKVMemory();
18
+
19
+ injector.set(Http, http);
20
+ injector.set(Memory, memory);
21
+
22
+ authRepo = new AuthRepoImpl();
23
+ injector.set(AuthRepo, authRepo);
24
+
25
+ authService = new AuthService();
26
+ });
27
+
28
+ it('success/no user authInit', () => {
29
+ authService.authInit();
30
+
31
+ expect(authService.token).toBeNull();
32
+ });
33
+
34
+ it('success authInit', () => {
35
+ const expectedToken = 'SomeTokenMock';
36
+
37
+ jest.spyOn(authRepo, 'loginFromMemory').mockImplementationOnce(() => expectedToken);
38
+ authService.authInit();
39
+
40
+ expect(authService.token).toStrictEqual(expectedToken);
41
+ });
42
+
43
+ it('success login', async () => {
44
+ const expectedToken = 'SomeTokenMock';
45
+
46
+ jest.spyOn(authRepo, 'login').mockImplementationOnce(() => Promise.resolve(expectedToken));
47
+ await authService.login('', '');
48
+
49
+ expect(authService.token).toStrictEqual(expectedToken);
50
+ });
51
+
52
+ it('exception login', async () => {
53
+ await expect(authService.login('', '')).rejects.toThrow(Error);
54
+ });
55
+
56
+ it('logout', async () => {
57
+ await expect(authService.logout()).rejects.toThrow(Error);
58
+ });
59
+ });
@@ -0,0 +1,42 @@
1
+ import {Http} from '@config/http';
2
+ import {injector} from '@config/injector';
3
+ import {AuthService} from '../auth.service';
4
+ import {AuthRepoImpl} from '../auth.repo.impl';
5
+ import {MMKVMemory, Memory} from '@config/memory';
6
+ import {AuthRepo} from '../auth.repo';
7
+ import {LoginController} from '../screens/login/login.controller';
8
+
9
+ describe('AuthService', () => {
10
+ let http: Http;
11
+ let memory: Memory;
12
+
13
+ let authRepo: AuthRepoImpl;
14
+
15
+ let authService: AuthService;
16
+
17
+ let controller: LoginController;
18
+
19
+ beforeEach(() => {
20
+ http = new Http();
21
+ memory = new MMKVMemory();
22
+
23
+ injector.set(Http, http);
24
+ injector.set(Memory, memory);
25
+
26
+ authRepo = new AuthRepoImpl();
27
+ injector.set(AuthRepo, authRepo);
28
+
29
+ authService = new AuthService();
30
+ injector.set(AuthService, authService);
31
+
32
+ controller = new LoginController();
33
+ });
34
+
35
+ it('login', async () => {
36
+ expect(controller.isProcessing).toBe(false);
37
+
38
+ await expect(controller.login('', '')).rejects.toThrow(Error);
39
+
40
+ expect(controller.isProcessing).toBe(false);
41
+ });
42
+ });
@@ -3,7 +3,7 @@ import {Memory} from '@config/memory';
3
3
  import {Http} from '@config/http';
4
4
  import {AuthRepo} from './auth.repo';
5
5
 
6
- export class AuthRepoImpl implements AuthRepo {
6
+ export class AuthRepoImpl extends AuthRepo {
7
7
  private static readonly TokenKey: string = 'USER_TOKEN';
8
8
 
9
9
  private memory: Memory = injector.get(Memory);
@@ -19,7 +19,7 @@ export class AuthRepoImpl implements AuthRepo {
19
19
  return token;
20
20
  };
21
21
 
22
- public login = async (username: string, password: string) => {
22
+ public login = async (username: string, password: string): Promise<string> => {
23
23
  throw new Error(`Not implemented login with: ${username} ${password}`);
24
24
  };
25
25
 
@@ -1,5 +1,5 @@
1
1
  export abstract class AuthRepo {
2
2
  public abstract loginFromMemory: () => string | null;
3
- public abstract login: (username: string, password: string) => Promise<null>;
3
+ public abstract login: (username: string, password: string) => Promise<string>;
4
4
  public abstract logout: () => Promise<null>;
5
5
  }
@@ -11,7 +11,7 @@ export class AuthService {
11
11
  }
12
12
 
13
13
  public authInit() {
14
- this.authRepo.loginFromMemory();
14
+ this.userToken = this.authRepo.loginFromMemory();
15
15
  }
16
16
 
17
17
  public async login(username: string, password: string) {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import * as yup from 'yup';
3
- import {yupResolver} from '@hookform/resolvers/yup';
4
3
  import {useLocalObservable} from 'mobx-react-lite';
4
+ import {yupResolver} from '@hookform/resolvers/yup';
5
5
  import {View, Text, StyleSheet} from 'react-native';
6
6
  import {CommonActions} from '@react-navigation/native';
7
7
  import {useForm, Controller, ControllerProps} from 'react-hook-form';