@timardex/cluemart-shared 1.0.84 → 1.0.86
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 +101 -100
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +4 -13
- package/dist/graphql/index.d.ts +4 -13
- package/dist/graphql/index.mjs +98 -95
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/index.cjs +101 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -17
- package/dist/index.d.ts +5 -17
- package/dist/index.mjs +98 -95
- 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/graphql/index.cjs
CHANGED
|
@@ -20,7 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/graphql/index.ts
|
|
21
21
|
var graphql_exports = {};
|
|
22
22
|
__export(graphql_exports, {
|
|
23
|
-
GET_CHAT_MESSAGE: () => GET_CHAT_MESSAGE,
|
|
24
23
|
useAddParticipantToChat: () => useAddParticipantToChat,
|
|
25
24
|
useAddUserFavouriteResource: () => useAddUserFavouriteResource,
|
|
26
25
|
useAdminUpdateResourceType: () => useAdminUpdateResourceType,
|
|
@@ -29,7 +28,6 @@ __export(graphql_exports, {
|
|
|
29
28
|
useCreateChat: () => useCreateChat,
|
|
30
29
|
useCreateMarket: () => useCreateMarket,
|
|
31
30
|
useCreateMarketInfo: () => useCreateMarketInfo,
|
|
32
|
-
useCreateNotification: () => useCreateNotification,
|
|
33
31
|
useCreatePoster: () => useCreatePoster,
|
|
34
32
|
useCreatePushToken: () => useCreatePushToken,
|
|
35
33
|
useCreateRelation: () => useCreateRelation,
|
|
@@ -52,7 +50,7 @@ __export(graphql_exports, {
|
|
|
52
50
|
useGetMarkets: () => useGetMarkets,
|
|
53
51
|
useGetMarketsByRegion: () => useGetMarketsByRegion,
|
|
54
52
|
useGetMarketsNearMe: () => useGetMarketsNearMe,
|
|
55
|
-
|
|
53
|
+
useGetNotificationCountSubscription: () => useGetNotificationCountSubscription,
|
|
56
54
|
useGetRelation: () => useGetRelation,
|
|
57
55
|
useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
|
|
58
56
|
useGetResourceConnections: () => useGetResourceConnections,
|
|
@@ -67,7 +65,7 @@ __export(graphql_exports, {
|
|
|
67
65
|
useGetUserChats: () => useGetUserChats,
|
|
68
66
|
useGetUserFavourites: () => useGetUserFavourites,
|
|
69
67
|
useGetUserMarkets: () => useGetUserMarkets,
|
|
70
|
-
|
|
68
|
+
useGetUserNotificationsSubscription: () => useGetUserNotificationsSubscription,
|
|
71
69
|
useGetUserStallholder: () => useGetUserStallholder,
|
|
72
70
|
useGetUsers: () => useGetUsers,
|
|
73
71
|
useLogin: () => useLogin,
|
|
@@ -642,6 +640,14 @@ var USER_CHATS = import_client8.gql`
|
|
|
642
640
|
}
|
|
643
641
|
${CHAT_FIELDS_FRAGMENT}
|
|
644
642
|
`;
|
|
643
|
+
var GET_CHAT_MESSAGE = import_client8.gql`
|
|
644
|
+
subscription {
|
|
645
|
+
getChatMessage {
|
|
646
|
+
...ChatFields
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
${CHAT_FIELDS_FRAGMENT}
|
|
650
|
+
`;
|
|
645
651
|
|
|
646
652
|
// src/graphql/mutations/chat.ts
|
|
647
653
|
var CREATE_CHAT_MUTATION = import_client9.gql`
|
|
@@ -765,22 +771,9 @@ var useRemoveParticipantFromChat = () => {
|
|
|
765
771
|
};
|
|
766
772
|
|
|
767
773
|
// src/graphql/hooks/chat/hooksQuery.ts
|
|
768
|
-
var import_client12 = require("@apollo/client");
|
|
769
|
-
|
|
770
|
-
// src/graphql/subscriptions/chat.ts
|
|
771
774
|
var import_client11 = require("@apollo/client");
|
|
772
|
-
var GET_CHAT_MESSAGE = import_client11.gql`
|
|
773
|
-
subscription {
|
|
774
|
-
getChatMessage {
|
|
775
|
-
...ChatFields
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
${CHAT_FIELDS_FRAGMENT}
|
|
779
|
-
`;
|
|
780
|
-
|
|
781
|
-
// src/graphql/hooks/chat/hooksQuery.ts
|
|
782
775
|
var useGetChat = (_id) => {
|
|
783
|
-
const { loading, error, data, refetch } = (0,
|
|
776
|
+
const { loading, error, data, refetch } = (0, import_client11.useQuery)(CHAT, {
|
|
784
777
|
fetchPolicy: "network-only",
|
|
785
778
|
skip: !_id,
|
|
786
779
|
variables: { _id }
|
|
@@ -789,24 +782,24 @@ var useGetChat = (_id) => {
|
|
|
789
782
|
return { chat, error, loading, refetch };
|
|
790
783
|
};
|
|
791
784
|
var useGetUserChats = () => {
|
|
792
|
-
const { loading, error, data, refetch } = (0,
|
|
785
|
+
const { loading, error, data, refetch } = (0, import_client11.useQuery)(USER_CHATS, {
|
|
793
786
|
fetchPolicy: "network-only"
|
|
794
787
|
});
|
|
795
788
|
const userChats = data?.userChats;
|
|
796
789
|
return { error, loading, refetch, userChats };
|
|
797
790
|
};
|
|
798
791
|
var useGetChatSubscription = () => {
|
|
799
|
-
const { data, loading, error } = (0,
|
|
792
|
+
const { data, loading, error } = (0, import_client11.useSubscription)(GET_CHAT_MESSAGE);
|
|
800
793
|
const chat = data?.getChat;
|
|
801
794
|
return { chat, error, loading };
|
|
802
795
|
};
|
|
803
796
|
|
|
804
797
|
// src/graphql/hooks/contactUs.ts
|
|
805
|
-
var
|
|
798
|
+
var import_client13 = require("@apollo/client");
|
|
806
799
|
|
|
807
800
|
// src/graphql/mutations/contactUs.ts
|
|
808
|
-
var
|
|
809
|
-
var CONTACT_US_MUTATION =
|
|
801
|
+
var import_client12 = require("@apollo/client");
|
|
802
|
+
var CONTACT_US_MUTATION = import_client12.gql`
|
|
810
803
|
mutation contactUs($input: ContactUsInputType!) {
|
|
811
804
|
contactUs(input: $input) {
|
|
812
805
|
message
|
|
@@ -816,16 +809,16 @@ var CONTACT_US_MUTATION = import_client13.gql`
|
|
|
816
809
|
|
|
817
810
|
// src/graphql/hooks/contactUs.ts
|
|
818
811
|
var useContactUs = () => {
|
|
819
|
-
const [contactUs, { loading, error }] = (0,
|
|
812
|
+
const [contactUs, { loading, error }] = (0, import_client13.useMutation)(CONTACT_US_MUTATION);
|
|
820
813
|
return { contactUs, error, loading };
|
|
821
814
|
};
|
|
822
815
|
|
|
823
816
|
// src/graphql/hooks/market/hooksMutation.ts
|
|
824
|
-
var
|
|
817
|
+
var import_client16 = require("@apollo/client");
|
|
825
818
|
|
|
826
819
|
// src/graphql/mutations/market.ts
|
|
827
|
-
var
|
|
828
|
-
var CREATE_MARKET_MUTATION =
|
|
820
|
+
var import_client14 = require("@apollo/client");
|
|
821
|
+
var CREATE_MARKET_MUTATION = import_client14.gql`
|
|
829
822
|
mutation createMarket($input: MarketInputType!) {
|
|
830
823
|
createMarket(input: $input) {
|
|
831
824
|
...MarketFields
|
|
@@ -833,7 +826,7 @@ var CREATE_MARKET_MUTATION = import_client15.gql`
|
|
|
833
826
|
}
|
|
834
827
|
${MARKET}
|
|
835
828
|
`;
|
|
836
|
-
var UPDATE_MARKET_MUTATION =
|
|
829
|
+
var UPDATE_MARKET_MUTATION = import_client14.gql`
|
|
837
830
|
mutation updateMarket($_id: ID!, $input: MarketInputType!) {
|
|
838
831
|
updateMarket(_id: $_id, input: $input) {
|
|
839
832
|
...MarketFields
|
|
@@ -841,12 +834,12 @@ var UPDATE_MARKET_MUTATION = import_client15.gql`
|
|
|
841
834
|
}
|
|
842
835
|
${MARKET}
|
|
843
836
|
`;
|
|
844
|
-
var DELETE_MARKET_MUTATION =
|
|
837
|
+
var DELETE_MARKET_MUTATION = import_client14.gql`
|
|
845
838
|
mutation deleteMarket($_id: ID!) {
|
|
846
839
|
deleteMarket(_id: $_id)
|
|
847
840
|
}
|
|
848
841
|
`;
|
|
849
|
-
var CREATE_MARKET_INFO_MUTATION =
|
|
842
|
+
var CREATE_MARKET_INFO_MUTATION = import_client14.gql`
|
|
850
843
|
mutation createMarketInfo($input: MarketInfoInputType!) {
|
|
851
844
|
createMarketInfo(input: $input) {
|
|
852
845
|
...MarketInfoFields
|
|
@@ -854,7 +847,7 @@ var CREATE_MARKET_INFO_MUTATION = import_client15.gql`
|
|
|
854
847
|
}
|
|
855
848
|
${MARKET_INFO}
|
|
856
849
|
`;
|
|
857
|
-
var UPDATE_MARKET_INFO_MUTATION =
|
|
850
|
+
var UPDATE_MARKET_INFO_MUTATION = import_client14.gql`
|
|
858
851
|
mutation updateMarketInfo($_id: ID!, $input: MarketInfoInputType!) {
|
|
859
852
|
updateMarketInfo(_id: $_id, input: $input) {
|
|
860
853
|
...MarketInfoFields
|
|
@@ -864,8 +857,8 @@ var UPDATE_MARKET_INFO_MUTATION = import_client15.gql`
|
|
|
864
857
|
`;
|
|
865
858
|
|
|
866
859
|
// src/graphql/queries/user.ts
|
|
867
|
-
var
|
|
868
|
-
var GET_USERS =
|
|
860
|
+
var import_client15 = require("@apollo/client");
|
|
861
|
+
var GET_USERS = import_client15.gql`
|
|
869
862
|
query getUsers {
|
|
870
863
|
users {
|
|
871
864
|
...UserFields
|
|
@@ -873,7 +866,7 @@ var GET_USERS = import_client16.gql`
|
|
|
873
866
|
}
|
|
874
867
|
${USER_FIELDS_FRAGMENT}
|
|
875
868
|
`;
|
|
876
|
-
var GET_USER =
|
|
869
|
+
var GET_USER = import_client15.gql`
|
|
877
870
|
query getUser($_id: ID!) {
|
|
878
871
|
user(_id: $_id) {
|
|
879
872
|
...UserFields
|
|
@@ -881,7 +874,7 @@ var GET_USER = import_client16.gql`
|
|
|
881
874
|
}
|
|
882
875
|
${USER_FIELDS_FRAGMENT}
|
|
883
876
|
`;
|
|
884
|
-
var GET_USER_MARKETS =
|
|
877
|
+
var GET_USER_MARKETS = import_client15.gql`
|
|
885
878
|
query getUserMarkets {
|
|
886
879
|
userMarkets {
|
|
887
880
|
...MarketFields
|
|
@@ -889,7 +882,7 @@ var GET_USER_MARKETS = import_client16.gql`
|
|
|
889
882
|
}
|
|
890
883
|
${MARKET}
|
|
891
884
|
`;
|
|
892
|
-
var GET_USER_STALLHOLDER =
|
|
885
|
+
var GET_USER_STALLHOLDER = import_client15.gql`
|
|
893
886
|
query getUserStallholder {
|
|
894
887
|
userStallholder {
|
|
895
888
|
...StallholderFields
|
|
@@ -897,7 +890,7 @@ var GET_USER_STALLHOLDER = import_client16.gql`
|
|
|
897
890
|
}
|
|
898
891
|
${STALLHOLDER}
|
|
899
892
|
`;
|
|
900
|
-
var GET_USER_FAVOURITES =
|
|
893
|
+
var GET_USER_FAVOURITES = import_client15.gql`
|
|
901
894
|
query getUserFavourites {
|
|
902
895
|
userFavourites {
|
|
903
896
|
markets {
|
|
@@ -914,7 +907,7 @@ var GET_USER_FAVOURITES = import_client16.gql`
|
|
|
914
907
|
|
|
915
908
|
// src/graphql/hooks/market/hooksMutation.ts
|
|
916
909
|
var useCreateMarket = () => {
|
|
917
|
-
const [createMarket, { loading, error }] = (0,
|
|
910
|
+
const [createMarket, { loading, error }] = (0, import_client16.useMutation)(
|
|
918
911
|
CREATE_MARKET_MUTATION,
|
|
919
912
|
{
|
|
920
913
|
awaitRefetchQueries: true,
|
|
@@ -924,7 +917,7 @@ var useCreateMarket = () => {
|
|
|
924
917
|
return { createMarket, error, loading };
|
|
925
918
|
};
|
|
926
919
|
var useUpdateMarket = () => {
|
|
927
|
-
const [updateMarket, { loading, error }] = (0,
|
|
920
|
+
const [updateMarket, { loading, error }] = (0, import_client16.useMutation)(
|
|
928
921
|
UPDATE_MARKET_MUTATION,
|
|
929
922
|
{
|
|
930
923
|
awaitRefetchQueries: true,
|
|
@@ -934,7 +927,7 @@ var useUpdateMarket = () => {
|
|
|
934
927
|
return { error, loading, updateMarket };
|
|
935
928
|
};
|
|
936
929
|
var useDeleteMarket = () => {
|
|
937
|
-
const [deleteMarket, { loading, error }] = (0,
|
|
930
|
+
const [deleteMarket, { loading, error }] = (0, import_client16.useMutation)(
|
|
938
931
|
DELETE_MARKET_MUTATION,
|
|
939
932
|
{
|
|
940
933
|
awaitRefetchQueries: true,
|
|
@@ -944,7 +937,7 @@ var useDeleteMarket = () => {
|
|
|
944
937
|
return { deleteMarket, error, loading };
|
|
945
938
|
};
|
|
946
939
|
var useCreateMarketInfo = () => {
|
|
947
|
-
const [createMarketInfo, { loading, error }] = (0,
|
|
940
|
+
const [createMarketInfo, { loading, error }] = (0, import_client16.useMutation)(
|
|
948
941
|
CREATE_MARKET_INFO_MUTATION,
|
|
949
942
|
{
|
|
950
943
|
awaitRefetchQueries: true,
|
|
@@ -970,7 +963,7 @@ var useCreateMarketInfo = () => {
|
|
|
970
963
|
return { createMarketInfo, error, loading };
|
|
971
964
|
};
|
|
972
965
|
var useUpdateMarketInfo = () => {
|
|
973
|
-
const [updateMarketInfo, { loading, error }] = (0,
|
|
966
|
+
const [updateMarketInfo, { loading, error }] = (0, import_client16.useMutation)(
|
|
974
967
|
UPDATE_MARKET_INFO_MUTATION,
|
|
975
968
|
{
|
|
976
969
|
awaitRefetchQueries: true,
|
|
@@ -996,16 +989,16 @@ var useUpdateMarketInfo = () => {
|
|
|
996
989
|
};
|
|
997
990
|
|
|
998
991
|
// src/graphql/hooks/market/hooksQuery.ts
|
|
999
|
-
var
|
|
992
|
+
var import_client17 = require("@apollo/client");
|
|
1000
993
|
var useGetMarkets = () => {
|
|
1001
|
-
const { loading, error, data, refetch } = (0,
|
|
994
|
+
const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_MARKETS, {
|
|
1002
995
|
fetchPolicy: "network-only"
|
|
1003
996
|
});
|
|
1004
997
|
const markets = data?.markets;
|
|
1005
998
|
return { error, loading, markets, refetch };
|
|
1006
999
|
};
|
|
1007
1000
|
var useGetMarket = (_id) => {
|
|
1008
|
-
const { loading, error, data, refetch } = (0,
|
|
1001
|
+
const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_MARKET, {
|
|
1009
1002
|
fetchPolicy: "network-only",
|
|
1010
1003
|
skip: !_id,
|
|
1011
1004
|
variables: { _id }
|
|
@@ -1014,7 +1007,7 @@ var useGetMarket = (_id) => {
|
|
|
1014
1007
|
return { error, loading, market, refetch };
|
|
1015
1008
|
};
|
|
1016
1009
|
var useGetMarketsByRegion = (region) => {
|
|
1017
|
-
const { loading, error, data, refetch } = (0,
|
|
1010
|
+
const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_MARKETS_BY_REGION, {
|
|
1018
1011
|
fetchPolicy: "no-cache",
|
|
1019
1012
|
skip: !region,
|
|
1020
1013
|
variables: { region }
|
|
@@ -1023,7 +1016,7 @@ var useGetMarketsByRegion = (region) => {
|
|
|
1023
1016
|
return { error, loading, marketsByRegion, refetch };
|
|
1024
1017
|
};
|
|
1025
1018
|
var useSearchMarkets = (search, region) => {
|
|
1026
|
-
const { loading, error, data, refetch } = (0,
|
|
1019
|
+
const { loading, error, data, refetch } = (0, import_client17.useQuery)(SEARCH_MARKETS, {
|
|
1027
1020
|
fetchPolicy: "network-only",
|
|
1028
1021
|
skip: search.length < 3,
|
|
1029
1022
|
variables: { region, search }
|
|
@@ -1032,7 +1025,7 @@ var useSearchMarkets = (search, region) => {
|
|
|
1032
1025
|
return { error, loading, marketsSearch, refetch };
|
|
1033
1026
|
};
|
|
1034
1027
|
var useGetMarketsNearMe = (location) => {
|
|
1035
|
-
const { loading, error, data, refetch } = (0,
|
|
1028
|
+
const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_MARKETS_NEAR_ME, {
|
|
1036
1029
|
fetchPolicy: "network-only",
|
|
1037
1030
|
skip: !location.latitude || !location.longitude,
|
|
1038
1031
|
variables: {
|
|
@@ -1046,7 +1039,7 @@ var useGetMarketsNearMe = (location) => {
|
|
|
1046
1039
|
return { error, loading, marketsNearMe, refetch };
|
|
1047
1040
|
};
|
|
1048
1041
|
var useGetMarketInfo = (marketId) => {
|
|
1049
|
-
const { loading, error, data, refetch } = (0,
|
|
1042
|
+
const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_MARKET_INFO, {
|
|
1050
1043
|
fetchPolicy: "network-only",
|
|
1051
1044
|
skip: !marketId,
|
|
1052
1045
|
variables: { marketId }
|
|
@@ -1056,14 +1049,14 @@ var useGetMarketInfo = (marketId) => {
|
|
|
1056
1049
|
};
|
|
1057
1050
|
|
|
1058
1051
|
// src/graphql/hooks/notifications/hooksMutation.ts
|
|
1059
|
-
var
|
|
1052
|
+
var import_client20 = require("@apollo/client");
|
|
1060
1053
|
|
|
1061
1054
|
// src/graphql/mutations/notification.ts
|
|
1062
|
-
var
|
|
1055
|
+
var import_client19 = require("@apollo/client");
|
|
1063
1056
|
|
|
1064
1057
|
// src/graphql/queries/notification.ts
|
|
1065
|
-
var
|
|
1066
|
-
var USER_NOTIFICATION_FRAGMENT =
|
|
1058
|
+
var import_client18 = require("@apollo/client");
|
|
1059
|
+
var USER_NOTIFICATION_FRAGMENT = import_client18.gql`
|
|
1067
1060
|
fragment UserNotificationFields on Notification {
|
|
1068
1061
|
_id
|
|
1069
1062
|
userId
|
|
@@ -1076,7 +1069,7 @@ var USER_NOTIFICATION_FRAGMENT = import_client19.gql`
|
|
|
1076
1069
|
updatedAt
|
|
1077
1070
|
}
|
|
1078
1071
|
`;
|
|
1079
|
-
var GET_USER_NOTIFICATIONS =
|
|
1072
|
+
var GET_USER_NOTIFICATIONS = import_client18.gql`
|
|
1080
1073
|
query getUserNotifications($userId: String!, $limit: Int, $offset: Int) {
|
|
1081
1074
|
userNotifications(userId: $userId, limit: $limit, offset: $offset) {
|
|
1082
1075
|
...UserNotificationFields
|
|
@@ -1084,7 +1077,7 @@ var GET_USER_NOTIFICATIONS = import_client19.gql`
|
|
|
1084
1077
|
}
|
|
1085
1078
|
${USER_NOTIFICATION_FRAGMENT}
|
|
1086
1079
|
`;
|
|
1087
|
-
var GET_NOTIFICATION_COUNT =
|
|
1080
|
+
var GET_NOTIFICATION_COUNT = import_client18.gql`
|
|
1088
1081
|
query getNotificationCount($userId: String!) {
|
|
1089
1082
|
notificationCount(userId: $userId) {
|
|
1090
1083
|
total
|
|
@@ -1094,15 +1087,7 @@ var GET_NOTIFICATION_COUNT = import_client19.gql`
|
|
|
1094
1087
|
`;
|
|
1095
1088
|
|
|
1096
1089
|
// src/graphql/mutations/notification.ts
|
|
1097
|
-
var
|
|
1098
|
-
mutation createNotification($input: CreateNotificationInput!) {
|
|
1099
|
-
createNotification(input: $input) {
|
|
1100
|
-
...UserNotificationFields
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
${USER_NOTIFICATION_FRAGMENT}
|
|
1104
|
-
`;
|
|
1105
|
-
var CREATE_BULK_NOTIFICATIONS = import_client20.gql`
|
|
1090
|
+
var CREATE_BULK_NOTIFICATIONS = import_client19.gql`
|
|
1106
1091
|
mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
|
|
1107
1092
|
createBulkNotifications(input: $input) {
|
|
1108
1093
|
...UserNotificationFields
|
|
@@ -1110,7 +1095,7 @@ var CREATE_BULK_NOTIFICATIONS = import_client20.gql`
|
|
|
1110
1095
|
}
|
|
1111
1096
|
${USER_NOTIFICATION_FRAGMENT}
|
|
1112
1097
|
`;
|
|
1113
|
-
var MARK_NOTIFICATION_READ =
|
|
1098
|
+
var MARK_NOTIFICATION_READ = import_client19.gql`
|
|
1114
1099
|
mutation markNotificationRead($input: MarkNotificationReadInput!) {
|
|
1115
1100
|
markNotificationRead(input: $input) {
|
|
1116
1101
|
...UserNotificationFields
|
|
@@ -1118,30 +1103,26 @@ var MARK_NOTIFICATION_READ = import_client20.gql`
|
|
|
1118
1103
|
}
|
|
1119
1104
|
${USER_NOTIFICATION_FRAGMENT}
|
|
1120
1105
|
`;
|
|
1121
|
-
var MARK_ALL_NOTIFICATIONS_READ =
|
|
1106
|
+
var MARK_ALL_NOTIFICATIONS_READ = import_client19.gql`
|
|
1122
1107
|
mutation markAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
|
|
1123
1108
|
markAllNotificationsRead(input: $input)
|
|
1124
1109
|
}
|
|
1125
1110
|
`;
|
|
1126
|
-
var DELETE_NOTIFICATION =
|
|
1111
|
+
var DELETE_NOTIFICATION = import_client19.gql`
|
|
1127
1112
|
mutation deleteNotification($_id: ID!) {
|
|
1128
1113
|
deleteNotification(_id: $_id)
|
|
1129
1114
|
}
|
|
1130
1115
|
`;
|
|
1131
1116
|
|
|
1132
1117
|
// src/graphql/hooks/notifications/hooksMutation.ts
|
|
1133
|
-
var useCreateNotification = () => {
|
|
1134
|
-
const [createNotification, { loading, error }] = (0, import_client21.useMutation)(CREATE_NOTIFICATION);
|
|
1135
|
-
return { createNotification, error, loading };
|
|
1136
|
-
};
|
|
1137
1118
|
var useCreateBulkNotifications = () => {
|
|
1138
|
-
const [createBulkNotifications, { loading, error }] = (0,
|
|
1119
|
+
const [createBulkNotifications, { loading, error }] = (0, import_client20.useMutation)(
|
|
1139
1120
|
CREATE_BULK_NOTIFICATIONS
|
|
1140
1121
|
);
|
|
1141
1122
|
return { createBulkNotifications, error, loading };
|
|
1142
1123
|
};
|
|
1143
1124
|
var useMarkNotificationRead = () => {
|
|
1144
|
-
const [markNotificationRead, { loading, error }] = (0,
|
|
1125
|
+
const [markNotificationRead, { loading, error }] = (0, import_client20.useMutation)(
|
|
1145
1126
|
MARK_NOTIFICATION_READ,
|
|
1146
1127
|
{
|
|
1147
1128
|
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
@@ -1150,7 +1131,7 @@ var useMarkNotificationRead = () => {
|
|
|
1150
1131
|
return { error, loading, markNotificationRead };
|
|
1151
1132
|
};
|
|
1152
1133
|
var useMarkAllNotificationsRead = () => {
|
|
1153
|
-
const [markAllNotificationsRead, { loading, error }] = (0,
|
|
1134
|
+
const [markAllNotificationsRead, { loading, error }] = (0, import_client20.useMutation)(
|
|
1154
1135
|
MARK_ALL_NOTIFICATIONS_READ,
|
|
1155
1136
|
{
|
|
1156
1137
|
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
@@ -1159,7 +1140,7 @@ var useMarkAllNotificationsRead = () => {
|
|
|
1159
1140
|
return { error, loading, markAllNotificationsRead };
|
|
1160
1141
|
};
|
|
1161
1142
|
var useDeleteNotification = () => {
|
|
1162
|
-
const [deleteNotification, { loading, error }] = (0,
|
|
1143
|
+
const [deleteNotification, { loading, error }] = (0, import_client20.useMutation)(
|
|
1163
1144
|
DELETE_NOTIFICATION,
|
|
1164
1145
|
{
|
|
1165
1146
|
refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
|
|
@@ -1168,40 +1149,62 @@ var useDeleteNotification = () => {
|
|
|
1168
1149
|
return { deleteNotification, error, loading };
|
|
1169
1150
|
};
|
|
1170
1151
|
|
|
1171
|
-
// src/graphql/hooks/notifications/
|
|
1152
|
+
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
1172
1153
|
var import_client22 = require("@apollo/client");
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1154
|
+
|
|
1155
|
+
// src/graphql/subscriptions/notification.ts
|
|
1156
|
+
var import_client21 = require("@apollo/client");
|
|
1157
|
+
var USER_NOTIFICATION_FRAGMENT2 = import_client21.gql`
|
|
1158
|
+
fragment UserNotificationFields on Notification {
|
|
1159
|
+
_id
|
|
1160
|
+
userId
|
|
1161
|
+
title
|
|
1162
|
+
message
|
|
1163
|
+
type
|
|
1164
|
+
isRead
|
|
1165
|
+
data
|
|
1166
|
+
createdAt
|
|
1167
|
+
updatedAt
|
|
1168
|
+
}
|
|
1169
|
+
`;
|
|
1170
|
+
var GET_USER_NOTIFICATIONS_SUBSCRIPTION = import_client21.gql`
|
|
1171
|
+
subscription getUserNotifications($userId: String!) {
|
|
1172
|
+
getUserNotifications(userId: $userId) {
|
|
1173
|
+
...UserNotificationFields
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
${USER_NOTIFICATION_FRAGMENT2}
|
|
1177
|
+
`;
|
|
1178
|
+
var GET_NOTIFICATION_COUNT_SUBSCRIPTION = import_client21.gql`
|
|
1179
|
+
subscription getNotificationCount($userId: String!) {
|
|
1180
|
+
getNotificationCount(userId: $userId) {
|
|
1181
|
+
total
|
|
1182
|
+
unread
|
|
1181
1183
|
}
|
|
1184
|
+
}
|
|
1185
|
+
`;
|
|
1186
|
+
|
|
1187
|
+
// src/graphql/hooks/notifications/hooksSubscription.ts
|
|
1188
|
+
var useGetUserNotificationsSubscription = (userId) => {
|
|
1189
|
+
const { data, loading, error } = (0, import_client22.useSubscription)(GET_USER_NOTIFICATIONS_SUBSCRIPTION, {
|
|
1190
|
+
skip: !userId,
|
|
1191
|
+
variables: { userId }
|
|
1182
1192
|
});
|
|
1183
|
-
const notifications = data?.userNotifications;
|
|
1184
1193
|
return {
|
|
1185
1194
|
error,
|
|
1186
1195
|
loading,
|
|
1187
|
-
notifications
|
|
1188
|
-
refetch
|
|
1196
|
+
notifications: data?.getUserNotifications || []
|
|
1189
1197
|
};
|
|
1190
1198
|
};
|
|
1191
|
-
var
|
|
1192
|
-
const { data,
|
|
1193
|
-
fetchPolicy: "no-cache",
|
|
1199
|
+
var useGetNotificationCountSubscription = (userId) => {
|
|
1200
|
+
const { data, loading, error } = (0, import_client22.useSubscription)(GET_NOTIFICATION_COUNT_SUBSCRIPTION, {
|
|
1194
1201
|
skip: !userId,
|
|
1195
|
-
variables: {
|
|
1196
|
-
userId
|
|
1197
|
-
}
|
|
1202
|
+
variables: { userId }
|
|
1198
1203
|
});
|
|
1199
|
-
const notificationCount = data?.notificationCount;
|
|
1200
1204
|
return {
|
|
1201
1205
|
error,
|
|
1202
1206
|
loading,
|
|
1203
|
-
notificationCount,
|
|
1204
|
-
refetch
|
|
1207
|
+
notificationCount: data?.getNotificationCount || { total: 0, unread: 0 }
|
|
1205
1208
|
};
|
|
1206
1209
|
};
|
|
1207
1210
|
|
|
@@ -2092,7 +2095,6 @@ var useGetUserFavourites = () => {
|
|
|
2092
2095
|
};
|
|
2093
2096
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2094
2097
|
0 && (module.exports = {
|
|
2095
|
-
GET_CHAT_MESSAGE,
|
|
2096
2098
|
useAddParticipantToChat,
|
|
2097
2099
|
useAddUserFavouriteResource,
|
|
2098
2100
|
useAdminUpdateResourceType,
|
|
@@ -2101,7 +2103,6 @@ var useGetUserFavourites = () => {
|
|
|
2101
2103
|
useCreateChat,
|
|
2102
2104
|
useCreateMarket,
|
|
2103
2105
|
useCreateMarketInfo,
|
|
2104
|
-
useCreateNotification,
|
|
2105
2106
|
useCreatePoster,
|
|
2106
2107
|
useCreatePushToken,
|
|
2107
2108
|
useCreateRelation,
|
|
@@ -2124,7 +2125,7 @@ var useGetUserFavourites = () => {
|
|
|
2124
2125
|
useGetMarkets,
|
|
2125
2126
|
useGetMarketsByRegion,
|
|
2126
2127
|
useGetMarketsNearMe,
|
|
2127
|
-
|
|
2128
|
+
useGetNotificationCountSubscription,
|
|
2128
2129
|
useGetRelation,
|
|
2129
2130
|
useGetRelationByMarketAndStallholder,
|
|
2130
2131
|
useGetResourceConnections,
|
|
@@ -2139,7 +2140,7 @@ var useGetUserFavourites = () => {
|
|
|
2139
2140
|
useGetUserChats,
|
|
2140
2141
|
useGetUserFavourites,
|
|
2141
2142
|
useGetUserMarkets,
|
|
2142
|
-
|
|
2143
|
+
useGetUserNotificationsSubscription,
|
|
2143
2144
|
useGetUserStallholder,
|
|
2144
2145
|
useGetUsers,
|
|
2145
2146
|
useLogin,
|