@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.
- package/dist/{chunk-3ZDDQGW4.mjs → chunk-Y3MIKYGQ.mjs} +20 -2
- package/dist/chunk-Y3MIKYGQ.mjs.map +1 -0
- package/dist/graphql/index.cjs +160 -0
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +43 -2
- package/dist/graphql/index.d.ts +43 -2
- package/dist/graphql/index.mjs +154 -0
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +140 -5
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +4 -2
- package/dist/hooks/index.d.ts +4 -2
- package/dist/hooks/index.mjs +124 -6
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +304 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +107 -1
- package/dist/index.d.ts +107 -1
- package/dist/index.mjs +295 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{ad-CUvYTUtk.d.ts → post-CL2oI3Yl.d.ts} +64 -1
- package/dist/{ad-Bk1vP-sL.d.mts → post-CifJA7KI.d.mts} +64 -1
- package/dist/types/index.cjs +20 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +5 -1
- package/dist/types/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3ZDDQGW4.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -904,6 +904,69 @@ interface PartnerType extends BaseResourceType {
|
|
|
904
904
|
partnerType: EnumPartnerType;
|
|
905
905
|
}
|
|
906
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
|
+
|
|
907
970
|
declare const vendorElectricity: {
|
|
908
971
|
details: FormField;
|
|
909
972
|
isRequired: FormField;
|
|
@@ -1736,6 +1799,47 @@ declare const useSearchPartners: (search: string, region: string) => {
|
|
|
1736
1799
|
}>>;
|
|
1737
1800
|
};
|
|
1738
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
|
+
declare const useGetPostsByType: (postType: EnumPostType) => {
|
|
1835
|
+
error: _apollo_client.ApolloError | undefined;
|
|
1836
|
+
loading: boolean;
|
|
1837
|
+
postsByType: PostType[];
|
|
1838
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
1839
|
+
postsByType: PostType[];
|
|
1840
|
+
}>>;
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1739
1843
|
interface PlacePrediction {
|
|
1740
1844
|
place_id: string;
|
|
1741
1845
|
description: string;
|
|
@@ -1827,6 +1931,8 @@ declare function useAdForm(data?: AdFormData): CreateAdFormData;
|
|
|
1827
1931
|
*/
|
|
1828
1932
|
declare function usePartnerForm(data?: PartnerFormData): CreatePartnerFormData;
|
|
1829
1933
|
|
|
1934
|
+
declare function usePostform(data?: PostFormData): CreatePostFormData;
|
|
1935
|
+
|
|
1830
1936
|
declare const SAVED_PASSWORD_KEY = "savedPassword";
|
|
1831
1937
|
declare const SAVED_EMAIL_KEY = "savedEmail";
|
|
1832
1938
|
declare const SAVED_TOKEN_KEY = "savedToken";
|
|
@@ -1925,4 +2031,4 @@ declare const availableRegionOptions: OptionItem[];
|
|
|
1925
2031
|
declare const paymentMethodOptions: OptionItem[];
|
|
1926
2032
|
declare function normalizeUrl(url: string): string;
|
|
1927
2033
|
|
|
1928
|
-
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 };
|
|
2034
|
+
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, useGetPostsByType, 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
|
@@ -904,6 +904,69 @@ interface PartnerType extends BaseResourceType {
|
|
|
904
904
|
partnerType: EnumPartnerType;
|
|
905
905
|
}
|
|
906
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
|
+
|
|
907
970
|
declare const vendorElectricity: {
|
|
908
971
|
details: FormField;
|
|
909
972
|
isRequired: FormField;
|
|
@@ -1736,6 +1799,47 @@ declare const useSearchPartners: (search: string, region: string) => {
|
|
|
1736
1799
|
}>>;
|
|
1737
1800
|
};
|
|
1738
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
|
+
declare const useGetPostsByType: (postType: EnumPostType) => {
|
|
1835
|
+
error: _apollo_client.ApolloError | undefined;
|
|
1836
|
+
loading: boolean;
|
|
1837
|
+
postsByType: PostType[];
|
|
1838
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
1839
|
+
postsByType: PostType[];
|
|
1840
|
+
}>>;
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1739
1843
|
interface PlacePrediction {
|
|
1740
1844
|
place_id: string;
|
|
1741
1845
|
description: string;
|
|
@@ -1827,6 +1931,8 @@ declare function useAdForm(data?: AdFormData): CreateAdFormData;
|
|
|
1827
1931
|
*/
|
|
1828
1932
|
declare function usePartnerForm(data?: PartnerFormData): CreatePartnerFormData;
|
|
1829
1933
|
|
|
1934
|
+
declare function usePostform(data?: PostFormData): CreatePostFormData;
|
|
1935
|
+
|
|
1830
1936
|
declare const SAVED_PASSWORD_KEY = "savedPassword";
|
|
1831
1937
|
declare const SAVED_EMAIL_KEY = "savedEmail";
|
|
1832
1938
|
declare const SAVED_TOKEN_KEY = "savedToken";
|
|
@@ -1925,4 +2031,4 @@ declare const availableRegionOptions: OptionItem[];
|
|
|
1925
2031
|
declare const paymentMethodOptions: OptionItem[];
|
|
1926
2032
|
declare function normalizeUrl(url: string): string;
|
|
1927
2033
|
|
|
1928
|
-
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 };
|
|
2034
|
+
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, useGetPostsByType, 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,154 @@ 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
|
+
var GET_POSTS_BY_TYPE = gql31`
|
|
5113
|
+
query getPostsByType($postType: PostTypeEnum!) {
|
|
5114
|
+
postsByType(postType: $postType) {
|
|
5115
|
+
...PostFields
|
|
5116
|
+
}
|
|
5117
|
+
}
|
|
5118
|
+
${POST_FIELDS_FRAGMENT}
|
|
5119
|
+
`;
|
|
5120
|
+
|
|
5121
|
+
// src/graphql/mutations/post.ts
|
|
5122
|
+
var CREATE_POST_MUTATION = gql32`
|
|
5123
|
+
mutation createPost($input: PostInputType!) {
|
|
5124
|
+
createPost(input: $input) {
|
|
5125
|
+
...PostFields
|
|
5126
|
+
}
|
|
5127
|
+
}
|
|
5128
|
+
${POST_FIELDS_FRAGMENT}
|
|
5129
|
+
`;
|
|
5130
|
+
var UPDATE_POST_MUTATION = gql32`
|
|
5131
|
+
mutation updatePost($_id: ID!, $input: PostInputType!) {
|
|
5132
|
+
updatePost(_id: $_id, input: $input) {
|
|
5133
|
+
...PostFields
|
|
5134
|
+
}
|
|
5135
|
+
}
|
|
5136
|
+
${POST_FIELDS_FRAGMENT}
|
|
5137
|
+
`;
|
|
5138
|
+
var DELETE_POST_MUTATION = gql32`
|
|
5139
|
+
mutation deletePost($_id: ID!) {
|
|
5140
|
+
deletePost(_id: $_id)
|
|
5141
|
+
}
|
|
5142
|
+
`;
|
|
5143
|
+
|
|
5144
|
+
// src/graphql/hooks/post/hooksMutation.ts
|
|
5145
|
+
var useCreatePost = () => {
|
|
5146
|
+
const [createPost, { loading, error }] = useMutation17(CREATE_POST_MUTATION, {
|
|
5147
|
+
awaitRefetchQueries: true,
|
|
5148
|
+
refetchQueries: [{ query: GET_POSTS }]
|
|
5149
|
+
});
|
|
5150
|
+
return { createPost, error, loading };
|
|
5151
|
+
};
|
|
5152
|
+
var useUpdatePost = () => {
|
|
5153
|
+
const [updatePost, { loading, error }] = useMutation17(UPDATE_POST_MUTATION, {
|
|
5154
|
+
awaitRefetchQueries: true,
|
|
5155
|
+
refetchQueries: [{ query: GET_POSTS }]
|
|
5156
|
+
});
|
|
5157
|
+
return { error, loading, updatePost };
|
|
5158
|
+
};
|
|
5159
|
+
var useDeletePost = () => {
|
|
5160
|
+
const [deletePost, { loading, error }] = useMutation17(DELETE_POST_MUTATION, {
|
|
5161
|
+
awaitRefetchQueries: true,
|
|
5162
|
+
refetchQueries: [{ query: GET_POSTS }]
|
|
5163
|
+
});
|
|
5164
|
+
return { deletePost, error, loading };
|
|
5165
|
+
};
|
|
5166
|
+
|
|
5167
|
+
// src/graphql/hooks/post/hooksQuery.ts
|
|
5168
|
+
import { useQuery as useQuery12 } from "@apollo/client";
|
|
5169
|
+
var useGetPosts = () => {
|
|
5170
|
+
const { data, loading, error, refetch } = useQuery12(GET_POSTS);
|
|
5171
|
+
return { error, loading, posts: data?.posts || [], refetch };
|
|
5172
|
+
};
|
|
5173
|
+
var useGetPost = (postId) => {
|
|
5174
|
+
const { data, loading, error, refetch } = useQuery12(GET_POST, {
|
|
5175
|
+
skip: !postId,
|
|
5176
|
+
variables: { postId }
|
|
5177
|
+
});
|
|
5178
|
+
return { error, loading, post: data?.post || null, refetch };
|
|
5179
|
+
};
|
|
5180
|
+
var useGetPostsByType = (postType) => {
|
|
5181
|
+
const { data, loading, error, refetch } = useQuery12(GET_POSTS_BY_TYPE, {
|
|
5182
|
+
skip: !postType,
|
|
5183
|
+
variables: { postType }
|
|
5184
|
+
});
|
|
5185
|
+
return { error, loading, postsByType: data?.postsByType || [], refetch };
|
|
5186
|
+
};
|
|
5187
|
+
|
|
5040
5188
|
// src/hooks/useLocationSearch.ts
|
|
5041
5189
|
var handleApiError = (error, message) => {
|
|
5042
5190
|
console.error(message, error);
|
|
@@ -5689,6 +5837,87 @@ var partnerSchema = globalResourceSchema.shape({
|
|
|
5689
5837
|
partnerType: yup8.mixed().oneOf(Object.values(EnumPartnerType)).required("Please select a Partner type")
|
|
5690
5838
|
});
|
|
5691
5839
|
|
|
5840
|
+
// src/yupSchema/post.ts
|
|
5841
|
+
import * as yup9 from "yup";
|
|
5842
|
+
|
|
5843
|
+
// src/types/post.ts
|
|
5844
|
+
var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
5845
|
+
EnumPostType2["DAILY_MEETS"] = "daily_meets";
|
|
5846
|
+
EnumPostType2["DAILY_TIPS"] = "daily_tips";
|
|
5847
|
+
EnumPostType2["DAILY_POLL"] = "daily_poll";
|
|
5848
|
+
return EnumPostType2;
|
|
5849
|
+
})(EnumPostType || {});
|
|
5850
|
+
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
5851
|
+
EnumPostContentType2["COVER"] = "cover";
|
|
5852
|
+
EnumPostContentType2["IMAGE"] = "image";
|
|
5853
|
+
EnumPostContentType2["LIST"] = "list";
|
|
5854
|
+
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
5855
|
+
EnumPostContentType2["VIDEO"] = "video";
|
|
5856
|
+
return EnumPostContentType2;
|
|
5857
|
+
})(EnumPostContentType || {});
|
|
5858
|
+
|
|
5859
|
+
// src/yupSchema/post.ts
|
|
5860
|
+
var coverContentSchema = yup9.object({
|
|
5861
|
+
cover: yup9.object({
|
|
5862
|
+
source: yup9.string().required("Cover source is required"),
|
|
5863
|
+
title: yup9.string().required("Cover title is required")
|
|
5864
|
+
}).required()
|
|
5865
|
+
});
|
|
5866
|
+
var textareaContentSchema = yup9.object({
|
|
5867
|
+
textarea: yup9.object({
|
|
5868
|
+
data: yup9.string().required("Textarea content is required"),
|
|
5869
|
+
title: yup9.string().optional()
|
|
5870
|
+
}).required()
|
|
5871
|
+
});
|
|
5872
|
+
var imagesContentSchema = yup9.object({
|
|
5873
|
+
images: yup9.array().of(
|
|
5874
|
+
yup9.object({
|
|
5875
|
+
source: yup9.string().required("Image source is required"),
|
|
5876
|
+
title: yup9.string().required("Image title is required")
|
|
5877
|
+
})
|
|
5878
|
+
).nullable()
|
|
5879
|
+
});
|
|
5880
|
+
var videoContentSchema = yup9.object({
|
|
5881
|
+
video: yup9.object({
|
|
5882
|
+
source: yup9.string().required("Video source is required"),
|
|
5883
|
+
title: yup9.string().optional()
|
|
5884
|
+
}).required()
|
|
5885
|
+
});
|
|
5886
|
+
var listContentSchema = yup9.object({
|
|
5887
|
+
list: yup9.object({
|
|
5888
|
+
items: yup9.array().of(yup9.string().required()).min(1, "List must contain at least one item").required(),
|
|
5889
|
+
title: yup9.string().optional()
|
|
5890
|
+
}).required()
|
|
5891
|
+
});
|
|
5892
|
+
var contentDataSchema = yup9.lazy((_, options) => {
|
|
5893
|
+
const contentType = options.parent?.contentType;
|
|
5894
|
+
switch (contentType) {
|
|
5895
|
+
case "cover" /* COVER */:
|
|
5896
|
+
return coverContentSchema;
|
|
5897
|
+
case "textarea" /* TEXTAREA */:
|
|
5898
|
+
return textareaContentSchema;
|
|
5899
|
+
case "image" /* IMAGE */:
|
|
5900
|
+
return imagesContentSchema;
|
|
5901
|
+
case "video" /* VIDEO */:
|
|
5902
|
+
return videoContentSchema;
|
|
5903
|
+
case "list" /* LIST */:
|
|
5904
|
+
return listContentSchema;
|
|
5905
|
+
default:
|
|
5906
|
+
return yup9.mixed().required();
|
|
5907
|
+
}
|
|
5908
|
+
});
|
|
5909
|
+
var postContentSchema = yup9.object().shape({
|
|
5910
|
+
contentData: contentDataSchema,
|
|
5911
|
+
contentOrder: yup9.number().min(0).required(),
|
|
5912
|
+
contentType: yup9.mixed().oneOf(Object.values(EnumPostContentType)).required()
|
|
5913
|
+
});
|
|
5914
|
+
var postSchema = yup9.object().shape({
|
|
5915
|
+
content: yup9.array().of(postContentSchema).required(),
|
|
5916
|
+
postType: yup9.mixed().oneOf(Object.values(EnumPostType)).required(),
|
|
5917
|
+
tags: yup9.array().of(yup9.string()).nullable().optional(),
|
|
5918
|
+
title: yup9.string().required()
|
|
5919
|
+
});
|
|
5920
|
+
|
|
5692
5921
|
// src/hooks/utils.ts
|
|
5693
5922
|
var defaultLocation = {
|
|
5694
5923
|
city: "",
|
|
@@ -6486,12 +6715,12 @@ import React7 from "react";
|
|
|
6486
6715
|
import { useForm as useForm12 } from "react-hook-form";
|
|
6487
6716
|
|
|
6488
6717
|
// src/yupSchema/contactUs.ts
|
|
6489
|
-
import * as
|
|
6490
|
-
var contactUsSchema =
|
|
6718
|
+
import * as yup10 from "yup";
|
|
6719
|
+
var contactUsSchema = yup10.object().shape({
|
|
6491
6720
|
email: emailRequiredSchema,
|
|
6492
|
-
firstName:
|
|
6493
|
-
lastName:
|
|
6494
|
-
message:
|
|
6721
|
+
firstName: yup10.string().label("First Name").required("First name is required"),
|
|
6722
|
+
lastName: yup10.string().label("Last Name").required("Last name is required"),
|
|
6723
|
+
message: yup10.string().label("Message").required("Message is required")
|
|
6495
6724
|
});
|
|
6496
6725
|
|
|
6497
6726
|
// src/hooks/useContactUsForm.ts
|
|
@@ -6739,6 +6968,58 @@ function usePartnerForm(data) {
|
|
|
6739
6968
|
};
|
|
6740
6969
|
}
|
|
6741
6970
|
|
|
6971
|
+
// src/hooks/usePostForm.ts
|
|
6972
|
+
import { yupResolver as yupResolver15 } from "@hookform/resolvers/yup";
|
|
6973
|
+
import React10 from "react";
|
|
6974
|
+
import { useForm as useForm15 } from "react-hook-form";
|
|
6975
|
+
var defaultValues10 = {
|
|
6976
|
+
content: [],
|
|
6977
|
+
postType: "daily_meets" /* DAILY_MEETS */,
|
|
6978
|
+
tags: [],
|
|
6979
|
+
title: ""
|
|
6980
|
+
};
|
|
6981
|
+
function usePostform(data) {
|
|
6982
|
+
const {
|
|
6983
|
+
control,
|
|
6984
|
+
formState: { errors },
|
|
6985
|
+
getValues,
|
|
6986
|
+
handleSubmit,
|
|
6987
|
+
reset,
|
|
6988
|
+
setValue,
|
|
6989
|
+
watch
|
|
6990
|
+
} = useForm15({
|
|
6991
|
+
defaultValues: defaultValues10,
|
|
6992
|
+
resolver: yupResolver15(postSchema)
|
|
6993
|
+
});
|
|
6994
|
+
React10.useEffect(() => {
|
|
6995
|
+
if (data) {
|
|
6996
|
+
reset({
|
|
6997
|
+
content: data.content,
|
|
6998
|
+
postType: data.postType,
|
|
6999
|
+
tags: data.tags,
|
|
7000
|
+
title: data.title
|
|
7001
|
+
});
|
|
7002
|
+
} else {
|
|
7003
|
+
reset(defaultValues10);
|
|
7004
|
+
}
|
|
7005
|
+
}, [data]);
|
|
7006
|
+
const { content, postType, tags, title } = getValues();
|
|
7007
|
+
return {
|
|
7008
|
+
control,
|
|
7009
|
+
fields: {
|
|
7010
|
+
content,
|
|
7011
|
+
postType,
|
|
7012
|
+
tags,
|
|
7013
|
+
title
|
|
7014
|
+
},
|
|
7015
|
+
formState: { errors },
|
|
7016
|
+
handleSubmit,
|
|
7017
|
+
reset,
|
|
7018
|
+
setValue,
|
|
7019
|
+
watch
|
|
7020
|
+
};
|
|
7021
|
+
}
|
|
7022
|
+
|
|
6742
7023
|
// src/storage/index.ts
|
|
6743
7024
|
var SAVED_PASSWORD_KEY = "savedPassword";
|
|
6744
7025
|
var SAVED_EMAIL_KEY = "savedEmail";
|
|
@@ -6810,6 +7091,8 @@ export {
|
|
|
6810
7091
|
EnumOSPlatform,
|
|
6811
7092
|
EnumPartnerType,
|
|
6812
7093
|
EnumPaymentMethod,
|
|
7094
|
+
EnumPostContentType,
|
|
7095
|
+
EnumPostType,
|
|
6813
7096
|
EnumRegions,
|
|
6814
7097
|
EnumRelationResource,
|
|
6815
7098
|
EnumResourceType,
|
|
@@ -6898,6 +7181,7 @@ export {
|
|
|
6898
7181
|
useCreateEvent,
|
|
6899
7182
|
useCreateEventInfo,
|
|
6900
7183
|
useCreatePartner,
|
|
7184
|
+
useCreatePost,
|
|
6901
7185
|
useCreatePoster,
|
|
6902
7186
|
useCreatePushToken,
|
|
6903
7187
|
useCreateRelation,
|
|
@@ -6912,6 +7196,7 @@ export {
|
|
|
6912
7196
|
useDeleteEvent,
|
|
6913
7197
|
useDeleteNotification,
|
|
6914
7198
|
useDeletePartner,
|
|
7199
|
+
useDeletePost,
|
|
6915
7200
|
useDeleteRelation,
|
|
6916
7201
|
useDeleteTester,
|
|
6917
7202
|
useDeleteUser,
|
|
@@ -6934,6 +7219,9 @@ export {
|
|
|
6934
7219
|
useGetPartner,
|
|
6935
7220
|
useGetPartners,
|
|
6936
7221
|
useGetPartnersByRegion,
|
|
7222
|
+
useGetPost,
|
|
7223
|
+
useGetPosts,
|
|
7224
|
+
useGetPostsByType,
|
|
6937
7225
|
useGetRelation,
|
|
6938
7226
|
useGetRelationByEventAndVendor,
|
|
6939
7227
|
useGetResourceActivities,
|
|
@@ -6961,6 +7249,7 @@ export {
|
|
|
6961
7249
|
useMarkAllNotificationsRead,
|
|
6962
7250
|
useMarkNotificationRead,
|
|
6963
7251
|
usePartnerForm,
|
|
7252
|
+
usePostform,
|
|
6964
7253
|
useRefreshToken,
|
|
6965
7254
|
useRegister,
|
|
6966
7255
|
useRegisterForm,
|
|
@@ -6983,6 +7272,7 @@ export {
|
|
|
6983
7272
|
useUpdateEvent,
|
|
6984
7273
|
useUpdateEventInfo,
|
|
6985
7274
|
useUpdatePartner,
|
|
7275
|
+
useUpdatePost,
|
|
6986
7276
|
useUpdateRelation,
|
|
6987
7277
|
useUpdateSubscriptionPlan,
|
|
6988
7278
|
useUpdateTester,
|