@replyke/core 5.1.6-beta.30 → 5.1.6-beta.31
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/dist/cjs/config/axios.d.ts +3 -0
- package/dist/cjs/config/axios.js +17 -0
- package/dist/cjs/config/axios.js.map +1 -0
- package/dist/cjs/config/useAxiosPrivate.d.ts +2 -0
- package/dist/cjs/config/useAxiosPrivate.js +82 -0
- package/dist/cjs/config/useAxiosPrivate.js.map +1 -0
- package/dist/cjs/constants/reportReasons.d.ts +12 -0
- package/dist/cjs/constants/reportReasons.js +15 -0
- package/dist/cjs/constants/reportReasons.js.map +1 -0
- package/dist/cjs/context/comment-section-context.d.ts +9 -0
- package/dist/cjs/context/comment-section-context.js +28 -0
- package/dist/cjs/context/comment-section-context.js.map +1 -0
- package/dist/cjs/context/entity-context.d.ts +9 -0
- package/dist/cjs/context/entity-context.js +38 -0
- package/dist/cjs/context/entity-context.js.map +1 -0
- package/dist/cjs/context/index.d.ts +4 -0
- package/dist/cjs/context/index.js +12 -0
- package/dist/cjs/context/index.js.map +1 -0
- package/dist/cjs/context/replyke-context.d.ts +10 -0
- package/dist/cjs/context/replyke-context.js +23 -0
- package/dist/cjs/context/replyke-context.js.map +1 -0
- package/dist/cjs/context/replyke-store-context.d.ts +13 -0
- package/dist/cjs/context/replyke-store-context.js +37 -0
- package/dist/cjs/context/replyke-store-context.js.map +1 -0
- package/dist/cjs/helpers/addCommentsToTree.d.ts +3 -0
- package/dist/cjs/helpers/addCommentsToTree.js +61 -0
- package/dist/cjs/helpers/addCommentsToTree.js.map +1 -0
- package/dist/cjs/helpers/addNotificationsMessages.d.ts +3 -0
- package/dist/cjs/helpers/addNotificationsMessages.js +91 -0
- package/dist/cjs/helpers/addNotificationsMessages.js.map +1 -0
- package/dist/cjs/helpers/getPublicFileUrl.d.ts +2 -0
- package/dist/cjs/helpers/getPublicFileUrl.js +10 -0
- package/dist/cjs/helpers/getPublicFileUrl.js.map +1 -0
- package/dist/cjs/helpers/getUserName.d.ts +2 -0
- package/dist/cjs/helpers/getUserName.js +23 -0
- package/dist/cjs/helpers/getUserName.js.map +1 -0
- package/dist/cjs/helpers/markCommentAsFailed.d.ts +2 -0
- package/dist/cjs/helpers/markCommentAsFailed.js +29 -0
- package/dist/cjs/helpers/markCommentAsFailed.js.map +1 -0
- package/dist/cjs/helpers/removeCommentFromTree.d.ts +2 -0
- package/dist/cjs/helpers/removeCommentFromTree.js +44 -0
- package/dist/cjs/helpers/removeCommentFromTree.js.map +1 -0
- package/dist/cjs/helpers/safeMergeStyleProps.d.ts +1 -0
- package/dist/cjs/helpers/safeMergeStyleProps.js +23 -0
- package/dist/cjs/helpers/safeMergeStyleProps.js.map +1 -0
- package/dist/cjs/hooks/app-notifications/index.d.ts +3 -0
- package/dist/cjs/hooks/app-notifications/index.js +12 -0
- package/dist/cjs/hooks/app-notifications/index.js.map +1 -0
- package/dist/cjs/hooks/app-notifications/useAppNotifications.d.ts +21 -0
- package/dist/cjs/hooks/app-notifications/useAppNotifications.js +108 -0
- package/dist/cjs/hooks/app-notifications/useAppNotifications.js.map +1 -0
- package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.d.ts +13 -0
- package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.js +266 -0
- package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.js.map +1 -0
- package/dist/cjs/hooks/auth/index.d.ts +1 -0
- package/dist/cjs/hooks/auth/index.js +9 -0
- package/dist/cjs/hooks/auth/index.js.map +1 -0
- package/dist/cjs/hooks/auth/useAuth.d.ts +32 -0
- package/dist/cjs/hooks/auth/useAuth.js +180 -0
- package/dist/cjs/hooks/auth/useAuth.js.map +1 -0
- package/dist/cjs/hooks/comments/index.d.ts +12 -0
- package/dist/cjs/hooks/comments/index.js +31 -0
- package/dist/cjs/hooks/comments/index.js.map +1 -0
- package/dist/cjs/hooks/comments/useCommentSection.d.ts +2 -0
- package/dist/cjs/hooks/comments/useCommentSection.js +9 -0
- package/dist/cjs/hooks/comments/useCommentSection.js.map +1 -0
- package/dist/cjs/hooks/comments/useCommentSectionData.d.ts +60 -0
- package/dist/cjs/hooks/comments/useCommentSectionData.js +407 -0
- package/dist/cjs/hooks/comments/useCommentSectionData.js.map +1 -0
- package/dist/cjs/hooks/comments/useCommentVotes.d.ts +11 -0
- package/dist/cjs/hooks/comments/useCommentVotes.js +234 -0
- package/dist/cjs/hooks/comments/useCommentVotes.js.map +1 -0
- package/dist/cjs/hooks/comments/useCreateComment.d.ts +14 -0
- package/dist/cjs/hooks/comments/useCreateComment.js +90 -0
- package/dist/cjs/hooks/comments/useCreateComment.js.map +1 -0
- package/dist/cjs/hooks/comments/useDeleteComment.d.ts +4 -0
- package/dist/cjs/hooks/comments/useDeleteComment.js +70 -0
- package/dist/cjs/hooks/comments/useDeleteComment.js.map +1 -0
- package/dist/cjs/hooks/comments/useDownvoteComment.d.ts +5 -0
- package/dist/cjs/hooks/comments/useDownvoteComment.js +71 -0
- package/dist/cjs/hooks/comments/useDownvoteComment.js.map +1 -0
- package/dist/cjs/hooks/comments/useEntityComments.d.ts +22 -0
- package/dist/cjs/hooks/comments/useEntityComments.js +196 -0
- package/dist/cjs/hooks/comments/useEntityComments.js.map +1 -0
- package/dist/cjs/hooks/comments/useFetchComment.d.ts +9 -0
- package/dist/cjs/hooks/comments/useFetchComment.js +74 -0
- package/dist/cjs/hooks/comments/useFetchComment.js.map +1 -0
- package/dist/cjs/hooks/comments/useFetchCommentByForeignId.d.ts +9 -0
- package/dist/cjs/hooks/comments/useFetchCommentByForeignId.js +75 -0
- package/dist/cjs/hooks/comments/useFetchCommentByForeignId.js.map +1 -0
- package/dist/cjs/hooks/comments/useFetchManyComments.d.ts +12 -0
- package/dist/cjs/hooks/comments/useFetchManyComments.js +88 -0
- package/dist/cjs/hooks/comments/useFetchManyComments.js.map +1 -0
- package/dist/cjs/hooks/comments/useGroupReplies.d.ts +8 -0
- package/dist/cjs/hooks/comments/useGroupReplies.js +24 -0
- package/dist/cjs/hooks/comments/useGroupReplies.js.map +1 -0
- package/dist/cjs/hooks/comments/useProfileComments.d.ts +18 -0
- package/dist/cjs/hooks/comments/useProfileComments.js +179 -0
- package/dist/cjs/hooks/comments/useProfileComments.js.map +1 -0
- package/dist/cjs/hooks/comments/useRemoveCommentDownvote.d.ts +5 -0
- package/dist/cjs/hooks/comments/useRemoveCommentDownvote.js +71 -0
- package/dist/cjs/hooks/comments/useRemoveCommentDownvote.js.map +1 -0
- package/dist/cjs/hooks/comments/useRemoveCommentUpvote.d.ts +5 -0
- package/dist/cjs/hooks/comments/useRemoveCommentUpvote.js +71 -0
- package/dist/cjs/hooks/comments/useRemoveCommentUpvote.js.map +1 -0
- package/dist/cjs/hooks/comments/useReplies.d.ts +13 -0
- package/dist/cjs/hooks/comments/useReplies.js +107 -0
- package/dist/cjs/hooks/comments/useReplies.js.map +1 -0
- package/dist/cjs/hooks/comments/useUpdateComment.d.ts +6 -0
- package/dist/cjs/hooks/comments/useUpdateComment.js +73 -0
- package/dist/cjs/hooks/comments/useUpdateComment.js.map +1 -0
- package/dist/cjs/hooks/comments/useUpvoteComment.d.ts +5 -0
- package/dist/cjs/hooks/comments/useUpvoteComment.js +71 -0
- package/dist/cjs/hooks/comments/useUpvoteComment.js.map +1 -0
- package/dist/cjs/hooks/crypto/index.d.ts +1 -0
- package/dist/cjs/hooks/crypto/index.js +9 -0
- package/dist/cjs/hooks/crypto/index.js.map +1 -0
- package/dist/cjs/hooks/crypto/useSignTestingJwt.d.ts +6 -0
- package/dist/cjs/hooks/crypto/useSignTestingJwt.js +74 -0
- package/dist/cjs/hooks/crypto/useSignTestingJwt.js.map +1 -0
- package/dist/cjs/hooks/entities/index.d.ts +10 -0
- package/dist/cjs/hooks/entities/index.js +27 -0
- package/dist/cjs/hooks/entities/index.js.map +1 -0
- package/dist/cjs/hooks/entities/useCreateEntity.d.ts +18 -0
- package/dist/cjs/hooks/entities/useCreateEntity.js +79 -0
- package/dist/cjs/hooks/entities/useCreateEntity.js.map +1 -0
- package/dist/cjs/hooks/entities/useDeleteEntity.d.ts +4 -0
- package/dist/cjs/hooks/entities/useDeleteEntity.js +72 -0
- package/dist/cjs/hooks/entities/useDeleteEntity.js.map +1 -0
- package/dist/cjs/hooks/entities/useDownvoteEntity.d.ts +5 -0
- package/dist/cjs/hooks/entities/useDownvoteEntity.js +71 -0
- package/dist/cjs/hooks/entities/useDownvoteEntity.js.map +1 -0
- package/dist/cjs/hooks/entities/useEntity.d.ts +2 -0
- package/dist/cjs/hooks/entities/useEntity.js +9 -0
- package/dist/cjs/hooks/entities/useEntity.js.map +1 -0
- package/dist/cjs/hooks/entities/useEntityData.d.ts +24 -0
- package/dist/cjs/hooks/entities/useEntityData.js +246 -0
- package/dist/cjs/hooks/entities/useEntityData.js.map +1 -0
- package/dist/cjs/hooks/entities/useEntityVotes.d.ts +11 -0
- package/dist/cjs/hooks/entities/useEntityVotes.js +241 -0
- package/dist/cjs/hooks/entities/useEntityVotes.js.map +1 -0
- package/dist/cjs/hooks/entities/useFetchEntity.d.ts +5 -0
- package/dist/cjs/hooks/entities/useFetchEntity.js +70 -0
- package/dist/cjs/hooks/entities/useFetchEntity.js.map +1 -0
- package/dist/cjs/hooks/entities/useFetchEntityByForeignId.d.ts +6 -0
- package/dist/cjs/hooks/entities/useFetchEntityByForeignId.js +75 -0
- package/dist/cjs/hooks/entities/useFetchEntityByForeignId.js.map +1 -0
- package/dist/cjs/hooks/entities/useFetchEntityByShortId.d.ts +5 -0
- package/dist/cjs/hooks/entities/useFetchEntityByShortId.js +74 -0
- package/dist/cjs/hooks/entities/useFetchEntityByShortId.js.map +1 -0
- package/dist/cjs/hooks/entities/useIncrementEntityViews.d.ts +5 -0
- package/dist/cjs/hooks/entities/useIncrementEntityViews.js +73 -0
- package/dist/cjs/hooks/entities/useIncrementEntityViews.js.map +1 -0
- package/dist/cjs/hooks/entities/useRemoveEntityDownvote.d.ts +5 -0
- package/dist/cjs/hooks/entities/useRemoveEntityDownvote.js +71 -0
- package/dist/cjs/hooks/entities/useRemoveEntityDownvote.js.map +1 -0
- package/dist/cjs/hooks/entities/useRemoveEntityUpvote.d.ts +5 -0
- package/dist/cjs/hooks/entities/useRemoveEntityUpvote.js +71 -0
- package/dist/cjs/hooks/entities/useRemoveEntityUpvote.js.map +1 -0
- package/dist/cjs/hooks/entities/useUpdateEntity.d.ts +19 -0
- package/dist/cjs/hooks/entities/useUpdateEntity.js +77 -0
- package/dist/cjs/hooks/entities/useUpdateEntity.js.map +1 -0
- package/dist/cjs/hooks/entities/useUpvoteEntity.d.ts +5 -0
- package/dist/cjs/hooks/entities/useUpvoteEntity.js +71 -0
- package/dist/cjs/hooks/entities/useUpvoteEntity.js.map +1 -0
- package/dist/cjs/hooks/entity-lists/index.d.ts +4 -0
- package/dist/cjs/hooks/entity-lists/index.js +11 -0
- package/dist/cjs/hooks/entity-lists/index.js.map +1 -0
- package/dist/cjs/hooks/entity-lists/useEntityList.d.ts +53 -0
- package/dist/cjs/hooks/entity-lists/useEntityList.js +358 -0
- package/dist/cjs/hooks/entity-lists/useEntityList.js.map +1 -0
- package/dist/cjs/hooks/entity-lists/useEntityListActions.d.ts +51 -0
- package/dist/cjs/hooks/entity-lists/useEntityListActions.js +196 -0
- package/dist/cjs/hooks/entity-lists/useEntityListActions.js.map +1 -0
- package/dist/cjs/hooks/entity-lists/useInfusedData.d.ts +8 -0
- package/dist/cjs/hooks/entity-lists/useInfusedData.js +130 -0
- package/dist/cjs/hooks/entity-lists/useInfusedData.js.map +1 -0
- package/dist/cjs/hooks/lists/index.d.ts +3 -0
- package/dist/cjs/hooks/lists/index.js +14 -0
- package/dist/cjs/hooks/lists/index.js.map +1 -0
- package/dist/cjs/hooks/lists/useIsEntitySaved.d.ts +5 -0
- package/dist/cjs/hooks/lists/useIsEntitySaved.js +83 -0
- package/dist/cjs/hooks/lists/useIsEntitySaved.js.map +1 -0
- package/dist/cjs/hooks/lists/useLists.d.ts +36 -0
- package/dist/cjs/hooks/lists/useLists.js +239 -0
- package/dist/cjs/hooks/lists/useLists.js.map +1 -0
- package/dist/cjs/hooks/lists/useListsActions.d.ts +21 -0
- package/dist/cjs/hooks/lists/useListsActions.js +341 -0
- package/dist/cjs/hooks/lists/useListsActions.js.map +1 -0
- package/dist/cjs/hooks/projects/index.d.ts +2 -0
- package/dist/cjs/hooks/projects/index.js +11 -0
- package/dist/cjs/hooks/projects/index.js.map +1 -0
- package/dist/cjs/hooks/projects/useProject.d.ts +2 -0
- package/dist/cjs/hooks/projects/useProject.js +9 -0
- package/dist/cjs/hooks/projects/useProject.js.map +1 -0
- package/dist/cjs/hooks/projects/useProjectData.d.ts +10 -0
- package/dist/cjs/hooks/projects/useProjectData.js +78 -0
- package/dist/cjs/hooks/projects/useProjectData.js.map +1 -0
- package/dist/cjs/hooks/reports/index.d.ts +1 -0
- package/dist/cjs/hooks/reports/index.js +9 -0
- package/dist/cjs/hooks/reports/index.js.map +1 -0
- package/dist/cjs/hooks/reports/useCreateReport.d.ts +14 -0
- package/dist/cjs/hooks/reports/useCreateReport.js +108 -0
- package/dist/cjs/hooks/reports/useCreateReport.js.map +1 -0
- package/dist/cjs/hooks/storage/index.d.ts +1 -0
- package/dist/cjs/hooks/storage/index.js +9 -0
- package/dist/cjs/hooks/storage/index.js.map +1 -0
- package/dist/cjs/hooks/storage/useUploadFile.d.ts +14 -0
- package/dist/cjs/hooks/storage/useUploadFile.js +95 -0
- package/dist/cjs/hooks/storage/useUploadFile.js.map +1 -0
- package/dist/cjs/hooks/user/index.d.ts +2 -0
- package/dist/cjs/hooks/user/index.js +12 -0
- package/dist/cjs/hooks/user/index.js.map +1 -0
- package/dist/cjs/hooks/user/useUser.d.ts +18 -0
- package/dist/cjs/hooks/user/useUser.js +116 -0
- package/dist/cjs/hooks/user/useUser.js.map +1 -0
- package/dist/cjs/hooks/user/useUserActions.d.ts +12 -0
- package/dist/cjs/hooks/user/useUserActions.js +125 -0
- package/dist/cjs/hooks/user/useUserActions.js.map +1 -0
- package/dist/cjs/hooks/users/follows/index.d.ts +4 -0
- package/dist/cjs/hooks/users/follows/index.js +15 -0
- package/dist/cjs/hooks/users/follows/index.js.map +1 -0
- package/dist/cjs/hooks/users/follows/useFetchFollow.d.ts +6 -0
- package/dist/cjs/hooks/users/follows/useFetchFollow.js +81 -0
- package/dist/cjs/hooks/users/follows/useFetchFollow.js.map +1 -0
- package/dist/cjs/hooks/users/follows/useFollowManager.d.ts +9 -0
- package/dist/cjs/hooks/users/follows/useFollowManager.js +122 -0
- package/dist/cjs/hooks/users/follows/useFollowManager.js.map +1 -0
- package/dist/cjs/hooks/users/follows/useFollowUser.d.ts +4 -0
- package/dist/cjs/hooks/users/follows/useFollowUser.js +71 -0
- package/dist/cjs/hooks/users/follows/useFollowUser.js.map +1 -0
- package/dist/cjs/hooks/users/follows/useUnfollowUser.d.ts +4 -0
- package/dist/cjs/hooks/users/follows/useUnfollowUser.js +81 -0
- package/dist/cjs/hooks/users/follows/useUnfollowUser.js.map +1 -0
- package/dist/cjs/hooks/users/index.d.ts +9 -0
- package/dist/cjs/hooks/users/index.js +28 -0
- package/dist/cjs/hooks/users/index.js.map +1 -0
- package/dist/cjs/hooks/users/useCheckUsernameAvailability.d.ts +6 -0
- package/dist/cjs/hooks/users/useCheckUsernameAvailability.js +72 -0
- package/dist/cjs/hooks/users/useCheckUsernameAvailability.js.map +1 -0
- package/dist/cjs/hooks/users/useFetchUser.d.ts +5 -0
- package/dist/cjs/hooks/users/useFetchUser.js +70 -0
- package/dist/cjs/hooks/users/useFetchUser.js.map +1 -0
- package/dist/cjs/hooks/users/useFetchUserByForeignId.d.ts +5 -0
- package/dist/cjs/hooks/users/useFetchUserByForeignId.js +72 -0
- package/dist/cjs/hooks/users/useFetchUserByForeignId.js.map +1 -0
- package/dist/cjs/hooks/users/useFetchUserFollowersCount.d.ts +6 -0
- package/dist/cjs/hooks/users/useFetchUserFollowersCount.js +71 -0
- package/dist/cjs/hooks/users/useFetchUserFollowersCount.js.map +1 -0
- package/dist/cjs/hooks/users/useFetchUserFollowingCount.d.ts +6 -0
- package/dist/cjs/hooks/users/useFetchUserFollowingCount.js +71 -0
- package/dist/cjs/hooks/users/useFetchUserFollowingCount.js.map +1 -0
- package/dist/cjs/hooks/users/useFetchUserSuggestions.d.ts +5 -0
- package/dist/cjs/hooks/users/useFetchUserSuggestions.js +72 -0
- package/dist/cjs/hooks/users/useFetchUserSuggestions.js.map +1 -0
- package/dist/cjs/hooks/users/useMentions.d.ts +18 -0
- package/dist/cjs/hooks/users/useMentions.js +185 -0
- package/dist/cjs/hooks/users/useMentions.js.map +1 -0
- package/dist/cjs/hooks/users/useUpdateUser.d.ts +19 -0
- package/dist/cjs/hooks/users/useUpdateUser.js +73 -0
- package/dist/cjs/hooks/users/useUpdateUser.js.map +1 -0
- package/dist/cjs/hooks/utils/index.d.ts +1 -0
- package/dist/cjs/hooks/utils/index.js +9 -0
- package/dist/cjs/hooks/utils/index.js.map +1 -0
- package/dist/cjs/hooks/utils/useGetMetadata.d.ts +4 -0
- package/dist/cjs/hooks/utils/useGetMetadata.js +79 -0
- package/dist/cjs/hooks/utils/useGetMetadata.js.map +1 -0
- package/dist/cjs/index.d.ts +32 -0
- package/dist/cjs/index.js +142 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interfaces/CommentsSortByOptions.d.ts +1 -0
- package/dist/cjs/interfaces/CommentsSortByOptions.js +3 -0
- package/dist/cjs/interfaces/CommentsSortByOptions.js.map +1 -0
- package/dist/cjs/interfaces/EntityCommentsTree.d.ts +13 -0
- package/dist/cjs/interfaces/EntityCommentsTree.js +3 -0
- package/dist/cjs/interfaces/EntityCommentsTree.js.map +1 -0
- package/dist/cjs/interfaces/EntityListSortByOptions.d.ts +1 -0
- package/dist/cjs/interfaces/EntityListSortByOptions.js +3 -0
- package/dist/cjs/interfaces/EntityListSortByOptions.js.map +1 -0
- package/dist/cjs/interfaces/TimeFrame.d.ts +1 -0
- package/dist/cjs/interfaces/TimeFrame.js +3 -0
- package/dist/cjs/interfaces/TimeFrame.js.map +1 -0
- package/dist/cjs/interfaces/entity-filters/AttachmentsFilters.d.ts +3 -0
- package/dist/cjs/interfaces/entity-filters/AttachmentsFilters.js +3 -0
- package/dist/cjs/interfaces/entity-filters/AttachmentsFilters.js.map +1 -0
- package/dist/cjs/interfaces/entity-filters/ContentFilters.d.ts +5 -0
- package/dist/cjs/interfaces/entity-filters/ContentFilters.js +3 -0
- package/dist/cjs/interfaces/entity-filters/ContentFilters.js.map +1 -0
- package/dist/cjs/interfaces/entity-filters/KeywordsFilters.d.ts +4 -0
- package/dist/cjs/interfaces/entity-filters/KeywordsFilters.js +3 -0
- package/dist/cjs/interfaces/entity-filters/KeywordsFilters.js.map +1 -0
- package/dist/cjs/interfaces/entity-filters/LocationFilters.d.ts +5 -0
- package/dist/cjs/interfaces/entity-filters/LocationFilters.js +3 -0
- package/dist/cjs/interfaces/entity-filters/LocationFilters.js.map +1 -0
- package/dist/cjs/interfaces/entity-filters/MetadataFilters.d.ts +7 -0
- package/dist/cjs/interfaces/entity-filters/MetadataFilters.js +3 -0
- package/dist/cjs/interfaces/entity-filters/MetadataFilters.js.map +1 -0
- package/dist/cjs/interfaces/entity-filters/TitleFilters.d.ts +5 -0
- package/dist/cjs/interfaces/entity-filters/TitleFilters.js +3 -0
- package/dist/cjs/interfaces/entity-filters/TitleFilters.js.map +1 -0
- package/dist/cjs/interfaces/models/AppNotification.d.ts +140 -0
- package/dist/cjs/interfaces/models/AppNotification.js +3 -0
- package/dist/cjs/interfaces/models/AppNotification.js.map +1 -0
- package/dist/cjs/interfaces/models/Comment.d.ts +32 -0
- package/dist/cjs/interfaces/models/Comment.js +3 -0
- package/dist/cjs/interfaces/models/Comment.js.map +1 -0
- package/dist/cjs/interfaces/models/Entity.d.ts +37 -0
- package/dist/cjs/interfaces/models/Entity.js +3 -0
- package/dist/cjs/interfaces/models/Entity.js.map +1 -0
- package/dist/cjs/interfaces/models/Follow.d.ts +5 -0
- package/dist/cjs/interfaces/models/Follow.js +3 -0
- package/dist/cjs/interfaces/models/Follow.js.map +1 -0
- package/dist/cjs/interfaces/models/List.d.ts +12 -0
- package/dist/cjs/interfaces/models/List.js +3 -0
- package/dist/cjs/interfaces/models/List.js.map +1 -0
- package/dist/cjs/interfaces/models/Mention.d.ts +4 -0
- package/dist/cjs/interfaces/models/Mention.js +3 -0
- package/dist/cjs/interfaces/models/Mention.js.map +1 -0
- package/dist/cjs/interfaces/models/Project.d.ts +14 -0
- package/dist/cjs/interfaces/models/Project.js +3 -0
- package/dist/cjs/interfaces/models/Project.js.map +1 -0
- package/dist/cjs/interfaces/models/User.d.ts +33 -0
- package/dist/cjs/interfaces/models/User.js +3 -0
- package/dist/cjs/interfaces/models/User.js.map +1 -0
- package/dist/cjs/store/api/appNotificationsApi.d.ts +2024 -0
- package/dist/cjs/store/api/appNotificationsApi.js +224 -0
- package/dist/cjs/store/api/appNotificationsApi.js.map +1 -0
- package/dist/cjs/store/api/baseApi.d.ts +1 -0
- package/dist/cjs/store/api/baseApi.js +43 -0
- package/dist/cjs/store/api/baseApi.js.map +1 -0
- package/dist/cjs/store/api/entityListsApi.d.ts +1719 -0
- package/dist/cjs/store/api/entityListsApi.js +237 -0
- package/dist/cjs/store/api/entityListsApi.js.map +1 -0
- package/dist/cjs/store/api/index.d.ts +4 -0
- package/dist/cjs/store/api/index.js +29 -0
- package/dist/cjs/store/api/index.js.map +1 -0
- package/dist/cjs/store/api/listsApi.d.ts +3044 -0
- package/dist/cjs/store/api/listsApi.js +288 -0
- package/dist/cjs/store/api/listsApi.js.map +1 -0
- package/dist/cjs/store/api/userApi.d.ts +183 -0
- package/dist/cjs/store/api/userApi.js +38 -0
- package/dist/cjs/store/api/userApi.js.map +1 -0
- package/dist/cjs/store/index.d.ts +21 -0
- package/dist/cjs/store/index.js +73 -0
- package/dist/cjs/store/index.js.map +1 -0
- package/dist/cjs/store/middleware.d.ts +4 -0
- package/dist/cjs/store/middleware.js +43 -0
- package/dist/cjs/store/middleware.js.map +1 -0
- package/dist/cjs/store/rootReducer.d.ts +16 -0
- package/dist/cjs/store/rootReducer.js +26 -0
- package/dist/cjs/store/rootReducer.js.map +1 -0
- package/dist/cjs/store/slices/appNotificationsSlice.d.ts +58 -0
- package/dist/cjs/store/slices/appNotificationsSlice.js +135 -0
- package/dist/cjs/store/slices/appNotificationsSlice.js.map +1 -0
- package/dist/cjs/store/slices/authSlice.d.ts +24 -0
- package/dist/cjs/store/slices/authSlice.js +79 -0
- package/dist/cjs/store/slices/authSlice.js.map +1 -0
- package/dist/cjs/store/slices/authThunks.d.ts +40 -0
- package/dist/cjs/store/slices/authThunks.js +363 -0
- package/dist/cjs/store/slices/authThunks.js.map +1 -0
- package/dist/cjs/store/slices/entityListsSlice.d.ts +364 -0
- package/dist/cjs/store/slices/entityListsSlice.js +295 -0
- package/dist/cjs/store/slices/entityListsSlice.js.map +1 -0
- package/dist/cjs/store/slices/index.d.ts +0 -0
- package/dist/cjs/store/slices/index.js +7 -0
- package/dist/cjs/store/slices/index.js.map +1 -0
- package/dist/cjs/store/slices/listsSlice.d.ts +147 -0
- package/dist/cjs/store/slices/listsSlice.js +211 -0
- package/dist/cjs/store/slices/listsSlice.js.map +1 -0
- package/dist/cjs/store/slices/userSlice.d.ts +29 -0
- package/dist/cjs/store/slices/userSlice.js +87 -0
- package/dist/cjs/store/slices/userSlice.js.map +1 -0
- package/dist/cjs/store/types/index.d.ts +8 -0
- package/dist/cjs/store/types/index.js +3 -0
- package/dist/cjs/store/types/index.js.map +1 -0
- package/dist/cjs/utils/constants.d.ts +1 -0
- package/dist/cjs/utils/constants.js +5 -0
- package/dist/cjs/utils/constants.js.map +1 -0
- package/dist/cjs/utils/env.d.ts +19 -0
- package/dist/cjs/utils/env.js +102 -0
- package/dist/cjs/utils/env.js.map +1 -0
- package/dist/cjs/utils/handleError.d.ts +1 -0
- package/dist/cjs/utils/handleError.js +24 -0
- package/dist/cjs/utils/handleError.js.map +1 -0
- package/dist/cjs/utils/isAbsoluteUrl.d.ts +1 -0
- package/dist/cjs/utils/isAbsoluteUrl.js +9 -0
- package/dist/cjs/utils/isAbsoluteUrl.js.map +1 -0
- package/dist/cjs/utils/isReactNative.d.ts +1 -0
- package/dist/cjs/utils/isReactNative.js +8 -0
- package/dist/cjs/utils/isReactNative.js.map +1 -0
- package/dist/cjs/utils/isUUID.d.ts +1 -0
- package/dist/cjs/utils/isUUID.js +8 -0
- package/dist/cjs/utils/isUUID.js.map +1 -0
- package/dist/cjs/utils/keywordHelpers.d.ts +30 -0
- package/dist/cjs/utils/keywordHelpers.js +101 -0
- package/dist/cjs/utils/keywordHelpers.js.map +1 -0
- package/dist/esm/hooks/users/follows/useFollowManager.js +4 -2
- package/dist/esm/hooks/users/follows/useFollowManager.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Project } from "../../interfaces/models/Project";
|
|
2
|
+
export interface UseProjectDataProps {
|
|
3
|
+
projectId: string | null | undefined;
|
|
4
|
+
}
|
|
5
|
+
export interface UseProjectDataValues {
|
|
6
|
+
projectId: string;
|
|
7
|
+
project: Pick<Project, "id" | "integrations"> | null;
|
|
8
|
+
}
|
|
9
|
+
declare function useProjectData({ projectId, }: UseProjectDataProps): UseProjectDataValues;
|
|
10
|
+
export default useProjectData;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var react_1 = require("react");
|
|
43
|
+
var handleError_1 = require("../../utils/handleError");
|
|
44
|
+
var axios_1 = __importDefault(require("../../config/axios"));
|
|
45
|
+
function useProjectData(_a) {
|
|
46
|
+
var _this = this;
|
|
47
|
+
var projectId = _a.projectId;
|
|
48
|
+
var _b = (0, react_1.useState)(null), project = _b[0], setProject = _b[1];
|
|
49
|
+
if (!projectId)
|
|
50
|
+
throw new Error("Please pass a project ID");
|
|
51
|
+
(0, react_1.useEffect)(function () {
|
|
52
|
+
var handleFetchProject = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
53
|
+
var response, fetchedProject, err_1;
|
|
54
|
+
return __generator(this, function (_a) {
|
|
55
|
+
switch (_a.label) {
|
|
56
|
+
case 0:
|
|
57
|
+
_a.trys.push([0, 2, , 3]);
|
|
58
|
+
return [4 /*yield*/, axios_1.default.get("https://api.replyke.com/internal/projects/".concat(projectId, "/lean"))];
|
|
59
|
+
case 1:
|
|
60
|
+
response = _a.sent();
|
|
61
|
+
fetchedProject = response.data;
|
|
62
|
+
setProject(fetchedProject);
|
|
63
|
+
return [3 /*break*/, 3];
|
|
64
|
+
case 2:
|
|
65
|
+
err_1 = _a.sent();
|
|
66
|
+
(0, handleError_1.handleError)(err_1, "Failed to fetch project");
|
|
67
|
+
return [3 /*break*/, 3];
|
|
68
|
+
case 3: return [2 /*return*/];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}); };
|
|
72
|
+
if (projectId)
|
|
73
|
+
handleFetchProject();
|
|
74
|
+
}, [projectId]);
|
|
75
|
+
return { projectId: projectId, project: project };
|
|
76
|
+
}
|
|
77
|
+
exports.default = useProjectData;
|
|
78
|
+
//# sourceMappingURL=useProjectData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProjectData.js","sourceRoot":"","sources":["../../../../src/hooks/projects/useProjectData.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4C;AAE5C,uDAAsD;AACtD,6DAAuC;AAUvC,SAAS,cAAc,CAAC,EAEF;IAFtB,iBAyBC;QAxBC,SAAS,eAAA;IAEH,IAAA,KAAwB,IAAA,gBAAQ,EAAiB,IAAI,CAAC,EAArD,OAAO,QAAA,EAAE,UAAU,QAAkC,CAAC;IAE7D,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAE5D,IAAA,iBAAS,EAAC;QACR,IAAM,kBAAkB,GAAG;;;;;;wBAEN,qBAAM,eAAK,CAAC,GAAG,CAC9B,oDAA6C,SAAS,UAAO,CAC9D,EAAA;;wBAFK,QAAQ,GAAG,SAEhB;wBAEK,cAAc,GAAG,QAAQ,CAAC,IAAe,CAAC;wBAChD,UAAU,CAAC,cAAc,CAAC,CAAC;;;;wBAE3B,IAAA,yBAAW,EAAC,KAAG,EAAE,yBAAyB,CAAC,CAAC;;;;;aAE/C,CAAC;QAEF,IAAI,SAAS;YAAE,kBAAkB,EAAE,CAAC;IACtC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,CAAC;AAChC,CAAC;AAED,kBAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useCreateReport } from "./useCreateReport";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useCreateReport = void 0;
|
|
7
|
+
var useCreateReport_1 = require("./useCreateReport");
|
|
8
|
+
Object.defineProperty(exports, "useCreateReport", { enumerable: true, get: function () { return __importDefault(useCreateReport_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/reports/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReportReasonKey } from "../../constants/reportReasons";
|
|
2
|
+
declare function useCreateReport(): {
|
|
3
|
+
createCommentReport: ({ targetId, reason, details, }: {
|
|
4
|
+
targetId: string;
|
|
5
|
+
reason: ReportReasonKey;
|
|
6
|
+
details?: string;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
createEntityReport: ({ targetId, reason, details, }: {
|
|
9
|
+
targetId: string;
|
|
10
|
+
reason: ReportReasonKey;
|
|
11
|
+
details?: string;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export default useCreateReport;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
|
|
43
|
+
var useProject_1 = __importDefault(require("../projects/useProject"));
|
|
44
|
+
var user_1 = require("../user");
|
|
45
|
+
function useCreateReport() {
|
|
46
|
+
var _this = this;
|
|
47
|
+
var axios = (0, useAxiosPrivate_1.default)();
|
|
48
|
+
var projectId = (0, useProject_1.default)().projectId;
|
|
49
|
+
var user = (0, user_1.useUser)().user;
|
|
50
|
+
var createReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
51
|
+
var targetId = _b.targetId, targetType = _b.targetType, reason = _b.reason, details = _b.details;
|
|
52
|
+
return __generator(this, function (_c) {
|
|
53
|
+
switch (_c.label) {
|
|
54
|
+
case 0:
|
|
55
|
+
if (!projectId) {
|
|
56
|
+
throw new Error("Project ID is required");
|
|
57
|
+
}
|
|
58
|
+
if (!user) {
|
|
59
|
+
throw new Error("No user is logged in");
|
|
60
|
+
}
|
|
61
|
+
return [4 /*yield*/, axios.post("/".concat(projectId, "/reports"), {
|
|
62
|
+
targetId: targetId,
|
|
63
|
+
targetType: targetType,
|
|
64
|
+
reason: reason,
|
|
65
|
+
details: details,
|
|
66
|
+
}, { withCredentials: true })];
|
|
67
|
+
case 1:
|
|
68
|
+
_c.sent();
|
|
69
|
+
return [2 /*return*/];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}); };
|
|
73
|
+
var createCommentReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
74
|
+
var targetId = _b.targetId, reason = _b.reason, details = _b.details;
|
|
75
|
+
return __generator(this, function (_c) {
|
|
76
|
+
switch (_c.label) {
|
|
77
|
+
case 0: return [4 /*yield*/, createReport({
|
|
78
|
+
targetId: targetId,
|
|
79
|
+
targetType: "Comment",
|
|
80
|
+
reason: reason,
|
|
81
|
+
details: details,
|
|
82
|
+
})];
|
|
83
|
+
case 1:
|
|
84
|
+
_c.sent();
|
|
85
|
+
return [2 /*return*/];
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}); };
|
|
89
|
+
var createEntityReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
90
|
+
var targetId = _b.targetId, reason = _b.reason, details = _b.details;
|
|
91
|
+
return __generator(this, function (_c) {
|
|
92
|
+
switch (_c.label) {
|
|
93
|
+
case 0: return [4 /*yield*/, createReport({
|
|
94
|
+
targetId: targetId,
|
|
95
|
+
targetType: "Entity",
|
|
96
|
+
reason: reason,
|
|
97
|
+
details: details,
|
|
98
|
+
})];
|
|
99
|
+
case 1:
|
|
100
|
+
_c.sent();
|
|
101
|
+
return [2 /*return*/];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}); };
|
|
105
|
+
return { createCommentReport: createCommentReport, createEntityReport: createEntityReport };
|
|
106
|
+
}
|
|
107
|
+
exports.default = useCreateReport;
|
|
108
|
+
//# sourceMappingURL=useCreateReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateReport.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useCreateReport.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAA2D;AAE3D,sEAAgD;AAChD,gCAAkC;AAElC,SAAS,eAAe;IAAxB,iBAuEC;IAtEC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,IAAA,cAAO,GAAE,KAAd,CAAe;IAE3B,IAAM,YAAY,GAAG,gEAAO,EAU3B;YATC,QAAQ,cAAA,EACR,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,OAAO,aAAA;;;;oBAOP,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;oBAC5C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,qBAAM,KAAK,CAAC,IAAI,CACd,WAAI,SAAS,aAAU,EACvB;4BACE,QAAQ,UAAA;4BACR,UAAU,YAAA;4BACV,MAAM,QAAA;4BACN,OAAO,SAAA;yBACR,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBATD,SASC,CAAC;;;;SACH,CAAC;IAEF,IAAM,mBAAmB,GAAG,gEAAO,EAQlC;YAPC,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,OAAO,aAAA;;;wBAMP,qBAAM,YAAY,CAAC;wBACjB,QAAQ,UAAA;wBACR,UAAU,EAAE,SAAS;wBACrB,MAAM,QAAA;wBACN,OAAO,SAAA;qBACR,CAAC,EAAA;;oBALF,SAKE,CAAC;;;;SACJ,CAAC;IAEF,IAAM,kBAAkB,GAAG,gEAAO,EAQjC;YAPC,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,OAAO,aAAA;;;wBAMP,qBAAM,YAAY,CAAC;wBACjB,QAAQ,UAAA;wBACR,UAAU,EAAE,QAAQ;wBACpB,MAAM,QAAA;wBACN,OAAO,SAAA;qBACR,CAAC,EAAA;;oBALF,SAKE,CAAC;;;;SACJ,CAAC;IAEF,OAAO,EAAE,mBAAmB,qBAAA,EAAE,kBAAkB,oBAAA,EAAE,CAAC;AACrD,CAAC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useUploadFile } from "./useUploadFile";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useUploadFile = void 0;
|
|
7
|
+
var useUploadFile_1 = require("./useUploadFile");
|
|
8
|
+
Object.defineProperty(exports, "useUploadFile", { enumerable: true, get: function () { return __importDefault(useUploadFile_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/storage/index.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type BrowserFile = File;
|
|
2
|
+
type RNFile = {
|
|
3
|
+
uri: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
};
|
|
7
|
+
type UniversalFile = BrowserFile | RNFile;
|
|
8
|
+
type UploadResponse = {
|
|
9
|
+
fileId: string;
|
|
10
|
+
relativePath: string;
|
|
11
|
+
publicPath: string;
|
|
12
|
+
};
|
|
13
|
+
declare function useUploadFile(): (file: UniversalFile, pathParts: string[]) => Promise<UploadResponse | void>;
|
|
14
|
+
export default useUploadFile;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var react_1 = require("react");
|
|
43
|
+
var useAxiosPrivate_1 = __importDefault(require("../../config/useAxiosPrivate"));
|
|
44
|
+
var useProject_1 = __importDefault(require("../projects/useProject"));
|
|
45
|
+
// Type guard to detect if it’s a real browser File
|
|
46
|
+
function isBrowserFile(file) {
|
|
47
|
+
return typeof File !== "undefined" && file instanceof File;
|
|
48
|
+
}
|
|
49
|
+
function useUploadFile() {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var axios = (0, useAxiosPrivate_1.default)();
|
|
52
|
+
var projectId = (0, useProject_1.default)().projectId;
|
|
53
|
+
var uploadFile = (0, react_1.useCallback)(function (file, pathParts) { return __awaiter(_this, void 0, void 0, function () {
|
|
54
|
+
var formData, response;
|
|
55
|
+
return __generator(this, function (_a) {
|
|
56
|
+
switch (_a.label) {
|
|
57
|
+
case 0:
|
|
58
|
+
if (!projectId) {
|
|
59
|
+
throw new Error("No projectId available.");
|
|
60
|
+
}
|
|
61
|
+
if (!file || !pathParts || !Array.isArray(pathParts)) {
|
|
62
|
+
throw new Error("Invalid arguments. File and pathParts are required.");
|
|
63
|
+
}
|
|
64
|
+
formData = new FormData();
|
|
65
|
+
// 2) Check if it's a browser File or a React Native { uri, ... } object
|
|
66
|
+
if (isBrowserFile(file)) {
|
|
67
|
+
// We are dealing with a real browser File
|
|
68
|
+
formData.append("file", file, file.name);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
// We assume it’s a React Native { uri, type, name } shape
|
|
72
|
+
formData.append("file", {
|
|
73
|
+
uri: file.uri,
|
|
74
|
+
type: file.type || "application/octet-stream",
|
|
75
|
+
name: file.name,
|
|
76
|
+
}); // casting to `any` to appease TS if needed
|
|
77
|
+
}
|
|
78
|
+
// 3) Append other form fields
|
|
79
|
+
formData.append("pathParts", JSON.stringify(pathParts));
|
|
80
|
+
return [4 /*yield*/, axios.post("/".concat(projectId, "/storage"), formData, {
|
|
81
|
+
headers: {
|
|
82
|
+
"Content-Type": "multipart/form-data",
|
|
83
|
+
},
|
|
84
|
+
withCredentials: true,
|
|
85
|
+
})];
|
|
86
|
+
case 1:
|
|
87
|
+
response = _a.sent();
|
|
88
|
+
return [2 /*return*/, response.data]; // Return the server response
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}); }, [projectId, axios]);
|
|
92
|
+
return uploadFile;
|
|
93
|
+
}
|
|
94
|
+
exports.default = useUploadFile;
|
|
95
|
+
//# sourceMappingURL=useUploadFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUploadFile.js","sourceRoot":"","sources":["../../../../src/hooks/storage/useUploadFile.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,iFAA2D;AAC3D,sEAAgD;AAEhD,mDAAmD;AACnD,SAAS,aAAa,CAAC,IAAmB;IACxC,OAAO,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,YAAY,IAAI,CAAC;AAC7D,CAAC;AAYD,SAAS,aAAa;IAAtB,iBAiDC;IAhDC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IACxB,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAEnC,IAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,UACE,IAAmB,EACnB,SAAmB;;;;;oBAEnB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;wBACrD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;oBACzE,CAAC;oBAEK,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;oBAEhC,wEAAwE;oBACxE,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;wBACxB,0CAA0C;wBAC1C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC3C,CAAC;yBAAM,CAAC;wBACN,0DAA0D;wBAC1D,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;4BACtB,GAAG,EAAE,IAAI,CAAC,GAAG;4BACb,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,0BAA0B;4BAC7C,IAAI,EAAE,IAAI,CAAC,IAAI;yBACT,CAAC,CAAC,CAAC,2CAA2C;oBACxD,CAAC;oBAED,8BAA8B;oBAC9B,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;oBAGvC,qBAAM,KAAK,CAAC,IAAI,CAAC,WAAI,SAAS,aAAU,EAAE,QAAQ,EAAE;4BACnE,OAAO,EAAE;gCACP,cAAc,EAAE,qBAAqB;6BACtC;4BACD,eAAe,EAAE,IAAI;yBACtB,CAAC,EAAA;;oBALI,QAAQ,GAAG,SAKf;oBAEF,sBAAO,QAAQ,CAAC,IAAsB,EAAC,CAAC,6BAA6B;;;SACtE,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useUser = exports.useUserActions = void 0;
|
|
7
|
+
// Export Redux-powered user hooks
|
|
8
|
+
var useUserActions_1 = require("./useUserActions");
|
|
9
|
+
Object.defineProperty(exports, "useUserActions", { enumerable: true, get: function () { return useUserActions_1.useUserActions; } });
|
|
10
|
+
var useUser_1 = require("./useUser");
|
|
11
|
+
Object.defineProperty(exports, "useUser", { enumerable: true, get: function () { return __importDefault(useUser_1).default; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/user/index.ts"],"names":[],"mappings":";;;;;;AAAA,kCAAkC;AAClC,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,qCAImB;AAHjB,mHAAA,OAAO,OAAW"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AuthUser } from "../../interfaces/models/User";
|
|
2
|
+
import type { UpdateUserParams } from "../../store/api/userApi";
|
|
3
|
+
export interface UseUserProps {
|
|
4
|
+
}
|
|
5
|
+
export interface UseUserValues {
|
|
6
|
+
user: AuthUser | null;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
updating: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
updateUser: (update: UpdateUserParams) => Promise<AuthUser>;
|
|
11
|
+
clearError: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Redux-powered hook that provides comprehensive user management
|
|
15
|
+
* This replaces useUserData and provides the same interface with Redux state management
|
|
16
|
+
*/
|
|
17
|
+
declare function useUser(_?: UseUserProps): UseUserValues;
|
|
18
|
+
export default useUser;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var react_1 = require("react");
|
|
43
|
+
var react_redux_1 = require("react-redux");
|
|
44
|
+
var userSlice_1 = require("../../store/slices/userSlice");
|
|
45
|
+
var useUserActions_1 = require("./useUserActions");
|
|
46
|
+
var useProject_1 = __importDefault(require("../projects/useProject"));
|
|
47
|
+
var authSlice_1 = require("../../store/slices/authSlice");
|
|
48
|
+
/**
|
|
49
|
+
* Redux-powered hook that provides comprehensive user management
|
|
50
|
+
* This replaces useUserData and provides the same interface with Redux state management
|
|
51
|
+
*/
|
|
52
|
+
function useUser(_) {
|
|
53
|
+
var _this = this;
|
|
54
|
+
if (_ === void 0) { _ = {}; }
|
|
55
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
56
|
+
// Get external context
|
|
57
|
+
var projectId = (0, useProject_1.default)().projectId;
|
|
58
|
+
// Get Redux state
|
|
59
|
+
var user = (0, react_redux_1.useSelector)(function (state) { return (0, userSlice_1.selectUser)(state); });
|
|
60
|
+
var authUser = (0, react_redux_1.useSelector)(function (state) { return (0, authSlice_1.selectUser)(state); }); // Fallback to auth user
|
|
61
|
+
var loading = (0, react_redux_1.useSelector)(function (state) { return (0, userSlice_1.selectUserLoading)(state); });
|
|
62
|
+
var updating = (0, react_redux_1.useSelector)(function (state) { return (0, userSlice_1.selectUserUpdating)(state); });
|
|
63
|
+
var error = (0, react_redux_1.useSelector)(function (state) { return (0, userSlice_1.selectUserError)(state); });
|
|
64
|
+
var currentProjectId = (0, react_redux_1.useSelector)(function (state) { return (0, userSlice_1.selectCurrentProjectId)(state); });
|
|
65
|
+
// Get actions
|
|
66
|
+
var _a = (0, useUserActions_1.useUserActions)(), setUser = _a.setUser, updateUserAction = _a.updateUser, clearError = _a.clearError;
|
|
67
|
+
// Update Redux state when project changes
|
|
68
|
+
(0, react_1.useEffect)(function () {
|
|
69
|
+
if (projectId && projectId !== currentProjectId) {
|
|
70
|
+
dispatch((0, userSlice_1.setProjectContext)(projectId));
|
|
71
|
+
}
|
|
72
|
+
}, [dispatch, projectId, currentProjectId]);
|
|
73
|
+
// Sync auth user to user slice when auth user changes and we don't have a user yet
|
|
74
|
+
(0, react_1.useEffect)(function () {
|
|
75
|
+
if (authUser && !user) {
|
|
76
|
+
setUser(authUser);
|
|
77
|
+
}
|
|
78
|
+
}, [authUser, user, setUser]);
|
|
79
|
+
// Current user operations with projectId included automatically
|
|
80
|
+
var handleUpdateUser = (0, react_1.useCallback)(function (update) { return __awaiter(_this, void 0, void 0, function () {
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
switch (_a.label) {
|
|
83
|
+
case 0:
|
|
84
|
+
if (!user) {
|
|
85
|
+
throw new Error("No user available to update");
|
|
86
|
+
}
|
|
87
|
+
if (!projectId) {
|
|
88
|
+
throw new Error("No projectId available");
|
|
89
|
+
}
|
|
90
|
+
return [4 /*yield*/, updateUserAction(projectId, user.id, update, user)];
|
|
91
|
+
case 1:
|
|
92
|
+
// Pass current user for optimistic update reversion if needed
|
|
93
|
+
return [2 /*return*/, _a.sent()];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}); }, [updateUserAction, user, projectId]);
|
|
97
|
+
// Return focused interface for current user management
|
|
98
|
+
return (0, react_1.useMemo)(function () { return ({
|
|
99
|
+
user: user || authUser, // Fallback to auth user if user slice is empty
|
|
100
|
+
loading: loading,
|
|
101
|
+
updating: updating,
|
|
102
|
+
error: error,
|
|
103
|
+
updateUser: handleUpdateUser,
|
|
104
|
+
clearError: clearError,
|
|
105
|
+
}); }, [
|
|
106
|
+
user,
|
|
107
|
+
authUser,
|
|
108
|
+
loading,
|
|
109
|
+
updating,
|
|
110
|
+
error,
|
|
111
|
+
handleUpdateUser,
|
|
112
|
+
clearError,
|
|
113
|
+
]);
|
|
114
|
+
}
|
|
115
|
+
exports.default = useUser;
|
|
116
|
+
//# sourceMappingURL=useUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUser.js","sourceRoot":"","sources":["../../../../src/hooks/user/useUser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAwD;AACxD,2CAAuD;AAGvD,0DAOsC;AACtC,mDAAkD;AAClD,sEAAgD;AAChD,0DAA4E;AAmB5E;;;GAGG;AACH,SAAS,OAAO,CAAC,CAAoB;IAArC,iBA0EC;IA1EgB,kBAAA,EAAA,MAAoB;IACnC,IAAM,QAAQ,GAAG,IAAA,yBAAW,GAAe,CAAC;IAE5C,uBAAuB;IACf,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAEnC,kBAAkB;IAClB,IAAM,IAAI,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAgB,IAAK,OAAA,IAAA,sBAAU,EAAC,KAAK,CAAC,EAAjB,CAAiB,CAAC,CAAC;IAClE,IAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAgB,IAAK,OAAA,IAAA,sBAAc,EAAC,KAAK,CAAC,EAArB,CAAqB,CAAC,CAAC,CAAC,wBAAwB;IACnG,IAAM,OAAO,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAgB,IAAK,OAAA,IAAA,6BAAiB,EAAC,KAAK,CAAC,EAAxB,CAAwB,CAAC,CAAC;IAC5E,IAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAgB,IAAK,OAAA,IAAA,8BAAkB,EAAC,KAAK,CAAC,EAAzB,CAAyB,CAAC,CAAC;IAC9E,IAAM,KAAK,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAgB,IAAK,OAAA,IAAA,2BAAe,EAAC,KAAK,CAAC,EAAtB,CAAsB,CAAC,CAAC;IACxE,IAAM,gBAAgB,GAAG,IAAA,yBAAW,EAAC,UAAC,KAAgB,IAAK,OAAA,IAAA,kCAAsB,EAAC,KAAK,CAAC,EAA7B,CAA6B,CAAC,CAAC;IAE1F,cAAc;IACR,IAAA,KAIF,IAAA,+BAAc,GAAE,EAHlB,OAAO,aAAA,EACK,gBAAgB,gBAAA,EAC5B,UAAU,gBACQ,CAAC;IAErB,0CAA0C;IAC1C,IAAA,iBAAS,EAAC;QACR,IAAI,SAAS,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC;YAChD,QAAQ,CAAC,IAAA,6BAAiB,EAAC,SAAS,CAAC,CAAC,CAAC;QACzC,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE5C,mFAAmF;IACnF,IAAA,iBAAS,EAAC;QACR,IAAI,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YACtB,OAAO,CAAC,QAAQ,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAE9B,gEAAgE;IAChE,IAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,UAAO,MAAwB;;;;oBAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;oBACjD,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;oBAC5C,CAAC;oBAGM,qBAAM,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAA;;gBAD/D,8DAA8D;gBAC9D,sBAAO,SAAwD,EAAC;;;SACjE,EACD,CAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,CAAC,CACpC,CAAC;IAEF,uDAAuD;IACvD,OAAO,IAAA,eAAO,EACZ,cAAM,OAAA,CAAC;QACL,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,+CAA+C;QACvE,OAAO,SAAA;QACP,QAAQ,UAAA;QACR,KAAK,OAAA;QAEL,UAAU,EAAE,gBAAgB;QAE5B,UAAU,YAAA;KACX,CAAC,EATI,CASJ,EACF;QACE,IAAI;QACJ,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,KAAK;QACL,gBAAgB;QAChB,UAAU;KACX,CACF,CAAC;AACJ,CAAC;AAED,kBAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type UpdateUserParams } from "../../store/api/userApi";
|
|
2
|
+
/**
|
|
3
|
+
* Redux-powered hook that provides current user management actions
|
|
4
|
+
* Focused on current user operations only
|
|
5
|
+
*/
|
|
6
|
+
export declare function useUserActions(): {
|
|
7
|
+
setUser: (user: any) => void;
|
|
8
|
+
clearUser: () => void;
|
|
9
|
+
updateUser: (projectId: string, userId: string, update: UpdateUserParams, currentUser?: any) => Promise<import("../..").AuthUser>;
|
|
10
|
+
clearError: () => void;
|
|
11
|
+
};
|
|
12
|
+
export default useUserActions;
|