@timardex/cluemart-shared 1.0.85 → 1.0.87
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/graphql/index.cjs +127 -108
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +19 -7
- package/dist/graphql/index.d.ts +19 -7
- package/dist/graphql/index.mjs +58 -40
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/index.cjs +127 -108
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +20 -11
- package/dist/index.d.ts +20 -11
- package/dist/index.mjs +58 -40
- package/dist/index.mjs.map +1 -1
- package/dist/{notification-DDVH6HnE.d.mts → notification-CmjfP3gD.d.mts} +3 -6
- package/dist/{notification-DDVH6HnE.d.ts → notification-CmjfP3gD.d.ts} +3 -6
- 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.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -562,16 +562,13 @@ type NotificationCount = {
|
|
|
562
562
|
total: number;
|
|
563
563
|
unread: number;
|
|
564
564
|
};
|
|
565
|
-
type
|
|
566
|
-
|
|
565
|
+
type CreateBulkNotificationInput = {
|
|
566
|
+
userIds: string[];
|
|
567
567
|
title: string;
|
|
568
568
|
message: string;
|
|
569
569
|
type?: EnumNotificationType;
|
|
570
570
|
data?: Record<string, unknown>;
|
|
571
571
|
};
|
|
572
|
-
type CreateBulkNotificationInput = Omit<CreateNotificationInput, "userId"> & {
|
|
573
|
-
userIds: string[];
|
|
574
|
-
};
|
|
575
572
|
type MarkNotificationReadInput = {
|
|
576
573
|
notificationIds: string[];
|
|
577
574
|
};
|
|
@@ -830,11 +827,6 @@ declare const useGetMarketInfo: (marketId: string) => {
|
|
|
830
827
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
831
828
|
};
|
|
832
829
|
|
|
833
|
-
declare const useCreateNotification: () => {
|
|
834
|
-
createNotification: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
835
|
-
error: _apollo_client.ApolloError | undefined;
|
|
836
|
-
loading: boolean;
|
|
837
|
-
};
|
|
838
830
|
declare const useCreateBulkNotifications: () => {
|
|
839
831
|
createBulkNotifications: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
840
832
|
error: _apollo_client.ApolloError | undefined;
|
|
@@ -856,6 +848,23 @@ declare const useDeleteNotification: () => {
|
|
|
856
848
|
loading: boolean;
|
|
857
849
|
};
|
|
858
850
|
|
|
851
|
+
declare const useGetUserNotifications: (userId: string, limit?: number, offset?: number) => {
|
|
852
|
+
error: _apollo_client.ApolloError | undefined;
|
|
853
|
+
loading: boolean;
|
|
854
|
+
notifications: NotificationType[];
|
|
855
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
856
|
+
userNotifications: NotificationType[];
|
|
857
|
+
}>>;
|
|
858
|
+
};
|
|
859
|
+
declare const useGetNotificationCount: (userId: string) => {
|
|
860
|
+
error: _apollo_client.ApolloError | undefined;
|
|
861
|
+
loading: boolean;
|
|
862
|
+
notificationCount: NotificationCount;
|
|
863
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
864
|
+
notificationCount: NotificationCount;
|
|
865
|
+
}>>;
|
|
866
|
+
};
|
|
867
|
+
|
|
859
868
|
declare const useGetUserNotificationsSubscription: (userId: string) => {
|
|
860
869
|
error: _apollo_client.ApolloError | undefined;
|
|
861
870
|
loading: boolean;
|
|
@@ -1262,4 +1271,4 @@ declare const availableRegionOptions: OptionItem[];
|
|
|
1262
1271
|
declare const paymentMethodOptions: OptionItem[];
|
|
1263
1272
|
declare function normalizeUrl(url: string): string;
|
|
1264
1273
|
|
|
1265
|
-
export { type AdminUpdateResourceType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type
|
|
1274
|
+
export { type AdminUpdateResourceType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateBulkNotificationInput, 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, EnumNotificationType, EnumOSType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarkAllNotificationsReadInput, type MarkNotificationReadInput, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationCount, type NotificationType, type Nullable, type OptionItem, type PaymentInfoType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, 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 SubcategoryItems, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserFormData, type UserType, type ValidateVerificationTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, contactUsFields, darkColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderFormValues, defaultStallholderInfoFormValues, fonts, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentInfo, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesChronologically, stallTypeOptions, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, testersFields, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useAdminUpdateResourceType, useContactUs, useContactUsForm, useCreateBulkNotifications, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateStallholder, useCreateStallholderInfo, useCreateTester, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteNotification, useDeleteRelation, useDeleteStallholder, useDeleteTester, useDeleteUser, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderInfo, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetTester, useGetTesters, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserStallholder, useGetUsers, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, 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
|
@@ -562,16 +562,13 @@ type NotificationCount = {
|
|
|
562
562
|
total: number;
|
|
563
563
|
unread: number;
|
|
564
564
|
};
|
|
565
|
-
type
|
|
566
|
-
|
|
565
|
+
type CreateBulkNotificationInput = {
|
|
566
|
+
userIds: string[];
|
|
567
567
|
title: string;
|
|
568
568
|
message: string;
|
|
569
569
|
type?: EnumNotificationType;
|
|
570
570
|
data?: Record<string, unknown>;
|
|
571
571
|
};
|
|
572
|
-
type CreateBulkNotificationInput = Omit<CreateNotificationInput, "userId"> & {
|
|
573
|
-
userIds: string[];
|
|
574
|
-
};
|
|
575
572
|
type MarkNotificationReadInput = {
|
|
576
573
|
notificationIds: string[];
|
|
577
574
|
};
|
|
@@ -830,11 +827,6 @@ declare const useGetMarketInfo: (marketId: string) => {
|
|
|
830
827
|
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<any>>;
|
|
831
828
|
};
|
|
832
829
|
|
|
833
|
-
declare const useCreateNotification: () => {
|
|
834
|
-
createNotification: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
835
|
-
error: _apollo_client.ApolloError | undefined;
|
|
836
|
-
loading: boolean;
|
|
837
|
-
};
|
|
838
830
|
declare const useCreateBulkNotifications: () => {
|
|
839
831
|
createBulkNotifications: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
840
832
|
error: _apollo_client.ApolloError | undefined;
|
|
@@ -856,6 +848,23 @@ declare const useDeleteNotification: () => {
|
|
|
856
848
|
loading: boolean;
|
|
857
849
|
};
|
|
858
850
|
|
|
851
|
+
declare const useGetUserNotifications: (userId: string, limit?: number, offset?: number) => {
|
|
852
|
+
error: _apollo_client.ApolloError | undefined;
|
|
853
|
+
loading: boolean;
|
|
854
|
+
notifications: NotificationType[];
|
|
855
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
856
|
+
userNotifications: NotificationType[];
|
|
857
|
+
}>>;
|
|
858
|
+
};
|
|
859
|
+
declare const useGetNotificationCount: (userId: string) => {
|
|
860
|
+
error: _apollo_client.ApolloError | undefined;
|
|
861
|
+
loading: boolean;
|
|
862
|
+
notificationCount: NotificationCount;
|
|
863
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
864
|
+
notificationCount: NotificationCount;
|
|
865
|
+
}>>;
|
|
866
|
+
};
|
|
867
|
+
|
|
859
868
|
declare const useGetUserNotificationsSubscription: (userId: string) => {
|
|
860
869
|
error: _apollo_client.ApolloError | undefined;
|
|
861
870
|
loading: boolean;
|
|
@@ -1262,4 +1271,4 @@ declare const availableRegionOptions: OptionItem[];
|
|
|
1262
1271
|
declare const paymentMethodOptions: OptionItem[];
|
|
1263
1272
|
declare function normalizeUrl(url: string): string;
|
|
1264
1273
|
|
|
1265
|
-
export { type AdminUpdateResourceType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateBulkNotificationInput, type CreateContactUsFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type
|
|
1274
|
+
export { type AdminUpdateResourceType, type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type ContactUsFormData, type CreateBulkNotificationInput, 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, EnumNotificationType, EnumOSType, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarkAllNotificationsReadInput, type MarkNotificationReadInput, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationCount, type NotificationType, type Nullable, type OptionItem, type PaymentInfoType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, 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 SubcategoryItems, type TesterType, type TestersFormData, USER_STORAGE_KEY, type UserFormData, type UserType, type ValidateVerificationTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, contactUsFields, darkColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderFormValues, defaultStallholderInfoFormValues, fonts, formatDate, formatTimestamp, getCurrentAndFutureDates, globalDefaultValues, isFutureDatesBeforeThreshold, lightColors, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentInfo, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesChronologically, stallTypeOptions, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, testersFields, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useAdminUpdateResourceType, useContactUs, useContactUsForm, useCreateBulkNotifications, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreatePushToken, useCreateRelation, useCreateStallholder, useCreateStallholderInfo, useCreateTester, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteNotification, useDeleteRelation, useDeleteStallholder, useDeleteTester, useDeleteUser, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotificationCount, useGetNotificationCountSubscription, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderInfo, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetTester, useGetTesters, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUserNotificationsSubscription, useGetUserStallholder, useGetUsers, useLocationSearch, useLogin, useLoginForm, useLogout, useMarkAllNotificationsRead, useMarkNotificationRead, 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
|
@@ -2771,7 +2771,7 @@ var USER_NOTIFICATION_FRAGMENT = gql11`
|
|
|
2771
2771
|
}
|
|
2772
2772
|
`;
|
|
2773
2773
|
var GET_USER_NOTIFICATIONS = gql11`
|
|
2774
|
-
query getUserNotifications($userId:
|
|
2774
|
+
query getUserNotifications($userId: ID!, $limit: Int, $offset: Int) {
|
|
2775
2775
|
userNotifications(userId: $userId, limit: $limit, offset: $offset) {
|
|
2776
2776
|
...UserNotificationFields
|
|
2777
2777
|
}
|
|
@@ -2779,7 +2779,7 @@ var GET_USER_NOTIFICATIONS = gql11`
|
|
|
2779
2779
|
${USER_NOTIFICATION_FRAGMENT}
|
|
2780
2780
|
`;
|
|
2781
2781
|
var GET_NOTIFICATION_COUNT = gql11`
|
|
2782
|
-
query getNotificationCount($userId:
|
|
2782
|
+
query getNotificationCount($userId: ID!) {
|
|
2783
2783
|
notificationCount(userId: $userId) {
|
|
2784
2784
|
total
|
|
2785
2785
|
unread
|
|
@@ -2788,14 +2788,6 @@ var GET_NOTIFICATION_COUNT = gql11`
|
|
|
2788
2788
|
`;
|
|
2789
2789
|
|
|
2790
2790
|
// src/graphql/mutations/notification.ts
|
|
2791
|
-
var CREATE_NOTIFICATION = gql12`
|
|
2792
|
-
mutation createNotification($input: CreateNotificationInput!) {
|
|
2793
|
-
createNotification(input: $input) {
|
|
2794
|
-
...UserNotificationFields
|
|
2795
|
-
}
|
|
2796
|
-
}
|
|
2797
|
-
${USER_NOTIFICATION_FRAGMENT}
|
|
2798
|
-
`;
|
|
2799
2791
|
var CREATE_BULK_NOTIFICATIONS = gql12`
|
|
2800
2792
|
mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
|
|
2801
2793
|
createBulkNotifications(input: $input) {
|
|
@@ -2818,16 +2810,12 @@ var MARK_ALL_NOTIFICATIONS_READ = gql12`
|
|
|
2818
2810
|
}
|
|
2819
2811
|
`;
|
|
2820
2812
|
var DELETE_NOTIFICATION = gql12`
|
|
2821
|
-
mutation deleteNotification($
|
|
2822
|
-
deleteNotification(
|
|
2813
|
+
mutation deleteNotification($input: DeleteNotificationInput!) {
|
|
2814
|
+
deleteNotification(input: $input)
|
|
2823
2815
|
}
|
|
2824
2816
|
`;
|
|
2825
2817
|
|
|
2826
2818
|
// src/graphql/hooks/notifications/hooksMutation.ts
|
|
2827
|
-
var useCreateNotification = () => {
|
|
2828
|
-
const [createNotification, { loading, error }] = useMutation6(CREATE_NOTIFICATION);
|
|
2829
|
-
return { createNotification, error, loading };
|
|
2830
|
-
};
|
|
2831
2819
|
var useCreateBulkNotifications = () => {
|
|
2832
2820
|
const [createBulkNotifications, { loading, error }] = useMutation6(
|
|
2833
2821
|
CREATE_BULK_NOTIFICATIONS
|
|
@@ -2862,6 +2850,35 @@ var useDeleteNotification = () => {
|
|
|
2862
2850
|
return { deleteNotification, error, loading };
|
|
2863
2851
|
};
|
|
2864
2852
|
|
|
2853
|
+
// src/graphql/hooks/notifications/hooksQuery.ts
|
|
2854
|
+
import { useQuery as useQuery3 } from "@apollo/client";
|
|
2855
|
+
var useGetUserNotifications = (userId, limit, offset) => {
|
|
2856
|
+
const { data, loading, error, refetch } = useQuery3(GET_USER_NOTIFICATIONS, {
|
|
2857
|
+
fetchPolicy: "cache-and-network",
|
|
2858
|
+
skip: !userId,
|
|
2859
|
+
variables: { limit, offset, userId }
|
|
2860
|
+
});
|
|
2861
|
+
return {
|
|
2862
|
+
error,
|
|
2863
|
+
loading,
|
|
2864
|
+
notifications: data?.userNotifications || [],
|
|
2865
|
+
refetch
|
|
2866
|
+
};
|
|
2867
|
+
};
|
|
2868
|
+
var useGetNotificationCount = (userId) => {
|
|
2869
|
+
const { data, loading, error, refetch } = useQuery3(GET_NOTIFICATION_COUNT, {
|
|
2870
|
+
fetchPolicy: "cache-and-network",
|
|
2871
|
+
skip: !userId,
|
|
2872
|
+
variables: { userId }
|
|
2873
|
+
});
|
|
2874
|
+
return {
|
|
2875
|
+
error,
|
|
2876
|
+
loading,
|
|
2877
|
+
notificationCount: data?.notificationCount || { total: 0, unread: 0 },
|
|
2878
|
+
refetch
|
|
2879
|
+
};
|
|
2880
|
+
};
|
|
2881
|
+
|
|
2865
2882
|
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
2866
2883
|
import { useSubscription as useSubscription2 } from "@apollo/client";
|
|
2867
2884
|
|
|
@@ -2881,7 +2898,7 @@ var USER_NOTIFICATION_FRAGMENT2 = gql13`
|
|
|
2881
2898
|
}
|
|
2882
2899
|
`;
|
|
2883
2900
|
var GET_USER_NOTIFICATIONS_SUBSCRIPTION = gql13`
|
|
2884
|
-
subscription getUserNotifications($userId:
|
|
2901
|
+
subscription getUserNotifications($userId: ID!) {
|
|
2885
2902
|
getUserNotifications(userId: $userId) {
|
|
2886
2903
|
...UserNotificationFields
|
|
2887
2904
|
}
|
|
@@ -2889,7 +2906,7 @@ var GET_USER_NOTIFICATIONS_SUBSCRIPTION = gql13`
|
|
|
2889
2906
|
${USER_NOTIFICATION_FRAGMENT2}
|
|
2890
2907
|
`;
|
|
2891
2908
|
var GET_NOTIFICATION_COUNT_SUBSCRIPTION = gql13`
|
|
2892
|
-
subscription getNotificationCount($userId:
|
|
2909
|
+
subscription getNotificationCount($userId: ID!) {
|
|
2893
2910
|
getNotificationCount(userId: $userId) {
|
|
2894
2911
|
total
|
|
2895
2912
|
unread
|
|
@@ -3316,9 +3333,9 @@ var useDeleteRelation = () => {
|
|
|
3316
3333
|
};
|
|
3317
3334
|
|
|
3318
3335
|
// src/graphql/hooks/relation/hooksQuery.ts
|
|
3319
|
-
import { useQuery as
|
|
3336
|
+
import { useQuery as useQuery4 } from "@apollo/client";
|
|
3320
3337
|
var useGetRelation = (id) => {
|
|
3321
|
-
const { loading, error, data, refetch } =
|
|
3338
|
+
const { loading, error, data, refetch } = useQuery4(GET_RELATION, {
|
|
3322
3339
|
fetchPolicy: "network-only",
|
|
3323
3340
|
skip: id === "",
|
|
3324
3341
|
variables: { id }
|
|
@@ -3327,7 +3344,7 @@ var useGetRelation = (id) => {
|
|
|
3327
3344
|
return { error, loading, refetch, relation };
|
|
3328
3345
|
};
|
|
3329
3346
|
var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
3330
|
-
const { loading, error, data, refetch } =
|
|
3347
|
+
const { loading, error, data, refetch } = useQuery4(
|
|
3331
3348
|
GET_RELATION_BY_MARKET_AND_STALLHOLDER,
|
|
3332
3349
|
{
|
|
3333
3350
|
fetchPolicy: "network-only",
|
|
@@ -3339,7 +3356,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
|
3339
3356
|
return { error, loading, refetch, relationByMarketAndStallholder };
|
|
3340
3357
|
};
|
|
3341
3358
|
var useGetMarketRelations = (marketId) => {
|
|
3342
|
-
const { loading, error, data, refetch } =
|
|
3359
|
+
const { loading, error, data, refetch } = useQuery4(GET_MARKET_RELATIONS, {
|
|
3343
3360
|
fetchPolicy: "network-only",
|
|
3344
3361
|
skip: marketId === "",
|
|
3345
3362
|
variables: { marketId }
|
|
@@ -3348,7 +3365,7 @@ var useGetMarketRelations = (marketId) => {
|
|
|
3348
3365
|
return { error, loading, marketRelations, refetch };
|
|
3349
3366
|
};
|
|
3350
3367
|
var useGetStallholderRelations = (stallholderId) => {
|
|
3351
|
-
const { loading, error, data, refetch } =
|
|
3368
|
+
const { loading, error, data, refetch } = useQuery4(
|
|
3352
3369
|
GET_STALLHOLDER_RELATIONS,
|
|
3353
3370
|
{
|
|
3354
3371
|
fetchPolicy: "network-only",
|
|
@@ -3360,7 +3377,7 @@ var useGetStallholderRelations = (stallholderId) => {
|
|
|
3360
3377
|
return { error, loading, refetch, stallholderRelations };
|
|
3361
3378
|
};
|
|
3362
3379
|
var useGetResourceConnections = (resourceId, resourceType) => {
|
|
3363
|
-
const { loading, error, data, refetch } =
|
|
3380
|
+
const { loading, error, data, refetch } = useQuery4(GET_RESOURCE_CONNECTIONS, {
|
|
3364
3381
|
fetchPolicy: "network-only",
|
|
3365
3382
|
variables: { resourceId, resourceType }
|
|
3366
3383
|
});
|
|
@@ -3494,9 +3511,9 @@ var useUpdateStallholderInfo = () => {
|
|
|
3494
3511
|
};
|
|
3495
3512
|
|
|
3496
3513
|
// src/graphql/hooks/stallholder/hooksQuery.ts
|
|
3497
|
-
import { useQuery as
|
|
3514
|
+
import { useQuery as useQuery5 } from "@apollo/client";
|
|
3498
3515
|
var useGetStallholders = () => {
|
|
3499
|
-
const { loading, error, data, refetch } =
|
|
3516
|
+
const { loading, error, data, refetch } = useQuery5(GET_STALLHOLDERS, {
|
|
3500
3517
|
fetchPolicy: "network-only"
|
|
3501
3518
|
});
|
|
3502
3519
|
const stallholders = data?.stallholders;
|
|
@@ -3508,7 +3525,7 @@ var useGetStallholders = () => {
|
|
|
3508
3525
|
};
|
|
3509
3526
|
};
|
|
3510
3527
|
var useGetStallholder = (_id) => {
|
|
3511
|
-
const { loading, error, data, refetch } =
|
|
3528
|
+
const { loading, error, data, refetch } = useQuery5(GET_STALLHOLDER, {
|
|
3512
3529
|
fetchPolicy: "network-only",
|
|
3513
3530
|
skip: !_id,
|
|
3514
3531
|
variables: { _id }
|
|
@@ -3517,7 +3534,7 @@ var useGetStallholder = (_id) => {
|
|
|
3517
3534
|
return { error, loading, refetch, stallholder };
|
|
3518
3535
|
};
|
|
3519
3536
|
var useGetStallholdersByRegion = (region) => {
|
|
3520
|
-
const { loading, error, data, refetch } =
|
|
3537
|
+
const { loading, error, data, refetch } = useQuery5(
|
|
3521
3538
|
GET_STALLHOLDERS_BY_REGION,
|
|
3522
3539
|
{
|
|
3523
3540
|
fetchPolicy: "no-cache",
|
|
@@ -3529,7 +3546,7 @@ var useGetStallholdersByRegion = (region) => {
|
|
|
3529
3546
|
return { error, loading, refetch, stallholdersByRegion };
|
|
3530
3547
|
};
|
|
3531
3548
|
var useSearchStallholders = (search, region) => {
|
|
3532
|
-
const { loading, error, data, refetch } =
|
|
3549
|
+
const { loading, error, data, refetch } = useQuery5(SEARCH_STALLHOLDERS, {
|
|
3533
3550
|
fetchPolicy: "network-only",
|
|
3534
3551
|
skip: search.length < 3,
|
|
3535
3552
|
variables: { region, search }
|
|
@@ -3538,7 +3555,7 @@ var useSearchStallholders = (search, region) => {
|
|
|
3538
3555
|
return { error, loading, refetch, stallholderSearch };
|
|
3539
3556
|
};
|
|
3540
3557
|
var useGetStallholderInfo = (stallholderId) => {
|
|
3541
|
-
const { loading, error, data, refetch } =
|
|
3558
|
+
const { loading, error, data, refetch } = useQuery5(GET_STALLHOLDER_INFO, {
|
|
3542
3559
|
fetchPolicy: "network-only",
|
|
3543
3560
|
skip: !stallholderId,
|
|
3544
3561
|
variables: { stallholderId }
|
|
@@ -3644,9 +3661,9 @@ var useDeleteTester = () => {
|
|
|
3644
3661
|
};
|
|
3645
3662
|
|
|
3646
3663
|
// src/graphql/hooks/testers/hooksQuery.ts
|
|
3647
|
-
import { useQuery as
|
|
3664
|
+
import { useQuery as useQuery6 } from "@apollo/client";
|
|
3648
3665
|
var useGetTesters = () => {
|
|
3649
|
-
const { data, loading, error, refetch } =
|
|
3666
|
+
const { data, loading, error, refetch } = useQuery6(GET_TESTERS);
|
|
3650
3667
|
const testers = data?.testers;
|
|
3651
3668
|
return {
|
|
3652
3669
|
error,
|
|
@@ -3656,7 +3673,7 @@ var useGetTesters = () => {
|
|
|
3656
3673
|
};
|
|
3657
3674
|
};
|
|
3658
3675
|
var useGetTester = (_id) => {
|
|
3659
|
-
const { data, loading, error, refetch } =
|
|
3676
|
+
const { data, loading, error, refetch } = useQuery6(GET_TESTER, {
|
|
3660
3677
|
skip: !_id,
|
|
3661
3678
|
variables: { _id }
|
|
3662
3679
|
});
|
|
@@ -3765,37 +3782,37 @@ var useRemoveUserFavouriteResource = () => {
|
|
|
3765
3782
|
};
|
|
3766
3783
|
|
|
3767
3784
|
// src/graphql/hooks/user/hooksQuery.ts
|
|
3768
|
-
import { useQuery as
|
|
3785
|
+
import { useQuery as useQuery7 } from "@apollo/client";
|
|
3769
3786
|
var useGetUsers = () => {
|
|
3770
|
-
const { loading, error, data, refetch } =
|
|
3787
|
+
const { loading, error, data, refetch } = useQuery7(GET_USERS, {
|
|
3771
3788
|
fetchPolicy: "network-only"
|
|
3772
3789
|
});
|
|
3773
3790
|
const users = data?.users;
|
|
3774
3791
|
return { error, loading, refetch, users };
|
|
3775
3792
|
};
|
|
3776
3793
|
var useGetUser = (_id) => {
|
|
3777
|
-
const { loading, error, data, refetch } =
|
|
3794
|
+
const { loading, error, data, refetch } = useQuery7(GET_USER, {
|
|
3778
3795
|
variables: { _id }
|
|
3779
3796
|
});
|
|
3780
3797
|
const user = data?.user;
|
|
3781
3798
|
return { error, loading, refetch, user };
|
|
3782
3799
|
};
|
|
3783
3800
|
var useGetUserMarkets = () => {
|
|
3784
|
-
const { loading, error, data, refetch } =
|
|
3801
|
+
const { loading, error, data, refetch } = useQuery7(GET_USER_MARKETS, {
|
|
3785
3802
|
fetchPolicy: "network-only"
|
|
3786
3803
|
});
|
|
3787
3804
|
const userMarkets = data?.userMarkets;
|
|
3788
3805
|
return { error, loading, refetch, userMarkets };
|
|
3789
3806
|
};
|
|
3790
3807
|
var useGetUserStallholder = () => {
|
|
3791
|
-
const { loading, error, data, refetch } =
|
|
3808
|
+
const { loading, error, data, refetch } = useQuery7(GET_USER_STALLHOLDER, {
|
|
3792
3809
|
fetchPolicy: "network-only"
|
|
3793
3810
|
});
|
|
3794
3811
|
const userStallholder = data?.userStallholder;
|
|
3795
3812
|
return { error, loading, refetch, userStallholder };
|
|
3796
3813
|
};
|
|
3797
3814
|
var useGetUserFavourites = () => {
|
|
3798
|
-
const { loading, error, data, refetch } =
|
|
3815
|
+
const { loading, error, data, refetch } = useQuery7(GET_USER_FAVOURITES, {
|
|
3799
3816
|
fetchPolicy: "network-only"
|
|
3800
3817
|
});
|
|
3801
3818
|
const markets = data?.userFavourites.markets;
|
|
@@ -5130,7 +5147,6 @@ export {
|
|
|
5130
5147
|
useCreateChat,
|
|
5131
5148
|
useCreateMarket,
|
|
5132
5149
|
useCreateMarketInfo,
|
|
5133
|
-
useCreateNotification,
|
|
5134
5150
|
useCreatePoster,
|
|
5135
5151
|
useCreatePushToken,
|
|
5136
5152
|
useCreateRelation,
|
|
@@ -5153,6 +5169,7 @@ export {
|
|
|
5153
5169
|
useGetMarkets,
|
|
5154
5170
|
useGetMarketsByRegion,
|
|
5155
5171
|
useGetMarketsNearMe,
|
|
5172
|
+
useGetNotificationCount,
|
|
5156
5173
|
useGetNotificationCountSubscription,
|
|
5157
5174
|
useGetRelation,
|
|
5158
5175
|
useGetRelationByMarketAndStallholder,
|
|
@@ -5168,6 +5185,7 @@ export {
|
|
|
5168
5185
|
useGetUserChats,
|
|
5169
5186
|
useGetUserFavourites,
|
|
5170
5187
|
useGetUserMarkets,
|
|
5188
|
+
useGetUserNotifications,
|
|
5171
5189
|
useGetUserNotificationsSubscription,
|
|
5172
5190
|
useGetUserStallholder,
|
|
5173
5191
|
useGetUsers,
|