@timardex/cluemart-shared 1.3.1 → 1.3.11

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.
@@ -2,7 +2,7 @@ import * as _apollo_client from '@apollo/client';
2
2
  import { EnumResourceType } from '../enums/index.mjs';
3
3
  import { C as ChatType, N as NotificationType, a as NotificationCount, R as ResourceActivityType } from '../resourceActivities-CJRTZROh.mjs';
4
4
  import { E as EventType, b as EventInfoType, c as RelationType, d as ResourceConnectionsType, V as VendorType, e as VendorInfoType, U as UserLicenceType } from '../global-O7RsWypG.mjs';
5
- import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus, S as SubscriptionStatusData, P as PartnerType } from '../ad-Bk1vP-sL.mjs';
5
+ import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus, S as SubscriptionStatusData, P as PartnerType, a as PostType } from '../post-tVcpbEDX.mjs';
6
6
  import 'react-hook-form';
7
7
 
8
8
  declare const useAdminUpdateResourceType: () => {
@@ -773,4 +773,37 @@ declare const useSearchPartners: (search: string, region: string) => {
773
773
  }>>;
774
774
  };
775
775
 
776
- export { useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useAdminUpdateTester, useCancelSubscription, useContactUs, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useGetAd, useGetAds, useGetAdsByRegion, useGetChat, useGetChatSubscription, useGetEvent, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetRelation, useGetRelationByEventAndVendor, useGetResourceActivities, useGetResourceConnections, useGetSubscriptionStatus, useGetTester, useGetTesters, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLogin, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, useRefreshToken, useRegister, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useResetPassword, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSendChatMessage, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdatePartner, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useValidateVerificationToken };
776
+ declare const useCreatePost: () => {
777
+ createPost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
778
+ error: _apollo_client.ApolloError | undefined;
779
+ loading: boolean;
780
+ };
781
+ declare const useUpdatePost: () => {
782
+ error: _apollo_client.ApolloError | undefined;
783
+ loading: boolean;
784
+ updatePost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
785
+ };
786
+ declare const useDeletePost: () => {
787
+ deletePost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
788
+ error: _apollo_client.ApolloError | undefined;
789
+ loading: boolean;
790
+ };
791
+
792
+ declare const useGetPosts: () => {
793
+ error: _apollo_client.ApolloError | undefined;
794
+ loading: boolean;
795
+ posts: PostType[];
796
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
797
+ posts: PostType[];
798
+ }>>;
799
+ };
800
+ declare const useGetPost: (postId: string) => {
801
+ error: _apollo_client.ApolloError | undefined;
802
+ loading: boolean;
803
+ post: PostType | null;
804
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
805
+ post: PostType;
806
+ }>>;
807
+ };
808
+
809
+ export { useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useAdminUpdateTester, useCancelSubscription, useContactUs, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useGetAd, useGetAds, useGetAdsByRegion, useGetChat, useGetChatSubscription, useGetEvent, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetRelation, useGetRelationByEventAndVendor, useGetResourceActivities, useGetResourceConnections, useGetSubscriptionStatus, useGetTester, useGetTesters, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLogin, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, useRefreshToken, useRegister, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useResetPassword, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSendChatMessage, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useValidateVerificationToken };
@@ -2,7 +2,7 @@ import * as _apollo_client from '@apollo/client';
2
2
  import { EnumResourceType } from '../enums/index.js';
3
3
  import { C as ChatType, N as NotificationType, a as NotificationCount, R as ResourceActivityType } from '../resourceActivities-CVwxvGeC.js';
4
4
  import { E as EventType, b as EventInfoType, c as RelationType, d as ResourceConnectionsType, V as VendorType, e as VendorInfoType, U as UserLicenceType } from '../global-DSwmP6sp.js';
5
- import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus, S as SubscriptionStatusData, P as PartnerType } from '../ad-CUvYTUtk.js';
5
+ import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus, S as SubscriptionStatusData, P as PartnerType, a as PostType } from '../post-Df5kAhEE.js';
6
6
  import 'react-hook-form';
7
7
 
8
8
  declare const useAdminUpdateResourceType: () => {
@@ -773,4 +773,37 @@ declare const useSearchPartners: (search: string, region: string) => {
773
773
  }>>;
774
774
  };
775
775
 
776
- export { useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useAdminUpdateTester, useCancelSubscription, useContactUs, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useGetAd, useGetAds, useGetAdsByRegion, useGetChat, useGetChatSubscription, useGetEvent, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetRelation, useGetRelationByEventAndVendor, useGetResourceActivities, useGetResourceConnections, useGetSubscriptionStatus, useGetTester, useGetTesters, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLogin, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, useRefreshToken, useRegister, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useResetPassword, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSendChatMessage, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdatePartner, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useValidateVerificationToken };
776
+ declare const useCreatePost: () => {
777
+ createPost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
778
+ error: _apollo_client.ApolloError | undefined;
779
+ loading: boolean;
780
+ };
781
+ declare const useUpdatePost: () => {
782
+ error: _apollo_client.ApolloError | undefined;
783
+ loading: boolean;
784
+ updatePost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
785
+ };
786
+ declare const useDeletePost: () => {
787
+ deletePost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
788
+ error: _apollo_client.ApolloError | undefined;
789
+ loading: boolean;
790
+ };
791
+
792
+ declare const useGetPosts: () => {
793
+ error: _apollo_client.ApolloError | undefined;
794
+ loading: boolean;
795
+ posts: PostType[];
796
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
797
+ posts: PostType[];
798
+ }>>;
799
+ };
800
+ declare const useGetPost: (postId: string) => {
801
+ error: _apollo_client.ApolloError | undefined;
802
+ loading: boolean;
803
+ post: PostType | null;
804
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
805
+ post: PostType;
806
+ }>>;
807
+ };
808
+
809
+ export { useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useAdminUpdateTester, useCancelSubscription, useContactUs, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePost, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeletePost, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useGetAd, useGetAds, useGetAdsByRegion, useGetChat, useGetChatSubscription, useGetEvent, useGetEventInfo, useGetEventRelations, useGetEvents, useGetEventsByRegion, useGetEventsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetPartner, useGetPartners, useGetPartnersByRegion, useGetPost, useGetPosts, useGetRelation, useGetRelationByEventAndVendor, useGetResourceActivities, useGetResourceConnections, useGetSubscriptionStatus, useGetTester, useGetTesters, useGetUser, useGetUserActivities, useGetUserChats, useGetUserEvents, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserVendors, useGetUsers, useGetVendor, useGetVendorInfo, useGetVendorRelations, useGetVendors, useGetVendorsByRegion, useLogin, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, useRefreshToken, useRegister, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useResetPassword, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSendChatMessage, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useValidateVerificationToken };
@@ -2891,6 +2891,139 @@ var useSearchPartners = (search, region) => {
2891
2891
  const partnersSearch = data?.partnersSearch || [];
2892
2892
  return { error, loading, partnersSearch, refetch };
2893
2893
  };
2894
+
2895
+ // src/graphql/hooks/post/hooksMutation.ts
2896
+ import { useMutation as useMutation17 } from "@apollo/client";
2897
+
2898
+ // src/graphql/mutations/post.ts
2899
+ import { gql as gql32 } from "@apollo/client";
2900
+
2901
+ // src/graphql/queries/post.ts
2902
+ import { gql as gql31 } from "@apollo/client";
2903
+ var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql31`
2904
+ fragment PostContentDataFields on PostContentData {
2905
+ cover {
2906
+ ...ResourceImageFields
2907
+ }
2908
+ textarea {
2909
+ title
2910
+ data
2911
+ }
2912
+ images {
2913
+ ...ResourceImageFields
2914
+ }
2915
+ video {
2916
+ source
2917
+ title
2918
+ }
2919
+ list {
2920
+ title
2921
+ items
2922
+ }
2923
+ }
2924
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
2925
+ `;
2926
+ var POST_CONTENT_FIELDS_FRAGMENT = gql31`
2927
+ fragment PostContentFields on PostContentType {
2928
+ _id
2929
+ contentData {
2930
+ ...PostContentDataFields
2931
+ }
2932
+ contentOrder
2933
+ contentType
2934
+ }
2935
+ ${POST_CONTENT_DATA_FIELDS_FRAGMENT}
2936
+ `;
2937
+ var POST_FIELDS_FRAGMENT = gql31`
2938
+ fragment PostFields on PostType {
2939
+ _id
2940
+ content {
2941
+ ...PostContentFields
2942
+ }
2943
+ postType
2944
+ tags
2945
+ title
2946
+ createdAt
2947
+ updatedAt
2948
+ }
2949
+ ${POST_CONTENT_FIELDS_FRAGMENT}
2950
+ `;
2951
+ var GET_POSTS = gql31`
2952
+ query getPosts {
2953
+ posts {
2954
+ ...PostFields
2955
+ }
2956
+ }
2957
+ ${POST_FIELDS_FRAGMENT}
2958
+ `;
2959
+ var GET_POST = gql31`
2960
+ query getPost($postId: ID!) {
2961
+ post(postId: $postId) {
2962
+ ...PostFields
2963
+ }
2964
+ }
2965
+ ${POST_FIELDS_FRAGMENT}
2966
+ `;
2967
+
2968
+ // src/graphql/mutations/post.ts
2969
+ var CREATE_POST_MUTATION = gql32`
2970
+ mutation createPost($input: PostInputType!) {
2971
+ createPost(input: $input) {
2972
+ ...PostFields
2973
+ }
2974
+ }
2975
+ ${POST_FIELDS_FRAGMENT}
2976
+ `;
2977
+ var UPDATE_POST_MUTATION = gql32`
2978
+ mutation updatePost($_id: ID!, $input: PostInputType!) {
2979
+ updatePost(_id: $_id, input: $input) {
2980
+ ...PostFields
2981
+ }
2982
+ }
2983
+ ${POST_FIELDS_FRAGMENT}
2984
+ `;
2985
+ var DELETE_POST_MUTATION = gql32`
2986
+ mutation deletePost($_id: ID!) {
2987
+ deletePost(_id: $_id)
2988
+ }
2989
+ `;
2990
+
2991
+ // src/graphql/hooks/post/hooksMutation.ts
2992
+ var useCreatePost = () => {
2993
+ const [createPost, { loading, error }] = useMutation17(CREATE_POST_MUTATION, {
2994
+ awaitRefetchQueries: true,
2995
+ refetchQueries: [{ query: GET_POSTS }]
2996
+ });
2997
+ return { createPost, error, loading };
2998
+ };
2999
+ var useUpdatePost = () => {
3000
+ const [updatePost, { loading, error }] = useMutation17(UPDATE_POST_MUTATION, {
3001
+ awaitRefetchQueries: true,
3002
+ refetchQueries: [{ query: GET_POSTS }]
3003
+ });
3004
+ return { error, loading, updatePost };
3005
+ };
3006
+ var useDeletePost = () => {
3007
+ const [deletePost, { loading, error }] = useMutation17(DELETE_POST_MUTATION, {
3008
+ awaitRefetchQueries: true,
3009
+ refetchQueries: [{ query: GET_POSTS }]
3010
+ });
3011
+ return { deletePost, error, loading };
3012
+ };
3013
+
3014
+ // src/graphql/hooks/post/hooksQuery.ts
3015
+ import { useQuery as useQuery12 } from "@apollo/client";
3016
+ var useGetPosts = () => {
3017
+ const { data, loading, error, refetch } = useQuery12(GET_POSTS);
3018
+ return { error, loading, posts: data?.posts || [], refetch };
3019
+ };
3020
+ var useGetPost = (postId) => {
3021
+ const { data, loading, error, refetch } = useQuery12(GET_POST, {
3022
+ skip: !postId,
3023
+ variables: { postId }
3024
+ });
3025
+ return { error, loading, post: data?.post || null, refetch };
3026
+ };
2894
3027
  export {
2895
3028
  useAddParticipantToChat,
2896
3029
  useAddUserFavouriteResource,
@@ -2907,6 +3040,7 @@ export {
2907
3040
  useCreateEvent,
2908
3041
  useCreateEventInfo,
2909
3042
  useCreatePartner,
3043
+ useCreatePost,
2910
3044
  useCreatePoster,
2911
3045
  useCreatePushToken,
2912
3046
  useCreateRelation,
@@ -2921,6 +3055,7 @@ export {
2921
3055
  useDeleteEvent,
2922
3056
  useDeleteNotification,
2923
3057
  useDeletePartner,
3058
+ useDeletePost,
2924
3059
  useDeleteRelation,
2925
3060
  useDeleteTester,
2926
3061
  useDeleteUser,
@@ -2941,6 +3076,8 @@ export {
2941
3076
  useGetPartner,
2942
3077
  useGetPartners,
2943
3078
  useGetPartnersByRegion,
3079
+ useGetPost,
3080
+ useGetPosts,
2944
3081
  useGetRelation,
2945
3082
  useGetRelationByEventAndVendor,
2946
3083
  useGetResourceActivities,
@@ -2983,6 +3120,7 @@ export {
2983
3120
  useUpdateEvent,
2984
3121
  useUpdateEventInfo,
2985
3122
  useUpdatePartner,
3123
+ useUpdatePost,
2986
3124
  useUpdateRelation,
2987
3125
  useUpdateSubscriptionPlan,
2988
3126
  useUpdateTester,