@timardex/cluemart-shared 1.0.82 → 1.0.84

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.
Files changed (37) hide show
  1. package/dist/{chunk-3LHMZDI4.mjs → chunk-JIL6JFWC.mjs} +1 -7
  2. package/dist/chunk-JIL6JFWC.mjs.map +1 -0
  3. package/dist/{chunk-ZDTBLK7U.mjs → chunk-ORGSRTC4.mjs} +2 -2
  4. package/dist/enums/index.cjs +0 -7
  5. package/dist/enums/index.cjs.map +1 -1
  6. package/dist/enums/index.d.mts +1 -5
  7. package/dist/enums/index.d.ts +1 -5
  8. package/dist/enums/index.mjs +1 -3
  9. package/dist/formFields/index.cjs.map +1 -1
  10. package/dist/formFields/index.mjs +2 -2
  11. package/dist/graphql/index.cjs +243 -300
  12. package/dist/graphql/index.cjs.map +1 -1
  13. package/dist/graphql/index.d.mts +41 -30
  14. package/dist/graphql/index.d.ts +41 -30
  15. package/dist/graphql/index.mjs +238 -300
  16. package/dist/graphql/index.mjs.map +1 -1
  17. package/dist/hooks/index.cjs.map +1 -1
  18. package/dist/hooks/index.mjs +2 -2
  19. package/dist/index.cjs +255 -307
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.mts +62 -53
  22. package/dist/index.d.ts +62 -53
  23. package/dist/index.mjs +248 -305
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/{notification-P3Vnadx_.d.mts → notification-DDVH6HnE.d.mts} +23 -21
  26. package/dist/{notification-P3Vnadx_.d.ts → notification-DDVH6HnE.d.ts} +23 -21
  27. package/dist/types/index.cjs +21 -0
  28. package/dist/types/index.cjs.map +1 -1
  29. package/dist/types/index.d.mts +1 -1
  30. package/dist/types/index.d.ts +1 -1
  31. package/dist/types/index.mjs +14 -0
  32. package/dist/types/index.mjs.map +1 -1
  33. package/dist/utils/index.cjs.map +1 -1
  34. package/dist/utils/index.mjs +2 -2
  35. package/package.json +1 -1
  36. package/dist/chunk-3LHMZDI4.mjs.map +0 -1
  37. /package/dist/{chunk-ZDTBLK7U.mjs.map → chunk-ORGSRTC4.mjs.map} +0 -0
package/dist/index.cjs CHANGED
@@ -32,12 +32,12 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  EnumInviteStatus: () => EnumInviteStatus,
34
34
  EnumNotification: () => EnumNotification,
35
+ EnumNotificationType: () => EnumNotificationType,
35
36
  EnumOSType: () => EnumOSType,
36
37
  EnumPaymentMethod: () => EnumPaymentMethod,
37
38
  EnumRegions: () => EnumRegions,
38
39
  EnumRelationResource: () => EnumRelationResource,
39
40
  EnumResourceType: () => EnumResourceType,
40
- EnumResourceTypeIcon: () => EnumResourceTypeIcon,
41
41
  EnumSocialMedia: () => EnumSocialMedia,
42
42
  EnumUserLicence: () => EnumUserLicence,
43
43
  EnumUserRole: () => EnumUserRole,
@@ -115,9 +115,11 @@ __export(index_exports, {
115
115
  useAdminUpdateResourceType: () => useAdminUpdateResourceType,
116
116
  useContactUs: () => useContactUs,
117
117
  useContactUsForm: () => useContactUsForm,
118
+ useCreateBulkNotifications: () => useCreateBulkNotifications,
118
119
  useCreateChat: () => useCreateChat,
119
120
  useCreateMarket: () => useCreateMarket,
120
121
  useCreateMarketInfo: () => useCreateMarketInfo,
122
+ useCreateNotification: () => useCreateNotification,
121
123
  useCreatePoster: () => useCreatePoster,
122
124
  useCreatePushToken: () => useCreatePushToken,
123
125
  useCreateRelation: () => useCreateRelation,
@@ -127,6 +129,7 @@ __export(index_exports, {
127
129
  useCreateUser: () => useCreateUser,
128
130
  useDeleteChat: () => useDeleteChat,
129
131
  useDeleteMarket: () => useDeleteMarket,
132
+ useDeleteNotification: () => useDeleteNotification,
130
133
  useDeleteRelation: () => useDeleteRelation,
131
134
  useDeleteStallholder: () => useDeleteStallholder,
132
135
  useDeleteTester: () => useDeleteTester,
@@ -139,6 +142,7 @@ __export(index_exports, {
139
142
  useGetMarkets: () => useGetMarkets,
140
143
  useGetMarketsByRegion: () => useGetMarketsByRegion,
141
144
  useGetMarketsNearMe: () => useGetMarketsNearMe,
145
+ useGetNotificationCount: () => useGetNotificationCount,
142
146
  useGetRelation: () => useGetRelation,
143
147
  useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
144
148
  useGetResourceConnections: () => useGetResourceConnections,
@@ -160,9 +164,10 @@ __export(index_exports, {
160
164
  useLogin: () => useLogin,
161
165
  useLoginForm: () => useLoginForm,
162
166
  useLogout: () => useLogout,
167
+ useMarkAllNotificationsRead: () => useMarkAllNotificationsRead,
168
+ useMarkNotificationRead: () => useMarkNotificationRead,
163
169
  useMarketForm: () => useMarketForm,
164
170
  useMarketInfoForm: () => useMarketInfoForm,
165
- useNotifications: () => useNotifications,
166
171
  useRefreshToken: () => useRefreshToken,
167
172
  useRegister: () => useRegister,
168
173
  useRegisterForm: () => useRegisterForm,
@@ -236,11 +241,6 @@ var EnumNotification = /* @__PURE__ */ ((EnumNotification2) => {
236
241
  EnumNotification2["STALLHOLDER_APPLICATION_TO_MARKET"] = "stallholder_application_to_market" /* STALLHOLDER_APPLICATION_TO_MARKET */;
237
242
  return EnumNotification2;
238
243
  })(EnumNotification || {});
239
- var EnumResourceTypeIcon = /* @__PURE__ */ ((EnumResourceTypeIcon2) => {
240
- EnumResourceTypeIcon2["MARKET"] = "compass";
241
- EnumResourceTypeIcon2["STALLHOLDER"] = "store";
242
- return EnumResourceTypeIcon2;
243
- })(EnumResourceTypeIcon || {});
244
244
  var EnumRegions = /* @__PURE__ */ ((EnumRegions2) => {
245
245
  EnumRegions2["Auckland"] = "Auckland";
246
246
  EnumRegions2["BayOfPlentyGisborne"] = "Bay of Plenty & Gisborne";
@@ -2809,11 +2809,6 @@ var GET_USER_FAVOURITES = import_client16.gql`
2809
2809
  ${MARKET}
2810
2810
  ${STALLHOLDER}
2811
2811
  `;
2812
- var GET_USER_NOTIFICATIONS = import_client16.gql`
2813
- query getMissedNotifications {
2814
- userNotifications
2815
- }
2816
- `;
2817
2812
 
2818
2813
  // src/graphql/hooks/market/hooksMutation.ts
2819
2814
  var useCreateMarket = () => {
@@ -2958,12 +2953,162 @@ var useGetMarketInfo = (marketId) => {
2958
2953
  return { error, loading, marketInfo: marketInfo2, refetch };
2959
2954
  };
2960
2955
 
2961
- // src/graphql/hooks/poster.ts
2956
+ // src/graphql/hooks/notifications/hooksMutation.ts
2957
+ var import_client21 = require("@apollo/client");
2958
+
2959
+ // src/graphql/mutations/notification.ts
2962
2960
  var import_client20 = require("@apollo/client");
2963
2961
 
2964
- // src/graphql/mutations/poster.ts
2962
+ // src/graphql/queries/notification.ts
2965
2963
  var import_client19 = require("@apollo/client");
2966
- var CREATE_POSTER_MUTATION = import_client19.gql`
2964
+ var USER_NOTIFICATION_FRAGMENT = import_client19.gql`
2965
+ fragment UserNotificationFields on Notification {
2966
+ _id
2967
+ userId
2968
+ title
2969
+ message
2970
+ type
2971
+ isRead
2972
+ data
2973
+ createdAt
2974
+ updatedAt
2975
+ }
2976
+ `;
2977
+ var GET_USER_NOTIFICATIONS = import_client19.gql`
2978
+ query getUserNotifications($userId: String!, $limit: Int, $offset: Int) {
2979
+ userNotifications(userId: $userId, limit: $limit, offset: $offset) {
2980
+ ...UserNotificationFields
2981
+ }
2982
+ }
2983
+ ${USER_NOTIFICATION_FRAGMENT}
2984
+ `;
2985
+ var GET_NOTIFICATION_COUNT = import_client19.gql`
2986
+ query getNotificationCount($userId: String!) {
2987
+ notificationCount(userId: $userId) {
2988
+ total
2989
+ unread
2990
+ }
2991
+ }
2992
+ `;
2993
+
2994
+ // src/graphql/mutations/notification.ts
2995
+ var CREATE_NOTIFICATION = import_client20.gql`
2996
+ mutation createNotification($input: CreateNotificationInput!) {
2997
+ createNotification(input: $input) {
2998
+ ...UserNotificationFields
2999
+ }
3000
+ }
3001
+ ${USER_NOTIFICATION_FRAGMENT}
3002
+ `;
3003
+ var CREATE_BULK_NOTIFICATIONS = import_client20.gql`
3004
+ mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
3005
+ createBulkNotifications(input: $input) {
3006
+ ...UserNotificationFields
3007
+ }
3008
+ }
3009
+ ${USER_NOTIFICATION_FRAGMENT}
3010
+ `;
3011
+ var MARK_NOTIFICATION_READ = import_client20.gql`
3012
+ mutation markNotificationRead($input: MarkNotificationReadInput!) {
3013
+ markNotificationRead(input: $input) {
3014
+ ...UserNotificationFields
3015
+ }
3016
+ }
3017
+ ${USER_NOTIFICATION_FRAGMENT}
3018
+ `;
3019
+ var MARK_ALL_NOTIFICATIONS_READ = import_client20.gql`
3020
+ mutation markAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
3021
+ markAllNotificationsRead(input: $input)
3022
+ }
3023
+ `;
3024
+ var DELETE_NOTIFICATION = import_client20.gql`
3025
+ mutation deleteNotification($_id: ID!) {
3026
+ deleteNotification(_id: $_id)
3027
+ }
3028
+ `;
3029
+
3030
+ // src/graphql/hooks/notifications/hooksMutation.ts
3031
+ var useCreateNotification = () => {
3032
+ const [createNotification, { loading, error }] = (0, import_client21.useMutation)(CREATE_NOTIFICATION);
3033
+ return { createNotification, error, loading };
3034
+ };
3035
+ var useCreateBulkNotifications = () => {
3036
+ const [createBulkNotifications, { loading, error }] = (0, import_client21.useMutation)(
3037
+ CREATE_BULK_NOTIFICATIONS
3038
+ );
3039
+ return { createBulkNotifications, error, loading };
3040
+ };
3041
+ var useMarkNotificationRead = () => {
3042
+ const [markNotificationRead, { loading, error }] = (0, import_client21.useMutation)(
3043
+ MARK_NOTIFICATION_READ,
3044
+ {
3045
+ refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
3046
+ }
3047
+ );
3048
+ return { error, loading, markNotificationRead };
3049
+ };
3050
+ var useMarkAllNotificationsRead = () => {
3051
+ const [markAllNotificationsRead, { loading, error }] = (0, import_client21.useMutation)(
3052
+ MARK_ALL_NOTIFICATIONS_READ,
3053
+ {
3054
+ refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
3055
+ }
3056
+ );
3057
+ return { error, loading, markAllNotificationsRead };
3058
+ };
3059
+ var useDeleteNotification = () => {
3060
+ const [deleteNotification, { loading, error }] = (0, import_client21.useMutation)(
3061
+ DELETE_NOTIFICATION,
3062
+ {
3063
+ refetchQueries: [{ query: GET_USER_NOTIFICATIONS }]
3064
+ }
3065
+ );
3066
+ return { deleteNotification, error, loading };
3067
+ };
3068
+
3069
+ // src/graphql/hooks/notifications/hooksQuery.ts
3070
+ var import_client22 = require("@apollo/client");
3071
+ var useGetUserNotifications = (userId, limit, offset) => {
3072
+ const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_USER_NOTIFICATIONS, {
3073
+ fetchPolicy: "no-cache",
3074
+ skip: !userId,
3075
+ variables: {
3076
+ limit: limit ?? 50,
3077
+ offset: offset ?? 0,
3078
+ userId
3079
+ }
3080
+ });
3081
+ const notifications = data?.userNotifications;
3082
+ return {
3083
+ error,
3084
+ loading,
3085
+ notifications,
3086
+ refetch
3087
+ };
3088
+ };
3089
+ var useGetNotificationCount = (userId) => {
3090
+ const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_NOTIFICATION_COUNT, {
3091
+ fetchPolicy: "no-cache",
3092
+ skip: !userId,
3093
+ variables: {
3094
+ userId
3095
+ }
3096
+ });
3097
+ const notificationCount = data?.notificationCount;
3098
+ return {
3099
+ error,
3100
+ loading,
3101
+ notificationCount,
3102
+ refetch
3103
+ };
3104
+ };
3105
+
3106
+ // src/graphql/hooks/poster.ts
3107
+ var import_client24 = require("@apollo/client");
3108
+
3109
+ // src/graphql/mutations/poster.ts
3110
+ var import_client23 = require("@apollo/client");
3111
+ var CREATE_POSTER_MUTATION = import_client23.gql`
2967
3112
  mutation createPoster($input: PosterInputType!) {
2968
3113
  createPoster(input: $input) {
2969
3114
  message
@@ -2973,18 +3118,18 @@ var CREATE_POSTER_MUTATION = import_client19.gql`
2973
3118
 
2974
3119
  // src/graphql/hooks/poster.ts
2975
3120
  var useCreatePoster = () => {
2976
- const [createPoster, { loading, error }] = (0, import_client20.useMutation)(
3121
+ const [createPoster, { loading, error }] = (0, import_client24.useMutation)(
2977
3122
  CREATE_POSTER_MUTATION
2978
3123
  );
2979
3124
  return { createPoster, error, loading };
2980
3125
  };
2981
3126
 
2982
3127
  // src/graphql/hooks/pushToken.ts
2983
- var import_client22 = require("@apollo/client");
3128
+ var import_client26 = require("@apollo/client");
2984
3129
 
2985
3130
  // src/graphql/mutations/pushToken.ts
2986
- var import_client21 = require("@apollo/client");
2987
- var CREATE_PUSH_TOKEN_MUTATION = import_client21.gql`
3131
+ var import_client25 = require("@apollo/client");
3132
+ var CREATE_PUSH_TOKEN_MUTATION = import_client25.gql`
2988
3133
  mutation createPushToken($input: PushTokenInput!) {
2989
3134
  createPushToken(input: $input) {
2990
3135
  success
@@ -2994,21 +3139,21 @@ var CREATE_PUSH_TOKEN_MUTATION = import_client21.gql`
2994
3139
 
2995
3140
  // src/graphql/hooks/pushToken.ts
2996
3141
  var useCreatePushToken = () => {
2997
- const [createPushToken, { loading, error }] = (0, import_client22.useMutation)(
3142
+ const [createPushToken, { loading, error }] = (0, import_client26.useMutation)(
2998
3143
  CREATE_PUSH_TOKEN_MUTATION
2999
3144
  );
3000
3145
  return { createPushToken, error, loading };
3001
3146
  };
3002
3147
 
3003
3148
  // src/graphql/hooks/relation/hooksMutation.ts
3004
- var import_client25 = require("@apollo/client");
3149
+ var import_client29 = require("@apollo/client");
3005
3150
 
3006
3151
  // src/graphql/mutations/relation.ts
3007
- var import_client24 = require("@apollo/client");
3152
+ var import_client28 = require("@apollo/client");
3008
3153
 
3009
3154
  // src/graphql/queries/relation.ts
3010
- var import_client23 = require("@apollo/client");
3011
- var RELATION_DATES_FRAGMENT = import_client23.gql`
3155
+ var import_client27 = require("@apollo/client");
3156
+ var RELATION_DATES_FRAGMENT = import_client27.gql`
3012
3157
  fragment RelationDates on RelationDateType {
3013
3158
  lastUpdateBy
3014
3159
  paymentReference
@@ -3022,7 +3167,7 @@ var RELATION_DATES_FRAGMENT = import_client23.gql`
3022
3167
  status
3023
3168
  }
3024
3169
  `;
3025
- var RELATION_FIELDS_FRAGMENT = import_client23.gql`
3170
+ var RELATION_FIELDS_FRAGMENT = import_client27.gql`
3026
3171
  fragment RelationFields on RelationType {
3027
3172
  _id
3028
3173
  apiMessage
@@ -3039,7 +3184,7 @@ var RELATION_FIELDS_FRAGMENT = import_client23.gql`
3039
3184
  }
3040
3185
  ${RELATION_DATES_FRAGMENT}
3041
3186
  `;
3042
- var GET_RELATION = import_client23.gql`
3187
+ var GET_RELATION = import_client27.gql`
3043
3188
  query getRelation($id: ID!) {
3044
3189
  relation(_id: $id) {
3045
3190
  ...RelationFields
@@ -3047,7 +3192,7 @@ var GET_RELATION = import_client23.gql`
3047
3192
  }
3048
3193
  ${RELATION_FIELDS_FRAGMENT}
3049
3194
  `;
3050
- var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client23.gql`
3195
+ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client27.gql`
3051
3196
  query getRelationByMarketAndStallholder($marketId: ID!, $stallholderId: ID!) {
3052
3197
  relationByMarketAndStallholder(
3053
3198
  marketId: $marketId
@@ -3058,7 +3203,7 @@ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client23.gql`
3058
3203
  }
3059
3204
  ${RELATION_FIELDS_FRAGMENT}
3060
3205
  `;
3061
- var GET_MARKET_RELATIONS = import_client23.gql`
3206
+ var GET_MARKET_RELATIONS = import_client27.gql`
3062
3207
  query getMarketRelations($marketId: ID!) {
3063
3208
  marketRelations(marketId: $marketId) {
3064
3209
  ...RelationFields
@@ -3066,7 +3211,7 @@ var GET_MARKET_RELATIONS = import_client23.gql`
3066
3211
  }
3067
3212
  ${RELATION_FIELDS_FRAGMENT}
3068
3213
  `;
3069
- var GET_STALLHOLDER_RELATIONS = import_client23.gql`
3214
+ var GET_STALLHOLDER_RELATIONS = import_client27.gql`
3070
3215
  query getStallholderRelations($stallholderId: ID!) {
3071
3216
  stallholderRelations(stallholderId: $stallholderId) {
3072
3217
  ...RelationFields
@@ -3074,7 +3219,7 @@ var GET_STALLHOLDER_RELATIONS = import_client23.gql`
3074
3219
  }
3075
3220
  ${RELATION_FIELDS_FRAGMENT}
3076
3221
  `;
3077
- var GET_RESOURCE_CONNECTIONS = import_client23.gql`
3222
+ var GET_RESOURCE_CONNECTIONS = import_client27.gql`
3078
3223
  query getResourceConnections(
3079
3224
  $resourceId: ID!
3080
3225
  $resourceType: ResourceTypeEnum!
@@ -3177,7 +3322,7 @@ var GET_RESOURCE_CONNECTIONS = import_client23.gql`
3177
3322
  `;
3178
3323
 
3179
3324
  // src/graphql/mutations/relation.ts
3180
- var CREATE_RELATION_MUTATION = import_client24.gql`
3325
+ var CREATE_RELATION_MUTATION = import_client28.gql`
3181
3326
  mutation createRelation($input: RelationInputType!) {
3182
3327
  createRelation(input: $input) {
3183
3328
  ...RelationFields
@@ -3185,7 +3330,7 @@ var CREATE_RELATION_MUTATION = import_client24.gql`
3185
3330
  }
3186
3331
  ${RELATION_FIELDS_FRAGMENT}
3187
3332
  `;
3188
- var UPDATE_RELATION_MUTATION = import_client24.gql`
3333
+ var UPDATE_RELATION_MUTATION = import_client28.gql`
3189
3334
  mutation updateRelation($_id: ID!, $input: RelationInputType!) {
3190
3335
  updateRelation(_id: $_id, input: $input) {
3191
3336
  ...RelationFields
@@ -3193,7 +3338,7 @@ var UPDATE_RELATION_MUTATION = import_client24.gql`
3193
3338
  }
3194
3339
  ${RELATION_FIELDS_FRAGMENT}
3195
3340
  `;
3196
- var DELETE_RELATION_MUTATION = import_client24.gql`
3341
+ var DELETE_RELATION_MUTATION = import_client28.gql`
3197
3342
  mutation deleteRelation($_id: ID!) {
3198
3343
  deleteRelation(_id: $_id) {
3199
3344
  ...RelationFields
@@ -3205,7 +3350,7 @@ var DELETE_RELATION_MUTATION = import_client24.gql`
3205
3350
  // src/graphql/hooks/relation/hooksMutation.ts
3206
3351
  var fetchPolicy = "no-cache";
3207
3352
  var useCreateRelation = () => {
3208
- const [createRelation, { loading, error }] = (0, import_client25.useMutation)(
3353
+ const [createRelation, { loading, error }] = (0, import_client29.useMutation)(
3209
3354
  CREATE_RELATION_MUTATION,
3210
3355
  {
3211
3356
  awaitRefetchQueries: true,
@@ -3257,7 +3402,7 @@ var useCreateRelation = () => {
3257
3402
  return { createRelation, error, loading };
3258
3403
  };
3259
3404
  var useUpdateRelation = () => {
3260
- const [updateRelation, { loading, error }] = (0, import_client25.useMutation)(
3405
+ const [updateRelation, { loading, error }] = (0, import_client29.useMutation)(
3261
3406
  UPDATE_RELATION_MUTATION,
3262
3407
  {
3263
3408
  awaitRefetchQueries: true,
@@ -3305,7 +3450,7 @@ var useUpdateRelation = () => {
3305
3450
  return { error, loading, updateRelation };
3306
3451
  };
3307
3452
  var useDeleteRelation = () => {
3308
- const [deleteRelation, { loading, error }] = (0, import_client25.useMutation)(
3453
+ const [deleteRelation, { loading, error }] = (0, import_client29.useMutation)(
3309
3454
  DELETE_RELATION_MUTATION,
3310
3455
  {
3311
3456
  awaitRefetchQueries: true,
@@ -3353,9 +3498,9 @@ var useDeleteRelation = () => {
3353
3498
  };
3354
3499
 
3355
3500
  // src/graphql/hooks/relation/hooksQuery.ts
3356
- var import_client26 = require("@apollo/client");
3501
+ var import_client30 = require("@apollo/client");
3357
3502
  var useGetRelation = (id) => {
3358
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_RELATION, {
3503
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_RELATION, {
3359
3504
  fetchPolicy: "network-only",
3360
3505
  skip: id === "",
3361
3506
  variables: { id }
@@ -3364,7 +3509,7 @@ var useGetRelation = (id) => {
3364
3509
  return { error, loading, refetch, relation };
3365
3510
  };
3366
3511
  var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
3367
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(
3512
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(
3368
3513
  GET_RELATION_BY_MARKET_AND_STALLHOLDER,
3369
3514
  {
3370
3515
  fetchPolicy: "network-only",
@@ -3376,7 +3521,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
3376
3521
  return { error, loading, refetch, relationByMarketAndStallholder };
3377
3522
  };
3378
3523
  var useGetMarketRelations = (marketId) => {
3379
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_MARKET_RELATIONS, {
3524
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_MARKET_RELATIONS, {
3380
3525
  fetchPolicy: "network-only",
3381
3526
  skip: marketId === "",
3382
3527
  variables: { marketId }
@@ -3385,7 +3530,7 @@ var useGetMarketRelations = (marketId) => {
3385
3530
  return { error, loading, marketRelations, refetch };
3386
3531
  };
3387
3532
  var useGetStallholderRelations = (stallholderId) => {
3388
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(
3533
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(
3389
3534
  GET_STALLHOLDER_RELATIONS,
3390
3535
  {
3391
3536
  fetchPolicy: "network-only",
@@ -3397,7 +3542,7 @@ var useGetStallholderRelations = (stallholderId) => {
3397
3542
  return { error, loading, refetch, stallholderRelations };
3398
3543
  };
3399
3544
  var useGetResourceConnections = (resourceId, resourceType) => {
3400
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_RESOURCE_CONNECTIONS, {
3545
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_RESOURCE_CONNECTIONS, {
3401
3546
  fetchPolicy: "network-only",
3402
3547
  variables: { resourceId, resourceType }
3403
3548
  });
@@ -3406,11 +3551,11 @@ var useGetResourceConnections = (resourceId, resourceType) => {
3406
3551
  };
3407
3552
 
3408
3553
  // src/graphql/hooks/stallholder/hooksMutation.ts
3409
- var import_client28 = require("@apollo/client");
3554
+ var import_client32 = require("@apollo/client");
3410
3555
 
3411
3556
  // src/graphql/mutations/stallholder.ts
3412
- var import_client27 = require("@apollo/client");
3413
- var CREATE_STALLHOLDER_MUTATION = import_client27.gql`
3557
+ var import_client31 = require("@apollo/client");
3558
+ var CREATE_STALLHOLDER_MUTATION = import_client31.gql`
3414
3559
  mutation createStallholder($input: StallholderInputType!) {
3415
3560
  createStallholder(input: $input) {
3416
3561
  ...StallholderFields
@@ -3418,7 +3563,7 @@ var CREATE_STALLHOLDER_MUTATION = import_client27.gql`
3418
3563
  }
3419
3564
  ${STALLHOLDER}
3420
3565
  `;
3421
- var UPDATE_STALLHOLDER_MUTATION = import_client27.gql`
3566
+ var UPDATE_STALLHOLDER_MUTATION = import_client31.gql`
3422
3567
  mutation updateStallholder($_id: ID!, $input: StallholderInputType!) {
3423
3568
  updateStallholder(_id: $_id, input: $input) {
3424
3569
  ...StallholderFields
@@ -3426,12 +3571,12 @@ var UPDATE_STALLHOLDER_MUTATION = import_client27.gql`
3426
3571
  }
3427
3572
  ${STALLHOLDER}
3428
3573
  `;
3429
- var DELETE_STALLHOLDER_MUTATION = import_client27.gql`
3574
+ var DELETE_STALLHOLDER_MUTATION = import_client31.gql`
3430
3575
  mutation deleteStallholder($_id: ID!) {
3431
3576
  deleteStallholder(_id: $_id)
3432
3577
  }
3433
3578
  `;
3434
- var CREATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
3579
+ var CREATE_STALLHOLDER_INFO_MUTATION = import_client31.gql`
3435
3580
  mutation createStallholderInfo($input: StallholderInfoInputType!) {
3436
3581
  createStallholderInfo(input: $input) {
3437
3582
  ...StallholderInfoFields
@@ -3439,7 +3584,7 @@ var CREATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
3439
3584
  }
3440
3585
  ${STALLHOLDER_INFO}
3441
3586
  `;
3442
- var UPDATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
3587
+ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client31.gql`
3443
3588
  mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
3444
3589
  updateStallholderInfo(_id: $_id, input: $input) {
3445
3590
  ...StallholderInfoFields
@@ -3450,7 +3595,7 @@ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
3450
3595
 
3451
3596
  // src/graphql/hooks/stallholder/hooksMutation.ts
3452
3597
  var useCreateStallholder = () => {
3453
- const [createStallholder, { loading, error }] = (0, import_client28.useMutation)(
3598
+ const [createStallholder, { loading, error }] = (0, import_client32.useMutation)(
3454
3599
  CREATE_STALLHOLDER_MUTATION,
3455
3600
  {
3456
3601
  awaitRefetchQueries: true,
@@ -3462,7 +3607,7 @@ var useCreateStallholder = () => {
3462
3607
  return { createStallholder, error, loading };
3463
3608
  };
3464
3609
  var useUpdateStallholder = () => {
3465
- const [updateStallholder, { loading, error }] = (0, import_client28.useMutation)(
3610
+ const [updateStallholder, { loading, error }] = (0, import_client32.useMutation)(
3466
3611
  UPDATE_STALLHOLDER_MUTATION,
3467
3612
  {
3468
3613
  awaitRefetchQueries: true,
@@ -3474,7 +3619,7 @@ var useUpdateStallholder = () => {
3474
3619
  return { error, loading, updateStallholder };
3475
3620
  };
3476
3621
  var useDeleteStallholder = () => {
3477
- const [deleteStallholder, { loading, error }] = (0, import_client28.useMutation)(
3622
+ const [deleteStallholder, { loading, error }] = (0, import_client32.useMutation)(
3478
3623
  DELETE_STALLHOLDER_MUTATION,
3479
3624
  {
3480
3625
  awaitRefetchQueries: true,
@@ -3486,7 +3631,7 @@ var useDeleteStallholder = () => {
3486
3631
  return { deleteStallholder, error, loading };
3487
3632
  };
3488
3633
  var useCreateStallholderInfo = () => {
3489
- const [createStallholderInfo, { loading, error }] = (0, import_client28.useMutation)(
3634
+ const [createStallholderInfo, { loading, error }] = (0, import_client32.useMutation)(
3490
3635
  CREATE_STALLHOLDER_INFO_MUTATION,
3491
3636
  {
3492
3637
  awaitRefetchQueries: true,
@@ -3510,7 +3655,7 @@ var useCreateStallholderInfo = () => {
3510
3655
  return { createStallholderInfo, error, loading };
3511
3656
  };
3512
3657
  var useUpdateStallholderInfo = () => {
3513
- const [updateStallholderInfo, { loading, error }] = (0, import_client28.useMutation)(
3658
+ const [updateStallholderInfo, { loading, error }] = (0, import_client32.useMutation)(
3514
3659
  UPDATE_STALLHOLDER_INFO_MUTATION,
3515
3660
  {
3516
3661
  awaitRefetchQueries: true,
@@ -3531,9 +3676,9 @@ var useUpdateStallholderInfo = () => {
3531
3676
  };
3532
3677
 
3533
3678
  // src/graphql/hooks/stallholder/hooksQuery.ts
3534
- var import_client29 = require("@apollo/client");
3679
+ var import_client33 = require("@apollo/client");
3535
3680
  var useGetStallholders = () => {
3536
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDERS, {
3681
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDERS, {
3537
3682
  fetchPolicy: "network-only"
3538
3683
  });
3539
3684
  const stallholders = data?.stallholders;
@@ -3545,7 +3690,7 @@ var useGetStallholders = () => {
3545
3690
  };
3546
3691
  };
3547
3692
  var useGetStallholder = (_id) => {
3548
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDER, {
3693
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDER, {
3549
3694
  fetchPolicy: "network-only",
3550
3695
  skip: !_id,
3551
3696
  variables: { _id }
@@ -3554,7 +3699,7 @@ var useGetStallholder = (_id) => {
3554
3699
  return { error, loading, refetch, stallholder };
3555
3700
  };
3556
3701
  var useGetStallholdersByRegion = (region) => {
3557
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(
3702
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(
3558
3703
  GET_STALLHOLDERS_BY_REGION,
3559
3704
  {
3560
3705
  fetchPolicy: "no-cache",
@@ -3566,7 +3711,7 @@ var useGetStallholdersByRegion = (region) => {
3566
3711
  return { error, loading, refetch, stallholdersByRegion };
3567
3712
  };
3568
3713
  var useSearchStallholders = (search, region) => {
3569
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(SEARCH_STALLHOLDERS, {
3714
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(SEARCH_STALLHOLDERS, {
3570
3715
  fetchPolicy: "network-only",
3571
3716
  skip: search.length < 3,
3572
3717
  variables: { region, search }
@@ -3575,7 +3720,7 @@ var useSearchStallholders = (search, region) => {
3575
3720
  return { error, loading, refetch, stallholderSearch };
3576
3721
  };
3577
3722
  var useGetStallholderInfo = (stallholderId) => {
3578
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDER_INFO, {
3723
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDER_INFO, {
3579
3724
  fetchPolicy: "network-only",
3580
3725
  skip: !stallholderId,
3581
3726
  variables: { stallholderId }
@@ -3590,14 +3735,14 @@ var useGetStallholderInfo = (stallholderId) => {
3590
3735
  };
3591
3736
 
3592
3737
  // src/graphql/hooks/testers/hooksMutation.ts
3593
- var import_client32 = require("@apollo/client");
3738
+ var import_client36 = require("@apollo/client");
3594
3739
 
3595
3740
  // src/graphql/mutations/testers.ts
3596
- var import_client31 = require("@apollo/client");
3741
+ var import_client35 = require("@apollo/client");
3597
3742
 
3598
3743
  // src/graphql/queries/testers.ts
3599
- var import_client30 = require("@apollo/client");
3600
- var TESTER_FIELDS_FRAGMENT = import_client30.gql`
3744
+ var import_client34 = require("@apollo/client");
3745
+ var TESTER_FIELDS_FRAGMENT = import_client34.gql`
3601
3746
  fragment TesterFields on TesterType {
3602
3747
  _id
3603
3748
  active
@@ -3610,7 +3755,7 @@ var TESTER_FIELDS_FRAGMENT = import_client30.gql`
3610
3755
  updatedAt
3611
3756
  }
3612
3757
  `;
3613
- var GET_TESTERS = import_client30.gql`
3758
+ var GET_TESTERS = import_client34.gql`
3614
3759
  query getTesters {
3615
3760
  testers {
3616
3761
  ...TesterFields
@@ -3618,7 +3763,7 @@ var GET_TESTERS = import_client30.gql`
3618
3763
  }
3619
3764
  ${TESTER_FIELDS_FRAGMENT}
3620
3765
  `;
3621
- var GET_TESTER = import_client30.gql`
3766
+ var GET_TESTER = import_client34.gql`
3622
3767
  query getTester($_id: ID!) {
3623
3768
  tester(_id: $_id) {
3624
3769
  ...TesterFields
@@ -3628,7 +3773,7 @@ var GET_TESTER = import_client30.gql`
3628
3773
  `;
3629
3774
 
3630
3775
  // src/graphql/mutations/testers.ts
3631
- var CREATE_TESTER_MUTATION = import_client31.gql`
3776
+ var CREATE_TESTER_MUTATION = import_client35.gql`
3632
3777
  mutation createTester($input: TesterInputType!) {
3633
3778
  createTester(input: $input) {
3634
3779
  ...TesterFields
@@ -3636,7 +3781,7 @@ var CREATE_TESTER_MUTATION = import_client31.gql`
3636
3781
  }
3637
3782
  ${TESTER_FIELDS_FRAGMENT}
3638
3783
  `;
3639
- var UPDATE_TESTER_MUTATION = import_client31.gql`
3784
+ var UPDATE_TESTER_MUTATION = import_client35.gql`
3640
3785
  mutation updateTester($_id: ID!, $input: TesterInputType!) {
3641
3786
  updateTester(_id: $_id, input: $input) {
3642
3787
  ...TesterFields
@@ -3644,7 +3789,7 @@ var UPDATE_TESTER_MUTATION = import_client31.gql`
3644
3789
  }
3645
3790
  ${TESTER_FIELDS_FRAGMENT}
3646
3791
  `;
3647
- var DELETE_TESTER_MUTATION = import_client31.gql`
3792
+ var DELETE_TESTER_MUTATION = import_client35.gql`
3648
3793
  mutation deleteTester($_id: ID!) {
3649
3794
  deleteTester(_id: $_id)
3650
3795
  }
@@ -3652,7 +3797,7 @@ var DELETE_TESTER_MUTATION = import_client31.gql`
3652
3797
 
3653
3798
  // src/graphql/hooks/testers/hooksMutation.ts
3654
3799
  var useCreateTester = () => {
3655
- const [createTester, { data, loading, error }] = (0, import_client32.useMutation)(
3800
+ const [createTester, { data, loading, error }] = (0, import_client36.useMutation)(
3656
3801
  CREATE_TESTER_MUTATION
3657
3802
  );
3658
3803
  return {
@@ -3663,7 +3808,7 @@ var useCreateTester = () => {
3663
3808
  };
3664
3809
  };
3665
3810
  var useUpdateTester = () => {
3666
- const [updateTester, { data, loading, error }] = (0, import_client32.useMutation)(
3811
+ const [updateTester, { data, loading, error }] = (0, import_client36.useMutation)(
3667
3812
  UPDATE_TESTER_MUTATION
3668
3813
  );
3669
3814
  return {
@@ -3674,16 +3819,16 @@ var useUpdateTester = () => {
3674
3819
  };
3675
3820
  };
3676
3821
  var useDeleteTester = () => {
3677
- const [deleteTester, { loading, error }] = (0, import_client32.useMutation)(
3822
+ const [deleteTester, { loading, error }] = (0, import_client36.useMutation)(
3678
3823
  DELETE_TESTER_MUTATION
3679
3824
  );
3680
3825
  return { deleteTester, error, loading };
3681
3826
  };
3682
3827
 
3683
3828
  // src/graphql/hooks/testers/hooksQuery.ts
3684
- var import_client33 = require("@apollo/client");
3829
+ var import_client37 = require("@apollo/client");
3685
3830
  var useGetTesters = () => {
3686
- const { data, loading, error, refetch } = (0, import_client33.useQuery)(GET_TESTERS);
3831
+ const { data, loading, error, refetch } = (0, import_client37.useQuery)(GET_TESTERS);
3687
3832
  const testers = data?.testers;
3688
3833
  return {
3689
3834
  error,
@@ -3693,7 +3838,7 @@ var useGetTesters = () => {
3693
3838
  };
3694
3839
  };
3695
3840
  var useGetTester = (_id) => {
3696
- const { data, loading, error, refetch } = (0, import_client33.useQuery)(GET_TESTER, {
3841
+ const { data, loading, error, refetch } = (0, import_client37.useQuery)(GET_TESTER, {
3697
3842
  skip: !_id,
3698
3843
  variables: { _id }
3699
3844
  });
@@ -3702,11 +3847,11 @@ var useGetTester = (_id) => {
3702
3847
  };
3703
3848
 
3704
3849
  // src/graphql/hooks/user/hooksMutation.ts
3705
- var import_client35 = require("@apollo/client");
3850
+ var import_client39 = require("@apollo/client");
3706
3851
 
3707
3852
  // src/graphql/mutations/user.ts
3708
- var import_client34 = require("@apollo/client");
3709
- var CREATE_USER_MUTATION = import_client34.gql`
3853
+ var import_client38 = require("@apollo/client");
3854
+ var CREATE_USER_MUTATION = import_client38.gql`
3710
3855
  mutation createUser($input: UserInputType!) {
3711
3856
  createUser(input: $input) {
3712
3857
  ...UserFields
@@ -3714,7 +3859,7 @@ var CREATE_USER_MUTATION = import_client34.gql`
3714
3859
  }
3715
3860
  ${USER_FIELDS_FRAGMENT}
3716
3861
  `;
3717
- var UPDATE_USER_MUTATION = import_client34.gql`
3862
+ var UPDATE_USER_MUTATION = import_client38.gql`
3718
3863
  mutation updateUser($_id: ID!, $input: UserInputType!) {
3719
3864
  updateUser(_id: $_id, input: $input) {
3720
3865
  ...UserFields
@@ -3722,12 +3867,12 @@ var UPDATE_USER_MUTATION = import_client34.gql`
3722
3867
  }
3723
3868
  ${USER_FIELDS_FRAGMENT}
3724
3869
  `;
3725
- var DELETE_USER_MUTATION = import_client34.gql`
3870
+ var DELETE_USER_MUTATION = import_client38.gql`
3726
3871
  mutation deleteUser($_id: ID!) {
3727
3872
  deleteUser(_id: $_id)
3728
3873
  }
3729
3874
  `;
3730
- var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
3875
+ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client38.gql`
3731
3876
  mutation addUserFavouriteResource(
3732
3877
  $resourceId: ID!
3733
3878
  $resourceType: ResourceTypeEnum!
@@ -3743,7 +3888,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
3743
3888
  }
3744
3889
  ${USER_FIELDS_FRAGMENT}
3745
3890
  `;
3746
- var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
3891
+ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client38.gql`
3747
3892
  mutation removeUserFavouriteResource(
3748
3893
  $resourceId: ID!
3749
3894
  $resourceType: ResourceTypeEnum!
@@ -3762,11 +3907,11 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
3762
3907
 
3763
3908
  // src/graphql/hooks/user/hooksMutation.ts
3764
3909
  var useCreateUser = () => {
3765
- const [createUser, { loading, error }] = (0, import_client35.useMutation)(CREATE_USER_MUTATION);
3910
+ const [createUser, { loading, error }] = (0, import_client39.useMutation)(CREATE_USER_MUTATION);
3766
3911
  return { createUser, error, loading };
3767
3912
  };
3768
3913
  var useUpdateUser = () => {
3769
- const [updateUser, { loading, error }] = (0, import_client35.useMutation)(UPDATE_USER_MUTATION, {
3914
+ const [updateUser, { loading, error }] = (0, import_client39.useMutation)(UPDATE_USER_MUTATION, {
3770
3915
  awaitRefetchQueries: true,
3771
3916
  refetchQueries: (mutationResult) => {
3772
3917
  const userId = mutationResult?.data?.updateUser?._id;
@@ -3777,11 +3922,11 @@ var useUpdateUser = () => {
3777
3922
  return { error, loading, updateUser };
3778
3923
  };
3779
3924
  var useDeleteUser = () => {
3780
- const [deleteUser, { loading, error }] = (0, import_client35.useMutation)(DELETE_USER_MUTATION);
3925
+ const [deleteUser, { loading, error }] = (0, import_client39.useMutation)(DELETE_USER_MUTATION);
3781
3926
  return { deleteUser, error, loading };
3782
3927
  };
3783
3928
  var useAddUserFavouriteResource = () => {
3784
- const [addUserFavouriteResource, { loading, error }] = (0, import_client35.useMutation)(
3929
+ const [addUserFavouriteResource, { loading, error }] = (0, import_client39.useMutation)(
3785
3930
  ADD_USER_FAVOURITE_RESOURCE_MUTATION,
3786
3931
  {
3787
3932
  awaitRefetchQueries: true,
@@ -3791,7 +3936,7 @@ var useAddUserFavouriteResource = () => {
3791
3936
  return { addUserFavouriteResource, error, loading };
3792
3937
  };
3793
3938
  var useRemoveUserFavouriteResource = () => {
3794
- const [removeUserFavouriteResource, { loading, error }] = (0, import_client35.useMutation)(
3939
+ const [removeUserFavouriteResource, { loading, error }] = (0, import_client39.useMutation)(
3795
3940
  REMOVE_USER_FAVOURITE_RESOURCE_MUTATION,
3796
3941
  {
3797
3942
  awaitRefetchQueries: true,
@@ -3802,37 +3947,37 @@ var useRemoveUserFavouriteResource = () => {
3802
3947
  };
3803
3948
 
3804
3949
  // src/graphql/hooks/user/hooksQuery.ts
3805
- var import_client36 = require("@apollo/client");
3950
+ var import_client40 = require("@apollo/client");
3806
3951
  var useGetUsers = () => {
3807
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USERS, {
3952
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USERS, {
3808
3953
  fetchPolicy: "network-only"
3809
3954
  });
3810
3955
  const users = data?.users;
3811
3956
  return { error, loading, refetch, users };
3812
3957
  };
3813
3958
  var useGetUser = (_id) => {
3814
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER, {
3959
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER, {
3815
3960
  variables: { _id }
3816
3961
  });
3817
3962
  const user = data?.user;
3818
3963
  return { error, loading, refetch, user };
3819
3964
  };
3820
3965
  var useGetUserMarkets = () => {
3821
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_MARKETS, {
3966
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_MARKETS, {
3822
3967
  fetchPolicy: "network-only"
3823
3968
  });
3824
3969
  const userMarkets = data?.userMarkets;
3825
3970
  return { error, loading, refetch, userMarkets };
3826
3971
  };
3827
3972
  var useGetUserStallholder = () => {
3828
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_STALLHOLDER, {
3973
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_STALLHOLDER, {
3829
3974
  fetchPolicy: "network-only"
3830
3975
  });
3831
3976
  const userStallholder = data?.userStallholder;
3832
3977
  return { error, loading, refetch, userStallholder };
3833
3978
  };
3834
3979
  var useGetUserFavourites = () => {
3835
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_FAVOURITES, {
3980
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_FAVOURITES, {
3836
3981
  fetchPolicy: "network-only"
3837
3982
  });
3838
3983
  const markets = data?.userFavourites.markets;
@@ -3843,218 +3988,6 @@ var useGetUserFavourites = () => {
3843
3988
  };
3844
3989
  return { error, loading, refetch, userFavourites };
3845
3990
  };
3846
- var useGetUserNotifications = () => {
3847
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_NOTIFICATIONS, {
3848
- fetchPolicy: "network-only"
3849
- });
3850
- const userNotifications = data?.userNotifications;
3851
- return { error, loading, refetch, userNotifications };
3852
- };
3853
-
3854
- // src/graphql/hooks/notifications.ts
3855
- var import_client39 = require("@apollo/client");
3856
-
3857
- // src/graphql/mutations/notification.ts
3858
- var import_client37 = require("@apollo/client");
3859
- var CREATE_NOTIFICATION = import_client37.gql`
3860
- mutation CreateNotification($input: CreateNotificationInput!) {
3861
- createNotification(input: $input) {
3862
- id
3863
- userId
3864
- title
3865
- message
3866
- type
3867
- isRead
3868
- data
3869
- createdAt
3870
- updatedAt
3871
- }
3872
- }
3873
- `;
3874
- var CREATE_BULK_NOTIFICATIONS = import_client37.gql`
3875
- mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {
3876
- createBulkNotifications(input: $input) {
3877
- id
3878
- userId
3879
- title
3880
- message
3881
- type
3882
- isRead
3883
- data
3884
- createdAt
3885
- updatedAt
3886
- }
3887
- }
3888
- `;
3889
- var MARK_NOTIFICATION_READ = import_client37.gql`
3890
- mutation MarkNotificationRead($input: MarkNotificationReadInput!) {
3891
- markNotificationRead(input: $input) {
3892
- id
3893
- userId
3894
- title
3895
- message
3896
- type
3897
- isRead
3898
- data
3899
- createdAt
3900
- updatedAt
3901
- }
3902
- }
3903
- `;
3904
- var MARK_ALL_NOTIFICATIONS_READ = import_client37.gql`
3905
- mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
3906
- markAllNotificationsRead(input: $input)
3907
- }
3908
- `;
3909
-
3910
- // src/graphql/queries/notification.ts
3911
- var import_client38 = require("@apollo/client");
3912
- var GET_USER_NOTIFICATIONS2 = import_client38.gql`
3913
- query GetUserNotifications(
3914
- $userId: String!
3915
- $limit: Int
3916
- $offset: Int
3917
- $isRead: String
3918
- ) {
3919
- userNotifications(
3920
- userId: $userId
3921
- limit: $limit
3922
- offset: $offset
3923
- isRead: $isRead
3924
- ) {
3925
- id
3926
- userId
3927
- title
3928
- message
3929
- type
3930
- isRead
3931
- data
3932
- createdAt
3933
- updatedAt
3934
- }
3935
- }
3936
- `;
3937
- var GET_NOTIFICATION_COUNT = import_client38.gql`
3938
- query GetNotificationCount($userId: String!) {
3939
- notificationCount(userId: $userId) {
3940
- total
3941
- unread
3942
- }
3943
- }
3944
- `;
3945
- var GET_UNREAD_NOTIFICATIONS = import_client38.gql`
3946
- query GetUnreadNotifications($userId: String!, $limit: Int) {
3947
- unreadNotifications(userId: $userId, limit: $limit) {
3948
- id
3949
- userId
3950
- title
3951
- message
3952
- type
3953
- isRead
3954
- data
3955
- createdAt
3956
- updatedAt
3957
- }
3958
- }
3959
- `;
3960
-
3961
- // src/graphql/hooks/notifications.ts
3962
- var useNotifications = (userId) => {
3963
- const client = (0, import_client39.useApolloClient)();
3964
- const {
3965
- data: notificationsData,
3966
- loading: notificationsLoading,
3967
- error: notificationsError,
3968
- refetch: refetchNotifications
3969
- } = (0, import_client39.useQuery)(GET_USER_NOTIFICATIONS2, {
3970
- variables: { userId, limit: 50, offset: 0 },
3971
- fetchPolicy: "cache-and-network",
3972
- skip: !userId
3973
- });
3974
- const {
3975
- data: countData,
3976
- loading: countLoading,
3977
- error: countError,
3978
- refetch: refetchCount
3979
- } = (0, import_client39.useQuery)(GET_NOTIFICATION_COUNT, {
3980
- variables: { userId },
3981
- fetchPolicy: "cache-and-network",
3982
- skip: !userId
3983
- });
3984
- const {
3985
- data: unreadData,
3986
- loading: unreadLoading,
3987
- error: unreadError,
3988
- refetch: refetchUnread
3989
- } = (0, import_client39.useQuery)(GET_UNREAD_NOTIFICATIONS, {
3990
- variables: { userId, limit: 20 },
3991
- fetchPolicy: "cache-and-network",
3992
- skip: !userId
3993
- });
3994
- const [createNotification, { loading: createLoading }] = (0, import_client39.useMutation)(CREATE_NOTIFICATION);
3995
- const [createBulkNotifications, { loading: createBulkLoading }] = (0, import_client39.useMutation)(
3996
- CREATE_BULK_NOTIFICATIONS
3997
- );
3998
- const [markNotificationRead, { loading: markReadLoading }] = (0, import_client39.useMutation)(
3999
- MARK_NOTIFICATION_READ
4000
- );
4001
- const [markAllNotificationsRead, { loading: markAllReadLoading }] = (0, import_client39.useMutation)(MARK_ALL_NOTIFICATIONS_READ);
4002
- const refetchAll = () => {
4003
- if (userId) {
4004
- refetchNotifications();
4005
- refetchCount();
4006
- refetchUnread();
4007
- }
4008
- };
4009
- const invalidateCache = () => {
4010
- client.cache.evict({ fieldName: "userNotifications" });
4011
- client.cache.evict({ fieldName: "notificationCount" });
4012
- client.cache.evict({ fieldName: "unreadNotifications" });
4013
- client.cache.gc();
4014
- };
4015
- return {
4016
- // Data
4017
- notifications: notificationsData?.userNotifications || [],
4018
- count: countData?.notificationCount || { total: 0, unread: 0 },
4019
- unreadNotifications: unreadData?.unreadNotifications || [],
4020
- // Loading states
4021
- notificationsLoading,
4022
- countLoading,
4023
- unreadLoading,
4024
- createLoading,
4025
- createBulkLoading,
4026
- markReadLoading,
4027
- markAllReadLoading,
4028
- // Errors
4029
- notificationsError,
4030
- countError,
4031
- unreadError,
4032
- // Actions
4033
- createNotification: async (input) => {
4034
- const result = await createNotification({ variables: { input } });
4035
- refetchAll();
4036
- return result;
4037
- },
4038
- createBulkNotifications: async (input) => {
4039
- const result = await createBulkNotifications({ variables: { input } });
4040
- refetchAll();
4041
- return result;
4042
- },
4043
- markNotificationRead: async (input) => {
4044
- const result = await markNotificationRead({ variables: { input } });
4045
- refetchAll();
4046
- return result;
4047
- },
4048
- markAllNotificationsRead: async (input) => {
4049
- const result = await markAllNotificationsRead({ variables: { input } });
4050
- refetchAll();
4051
- return result;
4052
- },
4053
- // Utilities
4054
- refetchAll,
4055
- invalidateCache
4056
- };
4057
- };
4058
3991
 
4059
3992
  // src/hooks/useLocationSearch.ts
4060
3993
  var handleApiError = (error, message) => {
@@ -5280,16 +5213,26 @@ var fonts = {
5280
5213
  fontWeight: "400"
5281
5214
  }
5282
5215
  };
5216
+
5217
+ // src/types/notification.ts
5218
+ var EnumNotificationType = ((EnumNotificationType2) => {
5219
+ EnumNotificationType2[EnumNotificationType2["MARKET"] = "market" /* MARKET */] = "MARKET";
5220
+ EnumNotificationType2[EnumNotificationType2["STALLHOLDER"] = "stallholder" /* STALLHOLDER */] = "STALLHOLDER";
5221
+ EnumNotificationType2["RELATION"] = "relation";
5222
+ EnumNotificationType2["CHAT"] = "chat";
5223
+ EnumNotificationType2["SYSTEM"] = "system";
5224
+ return EnumNotificationType2;
5225
+ })(EnumNotificationType || {});
5283
5226
  // Annotate the CommonJS export names for ESM import in node:
5284
5227
  0 && (module.exports = {
5285
5228
  EnumInviteStatus,
5286
5229
  EnumNotification,
5230
+ EnumNotificationType,
5287
5231
  EnumOSType,
5288
5232
  EnumPaymentMethod,
5289
5233
  EnumRegions,
5290
5234
  EnumRelationResource,
5291
5235
  EnumResourceType,
5292
- EnumResourceTypeIcon,
5293
5236
  EnumSocialMedia,
5294
5237
  EnumUserLicence,
5295
5238
  EnumUserRole,
@@ -5367,9 +5310,11 @@ var fonts = {
5367
5310
  useAdminUpdateResourceType,
5368
5311
  useContactUs,
5369
5312
  useContactUsForm,
5313
+ useCreateBulkNotifications,
5370
5314
  useCreateChat,
5371
5315
  useCreateMarket,
5372
5316
  useCreateMarketInfo,
5317
+ useCreateNotification,
5373
5318
  useCreatePoster,
5374
5319
  useCreatePushToken,
5375
5320
  useCreateRelation,
@@ -5379,6 +5324,7 @@ var fonts = {
5379
5324
  useCreateUser,
5380
5325
  useDeleteChat,
5381
5326
  useDeleteMarket,
5327
+ useDeleteNotification,
5382
5328
  useDeleteRelation,
5383
5329
  useDeleteStallholder,
5384
5330
  useDeleteTester,
@@ -5391,6 +5337,7 @@ var fonts = {
5391
5337
  useGetMarkets,
5392
5338
  useGetMarketsByRegion,
5393
5339
  useGetMarketsNearMe,
5340
+ useGetNotificationCount,
5394
5341
  useGetRelation,
5395
5342
  useGetRelationByMarketAndStallholder,
5396
5343
  useGetResourceConnections,
@@ -5412,9 +5359,10 @@ var fonts = {
5412
5359
  useLogin,
5413
5360
  useLoginForm,
5414
5361
  useLogout,
5362
+ useMarkAllNotificationsRead,
5363
+ useMarkNotificationRead,
5415
5364
  useMarketForm,
5416
5365
  useMarketInfoForm,
5417
- useNotifications,
5418
5366
  useRefreshToken,
5419
5367
  useRegister,
5420
5368
  useRegisterForm,