@bigbinary/neeto-commons-rn 1.8.5 → 2.0.3

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 (427) hide show
  1. package/README.md +64 -0
  2. package/eslint-config/index.js +84 -17
  3. package/eslint-config/rules/no-dangling-constants.js +1 -1
  4. package/lib/typescript/api/app_version.d.ts +10 -0
  5. package/lib/typescript/api/app_version.d.ts.map +1 -0
  6. package/lib/typescript/api/auth.d.ts +26 -0
  7. package/lib/typescript/api/auth.d.ts.map +1 -0
  8. package/lib/typescript/api/global_roles.d.ts +10 -0
  9. package/lib/typescript/api/global_roles.d.ts.map +1 -0
  10. package/lib/typescript/api/notifications.d.ts +38 -0
  11. package/lib/typescript/api/notifications.d.ts.map +1 -0
  12. package/lib/typescript/api/organization_roles.d.ts +11 -0
  13. package/lib/typescript/api/organization_roles.d.ts.map +1 -0
  14. package/lib/typescript/api/profile.d.ts +15 -0
  15. package/lib/typescript/api/profile.d.ts.map +1 -0
  16. package/lib/typescript/api/team_members.d.ts +34 -0
  17. package/lib/typescript/api/team_members.d.ts.map +1 -0
  18. package/lib/typescript/auth/index.d.ts +3 -0
  19. package/lib/typescript/auth/index.d.ts.map +1 -0
  20. package/lib/typescript/components/AppVersion.d.ts +2 -0
  21. package/lib/typescript/components/AppVersion.d.ts.map +1 -0
  22. package/lib/typescript/components/BottomSheet.d.ts +9 -0
  23. package/lib/typescript/components/BottomSheet.d.ts.map +1 -0
  24. package/lib/typescript/components/BottomSheetMenu.d.ts +7 -0
  25. package/lib/typescript/components/BottomSheetMenu.d.ts.map +1 -0
  26. package/lib/typescript/components/ConfirmSheet.d.ts +15 -0
  27. package/lib/typescript/components/ConfirmSheet.d.ts.map +1 -0
  28. package/lib/typescript/components/EmptyView.d.ts +19 -0
  29. package/lib/typescript/components/EmptyView.d.ts.map +1 -0
  30. package/lib/typescript/components/Header/BaseHeader.d.ts +7 -0
  31. package/lib/typescript/components/Header/BaseHeader.d.ts.map +1 -0
  32. package/lib/typescript/components/Header/ScreenHeader.d.ts +7 -0
  33. package/lib/typescript/components/Header/ScreenHeader.d.ts.map +1 -0
  34. package/lib/typescript/components/Header.d.ts +22 -0
  35. package/lib/typescript/components/Header.d.ts.map +1 -0
  36. package/lib/typescript/components/HyperlinkText.d.ts +17 -0
  37. package/lib/typescript/components/HyperlinkText.d.ts.map +1 -0
  38. package/lib/typescript/components/LineLoader.d.ts +13 -0
  39. package/lib/typescript/components/LineLoader.d.ts.map +1 -0
  40. package/lib/typescript/components/NotificationIcon.d.ts +6 -0
  41. package/lib/typescript/components/NotificationIcon.d.ts.map +1 -0
  42. package/lib/typescript/components/NotificationPreferenceList.d.ts +14 -0
  43. package/lib/typescript/components/NotificationPreferenceList.d.ts.map +1 -0
  44. package/lib/typescript/components/OfflineScreen.d.ts +7 -0
  45. package/lib/typescript/components/OfflineScreen.d.ts.map +1 -0
  46. package/lib/typescript/components/OrganizationItem.d.ts +8 -0
  47. package/lib/typescript/components/OrganizationItem.d.ts.map +1 -0
  48. package/lib/typescript/components/SocialButton.d.ts +11 -0
  49. package/lib/typescript/components/SocialButton.d.ts.map +1 -0
  50. package/lib/typescript/components/TextWithUrl.d.ts +7 -0
  51. package/lib/typescript/components/TextWithUrl.d.ts.map +1 -0
  52. package/lib/typescript/components/ToggleSwitch.d.ts +8 -0
  53. package/lib/typescript/components/ToggleSwitch.d.ts.map +1 -0
  54. package/lib/typescript/components/WorkspaceSwitcherPane.d.ts +9 -0
  55. package/lib/typescript/components/WorkspaceSwitcherPane.d.ts.map +1 -0
  56. package/lib/typescript/components/constants.d.ts +7 -0
  57. package/lib/typescript/components/constants.d.ts.map +1 -0
  58. package/lib/typescript/components/index.d.ts +14 -0
  59. package/lib/typescript/components/index.d.ts.map +1 -0
  60. package/lib/typescript/config/axios/caseConversion.d.ts +4 -0
  61. package/lib/typescript/config/axios/caseConversion.d.ts.map +1 -0
  62. package/lib/typescript/config/axios/constants.d.ts +4 -0
  63. package/lib/typescript/config/axios/constants.d.ts.map +1 -0
  64. package/lib/typescript/config/axios/index.d.ts +13 -0
  65. package/lib/typescript/config/axios/index.d.ts.map +1 -0
  66. package/lib/typescript/config/axios/networkErrorHandler.d.ts +5 -0
  67. package/lib/typescript/config/axios/networkErrorHandler.d.ts.map +1 -0
  68. package/lib/typescript/config/axios/paramsSerializer.d.ts +3 -0
  69. package/lib/typescript/config/axios/paramsSerializer.d.ts.map +1 -0
  70. package/lib/typescript/config/axios/types.d.ts +10 -0
  71. package/lib/typescript/config/axios/types.d.ts.map +1 -0
  72. package/lib/typescript/config/bugsnag.d.ts +4 -0
  73. package/lib/typescript/config/bugsnag.d.ts.map +1 -0
  74. package/lib/typescript/config/dayjs.d.ts +23 -0
  75. package/lib/typescript/config/dayjs.d.ts.map +1 -0
  76. package/lib/typescript/config/googleSignin.d.ts +2 -0
  77. package/lib/typescript/config/googleSignin.d.ts.map +1 -0
  78. package/lib/typescript/config/index.d.ts +2 -0
  79. package/lib/typescript/config/index.d.ts.map +1 -0
  80. package/lib/typescript/config/validations.d.ts +2 -0
  81. package/lib/typescript/config/validations.d.ts.map +1 -0
  82. package/lib/typescript/constants/index.d.ts +8 -0
  83. package/lib/typescript/constants/index.d.ts.map +1 -0
  84. package/lib/typescript/contexts/index.d.ts +2 -0
  85. package/lib/typescript/contexts/index.d.ts.map +1 -0
  86. package/lib/typescript/contexts/localization.d.ts +26 -0
  87. package/lib/typescript/contexts/localization.d.ts.map +1 -0
  88. package/lib/typescript/helpers/asyncStore.d.ts +6 -0
  89. package/lib/typescript/helpers/asyncStore.d.ts.map +1 -0
  90. package/lib/typescript/helpers/index.d.ts +2 -0
  91. package/lib/typescript/helpers/index.d.ts.map +1 -0
  92. package/lib/typescript/helpers/keychain.d.ts +4 -0
  93. package/lib/typescript/helpers/keychain.d.ts.map +1 -0
  94. package/lib/typescript/helpers/notifications/apnsToken.d.ts +2 -0
  95. package/lib/typescript/helpers/notifications/apnsToken.d.ts.map +1 -0
  96. package/lib/typescript/helpers/notifications/constants.d.ts +5 -0
  97. package/lib/typescript/helpers/notifications/constants.d.ts.map +1 -0
  98. package/lib/typescript/helpers/notifications/getDeviceToken.d.ts +2 -0
  99. package/lib/typescript/helpers/notifications/getDeviceToken.d.ts.map +1 -0
  100. package/lib/typescript/helpers/notifications/index.d.ts +4 -0
  101. package/lib/typescript/helpers/notifications/index.d.ts.map +1 -0
  102. package/lib/typescript/helpers/notifications/registerBackgroundHandlers.d.ts +3 -0
  103. package/lib/typescript/helpers/notifications/registerBackgroundHandlers.d.ts.map +1 -0
  104. package/lib/typescript/helpers/notifications/types.d.ts +19 -0
  105. package/lib/typescript/helpers/notifications/types.d.ts.map +1 -0
  106. package/lib/typescript/helpers/notifications/usePushNotification.d.ts +7 -0
  107. package/lib/typescript/helpers/notifications/usePushNotification.d.ts.map +1 -0
  108. package/lib/typescript/helpers/scale.d.ts +2 -0
  109. package/lib/typescript/helpers/scale.d.ts.map +1 -0
  110. package/lib/typescript/helpers/utils.d.ts +5 -0
  111. package/lib/typescript/helpers/utils.d.ts.map +1 -0
  112. package/lib/typescript/hooks/index.d.ts +3 -0
  113. package/lib/typescript/hooks/index.d.ts.map +1 -0
  114. package/lib/typescript/hooks/query/queryKeys.d.ts +9 -0
  115. package/lib/typescript/hooks/query/queryKeys.d.ts.map +1 -0
  116. package/lib/typescript/hooks/query/useAppVersionApi.d.ts +2 -0
  117. package/lib/typescript/hooks/query/useAppVersionApi.d.ts.map +1 -0
  118. package/lib/typescript/hooks/query/useAuth.d.ts +27 -0
  119. package/lib/typescript/hooks/query/useAuth.d.ts.map +1 -0
  120. package/lib/typescript/hooks/query/useNotification.d.ts +19 -0
  121. package/lib/typescript/hooks/query/useNotification.d.ts.map +1 -0
  122. package/lib/typescript/hooks/query/useProfile.d.ts +9 -0
  123. package/lib/typescript/hooks/query/useProfile.d.ts.map +1 -0
  124. package/lib/typescript/hooks/query/useRolesApi.d.ts +4 -0
  125. package/lib/typescript/hooks/query/useRolesApi.d.ts.map +1 -0
  126. package/lib/typescript/hooks/query/useTeamMembersApi.d.ts +23 -0
  127. package/lib/typescript/hooks/query/useTeamMembersApi.d.ts.map +1 -0
  128. package/lib/typescript/hooks/useAppState.d.ts +2 -0
  129. package/lib/typescript/hooks/useAppState.d.ts.map +1 -0
  130. package/lib/typescript/hooks/usePushNotificationPermissions.d.ts +2 -0
  131. package/lib/typescript/hooks/usePushNotificationPermissions.d.ts.map +1 -0
  132. package/lib/typescript/index.d.ts +9 -0
  133. package/lib/typescript/index.d.ts.map +1 -0
  134. package/lib/typescript/initializers/index.d.ts +3 -0
  135. package/lib/typescript/initializers/index.d.ts.map +1 -0
  136. package/lib/typescript/initializers/logRocket.d.ts +2 -0
  137. package/lib/typescript/initializers/logRocket.d.ts.map +1 -0
  138. package/lib/typescript/localization/i18n.d.ts +4 -0
  139. package/lib/typescript/localization/i18n.d.ts.map +1 -0
  140. package/lib/typescript/localization/index.d.ts +7 -0
  141. package/lib/typescript/localization/index.d.ts.map +1 -0
  142. package/lib/typescript/navigation/navigationService.d.ts +14 -0
  143. package/lib/typescript/navigation/navigationService.d.ts.map +1 -0
  144. package/lib/typescript/navigation/screenNames.d.ts +10 -0
  145. package/lib/typescript/navigation/screenNames.d.ts.map +1 -0
  146. package/lib/typescript/navigation/stacks.d.ts +3 -0
  147. package/lib/typescript/navigation/stacks.d.ts.map +1 -0
  148. package/lib/typescript/navigation/types.d.ts +24 -0
  149. package/lib/typescript/navigation/types.d.ts.map +1 -0
  150. package/lib/typescript/providers/NeetoCommonsRNProvider.d.ts +14 -0
  151. package/lib/typescript/providers/NeetoCommonsRNProvider.d.ts.map +1 -0
  152. package/lib/typescript/providers/index.d.ts +2 -0
  153. package/lib/typescript/providers/index.d.ts.map +1 -0
  154. package/lib/typescript/screens/NotificationsScreen.d.ts +11 -0
  155. package/lib/typescript/screens/NotificationsScreen.d.ts.map +1 -0
  156. package/lib/typescript/screens/authentication/AuthOptions.d.ts +7 -0
  157. package/lib/typescript/screens/authentication/AuthOptions.d.ts.map +1 -0
  158. package/lib/typescript/screens/authentication/IncompleteOnboardingInfo.d.ts +4 -0
  159. package/lib/typescript/screens/authentication/IncompleteOnboardingInfo.d.ts.map +1 -0
  160. package/lib/typescript/screens/authentication/LoginScreen.d.ts +3 -0
  161. package/lib/typescript/screens/authentication/LoginScreen.d.ts.map +1 -0
  162. package/lib/typescript/screens/authentication/OTPVerificationScreen.d.ts +4 -0
  163. package/lib/typescript/screens/authentication/OTPVerificationScreen.d.ts.map +1 -0
  164. package/lib/typescript/screens/authentication/Organization.d.ts +11 -0
  165. package/lib/typescript/screens/authentication/Organization.d.ts.map +1 -0
  166. package/lib/typescript/screens/authentication/SubDomainScreen.d.ts +4 -0
  167. package/lib/typescript/screens/authentication/SubDomainScreen.d.ts.map +1 -0
  168. package/lib/typescript/screens/authentication/constants.d.ts +17 -0
  169. package/lib/typescript/screens/authentication/constants.d.ts.map +1 -0
  170. package/lib/typescript/screens/index.d.ts +11 -0
  171. package/lib/typescript/screens/index.d.ts.map +1 -0
  172. package/lib/typescript/screens/profile/ChatWidget.d.ts +3 -0
  173. package/lib/typescript/screens/profile/ChatWidget.d.ts.map +1 -0
  174. package/lib/typescript/screens/profile/ProfileScreen.d.ts +12 -0
  175. package/lib/typescript/screens/profile/ProfileScreen.d.ts.map +1 -0
  176. package/lib/typescript/screens/profile/UserData.d.ts +21 -0
  177. package/lib/typescript/screens/profile/UserData.d.ts.map +1 -0
  178. package/lib/typescript/screens/team_members/Add.d.ts +4 -0
  179. package/lib/typescript/screens/team_members/Add.d.ts.map +1 -0
  180. package/lib/typescript/screens/team_members/Card.d.ts +9 -0
  181. package/lib/typescript/screens/team_members/Card.d.ts.map +1 -0
  182. package/lib/typescript/screens/team_members/Checkbox.d.ts +11 -0
  183. package/lib/typescript/screens/team_members/Checkbox.d.ts.map +1 -0
  184. package/lib/typescript/screens/team_members/Edit.d.ts +5 -0
  185. package/lib/typescript/screens/team_members/Edit.d.ts.map +1 -0
  186. package/lib/typescript/screens/team_members/Email.d.ts +11 -0
  187. package/lib/typescript/screens/team_members/Email.d.ts.map +1 -0
  188. package/lib/typescript/screens/team_members/LoadingCard.d.ts +6 -0
  189. package/lib/typescript/screens/team_members/LoadingCard.d.ts.map +1 -0
  190. package/lib/typescript/screens/team_members/ProductSelect.d.ts +11 -0
  191. package/lib/typescript/screens/team_members/ProductSelect.d.ts.map +1 -0
  192. package/lib/typescript/screens/team_members/RolesRadioGroup.d.ts +14 -0
  193. package/lib/typescript/screens/team_members/RolesRadioGroup.d.ts.map +1 -0
  194. package/lib/typescript/screens/team_members/SaveButtons.d.ts +10 -0
  195. package/lib/typescript/screens/team_members/SaveButtons.d.ts.map +1 -0
  196. package/lib/typescript/screens/team_members/constants.d.ts +16 -0
  197. package/lib/typescript/screens/team_members/constants.d.ts.map +1 -0
  198. package/lib/typescript/screens/team_members/index.d.ts +16 -0
  199. package/lib/typescript/screens/team_members/index.d.ts.map +1 -0
  200. package/lib/typescript/screens/team_members/utils.d.ts +20 -0
  201. package/lib/typescript/screens/team_members/utils.d.ts.map +1 -0
  202. package/lib/typescript/slices/auth.d.ts +31 -0
  203. package/lib/typescript/slices/auth.d.ts.map +1 -0
  204. package/lib/typescript/slices/index.d.ts +6 -0
  205. package/lib/typescript/slices/index.d.ts.map +1 -0
  206. package/lib/typescript/store/hooks.d.ts +6 -0
  207. package/lib/typescript/store/hooks.d.ts.map +1 -0
  208. package/lib/typescript/store/index.d.ts +18 -0
  209. package/lib/typescript/store/index.d.ts.map +1 -0
  210. package/lib/typescript/store/utils.d.ts +8 -0
  211. package/lib/typescript/store/utils.d.ts.map +1 -0
  212. package/lib/typescript/utils/apiHelpers.d.ts +5 -0
  213. package/lib/typescript/utils/apiHelpers.d.ts.map +1 -0
  214. package/package.json +267 -70
  215. package/src/api/app_version.ts +24 -0
  216. package/src/api/auth.ts +68 -0
  217. package/src/api/global_roles.ts +15 -0
  218. package/src/api/notifications.ts +66 -0
  219. package/src/api/organization_roles.ts +17 -0
  220. package/src/api/profile.ts +17 -0
  221. package/src/api/team_members.ts +39 -0
  222. package/src/assets/images/apple-logo.svg +3 -0
  223. package/src/assets/images/google-logo.svg +6 -0
  224. package/src/auth/index.ts +2 -0
  225. package/src/components/AppVersion.ts +154 -0
  226. package/src/components/BottomSheet.ts +9 -0
  227. package/src/components/BottomSheetMenu.ts +6 -0
  228. package/src/components/ConfirmSheet.ts +15 -0
  229. package/src/components/EmptyView.tsx +40 -0
  230. package/src/components/Header/BaseHeader.ts +6 -0
  231. package/src/components/Header/ScreenHeader.ts +6 -0
  232. package/src/components/Header.tsx +139 -0
  233. package/src/components/HyperlinkText.tsx +34 -0
  234. package/src/components/LineLoader.tsx +23 -0
  235. package/src/components/NotificationIcon.tsx +53 -0
  236. package/src/components/NotificationPreferenceList.tsx +132 -0
  237. package/src/components/OfflineScreen.tsx +89 -0
  238. package/src/components/OrganizationItem.tsx +67 -0
  239. package/src/components/SocialButton.tsx +78 -0
  240. package/src/components/TextWithUrl.ts +6 -0
  241. package/src/components/ToggleSwitch.tsx +89 -0
  242. package/src/components/WorkspaceSwitcherPane.tsx +113 -0
  243. package/src/components/constants.ts +16 -0
  244. package/src/components/index.ts +13 -0
  245. package/src/config/axios/caseConversion.ts +60 -0
  246. package/src/config/axios/constants.ts +17 -0
  247. package/src/config/axios/index.ts +291 -0
  248. package/src/config/axios/networkErrorHandler.ts +47 -0
  249. package/src/config/axios/paramsSerializer.ts +9 -0
  250. package/src/config/axios/types.ts +13 -0
  251. package/src/config/bugsnag.ts +48 -0
  252. package/src/config/dayjs.ts +42 -0
  253. package/src/config/googleSignin.ts +36 -0
  254. package/src/config/index.ts +11 -0
  255. package/src/config/validations.ts +15 -0
  256. package/src/constants/index.ts +9 -0
  257. package/src/contexts/index.ts +4 -0
  258. package/src/contexts/localization.tsx +183 -0
  259. package/src/helpers/asyncStore.ts +39 -0
  260. package/src/helpers/index.ts +1 -0
  261. package/src/helpers/keychain.ts +46 -0
  262. package/src/helpers/notifications/apnsToken.ts +69 -0
  263. package/src/helpers/notifications/constants.ts +34 -0
  264. package/src/helpers/notifications/getDeviceToken.ts +17 -0
  265. package/src/helpers/notifications/index.ts +3 -0
  266. package/src/helpers/notifications/registerBackgroundHandlers.ts +62 -0
  267. package/src/helpers/notifications/types.ts +27 -0
  268. package/src/helpers/notifications/usePushNotification.ts +208 -0
  269. package/src/helpers/scale.ts +4 -0
  270. package/src/helpers/utils.ts +68 -0
  271. package/src/hooks/index.ts +2 -0
  272. package/src/hooks/query/queryKeys.ts +8 -0
  273. package/src/hooks/query/useAppVersionApi.ts +12 -0
  274. package/src/hooks/query/useAuth.ts +253 -0
  275. package/src/hooks/query/useNotification.ts +130 -0
  276. package/src/hooks/query/useProfile.ts +21 -0
  277. package/src/hooks/query/useRolesApi.ts +25 -0
  278. package/src/hooks/query/useTeamMembersApi.ts +109 -0
  279. package/src/hooks/useAppState.ts +16 -0
  280. package/src/hooks/usePushNotificationPermissions.ts +111 -0
  281. package/src/index.ts +8 -0
  282. package/src/initializers/index.ts +3 -0
  283. package/src/initializers/logRocket.ts +25 -0
  284. package/src/localization/i18n.ts +19 -0
  285. package/src/localization/index.ts +14 -0
  286. package/src/navigation/navigationService.ts +37 -0
  287. package/src/navigation/screenNames.ts +11 -0
  288. package/src/navigation/stacks.tsx +30 -0
  289. package/src/navigation/types.ts +19 -0
  290. package/src/providers/NeetoCommonsRNProvider.tsx +77 -0
  291. package/src/providers/index.ts +1 -0
  292. package/src/screens/NotificationsScreen.tsx +290 -0
  293. package/src/screens/authentication/AuthOptions.tsx +254 -0
  294. package/src/screens/authentication/IncompleteOnboardingInfo.tsx +110 -0
  295. package/src/screens/authentication/LoginScreen.tsx +170 -0
  296. package/src/screens/authentication/OTPVerificationScreen.tsx +235 -0
  297. package/src/screens/authentication/Organization.tsx +102 -0
  298. package/src/screens/authentication/SubDomainScreen.tsx +176 -0
  299. package/src/screens/authentication/constants.ts +30 -0
  300. package/src/screens/index.ts +10 -0
  301. package/src/screens/profile/ChatWidget.tsx +8 -0
  302. package/src/screens/profile/ProfileScreen.tsx +251 -0
  303. package/src/screens/profile/UserData.tsx +92 -0
  304. package/src/screens/team_members/Add.tsx +248 -0
  305. package/src/screens/team_members/Card.tsx +124 -0
  306. package/src/screens/team_members/Checkbox.tsx +88 -0
  307. package/src/screens/team_members/Edit.tsx +171 -0
  308. package/src/screens/team_members/Email.tsx +59 -0
  309. package/src/screens/team_members/LoadingCard.tsx +75 -0
  310. package/src/screens/team_members/ProductSelect.tsx +218 -0
  311. package/src/screens/team_members/RolesRadioGroup.tsx +135 -0
  312. package/src/screens/team_members/SaveButtons.tsx +62 -0
  313. package/src/screens/team_members/constants.ts +33 -0
  314. package/src/screens/team_members/index.tsx +223 -0
  315. package/src/screens/team_members/utils.ts +84 -0
  316. package/src/slices/auth.ts +86 -0
  317. package/src/slices/index.ts +7 -0
  318. package/src/store/hooks.ts +8 -0
  319. package/src/store/index.ts +47 -0
  320. package/src/store/utils.ts +36 -0
  321. package/src/utils/apiHelpers.ts +7 -0
  322. package/types/assets.d.ts +38 -0
  323. package/types/neeto-icons-rn.d.ts +548 -0
  324. package/api/app_version.js +0 -1
  325. package/api/auth.js +0 -1
  326. package/api/global_roles.js +0 -1
  327. package/api/notifications.js +0 -1
  328. package/api/organization_roles.js +0 -1
  329. package/api/profile.js +0 -1
  330. package/api/team_members.js +0 -1
  331. package/auth/index.d.ts +0 -9
  332. package/auth/index.js +0 -1
  333. package/components/AppVersion.js +0 -1
  334. package/components/BottomSheet.js +0 -1
  335. package/components/BottomSheetMenu.js +0 -1
  336. package/components/ConfirmSheet.js +0 -1
  337. package/components/EmptyView.js +0 -1
  338. package/components/Header/BaseHeader.js +0 -1
  339. package/components/Header/ScreenHeader.js +0 -1
  340. package/components/Header.js +0 -1
  341. package/components/HyperlinkText.js +0 -1
  342. package/components/LineLoader.js +0 -1
  343. package/components/NotificationIcon.js +0 -1
  344. package/components/OfflineScreen.js +0 -1
  345. package/components/TextWithUrl.js +0 -1
  346. package/components/WorkspaceSwitcherPane.js +0 -1
  347. package/components/constants.js +0 -1
  348. package/components/index.js +0 -1
  349. package/config/axios/caseConversion.js +0 -1
  350. package/config/axios/constants.js +0 -1
  351. package/config/axios/index.js +0 -1
  352. package/config/axios/networkErrorHandler.js +0 -1
  353. package/config/axios/paramsSerializer.js +0 -1
  354. package/config/bugsnag.js +0 -1
  355. package/config/dayjs.js +0 -1
  356. package/config/googleSignin.js +0 -1
  357. package/config/index.js +0 -1
  358. package/config/validations.js +0 -1
  359. package/constants/index.d.ts +0 -5
  360. package/constants/index.js +0 -1
  361. package/contexts/index.js +0 -0
  362. package/contexts/localization.js +0 -1
  363. package/helpers/asyncStore.js +0 -1
  364. package/helpers/index.d.ts +0 -13
  365. package/helpers/index.js +0 -1
  366. package/helpers/keychain.d.ts +0 -4
  367. package/helpers/keychain.js +0 -1
  368. package/helpers/notifications/index.d.ts +0 -8
  369. package/helpers/notifications/index.js +0 -1
  370. package/helpers/notifications/usePushNotification.js +0 -1
  371. package/helpers/scale.js +0 -1
  372. package/helpers/utils.js +0 -1
  373. package/hooks/index.d.ts +0 -11
  374. package/hooks/index.js +0 -1
  375. package/hooks/query/constants.js +0 -1
  376. package/hooks/query/queryKeys.js +0 -1
  377. package/hooks/query/useAppVersionApi.js +0 -1
  378. package/hooks/query/useAuth.js +0 -1
  379. package/hooks/query/useNotification.js +0 -1
  380. package/hooks/query/useProfile.js +0 -1
  381. package/hooks/query/useRolesApi.js +0 -1
  382. package/hooks/query/useTeamMembersApi.js +0 -1
  383. package/hooks/useAppState.js +0 -1
  384. package/hooks/usePushNotificationPermissions.js +0 -1
  385. package/initializers/index.js +0 -1
  386. package/initializers/logRocket.js +0 -1
  387. package/localization/index.js +0 -1
  388. package/localization/translations/it.json +0 -13
  389. package/navigation/navigationService.js +0 -1
  390. package/navigation/screenNames.js +0 -1
  391. package/navigation/stacks.js +0 -1
  392. package/providers/NeetoCommonsRNProvider.js +0 -1
  393. package/providers/index.d.ts +0 -16
  394. package/providers/index.js +0 -1
  395. package/screens/NotificationsScreen.js +0 -1
  396. package/screens/authentication/AuthOptions.js +0 -1
  397. package/screens/authentication/IncompleteOnboardingInfo.js +0 -1
  398. package/screens/authentication/LoginScreen.js +0 -1
  399. package/screens/authentication/OTPVerificationScreen.js +0 -1
  400. package/screens/authentication/Organization.js +0 -1
  401. package/screens/authentication/SubDomainScreen.js +0 -1
  402. package/screens/authentication/constants.js +0 -1
  403. package/screens/index.js +0 -1
  404. package/screens/profile/ChatWidget.js +0 -1
  405. package/screens/profile/ProfileScreen.js +0 -1
  406. package/screens/profile/UserData.js +0 -1
  407. package/screens/team_members/Add.js +0 -1
  408. package/screens/team_members/Card.js +0 -1
  409. package/screens/team_members/Checkbox.js +0 -1
  410. package/screens/team_members/Edit.js +0 -1
  411. package/screens/team_members/Email.js +0 -1
  412. package/screens/team_members/LoadingCard.js +0 -1
  413. package/screens/team_members/ProductSelect.js +0 -1
  414. package/screens/team_members/RolesRadioGroup.js +0 -1
  415. package/screens/team_members/SaveButtons.js +0 -1
  416. package/screens/team_members/constants.js +0 -1
  417. package/screens/team_members/index.js +0 -1
  418. package/screens/team_members/utils.js +0 -1
  419. package/slices/auth.js +0 -1
  420. package/slices/index.js +0 -1
  421. package/store/index.d.ts +0 -7
  422. package/store/index.js +0 -1
  423. package/store/utils.js +0 -1
  424. package/utils/apiHelpers.js +0 -1
  425. /package/{assets → src/assets}/images/empty.svg +0 -0
  426. /package/{assets → src/assets}/images/wifi.png +0 -0
  427. /package/{localization → src/localization}/translations/en.json +0 -0
@@ -0,0 +1,18 @@
1
+ import { type PersistConfig } from "redux-persist";
2
+ import { rootReducer } from "../slices";
3
+ export type CommonsState = ReturnType<typeof rootReducer>;
4
+ export type RootState = CommonsState & Record<string, unknown>;
5
+ declare const persistConfig: PersistConfig<CommonsState>;
6
+ declare const Persistor: import("redux-persist").Persistor;
7
+ declare const Store: {
8
+ dispatch: import("redux-thunk").ThunkDispatch<{
9
+ auth: import("../slices/auth").AuthState;
10
+ } & import("redux-persist/es/persistReducer").PersistPartial, undefined, import("redux").UnknownAction>;
11
+ } & import("redux").Store<{
12
+ auth: import("../slices/auth").AuthState;
13
+ } & import("redux-persist/es/persistReducer").PersistPartial, import("redux").UnknownAction, unknown> & {
14
+ Persistor: import("redux-persist").Persistor;
15
+ };
16
+ export type AppDispatch = typeof Store.dispatch;
17
+ export { Store, Persistor, persistConfig };
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/index.ts"],"names":[],"mappings":"AAEA,OAAO,EASL,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/D,QAAA,MAAM,aAAa,EAAE,aAAa,CAAC,YAAY,CAI9C,CAAC;AAaF,QAAA,MAAM,SAAS,mCAA0B,CAAC;AAI1C,QAAA,MAAM,KAAK;;;;;;;;CAA0C,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC,QAAQ,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type Reducer } from "redux";
2
+ interface UpdateRootReducerOptions {
3
+ reducers: Record<string, Reducer>;
4
+ blacklistedReducers?: string[];
5
+ }
6
+ export declare const updateRootReducer: ({ reducers, blacklistedReducers, }: UpdateRootReducerOptions) => void;
7
+ export {};
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/store/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AAOtD,UAAU,wBAAwB;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,eAAO,MAAM,iBAAiB,GAAI,oCAG/B,wBAAwB,SAoB1B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const appVersionsUrl: ({ appName, environment, }: {
2
+ appName: string;
3
+ environment: string;
4
+ }) => string;
5
+ //# sourceMappingURL=apiHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiHelpers.d.ts","sourceRoot":"","sources":["../../../src/utils/apiHelpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,2BAG5B;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,WAAyD,CAAC"}
package/package.json CHANGED
@@ -1,43 +1,153 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-rn",
3
- "version": "1.8.5",
4
- "main": ".",
3
+ "version": "2.0.3",
4
+ "license": "UNLICENSED",
5
+ "main": "./src/index.ts",
6
+ "react-native": "./src/index.ts",
7
+ "types": "./lib/typescript/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/typescript/index.d.ts",
11
+ "react-native": "./src/index.ts",
12
+ "default": "./src/index.ts"
13
+ },
14
+ "./auth": {
15
+ "types": "./lib/typescript/auth/index.d.ts",
16
+ "react-native": "./src/auth/index.ts",
17
+ "default": "./src/auth/index.ts"
18
+ },
19
+ "./components": {
20
+ "types": "./lib/typescript/components/index.d.ts",
21
+ "react-native": "./src/components/index.ts",
22
+ "default": "./src/components/index.ts"
23
+ },
24
+ "./config": {
25
+ "types": "./lib/typescript/config/index.d.ts",
26
+ "react-native": "./src/config/index.ts",
27
+ "default": "./src/config/index.ts"
28
+ },
29
+ "./constants": {
30
+ "types": "./lib/typescript/constants/index.d.ts",
31
+ "react-native": "./src/constants/index.ts",
32
+ "default": "./src/constants/index.ts"
33
+ },
34
+ "./contexts": {
35
+ "types": "./lib/typescript/contexts/index.d.ts",
36
+ "react-native": "./src/contexts/index.ts",
37
+ "default": "./src/contexts/index.ts"
38
+ },
39
+ "./helpers": {
40
+ "types": "./lib/typescript/helpers/index.d.ts",
41
+ "react-native": "./src/helpers/index.ts",
42
+ "default": "./src/helpers/index.ts"
43
+ },
44
+ "./helpers/notifications": {
45
+ "types": "./lib/typescript/helpers/notifications/index.d.ts",
46
+ "react-native": "./src/helpers/notifications/index.ts",
47
+ "default": "./src/helpers/notifications/index.ts"
48
+ },
49
+ "./hooks": {
50
+ "types": "./lib/typescript/hooks/index.d.ts",
51
+ "react-native": "./src/hooks/index.ts",
52
+ "default": "./src/hooks/index.ts"
53
+ },
54
+ "./initializers": {
55
+ "types": "./lib/typescript/initializers/index.d.ts",
56
+ "react-native": "./src/initializers/index.ts",
57
+ "default": "./src/initializers/index.ts"
58
+ },
59
+ "./localization": {
60
+ "types": "./lib/typescript/localization/index.d.ts",
61
+ "react-native": "./src/localization/index.ts",
62
+ "default": "./src/localization/index.ts"
63
+ },
64
+ "./providers": {
65
+ "types": "./lib/typescript/providers/index.d.ts",
66
+ "react-native": "./src/providers/index.ts",
67
+ "default": "./src/providers/index.ts"
68
+ },
69
+ "./screens": {
70
+ "types": "./lib/typescript/screens/index.d.ts",
71
+ "react-native": "./src/screens/index.ts",
72
+ "default": "./src/screens/index.ts"
73
+ },
74
+ "./slices": {
75
+ "types": "./lib/typescript/slices/index.d.ts",
76
+ "react-native": "./src/slices/index.ts",
77
+ "default": "./src/slices/index.ts"
78
+ },
79
+ "./store": {
80
+ "types": "./lib/typescript/store/index.d.ts",
81
+ "react-native": "./src/store/index.ts",
82
+ "default": "./src/store/index.ts"
83
+ },
84
+ "./eslint-config": "./eslint-config/index.js",
85
+ "./package.json": "./package.json",
86
+ "./*": {
87
+ "types": "./lib/typescript/*.d.ts",
88
+ "react-native": "./src/*",
89
+ "default": "./src/*"
90
+ }
91
+ },
5
92
  "files": [
6
- "api",
7
- "auth",
8
- "components",
9
- "config",
10
- "constants",
11
- "contexts",
12
- "helpers",
13
- "hooks",
14
- "localization",
15
- "initializers",
16
- "navigation",
17
- "providers",
18
- "store",
19
- "slices",
20
- "screens",
21
- "assets",
22
- "utils",
23
- "eslint-config"
93
+ "src",
94
+ "lib",
95
+ "types",
96
+ "eslint-config",
97
+ "!src/app",
98
+ "!**/__tests__",
99
+ "!**/*.stories.tsx",
100
+ "!**/.*"
24
101
  ],
25
- "husky": {
26
- "hooks": {
27
- "pre-commit": "lint-staged"
28
- }
102
+ "scripts": {
103
+ "build": "bob build",
104
+ "typecheck": "tsc --noEmit",
105
+ "android:staging": "react-native run-android --variant=stagingdebug --appIdSuffix=staging",
106
+ "android:staging-release": "react-native run-android --variant=stagingrelease --appIdSuffix=staging",
107
+ "android:dev": "react-native run-android --variant=developmentdebug --appIdSuffix=dev",
108
+ "android:dev-release": "react-native run-android --variant=developmentrelease --appIdSuffix=dev",
109
+ "android:prod": "react-native run-android --variant=productiondebug",
110
+ "android:prod-release": "react-native run-android --variant=productionrelease",
111
+ "ios:dev": "react-native run-ios --scheme 'Development'",
112
+ "ios:prod": "react-native run-ios --scheme 'Production'",
113
+ "ios:staging": "react-native run-ios --scheme 'Staging' --configuration 'DebugStaging'",
114
+ "start": "react-native start",
115
+ "test": "jest",
116
+ "lint": "eslint .",
117
+ "format": "prettier --write .",
118
+ "precommit": "lint-staged",
119
+ "boa": "bash ./offloadAndroidApps.sh",
120
+ "pod": "pod-install",
121
+ "prepare": "husky",
122
+ "updateVersion": "npm version ${1} --no-git-tag-version",
123
+ "fastlane:match:appstore": "cd ios && fastlane match appstore",
124
+ "fastlane:match:dev": "cd ios && fastlane match development",
125
+ "fastlane:ios:staging": "yarn fastlane:env:staging && cd ios && fastlane staging",
126
+ "fastlane:ios:prod": "yarn fastlane:env:prod && cd ios && fastlane production",
127
+ "fastlane:android:staging": "yarn fastlane:env:staging && cd android && fastlane staging",
128
+ "fastlane:android:prod": "yarn fastlane:env:prod && cd android && fastlane production",
129
+ "fastlane:env:staging": "cp ./.env.staging ./android/fastlane/.env && cp ./.env.staging ./ios/fastlane/.env",
130
+ "fastlane:env:prod": "cp ./.env.production ./android/fastlane/.env && cp ./.env.production ./ios/fastlane/.env",
131
+ "yalc:publish": "yarn build && yalc publish"
132
+ },
133
+ "lint-staged": {
134
+ "src/**/*.{js,es6,jsx,ts,tsx}": [
135
+ "prettier --write",
136
+ "eslint --fix"
137
+ ]
29
138
  },
30
139
  "peerDependencies": {
31
140
  "@babel/eslint-parser": "^7.19.1",
32
141
  "@bigbinary/app-version-control": "^1.1.6",
33
- "@bigbinary/neetoui-rn": ">=2.0.0",
142
+ "@bigbinary/neetoui-rn": ">=3.0.0",
34
143
  "@eslint/js": "^9.26.0",
35
144
  "@gorhom/bottom-sheet": ">=5.0.0",
36
- "@react-navigation/bottom-tabs": "^6.5.3",
37
- "@react-navigation/material-top-tabs": "^6.5.2",
145
+ "@react-native-firebase/app": "^25.1.0",
146
+ "@react-native-firebase/messaging": "^25.1.0",
38
147
  "@react-navigation/native": "^6.0.13",
39
148
  "@react-navigation/native-stack": ">=6.9.8",
40
- "axios": ">=1.16.0",
149
+ "@tanstack/react-query": "^5.0.0",
150
+ "axios": ">=1.18.0",
41
151
  "dayjs": "^1.11.6",
42
152
  "eslint": "^9.26.0",
43
153
  "eslint-config-prettier": "^9.1.0",
@@ -50,70 +160,135 @@
50
160
  "eslint-plugin-react-native": "^5.0.0",
51
161
  "eslint-plugin-unused-imports": "^4.1.4",
52
162
  "globals": "^15.15.0",
53
- "react": ">=18.2.0 <19",
54
- "react-native": ">=0.70.0",
55
- "react-native-cam": "^5.4.16",
56
- "react-native-gesture-handler": ">=2.0.0",
163
+ "react": ">=19.0.0 <20",
164
+ "react-native": ">=0.78.0",
165
+ "react-native-config": "^1.4.5",
166
+ "react-native-gesture-handler": ">=2.16.1",
57
167
  "react-native-keychain": "10.0.0",
58
- "react-native-notifications": "^5.1.0",
59
- "react-native-push-notification": "^8.1.1",
60
- "react-native-reanimated": ">=3.6.0",
61
- "react-native-safe-area-context": ">=3.3.2",
62
- "react-native-svg": ">=12.3.0",
63
- "react-query": "^3.38.1",
64
- "react-redux": "^8.0.5",
65
- "redux": "^4.1.2",
168
+ "react-native-notify-kit": "^10.5.0",
169
+ "react-native-reanimated": ">=3.16.0",
170
+ "react-native-safe-area-context": ">=4.0.0",
171
+ "react-native-svg": ">=15.0.0",
172
+ "react-redux": "^9.0.0",
173
+ "redux": "^5.0.0",
66
174
  "redux-persist": "^6.0.0",
67
- "redux-saga": "^1.2.2"
175
+ "typescript-eslint": "^8.0.0"
68
176
  },
69
177
  "dependencies": {
70
178
  "@bigbinary/neeto-cist": "^1.0.15",
71
- "@bugsnag/plugin-react-navigation": "^7.11.0",
72
- "@bugsnag/react-native": "^7.11.0",
179
+ "@bigbinary/neeto-icons-rn": "^1.20.74",
180
+ "@bugsnag/plugin-react-navigation": "^8",
181
+ "@bugsnag/react-native": "^8",
73
182
  "@invertase/react-native-apple-authentication": "^2.2.2",
74
- "@logrocket/react-native": "^1.35.1",
75
- "@react-native-async-storage/async-storage": "^1.15.5",
76
- "@react-native-community/netinfo": "^11.3.1",
77
- "@react-native-google-signin/google-signin": "^13.2.0",
78
- "@reduxjs/toolkit": "^1.7.1",
183
+ "@logrocket/react-native": "^3",
184
+ "@react-native-async-storage/async-storage": "^3",
185
+ "@react-native-community/netinfo": "^12",
186
+ "@react-native-google-signin/google-signin": "^16",
187
+ "@reduxjs/toolkit": "^2",
79
188
  "compare-versions": "^6.0.0-rc.1",
80
189
  "formik": "^2.2.9",
190
+ "i18next": "^26.3.6",
81
191
  "qs": "^6.15.2",
82
- "ramda": "^0.28.0",
192
+ "ramda": "^0.29.0",
83
193
  "react-content-loader": "^6.1.0",
84
- "react-native-device-info": "^10.3.0",
85
- "react-native-hyperlink": "^0.0.22",
86
- "react-native-notifications": "^5.1.0",
87
- "react-native-permissions": "^3.2.0",
88
- "react-native-push-notification": "^8.1.1",
194
+ "react-i18next": "^17.0.11",
195
+ "react-native-device-info": "^15",
196
+ "react-native-hyperlink": "^0.1.0",
197
+ "react-native-permissions": "^5",
89
198
  "react-native-remix-icon": "^0.4.0",
90
- "react-native-splash-screen": "^3.3.0",
91
- "react-native-webview": "^11.13.0",
92
- "styled-components": "^5.3.3",
93
- "yup": "^0.32.11"
199
+ "react-native-size-matters": "^0.4.0",
200
+ "react-native-webview": "^14",
201
+ "yup": "^1"
202
+ },
203
+ "devDependencies": {
204
+ "@babel/cli": "^7.18.10",
205
+ "@babel/core": "^7.29.6",
206
+ "@babel/eslint-parser": "^7.19.1",
207
+ "@babel/runtime": "^7.12.5",
208
+ "@bigbinary/app-version-control": "^1.1.6",
209
+ "@bigbinary/neetoui-rn": "^3.0.0",
210
+ "@bugsnag/source-maps": "^2.3.1",
211
+ "@eslint/js": "^9.26.0",
212
+ "@gorhom/bottom-sheet": "^5",
213
+ "@react-native-firebase/app": "^25.1.0",
214
+ "@react-native-firebase/messaging": "^25.1.0",
215
+ "@react-native/babel-preset": "^0.78.0",
216
+ "@react-navigation/native": "^6.0.13",
217
+ "@react-navigation/native-stack": "6.9.8",
218
+ "@shopify/flash-list": "^2.3.2",
219
+ "@tanstack/react-query": "^5",
220
+ "@testing-library/react-native": "^14.0.1",
221
+ "@types/jest": "^29.5.14",
222
+ "@types/qs": "^6.9.0",
223
+ "@types/ramda": "^0.29.0",
224
+ "@types/react": "^19.0.0",
225
+ "axios": "^1.18.0",
226
+ "babel-plugin-module-resolver": "^4.1.0",
227
+ "babel-plugin-transform-remove-console": "^6.9.4",
228
+ "dayjs": "^1.11.6",
229
+ "eslint": "^9.26.0",
230
+ "eslint-config-prettier": "^9.1.0",
231
+ "eslint-import-resolver-babel-module": "^5.3.1",
232
+ "eslint-plugin-import": "^2.31.0",
233
+ "eslint-plugin-prettier": "^5.0.0",
234
+ "eslint-plugin-promise": "^7.2.1",
235
+ "eslint-plugin-react": "^7.37.5",
236
+ "eslint-plugin-react-hooks": "^5.2.0",
237
+ "eslint-plugin-react-native": "^5.0.0",
238
+ "eslint-plugin-unused-imports": "^4.1.4",
239
+ "globals": "^15.15.0",
240
+ "husky": "^9",
241
+ "jest": "^29.7.0",
242
+ "jest-transform-stub": "^2.0.0",
243
+ "lint-staged": "^11.0.0",
244
+ "prettier": "^3.9.6",
245
+ "react": "19.0.0",
246
+ "react-native": "0.78.3",
247
+ "react-native-builder-bob": "^0.43.0",
248
+ "react-native-config": "^1.4.5",
249
+ "react-native-edge-to-edge": "^1.8.1",
250
+ "react-native-gesture-handler": "^2.28.0",
251
+ "react-native-keychain": "10.0.0",
252
+ "react-native-nitro-modules": "0.35.7",
253
+ "react-native-notify-kit": "^10.5.0",
254
+ "react-native-reanimated": "^3.19.0",
255
+ "react-native-safe-area-context": "^5.8.0",
256
+ "react-native-screens": "~4.6.0",
257
+ "react-native-size-matters": "^0.4.0",
258
+ "react-native-svg": "^15.15.5",
259
+ "react-native-svg-transformer": "^1.0.0",
260
+ "react-native-toast-message": "^2",
261
+ "react-native-unistyles": "3.2.5",
262
+ "react-native-version": "^4.0.0",
263
+ "react-redux": "^9.2.0",
264
+ "redux": "^5.0.1",
265
+ "redux-persist": "^6.0.0",
266
+ "test-renderer": "1.0.0",
267
+ "typescript": "^5.7.0",
268
+ "typescript-eslint": "^8.0.0"
94
269
  },
95
270
  "jest": {
96
271
  "preset": "react-native",
272
+ "transform": {
273
+ "^.+\\.(js|jsx|ts|tsx)$": "babel-jest",
274
+ "^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$": "react-native/jest/assetFileTransformer.js"
275
+ },
97
276
  "moduleNameMapper": {
98
- ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
277
+ ".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub",
278
+ "^@bigbinary/neeto-icons-rn$": "<rootDir>/node_modules/@bigbinary/neeto-icons-rn/dist/icons/index.ts"
99
279
  },
100
280
  "setupFiles": [
281
+ "./node_modules/react-native-gesture-handler/jestSetup.js",
282
+ "react-native-unistyles/mocks",
101
283
  "<rootDir>/jest/setup.js"
102
284
  ],
103
- "setupFilesAfterEnv": [
104
- "./node_modules/jest-enzyme/lib/index.js"
105
- ],
106
285
  "moduleDirectories": [
107
286
  "node_modules",
108
287
  "src"
109
288
  ],
110
289
  "transformIgnorePatterns": [
111
- "node_modules/(?!react-native|react-navigation)/"
112
- ],
113
- "testEnvironment": "jsdom"
114
- },
115
- "resolutions": {
116
- "cheerio": "1.0.0-rc.3"
290
+ "node_modules/(?!(jest-)?react-native|@react-native(-community)?|@react-navigation|react-navigation|@bigbinary|@gorhom|@invertase|react-native-.*)/"
291
+ ]
117
292
  },
118
293
  "peerDependenciesMeta": {
119
294
  "@babel/eslint-parser": {
@@ -154,6 +329,28 @@
154
329
  },
155
330
  "globals": {
156
331
  "optional": true
332
+ },
333
+ "typescript-eslint": {
334
+ "optional": true
157
335
  }
158
- }
159
- }
336
+ },
337
+ "resolutions": {
338
+ "shell-quote": "1.10.0",
339
+ "svgo": "3.3.4",
340
+ "linkify-it": "5.0.2",
341
+ "brace-expansion": "1.1.18"
342
+ },
343
+ "react-native-builder-bob": {
344
+ "source": "src",
345
+ "output": "lib",
346
+ "targets": [
347
+ [
348
+ "typescript",
349
+ {
350
+ "project": "tsconfig.build.json"
351
+ }
352
+ ]
353
+ ]
354
+ },
355
+ "packageManager": "yarn@4.18.0"
356
+ }
@@ -0,0 +1,24 @@
1
+ import axios from "axios";
2
+ import Config from "react-native-config";
3
+
4
+ import { Store } from "../store";
5
+ import { appVersionsUrl } from "../utils/apiHelpers";
6
+
7
+ export interface AppVersionInfo {
8
+ version: string;
9
+ force_update?: boolean;
10
+ [key: string]: unknown;
11
+ }
12
+
13
+ const fetch = () => {
14
+ // `String` keeps the pre-TypeScript behaviour for an unset appName, where
15
+ // template interpolation produced the literal "null" in the URL.
16
+ const appName = String(Store.getState().auth.appName);
17
+ const environment = Config.ENVIRONMENT === "staging" ? "net" : "com";
18
+
19
+ return axios.get<AppVersionInfo>(appVersionsUrl({ appName, environment }));
20
+ };
21
+
22
+ const appVersionApi = { fetch };
23
+
24
+ export default appVersionApi;
@@ -0,0 +1,68 @@
1
+ import { Platform } from "react-native";
2
+
3
+ import axios from "axios";
4
+
5
+ import { type Organization } from "../slices/auth";
6
+ import { Store } from "../store";
7
+
8
+ // Exported because it surfaces in the inferred return type of the mutations
9
+ // in useAuth, and a declaration cannot reference a type it cannot name.
10
+ export interface OrganizationsResponse {
11
+ organizations: Organization[];
12
+ }
13
+
14
+ export const generateOTPAPI = async ({ email }: { email: string }) => {
15
+ const {
16
+ data: { user_id },
17
+ } = await axios.post<{ user_id: string }>("/api/mobile/v1/generate_otp", {
18
+ user: { email },
19
+ });
20
+
21
+ return user_id;
22
+ };
23
+
24
+ export const verifyOTPAPI = ({
25
+ code,
26
+ userId,
27
+ }: {
28
+ code: string;
29
+ userId: string;
30
+ }) =>
31
+ axios.post<OrganizationsResponse>("/api/mobile/v1/verify_otp", {
32
+ user: { otp_number: code, user_id: userId },
33
+ });
34
+
35
+ export const loginWithGoogleAPI = async ({
36
+ serverAuthCode,
37
+ }: {
38
+ serverAuthCode: string;
39
+ }) => {
40
+ const appName = Store.getState().auth.appName;
41
+
42
+ return await axios.post<OrganizationsResponse>(
43
+ `/api/mobile/v1/google_login?code=${serverAuthCode}&app_name=${appName}&device=${Platform.OS}`
44
+ );
45
+ };
46
+
47
+ export const loginWithAppleAPI = async ({
48
+ authorizationCode,
49
+ identityToken,
50
+ }: {
51
+ authorizationCode: string;
52
+ identityToken: string;
53
+ }) => {
54
+ const appName = Store.getState().auth.appName;
55
+
56
+ return await axios.post<OrganizationsResponse>(
57
+ `/api/mobile/v1/apple_login?code=${authorizationCode}&id_token=${identityToken}&app_name=${appName}&device=${Platform.OS}`
58
+ );
59
+ };
60
+
61
+ export const fetchOrganizationDetailsAPI = async ({
62
+ subdomain,
63
+ }: {
64
+ subdomain: string;
65
+ }) =>
66
+ await axios.get<{ organization?: { is_onboard?: boolean } }>(
67
+ `/api/mobile/v1/organizations/${subdomain}`
68
+ );
@@ -0,0 +1,15 @@
1
+ import axios from "axios";
2
+
3
+ export interface GlobalRole {
4
+ id: string;
5
+ name: string;
6
+ app_name: string;
7
+ }
8
+
9
+ const fetch = () => axios.get<GlobalRole[]>("/neeto_team_members/global_roles");
10
+
11
+ const globalRolesApi = {
12
+ fetch,
13
+ };
14
+
15
+ export default globalRolesApi;
@@ -0,0 +1,66 @@
1
+ import axios from "axios";
2
+
3
+ // The notification list item as the neeto_notifications engine returns it.
4
+ export interface NotificationItem {
5
+ id: string;
6
+ title: string;
7
+ // The list endpoint names the copy `body`; the FCM data payload calls the
8
+ // same thing `message` (see helpers/notifications/types).
9
+ body: string;
10
+ read_at: string | null;
11
+ created_at: string;
12
+ url?: string;
13
+ [key: string]: unknown;
14
+ }
15
+
16
+ export interface NotificationsPage {
17
+ notifications: NotificationItem[];
18
+ total_count: number;
19
+ unread_count: number;
20
+ }
21
+
22
+ export interface RegisterDevicePayload {
23
+ device: {
24
+ device_token: string;
25
+ platform: string;
26
+ [key: string]: unknown;
27
+ };
28
+ }
29
+
30
+ export const registerDeviceTokenAPI = async (payload: RegisterDevicePayload) =>
31
+ await axios.post("/neeto_notifications/api/v1/devices", payload);
32
+
33
+ export const deleteDeviceTokenAPI = async ({
34
+ notificationDeviceId,
35
+ }: {
36
+ notificationDeviceId: string;
37
+ }) => {
38
+ const url = `/neeto_notifications/api/v1/devices/${notificationDeviceId}`;
39
+
40
+ return await axios.delete(url);
41
+ };
42
+
43
+ export const fetchNotificationsAPI = async ({ page }: { page: number }) =>
44
+ await axios.get<NotificationsPage>(
45
+ "/neeto_notifications/api/v1/notifications",
46
+ {
47
+ params: { page },
48
+ }
49
+ );
50
+
51
+ export const markReadUnReadNotificationAPI = async ({
52
+ notificationId,
53
+ readAt,
54
+ }: {
55
+ notificationId: string;
56
+ readAt: string | null;
57
+ }) =>
58
+ await axios.put(
59
+ `/neeto_notifications/api/v1/notifications/${notificationId}`,
60
+ {
61
+ notification: { read_at: readAt },
62
+ }
63
+ );
64
+
65
+ export const markAllNotificationsReadAPI = async () =>
66
+ await axios.post("/neeto_notifications/api/v1/notifications/mark_all_read");
@@ -0,0 +1,17 @@
1
+ import axios from "axios";
2
+
3
+ export interface OrganizationRole {
4
+ id: string;
5
+ name: string;
6
+ }
7
+
8
+ const fetch = () =>
9
+ axios.get<{ organization_roles: OrganizationRole[] }>(
10
+ "/neeto_team_members/organization_roles"
11
+ );
12
+
13
+ const organizationRolesApi = {
14
+ fetch,
15
+ };
16
+
17
+ export default organizationRolesApi;
@@ -0,0 +1,17 @@
1
+ import axios from "axios";
2
+
3
+ export interface Permission {
4
+ name: string;
5
+ }
6
+
7
+ export interface Profile {
8
+ id: string;
9
+ name: string;
10
+ email: string;
11
+ profile_image_url?: string | null;
12
+ permissions?: Permission[];
13
+ [key: string]: unknown;
14
+ }
15
+
16
+ export const getProfileApi = () =>
17
+ axios.get<{ user: Profile }>("/api/mobile/v1/profile");