@bigbinary/neeto-commons-rn 1.8.4 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/eslint-config/index.js +366 -0
- package/eslint-config/rules/no-dangling-constants.js +35 -0
- package/eslint-config/rules/no-redundant-string-templates.js +85 -0
- package/lib/typescript/api/app_version.d.ts +10 -0
- package/lib/typescript/api/app_version.d.ts.map +1 -0
- package/lib/typescript/api/auth.d.ts +26 -0
- package/lib/typescript/api/auth.d.ts.map +1 -0
- package/lib/typescript/api/global_roles.d.ts +10 -0
- package/lib/typescript/api/global_roles.d.ts.map +1 -0
- package/lib/typescript/api/notifications.d.ts +38 -0
- package/lib/typescript/api/notifications.d.ts.map +1 -0
- package/lib/typescript/api/organization_roles.d.ts +11 -0
- package/lib/typescript/api/organization_roles.d.ts.map +1 -0
- package/lib/typescript/api/profile.d.ts +15 -0
- package/lib/typescript/api/profile.d.ts.map +1 -0
- package/lib/typescript/api/team_members.d.ts +34 -0
- package/lib/typescript/api/team_members.d.ts.map +1 -0
- package/lib/typescript/auth/index.d.ts +3 -0
- package/lib/typescript/auth/index.d.ts.map +1 -0
- package/lib/typescript/components/AppVersion.d.ts +2 -0
- package/lib/typescript/components/AppVersion.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet.d.ts +9 -0
- package/lib/typescript/components/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheetMenu.d.ts +7 -0
- package/lib/typescript/components/BottomSheetMenu.d.ts.map +1 -0
- package/lib/typescript/components/ConfirmSheet.d.ts +15 -0
- package/lib/typescript/components/ConfirmSheet.d.ts.map +1 -0
- package/lib/typescript/components/EmptyView.d.ts +19 -0
- package/lib/typescript/components/EmptyView.d.ts.map +1 -0
- package/lib/typescript/components/Header/BaseHeader.d.ts +7 -0
- package/lib/typescript/components/Header/BaseHeader.d.ts.map +1 -0
- package/lib/typescript/components/Header/ScreenHeader.d.ts +7 -0
- package/lib/typescript/components/Header/ScreenHeader.d.ts.map +1 -0
- package/lib/typescript/components/Header.d.ts +22 -0
- package/lib/typescript/components/Header.d.ts.map +1 -0
- package/lib/typescript/components/HyperlinkText.d.ts +17 -0
- package/lib/typescript/components/HyperlinkText.d.ts.map +1 -0
- package/lib/typescript/components/LineLoader.d.ts +13 -0
- package/lib/typescript/components/LineLoader.d.ts.map +1 -0
- package/lib/typescript/components/NotificationIcon.d.ts +6 -0
- package/lib/typescript/components/NotificationIcon.d.ts.map +1 -0
- package/lib/typescript/components/NotificationPreferenceList.d.ts +14 -0
- package/lib/typescript/components/NotificationPreferenceList.d.ts.map +1 -0
- package/lib/typescript/components/OfflineScreen.d.ts +7 -0
- package/lib/typescript/components/OfflineScreen.d.ts.map +1 -0
- package/lib/typescript/components/OrganizationItem.d.ts +8 -0
- package/lib/typescript/components/OrganizationItem.d.ts.map +1 -0
- package/lib/typescript/components/SocialButton.d.ts +11 -0
- package/lib/typescript/components/SocialButton.d.ts.map +1 -0
- package/lib/typescript/components/TextWithUrl.d.ts +7 -0
- package/lib/typescript/components/TextWithUrl.d.ts.map +1 -0
- package/lib/typescript/components/ToggleSwitch.d.ts +8 -0
- package/lib/typescript/components/ToggleSwitch.d.ts.map +1 -0
- package/lib/typescript/components/WorkspaceSwitcherPane.d.ts +9 -0
- package/lib/typescript/components/WorkspaceSwitcherPane.d.ts.map +1 -0
- package/lib/typescript/components/constants.d.ts +7 -0
- package/lib/typescript/components/constants.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +14 -0
- package/lib/typescript/components/index.d.ts.map +1 -0
- package/lib/typescript/config/axios/caseConversion.d.ts +4 -0
- package/lib/typescript/config/axios/caseConversion.d.ts.map +1 -0
- package/lib/typescript/config/axios/constants.d.ts +4 -0
- package/lib/typescript/config/axios/constants.d.ts.map +1 -0
- package/lib/typescript/config/axios/index.d.ts +13 -0
- package/lib/typescript/config/axios/index.d.ts.map +1 -0
- package/lib/typescript/config/axios/networkErrorHandler.d.ts +5 -0
- package/lib/typescript/config/axios/networkErrorHandler.d.ts.map +1 -0
- package/lib/typescript/config/axios/paramsSerializer.d.ts +3 -0
- package/lib/typescript/config/axios/paramsSerializer.d.ts.map +1 -0
- package/lib/typescript/config/axios/types.d.ts +10 -0
- package/lib/typescript/config/axios/types.d.ts.map +1 -0
- package/lib/typescript/config/bugsnag.d.ts +4 -0
- package/lib/typescript/config/bugsnag.d.ts.map +1 -0
- package/lib/typescript/config/dayjs.d.ts +23 -0
- package/lib/typescript/config/dayjs.d.ts.map +1 -0
- package/lib/typescript/config/googleSignin.d.ts +2 -0
- package/lib/typescript/config/googleSignin.d.ts.map +1 -0
- package/lib/typescript/config/index.d.ts +2 -0
- package/lib/typescript/config/index.d.ts.map +1 -0
- package/lib/typescript/config/validations.d.ts +2 -0
- package/lib/typescript/config/validations.d.ts.map +1 -0
- package/lib/typescript/constants/index.d.ts +8 -0
- package/lib/typescript/constants/index.d.ts.map +1 -0
- package/lib/typescript/contexts/index.d.ts +2 -0
- package/lib/typescript/contexts/index.d.ts.map +1 -0
- package/lib/typescript/contexts/localization.d.ts +26 -0
- package/lib/typescript/contexts/localization.d.ts.map +1 -0
- package/lib/typescript/helpers/asyncStore.d.ts +6 -0
- package/lib/typescript/helpers/asyncStore.d.ts.map +1 -0
- package/lib/typescript/helpers/index.d.ts +2 -0
- package/lib/typescript/helpers/index.d.ts.map +1 -0
- package/lib/typescript/helpers/keychain.d.ts +4 -0
- package/lib/typescript/helpers/keychain.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/apnsToken.d.ts +2 -0
- package/lib/typescript/helpers/notifications/apnsToken.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/constants.d.ts +5 -0
- package/lib/typescript/helpers/notifications/constants.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/getDeviceToken.d.ts +2 -0
- package/lib/typescript/helpers/notifications/getDeviceToken.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/index.d.ts +4 -0
- package/lib/typescript/helpers/notifications/index.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/registerBackgroundHandlers.d.ts +3 -0
- package/lib/typescript/helpers/notifications/registerBackgroundHandlers.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/types.d.ts +19 -0
- package/lib/typescript/helpers/notifications/types.d.ts.map +1 -0
- package/lib/typescript/helpers/notifications/usePushNotification.d.ts +7 -0
- package/lib/typescript/helpers/notifications/usePushNotification.d.ts.map +1 -0
- package/lib/typescript/helpers/scale.d.ts +2 -0
- package/lib/typescript/helpers/scale.d.ts.map +1 -0
- package/lib/typescript/helpers/utils.d.ts +5 -0
- package/lib/typescript/helpers/utils.d.ts.map +1 -0
- package/lib/typescript/hooks/index.d.ts +3 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -0
- package/lib/typescript/hooks/query/queryKeys.d.ts +9 -0
- package/lib/typescript/hooks/query/queryKeys.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useAppVersionApi.d.ts +2 -0
- package/lib/typescript/hooks/query/useAppVersionApi.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useAuth.d.ts +27 -0
- package/lib/typescript/hooks/query/useAuth.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useNotification.d.ts +19 -0
- package/lib/typescript/hooks/query/useNotification.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useProfile.d.ts +9 -0
- package/lib/typescript/hooks/query/useProfile.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useRolesApi.d.ts +4 -0
- package/lib/typescript/hooks/query/useRolesApi.d.ts.map +1 -0
- package/lib/typescript/hooks/query/useTeamMembersApi.d.ts +23 -0
- package/lib/typescript/hooks/query/useTeamMembersApi.d.ts.map +1 -0
- package/lib/typescript/hooks/useAppState.d.ts +2 -0
- package/lib/typescript/hooks/useAppState.d.ts.map +1 -0
- package/lib/typescript/hooks/usePushNotificationPermissions.d.ts +2 -0
- package/lib/typescript/hooks/usePushNotificationPermissions.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +9 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/initializers/index.d.ts +3 -0
- package/lib/typescript/initializers/index.d.ts.map +1 -0
- package/lib/typescript/initializers/logRocket.d.ts +2 -0
- package/lib/typescript/initializers/logRocket.d.ts.map +1 -0
- package/lib/typescript/localization/i18n.d.ts +4 -0
- package/lib/typescript/localization/i18n.d.ts.map +1 -0
- package/lib/typescript/localization/index.d.ts +7 -0
- package/lib/typescript/localization/index.d.ts.map +1 -0
- package/lib/typescript/navigation/navigationService.d.ts +14 -0
- package/lib/typescript/navigation/navigationService.d.ts.map +1 -0
- package/lib/typescript/navigation/screenNames.d.ts +10 -0
- package/lib/typescript/navigation/screenNames.d.ts.map +1 -0
- package/lib/typescript/navigation/stacks.d.ts +3 -0
- package/lib/typescript/navigation/stacks.d.ts.map +1 -0
- package/lib/typescript/navigation/types.d.ts +24 -0
- package/lib/typescript/navigation/types.d.ts.map +1 -0
- package/lib/typescript/providers/NeetoCommonsRNProvider.d.ts +14 -0
- package/lib/typescript/providers/NeetoCommonsRNProvider.d.ts.map +1 -0
- package/lib/typescript/providers/index.d.ts +2 -0
- package/lib/typescript/providers/index.d.ts.map +1 -0
- package/lib/typescript/screens/NotificationsScreen.d.ts +11 -0
- package/lib/typescript/screens/NotificationsScreen.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/AuthOptions.d.ts +7 -0
- package/lib/typescript/screens/authentication/AuthOptions.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/IncompleteOnboardingInfo.d.ts +4 -0
- package/lib/typescript/screens/authentication/IncompleteOnboardingInfo.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/LoginScreen.d.ts +3 -0
- package/lib/typescript/screens/authentication/LoginScreen.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/OTPVerificationScreen.d.ts +4 -0
- package/lib/typescript/screens/authentication/OTPVerificationScreen.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/Organization.d.ts +11 -0
- package/lib/typescript/screens/authentication/Organization.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/SubDomainScreen.d.ts +4 -0
- package/lib/typescript/screens/authentication/SubDomainScreen.d.ts.map +1 -0
- package/lib/typescript/screens/authentication/constants.d.ts +17 -0
- package/lib/typescript/screens/authentication/constants.d.ts.map +1 -0
- package/lib/typescript/screens/index.d.ts +11 -0
- package/lib/typescript/screens/index.d.ts.map +1 -0
- package/lib/typescript/screens/profile/ChatWidget.d.ts +3 -0
- package/lib/typescript/screens/profile/ChatWidget.d.ts.map +1 -0
- package/lib/typescript/screens/profile/ProfileScreen.d.ts +12 -0
- package/lib/typescript/screens/profile/ProfileScreen.d.ts.map +1 -0
- package/lib/typescript/screens/profile/UserData.d.ts +21 -0
- package/lib/typescript/screens/profile/UserData.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Add.d.ts +4 -0
- package/lib/typescript/screens/team_members/Add.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Card.d.ts +9 -0
- package/lib/typescript/screens/team_members/Card.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Checkbox.d.ts +11 -0
- package/lib/typescript/screens/team_members/Checkbox.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Edit.d.ts +5 -0
- package/lib/typescript/screens/team_members/Edit.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/Email.d.ts +11 -0
- package/lib/typescript/screens/team_members/Email.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/LoadingCard.d.ts +6 -0
- package/lib/typescript/screens/team_members/LoadingCard.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/ProductSelect.d.ts +11 -0
- package/lib/typescript/screens/team_members/ProductSelect.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/RolesRadioGroup.d.ts +14 -0
- package/lib/typescript/screens/team_members/RolesRadioGroup.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/SaveButtons.d.ts +10 -0
- package/lib/typescript/screens/team_members/SaveButtons.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/constants.d.ts +16 -0
- package/lib/typescript/screens/team_members/constants.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/index.d.ts +16 -0
- package/lib/typescript/screens/team_members/index.d.ts.map +1 -0
- package/lib/typescript/screens/team_members/utils.d.ts +20 -0
- package/lib/typescript/screens/team_members/utils.d.ts.map +1 -0
- package/lib/typescript/slices/auth.d.ts +31 -0
- package/lib/typescript/slices/auth.d.ts.map +1 -0
- package/lib/typescript/slices/index.d.ts +6 -0
- package/lib/typescript/slices/index.d.ts.map +1 -0
- package/lib/typescript/store/hooks.d.ts +6 -0
- package/lib/typescript/store/hooks.d.ts.map +1 -0
- package/lib/typescript/store/index.d.ts +18 -0
- package/lib/typescript/store/index.d.ts.map +1 -0
- package/lib/typescript/store/utils.d.ts +8 -0
- package/lib/typescript/store/utils.d.ts.map +1 -0
- package/lib/typescript/utils/apiHelpers.d.ts +5 -0
- package/lib/typescript/utils/apiHelpers.d.ts.map +1 -0
- package/package.json +267 -71
- package/src/api/app_version.ts +24 -0
- package/src/api/auth.ts +68 -0
- package/src/api/global_roles.ts +15 -0
- package/src/api/notifications.ts +66 -0
- package/src/api/organization_roles.ts +17 -0
- package/src/api/profile.ts +17 -0
- package/src/api/team_members.ts +39 -0
- package/src/assets/images/apple-logo.svg +3 -0
- package/src/assets/images/google-logo.svg +6 -0
- package/src/auth/index.ts +2 -0
- package/src/components/AppVersion.ts +154 -0
- package/src/components/BottomSheet.ts +9 -0
- package/src/components/BottomSheetMenu.ts +6 -0
- package/src/components/ConfirmSheet.ts +15 -0
- package/src/components/EmptyView.tsx +40 -0
- package/src/components/Header/BaseHeader.ts +6 -0
- package/src/components/Header/ScreenHeader.ts +6 -0
- package/src/components/Header.tsx +139 -0
- package/src/components/HyperlinkText.tsx +34 -0
- package/src/components/LineLoader.tsx +23 -0
- package/src/components/NotificationIcon.tsx +53 -0
- package/src/components/NotificationPreferenceList.tsx +132 -0
- package/src/components/OfflineScreen.tsx +89 -0
- package/src/components/OrganizationItem.tsx +67 -0
- package/src/components/SocialButton.tsx +78 -0
- package/src/components/TextWithUrl.ts +6 -0
- package/src/components/ToggleSwitch.tsx +89 -0
- package/src/components/WorkspaceSwitcherPane.tsx +113 -0
- package/src/components/constants.ts +16 -0
- package/src/components/index.ts +13 -0
- package/src/config/axios/caseConversion.ts +60 -0
- package/src/config/axios/constants.ts +17 -0
- package/src/config/axios/index.ts +291 -0
- package/src/config/axios/networkErrorHandler.ts +47 -0
- package/src/config/axios/paramsSerializer.ts +9 -0
- package/src/config/axios/types.ts +13 -0
- package/src/config/bugsnag.ts +48 -0
- package/src/config/dayjs.ts +42 -0
- package/src/config/googleSignin.ts +36 -0
- package/src/config/index.ts +11 -0
- package/src/config/validations.ts +15 -0
- package/src/constants/index.ts +9 -0
- package/src/contexts/index.ts +4 -0
- package/src/contexts/localization.tsx +183 -0
- package/src/helpers/asyncStore.ts +39 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/keychain.ts +46 -0
- package/src/helpers/notifications/apnsToken.ts +69 -0
- package/src/helpers/notifications/constants.ts +34 -0
- package/src/helpers/notifications/getDeviceToken.ts +17 -0
- package/src/helpers/notifications/index.ts +3 -0
- package/src/helpers/notifications/registerBackgroundHandlers.ts +62 -0
- package/src/helpers/notifications/types.ts +27 -0
- package/src/helpers/notifications/usePushNotification.ts +208 -0
- package/src/helpers/scale.ts +4 -0
- package/src/helpers/utils.ts +68 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/query/queryKeys.ts +8 -0
- package/src/hooks/query/useAppVersionApi.ts +12 -0
- package/src/hooks/query/useAuth.ts +253 -0
- package/src/hooks/query/useNotification.ts +130 -0
- package/src/hooks/query/useProfile.ts +21 -0
- package/src/hooks/query/useRolesApi.ts +25 -0
- package/src/hooks/query/useTeamMembersApi.ts +109 -0
- package/src/hooks/useAppState.ts +16 -0
- package/src/hooks/usePushNotificationPermissions.ts +111 -0
- package/src/index.ts +8 -0
- package/src/initializers/index.ts +3 -0
- package/src/initializers/logRocket.ts +25 -0
- package/src/localization/i18n.ts +19 -0
- package/src/localization/index.ts +14 -0
- package/src/navigation/navigationService.ts +37 -0
- package/src/navigation/screenNames.ts +11 -0
- package/src/navigation/stacks.tsx +30 -0
- package/src/navigation/types.ts +19 -0
- package/src/providers/NeetoCommonsRNProvider.tsx +77 -0
- package/src/providers/index.ts +1 -0
- package/src/screens/NotificationsScreen.tsx +290 -0
- package/src/screens/authentication/AuthOptions.tsx +254 -0
- package/src/screens/authentication/IncompleteOnboardingInfo.tsx +110 -0
- package/src/screens/authentication/LoginScreen.tsx +170 -0
- package/src/screens/authentication/OTPVerificationScreen.tsx +235 -0
- package/src/screens/authentication/Organization.tsx +102 -0
- package/src/screens/authentication/SubDomainScreen.tsx +176 -0
- package/src/screens/authentication/constants.ts +30 -0
- package/src/screens/index.ts +10 -0
- package/src/screens/profile/ChatWidget.tsx +8 -0
- package/src/screens/profile/ProfileScreen.tsx +251 -0
- package/src/screens/profile/UserData.tsx +92 -0
- package/src/screens/team_members/Add.tsx +248 -0
- package/src/screens/team_members/Card.tsx +124 -0
- package/src/screens/team_members/Checkbox.tsx +88 -0
- package/src/screens/team_members/Edit.tsx +171 -0
- package/src/screens/team_members/Email.tsx +59 -0
- package/src/screens/team_members/LoadingCard.tsx +75 -0
- package/src/screens/team_members/ProductSelect.tsx +218 -0
- package/src/screens/team_members/RolesRadioGroup.tsx +135 -0
- package/src/screens/team_members/SaveButtons.tsx +62 -0
- package/src/screens/team_members/constants.ts +33 -0
- package/src/screens/team_members/index.tsx +223 -0
- package/src/screens/team_members/utils.ts +84 -0
- package/src/slices/auth.ts +86 -0
- package/src/slices/index.ts +7 -0
- package/src/store/hooks.ts +8 -0
- package/src/store/index.ts +47 -0
- package/src/store/utils.ts +36 -0
- package/src/utils/apiHelpers.ts +7 -0
- package/types/assets.d.ts +38 -0
- package/types/neeto-icons-rn.d.ts +548 -0
- package/api/app_version.js +0 -1
- package/api/auth.js +0 -1
- package/api/global_roles.js +0 -1
- package/api/notifications.js +0 -1
- package/api/organization_roles.js +0 -1
- package/api/profile.js +0 -1
- package/api/team_members.js +0 -1
- package/auth/index.d.ts +0 -9
- package/auth/index.js +0 -1
- package/components/AppVersion.js +0 -1
- package/components/BottomSheet.js +0 -1
- package/components/BottomSheetMenu.js +0 -1
- package/components/ConfirmSheet.js +0 -1
- package/components/EmptyView.js +0 -1
- package/components/Header/BaseHeader.js +0 -1
- package/components/Header/ScreenHeader.js +0 -1
- package/components/Header.js +0 -1
- package/components/HyperlinkText.js +0 -1
- package/components/LineLoader.js +0 -1
- package/components/NotificationIcon.js +0 -1
- package/components/OfflineScreen.js +0 -1
- package/components/TextWithUrl.js +0 -1
- package/components/WorkspaceSwitcherPane.js +0 -1
- package/components/constants.js +0 -1
- package/components/index.js +0 -1
- package/config/axios/caseConversion.js +0 -1
- package/config/axios/constants.js +0 -1
- package/config/axios/index.js +0 -1
- package/config/axios/networkErrorHandler.js +0 -1
- package/config/axios/paramsSerializer.js +0 -1
- package/config/bugsnag.js +0 -1
- package/config/dayjs.js +0 -1
- package/config/googleSignin.js +0 -1
- package/config/index.js +0 -1
- package/config/validations.js +0 -1
- package/constants/index.d.ts +0 -5
- package/constants/index.js +0 -1
- package/contexts/index.js +0 -0
- package/contexts/localization.js +0 -1
- package/helpers/asyncStore.js +0 -1
- package/helpers/index.d.ts +0 -13
- package/helpers/index.js +0 -1
- package/helpers/keychain.d.ts +0 -4
- package/helpers/keychain.js +0 -1
- package/helpers/notifications/index.d.ts +0 -8
- package/helpers/notifications/index.js +0 -1
- package/helpers/notifications/usePushNotification.js +0 -1
- package/helpers/scale.js +0 -1
- package/helpers/utils.js +0 -1
- package/hooks/index.d.ts +0 -11
- package/hooks/index.js +0 -1
- package/hooks/query/constants.js +0 -1
- package/hooks/query/queryKeys.js +0 -1
- package/hooks/query/useAppVersionApi.js +0 -1
- package/hooks/query/useAuth.js +0 -1
- package/hooks/query/useNotification.js +0 -1
- package/hooks/query/useProfile.js +0 -1
- package/hooks/query/useRolesApi.js +0 -1
- package/hooks/query/useTeamMembersApi.js +0 -1
- package/hooks/useAppState.js +0 -1
- package/hooks/usePushNotificationPermissions.js +0 -1
- package/initializers/index.js +0 -1
- package/initializers/logRocket.js +0 -1
- package/localization/index.js +0 -1
- package/localization/translations/it.json +0 -13
- package/navigation/navigationService.js +0 -1
- package/navigation/screenNames.js +0 -1
- package/navigation/stacks.js +0 -1
- package/providers/NeetoCommonsRNProvider.js +0 -1
- package/providers/index.d.ts +0 -16
- package/providers/index.js +0 -1
- package/screens/NotificationsScreen.js +0 -1
- package/screens/authentication/AuthOptions.js +0 -1
- package/screens/authentication/IncompleteOnboardingInfo.js +0 -1
- package/screens/authentication/LoginScreen.js +0 -1
- package/screens/authentication/OTPVerificationScreen.js +0 -1
- package/screens/authentication/Organization.js +0 -1
- package/screens/authentication/SubDomainScreen.js +0 -1
- package/screens/authentication/constants.js +0 -1
- package/screens/index.js +0 -1
- package/screens/profile/ChatWidget.js +0 -1
- package/screens/profile/ProfileScreen.js +0 -1
- package/screens/profile/UserData.js +0 -1
- package/screens/team_members/Add.js +0 -1
- package/screens/team_members/Card.js +0 -1
- package/screens/team_members/Checkbox.js +0 -1
- package/screens/team_members/Edit.js +0 -1
- package/screens/team_members/Email.js +0 -1
- package/screens/team_members/LoadingCard.js +0 -1
- package/screens/team_members/ProductSelect.js +0 -1
- package/screens/team_members/RolesRadioGroup.js +0 -1
- package/screens/team_members/SaveButtons.js +0 -1
- package/screens/team_members/constants.js +0 -1
- package/screens/team_members/index.js +0 -1
- package/screens/team_members/utils.js +0 -1
- package/slices/auth.js +0 -1
- package/slices/index.js +0 -1
- package/store/index.d.ts +0 -7
- package/store/index.js +0 -1
- package/store/utils.js +0 -1
- package/utils/apiHelpers.js +0 -1
- /package/{assets → src/assets}/images/empty.svg +0 -0
- /package/{assets → src/assets}/images/wifi.png +0 -0
- /package/{localization → src/localization}/translations/en.json +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# neeto-commons-rn
|
|
2
|
+
|
|
3
|
+
This project is a React Native boilerplate that can be used to kickstart a
|
|
4
|
+
mobile application.
|
|
5
|
+
|
|
6
|
+
## Development Setup
|
|
7
|
+
|
|
8
|
+
1. Configure your machine for React Native development by following the
|
|
9
|
+
[official documentation](https://reactnative.dev/docs/environment-setup).
|
|
10
|
+
|
|
11
|
+
2. Clone the repo.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone https://github.com/bigbinary/neeto-commons-rn.git
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. Navigate to the project directory.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cd 'project-name'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
4. Install project dependencies.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
5. Install iOS dependencies.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx pod-install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Running the app
|
|
36
|
+
|
|
37
|
+
1. To run the Android or iOS version of the app.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
yarn <platform>:<environment>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| param | values |
|
|
44
|
+
| ------------- | ------------------------ |
|
|
45
|
+
| `platform` | `ios`, `android` |
|
|
46
|
+
| `environment` | `dev`, `staging`, `prod` |
|
|
47
|
+
|
|
48
|
+
2. To run Android release build with the corresponding configuration,
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
yarn android:<environment>-release
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
> Execute `yarn run` command to get a list of all available scripts.
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
The project includes detailed documentation on various aspects of the
|
|
59
|
+
application:
|
|
60
|
+
|
|
61
|
+
- [Android Notifications](./docs/android-notifications.md) - Comprehensive guide
|
|
62
|
+
to the notification system for Android, including handling for Android 13+
|
|
63
|
+
permission requirements.
|
|
64
|
+
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
// Shared ESLint 9 flat config for neeto React Native apps.
|
|
2
|
+
//
|
|
3
|
+
// Usage in an app's eslint.config.js:
|
|
4
|
+
//
|
|
5
|
+
// const neetoRNConfig = require("@bigbinary/neeto-commons-rn/eslint-config");
|
|
6
|
+
// const aliases = require("./aliases.json");
|
|
7
|
+
//
|
|
8
|
+
// module.exports = neetoRNConfig({ aliases });
|
|
9
|
+
//
|
|
10
|
+
// Apps with TypeScript sources pass `typescript: true` and add the
|
|
11
|
+
// `typescript-eslint` package as a devDependency; without the flag nothing
|
|
12
|
+
// TypeScript-related is required or loaded.
|
|
13
|
+
//
|
|
14
|
+
// The plugins are resolved from the consuming app's node_modules — install
|
|
15
|
+
// the packages listed under peerDependencies (lint group) as devDependencies.
|
|
16
|
+
const babelParser = require("@babel/eslint-parser");
|
|
17
|
+
const js = require("@eslint/js");
|
|
18
|
+
const prettierConfig = require("eslint-config-prettier");
|
|
19
|
+
const importPlugin = require("eslint-plugin-import");
|
|
20
|
+
const prettierPlugin = require("eslint-plugin-prettier");
|
|
21
|
+
const promisePlugin = require("eslint-plugin-promise");
|
|
22
|
+
const reactPlugin = require("eslint-plugin-react");
|
|
23
|
+
const reactHooksPlugin = require("eslint-plugin-react-hooks");
|
|
24
|
+
const reactNativePlugin = require("eslint-plugin-react-native");
|
|
25
|
+
const unusedImportsPlugin = require("eslint-plugin-unused-imports");
|
|
26
|
+
const globals = require("globals");
|
|
27
|
+
|
|
28
|
+
const neetoPlugin = {
|
|
29
|
+
rules: {
|
|
30
|
+
"no-dangling-constants": require("./rules/no-dangling-constants"),
|
|
31
|
+
"no-redundant-string-templates": require("./rules/no-redundant-string-templates"),
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const DEFAULT_IGNORES = [
|
|
36
|
+
"node_modules/**",
|
|
37
|
+
"android/**",
|
|
38
|
+
"ios/**",
|
|
39
|
+
"vendor/**",
|
|
40
|
+
"coverage/**",
|
|
41
|
+
"patches/**",
|
|
42
|
+
"**/*.json",
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
// TypeScript sources reuse every shared rule. Only the parser, the unused-vars
|
|
46
|
+
// implementation, and the checks the compiler already performs differ.
|
|
47
|
+
const typescriptBlock = (javascript, aliases) => {
|
|
48
|
+
const tseslint = require("typescript-eslint");
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
...javascript,
|
|
52
|
+
files: ["**/*.{ts,tsx}"],
|
|
53
|
+
languageOptions: {
|
|
54
|
+
...javascript.languageOptions,
|
|
55
|
+
parser: tseslint.parser,
|
|
56
|
+
},
|
|
57
|
+
plugins: {
|
|
58
|
+
...javascript.plugins,
|
|
59
|
+
"@typescript-eslint": tseslint.plugin,
|
|
60
|
+
},
|
|
61
|
+
settings: {
|
|
62
|
+
...javascript.settings,
|
|
63
|
+
"import/resolver": {
|
|
64
|
+
"babel-module": {
|
|
65
|
+
root: ["."],
|
|
66
|
+
alias: aliases,
|
|
67
|
+
extensions: [".ts", ".tsx", ".js", ".jsx"],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
rules: {
|
|
72
|
+
...javascript.rules,
|
|
73
|
+
// The compiler resolves globals and reports unused bindings with an
|
|
74
|
+
// understanding of type-only syntax that these rules lack.
|
|
75
|
+
"no-undef": "off",
|
|
76
|
+
"no-unused-vars": "off",
|
|
77
|
+
"@typescript-eslint/no-unused-vars": [
|
|
78
|
+
"error",
|
|
79
|
+
{
|
|
80
|
+
args: "all",
|
|
81
|
+
argsIgnorePattern: "^_",
|
|
82
|
+
destructuredArrayIgnorePattern: "^_",
|
|
83
|
+
caughtErrors: "all",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
87
|
+
"error",
|
|
88
|
+
{ fixStyle: "inline-type-imports" },
|
|
89
|
+
],
|
|
90
|
+
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
|
|
91
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
92
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
module.exports = ({ aliases = {}, ignores = [], typescript = false } = {}) => {
|
|
98
|
+
const javascript = {
|
|
99
|
+
files: ["**/*.{js,jsx}"],
|
|
100
|
+
languageOptions: {
|
|
101
|
+
parser: babelParser,
|
|
102
|
+
ecmaVersion: "latest",
|
|
103
|
+
sourceType: "module",
|
|
104
|
+
parserOptions: {
|
|
105
|
+
ecmaFeatures: { jsx: true },
|
|
106
|
+
},
|
|
107
|
+
globals: {
|
|
108
|
+
...globals.browser,
|
|
109
|
+
...globals.node,
|
|
110
|
+
...globals.es2021,
|
|
111
|
+
...globals.jest,
|
|
112
|
+
...(reactNativePlugin.environments?.["react-native"]?.globals ?? {}),
|
|
113
|
+
Atomics: "readonly",
|
|
114
|
+
SharedArrayBuffer: "readonly",
|
|
115
|
+
// Makes logger function available everywhere. Else eslint will complain of undef-var.
|
|
116
|
+
logger: "readonly",
|
|
117
|
+
globalProps: "readonly",
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
plugins: {
|
|
121
|
+
react: reactPlugin,
|
|
122
|
+
"react-native": reactNativePlugin,
|
|
123
|
+
import: importPlugin,
|
|
124
|
+
"react-hooks": reactHooksPlugin,
|
|
125
|
+
"@bigbinary/neeto": neetoPlugin,
|
|
126
|
+
"unused-imports": unusedImportsPlugin,
|
|
127
|
+
prettier: prettierPlugin,
|
|
128
|
+
},
|
|
129
|
+
settings: {
|
|
130
|
+
react: {
|
|
131
|
+
version: "detect",
|
|
132
|
+
},
|
|
133
|
+
"import/ignore": ["[\\/]node_modules[\\/]"],
|
|
134
|
+
"import/resolver": {
|
|
135
|
+
"babel-module": {
|
|
136
|
+
root: ["."],
|
|
137
|
+
alias: aliases,
|
|
138
|
+
// A .js file may still import a directory whose index is TypeScript.
|
|
139
|
+
extensions: [".ts", ".tsx", ".js", ".jsx"],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
"react-native/style-sheet-object-names": ["StyleSheet"],
|
|
143
|
+
},
|
|
144
|
+
rules: {
|
|
145
|
+
// Disable stylistic rules that conflict with Prettier, then let
|
|
146
|
+
// prettier/prettier report formatting drift.
|
|
147
|
+
...prettierConfig.rules,
|
|
148
|
+
"prettier/prettier": "error",
|
|
149
|
+
|
|
150
|
+
"@bigbinary/neeto/no-dangling-constants": 2,
|
|
151
|
+
"@bigbinary/neeto/no-redundant-string-templates": 2,
|
|
152
|
+
"import/no-unresolved": 2,
|
|
153
|
+
"require-await": 2,
|
|
154
|
+
"import/no-anonymous-default-export": 2,
|
|
155
|
+
"no-unused-vars": [
|
|
156
|
+
"error",
|
|
157
|
+
{
|
|
158
|
+
args: "all",
|
|
159
|
+
argsIgnorePattern: "^_",
|
|
160
|
+
destructuredArrayIgnorePattern: "^_",
|
|
161
|
+
caughtErrors: "all",
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
"no-undef": "error",
|
|
165
|
+
// Dont use console statements. Use logger which babel will remove during bundling.
|
|
166
|
+
"no-console": "error",
|
|
167
|
+
"consistent-return": "error",
|
|
168
|
+
"padding-line-between-statements": [
|
|
169
|
+
"error",
|
|
170
|
+
{ blankLine: "always", prev: "if", next: ["if", "return"] },
|
|
171
|
+
{ blankLine: "always", prev: "*", next: "return" },
|
|
172
|
+
{
|
|
173
|
+
blankLine: "always",
|
|
174
|
+
prev: [
|
|
175
|
+
"block",
|
|
176
|
+
"multiline-block-like",
|
|
177
|
+
"function",
|
|
178
|
+
"iife",
|
|
179
|
+
"multiline-const",
|
|
180
|
+
"multiline-expression",
|
|
181
|
+
],
|
|
182
|
+
next: ["function", "iife", "multiline-const", "multiline-expression"],
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
curly: ["error", "multi-line"],
|
|
186
|
+
"no-else-return": "error",
|
|
187
|
+
"comma-dangle": [
|
|
188
|
+
"error",
|
|
189
|
+
{
|
|
190
|
+
arrays: "always-multiline",
|
|
191
|
+
objects: "always-multiline",
|
|
192
|
+
imports: "always-multiline",
|
|
193
|
+
exports: "always-multiline",
|
|
194
|
+
functions: "never",
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
"prefer-const": "error",
|
|
198
|
+
eqeqeq: "error",
|
|
199
|
+
"no-unsafe-optional-chaining": "error",
|
|
200
|
+
"unused-imports/no-unused-imports": "error",
|
|
201
|
+
"no-nested-ternary": "warn",
|
|
202
|
+
"arrow-body-style": ["error", "as-needed"],
|
|
203
|
+
"prefer-template": "error",
|
|
204
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
|
205
|
+
"object-shorthand": [
|
|
206
|
+
"error",
|
|
207
|
+
"always",
|
|
208
|
+
{ avoidQuotes: true, ignoreConstructors: true },
|
|
209
|
+
],
|
|
210
|
+
"prefer-arrow-callback": ["error", { allowUnboundThis: true }],
|
|
211
|
+
"no-duplicate-imports": ["error", { includeExports: true }],
|
|
212
|
+
"no-implicit-coercion": ["error", { allow: ["!!"] }],
|
|
213
|
+
"no-var": "error",
|
|
214
|
+
|
|
215
|
+
// Promise hygiene.
|
|
216
|
+
"promise/prefer-await-to-then": 2,
|
|
217
|
+
"promise/no-nesting": 2,
|
|
218
|
+
"promise/prefer-await-to-callbacks": 2,
|
|
219
|
+
"promise/no-new-statics": "error",
|
|
220
|
+
|
|
221
|
+
// Imports.
|
|
222
|
+
"import/order": [
|
|
223
|
+
"error",
|
|
224
|
+
{
|
|
225
|
+
"newlines-between": "always",
|
|
226
|
+
alphabetize: { order: "asc", caseInsensitive: true },
|
|
227
|
+
warnOnUnassignedImports: true,
|
|
228
|
+
groups: [
|
|
229
|
+
"builtin",
|
|
230
|
+
"external",
|
|
231
|
+
"internal",
|
|
232
|
+
"index",
|
|
233
|
+
"sibling",
|
|
234
|
+
"parent",
|
|
235
|
+
"object",
|
|
236
|
+
"type",
|
|
237
|
+
],
|
|
238
|
+
pathGroups: [
|
|
239
|
+
{
|
|
240
|
+
pattern: "react+(-native|)",
|
|
241
|
+
group: "external",
|
|
242
|
+
position: "before",
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
// Ignore react imports so that they're always ordered to the top of the file.
|
|
246
|
+
pathGroupsExcludedImportTypes: ["react", "react-native"],
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
"import/prefer-default-export": "off",
|
|
250
|
+
"import/no-cycle": ["error", { maxDepth: 1, ignoreExternal: true }],
|
|
251
|
+
"import/no-useless-path-segments": ["error", { noUselessIndex: true }],
|
|
252
|
+
"import/export": "error",
|
|
253
|
+
"import/no-mutable-exports": "error",
|
|
254
|
+
"import/first": "error",
|
|
255
|
+
"import/newline-after-import": ["error", { count: 1 }],
|
|
256
|
+
"import/extensions": [
|
|
257
|
+
"error",
|
|
258
|
+
"never",
|
|
259
|
+
{
|
|
260
|
+
ignorePackages: true,
|
|
261
|
+
pattern: { json: "always", mp3: "always" },
|
|
262
|
+
},
|
|
263
|
+
],
|
|
264
|
+
|
|
265
|
+
// React.
|
|
266
|
+
"react/prop-types": "off",
|
|
267
|
+
"react/no-unescaped-entities": "off",
|
|
268
|
+
"react/display-name": "error",
|
|
269
|
+
"react/no-access-state-in-setstate": "error",
|
|
270
|
+
"react/no-danger": "warn",
|
|
271
|
+
"react/no-danger-with-children": "warn",
|
|
272
|
+
"react/no-unused-prop-types": "error",
|
|
273
|
+
"react/jsx-key": "error",
|
|
274
|
+
"react/jsx-no-duplicate-props": "error",
|
|
275
|
+
"react/jsx-no-undef": "error",
|
|
276
|
+
"react/jsx-pascal-case": [
|
|
277
|
+
"error",
|
|
278
|
+
{ allowNamespace: true, ignore: ["FAB"] },
|
|
279
|
+
],
|
|
280
|
+
"react/jsx-uses-react": "error",
|
|
281
|
+
"react/jsx-uses-vars": "error",
|
|
282
|
+
"react/jsx-no-useless-fragment": ["error", { allowExpressions: true }],
|
|
283
|
+
"react/function-component-definition": [
|
|
284
|
+
"error",
|
|
285
|
+
{
|
|
286
|
+
namedComponents: "arrow-function",
|
|
287
|
+
unnamedComponents: "arrow-function",
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
"react/self-closing-comp": [
|
|
291
|
+
"error",
|
|
292
|
+
{
|
|
293
|
+
component: true,
|
|
294
|
+
html: true,
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
"react/jsx-wrap-multilines": [
|
|
298
|
+
"error",
|
|
299
|
+
{
|
|
300
|
+
declaration: "parens-new-line",
|
|
301
|
+
assignment: "parens-new-line",
|
|
302
|
+
return: "parens-new-line",
|
|
303
|
+
arrow: "parens-new-line",
|
|
304
|
+
condition: "parens-new-line",
|
|
305
|
+
logical: "parens-new-line",
|
|
306
|
+
prop: "ignore",
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
"react/jsx-filename-extension": [
|
|
310
|
+
"error",
|
|
311
|
+
{ allow: "as-needed", extensions: [".jsx", ".tsx"] },
|
|
312
|
+
],
|
|
313
|
+
"react/jsx-boolean-value": "error",
|
|
314
|
+
"react/hook-use-state": "error",
|
|
315
|
+
"react/jsx-sort-props": [
|
|
316
|
+
"error",
|
|
317
|
+
{
|
|
318
|
+
callbacksLast: true,
|
|
319
|
+
shorthandFirst: true,
|
|
320
|
+
multiline: "last",
|
|
321
|
+
reservedFirst: false,
|
|
322
|
+
locale: "auto",
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
"react/jsx-curly-brace-presence": [
|
|
326
|
+
"error",
|
|
327
|
+
{
|
|
328
|
+
props: "never",
|
|
329
|
+
children: "never",
|
|
330
|
+
propElementValues: "always",
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
"react/jsx-newline": ["error", { prevent: true }],
|
|
334
|
+
// allowAsProps: React Navigation (tabBarIcon) and neetoui-rn
|
|
335
|
+
// (SuffixIcon, RightComponent) take render-prop components.
|
|
336
|
+
"react/no-unstable-nested-components": ["error", { allowAsProps: true }],
|
|
337
|
+
|
|
338
|
+
"react-hooks/rules-of-hooks": "error",
|
|
339
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
340
|
+
|
|
341
|
+
"react-native/no-unused-styles": 2,
|
|
342
|
+
"react-native/split-platform-components": 1,
|
|
343
|
+
"react-native/no-inline-styles": 1,
|
|
344
|
+
"react-native/no-raw-text": 0,
|
|
345
|
+
"react-native/no-single-element-style-arrays": 1,
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
return [
|
|
350
|
+
{
|
|
351
|
+
ignores: [...DEFAULT_IGNORES, ...ignores],
|
|
352
|
+
},
|
|
353
|
+
js.configs.recommended,
|
|
354
|
+
reactPlugin.configs.flat.recommended,
|
|
355
|
+
promisePlugin.configs["flat/recommended"],
|
|
356
|
+
javascript,
|
|
357
|
+
...(typescript ? [typescriptBlock(javascript, aliases)] : []),
|
|
358
|
+
{
|
|
359
|
+
files: ["*.config.js", ".prettierrc.js", "babel.config.js"],
|
|
360
|
+
rules: {
|
|
361
|
+
"import/order": "off",
|
|
362
|
+
"react-hooks/rules-of-hooks": "off",
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
];
|
|
366
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Vendored from neetozone/eslint-plugin-neeto (src/lib/rules/constants/
|
|
2
|
+
// no-dangling-constants.js) so the plugin — and its hard dependency on
|
|
3
|
+
// neeto-commons-frontend — is not needed for the two rules this app uses.
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const CONSTANT_CASE_PATTERN = /^[A-Z0-9_]*$/;
|
|
7
|
+
const CONSTANTS_FILES = [/constants\//, /.*constants\.(js|jsx|ts|tsx)$/i];
|
|
8
|
+
|
|
9
|
+
const isConstantsFile = filename =>
|
|
10
|
+
CONSTANTS_FILES.some(pattern => pattern.test(path.resolve(filename)));
|
|
11
|
+
|
|
12
|
+
module.exports = {
|
|
13
|
+
meta: {
|
|
14
|
+
type: "suggestion",
|
|
15
|
+
docs: {
|
|
16
|
+
url: "https://github.com/neetozone/eslint-plugin-neeto/blob/main/docs/src/rules/no-dangling-constants.md",
|
|
17
|
+
description:
|
|
18
|
+
"Indicates that any constant outside a constant.[js|jsx] file should be moved to a constant.[js|jsx] file.",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
create: context => ({
|
|
22
|
+
VariableDeclaration(node) {
|
|
23
|
+
if (isConstantsFile(context.filename)) return;
|
|
24
|
+
if (node.kind !== "const") return;
|
|
25
|
+
|
|
26
|
+
const name = node.declarations[0]?.id?.name;
|
|
27
|
+
if (!name || !CONSTANT_CASE_PATTERN.test(name)) return;
|
|
28
|
+
|
|
29
|
+
context.report({
|
|
30
|
+
node,
|
|
31
|
+
message: `Move the constant ${name} to a constants.js file.`,
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Vendored from neetozone/eslint-plugin-neeto (src/lib/rules/
|
|
2
|
+
// no-redundant-string-templates/) so the plugin — and its hard dependency on
|
|
3
|
+
// neeto-commons-frontend — is not needed for the two rules this app uses.
|
|
4
|
+
const CHARACTERS_TO_IGNORE_PATTERN = /[\r\n\t\f\v&><}"{'`\\]/;
|
|
5
|
+
const ENDS_WITH_SPACES_PATTERN = / +$/;
|
|
6
|
+
const STARTS_OR_ENDS_WITH_SPACES_PATTERN = /^ +| +$/;
|
|
7
|
+
const STARTS_WITH_SPACES_PATTERN = /^ +/;
|
|
8
|
+
|
|
9
|
+
const getCode = (context, node) =>
|
|
10
|
+
context.sourceCode.text.slice(node.range[0], node.range[1]);
|
|
11
|
+
|
|
12
|
+
const doQuasisHaveSpecialCharacters = node =>
|
|
13
|
+
node.quasis.some(quasi =>
|
|
14
|
+
CHARACTERS_TO_IGNORE_PATTERN.test(quasi.value.cooked)
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const isExpressionOnly = node =>
|
|
18
|
+
node.expressions.length === 1 &&
|
|
19
|
+
node.quasis.length === 2 &&
|
|
20
|
+
node.quasis[0].value.cooked === "" &&
|
|
21
|
+
node.quasis[1].value.cooked === "";
|
|
22
|
+
|
|
23
|
+
const isInsideJsxElement = node =>
|
|
24
|
+
node.parent?.type === "JSXExpressionContainer" &&
|
|
25
|
+
["JSXElement", "JSXFragment"].includes(node.parent.parent?.type) &&
|
|
26
|
+
!STARTS_WITH_SPACES_PATTERN.test(node.quasis[0]?.value.cooked ?? "") &&
|
|
27
|
+
!ENDS_WITH_SPACES_PATTERN.test(
|
|
28
|
+
node.quasis[node.quasis.length - 1]?.value.cooked ?? ""
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const isReplaceableQuasisOnly = node =>
|
|
32
|
+
node.expressions.length === 0 &&
|
|
33
|
+
node.quasis.length === 1 &&
|
|
34
|
+
!STARTS_OR_ENDS_WITH_SPACES_PATTERN.test(node.quasis[0].value.cooked);
|
|
35
|
+
|
|
36
|
+
const getTemplateContent = (context, node) =>
|
|
37
|
+
node.expressions.reduce(
|
|
38
|
+
(acc, expression, index) =>
|
|
39
|
+
`${acc}{${getCode(context, expression)}}${
|
|
40
|
+
node.quasis[index + 1].value.cooked
|
|
41
|
+
}`,
|
|
42
|
+
node.quasis[0].value.cooked
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const canBeReplacedWith = fix => `Can be replaced with: ${fix}`;
|
|
46
|
+
|
|
47
|
+
module.exports = {
|
|
48
|
+
meta: {
|
|
49
|
+
type: "problem",
|
|
50
|
+
docs: {
|
|
51
|
+
url: "https://github.com/neetozone/eslint-plugin-neeto/blob/main/docs/src/rules/no-redundant-string-templates.md",
|
|
52
|
+
description:
|
|
53
|
+
"Prevent usage of string templates as direct children of JSX components.",
|
|
54
|
+
},
|
|
55
|
+
fixable: "code",
|
|
56
|
+
},
|
|
57
|
+
create: context => ({
|
|
58
|
+
TemplateLiteral(node) {
|
|
59
|
+
if (doQuasisHaveSpecialCharacters(node)) return;
|
|
60
|
+
|
|
61
|
+
if (isExpressionOnly(node)) {
|
|
62
|
+
const fix = getCode(context, node.expressions[0]);
|
|
63
|
+
context.report({
|
|
64
|
+
node,
|
|
65
|
+
message: canBeReplacedWith(fix),
|
|
66
|
+
fix: fixer => fixer.replaceText(node, fix),
|
|
67
|
+
});
|
|
68
|
+
} else if (isInsideJsxElement(node)) {
|
|
69
|
+
const fix = getTemplateContent(context, node);
|
|
70
|
+
context.report({
|
|
71
|
+
node,
|
|
72
|
+
message: canBeReplacedWith(fix),
|
|
73
|
+
fix: fixer => fixer.replaceText(node.parent, fix),
|
|
74
|
+
});
|
|
75
|
+
} else if (isReplaceableQuasisOnly(node)) {
|
|
76
|
+
const fix = `"${node.quasis[0].value.cooked}"`;
|
|
77
|
+
context.report({
|
|
78
|
+
node,
|
|
79
|
+
message: canBeReplacedWith(fix),
|
|
80
|
+
fix: fixer => fixer.replaceText(node, fix),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface AppVersionInfo {
|
|
2
|
+
version: string;
|
|
3
|
+
force_update?: boolean;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
declare const appVersionApi: {
|
|
7
|
+
fetch: () => Promise<import("axios").AxiosResponse<AppVersionInfo, any, {}, any>>;
|
|
8
|
+
};
|
|
9
|
+
export default appVersionApi;
|
|
10
|
+
//# sourceMappingURL=app_version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app_version.d.ts","sourceRoot":"","sources":["../../../src/api/app_version.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAWD,QAAA,MAAM,aAAa;;CAAY,CAAC;AAEhC,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Organization } from "../slices/auth";
|
|
2
|
+
export interface OrganizationsResponse {
|
|
3
|
+
organizations: Organization[];
|
|
4
|
+
}
|
|
5
|
+
export declare const generateOTPAPI: ({ email }: {
|
|
6
|
+
email: string;
|
|
7
|
+
}) => Promise<string>;
|
|
8
|
+
export declare const verifyOTPAPI: ({ code, userId, }: {
|
|
9
|
+
code: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
}) => Promise<import("axios").AxiosResponse<OrganizationsResponse, any, {}, any>>;
|
|
12
|
+
export declare const loginWithGoogleAPI: ({ serverAuthCode, }: {
|
|
13
|
+
serverAuthCode: string;
|
|
14
|
+
}) => Promise<import("axios").AxiosResponse<OrganizationsResponse, any, {}, any>>;
|
|
15
|
+
export declare const loginWithAppleAPI: ({ authorizationCode, identityToken, }: {
|
|
16
|
+
authorizationCode: string;
|
|
17
|
+
identityToken: string;
|
|
18
|
+
}) => Promise<import("axios").AxiosResponse<OrganizationsResponse, any, {}, any>>;
|
|
19
|
+
export declare const fetchOrganizationDetailsAPI: ({ subdomain, }: {
|
|
20
|
+
subdomain: string;
|
|
21
|
+
}) => Promise<import("axios").AxiosResponse<{
|
|
22
|
+
organization?: {
|
|
23
|
+
is_onboard?: boolean;
|
|
24
|
+
};
|
|
25
|
+
}, any, {}, any>>;
|
|
26
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/api/auth.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,eAAO,MAAM,cAAc,GAAU,WAAW;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,oBAQhE,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,mBAG1B;IACD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,gFAGG,CAAC;AAEL,eAAO,MAAM,kBAAkB,GAAU,qBAEtC;IACD,cAAc,EAAE,MAAM,CAAC;CACxB,gFAMA,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,uCAGrC;IACD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB,gFAMA,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAU,gBAE/C;IACD,SAAS,EAAE,MAAM,CAAC;CACnB;mBACkC;QAAE,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE;iBAExD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface GlobalRole {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
app_name: string;
|
|
5
|
+
}
|
|
6
|
+
declare const globalRolesApi: {
|
|
7
|
+
fetch: () => Promise<import("axios").AxiosResponse<GlobalRole[], any, {}, any>>;
|
|
8
|
+
};
|
|
9
|
+
export default globalRolesApi;
|
|
10
|
+
//# sourceMappingURL=global_roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global_roles.d.ts","sourceRoot":"","sources":["../../../src/api/global_roles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,QAAA,MAAM,cAAc;;CAEnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface NotificationItem {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
read_at: string | null;
|
|
6
|
+
created_at: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface NotificationsPage {
|
|
11
|
+
notifications: NotificationItem[];
|
|
12
|
+
total_count: number;
|
|
13
|
+
unread_count: number;
|
|
14
|
+
}
|
|
15
|
+
export interface RegisterDevicePayload {
|
|
16
|
+
device: {
|
|
17
|
+
device_token: string;
|
|
18
|
+
platform: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare const registerDeviceTokenAPI: (payload: RegisterDevicePayload) => Promise<import("axios").AxiosResponse<any, RegisterDevicePayload, {}, any>>;
|
|
23
|
+
export declare const deleteDeviceTokenAPI: ({ notificationDeviceId, }: {
|
|
24
|
+
notificationDeviceId: string;
|
|
25
|
+
}) => Promise<import("axios").AxiosResponse<any, any, {}, any>>;
|
|
26
|
+
export declare const fetchNotificationsAPI: ({ page }: {
|
|
27
|
+
page: number;
|
|
28
|
+
}) => Promise<import("axios").AxiosResponse<NotificationsPage, any, {}, any>>;
|
|
29
|
+
export declare const markReadUnReadNotificationAPI: ({ notificationId, readAt, }: {
|
|
30
|
+
notificationId: string;
|
|
31
|
+
readAt: string | null;
|
|
32
|
+
}) => Promise<import("axios").AxiosResponse<any, {
|
|
33
|
+
notification: {
|
|
34
|
+
read_at: string | null;
|
|
35
|
+
};
|
|
36
|
+
}, {}, any>>;
|
|
37
|
+
export declare const markAllNotificationsReadAPI: () => Promise<import("axios").AxiosResponse<any, any, {}, any>>;
|
|
38
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/api/notifications.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IAGd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED,eAAO,MAAM,sBAAsB,GAAU,SAAS,qBAAqB,gFACT,CAAC;AAEnE,eAAO,MAAM,oBAAoB,GAAU,2BAExC;IACD,oBAAoB,EAAE,MAAM,CAAC;CAC9B,8DAIA,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAU,UAAU;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,4EAMnE,CAAC;AAEJ,eAAO,MAAM,6BAA6B,GAAU,6BAGjD;IACD,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;;;;YAME,CAAC;AAEJ,eAAO,MAAM,2BAA2B,iEACqC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface OrganizationRole {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
declare const organizationRolesApi: {
|
|
6
|
+
fetch: () => Promise<import("axios").AxiosResponse<{
|
|
7
|
+
organization_roles: OrganizationRole[];
|
|
8
|
+
}, any, {}, any>>;
|
|
9
|
+
};
|
|
10
|
+
export default organizationRolesApi;
|
|
11
|
+
//# sourceMappingURL=organization_roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization_roles.d.ts","sourceRoot":"","sources":["../../../src/api/organization_roles.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAOD,QAAA,MAAM,oBAAoB;;4BAJQ,gBAAgB,EAAE;;CAMnD,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|