@timardex/cluemart-shared 1.0.86 → 1.0.88
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 +131 -107
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +21 -4
- package/dist/graphql/index.d.ts +21 -4
- package/dist/graphql/index.mjs +64 -42
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/index.cjs +131 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +20 -9
- package/dist/index.d.ts +20 -9
- package/dist/index.mjs +64 -42
- package/dist/index.mjs.map +1 -1
- package/dist/{notification-CmjfP3gD.d.mts → notification-Xc4qk09g.d.mts} +1 -7
- package/dist/{notification-CmjfP3gD.d.ts → notification-Xc4qk09g.d.ts} +1 -7
- 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
|
@@ -569,12 +569,6 @@ type CreateBulkNotificationInput = {
|
|
|
569
569
|
type?: EnumNotificationType;
|
|
570
570
|
data?: Record<string, unknown>;
|
|
571
571
|
};
|
|
572
|
-
type MarkNotificationReadInput = {
|
|
573
|
-
notificationIds: string[];
|
|
574
|
-
};
|
|
575
|
-
type MarkAllNotificationsReadInput = {
|
|
576
|
-
userId: string;
|
|
577
|
-
};
|
|
578
572
|
|
|
579
573
|
interface PosterInputType {
|
|
580
574
|
resourceId: string;
|
|
@@ -848,12 +842,29 @@ declare const useDeleteNotification: () => {
|
|
|
848
842
|
loading: boolean;
|
|
849
843
|
};
|
|
850
844
|
|
|
851
|
-
declare const
|
|
845
|
+
declare const useGetUserNotifications: (limit?: number, offset?: number) => {
|
|
846
|
+
error: _apollo_client.ApolloError | undefined;
|
|
847
|
+
loading: boolean;
|
|
848
|
+
notifications: NotificationType[];
|
|
849
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
850
|
+
userNotifications: NotificationType[];
|
|
851
|
+
}>>;
|
|
852
|
+
};
|
|
853
|
+
declare const useGetNotificationCount: () => {
|
|
854
|
+
error: _apollo_client.ApolloError | undefined;
|
|
855
|
+
loading: boolean;
|
|
856
|
+
notificationCount: NotificationCount;
|
|
857
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
858
|
+
notificationCount: NotificationCount;
|
|
859
|
+
}>>;
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
declare const useGetUserNotificationsSubscription: () => {
|
|
852
863
|
error: _apollo_client.ApolloError | undefined;
|
|
853
864
|
loading: boolean;
|
|
854
865
|
notifications: NotificationType[];
|
|
855
866
|
};
|
|
856
|
-
declare const useGetNotificationCountSubscription: (
|
|
867
|
+
declare const useGetNotificationCountSubscription: () => {
|
|
857
868
|
error: _apollo_client.ApolloError | undefined;
|
|
858
869
|
loading: boolean;
|
|
859
870
|
notificationCount: NotificationCount;
|
|
@@ -1254,4 +1265,4 @@ declare const availableRegionOptions: OptionItem[];
|
|
|
1254
1265
|
declare const paymentMethodOptions: OptionItem[];
|
|
1255
1266
|
declare function normalizeUrl(url: string): string;
|
|
1256
1267
|
|
|
1257
|
-
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
|
|
1268
|
+
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 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
|
@@ -569,12 +569,6 @@ type CreateBulkNotificationInput = {
|
|
|
569
569
|
type?: EnumNotificationType;
|
|
570
570
|
data?: Record<string, unknown>;
|
|
571
571
|
};
|
|
572
|
-
type MarkNotificationReadInput = {
|
|
573
|
-
notificationIds: string[];
|
|
574
|
-
};
|
|
575
|
-
type MarkAllNotificationsReadInput = {
|
|
576
|
-
userId: string;
|
|
577
|
-
};
|
|
578
572
|
|
|
579
573
|
interface PosterInputType {
|
|
580
574
|
resourceId: string;
|
|
@@ -848,12 +842,29 @@ declare const useDeleteNotification: () => {
|
|
|
848
842
|
loading: boolean;
|
|
849
843
|
};
|
|
850
844
|
|
|
851
|
-
declare const
|
|
845
|
+
declare const useGetUserNotifications: (limit?: number, offset?: number) => {
|
|
846
|
+
error: _apollo_client.ApolloError | undefined;
|
|
847
|
+
loading: boolean;
|
|
848
|
+
notifications: NotificationType[];
|
|
849
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
850
|
+
userNotifications: NotificationType[];
|
|
851
|
+
}>>;
|
|
852
|
+
};
|
|
853
|
+
declare const useGetNotificationCount: () => {
|
|
854
|
+
error: _apollo_client.ApolloError | undefined;
|
|
855
|
+
loading: boolean;
|
|
856
|
+
notificationCount: NotificationCount;
|
|
857
|
+
refetch: (variables?: Partial<_apollo_client.OperationVariables> | undefined) => Promise<_apollo_client.ApolloQueryResult<{
|
|
858
|
+
notificationCount: NotificationCount;
|
|
859
|
+
}>>;
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
declare const useGetUserNotificationsSubscription: () => {
|
|
852
863
|
error: _apollo_client.ApolloError | undefined;
|
|
853
864
|
loading: boolean;
|
|
854
865
|
notifications: NotificationType[];
|
|
855
866
|
};
|
|
856
|
-
declare const useGetNotificationCountSubscription: (
|
|
867
|
+
declare const useGetNotificationCountSubscription: () => {
|
|
857
868
|
error: _apollo_client.ApolloError | undefined;
|
|
858
869
|
loading: boolean;
|
|
859
870
|
notificationCount: NotificationCount;
|
|
@@ -1254,4 +1265,4 @@ declare const availableRegionOptions: OptionItem[];
|
|
|
1254
1265
|
declare const paymentMethodOptions: OptionItem[];
|
|
1255
1266
|
declare function normalizeUrl(url: string): string;
|
|
1256
1267
|
|
|
1257
|
-
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
|
|
1268
|
+
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 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
|
@@ -2377,8 +2377,8 @@ var ADD_PARTICIPANT_TO_CHAT_MUTATION = gql7`
|
|
|
2377
2377
|
addParticipantToChat(_id: $_id, input: $input) {
|
|
2378
2378
|
...ChatFields
|
|
2379
2379
|
}
|
|
2380
|
-
${CHAT_FIELDS_FRAGMENT}
|
|
2381
2380
|
}
|
|
2381
|
+
${CHAT_FIELDS_FRAGMENT}
|
|
2382
2382
|
`;
|
|
2383
2383
|
var REMOVE_PARTICIPANT_FROM_CHAT_MUTATION = gql7`
|
|
2384
2384
|
mutation removeParticipantFromChat($_id: ID!, $input: ID!) {
|
|
@@ -2771,16 +2771,16 @@ var USER_NOTIFICATION_FRAGMENT = gql11`
|
|
|
2771
2771
|
}
|
|
2772
2772
|
`;
|
|
2773
2773
|
var GET_USER_NOTIFICATIONS = gql11`
|
|
2774
|
-
query getUserNotifications($
|
|
2775
|
-
userNotifications(
|
|
2774
|
+
query getUserNotifications($limit: Int, $offset: Int) {
|
|
2775
|
+
userNotifications(limit: $limit, offset: $offset) {
|
|
2776
2776
|
...UserNotificationFields
|
|
2777
2777
|
}
|
|
2778
2778
|
}
|
|
2779
2779
|
${USER_NOTIFICATION_FRAGMENT}
|
|
2780
2780
|
`;
|
|
2781
2781
|
var GET_NOTIFICATION_COUNT = gql11`
|
|
2782
|
-
query getNotificationCount
|
|
2783
|
-
notificationCount
|
|
2782
|
+
query getNotificationCount {
|
|
2783
|
+
notificationCount {
|
|
2784
2784
|
total
|
|
2785
2785
|
unread
|
|
2786
2786
|
}
|
|
@@ -2797,16 +2797,16 @@ var CREATE_BULK_NOTIFICATIONS = gql12`
|
|
|
2797
2797
|
${USER_NOTIFICATION_FRAGMENT}
|
|
2798
2798
|
`;
|
|
2799
2799
|
var MARK_NOTIFICATION_READ = gql12`
|
|
2800
|
-
mutation markNotificationRead($
|
|
2801
|
-
markNotificationRead(
|
|
2800
|
+
mutation markNotificationRead($_id: ID!) {
|
|
2801
|
+
markNotificationRead(_id: $_id) {
|
|
2802
2802
|
...UserNotificationFields
|
|
2803
2803
|
}
|
|
2804
2804
|
}
|
|
2805
2805
|
${USER_NOTIFICATION_FRAGMENT}
|
|
2806
2806
|
`;
|
|
2807
2807
|
var MARK_ALL_NOTIFICATIONS_READ = gql12`
|
|
2808
|
-
mutation markAllNotificationsRead
|
|
2809
|
-
markAllNotificationsRead
|
|
2808
|
+
mutation markAllNotificationsRead {
|
|
2809
|
+
markAllNotificationsRead
|
|
2810
2810
|
}
|
|
2811
2811
|
`;
|
|
2812
2812
|
var DELETE_NOTIFICATION = gql12`
|
|
@@ -2850,6 +2850,32 @@ var useDeleteNotification = () => {
|
|
|
2850
2850
|
return { deleteNotification, error, loading };
|
|
2851
2851
|
};
|
|
2852
2852
|
|
|
2853
|
+
// src/graphql/hooks/notifications/hooksQuery.ts
|
|
2854
|
+
import { useQuery as useQuery3 } from "@apollo/client";
|
|
2855
|
+
var useGetUserNotifications = (limit, offset) => {
|
|
2856
|
+
const { data, loading, error, refetch } = useQuery3(GET_USER_NOTIFICATIONS, {
|
|
2857
|
+
fetchPolicy: "cache-and-network",
|
|
2858
|
+
variables: { limit, offset }
|
|
2859
|
+
});
|
|
2860
|
+
return {
|
|
2861
|
+
error,
|
|
2862
|
+
loading,
|
|
2863
|
+
notifications: data?.userNotifications || [],
|
|
2864
|
+
refetch
|
|
2865
|
+
};
|
|
2866
|
+
};
|
|
2867
|
+
var useGetNotificationCount = () => {
|
|
2868
|
+
const { data, loading, error, refetch } = useQuery3(GET_NOTIFICATION_COUNT, {
|
|
2869
|
+
fetchPolicy: "cache-and-network"
|
|
2870
|
+
});
|
|
2871
|
+
return {
|
|
2872
|
+
error,
|
|
2873
|
+
loading,
|
|
2874
|
+
notificationCount: data?.notificationCount || { total: 0, unread: 0 },
|
|
2875
|
+
refetch
|
|
2876
|
+
};
|
|
2877
|
+
};
|
|
2878
|
+
|
|
2853
2879
|
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
2854
2880
|
import { useSubscription as useSubscription2 } from "@apollo/client";
|
|
2855
2881
|
|
|
@@ -2869,7 +2895,7 @@ var USER_NOTIFICATION_FRAGMENT2 = gql13`
|
|
|
2869
2895
|
}
|
|
2870
2896
|
`;
|
|
2871
2897
|
var GET_USER_NOTIFICATIONS_SUBSCRIPTION = gql13`
|
|
2872
|
-
subscription getUserNotifications($userId:
|
|
2898
|
+
subscription getUserNotifications($userId: ID!) {
|
|
2873
2899
|
getUserNotifications(userId: $userId) {
|
|
2874
2900
|
...UserNotificationFields
|
|
2875
2901
|
}
|
|
@@ -2877,7 +2903,7 @@ var GET_USER_NOTIFICATIONS_SUBSCRIPTION = gql13`
|
|
|
2877
2903
|
${USER_NOTIFICATION_FRAGMENT2}
|
|
2878
2904
|
`;
|
|
2879
2905
|
var GET_NOTIFICATION_COUNT_SUBSCRIPTION = gql13`
|
|
2880
|
-
subscription getNotificationCount($userId:
|
|
2906
|
+
subscription getNotificationCount($userId: ID!) {
|
|
2881
2907
|
getNotificationCount(userId: $userId) {
|
|
2882
2908
|
total
|
|
2883
2909
|
unread
|
|
@@ -2886,22 +2912,16 @@ var GET_NOTIFICATION_COUNT_SUBSCRIPTION = gql13`
|
|
|
2886
2912
|
`;
|
|
2887
2913
|
|
|
2888
2914
|
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
2889
|
-
var useGetUserNotificationsSubscription = (
|
|
2890
|
-
const { data, loading, error } = useSubscription2(GET_USER_NOTIFICATIONS_SUBSCRIPTION
|
|
2891
|
-
skip: !userId,
|
|
2892
|
-
variables: { userId }
|
|
2893
|
-
});
|
|
2915
|
+
var useGetUserNotificationsSubscription = () => {
|
|
2916
|
+
const { data, loading, error } = useSubscription2(GET_USER_NOTIFICATIONS_SUBSCRIPTION);
|
|
2894
2917
|
return {
|
|
2895
2918
|
error,
|
|
2896
2919
|
loading,
|
|
2897
2920
|
notifications: data?.getUserNotifications || []
|
|
2898
2921
|
};
|
|
2899
2922
|
};
|
|
2900
|
-
var useGetNotificationCountSubscription = (
|
|
2901
|
-
const { data, loading, error } = useSubscription2(GET_NOTIFICATION_COUNT_SUBSCRIPTION
|
|
2902
|
-
skip: !userId,
|
|
2903
|
-
variables: { userId }
|
|
2904
|
-
});
|
|
2923
|
+
var useGetNotificationCountSubscription = () => {
|
|
2924
|
+
const { data, loading, error } = useSubscription2(GET_NOTIFICATION_COUNT_SUBSCRIPTION);
|
|
2905
2925
|
return {
|
|
2906
2926
|
error,
|
|
2907
2927
|
loading,
|
|
@@ -3304,9 +3324,9 @@ var useDeleteRelation = () => {
|
|
|
3304
3324
|
};
|
|
3305
3325
|
|
|
3306
3326
|
// src/graphql/hooks/relation/hooksQuery.ts
|
|
3307
|
-
import { useQuery as
|
|
3327
|
+
import { useQuery as useQuery4 } from "@apollo/client";
|
|
3308
3328
|
var useGetRelation = (id) => {
|
|
3309
|
-
const { loading, error, data, refetch } =
|
|
3329
|
+
const { loading, error, data, refetch } = useQuery4(GET_RELATION, {
|
|
3310
3330
|
fetchPolicy: "network-only",
|
|
3311
3331
|
skip: id === "",
|
|
3312
3332
|
variables: { id }
|
|
@@ -3315,7 +3335,7 @@ var useGetRelation = (id) => {
|
|
|
3315
3335
|
return { error, loading, refetch, relation };
|
|
3316
3336
|
};
|
|
3317
3337
|
var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
3318
|
-
const { loading, error, data, refetch } =
|
|
3338
|
+
const { loading, error, data, refetch } = useQuery4(
|
|
3319
3339
|
GET_RELATION_BY_MARKET_AND_STALLHOLDER,
|
|
3320
3340
|
{
|
|
3321
3341
|
fetchPolicy: "network-only",
|
|
@@ -3327,7 +3347,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
|
3327
3347
|
return { error, loading, refetch, relationByMarketAndStallholder };
|
|
3328
3348
|
};
|
|
3329
3349
|
var useGetMarketRelations = (marketId) => {
|
|
3330
|
-
const { loading, error, data, refetch } =
|
|
3350
|
+
const { loading, error, data, refetch } = useQuery4(GET_MARKET_RELATIONS, {
|
|
3331
3351
|
fetchPolicy: "network-only",
|
|
3332
3352
|
skip: marketId === "",
|
|
3333
3353
|
variables: { marketId }
|
|
@@ -3336,7 +3356,7 @@ var useGetMarketRelations = (marketId) => {
|
|
|
3336
3356
|
return { error, loading, marketRelations, refetch };
|
|
3337
3357
|
};
|
|
3338
3358
|
var useGetStallholderRelations = (stallholderId) => {
|
|
3339
|
-
const { loading, error, data, refetch } =
|
|
3359
|
+
const { loading, error, data, refetch } = useQuery4(
|
|
3340
3360
|
GET_STALLHOLDER_RELATIONS,
|
|
3341
3361
|
{
|
|
3342
3362
|
fetchPolicy: "network-only",
|
|
@@ -3348,7 +3368,7 @@ var useGetStallholderRelations = (stallholderId) => {
|
|
|
3348
3368
|
return { error, loading, refetch, stallholderRelations };
|
|
3349
3369
|
};
|
|
3350
3370
|
var useGetResourceConnections = (resourceId, resourceType) => {
|
|
3351
|
-
const { loading, error, data, refetch } =
|
|
3371
|
+
const { loading, error, data, refetch } = useQuery4(GET_RESOURCE_CONNECTIONS, {
|
|
3352
3372
|
fetchPolicy: "network-only",
|
|
3353
3373
|
variables: { resourceId, resourceType }
|
|
3354
3374
|
});
|
|
@@ -3482,9 +3502,9 @@ var useUpdateStallholderInfo = () => {
|
|
|
3482
3502
|
};
|
|
3483
3503
|
|
|
3484
3504
|
// src/graphql/hooks/stallholder/hooksQuery.ts
|
|
3485
|
-
import { useQuery as
|
|
3505
|
+
import { useQuery as useQuery5 } from "@apollo/client";
|
|
3486
3506
|
var useGetStallholders = () => {
|
|
3487
|
-
const { loading, error, data, refetch } =
|
|
3507
|
+
const { loading, error, data, refetch } = useQuery5(GET_STALLHOLDERS, {
|
|
3488
3508
|
fetchPolicy: "network-only"
|
|
3489
3509
|
});
|
|
3490
3510
|
const stallholders = data?.stallholders;
|
|
@@ -3496,7 +3516,7 @@ var useGetStallholders = () => {
|
|
|
3496
3516
|
};
|
|
3497
3517
|
};
|
|
3498
3518
|
var useGetStallholder = (_id) => {
|
|
3499
|
-
const { loading, error, data, refetch } =
|
|
3519
|
+
const { loading, error, data, refetch } = useQuery5(GET_STALLHOLDER, {
|
|
3500
3520
|
fetchPolicy: "network-only",
|
|
3501
3521
|
skip: !_id,
|
|
3502
3522
|
variables: { _id }
|
|
@@ -3505,7 +3525,7 @@ var useGetStallholder = (_id) => {
|
|
|
3505
3525
|
return { error, loading, refetch, stallholder };
|
|
3506
3526
|
};
|
|
3507
3527
|
var useGetStallholdersByRegion = (region) => {
|
|
3508
|
-
const { loading, error, data, refetch } =
|
|
3528
|
+
const { loading, error, data, refetch } = useQuery5(
|
|
3509
3529
|
GET_STALLHOLDERS_BY_REGION,
|
|
3510
3530
|
{
|
|
3511
3531
|
fetchPolicy: "no-cache",
|
|
@@ -3517,7 +3537,7 @@ var useGetStallholdersByRegion = (region) => {
|
|
|
3517
3537
|
return { error, loading, refetch, stallholdersByRegion };
|
|
3518
3538
|
};
|
|
3519
3539
|
var useSearchStallholders = (search, region) => {
|
|
3520
|
-
const { loading, error, data, refetch } =
|
|
3540
|
+
const { loading, error, data, refetch } = useQuery5(SEARCH_STALLHOLDERS, {
|
|
3521
3541
|
fetchPolicy: "network-only",
|
|
3522
3542
|
skip: search.length < 3,
|
|
3523
3543
|
variables: { region, search }
|
|
@@ -3526,7 +3546,7 @@ var useSearchStallholders = (search, region) => {
|
|
|
3526
3546
|
return { error, loading, refetch, stallholderSearch };
|
|
3527
3547
|
};
|
|
3528
3548
|
var useGetStallholderInfo = (stallholderId) => {
|
|
3529
|
-
const { loading, error, data, refetch } =
|
|
3549
|
+
const { loading, error, data, refetch } = useQuery5(GET_STALLHOLDER_INFO, {
|
|
3530
3550
|
fetchPolicy: "network-only",
|
|
3531
3551
|
skip: !stallholderId,
|
|
3532
3552
|
variables: { stallholderId }
|
|
@@ -3632,9 +3652,9 @@ var useDeleteTester = () => {
|
|
|
3632
3652
|
};
|
|
3633
3653
|
|
|
3634
3654
|
// src/graphql/hooks/testers/hooksQuery.ts
|
|
3635
|
-
import { useQuery as
|
|
3655
|
+
import { useQuery as useQuery6 } from "@apollo/client";
|
|
3636
3656
|
var useGetTesters = () => {
|
|
3637
|
-
const { data, loading, error, refetch } =
|
|
3657
|
+
const { data, loading, error, refetch } = useQuery6(GET_TESTERS);
|
|
3638
3658
|
const testers = data?.testers;
|
|
3639
3659
|
return {
|
|
3640
3660
|
error,
|
|
@@ -3644,7 +3664,7 @@ var useGetTesters = () => {
|
|
|
3644
3664
|
};
|
|
3645
3665
|
};
|
|
3646
3666
|
var useGetTester = (_id) => {
|
|
3647
|
-
const { data, loading, error, refetch } =
|
|
3667
|
+
const { data, loading, error, refetch } = useQuery6(GET_TESTER, {
|
|
3648
3668
|
skip: !_id,
|
|
3649
3669
|
variables: { _id }
|
|
3650
3670
|
});
|
|
@@ -3753,37 +3773,37 @@ var useRemoveUserFavouriteResource = () => {
|
|
|
3753
3773
|
};
|
|
3754
3774
|
|
|
3755
3775
|
// src/graphql/hooks/user/hooksQuery.ts
|
|
3756
|
-
import { useQuery as
|
|
3776
|
+
import { useQuery as useQuery7 } from "@apollo/client";
|
|
3757
3777
|
var useGetUsers = () => {
|
|
3758
|
-
const { loading, error, data, refetch } =
|
|
3778
|
+
const { loading, error, data, refetch } = useQuery7(GET_USERS, {
|
|
3759
3779
|
fetchPolicy: "network-only"
|
|
3760
3780
|
});
|
|
3761
3781
|
const users = data?.users;
|
|
3762
3782
|
return { error, loading, refetch, users };
|
|
3763
3783
|
};
|
|
3764
3784
|
var useGetUser = (_id) => {
|
|
3765
|
-
const { loading, error, data, refetch } =
|
|
3785
|
+
const { loading, error, data, refetch } = useQuery7(GET_USER, {
|
|
3766
3786
|
variables: { _id }
|
|
3767
3787
|
});
|
|
3768
3788
|
const user = data?.user;
|
|
3769
3789
|
return { error, loading, refetch, user };
|
|
3770
3790
|
};
|
|
3771
3791
|
var useGetUserMarkets = () => {
|
|
3772
|
-
const { loading, error, data, refetch } =
|
|
3792
|
+
const { loading, error, data, refetch } = useQuery7(GET_USER_MARKETS, {
|
|
3773
3793
|
fetchPolicy: "network-only"
|
|
3774
3794
|
});
|
|
3775
3795
|
const userMarkets = data?.userMarkets;
|
|
3776
3796
|
return { error, loading, refetch, userMarkets };
|
|
3777
3797
|
};
|
|
3778
3798
|
var useGetUserStallholder = () => {
|
|
3779
|
-
const { loading, error, data, refetch } =
|
|
3799
|
+
const { loading, error, data, refetch } = useQuery7(GET_USER_STALLHOLDER, {
|
|
3780
3800
|
fetchPolicy: "network-only"
|
|
3781
3801
|
});
|
|
3782
3802
|
const userStallholder = data?.userStallholder;
|
|
3783
3803
|
return { error, loading, refetch, userStallholder };
|
|
3784
3804
|
};
|
|
3785
3805
|
var useGetUserFavourites = () => {
|
|
3786
|
-
const { loading, error, data, refetch } =
|
|
3806
|
+
const { loading, error, data, refetch } = useQuery7(GET_USER_FAVOURITES, {
|
|
3787
3807
|
fetchPolicy: "network-only"
|
|
3788
3808
|
});
|
|
3789
3809
|
const markets = data?.userFavourites.markets;
|
|
@@ -5140,6 +5160,7 @@ export {
|
|
|
5140
5160
|
useGetMarkets,
|
|
5141
5161
|
useGetMarketsByRegion,
|
|
5142
5162
|
useGetMarketsNearMe,
|
|
5163
|
+
useGetNotificationCount,
|
|
5143
5164
|
useGetNotificationCountSubscription,
|
|
5144
5165
|
useGetRelation,
|
|
5145
5166
|
useGetRelationByMarketAndStallholder,
|
|
@@ -5155,6 +5176,7 @@ export {
|
|
|
5155
5176
|
useGetUserChats,
|
|
5156
5177
|
useGetUserFavourites,
|
|
5157
5178
|
useGetUserMarkets,
|
|
5179
|
+
useGetUserNotifications,
|
|
5158
5180
|
useGetUserNotificationsSubscription,
|
|
5159
5181
|
useGetUserStallholder,
|
|
5160
5182
|
useGetUsers,
|