@timardex/cluemart-shared 1.0.81 → 1.0.83
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/{notification-BVKetNZq.d.mts → contactUs-CQ9xTjlE.d.mts} +1 -38
- package/dist/{notification-BVKetNZq.d.ts → contactUs-CQ9xTjlE.d.ts} +1 -38
- package/dist/graphql/index.cjs +313 -242
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +48 -16
- package/dist/graphql/index.d.ts +48 -16
- package/dist/graphql/index.mjs +289 -124
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +0 -202
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +2 -25
- package/dist/hooks/index.d.ts +2 -25
- package/dist/hooks/index.mjs +0 -104
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +325 -338
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +68 -56
- package/dist/index.d.ts +68 -56
- package/dist/index.mjs +300 -314
- package/dist/index.mjs.map +1 -1
- package/dist/notification-Dy46qobo.d.mts +66 -0
- package/dist/notification-Dy46qobo.d.ts +66 -0
- package/dist/types/index.cjs +21 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.mjs +14 -0
- package/dist/types/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chat-BUVCf9Tu.d.mts +0 -27
- package/dist/chat-BUVCf9Tu.d.ts +0 -27
- package/dist/chunk-SCXVJDGI.mjs +0 -114
- package/dist/chunk-SCXVJDGI.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -30,10 +30,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
CREATE_BULK_NOTIFICATIONS: () => CREATE_BULK_NOTIFICATIONS,
|
|
34
|
-
CREATE_NOTIFICATION: () => CREATE_NOTIFICATION,
|
|
35
33
|
EnumInviteStatus: () => EnumInviteStatus,
|
|
36
34
|
EnumNotification: () => EnumNotification,
|
|
35
|
+
EnumNotificationType: () => EnumNotificationType,
|
|
37
36
|
EnumOSType: () => EnumOSType,
|
|
38
37
|
EnumPaymentMethod: () => EnumPaymentMethod,
|
|
39
38
|
EnumRegions: () => EnumRegions,
|
|
@@ -43,12 +42,8 @@ __export(index_exports, {
|
|
|
43
42
|
EnumSocialMedia: () => EnumSocialMedia,
|
|
44
43
|
EnumUserLicence: () => EnumUserLicence,
|
|
45
44
|
EnumUserRole: () => EnumUserRole,
|
|
46
|
-
|
|
47
|
-
GET_UNREAD_NOTIFICATIONS: () => GET_UNREAD_NOTIFICATIONS,
|
|
48
|
-
GET_USER_NOTIFICATIONS: () => GET_USER_NOTIFICATIONS2,
|
|
45
|
+
GET_CHAT_MESSAGE: () => GET_CHAT_MESSAGE,
|
|
49
46
|
ImageTypeEnum: () => ImageTypeEnum,
|
|
50
|
-
MARK_ALL_NOTIFICATIONS_READ: () => MARK_ALL_NOTIFICATIONS_READ,
|
|
51
|
-
MARK_NOTIFICATION_READ: () => MARK_NOTIFICATION_READ,
|
|
52
47
|
SAVED_EMAIL_KEY: () => SAVED_EMAIL_KEY,
|
|
53
48
|
SAVED_PASSWORD_KEY: () => SAVED_PASSWORD_KEY,
|
|
54
49
|
SAVED_REFRESH_TOKEN_KEY: () => SAVED_REFRESH_TOKEN_KEY,
|
|
@@ -121,9 +116,11 @@ __export(index_exports, {
|
|
|
121
116
|
useAdminUpdateResourceType: () => useAdminUpdateResourceType,
|
|
122
117
|
useContactUs: () => useContactUs,
|
|
123
118
|
useContactUsForm: () => useContactUsForm,
|
|
119
|
+
useCreateBulkNotifications: () => useCreateBulkNotifications,
|
|
124
120
|
useCreateChat: () => useCreateChat,
|
|
125
121
|
useCreateMarket: () => useCreateMarket,
|
|
126
122
|
useCreateMarketInfo: () => useCreateMarketInfo,
|
|
123
|
+
useCreateNotification: () => useCreateNotification,
|
|
127
124
|
useCreatePoster: () => useCreatePoster,
|
|
128
125
|
useCreatePushToken: () => useCreatePushToken,
|
|
129
126
|
useCreateRelation: () => useCreateRelation,
|
|
@@ -138,12 +135,14 @@ __export(index_exports, {
|
|
|
138
135
|
useDeleteTester: () => useDeleteTester,
|
|
139
136
|
useDeleteUser: () => useDeleteUser,
|
|
140
137
|
useGetChat: () => useGetChat,
|
|
138
|
+
useGetChatSubscription: () => useGetChatSubscription,
|
|
141
139
|
useGetMarket: () => useGetMarket,
|
|
142
140
|
useGetMarketInfo: () => useGetMarketInfo,
|
|
143
141
|
useGetMarketRelations: () => useGetMarketRelations,
|
|
144
142
|
useGetMarkets: () => useGetMarkets,
|
|
145
143
|
useGetMarketsByRegion: () => useGetMarketsByRegion,
|
|
146
144
|
useGetMarketsNearMe: () => useGetMarketsNearMe,
|
|
145
|
+
useGetNotificationCount: () => useGetNotificationCount,
|
|
147
146
|
useGetRelation: () => useGetRelation,
|
|
148
147
|
useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
|
|
149
148
|
useGetResourceConnections: () => useGetResourceConnections,
|
|
@@ -154,6 +153,7 @@ __export(index_exports, {
|
|
|
154
153
|
useGetStallholdersByRegion: () => useGetStallholdersByRegion,
|
|
155
154
|
useGetTester: () => useGetTester,
|
|
156
155
|
useGetTesters: () => useGetTesters,
|
|
156
|
+
useGetUnreadNotifications: () => useGetUnreadNotifications,
|
|
157
157
|
useGetUser: () => useGetUser,
|
|
158
158
|
useGetUserChats: () => useGetUserChats,
|
|
159
159
|
useGetUserFavourites: () => useGetUserFavourites,
|
|
@@ -165,9 +165,10 @@ __export(index_exports, {
|
|
|
165
165
|
useLogin: () => useLogin,
|
|
166
166
|
useLoginForm: () => useLoginForm,
|
|
167
167
|
useLogout: () => useLogout,
|
|
168
|
+
useMarkAllNotificationsRead: () => useMarkAllNotificationsRead,
|
|
169
|
+
useMarkNotificationRead: () => useMarkNotificationRead,
|
|
168
170
|
useMarketForm: () => useMarketForm,
|
|
169
171
|
useMarketInfoForm: () => useMarketInfoForm,
|
|
170
|
-
useNotifications: () => useNotifications,
|
|
171
172
|
useRefreshToken: () => useRefreshToken,
|
|
172
173
|
useRegister: () => useRegister,
|
|
173
174
|
useRegisterForm: () => useRegisterForm,
|
|
@@ -2668,9 +2669,22 @@ var useRemoveParticipantFromChat = () => {
|
|
|
2668
2669
|
};
|
|
2669
2670
|
|
|
2670
2671
|
// src/graphql/hooks/chat/hooksQuery.ts
|
|
2672
|
+
var import_client12 = require("@apollo/client");
|
|
2673
|
+
|
|
2674
|
+
// src/graphql/subscriptions/chat.ts
|
|
2671
2675
|
var import_client11 = require("@apollo/client");
|
|
2676
|
+
var GET_CHAT_MESSAGE = import_client11.gql`
|
|
2677
|
+
subscription {
|
|
2678
|
+
getChatMessage {
|
|
2679
|
+
...ChatFields
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
${CHAT_FIELDS_FRAGMENT}
|
|
2683
|
+
`;
|
|
2684
|
+
|
|
2685
|
+
// src/graphql/hooks/chat/hooksQuery.ts
|
|
2672
2686
|
var useGetChat = (_id) => {
|
|
2673
|
-
const { loading, error, data, refetch } = (0,
|
|
2687
|
+
const { loading, error, data, refetch } = (0, import_client12.useQuery)(CHAT, {
|
|
2674
2688
|
fetchPolicy: "network-only",
|
|
2675
2689
|
skip: !_id,
|
|
2676
2690
|
variables: { _id }
|
|
@@ -2679,19 +2693,24 @@ var useGetChat = (_id) => {
|
|
|
2679
2693
|
return { chat, error, loading, refetch };
|
|
2680
2694
|
};
|
|
2681
2695
|
var useGetUserChats = () => {
|
|
2682
|
-
const { loading, error, data, refetch } = (0,
|
|
2696
|
+
const { loading, error, data, refetch } = (0, import_client12.useQuery)(USER_CHATS, {
|
|
2683
2697
|
fetchPolicy: "network-only"
|
|
2684
2698
|
});
|
|
2685
2699
|
const userChats = data?.userChats;
|
|
2686
2700
|
return { error, loading, refetch, userChats };
|
|
2687
2701
|
};
|
|
2702
|
+
var useGetChatSubscription = () => {
|
|
2703
|
+
const { data, loading, error } = (0, import_client12.useSubscription)(GET_CHAT_MESSAGE);
|
|
2704
|
+
const chat = data?.getChat;
|
|
2705
|
+
return { chat, error, loading };
|
|
2706
|
+
};
|
|
2688
2707
|
|
|
2689
2708
|
// src/graphql/hooks/contactUs.ts
|
|
2690
|
-
var
|
|
2709
|
+
var import_client14 = require("@apollo/client");
|
|
2691
2710
|
|
|
2692
2711
|
// src/graphql/mutations/contactUs.ts
|
|
2693
|
-
var
|
|
2694
|
-
var CONTACT_US_MUTATION =
|
|
2712
|
+
var import_client13 = require("@apollo/client");
|
|
2713
|
+
var CONTACT_US_MUTATION = import_client13.gql`
|
|
2695
2714
|
mutation contactUs($input: ContactUsInputType!) {
|
|
2696
2715
|
contactUs(input: $input) {
|
|
2697
2716
|
message
|
|
@@ -2701,16 +2720,16 @@ var CONTACT_US_MUTATION = import_client12.gql`
|
|
|
2701
2720
|
|
|
2702
2721
|
// src/graphql/hooks/contactUs.ts
|
|
2703
2722
|
var useContactUs = () => {
|
|
2704
|
-
const [contactUs, { loading, error }] = (0,
|
|
2723
|
+
const [contactUs, { loading, error }] = (0, import_client14.useMutation)(CONTACT_US_MUTATION);
|
|
2705
2724
|
return { contactUs, error, loading };
|
|
2706
2725
|
};
|
|
2707
2726
|
|
|
2708
2727
|
// src/graphql/hooks/market/hooksMutation.ts
|
|
2709
|
-
var
|
|
2728
|
+
var import_client17 = require("@apollo/client");
|
|
2710
2729
|
|
|
2711
2730
|
// src/graphql/mutations/market.ts
|
|
2712
|
-
var
|
|
2713
|
-
var CREATE_MARKET_MUTATION =
|
|
2731
|
+
var import_client15 = require("@apollo/client");
|
|
2732
|
+
var CREATE_MARKET_MUTATION = import_client15.gql`
|
|
2714
2733
|
mutation createMarket($input: MarketInputType!) {
|
|
2715
2734
|
createMarket(input: $input) {
|
|
2716
2735
|
...MarketFields
|
|
@@ -2718,7 +2737,7 @@ var CREATE_MARKET_MUTATION = import_client14.gql`
|
|
|
2718
2737
|
}
|
|
2719
2738
|
${MARKET}
|
|
2720
2739
|
`;
|
|
2721
|
-
var UPDATE_MARKET_MUTATION =
|
|
2740
|
+
var UPDATE_MARKET_MUTATION = import_client15.gql`
|
|
2722
2741
|
mutation updateMarket($_id: ID!, $input: MarketInputType!) {
|
|
2723
2742
|
updateMarket(_id: $_id, input: $input) {
|
|
2724
2743
|
...MarketFields
|
|
@@ -2726,12 +2745,12 @@ var UPDATE_MARKET_MUTATION = import_client14.gql`
|
|
|
2726
2745
|
}
|
|
2727
2746
|
${MARKET}
|
|
2728
2747
|
`;
|
|
2729
|
-
var DELETE_MARKET_MUTATION =
|
|
2748
|
+
var DELETE_MARKET_MUTATION = import_client15.gql`
|
|
2730
2749
|
mutation deleteMarket($_id: ID!) {
|
|
2731
2750
|
deleteMarket(_id: $_id)
|
|
2732
2751
|
}
|
|
2733
2752
|
`;
|
|
2734
|
-
var CREATE_MARKET_INFO_MUTATION =
|
|
2753
|
+
var CREATE_MARKET_INFO_MUTATION = import_client15.gql`
|
|
2735
2754
|
mutation createMarketInfo($input: MarketInfoInputType!) {
|
|
2736
2755
|
createMarketInfo(input: $input) {
|
|
2737
2756
|
...MarketInfoFields
|
|
@@ -2739,7 +2758,7 @@ var CREATE_MARKET_INFO_MUTATION = import_client14.gql`
|
|
|
2739
2758
|
}
|
|
2740
2759
|
${MARKET_INFO}
|
|
2741
2760
|
`;
|
|
2742
|
-
var UPDATE_MARKET_INFO_MUTATION =
|
|
2761
|
+
var UPDATE_MARKET_INFO_MUTATION = import_client15.gql`
|
|
2743
2762
|
mutation updateMarketInfo($_id: ID!, $input: MarketInfoInputType!) {
|
|
2744
2763
|
updateMarketInfo(_id: $_id, input: $input) {
|
|
2745
2764
|
...MarketInfoFields
|
|
@@ -2749,8 +2768,8 @@ var UPDATE_MARKET_INFO_MUTATION = import_client14.gql`
|
|
|
2749
2768
|
`;
|
|
2750
2769
|
|
|
2751
2770
|
// src/graphql/queries/user.ts
|
|
2752
|
-
var
|
|
2753
|
-
var GET_USERS =
|
|
2771
|
+
var import_client16 = require("@apollo/client");
|
|
2772
|
+
var GET_USERS = import_client16.gql`
|
|
2754
2773
|
query getUsers {
|
|
2755
2774
|
users {
|
|
2756
2775
|
...UserFields
|
|
@@ -2758,7 +2777,7 @@ var GET_USERS = import_client15.gql`
|
|
|
2758
2777
|
}
|
|
2759
2778
|
${USER_FIELDS_FRAGMENT}
|
|
2760
2779
|
`;
|
|
2761
|
-
var GET_USER =
|
|
2780
|
+
var GET_USER = import_client16.gql`
|
|
2762
2781
|
query getUser($_id: ID!) {
|
|
2763
2782
|
user(_id: $_id) {
|
|
2764
2783
|
...UserFields
|
|
@@ -2766,7 +2785,7 @@ var GET_USER = import_client15.gql`
|
|
|
2766
2785
|
}
|
|
2767
2786
|
${USER_FIELDS_FRAGMENT}
|
|
2768
2787
|
`;
|
|
2769
|
-
var GET_USER_MARKETS =
|
|
2788
|
+
var GET_USER_MARKETS = import_client16.gql`
|
|
2770
2789
|
query getUserMarkets {
|
|
2771
2790
|
userMarkets {
|
|
2772
2791
|
...MarketFields
|
|
@@ -2774,7 +2793,7 @@ var GET_USER_MARKETS = import_client15.gql`
|
|
|
2774
2793
|
}
|
|
2775
2794
|
${MARKET}
|
|
2776
2795
|
`;
|
|
2777
|
-
var GET_USER_STALLHOLDER =
|
|
2796
|
+
var GET_USER_STALLHOLDER = import_client16.gql`
|
|
2778
2797
|
query getUserStallholder {
|
|
2779
2798
|
userStallholder {
|
|
2780
2799
|
...StallholderFields
|
|
@@ -2782,7 +2801,7 @@ var GET_USER_STALLHOLDER = import_client15.gql`
|
|
|
2782
2801
|
}
|
|
2783
2802
|
${STALLHOLDER}
|
|
2784
2803
|
`;
|
|
2785
|
-
var GET_USER_FAVOURITES =
|
|
2804
|
+
var GET_USER_FAVOURITES = import_client16.gql`
|
|
2786
2805
|
query getUserFavourites {
|
|
2787
2806
|
userFavourites {
|
|
2788
2807
|
markets {
|
|
@@ -2796,15 +2815,10 @@ var GET_USER_FAVOURITES = import_client15.gql`
|
|
|
2796
2815
|
${MARKET}
|
|
2797
2816
|
${STALLHOLDER}
|
|
2798
2817
|
`;
|
|
2799
|
-
var GET_USER_NOTIFICATIONS = import_client15.gql`
|
|
2800
|
-
query getMissedNotifications {
|
|
2801
|
-
userNotifications
|
|
2802
|
-
}
|
|
2803
|
-
`;
|
|
2804
2818
|
|
|
2805
2819
|
// src/graphql/hooks/market/hooksMutation.ts
|
|
2806
2820
|
var useCreateMarket = () => {
|
|
2807
|
-
const [createMarket, { loading, error }] = (0,
|
|
2821
|
+
const [createMarket, { loading, error }] = (0, import_client17.useMutation)(
|
|
2808
2822
|
CREATE_MARKET_MUTATION,
|
|
2809
2823
|
{
|
|
2810
2824
|
awaitRefetchQueries: true,
|
|
@@ -2814,7 +2828,7 @@ var useCreateMarket = () => {
|
|
|
2814
2828
|
return { createMarket, error, loading };
|
|
2815
2829
|
};
|
|
2816
2830
|
var useUpdateMarket = () => {
|
|
2817
|
-
const [updateMarket, { loading, error }] = (0,
|
|
2831
|
+
const [updateMarket, { loading, error }] = (0, import_client17.useMutation)(
|
|
2818
2832
|
UPDATE_MARKET_MUTATION,
|
|
2819
2833
|
{
|
|
2820
2834
|
awaitRefetchQueries: true,
|
|
@@ -2824,7 +2838,7 @@ var useUpdateMarket = () => {
|
|
|
2824
2838
|
return { error, loading, updateMarket };
|
|
2825
2839
|
};
|
|
2826
2840
|
var useDeleteMarket = () => {
|
|
2827
|
-
const [deleteMarket, { loading, error }] = (0,
|
|
2841
|
+
const [deleteMarket, { loading, error }] = (0, import_client17.useMutation)(
|
|
2828
2842
|
DELETE_MARKET_MUTATION,
|
|
2829
2843
|
{
|
|
2830
2844
|
awaitRefetchQueries: true,
|
|
@@ -2834,7 +2848,7 @@ var useDeleteMarket = () => {
|
|
|
2834
2848
|
return { deleteMarket, error, loading };
|
|
2835
2849
|
};
|
|
2836
2850
|
var useCreateMarketInfo = () => {
|
|
2837
|
-
const [createMarketInfo, { loading, error }] = (0,
|
|
2851
|
+
const [createMarketInfo, { loading, error }] = (0, import_client17.useMutation)(
|
|
2838
2852
|
CREATE_MARKET_INFO_MUTATION,
|
|
2839
2853
|
{
|
|
2840
2854
|
awaitRefetchQueries: true,
|
|
@@ -2860,7 +2874,7 @@ var useCreateMarketInfo = () => {
|
|
|
2860
2874
|
return { createMarketInfo, error, loading };
|
|
2861
2875
|
};
|
|
2862
2876
|
var useUpdateMarketInfo = () => {
|
|
2863
|
-
const [updateMarketInfo, { loading, error }] = (0,
|
|
2877
|
+
const [updateMarketInfo, { loading, error }] = (0, import_client17.useMutation)(
|
|
2864
2878
|
UPDATE_MARKET_INFO_MUTATION,
|
|
2865
2879
|
{
|
|
2866
2880
|
awaitRefetchQueries: true,
|
|
@@ -2886,16 +2900,16 @@ var useUpdateMarketInfo = () => {
|
|
|
2886
2900
|
};
|
|
2887
2901
|
|
|
2888
2902
|
// src/graphql/hooks/market/hooksQuery.ts
|
|
2889
|
-
var
|
|
2903
|
+
var import_client18 = require("@apollo/client");
|
|
2890
2904
|
var useGetMarkets = () => {
|
|
2891
|
-
const { loading, error, data, refetch } = (0,
|
|
2905
|
+
const { loading, error, data, refetch } = (0, import_client18.useQuery)(GET_MARKETS, {
|
|
2892
2906
|
fetchPolicy: "network-only"
|
|
2893
2907
|
});
|
|
2894
2908
|
const markets = data?.markets;
|
|
2895
2909
|
return { error, loading, markets, refetch };
|
|
2896
2910
|
};
|
|
2897
2911
|
var useGetMarket = (_id) => {
|
|
2898
|
-
const { loading, error, data, refetch } = (0,
|
|
2912
|
+
const { loading, error, data, refetch } = (0, import_client18.useQuery)(GET_MARKET, {
|
|
2899
2913
|
fetchPolicy: "network-only",
|
|
2900
2914
|
skip: !_id,
|
|
2901
2915
|
variables: { _id }
|
|
@@ -2904,7 +2918,7 @@ var useGetMarket = (_id) => {
|
|
|
2904
2918
|
return { error, loading, market, refetch };
|
|
2905
2919
|
};
|
|
2906
2920
|
var useGetMarketsByRegion = (region) => {
|
|
2907
|
-
const { loading, error, data, refetch } = (0,
|
|
2921
|
+
const { loading, error, data, refetch } = (0, import_client18.useQuery)(GET_MARKETS_BY_REGION, {
|
|
2908
2922
|
fetchPolicy: "no-cache",
|
|
2909
2923
|
skip: !region,
|
|
2910
2924
|
variables: { region }
|
|
@@ -2913,7 +2927,7 @@ var useGetMarketsByRegion = (region) => {
|
|
|
2913
2927
|
return { error, loading, marketsByRegion, refetch };
|
|
2914
2928
|
};
|
|
2915
2929
|
var useSearchMarkets = (search, region) => {
|
|
2916
|
-
const { loading, error, data, refetch } = (0,
|
|
2930
|
+
const { loading, error, data, refetch } = (0, import_client18.useQuery)(SEARCH_MARKETS, {
|
|
2917
2931
|
fetchPolicy: "network-only",
|
|
2918
2932
|
skip: search.length < 3,
|
|
2919
2933
|
variables: { region, search }
|
|
@@ -2922,7 +2936,7 @@ var useSearchMarkets = (search, region) => {
|
|
|
2922
2936
|
return { error, loading, marketsSearch, refetch };
|
|
2923
2937
|
};
|
|
2924
2938
|
var useGetMarketsNearMe = (location) => {
|
|
2925
|
-
const { loading, error, data, refetch } = (0,
|
|
2939
|
+
const { loading, error, data, refetch } = (0, import_client18.useQuery)(GET_MARKETS_NEAR_ME, {
|
|
2926
2940
|
fetchPolicy: "network-only",
|
|
2927
2941
|
skip: !location.latitude || !location.longitude,
|
|
2928
2942
|
variables: {
|
|
@@ -2936,7 +2950,7 @@ var useGetMarketsNearMe = (location) => {
|
|
|
2936
2950
|
return { error, loading, marketsNearMe, refetch };
|
|
2937
2951
|
};
|
|
2938
2952
|
var useGetMarketInfo = (marketId) => {
|
|
2939
|
-
const { loading, error, data, refetch } = (0,
|
|
2953
|
+
const { loading, error, data, refetch } = (0, import_client18.useQuery)(GET_MARKET_INFO, {
|
|
2940
2954
|
fetchPolicy: "network-only",
|
|
2941
2955
|
skip: !marketId,
|
|
2942
2956
|
variables: { marketId }
|
|
@@ -2945,12 +2959,179 @@ var useGetMarketInfo = (marketId) => {
|
|
|
2945
2959
|
return { error, loading, marketInfo: marketInfo2, refetch };
|
|
2946
2960
|
};
|
|
2947
2961
|
|
|
2948
|
-
// src/graphql/hooks/
|
|
2962
|
+
// src/graphql/hooks/notifications/hooksMutation.ts
|
|
2963
|
+
var import_client21 = require("@apollo/client");
|
|
2964
|
+
|
|
2965
|
+
// src/graphql/mutations/notification.ts
|
|
2966
|
+
var import_client20 = require("@apollo/client");
|
|
2967
|
+
|
|
2968
|
+
// src/graphql/queries/notification.ts
|
|
2949
2969
|
var import_client19 = require("@apollo/client");
|
|
2970
|
+
var USER_NOTIFICATION_FRAGMENT = import_client19.gql`
|
|
2971
|
+
fragment UserNotificationFields on Notification {
|
|
2972
|
+
id
|
|
2973
|
+
userId
|
|
2974
|
+
title
|
|
2975
|
+
message
|
|
2976
|
+
type
|
|
2977
|
+
isRead
|
|
2978
|
+
data
|
|
2979
|
+
createdAt
|
|
2980
|
+
updatedAt
|
|
2981
|
+
}
|
|
2982
|
+
`;
|
|
2983
|
+
var GET_USER_NOTIFICATIONS = import_client19.gql`
|
|
2984
|
+
query getUserNotifications(
|
|
2985
|
+
$userId: String!
|
|
2986
|
+
$limit: Int
|
|
2987
|
+
$offset: Int
|
|
2988
|
+
$isRead: String
|
|
2989
|
+
) {
|
|
2990
|
+
userNotifications(
|
|
2991
|
+
userId: $userId
|
|
2992
|
+
limit: $limit
|
|
2993
|
+
offset: $offset
|
|
2994
|
+
isRead: $isRead
|
|
2995
|
+
) {
|
|
2996
|
+
...UserNotificationFields
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
${USER_NOTIFICATION_FRAGMENT}
|
|
3000
|
+
`;
|
|
3001
|
+
var GET_UNREAD_NOTIFICATIONS = import_client19.gql`
|
|
3002
|
+
query getUnreadNotifications($userId: String!, $limit: Int) {
|
|
3003
|
+
unreadNotifications(userId: $userId, limit: $limit) {
|
|
3004
|
+
...UserNotificationFields
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
${USER_NOTIFICATION_FRAGMENT}
|
|
3008
|
+
`;
|
|
3009
|
+
var GET_NOTIFICATION_COUNT = import_client19.gql`
|
|
3010
|
+
query getNotificationCount($userId: String!) {
|
|
3011
|
+
notificationCount(userId: $userId) {
|
|
3012
|
+
total
|
|
3013
|
+
unread
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
`;
|
|
3017
|
+
|
|
3018
|
+
// src/graphql/mutations/notification.ts
|
|
3019
|
+
var CREATE_NOTIFICATION = import_client20.gql`
|
|
3020
|
+
mutation createNotification($input: CreateNotificationInput!) {
|
|
3021
|
+
createNotification(input: $input) {
|
|
3022
|
+
...UserNotificationFields
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
${USER_NOTIFICATION_FRAGMENT}
|
|
3026
|
+
`;
|
|
3027
|
+
var CREATE_BULK_NOTIFICATIONS = import_client20.gql`
|
|
3028
|
+
mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
|
|
3029
|
+
createBulkNotifications(input: $input) {
|
|
3030
|
+
...UserNotificationFields
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
${USER_NOTIFICATION_FRAGMENT}
|
|
3034
|
+
`;
|
|
3035
|
+
var MARK_NOTIFICATION_READ = import_client20.gql`
|
|
3036
|
+
mutation markNotificationRead($input: MarkNotificationReadInput!) {
|
|
3037
|
+
markNotificationRead(input: $input) {
|
|
3038
|
+
...UserNotificationFields
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
${USER_NOTIFICATION_FRAGMENT}
|
|
3042
|
+
`;
|
|
3043
|
+
var MARK_ALL_NOTIFICATIONS_READ = import_client20.gql`
|
|
3044
|
+
mutation markAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
|
|
3045
|
+
markAllNotificationsRead(input: $input)
|
|
3046
|
+
}
|
|
3047
|
+
`;
|
|
3048
|
+
|
|
3049
|
+
// src/graphql/hooks/notifications/hooksMutation.ts
|
|
3050
|
+
var useCreateNotification = () => {
|
|
3051
|
+
const [createNotification, { loading, error }] = (0, import_client21.useMutation)(CREATE_NOTIFICATION);
|
|
3052
|
+
return { createNotification, error, loading };
|
|
3053
|
+
};
|
|
3054
|
+
var useCreateBulkNotifications = () => {
|
|
3055
|
+
const [createBulkNotifications, { loading, error }] = (0, import_client21.useMutation)(
|
|
3056
|
+
CREATE_BULK_NOTIFICATIONS
|
|
3057
|
+
);
|
|
3058
|
+
return { createBulkNotifications, error, loading };
|
|
3059
|
+
};
|
|
3060
|
+
var useMarkNotificationRead = () => {
|
|
3061
|
+
const [markNotificationRead, { loading, error }] = (0, import_client21.useMutation)(
|
|
3062
|
+
MARK_NOTIFICATION_READ
|
|
3063
|
+
);
|
|
3064
|
+
return { error, loading, markNotificationRead };
|
|
3065
|
+
};
|
|
3066
|
+
var useMarkAllNotificationsRead = () => {
|
|
3067
|
+
const [markAllNotificationsRead, { loading, error }] = (0, import_client21.useMutation)(
|
|
3068
|
+
MARK_ALL_NOTIFICATIONS_READ
|
|
3069
|
+
);
|
|
3070
|
+
return { error, loading, markAllNotificationsRead };
|
|
3071
|
+
};
|
|
3072
|
+
|
|
3073
|
+
// src/graphql/hooks/notifications/hooksQuery.ts
|
|
3074
|
+
var import_client22 = require("@apollo/client");
|
|
3075
|
+
var useGetUserNotifications = (userId, limit, offset, isRead) => {
|
|
3076
|
+
const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_USER_NOTIFICATIONS, {
|
|
3077
|
+
fetchPolicy: "no-cache",
|
|
3078
|
+
skip: !userId,
|
|
3079
|
+
variables: {
|
|
3080
|
+
isRead,
|
|
3081
|
+
limit: limit ?? 50,
|
|
3082
|
+
offset: offset ?? 0,
|
|
3083
|
+
userId
|
|
3084
|
+
}
|
|
3085
|
+
});
|
|
3086
|
+
const notifications = data?.userNotifications;
|
|
3087
|
+
return {
|
|
3088
|
+
error,
|
|
3089
|
+
loading,
|
|
3090
|
+
notifications,
|
|
3091
|
+
refetch
|
|
3092
|
+
};
|
|
3093
|
+
};
|
|
3094
|
+
var useGetUnreadNotifications = (userId, limit) => {
|
|
3095
|
+
const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_UNREAD_NOTIFICATIONS, {
|
|
3096
|
+
fetchPolicy: "no-cache",
|
|
3097
|
+
skip: !userId,
|
|
3098
|
+
variables: {
|
|
3099
|
+
limit: limit ?? 50,
|
|
3100
|
+
offset: 0,
|
|
3101
|
+
userId
|
|
3102
|
+
}
|
|
3103
|
+
});
|
|
3104
|
+
const notifications = data?.unreadNotifications;
|
|
3105
|
+
return {
|
|
3106
|
+
error,
|
|
3107
|
+
loading,
|
|
3108
|
+
notifications,
|
|
3109
|
+
refetch
|
|
3110
|
+
};
|
|
3111
|
+
};
|
|
3112
|
+
var useGetNotificationCount = (userId) => {
|
|
3113
|
+
const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_NOTIFICATION_COUNT, {
|
|
3114
|
+
fetchPolicy: "no-cache",
|
|
3115
|
+
skip: !userId,
|
|
3116
|
+
variables: {
|
|
3117
|
+
userId
|
|
3118
|
+
}
|
|
3119
|
+
});
|
|
3120
|
+
const notificationCount = data?.notificationCount;
|
|
3121
|
+
return {
|
|
3122
|
+
error,
|
|
3123
|
+
loading,
|
|
3124
|
+
notificationCount,
|
|
3125
|
+
refetch
|
|
3126
|
+
};
|
|
3127
|
+
};
|
|
3128
|
+
|
|
3129
|
+
// src/graphql/hooks/poster.ts
|
|
3130
|
+
var import_client24 = require("@apollo/client");
|
|
2950
3131
|
|
|
2951
3132
|
// src/graphql/mutations/poster.ts
|
|
2952
|
-
var
|
|
2953
|
-
var CREATE_POSTER_MUTATION =
|
|
3133
|
+
var import_client23 = require("@apollo/client");
|
|
3134
|
+
var CREATE_POSTER_MUTATION = import_client23.gql`
|
|
2954
3135
|
mutation createPoster($input: PosterInputType!) {
|
|
2955
3136
|
createPoster(input: $input) {
|
|
2956
3137
|
message
|
|
@@ -2960,18 +3141,18 @@ var CREATE_POSTER_MUTATION = import_client18.gql`
|
|
|
2960
3141
|
|
|
2961
3142
|
// src/graphql/hooks/poster.ts
|
|
2962
3143
|
var useCreatePoster = () => {
|
|
2963
|
-
const [createPoster, { loading, error }] = (0,
|
|
3144
|
+
const [createPoster, { loading, error }] = (0, import_client24.useMutation)(
|
|
2964
3145
|
CREATE_POSTER_MUTATION
|
|
2965
3146
|
);
|
|
2966
3147
|
return { createPoster, error, loading };
|
|
2967
3148
|
};
|
|
2968
3149
|
|
|
2969
3150
|
// src/graphql/hooks/pushToken.ts
|
|
2970
|
-
var
|
|
3151
|
+
var import_client26 = require("@apollo/client");
|
|
2971
3152
|
|
|
2972
3153
|
// src/graphql/mutations/pushToken.ts
|
|
2973
|
-
var
|
|
2974
|
-
var CREATE_PUSH_TOKEN_MUTATION =
|
|
3154
|
+
var import_client25 = require("@apollo/client");
|
|
3155
|
+
var CREATE_PUSH_TOKEN_MUTATION = import_client25.gql`
|
|
2975
3156
|
mutation createPushToken($input: PushTokenInput!) {
|
|
2976
3157
|
createPushToken(input: $input) {
|
|
2977
3158
|
success
|
|
@@ -2981,21 +3162,21 @@ var CREATE_PUSH_TOKEN_MUTATION = import_client20.gql`
|
|
|
2981
3162
|
|
|
2982
3163
|
// src/graphql/hooks/pushToken.ts
|
|
2983
3164
|
var useCreatePushToken = () => {
|
|
2984
|
-
const [createPushToken, { loading, error }] = (0,
|
|
3165
|
+
const [createPushToken, { loading, error }] = (0, import_client26.useMutation)(
|
|
2985
3166
|
CREATE_PUSH_TOKEN_MUTATION
|
|
2986
3167
|
);
|
|
2987
3168
|
return { createPushToken, error, loading };
|
|
2988
3169
|
};
|
|
2989
3170
|
|
|
2990
3171
|
// src/graphql/hooks/relation/hooksMutation.ts
|
|
2991
|
-
var
|
|
3172
|
+
var import_client29 = require("@apollo/client");
|
|
2992
3173
|
|
|
2993
3174
|
// src/graphql/mutations/relation.ts
|
|
2994
|
-
var
|
|
3175
|
+
var import_client28 = require("@apollo/client");
|
|
2995
3176
|
|
|
2996
3177
|
// src/graphql/queries/relation.ts
|
|
2997
|
-
var
|
|
2998
|
-
var RELATION_DATES_FRAGMENT =
|
|
3178
|
+
var import_client27 = require("@apollo/client");
|
|
3179
|
+
var RELATION_DATES_FRAGMENT = import_client27.gql`
|
|
2999
3180
|
fragment RelationDates on RelationDateType {
|
|
3000
3181
|
lastUpdateBy
|
|
3001
3182
|
paymentReference
|
|
@@ -3009,7 +3190,7 @@ var RELATION_DATES_FRAGMENT = import_client22.gql`
|
|
|
3009
3190
|
status
|
|
3010
3191
|
}
|
|
3011
3192
|
`;
|
|
3012
|
-
var RELATION_FIELDS_FRAGMENT =
|
|
3193
|
+
var RELATION_FIELDS_FRAGMENT = import_client27.gql`
|
|
3013
3194
|
fragment RelationFields on RelationType {
|
|
3014
3195
|
_id
|
|
3015
3196
|
apiMessage
|
|
@@ -3026,7 +3207,7 @@ var RELATION_FIELDS_FRAGMENT = import_client22.gql`
|
|
|
3026
3207
|
}
|
|
3027
3208
|
${RELATION_DATES_FRAGMENT}
|
|
3028
3209
|
`;
|
|
3029
|
-
var GET_RELATION =
|
|
3210
|
+
var GET_RELATION = import_client27.gql`
|
|
3030
3211
|
query getRelation($id: ID!) {
|
|
3031
3212
|
relation(_id: $id) {
|
|
3032
3213
|
...RelationFields
|
|
@@ -3034,7 +3215,7 @@ var GET_RELATION = import_client22.gql`
|
|
|
3034
3215
|
}
|
|
3035
3216
|
${RELATION_FIELDS_FRAGMENT}
|
|
3036
3217
|
`;
|
|
3037
|
-
var GET_RELATION_BY_MARKET_AND_STALLHOLDER =
|
|
3218
|
+
var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client27.gql`
|
|
3038
3219
|
query getRelationByMarketAndStallholder($marketId: ID!, $stallholderId: ID!) {
|
|
3039
3220
|
relationByMarketAndStallholder(
|
|
3040
3221
|
marketId: $marketId
|
|
@@ -3045,7 +3226,7 @@ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client22.gql`
|
|
|
3045
3226
|
}
|
|
3046
3227
|
${RELATION_FIELDS_FRAGMENT}
|
|
3047
3228
|
`;
|
|
3048
|
-
var GET_MARKET_RELATIONS =
|
|
3229
|
+
var GET_MARKET_RELATIONS = import_client27.gql`
|
|
3049
3230
|
query getMarketRelations($marketId: ID!) {
|
|
3050
3231
|
marketRelations(marketId: $marketId) {
|
|
3051
3232
|
...RelationFields
|
|
@@ -3053,7 +3234,7 @@ var GET_MARKET_RELATIONS = import_client22.gql`
|
|
|
3053
3234
|
}
|
|
3054
3235
|
${RELATION_FIELDS_FRAGMENT}
|
|
3055
3236
|
`;
|
|
3056
|
-
var GET_STALLHOLDER_RELATIONS =
|
|
3237
|
+
var GET_STALLHOLDER_RELATIONS = import_client27.gql`
|
|
3057
3238
|
query getStallholderRelations($stallholderId: ID!) {
|
|
3058
3239
|
stallholderRelations(stallholderId: $stallholderId) {
|
|
3059
3240
|
...RelationFields
|
|
@@ -3061,7 +3242,7 @@ var GET_STALLHOLDER_RELATIONS = import_client22.gql`
|
|
|
3061
3242
|
}
|
|
3062
3243
|
${RELATION_FIELDS_FRAGMENT}
|
|
3063
3244
|
`;
|
|
3064
|
-
var GET_RESOURCE_CONNECTIONS =
|
|
3245
|
+
var GET_RESOURCE_CONNECTIONS = import_client27.gql`
|
|
3065
3246
|
query getResourceConnections(
|
|
3066
3247
|
$resourceId: ID!
|
|
3067
3248
|
$resourceType: ResourceTypeEnum!
|
|
@@ -3164,7 +3345,7 @@ var GET_RESOURCE_CONNECTIONS = import_client22.gql`
|
|
|
3164
3345
|
`;
|
|
3165
3346
|
|
|
3166
3347
|
// src/graphql/mutations/relation.ts
|
|
3167
|
-
var CREATE_RELATION_MUTATION =
|
|
3348
|
+
var CREATE_RELATION_MUTATION = import_client28.gql`
|
|
3168
3349
|
mutation createRelation($input: RelationInputType!) {
|
|
3169
3350
|
createRelation(input: $input) {
|
|
3170
3351
|
...RelationFields
|
|
@@ -3172,7 +3353,7 @@ var CREATE_RELATION_MUTATION = import_client23.gql`
|
|
|
3172
3353
|
}
|
|
3173
3354
|
${RELATION_FIELDS_FRAGMENT}
|
|
3174
3355
|
`;
|
|
3175
|
-
var UPDATE_RELATION_MUTATION =
|
|
3356
|
+
var UPDATE_RELATION_MUTATION = import_client28.gql`
|
|
3176
3357
|
mutation updateRelation($_id: ID!, $input: RelationInputType!) {
|
|
3177
3358
|
updateRelation(_id: $_id, input: $input) {
|
|
3178
3359
|
...RelationFields
|
|
@@ -3180,7 +3361,7 @@ var UPDATE_RELATION_MUTATION = import_client23.gql`
|
|
|
3180
3361
|
}
|
|
3181
3362
|
${RELATION_FIELDS_FRAGMENT}
|
|
3182
3363
|
`;
|
|
3183
|
-
var DELETE_RELATION_MUTATION =
|
|
3364
|
+
var DELETE_RELATION_MUTATION = import_client28.gql`
|
|
3184
3365
|
mutation deleteRelation($_id: ID!) {
|
|
3185
3366
|
deleteRelation(_id: $_id) {
|
|
3186
3367
|
...RelationFields
|
|
@@ -3192,7 +3373,7 @@ var DELETE_RELATION_MUTATION = import_client23.gql`
|
|
|
3192
3373
|
// src/graphql/hooks/relation/hooksMutation.ts
|
|
3193
3374
|
var fetchPolicy = "no-cache";
|
|
3194
3375
|
var useCreateRelation = () => {
|
|
3195
|
-
const [createRelation, { loading, error }] = (0,
|
|
3376
|
+
const [createRelation, { loading, error }] = (0, import_client29.useMutation)(
|
|
3196
3377
|
CREATE_RELATION_MUTATION,
|
|
3197
3378
|
{
|
|
3198
3379
|
awaitRefetchQueries: true,
|
|
@@ -3244,7 +3425,7 @@ var useCreateRelation = () => {
|
|
|
3244
3425
|
return { createRelation, error, loading };
|
|
3245
3426
|
};
|
|
3246
3427
|
var useUpdateRelation = () => {
|
|
3247
|
-
const [updateRelation, { loading, error }] = (0,
|
|
3428
|
+
const [updateRelation, { loading, error }] = (0, import_client29.useMutation)(
|
|
3248
3429
|
UPDATE_RELATION_MUTATION,
|
|
3249
3430
|
{
|
|
3250
3431
|
awaitRefetchQueries: true,
|
|
@@ -3292,7 +3473,7 @@ var useUpdateRelation = () => {
|
|
|
3292
3473
|
return { error, loading, updateRelation };
|
|
3293
3474
|
};
|
|
3294
3475
|
var useDeleteRelation = () => {
|
|
3295
|
-
const [deleteRelation, { loading, error }] = (0,
|
|
3476
|
+
const [deleteRelation, { loading, error }] = (0, import_client29.useMutation)(
|
|
3296
3477
|
DELETE_RELATION_MUTATION,
|
|
3297
3478
|
{
|
|
3298
3479
|
awaitRefetchQueries: true,
|
|
@@ -3340,9 +3521,9 @@ var useDeleteRelation = () => {
|
|
|
3340
3521
|
};
|
|
3341
3522
|
|
|
3342
3523
|
// src/graphql/hooks/relation/hooksQuery.ts
|
|
3343
|
-
var
|
|
3524
|
+
var import_client30 = require("@apollo/client");
|
|
3344
3525
|
var useGetRelation = (id) => {
|
|
3345
|
-
const { loading, error, data, refetch } = (0,
|
|
3526
|
+
const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_RELATION, {
|
|
3346
3527
|
fetchPolicy: "network-only",
|
|
3347
3528
|
skip: id === "",
|
|
3348
3529
|
variables: { id }
|
|
@@ -3351,7 +3532,7 @@ var useGetRelation = (id) => {
|
|
|
3351
3532
|
return { error, loading, refetch, relation };
|
|
3352
3533
|
};
|
|
3353
3534
|
var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
3354
|
-
const { loading, error, data, refetch } = (0,
|
|
3535
|
+
const { loading, error, data, refetch } = (0, import_client30.useQuery)(
|
|
3355
3536
|
GET_RELATION_BY_MARKET_AND_STALLHOLDER,
|
|
3356
3537
|
{
|
|
3357
3538
|
fetchPolicy: "network-only",
|
|
@@ -3363,7 +3544,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
|
|
|
3363
3544
|
return { error, loading, refetch, relationByMarketAndStallholder };
|
|
3364
3545
|
};
|
|
3365
3546
|
var useGetMarketRelations = (marketId) => {
|
|
3366
|
-
const { loading, error, data, refetch } = (0,
|
|
3547
|
+
const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_MARKET_RELATIONS, {
|
|
3367
3548
|
fetchPolicy: "network-only",
|
|
3368
3549
|
skip: marketId === "",
|
|
3369
3550
|
variables: { marketId }
|
|
@@ -3372,7 +3553,7 @@ var useGetMarketRelations = (marketId) => {
|
|
|
3372
3553
|
return { error, loading, marketRelations, refetch };
|
|
3373
3554
|
};
|
|
3374
3555
|
var useGetStallholderRelations = (stallholderId) => {
|
|
3375
|
-
const { loading, error, data, refetch } = (0,
|
|
3556
|
+
const { loading, error, data, refetch } = (0, import_client30.useQuery)(
|
|
3376
3557
|
GET_STALLHOLDER_RELATIONS,
|
|
3377
3558
|
{
|
|
3378
3559
|
fetchPolicy: "network-only",
|
|
@@ -3384,7 +3565,7 @@ var useGetStallholderRelations = (stallholderId) => {
|
|
|
3384
3565
|
return { error, loading, refetch, stallholderRelations };
|
|
3385
3566
|
};
|
|
3386
3567
|
var useGetResourceConnections = (resourceId, resourceType) => {
|
|
3387
|
-
const { loading, error, data, refetch } = (0,
|
|
3568
|
+
const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_RESOURCE_CONNECTIONS, {
|
|
3388
3569
|
fetchPolicy: "network-only",
|
|
3389
3570
|
variables: { resourceId, resourceType }
|
|
3390
3571
|
});
|
|
@@ -3393,11 +3574,11 @@ var useGetResourceConnections = (resourceId, resourceType) => {
|
|
|
3393
3574
|
};
|
|
3394
3575
|
|
|
3395
3576
|
// src/graphql/hooks/stallholder/hooksMutation.ts
|
|
3396
|
-
var
|
|
3577
|
+
var import_client32 = require("@apollo/client");
|
|
3397
3578
|
|
|
3398
3579
|
// src/graphql/mutations/stallholder.ts
|
|
3399
|
-
var
|
|
3400
|
-
var CREATE_STALLHOLDER_MUTATION =
|
|
3580
|
+
var import_client31 = require("@apollo/client");
|
|
3581
|
+
var CREATE_STALLHOLDER_MUTATION = import_client31.gql`
|
|
3401
3582
|
mutation createStallholder($input: StallholderInputType!) {
|
|
3402
3583
|
createStallholder(input: $input) {
|
|
3403
3584
|
...StallholderFields
|
|
@@ -3405,7 +3586,7 @@ var CREATE_STALLHOLDER_MUTATION = import_client26.gql`
|
|
|
3405
3586
|
}
|
|
3406
3587
|
${STALLHOLDER}
|
|
3407
3588
|
`;
|
|
3408
|
-
var UPDATE_STALLHOLDER_MUTATION =
|
|
3589
|
+
var UPDATE_STALLHOLDER_MUTATION = import_client31.gql`
|
|
3409
3590
|
mutation updateStallholder($_id: ID!, $input: StallholderInputType!) {
|
|
3410
3591
|
updateStallholder(_id: $_id, input: $input) {
|
|
3411
3592
|
...StallholderFields
|
|
@@ -3413,12 +3594,12 @@ var UPDATE_STALLHOLDER_MUTATION = import_client26.gql`
|
|
|
3413
3594
|
}
|
|
3414
3595
|
${STALLHOLDER}
|
|
3415
3596
|
`;
|
|
3416
|
-
var DELETE_STALLHOLDER_MUTATION =
|
|
3597
|
+
var DELETE_STALLHOLDER_MUTATION = import_client31.gql`
|
|
3417
3598
|
mutation deleteStallholder($_id: ID!) {
|
|
3418
3599
|
deleteStallholder(_id: $_id)
|
|
3419
3600
|
}
|
|
3420
3601
|
`;
|
|
3421
|
-
var CREATE_STALLHOLDER_INFO_MUTATION =
|
|
3602
|
+
var CREATE_STALLHOLDER_INFO_MUTATION = import_client31.gql`
|
|
3422
3603
|
mutation createStallholderInfo($input: StallholderInfoInputType!) {
|
|
3423
3604
|
createStallholderInfo(input: $input) {
|
|
3424
3605
|
...StallholderInfoFields
|
|
@@ -3426,7 +3607,7 @@ var CREATE_STALLHOLDER_INFO_MUTATION = import_client26.gql`
|
|
|
3426
3607
|
}
|
|
3427
3608
|
${STALLHOLDER_INFO}
|
|
3428
3609
|
`;
|
|
3429
|
-
var UPDATE_STALLHOLDER_INFO_MUTATION =
|
|
3610
|
+
var UPDATE_STALLHOLDER_INFO_MUTATION = import_client31.gql`
|
|
3430
3611
|
mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
|
|
3431
3612
|
updateStallholderInfo(_id: $_id, input: $input) {
|
|
3432
3613
|
...StallholderInfoFields
|
|
@@ -3437,7 +3618,7 @@ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client26.gql`
|
|
|
3437
3618
|
|
|
3438
3619
|
// src/graphql/hooks/stallholder/hooksMutation.ts
|
|
3439
3620
|
var useCreateStallholder = () => {
|
|
3440
|
-
const [createStallholder, { loading, error }] = (0,
|
|
3621
|
+
const [createStallholder, { loading, error }] = (0, import_client32.useMutation)(
|
|
3441
3622
|
CREATE_STALLHOLDER_MUTATION,
|
|
3442
3623
|
{
|
|
3443
3624
|
awaitRefetchQueries: true,
|
|
@@ -3449,7 +3630,7 @@ var useCreateStallholder = () => {
|
|
|
3449
3630
|
return { createStallholder, error, loading };
|
|
3450
3631
|
};
|
|
3451
3632
|
var useUpdateStallholder = () => {
|
|
3452
|
-
const [updateStallholder, { loading, error }] = (0,
|
|
3633
|
+
const [updateStallholder, { loading, error }] = (0, import_client32.useMutation)(
|
|
3453
3634
|
UPDATE_STALLHOLDER_MUTATION,
|
|
3454
3635
|
{
|
|
3455
3636
|
awaitRefetchQueries: true,
|
|
@@ -3461,7 +3642,7 @@ var useUpdateStallholder = () => {
|
|
|
3461
3642
|
return { error, loading, updateStallholder };
|
|
3462
3643
|
};
|
|
3463
3644
|
var useDeleteStallholder = () => {
|
|
3464
|
-
const [deleteStallholder, { loading, error }] = (0,
|
|
3645
|
+
const [deleteStallholder, { loading, error }] = (0, import_client32.useMutation)(
|
|
3465
3646
|
DELETE_STALLHOLDER_MUTATION,
|
|
3466
3647
|
{
|
|
3467
3648
|
awaitRefetchQueries: true,
|
|
@@ -3473,7 +3654,7 @@ var useDeleteStallholder = () => {
|
|
|
3473
3654
|
return { deleteStallholder, error, loading };
|
|
3474
3655
|
};
|
|
3475
3656
|
var useCreateStallholderInfo = () => {
|
|
3476
|
-
const [createStallholderInfo, { loading, error }] = (0,
|
|
3657
|
+
const [createStallholderInfo, { loading, error }] = (0, import_client32.useMutation)(
|
|
3477
3658
|
CREATE_STALLHOLDER_INFO_MUTATION,
|
|
3478
3659
|
{
|
|
3479
3660
|
awaitRefetchQueries: true,
|
|
@@ -3497,7 +3678,7 @@ var useCreateStallholderInfo = () => {
|
|
|
3497
3678
|
return { createStallholderInfo, error, loading };
|
|
3498
3679
|
};
|
|
3499
3680
|
var useUpdateStallholderInfo = () => {
|
|
3500
|
-
const [updateStallholderInfo, { loading, error }] = (0,
|
|
3681
|
+
const [updateStallholderInfo, { loading, error }] = (0, import_client32.useMutation)(
|
|
3501
3682
|
UPDATE_STALLHOLDER_INFO_MUTATION,
|
|
3502
3683
|
{
|
|
3503
3684
|
awaitRefetchQueries: true,
|
|
@@ -3518,9 +3699,9 @@ var useUpdateStallholderInfo = () => {
|
|
|
3518
3699
|
};
|
|
3519
3700
|
|
|
3520
3701
|
// src/graphql/hooks/stallholder/hooksQuery.ts
|
|
3521
|
-
var
|
|
3702
|
+
var import_client33 = require("@apollo/client");
|
|
3522
3703
|
var useGetStallholders = () => {
|
|
3523
|
-
const { loading, error, data, refetch } = (0,
|
|
3704
|
+
const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDERS, {
|
|
3524
3705
|
fetchPolicy: "network-only"
|
|
3525
3706
|
});
|
|
3526
3707
|
const stallholders = data?.stallholders;
|
|
@@ -3532,7 +3713,7 @@ var useGetStallholders = () => {
|
|
|
3532
3713
|
};
|
|
3533
3714
|
};
|
|
3534
3715
|
var useGetStallholder = (_id) => {
|
|
3535
|
-
const { loading, error, data, refetch } = (0,
|
|
3716
|
+
const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDER, {
|
|
3536
3717
|
fetchPolicy: "network-only",
|
|
3537
3718
|
skip: !_id,
|
|
3538
3719
|
variables: { _id }
|
|
@@ -3541,7 +3722,7 @@ var useGetStallholder = (_id) => {
|
|
|
3541
3722
|
return { error, loading, refetch, stallholder };
|
|
3542
3723
|
};
|
|
3543
3724
|
var useGetStallholdersByRegion = (region) => {
|
|
3544
|
-
const { loading, error, data, refetch } = (0,
|
|
3725
|
+
const { loading, error, data, refetch } = (0, import_client33.useQuery)(
|
|
3545
3726
|
GET_STALLHOLDERS_BY_REGION,
|
|
3546
3727
|
{
|
|
3547
3728
|
fetchPolicy: "no-cache",
|
|
@@ -3553,7 +3734,7 @@ var useGetStallholdersByRegion = (region) => {
|
|
|
3553
3734
|
return { error, loading, refetch, stallholdersByRegion };
|
|
3554
3735
|
};
|
|
3555
3736
|
var useSearchStallholders = (search, region) => {
|
|
3556
|
-
const { loading, error, data, refetch } = (0,
|
|
3737
|
+
const { loading, error, data, refetch } = (0, import_client33.useQuery)(SEARCH_STALLHOLDERS, {
|
|
3557
3738
|
fetchPolicy: "network-only",
|
|
3558
3739
|
skip: search.length < 3,
|
|
3559
3740
|
variables: { region, search }
|
|
@@ -3562,7 +3743,7 @@ var useSearchStallholders = (search, region) => {
|
|
|
3562
3743
|
return { error, loading, refetch, stallholderSearch };
|
|
3563
3744
|
};
|
|
3564
3745
|
var useGetStallholderInfo = (stallholderId) => {
|
|
3565
|
-
const { loading, error, data, refetch } = (0,
|
|
3746
|
+
const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDER_INFO, {
|
|
3566
3747
|
fetchPolicy: "network-only",
|
|
3567
3748
|
skip: !stallholderId,
|
|
3568
3749
|
variables: { stallholderId }
|
|
@@ -3577,14 +3758,14 @@ var useGetStallholderInfo = (stallholderId) => {
|
|
|
3577
3758
|
};
|
|
3578
3759
|
|
|
3579
3760
|
// src/graphql/hooks/testers/hooksMutation.ts
|
|
3580
|
-
var
|
|
3761
|
+
var import_client36 = require("@apollo/client");
|
|
3581
3762
|
|
|
3582
3763
|
// src/graphql/mutations/testers.ts
|
|
3583
|
-
var
|
|
3764
|
+
var import_client35 = require("@apollo/client");
|
|
3584
3765
|
|
|
3585
3766
|
// src/graphql/queries/testers.ts
|
|
3586
|
-
var
|
|
3587
|
-
var TESTER_FIELDS_FRAGMENT =
|
|
3767
|
+
var import_client34 = require("@apollo/client");
|
|
3768
|
+
var TESTER_FIELDS_FRAGMENT = import_client34.gql`
|
|
3588
3769
|
fragment TesterFields on TesterType {
|
|
3589
3770
|
_id
|
|
3590
3771
|
active
|
|
@@ -3597,7 +3778,7 @@ var TESTER_FIELDS_FRAGMENT = import_client29.gql`
|
|
|
3597
3778
|
updatedAt
|
|
3598
3779
|
}
|
|
3599
3780
|
`;
|
|
3600
|
-
var GET_TESTERS =
|
|
3781
|
+
var GET_TESTERS = import_client34.gql`
|
|
3601
3782
|
query getTesters {
|
|
3602
3783
|
testers {
|
|
3603
3784
|
...TesterFields
|
|
@@ -3605,7 +3786,7 @@ var GET_TESTERS = import_client29.gql`
|
|
|
3605
3786
|
}
|
|
3606
3787
|
${TESTER_FIELDS_FRAGMENT}
|
|
3607
3788
|
`;
|
|
3608
|
-
var GET_TESTER =
|
|
3789
|
+
var GET_TESTER = import_client34.gql`
|
|
3609
3790
|
query getTester($_id: ID!) {
|
|
3610
3791
|
tester(_id: $_id) {
|
|
3611
3792
|
...TesterFields
|
|
@@ -3615,7 +3796,7 @@ var GET_TESTER = import_client29.gql`
|
|
|
3615
3796
|
`;
|
|
3616
3797
|
|
|
3617
3798
|
// src/graphql/mutations/testers.ts
|
|
3618
|
-
var CREATE_TESTER_MUTATION =
|
|
3799
|
+
var CREATE_TESTER_MUTATION = import_client35.gql`
|
|
3619
3800
|
mutation createTester($input: TesterInputType!) {
|
|
3620
3801
|
createTester(input: $input) {
|
|
3621
3802
|
...TesterFields
|
|
@@ -3623,7 +3804,7 @@ var CREATE_TESTER_MUTATION = import_client30.gql`
|
|
|
3623
3804
|
}
|
|
3624
3805
|
${TESTER_FIELDS_FRAGMENT}
|
|
3625
3806
|
`;
|
|
3626
|
-
var UPDATE_TESTER_MUTATION =
|
|
3807
|
+
var UPDATE_TESTER_MUTATION = import_client35.gql`
|
|
3627
3808
|
mutation updateTester($_id: ID!, $input: TesterInputType!) {
|
|
3628
3809
|
updateTester(_id: $_id, input: $input) {
|
|
3629
3810
|
...TesterFields
|
|
@@ -3631,7 +3812,7 @@ var UPDATE_TESTER_MUTATION = import_client30.gql`
|
|
|
3631
3812
|
}
|
|
3632
3813
|
${TESTER_FIELDS_FRAGMENT}
|
|
3633
3814
|
`;
|
|
3634
|
-
var DELETE_TESTER_MUTATION =
|
|
3815
|
+
var DELETE_TESTER_MUTATION = import_client35.gql`
|
|
3635
3816
|
mutation deleteTester($_id: ID!) {
|
|
3636
3817
|
deleteTester(_id: $_id)
|
|
3637
3818
|
}
|
|
@@ -3639,7 +3820,7 @@ var DELETE_TESTER_MUTATION = import_client30.gql`
|
|
|
3639
3820
|
|
|
3640
3821
|
// src/graphql/hooks/testers/hooksMutation.ts
|
|
3641
3822
|
var useCreateTester = () => {
|
|
3642
|
-
const [createTester, { data, loading, error }] = (0,
|
|
3823
|
+
const [createTester, { data, loading, error }] = (0, import_client36.useMutation)(
|
|
3643
3824
|
CREATE_TESTER_MUTATION
|
|
3644
3825
|
);
|
|
3645
3826
|
return {
|
|
@@ -3650,7 +3831,7 @@ var useCreateTester = () => {
|
|
|
3650
3831
|
};
|
|
3651
3832
|
};
|
|
3652
3833
|
var useUpdateTester = () => {
|
|
3653
|
-
const [updateTester, { data, loading, error }] = (0,
|
|
3834
|
+
const [updateTester, { data, loading, error }] = (0, import_client36.useMutation)(
|
|
3654
3835
|
UPDATE_TESTER_MUTATION
|
|
3655
3836
|
);
|
|
3656
3837
|
return {
|
|
@@ -3661,16 +3842,16 @@ var useUpdateTester = () => {
|
|
|
3661
3842
|
};
|
|
3662
3843
|
};
|
|
3663
3844
|
var useDeleteTester = () => {
|
|
3664
|
-
const [deleteTester, { loading, error }] = (0,
|
|
3845
|
+
const [deleteTester, { loading, error }] = (0, import_client36.useMutation)(
|
|
3665
3846
|
DELETE_TESTER_MUTATION
|
|
3666
3847
|
);
|
|
3667
3848
|
return { deleteTester, error, loading };
|
|
3668
3849
|
};
|
|
3669
3850
|
|
|
3670
3851
|
// src/graphql/hooks/testers/hooksQuery.ts
|
|
3671
|
-
var
|
|
3852
|
+
var import_client37 = require("@apollo/client");
|
|
3672
3853
|
var useGetTesters = () => {
|
|
3673
|
-
const { data, loading, error, refetch } = (0,
|
|
3854
|
+
const { data, loading, error, refetch } = (0, import_client37.useQuery)(GET_TESTERS);
|
|
3674
3855
|
const testers = data?.testers;
|
|
3675
3856
|
return {
|
|
3676
3857
|
error,
|
|
@@ -3680,7 +3861,7 @@ var useGetTesters = () => {
|
|
|
3680
3861
|
};
|
|
3681
3862
|
};
|
|
3682
3863
|
var useGetTester = (_id) => {
|
|
3683
|
-
const { data, loading, error, refetch } = (0,
|
|
3864
|
+
const { data, loading, error, refetch } = (0, import_client37.useQuery)(GET_TESTER, {
|
|
3684
3865
|
skip: !_id,
|
|
3685
3866
|
variables: { _id }
|
|
3686
3867
|
});
|
|
@@ -3689,11 +3870,11 @@ var useGetTester = (_id) => {
|
|
|
3689
3870
|
};
|
|
3690
3871
|
|
|
3691
3872
|
// src/graphql/hooks/user/hooksMutation.ts
|
|
3692
|
-
var
|
|
3873
|
+
var import_client39 = require("@apollo/client");
|
|
3693
3874
|
|
|
3694
3875
|
// src/graphql/mutations/user.ts
|
|
3695
|
-
var
|
|
3696
|
-
var CREATE_USER_MUTATION =
|
|
3876
|
+
var import_client38 = require("@apollo/client");
|
|
3877
|
+
var CREATE_USER_MUTATION = import_client38.gql`
|
|
3697
3878
|
mutation createUser($input: UserInputType!) {
|
|
3698
3879
|
createUser(input: $input) {
|
|
3699
3880
|
...UserFields
|
|
@@ -3701,7 +3882,7 @@ var CREATE_USER_MUTATION = import_client33.gql`
|
|
|
3701
3882
|
}
|
|
3702
3883
|
${USER_FIELDS_FRAGMENT}
|
|
3703
3884
|
`;
|
|
3704
|
-
var UPDATE_USER_MUTATION =
|
|
3885
|
+
var UPDATE_USER_MUTATION = import_client38.gql`
|
|
3705
3886
|
mutation updateUser($_id: ID!, $input: UserInputType!) {
|
|
3706
3887
|
updateUser(_id: $_id, input: $input) {
|
|
3707
3888
|
...UserFields
|
|
@@ -3709,12 +3890,12 @@ var UPDATE_USER_MUTATION = import_client33.gql`
|
|
|
3709
3890
|
}
|
|
3710
3891
|
${USER_FIELDS_FRAGMENT}
|
|
3711
3892
|
`;
|
|
3712
|
-
var DELETE_USER_MUTATION =
|
|
3893
|
+
var DELETE_USER_MUTATION = import_client38.gql`
|
|
3713
3894
|
mutation deleteUser($_id: ID!) {
|
|
3714
3895
|
deleteUser(_id: $_id)
|
|
3715
3896
|
}
|
|
3716
3897
|
`;
|
|
3717
|
-
var ADD_USER_FAVOURITE_RESOURCE_MUTATION =
|
|
3898
|
+
var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client38.gql`
|
|
3718
3899
|
mutation addUserFavouriteResource(
|
|
3719
3900
|
$resourceId: ID!
|
|
3720
3901
|
$resourceType: ResourceTypeEnum!
|
|
@@ -3730,7 +3911,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client33.gql`
|
|
|
3730
3911
|
}
|
|
3731
3912
|
${USER_FIELDS_FRAGMENT}
|
|
3732
3913
|
`;
|
|
3733
|
-
var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION =
|
|
3914
|
+
var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client38.gql`
|
|
3734
3915
|
mutation removeUserFavouriteResource(
|
|
3735
3916
|
$resourceId: ID!
|
|
3736
3917
|
$resourceType: ResourceTypeEnum!
|
|
@@ -3749,11 +3930,11 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client33.gql`
|
|
|
3749
3930
|
|
|
3750
3931
|
// src/graphql/hooks/user/hooksMutation.ts
|
|
3751
3932
|
var useCreateUser = () => {
|
|
3752
|
-
const [createUser, { loading, error }] = (0,
|
|
3933
|
+
const [createUser, { loading, error }] = (0, import_client39.useMutation)(CREATE_USER_MUTATION);
|
|
3753
3934
|
return { createUser, error, loading };
|
|
3754
3935
|
};
|
|
3755
3936
|
var useUpdateUser = () => {
|
|
3756
|
-
const [updateUser, { loading, error }] = (0,
|
|
3937
|
+
const [updateUser, { loading, error }] = (0, import_client39.useMutation)(UPDATE_USER_MUTATION, {
|
|
3757
3938
|
awaitRefetchQueries: true,
|
|
3758
3939
|
refetchQueries: (mutationResult) => {
|
|
3759
3940
|
const userId = mutationResult?.data?.updateUser?._id;
|
|
@@ -3764,11 +3945,11 @@ var useUpdateUser = () => {
|
|
|
3764
3945
|
return { error, loading, updateUser };
|
|
3765
3946
|
};
|
|
3766
3947
|
var useDeleteUser = () => {
|
|
3767
|
-
const [deleteUser, { loading, error }] = (0,
|
|
3948
|
+
const [deleteUser, { loading, error }] = (0, import_client39.useMutation)(DELETE_USER_MUTATION);
|
|
3768
3949
|
return { deleteUser, error, loading };
|
|
3769
3950
|
};
|
|
3770
3951
|
var useAddUserFavouriteResource = () => {
|
|
3771
|
-
const [addUserFavouriteResource, { loading, error }] = (0,
|
|
3952
|
+
const [addUserFavouriteResource, { loading, error }] = (0, import_client39.useMutation)(
|
|
3772
3953
|
ADD_USER_FAVOURITE_RESOURCE_MUTATION,
|
|
3773
3954
|
{
|
|
3774
3955
|
awaitRefetchQueries: true,
|
|
@@ -3778,7 +3959,7 @@ var useAddUserFavouriteResource = () => {
|
|
|
3778
3959
|
return { addUserFavouriteResource, error, loading };
|
|
3779
3960
|
};
|
|
3780
3961
|
var useRemoveUserFavouriteResource = () => {
|
|
3781
|
-
const [removeUserFavouriteResource, { loading, error }] = (0,
|
|
3962
|
+
const [removeUserFavouriteResource, { loading, error }] = (0, import_client39.useMutation)(
|
|
3782
3963
|
REMOVE_USER_FAVOURITE_RESOURCE_MUTATION,
|
|
3783
3964
|
{
|
|
3784
3965
|
awaitRefetchQueries: true,
|
|
@@ -3789,37 +3970,37 @@ var useRemoveUserFavouriteResource = () => {
|
|
|
3789
3970
|
};
|
|
3790
3971
|
|
|
3791
3972
|
// src/graphql/hooks/user/hooksQuery.ts
|
|
3792
|
-
var
|
|
3973
|
+
var import_client40 = require("@apollo/client");
|
|
3793
3974
|
var useGetUsers = () => {
|
|
3794
|
-
const { loading, error, data, refetch } = (0,
|
|
3975
|
+
const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USERS, {
|
|
3795
3976
|
fetchPolicy: "network-only"
|
|
3796
3977
|
});
|
|
3797
3978
|
const users = data?.users;
|
|
3798
3979
|
return { error, loading, refetch, users };
|
|
3799
3980
|
};
|
|
3800
3981
|
var useGetUser = (_id) => {
|
|
3801
|
-
const { loading, error, data, refetch } = (0,
|
|
3982
|
+
const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER, {
|
|
3802
3983
|
variables: { _id }
|
|
3803
3984
|
});
|
|
3804
3985
|
const user = data?.user;
|
|
3805
3986
|
return { error, loading, refetch, user };
|
|
3806
3987
|
};
|
|
3807
3988
|
var useGetUserMarkets = () => {
|
|
3808
|
-
const { loading, error, data, refetch } = (0,
|
|
3989
|
+
const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_MARKETS, {
|
|
3809
3990
|
fetchPolicy: "network-only"
|
|
3810
3991
|
});
|
|
3811
3992
|
const userMarkets = data?.userMarkets;
|
|
3812
3993
|
return { error, loading, refetch, userMarkets };
|
|
3813
3994
|
};
|
|
3814
3995
|
var useGetUserStallholder = () => {
|
|
3815
|
-
const { loading, error, data, refetch } = (0,
|
|
3996
|
+
const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_STALLHOLDER, {
|
|
3816
3997
|
fetchPolicy: "network-only"
|
|
3817
3998
|
});
|
|
3818
3999
|
const userStallholder = data?.userStallholder;
|
|
3819
4000
|
return { error, loading, refetch, userStallholder };
|
|
3820
4001
|
};
|
|
3821
4002
|
var useGetUserFavourites = () => {
|
|
3822
|
-
const { loading, error, data, refetch } = (0,
|
|
4003
|
+
const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_FAVOURITES, {
|
|
3823
4004
|
fetchPolicy: "network-only"
|
|
3824
4005
|
});
|
|
3825
4006
|
const markets = data?.userFavourites.markets;
|
|
@@ -3830,117 +4011,6 @@ var useGetUserFavourites = () => {
|
|
|
3830
4011
|
};
|
|
3831
4012
|
return { error, loading, refetch, userFavourites };
|
|
3832
4013
|
};
|
|
3833
|
-
var useGetUserNotifications = () => {
|
|
3834
|
-
const { loading, error, data, refetch } = (0, import_client35.useQuery)(GET_USER_NOTIFICATIONS, {
|
|
3835
|
-
fetchPolicy: "network-only"
|
|
3836
|
-
});
|
|
3837
|
-
const userNotifications = data?.userNotifications;
|
|
3838
|
-
return { error, loading, refetch, userNotifications };
|
|
3839
|
-
};
|
|
3840
|
-
|
|
3841
|
-
// src/graphql/queries/notificationQueries.ts
|
|
3842
|
-
var import_client36 = require("@apollo/client");
|
|
3843
|
-
var GET_USER_NOTIFICATIONS2 = import_client36.gql`
|
|
3844
|
-
query GetUserNotifications(
|
|
3845
|
-
$userId: String!
|
|
3846
|
-
$limit: Int
|
|
3847
|
-
$offset: Int
|
|
3848
|
-
$isRead: String
|
|
3849
|
-
) {
|
|
3850
|
-
userNotifications(
|
|
3851
|
-
userId: $userId
|
|
3852
|
-
limit: $limit
|
|
3853
|
-
offset: $offset
|
|
3854
|
-
isRead: $isRead
|
|
3855
|
-
) {
|
|
3856
|
-
id
|
|
3857
|
-
userId
|
|
3858
|
-
title
|
|
3859
|
-
message
|
|
3860
|
-
type
|
|
3861
|
-
isRead
|
|
3862
|
-
data
|
|
3863
|
-
createdAt
|
|
3864
|
-
updatedAt
|
|
3865
|
-
}
|
|
3866
|
-
}
|
|
3867
|
-
`;
|
|
3868
|
-
var GET_NOTIFICATION_COUNT = import_client36.gql`
|
|
3869
|
-
query GetNotificationCount($userId: String!) {
|
|
3870
|
-
notificationCount(userId: $userId) {
|
|
3871
|
-
total
|
|
3872
|
-
unread
|
|
3873
|
-
}
|
|
3874
|
-
}
|
|
3875
|
-
`;
|
|
3876
|
-
var GET_UNREAD_NOTIFICATIONS = import_client36.gql`
|
|
3877
|
-
query GetUnreadNotifications($userId: String!, $limit: Int) {
|
|
3878
|
-
unreadNotifications(userId: $userId, limit: $limit) {
|
|
3879
|
-
id
|
|
3880
|
-
userId
|
|
3881
|
-
title
|
|
3882
|
-
message
|
|
3883
|
-
type
|
|
3884
|
-
isRead
|
|
3885
|
-
data
|
|
3886
|
-
createdAt
|
|
3887
|
-
updatedAt
|
|
3888
|
-
}
|
|
3889
|
-
}
|
|
3890
|
-
`;
|
|
3891
|
-
|
|
3892
|
-
// src/graphql/mutations/notificationMutations.ts
|
|
3893
|
-
var import_client37 = require("@apollo/client");
|
|
3894
|
-
var CREATE_NOTIFICATION = import_client37.gql`
|
|
3895
|
-
mutation CreateNotification($input: CreateNotificationInput!) {
|
|
3896
|
-
createNotification(input: $input) {
|
|
3897
|
-
id
|
|
3898
|
-
userId
|
|
3899
|
-
title
|
|
3900
|
-
message
|
|
3901
|
-
type
|
|
3902
|
-
isRead
|
|
3903
|
-
data
|
|
3904
|
-
createdAt
|
|
3905
|
-
updatedAt
|
|
3906
|
-
}
|
|
3907
|
-
}
|
|
3908
|
-
`;
|
|
3909
|
-
var CREATE_BULK_NOTIFICATIONS = import_client37.gql`
|
|
3910
|
-
mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {
|
|
3911
|
-
createBulkNotifications(input: $input) {
|
|
3912
|
-
id
|
|
3913
|
-
userId
|
|
3914
|
-
title
|
|
3915
|
-
message
|
|
3916
|
-
type
|
|
3917
|
-
isRead
|
|
3918
|
-
data
|
|
3919
|
-
createdAt
|
|
3920
|
-
updatedAt
|
|
3921
|
-
}
|
|
3922
|
-
}
|
|
3923
|
-
`;
|
|
3924
|
-
var MARK_NOTIFICATION_READ = import_client37.gql`
|
|
3925
|
-
mutation MarkNotificationRead($input: MarkNotificationReadInput!) {
|
|
3926
|
-
markNotificationRead(input: $input) {
|
|
3927
|
-
id
|
|
3928
|
-
userId
|
|
3929
|
-
title
|
|
3930
|
-
message
|
|
3931
|
-
type
|
|
3932
|
-
isRead
|
|
3933
|
-
data
|
|
3934
|
-
createdAt
|
|
3935
|
-
updatedAt
|
|
3936
|
-
}
|
|
3937
|
-
}
|
|
3938
|
-
`;
|
|
3939
|
-
var MARK_ALL_NOTIFICATIONS_READ = import_client37.gql`
|
|
3940
|
-
mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
|
|
3941
|
-
markAllNotificationsRead(input: $input)
|
|
3942
|
-
}
|
|
3943
|
-
`;
|
|
3944
4014
|
|
|
3945
4015
|
// src/hooks/useLocationSearch.ts
|
|
3946
4016
|
var handleApiError = (error, message) => {
|
|
@@ -5122,100 +5192,6 @@ function useContactUsForm(data) {
|
|
|
5122
5192
|
};
|
|
5123
5193
|
}
|
|
5124
5194
|
|
|
5125
|
-
// src/hooks/useNotifications.ts
|
|
5126
|
-
var import_client38 = require("@apollo/client");
|
|
5127
|
-
var useNotifications = (userId) => {
|
|
5128
|
-
const client = (0, import_client38.useApolloClient)();
|
|
5129
|
-
const {
|
|
5130
|
-
data: notificationsData,
|
|
5131
|
-
loading: notificationsLoading,
|
|
5132
|
-
error: notificationsError,
|
|
5133
|
-
refetch: refetchNotifications
|
|
5134
|
-
} = (0, import_client38.useQuery)(GET_USER_NOTIFICATIONS2, {
|
|
5135
|
-
variables: { userId, limit: 50, offset: 0 },
|
|
5136
|
-
fetchPolicy: "cache-and-network"
|
|
5137
|
-
});
|
|
5138
|
-
const {
|
|
5139
|
-
data: countData,
|
|
5140
|
-
loading: countLoading,
|
|
5141
|
-
error: countError,
|
|
5142
|
-
refetch: refetchCount
|
|
5143
|
-
} = (0, import_client38.useQuery)(GET_NOTIFICATION_COUNT, {
|
|
5144
|
-
variables: { userId },
|
|
5145
|
-
fetchPolicy: "cache-and-network"
|
|
5146
|
-
});
|
|
5147
|
-
const {
|
|
5148
|
-
data: unreadData,
|
|
5149
|
-
loading: unreadLoading,
|
|
5150
|
-
error: unreadError,
|
|
5151
|
-
refetch: refetchUnread
|
|
5152
|
-
} = (0, import_client38.useQuery)(GET_UNREAD_NOTIFICATIONS, {
|
|
5153
|
-
variables: { userId, limit: 20 },
|
|
5154
|
-
fetchPolicy: "cache-and-network"
|
|
5155
|
-
});
|
|
5156
|
-
const [createNotification, { loading: createLoading }] = (0, import_client38.useMutation)(CREATE_NOTIFICATION);
|
|
5157
|
-
const [createBulkNotifications, { loading: createBulkLoading }] = (0, import_client38.useMutation)(
|
|
5158
|
-
CREATE_BULK_NOTIFICATIONS
|
|
5159
|
-
);
|
|
5160
|
-
const [markNotificationRead, { loading: markReadLoading }] = (0, import_client38.useMutation)(
|
|
5161
|
-
MARK_NOTIFICATION_READ
|
|
5162
|
-
);
|
|
5163
|
-
const [markAllNotificationsRead, { loading: markAllReadLoading }] = (0, import_client38.useMutation)(MARK_ALL_NOTIFICATIONS_READ);
|
|
5164
|
-
const refetchAll = () => {
|
|
5165
|
-
refetchNotifications();
|
|
5166
|
-
refetchCount();
|
|
5167
|
-
refetchUnread();
|
|
5168
|
-
};
|
|
5169
|
-
const invalidateCache = () => {
|
|
5170
|
-
client.cache.evict({ fieldName: "userNotifications" });
|
|
5171
|
-
client.cache.evict({ fieldName: "notificationCount" });
|
|
5172
|
-
client.cache.evict({ fieldName: "unreadNotifications" });
|
|
5173
|
-
client.cache.gc();
|
|
5174
|
-
};
|
|
5175
|
-
return {
|
|
5176
|
-
// Data
|
|
5177
|
-
notifications: notificationsData?.userNotifications || [],
|
|
5178
|
-
count: countData?.notificationCount || { total: 0, unread: 0 },
|
|
5179
|
-
unreadNotifications: unreadData?.unreadNotifications || [],
|
|
5180
|
-
// Loading states
|
|
5181
|
-
notificationsLoading,
|
|
5182
|
-
countLoading,
|
|
5183
|
-
unreadLoading,
|
|
5184
|
-
createLoading,
|
|
5185
|
-
createBulkLoading,
|
|
5186
|
-
markReadLoading,
|
|
5187
|
-
markAllReadLoading,
|
|
5188
|
-
// Errors
|
|
5189
|
-
notificationsError,
|
|
5190
|
-
countError,
|
|
5191
|
-
unreadError,
|
|
5192
|
-
// Actions
|
|
5193
|
-
createNotification: async (input) => {
|
|
5194
|
-
const result = await createNotification({ variables: { input } });
|
|
5195
|
-
refetchAll();
|
|
5196
|
-
return result;
|
|
5197
|
-
},
|
|
5198
|
-
createBulkNotifications: async (input) => {
|
|
5199
|
-
const result = await createBulkNotifications({ variables: { input } });
|
|
5200
|
-
refetchAll();
|
|
5201
|
-
return result;
|
|
5202
|
-
},
|
|
5203
|
-
markNotificationRead: async (input) => {
|
|
5204
|
-
const result = await markNotificationRead({ variables: { input } });
|
|
5205
|
-
refetchAll();
|
|
5206
|
-
return result;
|
|
5207
|
-
},
|
|
5208
|
-
markAllNotificationsRead: async (input) => {
|
|
5209
|
-
const result = await markAllNotificationsRead({ variables: { input } });
|
|
5210
|
-
refetchAll();
|
|
5211
|
-
return result;
|
|
5212
|
-
},
|
|
5213
|
-
// Utilities
|
|
5214
|
-
refetchAll,
|
|
5215
|
-
invalidateCache
|
|
5216
|
-
};
|
|
5217
|
-
};
|
|
5218
|
-
|
|
5219
5195
|
// src/storage/index.ts
|
|
5220
5196
|
var SAVED_PASSWORD_KEY = "savedPassword";
|
|
5221
5197
|
var SAVED_EMAIL_KEY = "savedEmail";
|
|
@@ -5260,12 +5236,21 @@ var fonts = {
|
|
|
5260
5236
|
fontWeight: "400"
|
|
5261
5237
|
}
|
|
5262
5238
|
};
|
|
5239
|
+
|
|
5240
|
+
// src/types/notification.ts
|
|
5241
|
+
var EnumNotificationType = ((EnumNotificationType2) => {
|
|
5242
|
+
EnumNotificationType2[EnumNotificationType2["MARKET"] = "market" /* MARKET */] = "MARKET";
|
|
5243
|
+
EnumNotificationType2[EnumNotificationType2["STALLHOLDER"] = "stallholder" /* STALLHOLDER */] = "STALLHOLDER";
|
|
5244
|
+
EnumNotificationType2["RELATION"] = "relation";
|
|
5245
|
+
EnumNotificationType2["CHAT"] = "chat";
|
|
5246
|
+
EnumNotificationType2["SYSTEM"] = "system";
|
|
5247
|
+
return EnumNotificationType2;
|
|
5248
|
+
})(EnumNotificationType || {});
|
|
5263
5249
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5264
5250
|
0 && (module.exports = {
|
|
5265
|
-
CREATE_BULK_NOTIFICATIONS,
|
|
5266
|
-
CREATE_NOTIFICATION,
|
|
5267
5251
|
EnumInviteStatus,
|
|
5268
5252
|
EnumNotification,
|
|
5253
|
+
EnumNotificationType,
|
|
5269
5254
|
EnumOSType,
|
|
5270
5255
|
EnumPaymentMethod,
|
|
5271
5256
|
EnumRegions,
|
|
@@ -5275,12 +5260,8 @@ var fonts = {
|
|
|
5275
5260
|
EnumSocialMedia,
|
|
5276
5261
|
EnumUserLicence,
|
|
5277
5262
|
EnumUserRole,
|
|
5278
|
-
|
|
5279
|
-
GET_UNREAD_NOTIFICATIONS,
|
|
5280
|
-
GET_USER_NOTIFICATIONS,
|
|
5263
|
+
GET_CHAT_MESSAGE,
|
|
5281
5264
|
ImageTypeEnum,
|
|
5282
|
-
MARK_ALL_NOTIFICATIONS_READ,
|
|
5283
|
-
MARK_NOTIFICATION_READ,
|
|
5284
5265
|
SAVED_EMAIL_KEY,
|
|
5285
5266
|
SAVED_PASSWORD_KEY,
|
|
5286
5267
|
SAVED_REFRESH_TOKEN_KEY,
|
|
@@ -5353,9 +5334,11 @@ var fonts = {
|
|
|
5353
5334
|
useAdminUpdateResourceType,
|
|
5354
5335
|
useContactUs,
|
|
5355
5336
|
useContactUsForm,
|
|
5337
|
+
useCreateBulkNotifications,
|
|
5356
5338
|
useCreateChat,
|
|
5357
5339
|
useCreateMarket,
|
|
5358
5340
|
useCreateMarketInfo,
|
|
5341
|
+
useCreateNotification,
|
|
5359
5342
|
useCreatePoster,
|
|
5360
5343
|
useCreatePushToken,
|
|
5361
5344
|
useCreateRelation,
|
|
@@ -5370,12 +5353,14 @@ var fonts = {
|
|
|
5370
5353
|
useDeleteTester,
|
|
5371
5354
|
useDeleteUser,
|
|
5372
5355
|
useGetChat,
|
|
5356
|
+
useGetChatSubscription,
|
|
5373
5357
|
useGetMarket,
|
|
5374
5358
|
useGetMarketInfo,
|
|
5375
5359
|
useGetMarketRelations,
|
|
5376
5360
|
useGetMarkets,
|
|
5377
5361
|
useGetMarketsByRegion,
|
|
5378
5362
|
useGetMarketsNearMe,
|
|
5363
|
+
useGetNotificationCount,
|
|
5379
5364
|
useGetRelation,
|
|
5380
5365
|
useGetRelationByMarketAndStallholder,
|
|
5381
5366
|
useGetResourceConnections,
|
|
@@ -5386,6 +5371,7 @@ var fonts = {
|
|
|
5386
5371
|
useGetStallholdersByRegion,
|
|
5387
5372
|
useGetTester,
|
|
5388
5373
|
useGetTesters,
|
|
5374
|
+
useGetUnreadNotifications,
|
|
5389
5375
|
useGetUser,
|
|
5390
5376
|
useGetUserChats,
|
|
5391
5377
|
useGetUserFavourites,
|
|
@@ -5397,9 +5383,10 @@ var fonts = {
|
|
|
5397
5383
|
useLogin,
|
|
5398
5384
|
useLoginForm,
|
|
5399
5385
|
useLogout,
|
|
5386
|
+
useMarkAllNotificationsRead,
|
|
5387
|
+
useMarkNotificationRead,
|
|
5400
5388
|
useMarketForm,
|
|
5401
5389
|
useMarketInfoForm,
|
|
5402
|
-
useNotifications,
|
|
5403
5390
|
useRefreshToken,
|
|
5404
5391
|
useRegister,
|
|
5405
5392
|
useRegisterForm,
|