@timardex/cluemart-shared 1.3.1 → 1.3.12

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, b as EnumPostType } from '../post-CifJA7KI.mjs';
6
6
  import 'react-hook-form';
7
7
 
8
8
  declare const useAdminUpdateResourceType: () => {
@@ -773,4 +773,45 @@ 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
+ declare const useGetPostsByType: (postType: EnumPostType) => {
809
+ error: _apollo_client.ApolloError | undefined;
810
+ loading: boolean;
811
+ postsByType: PostType[];
812
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
813
+ postsByType: PostType[];
814
+ }>>;
815
+ };
816
+
817
+ 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, useGetPostsByType, 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, b as EnumPostType } from '../post-CL2oI3Yl.js';
6
6
  import 'react-hook-form';
7
7
 
8
8
  declare const useAdminUpdateResourceType: () => {
@@ -773,4 +773,45 @@ 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
+ declare const useGetPostsByType: (postType: EnumPostType) => {
809
+ error: _apollo_client.ApolloError | undefined;
810
+ loading: boolean;
811
+ postsByType: PostType[];
812
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
813
+ postsByType: PostType[];
814
+ }>>;
815
+ };
816
+
817
+ 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, useGetPostsByType, 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,154 @@ 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
+ var GET_POSTS_BY_TYPE = gql31`
2968
+ query getPostsByType($postType: PostTypeEnum!) {
2969
+ postsByType(postType: $postType) {
2970
+ ...PostFields
2971
+ }
2972
+ }
2973
+ ${POST_FIELDS_FRAGMENT}
2974
+ `;
2975
+
2976
+ // src/graphql/mutations/post.ts
2977
+ var CREATE_POST_MUTATION = gql32`
2978
+ mutation createPost($input: PostInputType!) {
2979
+ createPost(input: $input) {
2980
+ ...PostFields
2981
+ }
2982
+ }
2983
+ ${POST_FIELDS_FRAGMENT}
2984
+ `;
2985
+ var UPDATE_POST_MUTATION = gql32`
2986
+ mutation updatePost($_id: ID!, $input: PostInputType!) {
2987
+ updatePost(_id: $_id, input: $input) {
2988
+ ...PostFields
2989
+ }
2990
+ }
2991
+ ${POST_FIELDS_FRAGMENT}
2992
+ `;
2993
+ var DELETE_POST_MUTATION = gql32`
2994
+ mutation deletePost($_id: ID!) {
2995
+ deletePost(_id: $_id)
2996
+ }
2997
+ `;
2998
+
2999
+ // src/graphql/hooks/post/hooksMutation.ts
3000
+ var useCreatePost = () => {
3001
+ const [createPost, { loading, error }] = useMutation17(CREATE_POST_MUTATION, {
3002
+ awaitRefetchQueries: true,
3003
+ refetchQueries: [{ query: GET_POSTS }]
3004
+ });
3005
+ return { createPost, error, loading };
3006
+ };
3007
+ var useUpdatePost = () => {
3008
+ const [updatePost, { loading, error }] = useMutation17(UPDATE_POST_MUTATION, {
3009
+ awaitRefetchQueries: true,
3010
+ refetchQueries: [{ query: GET_POSTS }]
3011
+ });
3012
+ return { error, loading, updatePost };
3013
+ };
3014
+ var useDeletePost = () => {
3015
+ const [deletePost, { loading, error }] = useMutation17(DELETE_POST_MUTATION, {
3016
+ awaitRefetchQueries: true,
3017
+ refetchQueries: [{ query: GET_POSTS }]
3018
+ });
3019
+ return { deletePost, error, loading };
3020
+ };
3021
+
3022
+ // src/graphql/hooks/post/hooksQuery.ts
3023
+ import { useQuery as useQuery12 } from "@apollo/client";
3024
+ var useGetPosts = () => {
3025
+ const { data, loading, error, refetch } = useQuery12(GET_POSTS);
3026
+ return { error, loading, posts: data?.posts || [], refetch };
3027
+ };
3028
+ var useGetPost = (postId) => {
3029
+ const { data, loading, error, refetch } = useQuery12(GET_POST, {
3030
+ skip: !postId,
3031
+ variables: { postId }
3032
+ });
3033
+ return { error, loading, post: data?.post || null, refetch };
3034
+ };
3035
+ var useGetPostsByType = (postType) => {
3036
+ const { data, loading, error, refetch } = useQuery12(GET_POSTS_BY_TYPE, {
3037
+ skip: !postType,
3038
+ variables: { postType }
3039
+ });
3040
+ return { error, loading, postsByType: data?.postsByType || [], refetch };
3041
+ };
2894
3042
  export {
2895
3043
  useAddParticipantToChat,
2896
3044
  useAddUserFavouriteResource,
@@ -2907,6 +3055,7 @@ export {
2907
3055
  useCreateEvent,
2908
3056
  useCreateEventInfo,
2909
3057
  useCreatePartner,
3058
+ useCreatePost,
2910
3059
  useCreatePoster,
2911
3060
  useCreatePushToken,
2912
3061
  useCreateRelation,
@@ -2921,6 +3070,7 @@ export {
2921
3070
  useDeleteEvent,
2922
3071
  useDeleteNotification,
2923
3072
  useDeletePartner,
3073
+ useDeletePost,
2924
3074
  useDeleteRelation,
2925
3075
  useDeleteTester,
2926
3076
  useDeleteUser,
@@ -2941,6 +3091,9 @@ export {
2941
3091
  useGetPartner,
2942
3092
  useGetPartners,
2943
3093
  useGetPartnersByRegion,
3094
+ useGetPost,
3095
+ useGetPosts,
3096
+ useGetPostsByType,
2944
3097
  useGetRelation,
2945
3098
  useGetRelationByEventAndVendor,
2946
3099
  useGetResourceActivities,
@@ -2983,6 +3136,7 @@ export {
2983
3136
  useUpdateEvent,
2984
3137
  useUpdateEventInfo,
2985
3138
  useUpdatePartner,
3139
+ useUpdatePost,
2986
3140
  useUpdateRelation,
2987
3141
  useUpdateSubscriptionPlan,
2988
3142
  useUpdateTester,