@replyke/core 7.0.0-beta.5 → 7.0.0-beta.51
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.js +1 -1
- package/dist/cjs/config/axios.js.map +1 -1
- package/dist/cjs/context/replyke-store-context.js +3 -2
- package/dist/cjs/context/replyke-store-context.js.map +1 -1
- package/dist/cjs/hooks/app-notifications/useAppNotifications.js +9 -9
- package/dist/cjs/hooks/app-notifications/useAppNotifications.js.map +1 -1
- package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.js +6 -6
- package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.js.map +1 -1
- package/dist/cjs/hooks/auth/useAuth.d.ts +5 -1
- package/dist/cjs/hooks/auth/useAuth.js +6 -6
- package/dist/cjs/hooks/auth/useAuth.js.map +1 -1
- package/dist/cjs/hooks/collections/index.d.ts +4 -0
- package/dist/cjs/hooks/collections/index.js +16 -0
- package/dist/cjs/hooks/collections/index.js.map +1 -0
- package/dist/cjs/hooks/collections/useCollectionEntitiesWrapper.d.ts +21 -0
- package/dist/cjs/hooks/collections/useCollectionEntitiesWrapper.js +211 -0
- package/dist/cjs/hooks/collections/useCollectionEntitiesWrapper.js.map +1 -0
- package/dist/cjs/hooks/collections/useCollections.d.ts +43 -0
- package/dist/cjs/hooks/collections/useCollections.js +277 -0
- package/dist/cjs/hooks/collections/useCollections.js.map +1 -0
- package/dist/cjs/hooks/collections/useCollectionsActions.d.ts +21 -0
- package/dist/cjs/hooks/{lists/useListsActions.js → collections/useCollectionsActions.js} +114 -120
- package/dist/cjs/hooks/collections/useCollectionsActions.js.map +1 -0
- package/dist/cjs/hooks/{lists → collections}/useIsEntitySaved.d.ts +2 -2
- package/dist/cjs/hooks/{lists → collections}/useIsEntitySaved.js +3 -3
- package/dist/cjs/hooks/collections/useIsEntitySaved.js.map +1 -0
- package/dist/cjs/hooks/comments/index.d.ts +2 -2
- package/dist/cjs/hooks/comments/index.js +3 -5
- package/dist/cjs/hooks/comments/index.js.map +1 -1
- package/dist/cjs/hooks/comments/useCommentSectionData.js +35 -12
- package/dist/cjs/hooks/comments/useCommentSectionData.js.map +1 -1
- package/dist/cjs/hooks/comments/useEntityComments.d.ts +2 -1
- package/dist/cjs/hooks/comments/useEntityComments.js +2 -1
- package/dist/cjs/hooks/comments/useEntityComments.js.map +1 -1
- package/dist/cjs/hooks/comments/useFetchComment.d.ts +3 -4
- package/dist/cjs/hooks/comments/useFetchComment.js +7 -5
- package/dist/cjs/hooks/comments/useFetchComment.js.map +1 -1
- package/dist/cjs/hooks/comments/useFetchCommentByForeignId.d.ts +3 -4
- package/dist/cjs/hooks/comments/useFetchCommentByForeignId.js +9 -6
- package/dist/cjs/hooks/comments/useFetchCommentByForeignId.js.map +1 -1
- package/dist/cjs/hooks/comments/useFetchManyComments.d.ts +2 -2
- package/dist/cjs/hooks/comments/useFetchManyComments.js +5 -7
- package/dist/cjs/hooks/comments/useFetchManyComments.js.map +1 -1
- package/dist/cjs/hooks/comments/useFetchManyCommentsWrapper.d.ts +21 -0
- package/dist/cjs/hooks/comments/{useProfileComments.js → useFetchManyCommentsWrapper.js} +40 -18
- package/dist/cjs/hooks/comments/useFetchManyCommentsWrapper.js.map +1 -0
- package/dist/cjs/hooks/comments/useReplies.js +1 -0
- package/dist/cjs/hooks/comments/useReplies.js.map +1 -1
- package/dist/cjs/hooks/entities/index.d.ts +2 -5
- package/dist/cjs/hooks/entities/index.js +3 -11
- package/dist/cjs/hooks/entities/index.js.map +1 -1
- package/dist/cjs/hooks/entities/useCreateEntity.d.ts +20 -0
- package/dist/cjs/hooks/entities/useCreateEntity.js +88 -15
- package/dist/cjs/hooks/entities/useCreateEntity.js.map +1 -1
- package/dist/cjs/hooks/entities/useEntityData.d.ts +0 -6
- package/dist/cjs/hooks/entities/useEntityData.js +0 -19
- package/dist/cjs/hooks/entities/useEntityData.js.map +1 -1
- package/dist/cjs/hooks/entities/useFetchManyEntitiesWrapper.d.ts +41 -0
- package/dist/cjs/hooks/entities/useFetchManyEntitiesWrapper.js +241 -0
- package/dist/cjs/hooks/entities/useFetchManyEntitiesWrapper.js.map +1 -0
- package/dist/cjs/hooks/entities/useUpdateEntity.js +6 -2
- package/dist/cjs/hooks/entities/useUpdateEntity.js.map +1 -1
- package/dist/cjs/hooks/entity-lists/index.d.ts +1 -1
- package/dist/cjs/hooks/entity-lists/useEntityList.d.ts +2 -2
- package/dist/cjs/hooks/entity-lists/useEntityList.js +46 -24
- package/dist/cjs/hooks/entity-lists/useEntityList.js.map +1 -1
- package/dist/cjs/hooks/entity-lists/useEntityListActions.d.ts +5 -4
- package/dist/cjs/hooks/entity-lists/useEntityListActions.js +3 -2
- package/dist/cjs/hooks/entity-lists/useEntityListActions.js.map +1 -1
- package/dist/cjs/hooks/reactions/index.d.ts +10 -0
- package/dist/cjs/hooks/reactions/index.js +21 -0
- package/dist/cjs/hooks/reactions/index.js.map +1 -0
- package/dist/cjs/hooks/reactions/useAddReaction.d.ts +9 -0
- package/dist/cjs/hooks/{comments/useUpvoteComment.js → reactions/useAddReaction.js} +19 -13
- package/dist/cjs/hooks/reactions/useAddReaction.js.map +1 -0
- package/dist/cjs/hooks/reactions/useFetchCommentReactions.d.ts +10 -0
- package/dist/cjs/hooks/reactions/useFetchCommentReactions.js +84 -0
- package/dist/cjs/hooks/reactions/useFetchCommentReactions.js.map +1 -0
- package/dist/cjs/hooks/reactions/useFetchCommentReactionsWrapper.d.ts +17 -0
- package/dist/cjs/hooks/reactions/useFetchCommentReactionsWrapper.js +170 -0
- package/dist/cjs/hooks/reactions/useFetchCommentReactionsWrapper.js.map +1 -0
- package/dist/cjs/hooks/reactions/useFetchEntityReactions.d.ts +10 -0
- package/dist/cjs/hooks/{entities/useUpvoteEntity.js → reactions/useFetchEntityReactions.js} +26 -13
- package/dist/cjs/hooks/reactions/useFetchEntityReactions.js.map +1 -0
- package/dist/cjs/hooks/reactions/useFetchEntityReactionsWrapper.d.ts +17 -0
- package/dist/cjs/hooks/reactions/useFetchEntityReactionsWrapper.js +170 -0
- package/dist/cjs/hooks/reactions/useFetchEntityReactionsWrapper.js.map +1 -0
- package/dist/cjs/hooks/reactions/useReactionToggle.d.ts +19 -0
- package/dist/cjs/hooks/reactions/useReactionToggle.js +146 -0
- package/dist/cjs/hooks/reactions/useReactionToggle.js.map +1 -0
- package/dist/cjs/hooks/reactions/useRemoveReaction.d.ts +7 -0
- package/dist/cjs/hooks/{comments/useRemoveCommentUpvote.js → reactions/useRemoveReaction.js} +16 -13
- package/dist/cjs/hooks/reactions/useRemoveReaction.js.map +1 -0
- package/dist/cjs/hooks/space-lists/useSpaceList.js +9 -9
- package/dist/cjs/hooks/space-lists/useSpaceList.js.map +1 -1
- package/dist/cjs/hooks/space-lists/useSpaceListActions.js +2 -2
- package/dist/cjs/hooks/space-lists/useSpaceListActions.js.map +1 -1
- package/dist/cjs/hooks/spaces/index.d.ts +3 -0
- package/dist/cjs/hooks/spaces/index.js +10 -1
- package/dist/cjs/hooks/spaces/index.js.map +1 -1
- package/dist/cjs/hooks/spaces/rules/index.d.ts +10 -0
- package/dist/cjs/hooks/spaces/rules/index.js +17 -0
- package/dist/cjs/hooks/spaces/rules/index.js.map +1 -0
- package/dist/cjs/hooks/spaces/rules/useCreateRule.d.ts +9 -0
- package/dist/cjs/hooks/{users/useUpdateUser.js → spaces/rules/useCreateRule.js} +19 -19
- package/dist/cjs/hooks/spaces/rules/useCreateRule.js.map +1 -0
- package/dist/cjs/hooks/spaces/rules/useDeleteRule.d.ts +7 -0
- package/dist/cjs/hooks/{entities/useRemoveEntityUpvote.js → spaces/rules/useDeleteRule.js} +18 -15
- package/dist/cjs/hooks/spaces/rules/useDeleteRule.js.map +1 -0
- package/dist/cjs/hooks/spaces/rules/useFetchManyRules.d.ts +6 -0
- package/dist/cjs/hooks/{entities/useDownvoteEntity.js → spaces/rules/useFetchManyRules.js} +15 -15
- package/dist/cjs/hooks/spaces/rules/useFetchManyRules.js.map +1 -0
- package/dist/cjs/hooks/spaces/rules/useFetchRule.d.ts +7 -0
- package/dist/cjs/hooks/{entities/useRemoveEntityDownvote.js → spaces/rules/useFetchRule.js} +18 -15
- package/dist/cjs/hooks/spaces/rules/useFetchRule.js.map +1 -0
- package/dist/cjs/hooks/spaces/rules/useUpdateRule.d.ts +12 -0
- package/dist/cjs/hooks/{comments/useRemoveCommentDownvote.js → spaces/rules/useUpdateRule.js} +18 -15
- package/dist/cjs/hooks/spaces/rules/useUpdateRule.js.map +1 -0
- package/dist/cjs/hooks/spaces/useCheckMyMembership.d.ts +5 -0
- package/dist/cjs/hooks/{comments/useDownvoteComment.js → spaces/useCheckMyMembership.js} +14 -14
- package/dist/cjs/hooks/spaces/useCheckMyMembership.js.map +1 -0
- package/dist/cjs/hooks/spaces/useCreateSpace.d.ts +7 -2
- package/dist/cjs/hooks/spaces/useCreateSpace.js +54 -3
- package/dist/cjs/hooks/spaces/useCreateSpace.js.map +1 -1
- package/dist/cjs/hooks/spaces/useFetchManySpaces.d.ts +2 -1
- package/dist/cjs/hooks/spaces/useFetchManySpaces.js +5 -0
- package/dist/cjs/hooks/spaces/useFetchManySpaces.js.map +1 -1
- package/dist/cjs/hooks/spaces/useFetchMySpaces.d.ts +2 -1
- package/dist/cjs/hooks/spaces/useFetchMySpaces.js +30 -2
- package/dist/cjs/hooks/spaces/useFetchMySpaces.js.map +1 -1
- package/dist/cjs/hooks/spaces/useFetchSpace.d.ts +3 -2
- package/dist/cjs/hooks/spaces/useFetchSpace.js +10 -3
- package/dist/cjs/hooks/spaces/useFetchSpace.js.map +1 -1
- package/dist/cjs/hooks/spaces/useFetchSpaceByShortId.d.ts +3 -2
- package/dist/cjs/hooks/spaces/useFetchSpaceByShortId.js +21 -3
- package/dist/cjs/hooks/spaces/useFetchSpaceByShortId.js.map +1 -1
- package/dist/cjs/hooks/spaces/useFetchSpaceBySlug.d.ts +3 -2
- package/dist/cjs/hooks/spaces/useFetchSpaceBySlug.js +21 -3
- package/dist/cjs/hooks/spaces/useFetchSpaceBySlug.js.map +1 -1
- package/dist/cjs/hooks/spaces/useFetchSpaceChildren.d.ts +3 -2
- package/dist/cjs/hooks/spaces/useFetchSpaceChildren.js +21 -3
- package/dist/cjs/hooks/spaces/useFetchSpaceChildren.js.map +1 -1
- package/dist/cjs/hooks/spaces/useUpdateSpace.d.ts +7 -2
- package/dist/cjs/hooks/spaces/useUpdateSpace.js +49 -4
- package/dist/cjs/hooks/spaces/useUpdateSpace.js.map +1 -1
- package/dist/cjs/hooks/storage/index.d.ts +1 -0
- package/dist/cjs/hooks/storage/index.js +3 -1
- package/dist/cjs/hooks/storage/index.js.map +1 -1
- package/dist/cjs/hooks/storage/useUploadFile.d.ts +12 -1
- package/dist/cjs/hooks/storage/useUploadFile.js +22 -8
- package/dist/cjs/hooks/storage/useUploadFile.js.map +1 -1
- package/dist/cjs/hooks/storage/useUploadImage.d.ts +14 -0
- package/dist/cjs/hooks/storage/useUploadImage.js +159 -0
- package/dist/cjs/hooks/storage/useUploadImage.js.map +1 -0
- package/dist/cjs/hooks/user/index.d.ts +1 -0
- package/dist/cjs/hooks/user/useUser.js +8 -8
- package/dist/cjs/hooks/user/useUser.js.map +1 -1
- package/dist/cjs/hooks/user/useUserActions.js +21 -4
- package/dist/cjs/hooks/user/useUserActions.js.map +1 -1
- package/dist/cjs/hooks/users/index.d.ts +1 -1
- package/dist/cjs/hooks/users/index.js +3 -3
- package/dist/cjs/hooks/users/index.js.map +1 -1
- package/dist/cjs/hooks/users/useFetchUser.d.ts +3 -2
- package/dist/cjs/hooks/users/useFetchUser.js +10 -3
- package/dist/cjs/hooks/users/useFetchUser.js.map +1 -1
- package/dist/cjs/hooks/users/useFetchUserByForeignId.d.ts +3 -2
- package/dist/cjs/hooks/users/useFetchUserByForeignId.js +19 -3
- package/dist/cjs/hooks/users/useFetchUserByForeignId.js.map +1 -1
- package/dist/cjs/hooks/users/useFetchUserByUsername.d.ts +6 -0
- package/dist/cjs/hooks/users/useFetchUserByUsername.js +88 -0
- package/dist/cjs/hooks/users/useFetchUserByUsername.js.map +1 -0
- package/dist/cjs/index.d.ts +16 -12
- package/dist/cjs/index.js +22 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/models/{List.d.ts → Collection.d.ts} +2 -4
- package/dist/cjs/interfaces/models/Collection.js +3 -0
- package/dist/cjs/interfaces/models/Collection.js.map +1 -0
- package/dist/cjs/interfaces/models/Comment.d.ts +8 -1
- package/dist/cjs/interfaces/models/Entity.d.ts +8 -1
- package/dist/cjs/interfaces/models/File.d.ts +38 -0
- package/dist/cjs/interfaces/models/{List.js → File.js} +1 -1
- package/dist/cjs/interfaces/models/File.js.map +1 -0
- package/dist/cjs/interfaces/models/Image.d.ts +74 -0
- package/dist/cjs/interfaces/models/Image.js +3 -0
- package/dist/cjs/interfaces/models/Image.js.map +1 -0
- package/dist/cjs/interfaces/models/Reaction.d.ts +23 -0
- package/dist/cjs/interfaces/models/Reaction.js +3 -0
- package/dist/cjs/interfaces/models/Reaction.js.map +1 -0
- package/dist/cjs/interfaces/models/Rule.d.ts +22 -0
- package/dist/cjs/interfaces/models/Rule.js +3 -0
- package/dist/cjs/interfaces/models/Rule.js.map +1 -0
- package/dist/cjs/interfaces/models/Space.d.ts +23 -3
- package/dist/cjs/interfaces/models/User.d.ts +9 -1
- package/dist/cjs/store/api/appNotificationsApi.d.ts +181 -181
- package/dist/cjs/store/api/baseApi.d.ts +1 -1
- package/dist/cjs/store/api/baseApi.js +2 -1
- package/dist/cjs/store/api/baseApi.js.map +1 -1
- package/dist/cjs/store/api/collectionsApi.d.ts +4541 -0
- package/dist/cjs/store/api/collectionsApi.js +244 -0
- package/dist/cjs/store/api/collectionsApi.js.map +1 -0
- package/dist/cjs/store/api/entityListsApi.d.ts +110 -110
- package/dist/cjs/store/api/entityListsApi.js.map +1 -1
- package/dist/cjs/store/api/index.d.ts +1 -1
- package/dist/cjs/store/api/index.js +2 -2
- package/dist/cjs/store/api/index.js.map +1 -1
- package/dist/cjs/store/api/spacesApi.d.ts +950 -950
- package/dist/cjs/store/api/userApi.d.ts +12 -4
- package/dist/cjs/store/api/userApi.js +62 -11
- package/dist/cjs/store/api/userApi.js.map +1 -1
- package/dist/cjs/store/index.d.ts +4 -4
- package/dist/cjs/store/replykeReduxContext.d.ts +6 -0
- package/dist/cjs/store/replykeReduxContext.js +45 -0
- package/dist/cjs/store/replykeReduxContext.js.map +1 -0
- package/dist/cjs/store/rootReducer.d.ts +4 -4
- package/dist/cjs/store/rootReducer.js +2 -2
- package/dist/cjs/store/rootReducer.js.map +1 -1
- package/dist/cjs/store/slices/authSlice.d.ts +1 -3
- package/dist/cjs/store/slices/authSlice.js +3 -9
- package/dist/cjs/store/slices/authSlice.js.map +1 -1
- package/dist/cjs/store/slices/authThunks.d.ts +4 -0
- package/dist/cjs/store/slices/authThunks.js +51 -13
- package/dist/cjs/store/slices/authThunks.js.map +1 -1
- package/dist/cjs/store/slices/collectionsSlice.d.ts +427 -0
- package/dist/cjs/store/slices/collectionsSlice.js +211 -0
- package/dist/cjs/store/slices/collectionsSlice.js.map +1 -0
- package/dist/cjs/store/slices/entityListsSlice.d.ts +3748 -183
- package/dist/cjs/store/slices/entityListsSlice.js +44 -21
- package/dist/cjs/store/slices/entityListsSlice.js.map +1 -1
- package/dist/cjs/store/slices/spaceListsSlice.d.ts +985 -25
- package/dist/cjs/store/slices/userSlice.d.ts +696 -0
- package/dist/cjs/utils/env.js +3 -3
- package/dist/cjs/utils/env.js.map +1 -1
- package/dist/esm/config/axios.js +1 -1
- package/dist/esm/config/axios.js.map +1 -1
- package/dist/esm/context/replyke-store-context.js +4 -3
- package/dist/esm/context/replyke-store-context.js.map +1 -1
- package/dist/esm/hooks/app-notifications/useAppNotifications.js +9 -9
- package/dist/esm/hooks/app-notifications/useAppNotifications.js.map +1 -1
- package/dist/esm/hooks/app-notifications/useAppNotificationsActions.js +6 -6
- package/dist/esm/hooks/app-notifications/useAppNotificationsActions.js.map +1 -1
- package/dist/esm/hooks/auth/useAuth.d.ts +5 -1
- package/dist/esm/hooks/auth/useAuth.js +7 -7
- package/dist/esm/hooks/auth/useAuth.js.map +1 -1
- package/dist/esm/hooks/collections/index.d.ts +4 -0
- package/dist/esm/hooks/collections/index.js +6 -0
- package/dist/esm/hooks/collections/index.js.map +1 -0
- package/dist/esm/hooks/collections/useCollectionEntitiesWrapper.d.ts +21 -0
- package/dist/esm/hooks/collections/useCollectionEntitiesWrapper.js +206 -0
- package/dist/esm/hooks/collections/useCollectionEntitiesWrapper.js.map +1 -0
- package/dist/esm/hooks/collections/useCollections.d.ts +43 -0
- package/dist/esm/hooks/collections/useCollections.js +272 -0
- package/dist/esm/hooks/collections/useCollections.js.map +1 -0
- package/dist/esm/hooks/collections/useCollectionsActions.d.ts +21 -0
- package/dist/esm/hooks/{lists/useListsActions.js → collections/useCollectionsActions.js} +105 -111
- package/dist/esm/hooks/collections/useCollectionsActions.js.map +1 -0
- package/dist/esm/hooks/{lists → collections}/useIsEntitySaved.d.ts +2 -2
- package/dist/esm/hooks/{lists → collections}/useIsEntitySaved.js +3 -3
- package/dist/esm/hooks/collections/useIsEntitySaved.js.map +1 -0
- package/dist/esm/hooks/comments/index.d.ts +2 -2
- package/dist/esm/hooks/comments/index.js +1 -2
- package/dist/esm/hooks/comments/index.js.map +1 -1
- package/dist/esm/hooks/comments/useCommentSectionData.js +35 -12
- package/dist/esm/hooks/comments/useCommentSectionData.js.map +1 -1
- package/dist/esm/hooks/comments/useEntityComments.d.ts +2 -1
- package/dist/esm/hooks/comments/useEntityComments.js +2 -1
- package/dist/esm/hooks/comments/useEntityComments.js.map +1 -1
- package/dist/esm/hooks/comments/useFetchComment.d.ts +3 -4
- package/dist/esm/hooks/comments/useFetchComment.js +7 -5
- package/dist/esm/hooks/comments/useFetchComment.js.map +1 -1
- package/dist/esm/hooks/comments/useFetchCommentByForeignId.d.ts +3 -4
- package/dist/esm/hooks/comments/useFetchCommentByForeignId.js +9 -6
- package/dist/esm/hooks/comments/useFetchCommentByForeignId.js.map +1 -1
- package/dist/esm/hooks/comments/useFetchManyComments.d.ts +2 -2
- package/dist/esm/hooks/comments/useFetchManyComments.js +5 -7
- package/dist/esm/hooks/comments/useFetchManyComments.js.map +1 -1
- package/dist/esm/hooks/comments/useFetchManyCommentsWrapper.d.ts +21 -0
- package/dist/esm/hooks/comments/{useProfileComments.js → useFetchManyCommentsWrapper.js} +40 -18
- package/dist/esm/hooks/comments/useFetchManyCommentsWrapper.js.map +1 -0
- package/dist/esm/hooks/comments/useReplies.js +1 -0
- package/dist/esm/hooks/comments/useReplies.js.map +1 -1
- package/dist/esm/hooks/entities/index.d.ts +2 -5
- package/dist/esm/hooks/entities/index.js +1 -5
- package/dist/esm/hooks/entities/index.js.map +1 -1
- package/dist/esm/hooks/entities/useCreateEntity.d.ts +20 -0
- package/dist/esm/hooks/entities/useCreateEntity.js +88 -15
- package/dist/esm/hooks/entities/useCreateEntity.js.map +1 -1
- package/dist/esm/hooks/entities/useEntityData.d.ts +0 -6
- package/dist/esm/hooks/entities/useEntityData.js +0 -19
- package/dist/esm/hooks/entities/useEntityData.js.map +1 -1
- package/dist/esm/hooks/entities/useFetchManyEntitiesWrapper.d.ts +41 -0
- package/dist/esm/hooks/entities/useFetchManyEntitiesWrapper.js +236 -0
- package/dist/esm/hooks/entities/useFetchManyEntitiesWrapper.js.map +1 -0
- package/dist/esm/hooks/entities/useUpdateEntity.js +6 -2
- package/dist/esm/hooks/entities/useUpdateEntity.js.map +1 -1
- package/dist/esm/hooks/entity-lists/index.d.ts +1 -1
- package/dist/esm/hooks/entity-lists/useEntityList.d.ts +2 -2
- package/dist/esm/hooks/entity-lists/useEntityList.js +47 -25
- package/dist/esm/hooks/entity-lists/useEntityList.js.map +1 -1
- package/dist/esm/hooks/entity-lists/useEntityListActions.d.ts +5 -4
- package/dist/esm/hooks/entity-lists/useEntityListActions.js +3 -2
- package/dist/esm/hooks/entity-lists/useEntityListActions.js.map +1 -1
- package/dist/esm/hooks/reactions/index.d.ts +10 -0
- package/dist/esm/hooks/reactions/index.js +8 -0
- package/dist/esm/hooks/reactions/index.js.map +1 -0
- package/dist/esm/hooks/reactions/useAddReaction.d.ts +9 -0
- package/dist/esm/hooks/{comments/useUpvoteComment.js → reactions/useAddReaction.js} +19 -13
- package/dist/esm/hooks/reactions/useAddReaction.js.map +1 -0
- package/dist/esm/hooks/reactions/useFetchCommentReactions.d.ts +10 -0
- package/dist/esm/hooks/reactions/useFetchCommentReactions.js +79 -0
- package/dist/esm/hooks/reactions/useFetchCommentReactions.js.map +1 -0
- package/dist/esm/hooks/reactions/useFetchCommentReactionsWrapper.d.ts +17 -0
- package/dist/esm/hooks/reactions/useFetchCommentReactionsWrapper.js +165 -0
- package/dist/esm/hooks/reactions/useFetchCommentReactionsWrapper.js.map +1 -0
- package/dist/esm/hooks/reactions/useFetchEntityReactions.d.ts +10 -0
- package/dist/esm/hooks/{entities/useRemoveEntityUpvote.js → reactions/useFetchEntityReactions.js} +26 -13
- package/dist/esm/hooks/reactions/useFetchEntityReactions.js.map +1 -0
- package/dist/esm/hooks/reactions/useFetchEntityReactionsWrapper.d.ts +17 -0
- package/dist/esm/hooks/reactions/useFetchEntityReactionsWrapper.js +165 -0
- package/dist/esm/hooks/reactions/useFetchEntityReactionsWrapper.js.map +1 -0
- package/dist/esm/hooks/reactions/useReactionToggle.d.ts +19 -0
- package/dist/esm/hooks/reactions/useReactionToggle.js +141 -0
- package/dist/esm/hooks/reactions/useReactionToggle.js.map +1 -0
- package/dist/esm/hooks/reactions/useRemoveReaction.d.ts +7 -0
- package/dist/esm/hooks/{comments/useRemoveCommentUpvote.js → reactions/useRemoveReaction.js} +16 -13
- package/dist/esm/hooks/reactions/useRemoveReaction.js.map +1 -0
- package/dist/esm/hooks/space-lists/useSpaceList.js +9 -9
- package/dist/esm/hooks/space-lists/useSpaceList.js.map +1 -1
- package/dist/esm/hooks/space-lists/useSpaceListActions.js +2 -2
- package/dist/esm/hooks/space-lists/useSpaceListActions.js.map +1 -1
- package/dist/esm/hooks/spaces/index.d.ts +3 -0
- package/dist/esm/hooks/spaces/index.js +3 -0
- package/dist/esm/hooks/spaces/index.js.map +1 -1
- package/dist/esm/hooks/spaces/rules/index.d.ts +10 -0
- package/dist/esm/hooks/spaces/rules/index.js +6 -0
- package/dist/esm/hooks/spaces/rules/index.js.map +1 -0
- package/dist/esm/hooks/spaces/rules/useCreateRule.d.ts +9 -0
- package/dist/esm/hooks/{entities/useUpvoteEntity.js → spaces/rules/useCreateRule.js} +22 -15
- package/dist/esm/hooks/spaces/rules/useCreateRule.js.map +1 -0
- package/dist/esm/hooks/spaces/rules/useDeleteRule.d.ts +7 -0
- package/dist/esm/hooks/{entities/useRemoveEntityDownvote.js → spaces/rules/useDeleteRule.js} +18 -15
- package/dist/esm/hooks/spaces/rules/useDeleteRule.js.map +1 -0
- package/dist/esm/hooks/spaces/rules/useFetchManyRules.d.ts +6 -0
- package/dist/esm/hooks/{entities/useDownvoteEntity.js → spaces/rules/useFetchManyRules.js} +15 -15
- package/dist/esm/hooks/spaces/rules/useFetchManyRules.js.map +1 -0
- package/dist/esm/hooks/spaces/rules/useFetchRule.d.ts +7 -0
- package/dist/esm/hooks/{comments/useRemoveCommentDownvote.js → spaces/rules/useFetchRule.js} +18 -15
- package/dist/esm/hooks/spaces/rules/useFetchRule.js.map +1 -0
- package/dist/esm/hooks/spaces/rules/useUpdateRule.d.ts +12 -0
- package/dist/esm/hooks/{users/useUpdateUser.js → spaces/rules/useUpdateRule.js} +15 -19
- package/dist/esm/hooks/spaces/rules/useUpdateRule.js.map +1 -0
- package/dist/esm/hooks/spaces/useCheckMyMembership.d.ts +5 -0
- package/dist/esm/hooks/{comments/useDownvoteComment.js → spaces/useCheckMyMembership.js} +14 -14
- package/dist/esm/hooks/spaces/useCheckMyMembership.js.map +1 -0
- package/dist/esm/hooks/spaces/useCreateSpace.d.ts +7 -2
- package/dist/esm/hooks/spaces/useCreateSpace.js +54 -3
- package/dist/esm/hooks/spaces/useCreateSpace.js.map +1 -1
- package/dist/esm/hooks/spaces/useFetchManySpaces.d.ts +2 -1
- package/dist/esm/hooks/spaces/useFetchManySpaces.js +5 -0
- package/dist/esm/hooks/spaces/useFetchManySpaces.js.map +1 -1
- package/dist/esm/hooks/spaces/useFetchMySpaces.d.ts +2 -1
- package/dist/esm/hooks/spaces/useFetchMySpaces.js +30 -2
- package/dist/esm/hooks/spaces/useFetchMySpaces.js.map +1 -1
- package/dist/esm/hooks/spaces/useFetchSpace.d.ts +3 -2
- package/dist/esm/hooks/spaces/useFetchSpace.js +10 -3
- package/dist/esm/hooks/spaces/useFetchSpace.js.map +1 -1
- package/dist/esm/hooks/spaces/useFetchSpaceByShortId.d.ts +3 -2
- package/dist/esm/hooks/spaces/useFetchSpaceByShortId.js +21 -3
- package/dist/esm/hooks/spaces/useFetchSpaceByShortId.js.map +1 -1
- package/dist/esm/hooks/spaces/useFetchSpaceBySlug.d.ts +3 -2
- package/dist/esm/hooks/spaces/useFetchSpaceBySlug.js +21 -3
- package/dist/esm/hooks/spaces/useFetchSpaceBySlug.js.map +1 -1
- package/dist/esm/hooks/spaces/useFetchSpaceChildren.d.ts +3 -2
- package/dist/esm/hooks/spaces/useFetchSpaceChildren.js +21 -3
- package/dist/esm/hooks/spaces/useFetchSpaceChildren.js.map +1 -1
- package/dist/esm/hooks/spaces/useUpdateSpace.d.ts +7 -2
- package/dist/esm/hooks/spaces/useUpdateSpace.js +49 -4
- package/dist/esm/hooks/spaces/useUpdateSpace.js.map +1 -1
- package/dist/esm/hooks/storage/index.d.ts +1 -0
- package/dist/esm/hooks/storage/index.js +1 -0
- package/dist/esm/hooks/storage/index.js.map +1 -1
- package/dist/esm/hooks/storage/useUploadFile.d.ts +12 -1
- package/dist/esm/hooks/storage/useUploadFile.js +22 -8
- package/dist/esm/hooks/storage/useUploadFile.js.map +1 -1
- package/dist/esm/hooks/storage/useUploadImage.d.ts +14 -0
- package/dist/esm/hooks/storage/useUploadImage.js +154 -0
- package/dist/esm/hooks/storage/useUploadImage.js.map +1 -0
- package/dist/esm/hooks/user/index.d.ts +1 -0
- package/dist/esm/hooks/user/useUser.js +8 -8
- package/dist/esm/hooks/user/useUser.js.map +1 -1
- package/dist/esm/hooks/user/useUserActions.js +21 -4
- package/dist/esm/hooks/user/useUserActions.js.map +1 -1
- package/dist/esm/hooks/users/index.d.ts +1 -1
- package/dist/esm/hooks/users/index.js +1 -1
- package/dist/esm/hooks/users/index.js.map +1 -1
- package/dist/esm/hooks/users/useFetchUser.d.ts +3 -2
- package/dist/esm/hooks/users/useFetchUser.js +10 -3
- package/dist/esm/hooks/users/useFetchUser.js.map +1 -1
- package/dist/esm/hooks/users/useFetchUserByForeignId.d.ts +3 -2
- package/dist/esm/hooks/users/useFetchUserByForeignId.js +19 -3
- package/dist/esm/hooks/users/useFetchUserByForeignId.js.map +1 -1
- package/dist/esm/hooks/users/useFetchUserByUsername.d.ts +6 -0
- package/dist/esm/hooks/users/useFetchUserByUsername.js +83 -0
- package/dist/esm/hooks/users/useFetchUserByUsername.js.map +1 -0
- package/dist/esm/index.d.ts +16 -12
- package/dist/esm/index.js +8 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/models/{List.d.ts → Collection.d.ts} +2 -4
- package/dist/esm/interfaces/models/Collection.js +2 -0
- package/dist/esm/interfaces/models/Collection.js.map +1 -0
- package/dist/esm/interfaces/models/Comment.d.ts +8 -1
- package/dist/esm/interfaces/models/Entity.d.ts +8 -1
- package/dist/esm/interfaces/models/File.d.ts +38 -0
- package/dist/esm/interfaces/models/File.js +2 -0
- package/dist/esm/interfaces/models/File.js.map +1 -0
- package/dist/esm/interfaces/models/Image.d.ts +74 -0
- package/dist/esm/interfaces/models/Image.js +2 -0
- package/dist/esm/interfaces/models/Image.js.map +1 -0
- package/dist/esm/interfaces/models/Reaction.d.ts +23 -0
- package/dist/esm/interfaces/models/Reaction.js +2 -0
- package/dist/esm/interfaces/models/Reaction.js.map +1 -0
- package/dist/esm/interfaces/models/Rule.d.ts +22 -0
- package/dist/esm/interfaces/models/Rule.js +2 -0
- package/dist/esm/interfaces/models/Rule.js.map +1 -0
- package/dist/esm/interfaces/models/Space.d.ts +23 -3
- package/dist/esm/interfaces/models/User.d.ts +9 -1
- package/dist/esm/store/api/appNotificationsApi.d.ts +181 -181
- package/dist/esm/store/api/baseApi.d.ts +1 -1
- package/dist/esm/store/api/baseApi.js +2 -1
- package/dist/esm/store/api/baseApi.js.map +1 -1
- package/dist/esm/store/api/collectionsApi.d.ts +4541 -0
- package/dist/esm/store/api/collectionsApi.js +241 -0
- package/dist/esm/store/api/collectionsApi.js.map +1 -0
- package/dist/esm/store/api/entityListsApi.d.ts +110 -110
- package/dist/esm/store/api/entityListsApi.js.map +1 -1
- package/dist/esm/store/api/index.d.ts +1 -1
- package/dist/esm/store/api/index.js +2 -2
- package/dist/esm/store/api/index.js.map +1 -1
- package/dist/esm/store/api/spacesApi.d.ts +950 -950
- package/dist/esm/store/api/userApi.d.ts +12 -4
- package/dist/esm/store/api/userApi.js +62 -11
- package/dist/esm/store/api/userApi.js.map +1 -1
- package/dist/esm/store/index.d.ts +4 -4
- package/dist/esm/store/replykeReduxContext.d.ts +6 -0
- package/dist/esm/store/replykeReduxContext.js +42 -0
- package/dist/esm/store/replykeReduxContext.js.map +1 -0
- package/dist/esm/store/rootReducer.d.ts +4 -4
- package/dist/esm/store/rootReducer.js +2 -2
- package/dist/esm/store/rootReducer.js.map +1 -1
- package/dist/esm/store/slices/authSlice.d.ts +1 -3
- package/dist/esm/store/slices/authSlice.js +2 -7
- package/dist/esm/store/slices/authSlice.js.map +1 -1
- package/dist/esm/store/slices/authThunks.d.ts +4 -0
- package/dist/esm/store/slices/authThunks.js +52 -14
- package/dist/esm/store/slices/authThunks.js.map +1 -1
- package/dist/esm/store/slices/collectionsSlice.d.ts +427 -0
- package/dist/esm/store/slices/collectionsSlice.js +202 -0
- package/dist/esm/store/slices/collectionsSlice.js.map +1 -0
- package/dist/esm/store/slices/entityListsSlice.d.ts +3748 -183
- package/dist/esm/store/slices/entityListsSlice.js +43 -20
- package/dist/esm/store/slices/entityListsSlice.js.map +1 -1
- package/dist/esm/store/slices/spaceListsSlice.d.ts +985 -25
- package/dist/esm/store/slices/userSlice.d.ts +696 -0
- package/dist/esm/utils/env.js +3 -3
- package/dist/esm/utils/env.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/hooks/comments/useCommentVotes.d.ts +0 -11
- package/dist/cjs/hooks/comments/useCommentVotes.js +0 -234
- package/dist/cjs/hooks/comments/useCommentVotes.js.map +0 -1
- package/dist/cjs/hooks/comments/useDownvoteComment.d.ts +0 -5
- package/dist/cjs/hooks/comments/useDownvoteComment.js.map +0 -1
- package/dist/cjs/hooks/comments/useProfileComments.d.ts +0 -18
- package/dist/cjs/hooks/comments/useProfileComments.js.map +0 -1
- package/dist/cjs/hooks/comments/useRemoveCommentDownvote.d.ts +0 -5
- package/dist/cjs/hooks/comments/useRemoveCommentDownvote.js.map +0 -1
- package/dist/cjs/hooks/comments/useRemoveCommentUpvote.d.ts +0 -5
- package/dist/cjs/hooks/comments/useRemoveCommentUpvote.js.map +0 -1
- package/dist/cjs/hooks/comments/useUpvoteComment.d.ts +0 -5
- package/dist/cjs/hooks/comments/useUpvoteComment.js.map +0 -1
- package/dist/cjs/hooks/entities/useDownvoteEntity.d.ts +0 -5
- package/dist/cjs/hooks/entities/useDownvoteEntity.js.map +0 -1
- package/dist/cjs/hooks/entities/useEntityVotes.d.ts +0 -11
- package/dist/cjs/hooks/entities/useEntityVotes.js +0 -241
- package/dist/cjs/hooks/entities/useEntityVotes.js.map +0 -1
- package/dist/cjs/hooks/entities/useRemoveEntityDownvote.d.ts +0 -5
- package/dist/cjs/hooks/entities/useRemoveEntityDownvote.js.map +0 -1
- package/dist/cjs/hooks/entities/useRemoveEntityUpvote.d.ts +0 -5
- package/dist/cjs/hooks/entities/useRemoveEntityUpvote.js.map +0 -1
- package/dist/cjs/hooks/entities/useUpvoteEntity.d.ts +0 -5
- package/dist/cjs/hooks/entities/useUpvoteEntity.js.map +0 -1
- package/dist/cjs/hooks/lists/index.d.ts +0 -3
- package/dist/cjs/hooks/lists/index.js +0 -14
- package/dist/cjs/hooks/lists/index.js.map +0 -1
- package/dist/cjs/hooks/lists/useIsEntitySaved.js.map +0 -1
- package/dist/cjs/hooks/lists/useLists.d.ts +0 -36
- package/dist/cjs/hooks/lists/useLists.js +0 -239
- package/dist/cjs/hooks/lists/useLists.js.map +0 -1
- package/dist/cjs/hooks/lists/useListsActions.d.ts +0 -21
- package/dist/cjs/hooks/lists/useListsActions.js.map +0 -1
- package/dist/cjs/hooks/users/useUpdateUser.d.ts +0 -18
- package/dist/cjs/hooks/users/useUpdateUser.js.map +0 -1
- package/dist/cjs/interfaces/models/List.js.map +0 -1
- package/dist/cjs/store/api/listsApi.d.ts +0 -3564
- package/dist/cjs/store/api/listsApi.js +0 -288
- package/dist/cjs/store/api/listsApi.js.map +0 -1
- package/dist/cjs/store/slices/listsSlice.d.ts +0 -1911
- package/dist/cjs/store/slices/listsSlice.js +0 -211
- package/dist/cjs/store/slices/listsSlice.js.map +0 -1
- package/dist/esm/hooks/comments/useCommentVotes.d.ts +0 -11
- package/dist/esm/hooks/comments/useCommentVotes.js +0 -229
- package/dist/esm/hooks/comments/useCommentVotes.js.map +0 -1
- package/dist/esm/hooks/comments/useDownvoteComment.d.ts +0 -5
- package/dist/esm/hooks/comments/useDownvoteComment.js.map +0 -1
- package/dist/esm/hooks/comments/useProfileComments.d.ts +0 -18
- package/dist/esm/hooks/comments/useProfileComments.js.map +0 -1
- package/dist/esm/hooks/comments/useRemoveCommentDownvote.d.ts +0 -5
- package/dist/esm/hooks/comments/useRemoveCommentDownvote.js.map +0 -1
- package/dist/esm/hooks/comments/useRemoveCommentUpvote.d.ts +0 -5
- package/dist/esm/hooks/comments/useRemoveCommentUpvote.js.map +0 -1
- package/dist/esm/hooks/comments/useUpvoteComment.d.ts +0 -5
- package/dist/esm/hooks/comments/useUpvoteComment.js.map +0 -1
- package/dist/esm/hooks/entities/useDownvoteEntity.d.ts +0 -5
- package/dist/esm/hooks/entities/useDownvoteEntity.js.map +0 -1
- package/dist/esm/hooks/entities/useEntityVotes.d.ts +0 -11
- package/dist/esm/hooks/entities/useEntityVotes.js +0 -236
- package/dist/esm/hooks/entities/useEntityVotes.js.map +0 -1
- package/dist/esm/hooks/entities/useRemoveEntityDownvote.d.ts +0 -5
- package/dist/esm/hooks/entities/useRemoveEntityDownvote.js.map +0 -1
- package/dist/esm/hooks/entities/useRemoveEntityUpvote.d.ts +0 -5
- package/dist/esm/hooks/entities/useRemoveEntityUpvote.js.map +0 -1
- package/dist/esm/hooks/entities/useUpvoteEntity.d.ts +0 -5
- package/dist/esm/hooks/entities/useUpvoteEntity.js.map +0 -1
- package/dist/esm/hooks/lists/index.d.ts +0 -3
- package/dist/esm/hooks/lists/index.js +0 -5
- package/dist/esm/hooks/lists/index.js.map +0 -1
- package/dist/esm/hooks/lists/useIsEntitySaved.js.map +0 -1
- package/dist/esm/hooks/lists/useLists.d.ts +0 -36
- package/dist/esm/hooks/lists/useLists.js +0 -234
- package/dist/esm/hooks/lists/useLists.js.map +0 -1
- package/dist/esm/hooks/lists/useListsActions.d.ts +0 -21
- package/dist/esm/hooks/lists/useListsActions.js.map +0 -1
- package/dist/esm/hooks/users/useUpdateUser.d.ts +0 -18
- package/dist/esm/hooks/users/useUpdateUser.js.map +0 -1
- package/dist/esm/interfaces/models/List.js +0 -2
- package/dist/esm/interfaces/models/List.js.map +0 -1
- package/dist/esm/store/api/listsApi.d.ts +0 -3564
- package/dist/esm/store/api/listsApi.js +0 -285
- package/dist/esm/store/api/listsApi.js.map +0 -1
- package/dist/esm/store/slices/listsSlice.d.ts +0 -1911
- package/dist/esm/store/slices/listsSlice.js +0 -202
- package/dist/esm/store/slices/listsSlice.js.map +0 -1
|
@@ -35,7 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import { useEffect, useMemo, useCallback } from "react";
|
|
38
|
-
import {
|
|
38
|
+
import { useReplykeDispatch, useReplykeSelector, } from "../../store/replykeReduxContext";
|
|
39
39
|
import { setProjectContext, selectUser, selectUserLoading, selectUserUpdating, selectCurrentProjectId, selectUserError, } from "../../store/slices/userSlice";
|
|
40
40
|
import { useUserActions } from "./useUserActions";
|
|
41
41
|
import useProject from "../projects/useProject";
|
|
@@ -47,16 +47,16 @@ import { selectUser as selectAuthUser } from "../../store/slices/authSlice";
|
|
|
47
47
|
function useUser(_) {
|
|
48
48
|
var _this = this;
|
|
49
49
|
if (_ === void 0) { _ = {}; }
|
|
50
|
-
var dispatch =
|
|
50
|
+
var dispatch = useReplykeDispatch();
|
|
51
51
|
// Get external context
|
|
52
52
|
var projectId = useProject().projectId;
|
|
53
53
|
// Get Redux state
|
|
54
|
-
var user =
|
|
55
|
-
var authUser =
|
|
56
|
-
var loading =
|
|
57
|
-
var updating =
|
|
58
|
-
var error =
|
|
59
|
-
var currentProjectId =
|
|
54
|
+
var user = useReplykeSelector(function (state) { return selectUser(state); });
|
|
55
|
+
var authUser = useReplykeSelector(function (state) { return selectAuthUser(state); }); // Fallback to auth user
|
|
56
|
+
var loading = useReplykeSelector(function (state) { return selectUserLoading(state); });
|
|
57
|
+
var updating = useReplykeSelector(function (state) { return selectUserUpdating(state); });
|
|
58
|
+
var error = useReplykeSelector(function (state) { return selectUserError(state); });
|
|
59
|
+
var currentProjectId = useReplykeSelector(function (state) { return selectCurrentProjectId(state); });
|
|
60
60
|
// Get actions
|
|
61
61
|
var _a = useUserActions(), setUser = _a.setUser, updateUserAction = _a.updateUser, clearError = _a.clearError;
|
|
62
62
|
// Update Redux state when project changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUser.js","sourceRoot":"","sources":["../../../../src/hooks/user/useUser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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M,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,OAAO,CACZ,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,eAAe,OAAO,CAAC"}
|
|
@@ -35,7 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import { useCallback } from "react";
|
|
38
|
-
import {
|
|
38
|
+
import { useReplykeDispatch } from "../../store/replykeReduxContext";
|
|
39
39
|
import { setUser, clearUser, setUpdating, setError, clearError, updateUserOptimistic, } from "../../store/slices/userSlice";
|
|
40
40
|
import { useUpdateUserMutation, } from "../../store/api/userApi";
|
|
41
41
|
/**
|
|
@@ -44,7 +44,7 @@ import { useUpdateUserMutation, } from "../../store/api/userApi";
|
|
|
44
44
|
*/
|
|
45
45
|
export function useUserActions() {
|
|
46
46
|
var _this = this;
|
|
47
|
-
var dispatch =
|
|
47
|
+
var dispatch = useReplykeDispatch();
|
|
48
48
|
// RTK Query mutations for current user
|
|
49
49
|
var updateUserMutation = useUpdateUserMutation()[0];
|
|
50
50
|
// User data management actions
|
|
@@ -64,7 +64,7 @@ export function useUserActions() {
|
|
|
64
64
|
}, [dispatch]);
|
|
65
65
|
// Update user with optimistic updates for instant UI feedback
|
|
66
66
|
var updateUser = useCallback(function (projectId, userId, update, currentUser) { return __awaiter(_this, void 0, void 0, function () {
|
|
67
|
-
var originalUser, result, error_1, errorMessage;
|
|
67
|
+
var originalUser, optimisticUpdate, result, error_1, errorMessage;
|
|
68
68
|
return __generator(this, function (_a) {
|
|
69
69
|
switch (_a.label) {
|
|
70
70
|
case 0:
|
|
@@ -74,8 +74,25 @@ export function useUserActions() {
|
|
|
74
74
|
dispatch(setUpdating(true));
|
|
75
75
|
dispatch(clearError());
|
|
76
76
|
originalUser = currentUser;
|
|
77
|
+
optimisticUpdate = {};
|
|
78
|
+
if (update.name !== undefined)
|
|
79
|
+
optimisticUpdate.name = update.name;
|
|
80
|
+
if (update.username !== undefined)
|
|
81
|
+
optimisticUpdate.username = update.username;
|
|
82
|
+
if (update.bio !== undefined)
|
|
83
|
+
optimisticUpdate.bio = update.bio;
|
|
84
|
+
if (update.birthdate !== undefined)
|
|
85
|
+
optimisticUpdate.birthdate = update.birthdate;
|
|
86
|
+
if (update.metadata !== undefined)
|
|
87
|
+
optimisticUpdate.metadata = update.metadata;
|
|
88
|
+
// Only apply avatar optimistically if it's a string URL (not a file upload)
|
|
89
|
+
if (typeof update.avatar === 'string' || update.avatar === null) {
|
|
90
|
+
optimisticUpdate.avatar = update.avatar;
|
|
91
|
+
}
|
|
77
92
|
// OPTIMISTIC UPDATE: Apply changes immediately for instant UI feedback
|
|
78
|
-
|
|
93
|
+
if (Object.keys(optimisticUpdate).length > 0) {
|
|
94
|
+
dispatch(updateUserOptimistic(optimisticUpdate));
|
|
95
|
+
}
|
|
79
96
|
_a.label = 1;
|
|
80
97
|
case 1:
|
|
81
98
|
_a.trys.push([1, 3, 4, 5]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUserActions.js","sourceRoot":"","sources":["../../../../src/hooks/user/useUserActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useUserAct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AC,CAAC,MAAM,EAAE,EAAA;;oBAJL,MAAM,GAAG,SAIJ;oBAEX,kDAAkD;oBAClD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,sBAAO,MAAM,EAAC;;;oBAEd,uEAAuE;oBACvE,IAAI,YAAY,EAAE,CAAC;wBACjB,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;oBAClC,CAAC;oBAEK,YAAY,GAAG,OAAK,YAAY,KAAK,CAAC,CAAC,CAAC,OAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC;oBACtF,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;oBACjC,MAAM,OAAK,CAAC;;oBAEZ,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;;;;;SAEhC,EACD,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAC/B,CAAC;IAEF,kEAAkE;IAClE,iBAAiB;IACjB,4BAA4B;IAC5B,mCAAmC;IACnC,4BAA4B;IAE5B,yBAAyB;IACzB,IAAM,cAAc,GAAG,WAAW,CAAC;QACjC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO;QACL,+BAA+B;QAC/B,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,eAAe;QAE1B,0BAA0B;QAC1B,UAAU,YAAA;QAEV,iBAAiB;QACjB,UAAU,EAAE,cAAc;KAC3B,CAAC;AACJ,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as useFetchUser } from "./useFetchUser";
|
|
2
2
|
export { default as useFetchUserByForeignId } from "./useFetchUserByForeignId";
|
|
3
|
+
export { default as useFetchUserByUsername } from "./useFetchUserByUsername";
|
|
3
4
|
export { default as useCheckUsernameAvailability } from "./useCheckUsernameAvailability";
|
|
4
5
|
export { default as useFetchUserSuggestions } from "./useFetchUserSuggestions";
|
|
5
6
|
export { default as useMentions } from "./useMentions";
|
|
6
|
-
export { default as useUpdateUser } from "./useUpdateUser";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as useFetchUser } from "./useFetchUser";
|
|
2
2
|
export { default as useFetchUserByForeignId } from "./useFetchUserByForeignId";
|
|
3
|
+
export { default as useFetchUserByUsername } from "./useFetchUserByUsername";
|
|
3
4
|
export { default as useCheckUsernameAvailability } from "./useCheckUsernameAvailability";
|
|
4
5
|
export { default as useFetchUserSuggestions } from "./useFetchUserSuggestions";
|
|
5
6
|
export { default as useMentions } from "./useMentions";
|
|
6
|
-
export { default as useUpdateUser } from "./useUpdateUser";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { User } from "../../interfaces/models/User";
|
|
2
|
-
declare function useFetchUser(): ({ userId }: {
|
|
1
|
+
import { User, UserIncludeParam } from "../../interfaces/models/User";
|
|
2
|
+
declare function useFetchUser(): ({ userId, include, }: {
|
|
3
3
|
userId: string;
|
|
4
|
+
include?: UserIncludeParam;
|
|
4
5
|
}) => Promise<User>;
|
|
5
6
|
export default useFetchUser;
|
|
@@ -41,8 +41,8 @@ function useFetchUser() {
|
|
|
41
41
|
var _this = this;
|
|
42
42
|
var projectId = useProject().projectId;
|
|
43
43
|
var fetchUser = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
44
|
-
var response;
|
|
45
|
-
var userId = _b.userId;
|
|
44
|
+
var includeParam, response;
|
|
45
|
+
var userId = _b.userId, include = _b.include;
|
|
46
46
|
return __generator(this, function (_c) {
|
|
47
47
|
switch (_c.label) {
|
|
48
48
|
case 0:
|
|
@@ -52,7 +52,14 @@ function useFetchUser() {
|
|
|
52
52
|
if (!userId) {
|
|
53
53
|
throw new Error("Please specify a user ID");
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
includeParam = include
|
|
56
|
+
? Array.isArray(include)
|
|
57
|
+
? include.join(",")
|
|
58
|
+
: include
|
|
59
|
+
: undefined;
|
|
60
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/users/").concat(userId), {
|
|
61
|
+
params: includeParam ? { include: includeParam } : undefined,
|
|
62
|
+
})];
|
|
56
63
|
case 1:
|
|
57
64
|
response = _c.sent();
|
|
58
65
|
return [2 /*return*/, response.data];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchUser.js","sourceRoot":"","sources":["../../../../src/hooks/users/useFetchUser.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AACh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AAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { User } from "../../interfaces/models/User";
|
|
2
|
-
declare function useFetchUserByForeignId(): ({ foreignId }: {
|
|
1
|
+
import { User, UserIncludeParam } from "../../interfaces/models/User";
|
|
2
|
+
declare function useFetchUserByForeignId(): ({ foreignId, include, }: {
|
|
3
3
|
foreignId: string;
|
|
4
|
+
include?: UserIncludeParam;
|
|
4
5
|
}) => Promise<User>;
|
|
5
6
|
export default useFetchUserByForeignId;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
13
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
14
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -41,8 +52,8 @@ function useFetchUserByForeignId() {
|
|
|
41
52
|
var _this = this;
|
|
42
53
|
var projectId = useProject().projectId;
|
|
43
54
|
var fetchUserByForeignId = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
44
|
-
var response;
|
|
45
|
-
var foreignId = _b.foreignId;
|
|
55
|
+
var includeParam, response;
|
|
56
|
+
var foreignId = _b.foreignId, include = _b.include;
|
|
46
57
|
return __generator(this, function (_c) {
|
|
47
58
|
switch (_c.label) {
|
|
48
59
|
case 0:
|
|
@@ -52,8 +63,13 @@ function useFetchUserByForeignId() {
|
|
|
52
63
|
if (!foreignId) {
|
|
53
64
|
throw new Error("Please specify a foreign ID");
|
|
54
65
|
}
|
|
66
|
+
includeParam = include
|
|
67
|
+
? Array.isArray(include)
|
|
68
|
+
? include.join(",")
|
|
69
|
+
: include
|
|
70
|
+
: undefined;
|
|
55
71
|
return [4 /*yield*/, axios.get("/".concat(projectId, "/users/by-foreign-id"), {
|
|
56
|
-
params: { foreignId: foreignId },
|
|
72
|
+
params: __assign({ foreignId: foreignId }, (includeParam ? { include: includeParam } : {})),
|
|
57
73
|
})];
|
|
58
74
|
case 1:
|
|
59
75
|
response = _c.sent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchUserByForeignId.js","sourceRoot":"","sources":["../../../../src/hooks/users/useFetchUserByForeignId.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFetchUserByForeignId.js","sourceRoot":"","sources":["../../../../src/hooks/users/useFetchUserByForeignId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,SAAS,uBAAuB;IAAhC,iBAsCC;IArCS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,oBAAoB,GAAG,WAAW,CACtC,gEAAO,EAMN;;YALC,SAAS,eAAA,EACT,OAAO,aAAA;;;;oBAKP,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;oBACjD,CAAC;oBAEK,YAAY,GAAG,OAAO;wBAC1B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;4BACtB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;4BACnB,CAAC,CAAC,OAAO;wBACX,CAAC,CAAC,SAAS,CAAC;oBAEG,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,yBAAsB,EAAE;4BACpE,MAAM,aACJ,SAAS,WAAA,IACN,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACnD;yBACF,CAAC,EAAA;;oBALI,QAAQ,GAAG,SAKf;oBAEF,sBAAO,QAAQ,CAAC,IAAY,EAAC;;;SAC9B,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
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);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { useCallback } from "react";
|
|
49
|
+
import useProject from "../projects/useProject";
|
|
50
|
+
import axios from "../../config/axios";
|
|
51
|
+
function useFetchUserByUsername() {
|
|
52
|
+
var _this = this;
|
|
53
|
+
var projectId = useProject().projectId;
|
|
54
|
+
var fetchUserByUsername = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
55
|
+
var includeParam, response;
|
|
56
|
+
var username = _b.username, include = _b.include;
|
|
57
|
+
return __generator(this, function (_c) {
|
|
58
|
+
switch (_c.label) {
|
|
59
|
+
case 0:
|
|
60
|
+
if (!projectId) {
|
|
61
|
+
throw new Error("No project specified");
|
|
62
|
+
}
|
|
63
|
+
if (!username) {
|
|
64
|
+
throw new Error("Please specify a username");
|
|
65
|
+
}
|
|
66
|
+
includeParam = include
|
|
67
|
+
? Array.isArray(include)
|
|
68
|
+
? include.join(",")
|
|
69
|
+
: include
|
|
70
|
+
: undefined;
|
|
71
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/users/by-username"), {
|
|
72
|
+
params: __assign({ username: username }, (includeParam ? { include: includeParam } : {})),
|
|
73
|
+
})];
|
|
74
|
+
case 1:
|
|
75
|
+
response = _c.sent();
|
|
76
|
+
return [2 /*return*/, response.data];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}); }, [projectId]);
|
|
80
|
+
return fetchUserByUsername;
|
|
81
|
+
}
|
|
82
|
+
export default useFetchUserByUsername;
|
|
83
|
+
//# sourceMappingURL=useFetchUserByUsername.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchUserByUsername.js","sourceRoot":"","sources":["../../../../src/hooks/users/useFetchUserByUsername.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,SAAS,sBAAsB;IAA/B,iBAsCC;IArCS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,mBAAmB,GAAG,WAAW,CACrC,gEAAO,EAMN;;YALC,QAAQ,cAAA,EACR,OAAO,aAAA;;;;oBAKP,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;oBAC/C,CAAC;oBAEK,YAAY,GAAG,OAAO;wBAC1B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;4BACtB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;4BACnB,CAAC,CAAC,OAAO;wBACX,CAAC,CAAC,SAAS,CAAC;oBAEG,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,uBAAoB,EAAE;4BAClE,MAAM,aACJ,QAAQ,UAAA,IACL,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACnD;yBACF,CAAC,EAAA;;oBALI,QAAQ,GAAG,SAKf;oBAEF,sBAAO,QAAQ,CAAC,IAAY,EAAC;;;SAC9B,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,eAAe,sBAAsB,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -10,15 +10,16 @@ export { ReplykeProvider, EntityProvider, CommentSectionProvider, SpaceProvider,
|
|
|
10
10
|
export { useProject, useProjectData } from "./hooks/projects";
|
|
11
11
|
export { useSignTestingJwt } from "./hooks/crypto";
|
|
12
12
|
export { useAuth, type UseAuthValues } from "./hooks/auth";
|
|
13
|
-
export { useUser, useUserActions, type UseUserProps, type UseUserValues, } from "./hooks/user";
|
|
13
|
+
export { useUser, useUserActions, type UseUserProps, type UseUserValues, type UpdateUserParams, } from "./hooks/user";
|
|
14
14
|
export { useAppNotifications, useAppNotificationsActions, type UseAppNotificationsProps, type UseAppNotificationsValues, } from "./hooks/app-notifications";
|
|
15
|
-
export {
|
|
16
|
-
export { useEntity, useEntityData, useCreateEntity, useDeleteEntity,
|
|
17
|
-
export { useEntityList, useEntityListActions, type UseEntityListProps, type UseEntityListValues, type EntityListFilters, type EntityListFetchOptions, } from "./hooks/entity-lists";
|
|
15
|
+
export { useCollections, useCollectionsActions, useIsEntityInCollection, useCollectionEntitiesWrapper, type UseCollectionsProps, type UseCollectionsValues, type UseCollectionEntitiesWrapperProps, type UseCollectionEntitiesWrapperValues, } from "./hooks/collections";
|
|
16
|
+
export { useEntity, useEntityData, useCreateEntity, useDeleteEntity, useFetchEntity, useFetchEntityByForeignId, useFetchEntityByShortId, useFetchManyEntities, useIncrementEntityViews, useFetchManyEntitiesWrapper, useUpdateEntity, type UseFetchManyEntitiesWrapperProps, type UseFetchManyEntitiesWrapperValues, } from "./hooks/entities";
|
|
17
|
+
export { useEntityList, useEntityListActions, type UseEntityListProps, type UseEntityListValues, type EntityListFilters, type EntityListSort, type EntityListFetchOptions, } from "./hooks/entity-lists";
|
|
18
18
|
export { useSpace, useSpaceData, useFetchSpace, useFetchSpaceByShortId, useFetchSpaceBySlug, useFetchSpaceBreadcrumb, useFetchSpaceChildren, useFetchManySpaces, useCheckSlugAvailability, useCreateSpace, useUpdateSpace, useDeleteSpace, useJoinSpace, useLeaveSpace, useFetchSpaceMembers, useFetchMySpaces, useUpdateMemberRole, useApproveMember, useDeclineMember, useRemoveMember, useSpacePermissions, type UseSpaceDataProps, type UseSpaceDataValues, type CreateSpaceProps, type UpdateSpaceProps, } from "./hooks/spaces";
|
|
19
19
|
export { useSpaceList, useSpaceListActions, type UseSpaceListProps, type UseSpaceListValues, } from "./hooks/space-lists";
|
|
20
|
-
export { useCommentSection, useCommentSectionData, useCreateComment, useFetchManyComments, useFetchComment, useFetchCommentByForeignId, useReplies, useUpdateComment,
|
|
21
|
-
export {
|
|
20
|
+
export { useCommentSection, useCommentSectionData, useCreateComment, useFetchManyComments, useFetchComment, useFetchCommentByForeignId, useReplies, useUpdateComment, useDeleteComment, useEntityComments, useFetchManyCommentsWrapper, type UseFetchManyCommentsWrapperProps, type UseFetchManyCommentsWrapperValues, } from "./hooks/comments";
|
|
21
|
+
export { useFetchEntityReactions, useFetchCommentReactions, useFetchEntityReactionsWrapper, useFetchCommentReactionsWrapper, useAddReaction, useRemoveReaction, useReactionToggle, type UseFetchEntityReactionsWrapperProps, type UseFetchEntityReactionsWrapperValues, type UseFetchCommentReactionsWrapperProps, type UseFetchCommentReactionsWrapperValues, type UseReactionToggleValues, } from "./hooks/reactions";
|
|
22
|
+
export { useFetchUser, useFetchUserByForeignId, useFetchUserByUsername, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, } from "./hooks/users";
|
|
22
23
|
export { useFetchFollowStatus, useFetchFollowers, useFetchFollowersByUserId, useFetchFollowersCount, useFetchFollowersCountByUserId, useFetchFollowing, useFetchFollowingByUserId, useFetchFollowingCount, useFetchFollowingCountByUserId, useFollowManager, useFollowUser, useUnfollowByFollowId, useUnfollowUserByUserId, } from "./hooks/relationships/follows";
|
|
23
24
|
export { useRequestConnection, useAcceptConnection, useDeclineConnection, useRemoveConnection, useFetchConnections, useFetchConnectionStatus, useRemoveConnectionByUserId, useFetchConnectionsCount, useFetchSentPendingConnections, useFetchReceivedPendingConnections, useFetchConnectionsByUserId, useFetchConnectionsCountByUserId, useConnectionManager, } from "./hooks/relationships/connections";
|
|
24
25
|
export { useCreateReport } from "./hooks/reports";
|
|
@@ -26,16 +27,17 @@ export { useFetchSpaceReports } from "./hooks/reports";
|
|
|
26
27
|
export { useHandleSpaceEntityReport } from "./hooks/reports";
|
|
27
28
|
export { useHandleSpaceCommentReport } from "./hooks/reports";
|
|
28
29
|
export { useGetMetadata } from "./hooks/utils";
|
|
29
|
-
export { useUploadFile } from "./hooks/storage";
|
|
30
|
+
export { useUploadFile, useUploadImage } from "./hooks/storage";
|
|
30
31
|
export type { PaginatedResponse, PaginationMetadata, } from "./interfaces/IPaginatedResponse";
|
|
31
32
|
export type { EntityCommentsTree } from "./interfaces/EntityCommentsTree";
|
|
32
|
-
export type { UserFull, User, AuthUser, UserRole, } from "./interfaces/models/User";
|
|
33
|
+
export type { UserFull, User, AuthUser, UserRole, UserInclude, UserIncludeArray, UserIncludeParam, } from "./interfaces/models/User";
|
|
33
34
|
export * as AppNotification from "./interfaces/models/AppNotification";
|
|
34
|
-
export type { Entity } from "./interfaces/models/Entity";
|
|
35
|
-
export type {
|
|
36
|
-
export type { Comment, GifData } from "./interfaces/models/Comment";
|
|
35
|
+
export type { Entity, EntityInclude, EntityIncludeArray, EntityIncludeParam, } from "./interfaces/models/Entity";
|
|
36
|
+
export type { Collection } from "./interfaces/models/Collection";
|
|
37
|
+
export type { Comment, GifData, CommentInclude, CommentIncludeArray, CommentIncludeParam, } from "./interfaces/models/Comment";
|
|
38
|
+
export type { Reaction, ReactionType, ReactionCounts, } from "./interfaces/models/Reaction";
|
|
37
39
|
export type { Mention } from "./interfaces/models/Mention";
|
|
38
|
-
export type { Space, SpaceDetailed, SpacePreview, SpaceMemberPermissions, ReadingPermission, PostingPermission, PaginationMeta, MySpaceItem, MySpacesResponse, JoinSpaceResponse, LeaveSpaceResponse, UpdateMemberRoleResponse, ApproveMemberResponse, DeclineMemberResponse, DeleteSpaceResponse, } from "./interfaces/models/Space";
|
|
40
|
+
export type { Space, SpaceDetailed, SpacePreview, SpaceMemberPermissions, ReadingPermission, PostingPermission, PaginationMeta, MySpaceItem, MySpacesResponse, JoinSpaceResponse, LeaveSpaceResponse, UpdateMemberRoleResponse, ApproveMemberResponse, DeclineMemberResponse, DeleteSpaceResponse, SpaceInclude, SpaceIncludeArray, SpaceIncludeParam, } from "./interfaces/models/Space";
|
|
39
41
|
export type { SpaceMember, SpaceMemberRole, SpaceMemberStatus, SpaceMemberWithUser, SpaceMembersResponse, } from "./interfaces/models/SpaceMember";
|
|
40
42
|
export type { SpaceListSortByOptions, SpaceListFilters, } from "./interfaces/SpaceListSortByOptions";
|
|
41
43
|
export type { SpaceBreadcrumb } from "./interfaces/SpaceBreadcrumb";
|
|
@@ -44,3 +46,5 @@ export type { EntityListSortByOptions, SortDirection, SortType, } from "./interf
|
|
|
44
46
|
export { validateSortBy, validateMetadataPropertyName, validateSortType, } from "./interfaces/EntityListSortByOptions";
|
|
45
47
|
export type { TimeFrame } from "./interfaces/TimeFrame";
|
|
46
48
|
export type { Connection, EstablishedConnection, PendingConnection, ConnectionsResponse, PendingConnectionsResponse, PendingConnectionListResponse, ConnectionRequestParams, ConnectionActionResponse, ConnectionWithdrawResponse, ConnectionCountResponse, RemoveConnectionByUserIdResponse, ConnectionStatusResponse, ConnectionStatus, } from "./interfaces/models/Connection";
|
|
49
|
+
export type { Image, ImageVariant, UploadImageOptions, } from "./interfaces/models/Image";
|
|
50
|
+
export type { File } from "./interfaces/models/File";
|
package/dist/esm/index.js
CHANGED
|
@@ -19,10 +19,10 @@ export { useAuth } from "./hooks/auth";
|
|
|
19
19
|
export { useUser, useUserActions, } from "./hooks/user";
|
|
20
20
|
// -- app notifications
|
|
21
21
|
export { useAppNotifications, useAppNotificationsActions, } from "./hooks/app-notifications";
|
|
22
|
-
// --
|
|
23
|
-
export {
|
|
22
|
+
// -- collections
|
|
23
|
+
export { useCollections, useCollectionsActions, useIsEntityInCollection, useCollectionEntitiesWrapper, } from "./hooks/collections";
|
|
24
24
|
// -- entities
|
|
25
|
-
export { useEntity, useEntityData, useCreateEntity, useDeleteEntity,
|
|
25
|
+
export { useEntity, useEntityData, useCreateEntity, useDeleteEntity, useFetchEntity, useFetchEntityByForeignId, useFetchEntityByShortId, useFetchManyEntities, useIncrementEntityViews, useFetchManyEntitiesWrapper, useUpdateEntity, } from "./hooks/entities";
|
|
26
26
|
// -- entity lists
|
|
27
27
|
export { useEntityList, useEntityListActions, } from "./hooks/entity-lists";
|
|
28
28
|
// -- spaces
|
|
@@ -30,9 +30,11 @@ export { useSpace, useSpaceData, useFetchSpace, useFetchSpaceByShortId, useFetch
|
|
|
30
30
|
// -- space lists
|
|
31
31
|
export { useSpaceList, useSpaceListActions, } from "./hooks/space-lists";
|
|
32
32
|
// -- comments
|
|
33
|
-
export { useCommentSection, useCommentSectionData, useCreateComment, useFetchManyComments, useFetchComment, useFetchCommentByForeignId, useReplies, useUpdateComment,
|
|
33
|
+
export { useCommentSection, useCommentSectionData, useCreateComment, useFetchManyComments, useFetchComment, useFetchCommentByForeignId, useReplies, useUpdateComment, useDeleteComment, useEntityComments, useFetchManyCommentsWrapper, } from "./hooks/comments";
|
|
34
|
+
// -- reactions
|
|
35
|
+
export { useFetchEntityReactions, useFetchCommentReactions, useFetchEntityReactionsWrapper, useFetchCommentReactionsWrapper, useAddReaction, useRemoveReaction, useReactionToggle, } from "./hooks/reactions";
|
|
34
36
|
// -- users
|
|
35
|
-
export { useFetchUser, useFetchUserByForeignId, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions,
|
|
37
|
+
export { useFetchUser, useFetchUserByForeignId, useFetchUserByUsername, useCheckUsernameAvailability, useFetchUserSuggestions, useMentions, } from "./hooks/users";
|
|
36
38
|
// -- follows
|
|
37
39
|
export { useFetchFollowStatus, useFetchFollowers, useFetchFollowersByUserId, useFetchFollowersCount, useFetchFollowersCountByUserId, useFetchFollowing, useFetchFollowingByUserId, useFetchFollowingCount, useFetchFollowingCountByUserId, useFollowManager, useFollowUser, useUnfollowByFollowId, useUnfollowUserByUserId, } from "./hooks/relationships/follows";
|
|
38
40
|
// -- connections
|
|
@@ -45,7 +47,7 @@ export { useHandleSpaceCommentReport } from "./hooks/reports";
|
|
|
45
47
|
// -- general
|
|
46
48
|
export { useGetMetadata } from "./hooks/utils";
|
|
47
49
|
// -- storage
|
|
48
|
-
export { useUploadFile } from "./hooks/storage";
|
|
50
|
+
export { useUploadFile, useUploadImage } from "./hooks/storage";
|
|
49
51
|
export * as AppNotification from "./interfaces/models/AppNotification";
|
|
50
52
|
export { validateSortBy, validateMetadataPropertyName, validateSortType, } from "./interfaces/EntityListSortByOptions";
|
|
51
53
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,YAAY;AACZ,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,+CAA+C;AAC/C,OAAO,EACL,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,aAAa,GACd,MAAM,WAAW,CAAC;AAEnB,cAAc;AACd,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE9D,YAAY;AACZ,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,oBAAoB;AACpB,OAAO,EAAE,OAAO,EAAsB,MAAM,cAAc,CAAC;AAE3D,oBAAoB;AACpB,OAAO,EACL,OAAO,EACP,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA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BAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,gCAAgC,EAChC,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAE3C,aAAa;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D,aAAa;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,aAAa;AACb,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAiBhE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AA2DvE,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,sCAAsC,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export interface List {
|
|
1
|
+
export interface Collection {
|
|
3
2
|
id: string;
|
|
4
3
|
projectId: string;
|
|
5
4
|
userId: string;
|
|
6
5
|
parentId: string | null;
|
|
7
6
|
name: string;
|
|
8
|
-
|
|
9
|
-
entities: Partial<Entity>[];
|
|
7
|
+
entityCount?: number;
|
|
10
8
|
createdAt: Date;
|
|
11
9
|
updatedAt: Date;
|
|
12
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../../../src/interfaces/models/Collection.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Entity } from "./Entity";
|
|
2
2
|
import { Mention } from "./Mention";
|
|
3
3
|
import { User } from "./User";
|
|
4
|
+
import { ReactionCounts, ReactionType } from "./Reaction";
|
|
4
5
|
export interface GifData {
|
|
5
6
|
id: string;
|
|
6
7
|
url: string;
|
|
@@ -16,13 +17,16 @@ export interface Comment {
|
|
|
16
17
|
entityId: string;
|
|
17
18
|
entity?: Entity;
|
|
18
19
|
userId: string;
|
|
19
|
-
user
|
|
20
|
+
user?: User;
|
|
20
21
|
parentId: string | null;
|
|
22
|
+
parentComment?: Comment;
|
|
21
23
|
content: string | null;
|
|
22
24
|
gif: GifData | null;
|
|
23
25
|
mentions: Mention[];
|
|
24
26
|
upvotes: string[];
|
|
25
27
|
downvotes: string[];
|
|
28
|
+
reactionCounts: ReactionCounts;
|
|
29
|
+
userReaction?: ReactionType | null;
|
|
26
30
|
repliesCount: number;
|
|
27
31
|
metadata: Record<string, any>;
|
|
28
32
|
createdAt: Date;
|
|
@@ -30,3 +34,6 @@ export interface Comment {
|
|
|
30
34
|
deletedAt: Date | null;
|
|
31
35
|
parentDeletedAt: Date | null;
|
|
32
36
|
}
|
|
37
|
+
export type CommentInclude = "user" | "entity" | "space" | "parent";
|
|
38
|
+
export type CommentIncludeArray = CommentInclude[];
|
|
39
|
+
export type CommentIncludeParam = CommentInclude | CommentIncludeArray;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Mention } from "./Mention";
|
|
2
2
|
import { User } from "./User";
|
|
3
3
|
import { Space } from "./Space";
|
|
4
|
+
import { ReactionCounts, ReactionType } from "./Reaction";
|
|
5
|
+
import { File } from "./File";
|
|
4
6
|
export interface TopComment {
|
|
5
7
|
id: string;
|
|
6
8
|
user: User;
|
|
@@ -8,6 +10,7 @@ export interface TopComment {
|
|
|
8
10
|
content: string;
|
|
9
11
|
createdAt: string;
|
|
10
12
|
}
|
|
13
|
+
export type EntityFile = File;
|
|
11
14
|
export interface Entity {
|
|
12
15
|
id: string;
|
|
13
16
|
foreignId: string | null;
|
|
@@ -21,9 +24,12 @@ export interface Entity {
|
|
|
21
24
|
content: string | null;
|
|
22
25
|
mentions: Mention[];
|
|
23
26
|
attachments: Record<string, any>[];
|
|
27
|
+
files?: EntityFile[];
|
|
24
28
|
keywords: string[];
|
|
25
29
|
upvotes: string[];
|
|
26
30
|
downvotes: string[];
|
|
31
|
+
reactionCounts: ReactionCounts;
|
|
32
|
+
userReaction?: ReactionType | null;
|
|
27
33
|
repliesCount: number;
|
|
28
34
|
views: number;
|
|
29
35
|
score: number;
|
|
@@ -34,10 +40,11 @@ export interface Entity {
|
|
|
34
40
|
} | null;
|
|
35
41
|
metadata: Record<string, any>;
|
|
36
42
|
topComment: TopComment | null;
|
|
43
|
+
isSaved?: boolean;
|
|
37
44
|
createdAt: Date;
|
|
38
45
|
updatedAt: Date;
|
|
39
46
|
deletedAt: Date | null;
|
|
40
47
|
}
|
|
41
|
-
export type EntityInclude = "space" | "user" | "topComment";
|
|
48
|
+
export type EntityInclude = "space" | "user" | "topComment" | "saved" | "files";
|
|
42
49
|
export type EntityIncludeArray = EntityInclude[];
|
|
43
50
|
export type EntityIncludeParam = string | EntityIncludeArray;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface FileImageVariant {
|
|
2
|
+
path: string;
|
|
3
|
+
publicPath: string;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
size: number;
|
|
7
|
+
format: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FileImage {
|
|
10
|
+
fileId: string;
|
|
11
|
+
originalWidth: number;
|
|
12
|
+
originalHeight: number;
|
|
13
|
+
variants: Record<string, FileImageVariant>;
|
|
14
|
+
processingStatus: "completed" | "failed";
|
|
15
|
+
processingError: string | null;
|
|
16
|
+
format: string;
|
|
17
|
+
quality: number;
|
|
18
|
+
exifStripped: boolean;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
|
+
}
|
|
22
|
+
export interface File {
|
|
23
|
+
id: string;
|
|
24
|
+
projectId: string;
|
|
25
|
+
userId: string | null;
|
|
26
|
+
entityId: string | null;
|
|
27
|
+
commentId: string | null;
|
|
28
|
+
spaceId: string | null;
|
|
29
|
+
type: "image" | "video" | "document" | "other";
|
|
30
|
+
originalPath: string;
|
|
31
|
+
originalSize: number;
|
|
32
|
+
originalMimeType: string;
|
|
33
|
+
position: number;
|
|
34
|
+
metadata: Record<string, any>;
|
|
35
|
+
image?: FileImage;
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
updatedAt: Date;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../src/interfaces/models/File.ts"],"names":[],"mappings":""}
|