@timardex/cluemart-shared 1.0.56 → 1.0.58
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/formFields/index.cjs +1 -1
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/formFields/index.mjs +1 -1
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-CYs1fvIO.d.mts → global-BKglpM-a.d.mts} +12 -12
- package/dist/{global-B4Zad8Xu.d.ts → global-DYtTgWhw.d.ts} +12 -12
- package/dist/graphql/index.cjs +57 -60
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +13 -13
- package/dist/graphql/index.d.ts +13 -13
- package/dist/graphql/index.mjs +54 -57
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +11 -11
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +5 -5
- package/dist/hooks/index.d.ts +5 -5
- package/dist/hooks/index.mjs +9 -9
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +69 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +26 -26
- package/dist/index.d.ts +26 -26
- package/dist/index.mjs +64 -67
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -322,7 +322,7 @@ type StallholderAttributes = {
|
|
|
322
322
|
details?: string | null;
|
|
323
323
|
isRequired: boolean;
|
|
324
324
|
};
|
|
325
|
-
type
|
|
325
|
+
type StallholderInfoFormData = {
|
|
326
326
|
_id?: string;
|
|
327
327
|
electricity: StallholderAttributes;
|
|
328
328
|
foodSafetyGradeFiles?: string[] | null;
|
|
@@ -342,26 +342,26 @@ type StallholderApplyFormFormData = {
|
|
|
342
342
|
};
|
|
343
343
|
table: StallholderAttributes;
|
|
344
344
|
};
|
|
345
|
-
interface
|
|
346
|
-
control: Control<
|
|
347
|
-
fields:
|
|
345
|
+
interface CreateStallholderInfoFormData {
|
|
346
|
+
control: Control<StallholderInfoFormData, any>;
|
|
347
|
+
fields: StallholderInfoFormData;
|
|
348
348
|
formState: {
|
|
349
|
-
errors: FieldErrors<
|
|
349
|
+
errors: FieldErrors<StallholderInfoFormData>;
|
|
350
350
|
};
|
|
351
|
-
handleSubmit: UseFormHandleSubmit<
|
|
352
|
-
reset: UseFormReset<
|
|
353
|
-
setValue: UseFormSetValue<
|
|
354
|
-
watch: UseFormWatch<
|
|
351
|
+
handleSubmit: UseFormHandleSubmit<StallholderInfoFormData, any>;
|
|
352
|
+
reset: UseFormReset<StallholderInfoFormData>;
|
|
353
|
+
setValue: UseFormSetValue<StallholderInfoFormData>;
|
|
354
|
+
watch: UseFormWatch<StallholderInfoFormData>;
|
|
355
355
|
}
|
|
356
356
|
interface StallholderType extends BaseResourceType {
|
|
357
|
-
|
|
357
|
+
stallholderInfoId: string;
|
|
358
358
|
categories: StallholderFormData["categories"];
|
|
359
359
|
locations: StallholderLocation[] | null;
|
|
360
360
|
multiLocation: boolean;
|
|
361
361
|
products: StallholderFormData["products"];
|
|
362
362
|
specialities: string[] | null;
|
|
363
363
|
}
|
|
364
|
-
type
|
|
364
|
+
type StallholderInfoType = Omit<StallholderInfoFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
|
|
365
365
|
_id: string;
|
|
366
366
|
};
|
|
367
367
|
interface SatllholderWithConnectionDatesType extends StallholderType {
|
|
@@ -666,9 +666,9 @@ declare function useStallholderForm(data?: StallholderFormData): CreateStallhold
|
|
|
666
666
|
* Custom hook to manage the stallholder apply form state and validation.
|
|
667
667
|
*
|
|
668
668
|
* @param {StallholderApplyFormFormData} data - The initial form data.
|
|
669
|
-
* @returns {
|
|
669
|
+
* @returns {CreateStallholderInfoFormData} - The form methods and state.
|
|
670
670
|
*/
|
|
671
|
-
declare function
|
|
671
|
+
declare function useStallholderInfoForm(data?: StallholderInfoFormData): CreateStallholderInfoFormData;
|
|
672
672
|
|
|
673
673
|
/**
|
|
674
674
|
* Custom hook to manage the market form state and validation.
|
|
@@ -718,7 +718,7 @@ declare const globalDefaultValues: BaseResourceTypeFormData;
|
|
|
718
718
|
declare const defaultMarketFormValues: MarketFormData;
|
|
719
719
|
declare const defaultMarketInfoFormValues: MarketInfoFormData;
|
|
720
720
|
declare const defaultStallholderFormValues: StallholderFormData;
|
|
721
|
-
declare const
|
|
721
|
+
declare const defaultStallholderInfoFormValues: StallholderInfoFormData;
|
|
722
722
|
declare function mapBaseResourceTypeToFormData(data: MarketFormData | StallholderFormData): BaseResourceTypeFormData;
|
|
723
723
|
|
|
724
724
|
declare function useTestersForm(data?: TestersFormData): CreateTestersFormData;
|
|
@@ -841,13 +841,13 @@ declare const useGetMarket: (_id: string) => {
|
|
|
841
841
|
declare const useGetMarketsByRegion: (region: string) => {
|
|
842
842
|
error: _apollo_client.ApolloError | undefined;
|
|
843
843
|
loading: boolean;
|
|
844
|
-
|
|
844
|
+
marketsByRegion: MarketType[];
|
|
845
845
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
846
846
|
};
|
|
847
847
|
declare const useSearchMarkets: (search: string, region: string) => {
|
|
848
848
|
error: _apollo_client.ApolloError | undefined;
|
|
849
849
|
loading: boolean;
|
|
850
|
-
|
|
850
|
+
marketsSearch: MarketType[];
|
|
851
851
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
852
852
|
};
|
|
853
853
|
declare const useGetMarketsNearMe: (location: {
|
|
@@ -857,7 +857,7 @@ declare const useGetMarketsNearMe: (location: {
|
|
|
857
857
|
}) => {
|
|
858
858
|
error: _apollo_client.ApolloError | undefined;
|
|
859
859
|
loading: boolean;
|
|
860
|
-
|
|
860
|
+
marketsNearMe: MarketType[];
|
|
861
861
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
862
862
|
};
|
|
863
863
|
declare const useGetMarketInfo: (marketId: string) => {
|
|
@@ -935,15 +935,15 @@ declare const useDeleteStallholder: () => {
|
|
|
935
935
|
error: _apollo_client.ApolloError | undefined;
|
|
936
936
|
loading: boolean;
|
|
937
937
|
};
|
|
938
|
-
declare const
|
|
939
|
-
|
|
938
|
+
declare const useCreateStallholderInfo: () => {
|
|
939
|
+
createStallholderInfo: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
940
940
|
error: _apollo_client.ApolloError | undefined;
|
|
941
941
|
loading: boolean;
|
|
942
942
|
};
|
|
943
|
-
declare const
|
|
943
|
+
declare const useUpdateStallholderInfo: () => {
|
|
944
944
|
error: _apollo_client.ApolloError | undefined;
|
|
945
945
|
loading: boolean;
|
|
946
|
-
|
|
946
|
+
updateStallholderInfo: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
947
947
|
};
|
|
948
948
|
|
|
949
949
|
declare const useGetStallholders: () => {
|
|
@@ -962,19 +962,19 @@ declare const useGetStallholdersByRegion: (region: string) => {
|
|
|
962
962
|
error: _apollo_client.ApolloError | undefined;
|
|
963
963
|
loading: boolean;
|
|
964
964
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
965
|
-
|
|
965
|
+
stallholdersByRegion: StallholderType[];
|
|
966
966
|
};
|
|
967
967
|
declare const useSearchStallholders: (search: string, region: string) => {
|
|
968
968
|
error: _apollo_client.ApolloError | undefined;
|
|
969
969
|
loading: boolean;
|
|
970
970
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
971
|
-
|
|
971
|
+
stallholderSearch: StallholderType[];
|
|
972
972
|
};
|
|
973
|
-
declare const
|
|
974
|
-
applyForm: StallholderApplyFormType;
|
|
973
|
+
declare const useGetStallholderInfo: (stallholderId: string) => {
|
|
975
974
|
error: _apollo_client.ApolloError | undefined;
|
|
976
975
|
loading: boolean;
|
|
977
976
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
977
|
+
stallholderInfo: StallholderInfoType;
|
|
978
978
|
};
|
|
979
979
|
|
|
980
980
|
declare const useGetNotification: () => {
|
|
@@ -1157,4 +1157,4 @@ declare const SAVED_TOKEN_KEY = "savedToken";
|
|
|
1157
1157
|
declare const SAVED_REFRESH_TOKEN_KEY = "savedRefreshToken";
|
|
1158
1158
|
declare const USER_STORAGE_KEY = "authUser";
|
|
1159
1159
|
|
|
1160
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type
|
|
1160
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderFormData, type CreateStallholderInfoFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumOSType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentInfoType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallType, type StallholderAttributes, type StallholderFormData, type StallholderInfoFormData, type StallholderInfoType, type StallholderLocation, type StallholderType, type Subcategory, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserFormData, type UserType, type ValidateVerificationTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, contactUsFields, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderFormValues, defaultStallholderInfoFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentInfo, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesByProximity, stallTypeOptions, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, testersFields, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useContactUs, useContactUsForm, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderInfo, useCreateTester, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useDeleteTester, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderInfo, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetTester, useGetTesters, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUserStallholder, useGetUsers, useLocationSearch, useLogin, useLoginForm, useLogout, useMarketForm, useMarketInfoForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderForm, useStallholderInfoForm, useTestersForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderInfo, useUpdateTester, useUpdateUser, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, validateVerificationTokenFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -322,7 +322,7 @@ type StallholderAttributes = {
|
|
|
322
322
|
details?: string | null;
|
|
323
323
|
isRequired: boolean;
|
|
324
324
|
};
|
|
325
|
-
type
|
|
325
|
+
type StallholderInfoFormData = {
|
|
326
326
|
_id?: string;
|
|
327
327
|
electricity: StallholderAttributes;
|
|
328
328
|
foodSafetyGradeFiles?: string[] | null;
|
|
@@ -342,26 +342,26 @@ type StallholderApplyFormFormData = {
|
|
|
342
342
|
};
|
|
343
343
|
table: StallholderAttributes;
|
|
344
344
|
};
|
|
345
|
-
interface
|
|
346
|
-
control: Control<
|
|
347
|
-
fields:
|
|
345
|
+
interface CreateStallholderInfoFormData {
|
|
346
|
+
control: Control<StallholderInfoFormData, any>;
|
|
347
|
+
fields: StallholderInfoFormData;
|
|
348
348
|
formState: {
|
|
349
|
-
errors: FieldErrors<
|
|
349
|
+
errors: FieldErrors<StallholderInfoFormData>;
|
|
350
350
|
};
|
|
351
|
-
handleSubmit: UseFormHandleSubmit<
|
|
352
|
-
reset: UseFormReset<
|
|
353
|
-
setValue: UseFormSetValue<
|
|
354
|
-
watch: UseFormWatch<
|
|
351
|
+
handleSubmit: UseFormHandleSubmit<StallholderInfoFormData, any>;
|
|
352
|
+
reset: UseFormReset<StallholderInfoFormData>;
|
|
353
|
+
setValue: UseFormSetValue<StallholderInfoFormData>;
|
|
354
|
+
watch: UseFormWatch<StallholderInfoFormData>;
|
|
355
355
|
}
|
|
356
356
|
interface StallholderType extends BaseResourceType {
|
|
357
|
-
|
|
357
|
+
stallholderInfoId: string;
|
|
358
358
|
categories: StallholderFormData["categories"];
|
|
359
359
|
locations: StallholderLocation[] | null;
|
|
360
360
|
multiLocation: boolean;
|
|
361
361
|
products: StallholderFormData["products"];
|
|
362
362
|
specialities: string[] | null;
|
|
363
363
|
}
|
|
364
|
-
type
|
|
364
|
+
type StallholderInfoType = Omit<StallholderInfoFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
|
|
365
365
|
_id: string;
|
|
366
366
|
};
|
|
367
367
|
interface SatllholderWithConnectionDatesType extends StallholderType {
|
|
@@ -666,9 +666,9 @@ declare function useStallholderForm(data?: StallholderFormData): CreateStallhold
|
|
|
666
666
|
* Custom hook to manage the stallholder apply form state and validation.
|
|
667
667
|
*
|
|
668
668
|
* @param {StallholderApplyFormFormData} data - The initial form data.
|
|
669
|
-
* @returns {
|
|
669
|
+
* @returns {CreateStallholderInfoFormData} - The form methods and state.
|
|
670
670
|
*/
|
|
671
|
-
declare function
|
|
671
|
+
declare function useStallholderInfoForm(data?: StallholderInfoFormData): CreateStallholderInfoFormData;
|
|
672
672
|
|
|
673
673
|
/**
|
|
674
674
|
* Custom hook to manage the market form state and validation.
|
|
@@ -718,7 +718,7 @@ declare const globalDefaultValues: BaseResourceTypeFormData;
|
|
|
718
718
|
declare const defaultMarketFormValues: MarketFormData;
|
|
719
719
|
declare const defaultMarketInfoFormValues: MarketInfoFormData;
|
|
720
720
|
declare const defaultStallholderFormValues: StallholderFormData;
|
|
721
|
-
declare const
|
|
721
|
+
declare const defaultStallholderInfoFormValues: StallholderInfoFormData;
|
|
722
722
|
declare function mapBaseResourceTypeToFormData(data: MarketFormData | StallholderFormData): BaseResourceTypeFormData;
|
|
723
723
|
|
|
724
724
|
declare function useTestersForm(data?: TestersFormData): CreateTestersFormData;
|
|
@@ -841,13 +841,13 @@ declare const useGetMarket: (_id: string) => {
|
|
|
841
841
|
declare const useGetMarketsByRegion: (region: string) => {
|
|
842
842
|
error: _apollo_client.ApolloError | undefined;
|
|
843
843
|
loading: boolean;
|
|
844
|
-
|
|
844
|
+
marketsByRegion: MarketType[];
|
|
845
845
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
846
846
|
};
|
|
847
847
|
declare const useSearchMarkets: (search: string, region: string) => {
|
|
848
848
|
error: _apollo_client.ApolloError | undefined;
|
|
849
849
|
loading: boolean;
|
|
850
|
-
|
|
850
|
+
marketsSearch: MarketType[];
|
|
851
851
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
852
852
|
};
|
|
853
853
|
declare const useGetMarketsNearMe: (location: {
|
|
@@ -857,7 +857,7 @@ declare const useGetMarketsNearMe: (location: {
|
|
|
857
857
|
}) => {
|
|
858
858
|
error: _apollo_client.ApolloError | undefined;
|
|
859
859
|
loading: boolean;
|
|
860
|
-
|
|
860
|
+
marketsNearMe: MarketType[];
|
|
861
861
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
862
862
|
};
|
|
863
863
|
declare const useGetMarketInfo: (marketId: string) => {
|
|
@@ -935,15 +935,15 @@ declare const useDeleteStallholder: () => {
|
|
|
935
935
|
error: _apollo_client.ApolloError | undefined;
|
|
936
936
|
loading: boolean;
|
|
937
937
|
};
|
|
938
|
-
declare const
|
|
939
|
-
|
|
938
|
+
declare const useCreateStallholderInfo: () => {
|
|
939
|
+
createStallholderInfo: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
940
940
|
error: _apollo_client.ApolloError | undefined;
|
|
941
941
|
loading: boolean;
|
|
942
942
|
};
|
|
943
|
-
declare const
|
|
943
|
+
declare const useUpdateStallholderInfo: () => {
|
|
944
944
|
error: _apollo_client.ApolloError | undefined;
|
|
945
945
|
loading: boolean;
|
|
946
|
-
|
|
946
|
+
updateStallholderInfo: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
947
947
|
};
|
|
948
948
|
|
|
949
949
|
declare const useGetStallholders: () => {
|
|
@@ -962,19 +962,19 @@ declare const useGetStallholdersByRegion: (region: string) => {
|
|
|
962
962
|
error: _apollo_client.ApolloError | undefined;
|
|
963
963
|
loading: boolean;
|
|
964
964
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
965
|
-
|
|
965
|
+
stallholdersByRegion: StallholderType[];
|
|
966
966
|
};
|
|
967
967
|
declare const useSearchStallholders: (search: string, region: string) => {
|
|
968
968
|
error: _apollo_client.ApolloError | undefined;
|
|
969
969
|
loading: boolean;
|
|
970
970
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
971
|
-
|
|
971
|
+
stallholderSearch: StallholderType[];
|
|
972
972
|
};
|
|
973
|
-
declare const
|
|
974
|
-
applyForm: StallholderApplyFormType;
|
|
973
|
+
declare const useGetStallholderInfo: (stallholderId: string) => {
|
|
975
974
|
error: _apollo_client.ApolloError | undefined;
|
|
976
975
|
loading: boolean;
|
|
977
976
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
977
|
+
stallholderInfo: StallholderInfoType;
|
|
978
978
|
};
|
|
979
979
|
|
|
980
980
|
declare const useGetNotification: () => {
|
|
@@ -1157,4 +1157,4 @@ declare const SAVED_TOKEN_KEY = "savedToken";
|
|
|
1157
1157
|
declare const SAVED_REFRESH_TOKEN_KEY = "savedRefreshToken";
|
|
1158
1158
|
declare const USER_STORAGE_KEY = "authUser";
|
|
1159
1159
|
|
|
1160
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type
|
|
1160
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderFormData, type CreateStallholderInfoFormData, type CreateTestersFormData, type CreateUserFormData, type CreateValidateVerificationTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumOSType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentInfoType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, SAVED_EMAIL_KEY, SAVED_PASSWORD_KEY, SAVED_REFRESH_TOKEN_KEY, SAVED_TOKEN_KEY, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallType, type StallholderAttributes, type StallholderFormData, type StallholderInfoFormData, type StallholderInfoType, type StallholderLocation, type StallholderType, type Subcategory, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserFormData, type UserType, type ValidateVerificationTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, contactUsFields, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderFormValues, defaultStallholderInfoFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentInfo, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesByProximity, stallTypeOptions, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, testersFields, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useContactUs, useContactUsForm, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderInfo, useCreateTester, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useDeleteTester, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderInfo, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetTester, useGetTesters, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUserStallholder, useGetUsers, useLocationSearch, useLogin, useLoginForm, useLogout, useMarketForm, useMarketInfoForm, useRefreshToken, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderForm, useStallholderInfoForm, useTestersForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderInfo, useUpdateTester, useUpdateUser, useUserForm, useValidateVerificationToken, useValidateVerificationTokenForm, validateVerificationTokenFields };
|
package/dist/index.mjs
CHANGED
|
@@ -479,7 +479,7 @@ var stallHolderSchema = globalResourceSchema.shape({
|
|
|
479
479
|
multiLocation: yup3.boolean().required("Multi location is required"),
|
|
480
480
|
products: yup3.array().of(yup3.string().defined()).min(1, "Product list must contain at least one item").required("Products are required")
|
|
481
481
|
});
|
|
482
|
-
var
|
|
482
|
+
var stallholderInfoSchema = yup3.object().shape({
|
|
483
483
|
electricity: yup3.object().shape({
|
|
484
484
|
details: yup3.string().trim().test("details-required", "Please add details", function(value) {
|
|
485
485
|
return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
|
|
@@ -662,7 +662,7 @@ var defaultStallholderFormValues = {
|
|
|
662
662
|
products: [],
|
|
663
663
|
specialities: null
|
|
664
664
|
};
|
|
665
|
-
var
|
|
665
|
+
var defaultStallholderInfoFormValues = {
|
|
666
666
|
electricity: { details: null, isRequired: false },
|
|
667
667
|
foodSafetyGradeFiles: null,
|
|
668
668
|
foodSafetyGradeFilesUpload: null,
|
|
@@ -771,11 +771,11 @@ function useStallholderForm(data) {
|
|
|
771
771
|
};
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
-
// src/hooks/stallholder/
|
|
774
|
+
// src/hooks/stallholder/useStallholderInfoForm.ts
|
|
775
775
|
import { yupResolver as yupResolver2 } from "@hookform/resolvers/yup";
|
|
776
776
|
import * as React2 from "react";
|
|
777
777
|
import { useForm as useForm2 } from "react-hook-form";
|
|
778
|
-
function
|
|
778
|
+
function useStallholderInfoForm(data) {
|
|
779
779
|
const {
|
|
780
780
|
control,
|
|
781
781
|
formState: { errors },
|
|
@@ -785,8 +785,8 @@ function useStallholderApplyForm(data) {
|
|
|
785
785
|
setValue,
|
|
786
786
|
watch
|
|
787
787
|
} = useForm2({
|
|
788
|
-
defaultValues:
|
|
789
|
-
resolver: yupResolver2(
|
|
788
|
+
defaultValues: defaultStallholderInfoFormValues,
|
|
789
|
+
resolver: yupResolver2(stallholderInfoSchema)
|
|
790
790
|
});
|
|
791
791
|
React2.useEffect(() => {
|
|
792
792
|
if (data) {
|
|
@@ -805,7 +805,7 @@ function useStallholderApplyForm(data) {
|
|
|
805
805
|
table: data.table
|
|
806
806
|
});
|
|
807
807
|
} else {
|
|
808
|
-
reset(
|
|
808
|
+
reset(defaultStallholderInfoFormValues);
|
|
809
809
|
}
|
|
810
810
|
}, [data]);
|
|
811
811
|
const {
|
|
@@ -1994,8 +1994,8 @@ var STALLHOLDER = gql7`
|
|
|
1994
1994
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
1995
1995
|
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
1996
1996
|
`;
|
|
1997
|
-
var
|
|
1998
|
-
fragment
|
|
1997
|
+
var STALLHOLDER_INFO = gql7`
|
|
1998
|
+
fragment StallholderInfoFields on StallholderInfoType {
|
|
1999
1999
|
_id
|
|
2000
2000
|
electricity {
|
|
2001
2001
|
details
|
|
@@ -2056,13 +2056,13 @@ var SEARCH_STALLHOLDERS = gql7`
|
|
|
2056
2056
|
}
|
|
2057
2057
|
${STALLHOLDER}
|
|
2058
2058
|
`;
|
|
2059
|
-
var
|
|
2060
|
-
query
|
|
2061
|
-
|
|
2062
|
-
...
|
|
2059
|
+
var GET_STALLHOLDER_INFO = gql7`
|
|
2060
|
+
query getStallholderInfo($stallholderId: ID!) {
|
|
2061
|
+
stallholderInfo(stallholderId: $stallholderId) {
|
|
2062
|
+
...StallholderInfoFields
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
|
-
${
|
|
2065
|
+
${STALLHOLDER_INFO}
|
|
2066
2066
|
`;
|
|
2067
2067
|
|
|
2068
2068
|
// src/graphql/queries/user.ts
|
|
@@ -2224,8 +2224,8 @@ var useGetMarketsByRegion = (region) => {
|
|
|
2224
2224
|
skip: !region,
|
|
2225
2225
|
variables: { region }
|
|
2226
2226
|
});
|
|
2227
|
-
const
|
|
2228
|
-
return { error, loading,
|
|
2227
|
+
const marketsByRegion = data?.marketsByRegion;
|
|
2228
|
+
return { error, loading, marketsByRegion, refetch };
|
|
2229
2229
|
};
|
|
2230
2230
|
var useSearchMarkets = (search, region) => {
|
|
2231
2231
|
const { loading, error, data, refetch } = useQuery2(SEARCH_MARKETS, {
|
|
@@ -2233,8 +2233,8 @@ var useSearchMarkets = (search, region) => {
|
|
|
2233
2233
|
skip: search.length < 3,
|
|
2234
2234
|
variables: { region, search }
|
|
2235
2235
|
});
|
|
2236
|
-
const
|
|
2237
|
-
return { error, loading,
|
|
2236
|
+
const marketsSearch = data?.marketSearch;
|
|
2237
|
+
return { error, loading, marketsSearch, refetch };
|
|
2238
2238
|
};
|
|
2239
2239
|
var useGetMarketsNearMe = (location) => {
|
|
2240
2240
|
const { loading, error, data, refetch } = useQuery2(GET_MARKETS_NEAR_ME, {
|
|
@@ -2247,8 +2247,8 @@ var useGetMarketsNearMe = (location) => {
|
|
|
2247
2247
|
// Default to 10km if no radius is provided
|
|
2248
2248
|
}
|
|
2249
2249
|
});
|
|
2250
|
-
const
|
|
2251
|
-
return { error, loading,
|
|
2250
|
+
const marketsNearMe = data?.marketsNearMe;
|
|
2251
|
+
return { error, loading, marketsNearMe, refetch };
|
|
2252
2252
|
};
|
|
2253
2253
|
var useGetMarketInfo = (marketId) => {
|
|
2254
2254
|
const { loading, error, data, refetch } = useQuery2(GET_MARKET_INFO, {
|
|
@@ -2602,6 +2602,9 @@ var useDeleteRelation = () => {
|
|
|
2602
2602
|
{
|
|
2603
2603
|
query: GET_RELATION_BY_MARKET_AND_STALLHOLDER,
|
|
2604
2604
|
variables: { marketId, stallholderId }
|
|
2605
|
+
},
|
|
2606
|
+
{
|
|
2607
|
+
query: USER_CHATS
|
|
2605
2608
|
}
|
|
2606
2609
|
];
|
|
2607
2610
|
}
|
|
@@ -2689,24 +2692,21 @@ var DELETE_STALLHOLDER_MUTATION = gql12`
|
|
|
2689
2692
|
deleteStallholder(_id: $_id)
|
|
2690
2693
|
}
|
|
2691
2694
|
`;
|
|
2692
|
-
var
|
|
2693
|
-
mutation
|
|
2694
|
-
|
|
2695
|
-
...
|
|
2695
|
+
var CREATE_STALLHOLDER_INFO_MUTATION = gql12`
|
|
2696
|
+
mutation createStallholderInfo($input: StallholderInfoInputType!) {
|
|
2697
|
+
createStallholderInfo(input: $input) {
|
|
2698
|
+
...StallholderInfoFields
|
|
2696
2699
|
}
|
|
2697
2700
|
}
|
|
2698
|
-
${
|
|
2701
|
+
${STALLHOLDER_INFO}
|
|
2699
2702
|
`;
|
|
2700
|
-
var
|
|
2701
|
-
mutation
|
|
2702
|
-
$_id:
|
|
2703
|
-
|
|
2704
|
-
) {
|
|
2705
|
-
updateStallholderApplyForm(_id: $_id, input: $input) {
|
|
2706
|
-
...StallholderApplyFormFields
|
|
2703
|
+
var UPDATE_STALLHOLDER_INFO_MUTATION = gql12`
|
|
2704
|
+
mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
|
|
2705
|
+
updateStallholderInfo(_id: $_id, input: $input) {
|
|
2706
|
+
...StallholderInfoFields
|
|
2707
2707
|
}
|
|
2708
2708
|
}
|
|
2709
|
-
${
|
|
2709
|
+
${STALLHOLDER_INFO}
|
|
2710
2710
|
`;
|
|
2711
2711
|
|
|
2712
2712
|
// src/graphql/hooks/stallholder/hooksMutation.ts
|
|
@@ -2749,17 +2749,17 @@ var useDeleteStallholder = () => {
|
|
|
2749
2749
|
);
|
|
2750
2750
|
return { deleteStallholder, error, loading };
|
|
2751
2751
|
};
|
|
2752
|
-
var
|
|
2753
|
-
const [
|
|
2754
|
-
|
|
2752
|
+
var useCreateStallholderInfo = () => {
|
|
2753
|
+
const [createStallholderInfo, { loading, error }] = useMutation6(
|
|
2754
|
+
CREATE_STALLHOLDER_INFO_MUTATION,
|
|
2755
2755
|
{
|
|
2756
2756
|
awaitRefetchQueries: true,
|
|
2757
2757
|
refetchQueries: (mutationResult) => {
|
|
2758
|
-
const stallholderId = mutationResult?.data?.
|
|
2758
|
+
const stallholderId = mutationResult?.data?.createStallholderInfo?.stallholderId;
|
|
2759
2759
|
if (!stallholderId) return [];
|
|
2760
2760
|
return [
|
|
2761
2761
|
{
|
|
2762
|
-
query:
|
|
2762
|
+
query: GET_STALLHOLDER_INFO,
|
|
2763
2763
|
variables: { stallholderId }
|
|
2764
2764
|
// Pass the stallholderId for refetching
|
|
2765
2765
|
}
|
|
@@ -2767,19 +2767,19 @@ var useCreateStallholderApplyForm = () => {
|
|
|
2767
2767
|
}
|
|
2768
2768
|
}
|
|
2769
2769
|
);
|
|
2770
|
-
return {
|
|
2770
|
+
return { createStallholderInfo, error, loading };
|
|
2771
2771
|
};
|
|
2772
|
-
var
|
|
2773
|
-
const [
|
|
2774
|
-
|
|
2772
|
+
var useUpdateStallholderInfo = () => {
|
|
2773
|
+
const [updateStallholderInfo, { loading, error }] = useMutation6(
|
|
2774
|
+
UPDATE_STALLHOLDER_INFO_MUTATION,
|
|
2775
2775
|
{
|
|
2776
2776
|
awaitRefetchQueries: true,
|
|
2777
2777
|
refetchQueries: (mutationResult) => {
|
|
2778
|
-
const stallholderId = mutationResult?.data?.
|
|
2778
|
+
const stallholderId = mutationResult?.data?.updateStallholderInfo?.stallholderId;
|
|
2779
2779
|
if (!stallholderId) return [];
|
|
2780
2780
|
return [
|
|
2781
2781
|
{
|
|
2782
|
-
query:
|
|
2782
|
+
query: GET_STALLHOLDER_INFO,
|
|
2783
2783
|
variables: { stallholderId }
|
|
2784
2784
|
// Pass the stallholderId for refetching
|
|
2785
2785
|
}
|
|
@@ -2787,7 +2787,7 @@ var useUpdateStallholderApplyForm = () => {
|
|
|
2787
2787
|
}
|
|
2788
2788
|
}
|
|
2789
2789
|
);
|
|
2790
|
-
return { error, loading,
|
|
2790
|
+
return { error, loading, updateStallholderInfo };
|
|
2791
2791
|
};
|
|
2792
2792
|
|
|
2793
2793
|
// src/graphql/hooks/stallholder/hooksQuery.ts
|
|
@@ -2822,8 +2822,8 @@ var useGetStallholdersByRegion = (region) => {
|
|
|
2822
2822
|
variables: { region }
|
|
2823
2823
|
}
|
|
2824
2824
|
);
|
|
2825
|
-
const
|
|
2826
|
-
return { error, loading, refetch,
|
|
2825
|
+
const stallholdersByRegion = data?.stallholdersByRegion;
|
|
2826
|
+
return { error, loading, refetch, stallholdersByRegion };
|
|
2827
2827
|
};
|
|
2828
2828
|
var useSearchStallholders = (search, region) => {
|
|
2829
2829
|
const { loading, error, data, refetch } = useQuery4(SEARCH_STALLHOLDERS, {
|
|
@@ -2831,24 +2831,21 @@ var useSearchStallholders = (search, region) => {
|
|
|
2831
2831
|
skip: search.length < 3,
|
|
2832
2832
|
variables: { region, search }
|
|
2833
2833
|
});
|
|
2834
|
-
const
|
|
2835
|
-
return { error, loading, refetch,
|
|
2834
|
+
const stallholderSearch = data?.stallholderSearch;
|
|
2835
|
+
return { error, loading, refetch, stallholderSearch };
|
|
2836
2836
|
};
|
|
2837
|
-
var
|
|
2838
|
-
const { loading, error, data, refetch } = useQuery4(
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
}
|
|
2845
|
-
);
|
|
2846
|
-
const applyForm = data?.stallholderApplyForm;
|
|
2837
|
+
var useGetStallholderInfo = (stallholderId) => {
|
|
2838
|
+
const { loading, error, data, refetch } = useQuery4(GET_STALLHOLDER_INFO, {
|
|
2839
|
+
fetchPolicy: "network-only",
|
|
2840
|
+
skip: !stallholderId,
|
|
2841
|
+
variables: { stallholderId }
|
|
2842
|
+
});
|
|
2843
|
+
const stallholderInfo = data?.stallholderInfo;
|
|
2847
2844
|
return {
|
|
2848
|
-
applyForm,
|
|
2849
2845
|
error,
|
|
2850
2846
|
loading,
|
|
2851
|
-
refetch
|
|
2847
|
+
refetch,
|
|
2848
|
+
stallholderInfo
|
|
2852
2849
|
};
|
|
2853
2850
|
};
|
|
2854
2851
|
|
|
@@ -3258,7 +3255,7 @@ var availableCityTypes = [
|
|
|
3258
3255
|
];
|
|
3259
3256
|
var availableCityOptions = mapArrayToOptions(availableCityTypes);
|
|
3260
3257
|
|
|
3261
|
-
// src/formFields/stallholder/
|
|
3258
|
+
// src/formFields/stallholder/stallholderInfo.ts
|
|
3262
3259
|
var stallholderElectricity = {
|
|
3263
3260
|
details: {
|
|
3264
3261
|
helperText: "Please describe details e.g. amps, voltage, etc.",
|
|
@@ -4241,8 +4238,8 @@ export {
|
|
|
4241
4238
|
defaultMarketFormValues,
|
|
4242
4239
|
defaultMarketInfoFormValues,
|
|
4243
4240
|
defaultRegion,
|
|
4244
|
-
defaultStallholderApplyFormValues,
|
|
4245
4241
|
defaultStallholderFormValues,
|
|
4242
|
+
defaultStallholderInfoFormValues,
|
|
4246
4243
|
formatDate,
|
|
4247
4244
|
formatTimestamp,
|
|
4248
4245
|
getCurrentAndFutureDates,
|
|
@@ -4298,7 +4295,7 @@ export {
|
|
|
4298
4295
|
useCreatePoster,
|
|
4299
4296
|
useCreateRelation,
|
|
4300
4297
|
useCreateStallholder,
|
|
4301
|
-
|
|
4298
|
+
useCreateStallholderInfo,
|
|
4302
4299
|
useCreateTester,
|
|
4303
4300
|
useCreateUser,
|
|
4304
4301
|
useDeleteChat,
|
|
@@ -4319,7 +4316,7 @@ export {
|
|
|
4319
4316
|
useGetRelationByMarketAndStallholder,
|
|
4320
4317
|
useGetResourceConnections,
|
|
4321
4318
|
useGetStallholder,
|
|
4322
|
-
|
|
4319
|
+
useGetStallholderInfo,
|
|
4323
4320
|
useGetStallholderRelations,
|
|
4324
4321
|
useGetStallholders,
|
|
4325
4322
|
useGetStallholdersByRegion,
|
|
@@ -4350,14 +4347,14 @@ export {
|
|
|
4350
4347
|
useSearchMarkets,
|
|
4351
4348
|
useSearchStallholders,
|
|
4352
4349
|
useSendChatMessage,
|
|
4353
|
-
useStallholderApplyForm,
|
|
4354
4350
|
useStallholderForm,
|
|
4351
|
+
useStallholderInfoForm,
|
|
4355
4352
|
useTestersForm,
|
|
4356
4353
|
useUpdateMarket,
|
|
4357
4354
|
useUpdateMarketInfo,
|
|
4358
4355
|
useUpdateRelation,
|
|
4359
4356
|
useUpdateStallholder,
|
|
4360
|
-
|
|
4357
|
+
useUpdateStallholderInfo,
|
|
4361
4358
|
useUpdateTester,
|
|
4362
4359
|
useUpdateUser,
|
|
4363
4360
|
useUserForm,
|