@timardex/cluemart-shared 1.3.0 → 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.
Files changed (38) hide show
  1. package/dist/{auth-DlXdCHFm.d.mts → auth-DpfaLmTU.d.mts} +1 -1
  2. package/dist/{auth-B1G5QrD2.d.ts → auth-xXqB6t_8.d.ts} +1 -1
  3. package/dist/{chunk-3ZDDQGW4.mjs → chunk-Y3MIKYGQ.mjs} +20 -2
  4. package/dist/chunk-Y3MIKYGQ.mjs.map +1 -0
  5. package/dist/formFields/index.d.mts +1 -1
  6. package/dist/formFields/index.d.ts +1 -1
  7. package/dist/{global-DabCYr5t.d.ts → global-DSwmP6sp.d.ts} +1 -3
  8. package/dist/{global-B3lGLGxH.d.mts → global-O7RsWypG.d.mts} +1 -3
  9. package/dist/graphql/index.cjs +143 -0
  10. package/dist/graphql/index.cjs.map +1 -1
  11. package/dist/graphql/index.d.mts +36 -3
  12. package/dist/graphql/index.d.ts +36 -3
  13. package/dist/graphql/index.mjs +138 -0
  14. package/dist/graphql/index.mjs.map +1 -1
  15. package/dist/hooks/index.cjs +140 -5
  16. package/dist/hooks/index.cjs.map +1 -1
  17. package/dist/hooks/index.d.mts +6 -4
  18. package/dist/hooks/index.d.ts +6 -4
  19. package/dist/hooks/index.mjs +124 -6
  20. package/dist/hooks/index.mjs.map +1 -1
  21. package/dist/index.cjs +287 -5
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.mts +100 -4
  24. package/dist/index.d.ts +100 -4
  25. package/dist/index.mjs +279 -5
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/{ad-j0VWBCVE.d.ts → post-Df5kAhEE.d.ts} +65 -2
  28. package/dist/{ad-Cld9z55n.d.mts → post-tVcpbEDX.d.mts} +65 -2
  29. package/dist/types/index.cjs +20 -0
  30. package/dist/types/index.cjs.map +1 -1
  31. package/dist/types/index.d.mts +3 -3
  32. package/dist/types/index.d.ts +3 -3
  33. package/dist/types/index.mjs +5 -1
  34. package/dist/types/index.mjs.map +1 -1
  35. package/dist/utils/index.d.mts +1 -1
  36. package/dist/utils/index.d.ts +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-3ZDDQGW4.mjs.map +0 -1
package/dist/index.d.mts CHANGED
@@ -424,13 +424,11 @@ type PosterUsageType = {
424
424
  month: string;
425
425
  count: number;
426
426
  };
427
- type BaseResourceType = Omit<BaseResourceTypeFormData, "_id" | "coverUpload" | "imagesUpload" | "logoUpload" | "owner" | "associates"> & {
427
+ type BaseResourceType = Omit<BaseResourceTypeFormData, "_id" | "coverUpload" | "imagesUpload" | "logoUpload"> & {
428
428
  _id: string;
429
429
  adIds?: string[] | null;
430
- associates: AssociateType[] | null;
431
430
  createdAt: Date;
432
431
  deletedAt: Date | null;
433
- owner: OwnerType;
434
432
  posterUsage?: PosterUsageType | null;
435
433
  updatedAt: Date | null;
436
434
  };
@@ -906,6 +904,69 @@ interface PartnerType extends BaseResourceType {
906
904
  partnerType: EnumPartnerType;
907
905
  }
908
906
 
907
+ declare enum EnumPostType {
908
+ DAILY_MEETS = "daily_meets",
909
+ DAILY_TIPS = "daily_tips",
910
+ DAILY_POLL = "daily_poll"
911
+ }
912
+ declare enum EnumPostContentType {
913
+ COVER = "cover",
914
+ IMAGE = "image",
915
+ LIST = "list",
916
+ TEXTAREA = "textarea",
917
+ VIDEO = "video"
918
+ }
919
+ type PostContentCover = {
920
+ cover: ResourceImageType;
921
+ coverUpload?: ResourceImageType | null;
922
+ };
923
+ type PostContentTextarea = {
924
+ textarea: {
925
+ title?: string;
926
+ data: string;
927
+ };
928
+ };
929
+ type PostContentImage = {
930
+ images: ResourceImageType[] | null;
931
+ imagesUpload?: ResourceImageType[] | null;
932
+ };
933
+ type PostContentVideo = {
934
+ video: {
935
+ source: string;
936
+ title?: string;
937
+ };
938
+ };
939
+ type PostContentList = {
940
+ list: {
941
+ title?: string;
942
+ items: string[];
943
+ };
944
+ };
945
+ type PostContentData = PostContentCover | PostContentTextarea | PostContentImage | PostContentVideo | PostContentList;
946
+ type PostContentFormData = {
947
+ contentData: PostContentData;
948
+ contentOrder: number;
949
+ contentType: EnumPostContentType;
950
+ };
951
+ interface PostFormData {
952
+ content: PostContentFormData[];
953
+ postType: EnumPostType;
954
+ tags?: string[] | null;
955
+ title: string;
956
+ }
957
+ type CreatePostFormData = CreateFormData<PostFormData>;
958
+ type PostContentType = Omit<PostContentFormData, "contentData"> & {
959
+ _id: string;
960
+ contentData: Omit<PostContentData, "imagesUpload" | "coverUpload">;
961
+ };
962
+ type PostType = Omit<PostFormData, "content"> & {
963
+ _id: string;
964
+ content: PostContentType;
965
+ createdAt: Date;
966
+ deletedAt: Date | null;
967
+ updatedAt: Date | null;
968
+ };
969
+
909
970
  declare const vendorElectricity: {
910
971
  details: FormField;
911
972
  isRequired: FormField;
@@ -1738,6 +1799,39 @@ declare const useSearchPartners: (search: string, region: string) => {
1738
1799
  }>>;
1739
1800
  };
1740
1801
 
1802
+ declare const useCreatePost: () => {
1803
+ createPost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
1804
+ error: _apollo_client.ApolloError | undefined;
1805
+ loading: boolean;
1806
+ };
1807
+ declare const useUpdatePost: () => {
1808
+ error: _apollo_client.ApolloError | undefined;
1809
+ loading: boolean;
1810
+ updatePost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
1811
+ };
1812
+ declare const useDeletePost: () => {
1813
+ deletePost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
1814
+ error: _apollo_client.ApolloError | undefined;
1815
+ loading: boolean;
1816
+ };
1817
+
1818
+ declare const useGetPosts: () => {
1819
+ error: _apollo_client.ApolloError | undefined;
1820
+ loading: boolean;
1821
+ posts: PostType[];
1822
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
1823
+ posts: PostType[];
1824
+ }>>;
1825
+ };
1826
+ declare const useGetPost: (postId: string) => {
1827
+ error: _apollo_client.ApolloError | undefined;
1828
+ loading: boolean;
1829
+ post: PostType | null;
1830
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
1831
+ post: PostType;
1832
+ }>>;
1833
+ };
1834
+
1741
1835
  interface PlacePrediction {
1742
1836
  place_id: string;
1743
1837
  description: string;
@@ -1829,6 +1923,8 @@ declare function useAdForm(data?: AdFormData): CreateAdFormData;
1829
1923
  */
1830
1924
  declare function usePartnerForm(data?: PartnerFormData): CreatePartnerFormData;
1831
1925
 
1926
+ declare function usePostform(data?: PostFormData): CreatePostFormData;
1927
+
1832
1928
  declare const SAVED_PASSWORD_KEY = "savedPassword";
1833
1929
  declare const SAVED_EMAIL_KEY = "savedEmail";
1834
1930
  declare const SAVED_TOKEN_KEY = "savedToken";
@@ -1927,4 +2023,4 @@ declare const availableRegionOptions: OptionItem[];
1927
2023
  declare const paymentMethodOptions: OptionItem[];
1928
2024
  declare function normalizeUrl(url: string): string;
1929
2025
 
1930
- export { type AdFormData, type AdType, type AdminUpdateResourceType, type AssociateType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateTesterFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventType, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, OrganizedMarketCount, OrganizerMarketFrequency, type OwnerType, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PosterInputType, type PosterUsageType, type Region, type RegisterFormData, type RelationDate, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionStatusData, type TermsAgreement, type TesterEvent, type TesterFormData, type TesterType, type TesterVendor, USER_STORAGE_KEY, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorLocation, type VendorMenuType, VendorSellingFrequency, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, companyContactFields, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultPartnerFormValues, defaultRegion, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, producedIngOptions, productLabelGroups, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, testersFields, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useAdminUpdateTester, useCancelSubscription, useContactUs, useContactUsForm, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, 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, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, usePartnerForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSendChatMessage, useTesterForm, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdatePartner, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorMultiLocation, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
2026
+ export { type AdFormData, type AdType, type AdminUpdateResourceType, type AssociateType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateTesterFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventType, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, OrganizedMarketCount, OrganizerMarketFrequency, type OwnerType, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentCover, type PostContentData, type PostContentFormData, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFormData, type PostType, type PosterInputType, type PosterUsageType, type Region, type RegisterFormData, type RelationDate, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionStatusData, type TermsAgreement, type TesterEvent, type TesterFormData, type TesterType, type TesterVendor, USER_STORAGE_KEY, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorLocation, type VendorMenuType, VendorSellingFrequency, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, companyContactFields, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultPartnerFormValues, defaultRegion, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, producedIngOptions, productLabelGroups, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, testersFields, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useAdminUpdateTester, useCancelSubscription, useContactUs, useContactUsForm, 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, useEventForm, useEventInfoForm, 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, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, usePartnerForm, usePostform, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSendChatMessage, useTesterForm, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorMultiLocation, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
package/dist/index.d.ts CHANGED
@@ -424,13 +424,11 @@ type PosterUsageType = {
424
424
  month: string;
425
425
  count: number;
426
426
  };
427
- type BaseResourceType = Omit<BaseResourceTypeFormData, "_id" | "coverUpload" | "imagesUpload" | "logoUpload" | "owner" | "associates"> & {
427
+ type BaseResourceType = Omit<BaseResourceTypeFormData, "_id" | "coverUpload" | "imagesUpload" | "logoUpload"> & {
428
428
  _id: string;
429
429
  adIds?: string[] | null;
430
- associates: AssociateType[] | null;
431
430
  createdAt: Date;
432
431
  deletedAt: Date | null;
433
- owner: OwnerType;
434
432
  posterUsage?: PosterUsageType | null;
435
433
  updatedAt: Date | null;
436
434
  };
@@ -906,6 +904,69 @@ interface PartnerType extends BaseResourceType {
906
904
  partnerType: EnumPartnerType;
907
905
  }
908
906
 
907
+ declare enum EnumPostType {
908
+ DAILY_MEETS = "daily_meets",
909
+ DAILY_TIPS = "daily_tips",
910
+ DAILY_POLL = "daily_poll"
911
+ }
912
+ declare enum EnumPostContentType {
913
+ COVER = "cover",
914
+ IMAGE = "image",
915
+ LIST = "list",
916
+ TEXTAREA = "textarea",
917
+ VIDEO = "video"
918
+ }
919
+ type PostContentCover = {
920
+ cover: ResourceImageType;
921
+ coverUpload?: ResourceImageType | null;
922
+ };
923
+ type PostContentTextarea = {
924
+ textarea: {
925
+ title?: string;
926
+ data: string;
927
+ };
928
+ };
929
+ type PostContentImage = {
930
+ images: ResourceImageType[] | null;
931
+ imagesUpload?: ResourceImageType[] | null;
932
+ };
933
+ type PostContentVideo = {
934
+ video: {
935
+ source: string;
936
+ title?: string;
937
+ };
938
+ };
939
+ type PostContentList = {
940
+ list: {
941
+ title?: string;
942
+ items: string[];
943
+ };
944
+ };
945
+ type PostContentData = PostContentCover | PostContentTextarea | PostContentImage | PostContentVideo | PostContentList;
946
+ type PostContentFormData = {
947
+ contentData: PostContentData;
948
+ contentOrder: number;
949
+ contentType: EnumPostContentType;
950
+ };
951
+ interface PostFormData {
952
+ content: PostContentFormData[];
953
+ postType: EnumPostType;
954
+ tags?: string[] | null;
955
+ title: string;
956
+ }
957
+ type CreatePostFormData = CreateFormData<PostFormData>;
958
+ type PostContentType = Omit<PostContentFormData, "contentData"> & {
959
+ _id: string;
960
+ contentData: Omit<PostContentData, "imagesUpload" | "coverUpload">;
961
+ };
962
+ type PostType = Omit<PostFormData, "content"> & {
963
+ _id: string;
964
+ content: PostContentType;
965
+ createdAt: Date;
966
+ deletedAt: Date | null;
967
+ updatedAt: Date | null;
968
+ };
969
+
909
970
  declare const vendorElectricity: {
910
971
  details: FormField;
911
972
  isRequired: FormField;
@@ -1738,6 +1799,39 @@ declare const useSearchPartners: (search: string, region: string) => {
1738
1799
  }>>;
1739
1800
  };
1740
1801
 
1802
+ declare const useCreatePost: () => {
1803
+ createPost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
1804
+ error: _apollo_client.ApolloError | undefined;
1805
+ loading: boolean;
1806
+ };
1807
+ declare const useUpdatePost: () => {
1808
+ error: _apollo_client.ApolloError | undefined;
1809
+ loading: boolean;
1810
+ updatePost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
1811
+ };
1812
+ declare const useDeletePost: () => {
1813
+ deletePost: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
1814
+ error: _apollo_client.ApolloError | undefined;
1815
+ loading: boolean;
1816
+ };
1817
+
1818
+ declare const useGetPosts: () => {
1819
+ error: _apollo_client.ApolloError | undefined;
1820
+ loading: boolean;
1821
+ posts: PostType[];
1822
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
1823
+ posts: PostType[];
1824
+ }>>;
1825
+ };
1826
+ declare const useGetPost: (postId: string) => {
1827
+ error: _apollo_client.ApolloError | undefined;
1828
+ loading: boolean;
1829
+ post: PostType | null;
1830
+ refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
1831
+ post: PostType;
1832
+ }>>;
1833
+ };
1834
+
1741
1835
  interface PlacePrediction {
1742
1836
  place_id: string;
1743
1837
  description: string;
@@ -1829,6 +1923,8 @@ declare function useAdForm(data?: AdFormData): CreateAdFormData;
1829
1923
  */
1830
1924
  declare function usePartnerForm(data?: PartnerFormData): CreatePartnerFormData;
1831
1925
 
1926
+ declare function usePostform(data?: PostFormData): CreatePostFormData;
1927
+
1832
1928
  declare const SAVED_PASSWORD_KEY = "savedPassword";
1833
1929
  declare const SAVED_EMAIL_KEY = "savedEmail";
1834
1930
  declare const SAVED_TOKEN_KEY = "savedToken";
@@ -1927,4 +2023,4 @@ declare const availableRegionOptions: OptionItem[];
1927
2023
  declare const paymentMethodOptions: OptionItem[];
1928
2024
  declare function normalizeUrl(url: string): string;
1929
2025
 
1930
- export { type AdFormData, type AdType, type AdminUpdateResourceType, type AssociateType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateTesterFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventType, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, OrganizedMarketCount, OrganizerMarketFrequency, type OwnerType, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PosterInputType, type PosterUsageType, type Region, type RegisterFormData, type RelationDate, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionStatusData, type TermsAgreement, type TesterEvent, type TesterFormData, type TesterType, type TesterVendor, USER_STORAGE_KEY, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorLocation, type VendorMenuType, VendorSellingFrequency, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, companyContactFields, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultPartnerFormValues, defaultRegion, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, producedIngOptions, productLabelGroups, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, testersFields, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useAdminUpdateTester, useCancelSubscription, useContactUs, useContactUsForm, useCreateAd, useCreateBulkNotifications, useCreateCheckoutSession, useCreateEvent, useCreateEventInfo, useCreatePartner, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateResourceActivity, useCreateTester, useCreateUser, useCreateVendor, useCreateVendorInfo, useDeleteAd, useDeleteAllNotifications, useDeleteChat, useDeleteEvent, useDeleteNotification, useDeletePartner, useDeleteRelation, useDeleteTester, useDeleteUser, useDeleteVendor, useEventForm, useEventInfoForm, 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, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, usePartnerForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSendChatMessage, useTesterForm, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdatePartner, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorMultiLocation, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
2026
+ export { type AdFormData, type AdType, type AdminUpdateResourceType, type AssociateType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateAdFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateEventFormData, type CreateEventInfoFormData, type CreateFormData, type CreateLoginFormData, type CreatePartnerFormData, type CreatePostFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateTesterFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type CreateVendorFormData, type CreateVendorInfoFormData, type DateTimeType, type DateTimeWithPriceType, type DeviceInfo, EnumActivity, EnumAdShowOn, EnumAdStatus, EnumAdStyle, EnumAdType, EnumChatType, EnumEventDateStatus, EnumEventType, EnumFoodFlavor, EnumFoodType, EnumInviteStatus, EnumNotificationResourceType, EnumNotificationType, EnumOSPlatform, EnumPartnerType, EnumPaymentMethod, EnumPostContentType, EnumPostType, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumSubscriptionStatus, EnumUserLicence, EnumUserRole, EnumVendorType, type EventFormData, type EventInfoFormData, type EventInfoType, type EventType, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type NotificationCount, type NotificationDataType, type NotificationType, type Nullable, type OptionItem, OrganizedMarketCount, OrganizerMarketFrequency, type OwnerType, type ParticipantType, type PartnerFormData, type PartnerType, type PaymentInfoType, type PlacePrediction, type PostContentCover, type PostContentData, type PostContentFormData, type PostContentImage, type PostContentList, type PostContentTextarea, type PostContentType, type PostContentVideo, type PostFormData, type PostType, type PosterInputType, type PosterUsageType, type Region, type RegisterFormData, type RelationDate, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceActivityEntry, type ResourceActivityInputType, type ResourceActivityType, type ResourceConnectionsType, type ResourceContactDetailsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SocialMediaType, type StallType, type StripeSubscription, type Subcategory, type SubcategoryItems, type SubscriptionStatusData, type TermsAgreement, type TesterEvent, type TesterFormData, type TesterType, type TesterVendor, USER_STORAGE_KEY, type UserActivity, type UserActivityEvent, type UserFormData, type UserLicenceType, type UserType, type ValidateVerificationTokenFormData, type VendorAttributes, type VendorFormData, type VendorInfoFormData, type VendorInfoType, type VendorLocation, type VendorMenuType, VendorSellingFrequency, type VendorType, availableCategories, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, companyContactFields, contactUsFields, darkColors, dateFormat, defaultEventFormValues, defaultEventInfoFormValues, defaultPartnerFormValues, defaultRegion, defaultVendorFormValues, defaultVendorInfoFormValues, emailField, eventBasicInfoFields, eventEndDateFields, eventInfo, eventInfoPaymentInfo, eventStartDateFields, fonts, foodFlavourOptions, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, normalizeUrl, packagingOptions, partnerBasicInfoFields, paymentMethodOptions, producedIngOptions, productLabelGroups, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesChronologically, stallTypeOptions, statusOptions, tagOptions, testersFields, timeFormat, toNZTime, truncateText, useAdForm, useAddParticipantToChat, useAddUserFavouriteResource, useAddUserGoingResource, useAddUserInterestResource, useAddUserPresentResource, useAdminUpdateResourceType, useAdminUpdateTester, useCancelSubscription, useContactUs, useContactUsForm, 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, useEventForm, useEventInfoForm, 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, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, usePartnerForm, usePostform, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRemoveUserGoingResource, useRemoveUserInterestResource, useRemoveUserPresentResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchEvents, useSearchPartners, useSearchVendors, useSelectPackage, useSendChatMessage, useTesterForm, useUpdateAd, useUpdateEvent, useUpdateEventInfo, useUpdatePartner, useUpdatePost, useUpdateRelation, useUpdateSubscriptionPlan, useUpdateTester, useUpdateUser, useUpdateVendor, useUpdateVendorInfo, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, useVendorForm, useVendorInfoForm, validateVerificationTokenFields, vendorAvailability, vendorBasicInfoFields, vendorCompliance, vendorElectricity, vendorEndDateFields, vendorFoodFlavour, vendorFullAddress, vendorGazebo, vendorLocationDescription, vendorMenuFields, vendorMultiLocation, vendorPackaging, vendorPriceRange, vendorProducedIn, vendorStallSize, vendorStartDateFields, vendorTable };
package/dist/index.mjs CHANGED
@@ -5037,6 +5037,139 @@ var useSearchPartners = (search, region) => {
5037
5037
  return { error, loading, partnersSearch, refetch };
5038
5038
  };
5039
5039
 
5040
+ // src/graphql/hooks/post/hooksMutation.ts
5041
+ import { useMutation as useMutation17 } from "@apollo/client";
5042
+
5043
+ // src/graphql/mutations/post.ts
5044
+ import { gql as gql32 } from "@apollo/client";
5045
+
5046
+ // src/graphql/queries/post.ts
5047
+ import { gql as gql31 } from "@apollo/client";
5048
+ var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql31`
5049
+ fragment PostContentDataFields on PostContentData {
5050
+ cover {
5051
+ ...ResourceImageFields
5052
+ }
5053
+ textarea {
5054
+ title
5055
+ data
5056
+ }
5057
+ images {
5058
+ ...ResourceImageFields
5059
+ }
5060
+ video {
5061
+ source
5062
+ title
5063
+ }
5064
+ list {
5065
+ title
5066
+ items
5067
+ }
5068
+ }
5069
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
5070
+ `;
5071
+ var POST_CONTENT_FIELDS_FRAGMENT = gql31`
5072
+ fragment PostContentFields on PostContentType {
5073
+ _id
5074
+ contentData {
5075
+ ...PostContentDataFields
5076
+ }
5077
+ contentOrder
5078
+ contentType
5079
+ }
5080
+ ${POST_CONTENT_DATA_FIELDS_FRAGMENT}
5081
+ `;
5082
+ var POST_FIELDS_FRAGMENT = gql31`
5083
+ fragment PostFields on PostType {
5084
+ _id
5085
+ content {
5086
+ ...PostContentFields
5087
+ }
5088
+ postType
5089
+ tags
5090
+ title
5091
+ createdAt
5092
+ updatedAt
5093
+ }
5094
+ ${POST_CONTENT_FIELDS_FRAGMENT}
5095
+ `;
5096
+ var GET_POSTS = gql31`
5097
+ query getPosts {
5098
+ posts {
5099
+ ...PostFields
5100
+ }
5101
+ }
5102
+ ${POST_FIELDS_FRAGMENT}
5103
+ `;
5104
+ var GET_POST = gql31`
5105
+ query getPost($postId: ID!) {
5106
+ post(postId: $postId) {
5107
+ ...PostFields
5108
+ }
5109
+ }
5110
+ ${POST_FIELDS_FRAGMENT}
5111
+ `;
5112
+
5113
+ // src/graphql/mutations/post.ts
5114
+ var CREATE_POST_MUTATION = gql32`
5115
+ mutation createPost($input: PostInputType!) {
5116
+ createPost(input: $input) {
5117
+ ...PostFields
5118
+ }
5119
+ }
5120
+ ${POST_FIELDS_FRAGMENT}
5121
+ `;
5122
+ var UPDATE_POST_MUTATION = gql32`
5123
+ mutation updatePost($_id: ID!, $input: PostInputType!) {
5124
+ updatePost(_id: $_id, input: $input) {
5125
+ ...PostFields
5126
+ }
5127
+ }
5128
+ ${POST_FIELDS_FRAGMENT}
5129
+ `;
5130
+ var DELETE_POST_MUTATION = gql32`
5131
+ mutation deletePost($_id: ID!) {
5132
+ deletePost(_id: $_id)
5133
+ }
5134
+ `;
5135
+
5136
+ // src/graphql/hooks/post/hooksMutation.ts
5137
+ var useCreatePost = () => {
5138
+ const [createPost, { loading, error }] = useMutation17(CREATE_POST_MUTATION, {
5139
+ awaitRefetchQueries: true,
5140
+ refetchQueries: [{ query: GET_POSTS }]
5141
+ });
5142
+ return { createPost, error, loading };
5143
+ };
5144
+ var useUpdatePost = () => {
5145
+ const [updatePost, { loading, error }] = useMutation17(UPDATE_POST_MUTATION, {
5146
+ awaitRefetchQueries: true,
5147
+ refetchQueries: [{ query: GET_POSTS }]
5148
+ });
5149
+ return { error, loading, updatePost };
5150
+ };
5151
+ var useDeletePost = () => {
5152
+ const [deletePost, { loading, error }] = useMutation17(DELETE_POST_MUTATION, {
5153
+ awaitRefetchQueries: true,
5154
+ refetchQueries: [{ query: GET_POSTS }]
5155
+ });
5156
+ return { deletePost, error, loading };
5157
+ };
5158
+
5159
+ // src/graphql/hooks/post/hooksQuery.ts
5160
+ import { useQuery as useQuery12 } from "@apollo/client";
5161
+ var useGetPosts = () => {
5162
+ const { data, loading, error, refetch } = useQuery12(GET_POSTS);
5163
+ return { error, loading, posts: data?.posts || [], refetch };
5164
+ };
5165
+ var useGetPost = (postId) => {
5166
+ const { data, loading, error, refetch } = useQuery12(GET_POST, {
5167
+ skip: !postId,
5168
+ variables: { postId }
5169
+ });
5170
+ return { error, loading, post: data?.post || null, refetch };
5171
+ };
5172
+
5040
5173
  // src/hooks/useLocationSearch.ts
5041
5174
  var handleApiError = (error, message) => {
5042
5175
  console.error(message, error);
@@ -5689,6 +5822,87 @@ var partnerSchema = globalResourceSchema.shape({
5689
5822
  partnerType: yup8.mixed().oneOf(Object.values(EnumPartnerType)).required("Please select a Partner type")
5690
5823
  });
5691
5824
 
5825
+ // src/yupSchema/post.ts
5826
+ import * as yup9 from "yup";
5827
+
5828
+ // src/types/post.ts
5829
+ var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
5830
+ EnumPostType2["DAILY_MEETS"] = "daily_meets";
5831
+ EnumPostType2["DAILY_TIPS"] = "daily_tips";
5832
+ EnumPostType2["DAILY_POLL"] = "daily_poll";
5833
+ return EnumPostType2;
5834
+ })(EnumPostType || {});
5835
+ var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
5836
+ EnumPostContentType2["COVER"] = "cover";
5837
+ EnumPostContentType2["IMAGE"] = "image";
5838
+ EnumPostContentType2["LIST"] = "list";
5839
+ EnumPostContentType2["TEXTAREA"] = "textarea";
5840
+ EnumPostContentType2["VIDEO"] = "video";
5841
+ return EnumPostContentType2;
5842
+ })(EnumPostContentType || {});
5843
+
5844
+ // src/yupSchema/post.ts
5845
+ var coverContentSchema = yup9.object({
5846
+ cover: yup9.object({
5847
+ source: yup9.string().required("Cover source is required"),
5848
+ title: yup9.string().required("Cover title is required")
5849
+ }).required()
5850
+ });
5851
+ var textareaContentSchema = yup9.object({
5852
+ textarea: yup9.object({
5853
+ data: yup9.string().required("Textarea content is required"),
5854
+ title: yup9.string().optional()
5855
+ }).required()
5856
+ });
5857
+ var imagesContentSchema = yup9.object({
5858
+ images: yup9.array().of(
5859
+ yup9.object({
5860
+ source: yup9.string().required("Image source is required"),
5861
+ title: yup9.string().required("Image title is required")
5862
+ })
5863
+ ).nullable()
5864
+ });
5865
+ var videoContentSchema = yup9.object({
5866
+ video: yup9.object({
5867
+ source: yup9.string().required("Video source is required"),
5868
+ title: yup9.string().optional()
5869
+ }).required()
5870
+ });
5871
+ var listContentSchema = yup9.object({
5872
+ list: yup9.object({
5873
+ items: yup9.array().of(yup9.string().required()).min(1, "List must contain at least one item").required(),
5874
+ title: yup9.string().optional()
5875
+ }).required()
5876
+ });
5877
+ var contentDataSchema = yup9.lazy((_, options) => {
5878
+ const contentType = options.parent?.contentType;
5879
+ switch (contentType) {
5880
+ case "cover" /* COVER */:
5881
+ return coverContentSchema;
5882
+ case "textarea" /* TEXTAREA */:
5883
+ return textareaContentSchema;
5884
+ case "image" /* IMAGE */:
5885
+ return imagesContentSchema;
5886
+ case "video" /* VIDEO */:
5887
+ return videoContentSchema;
5888
+ case "list" /* LIST */:
5889
+ return listContentSchema;
5890
+ default:
5891
+ return yup9.mixed().required();
5892
+ }
5893
+ });
5894
+ var postContentSchema = yup9.object().shape({
5895
+ contentData: contentDataSchema.required(),
5896
+ contentOrder: yup9.number().min(0).required(),
5897
+ contentType: yup9.mixed().oneOf(Object.values(EnumPostContentType)).required()
5898
+ });
5899
+ var postSchema = yup9.object().shape({
5900
+ content: yup9.array().of(postContentSchema).required(),
5901
+ postType: yup9.mixed().oneOf(Object.values(EnumPostType)).required(),
5902
+ tags: yup9.array().of(yup9.string()).nullable().optional(),
5903
+ title: yup9.string().required()
5904
+ });
5905
+
5692
5906
  // src/hooks/utils.ts
5693
5907
  var defaultLocation = {
5694
5908
  city: "",
@@ -6486,12 +6700,12 @@ import React7 from "react";
6486
6700
  import { useForm as useForm12 } from "react-hook-form";
6487
6701
 
6488
6702
  // src/yupSchema/contactUs.ts
6489
- import * as yup9 from "yup";
6490
- var contactUsSchema = yup9.object().shape({
6703
+ import * as yup10 from "yup";
6704
+ var contactUsSchema = yup10.object().shape({
6491
6705
  email: emailRequiredSchema,
6492
- firstName: yup9.string().label("First Name").required("First name is required"),
6493
- lastName: yup9.string().label("Last Name").required("Last name is required"),
6494
- message: yup9.string().label("Message").required("Message is required")
6706
+ firstName: yup10.string().label("First Name").required("First name is required"),
6707
+ lastName: yup10.string().label("Last Name").required("Last name is required"),
6708
+ message: yup10.string().label("Message").required("Message is required")
6495
6709
  });
6496
6710
 
6497
6711
  // src/hooks/useContactUsForm.ts
@@ -6739,6 +6953,58 @@ function usePartnerForm(data) {
6739
6953
  };
6740
6954
  }
6741
6955
 
6956
+ // src/hooks/usePostForm.ts
6957
+ import { yupResolver as yupResolver15 } from "@hookform/resolvers/yup";
6958
+ import React10 from "react";
6959
+ import { useForm as useForm15 } from "react-hook-form";
6960
+ var defaultValues10 = {
6961
+ content: [],
6962
+ postType: "daily_meets" /* DAILY_MEETS */,
6963
+ tags: [],
6964
+ title: ""
6965
+ };
6966
+ function usePostform(data) {
6967
+ const {
6968
+ control,
6969
+ formState: { errors },
6970
+ getValues,
6971
+ handleSubmit,
6972
+ reset,
6973
+ setValue,
6974
+ watch
6975
+ } = useForm15({
6976
+ defaultValues: defaultValues10,
6977
+ resolver: yupResolver15(postSchema)
6978
+ });
6979
+ React10.useEffect(() => {
6980
+ if (data) {
6981
+ reset({
6982
+ content: data.content,
6983
+ postType: data.postType,
6984
+ tags: data.tags,
6985
+ title: data.title
6986
+ });
6987
+ } else {
6988
+ reset(defaultValues10);
6989
+ }
6990
+ }, [data]);
6991
+ const { content, postType, tags, title } = getValues();
6992
+ return {
6993
+ control,
6994
+ fields: {
6995
+ content,
6996
+ postType,
6997
+ tags,
6998
+ title
6999
+ },
7000
+ formState: { errors },
7001
+ handleSubmit,
7002
+ reset,
7003
+ setValue,
7004
+ watch
7005
+ };
7006
+ }
7007
+
6742
7008
  // src/storage/index.ts
6743
7009
  var SAVED_PASSWORD_KEY = "savedPassword";
6744
7010
  var SAVED_EMAIL_KEY = "savedEmail";
@@ -6810,6 +7076,8 @@ export {
6810
7076
  EnumOSPlatform,
6811
7077
  EnumPartnerType,
6812
7078
  EnumPaymentMethod,
7079
+ EnumPostContentType,
7080
+ EnumPostType,
6813
7081
  EnumRegions,
6814
7082
  EnumRelationResource,
6815
7083
  EnumResourceType,
@@ -6898,6 +7166,7 @@ export {
6898
7166
  useCreateEvent,
6899
7167
  useCreateEventInfo,
6900
7168
  useCreatePartner,
7169
+ useCreatePost,
6901
7170
  useCreatePoster,
6902
7171
  useCreatePushToken,
6903
7172
  useCreateRelation,
@@ -6912,6 +7181,7 @@ export {
6912
7181
  useDeleteEvent,
6913
7182
  useDeleteNotification,
6914
7183
  useDeletePartner,
7184
+ useDeletePost,
6915
7185
  useDeleteRelation,
6916
7186
  useDeleteTester,
6917
7187
  useDeleteUser,
@@ -6934,6 +7204,8 @@ export {
6934
7204
  useGetPartner,
6935
7205
  useGetPartners,
6936
7206
  useGetPartnersByRegion,
7207
+ useGetPost,
7208
+ useGetPosts,
6937
7209
  useGetRelation,
6938
7210
  useGetRelationByEventAndVendor,
6939
7211
  useGetResourceActivities,
@@ -6961,6 +7233,7 @@ export {
6961
7233
  useMarkAllNotificationsRead,
6962
7234
  useMarkNotificationRead,
6963
7235
  usePartnerForm,
7236
+ usePostform,
6964
7237
  useRefreshToken,
6965
7238
  useRegister,
6966
7239
  useRegisterForm,
@@ -6983,6 +7256,7 @@ export {
6983
7256
  useUpdateEvent,
6984
7257
  useUpdateEventInfo,
6985
7258
  useUpdatePartner,
7259
+ useUpdatePost,
6986
7260
  useUpdateRelation,
6987
7261
  useUpdateSubscriptionPlan,
6988
7262
  useUpdateTester,