@timardex/cluemart-shared 1.0.81 → 1.0.82

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/index.mjs CHANGED
@@ -2469,7 +2469,20 @@ var useRemoveParticipantFromChat = () => {
2469
2469
  };
2470
2470
 
2471
2471
  // src/graphql/hooks/chat/hooksQuery.ts
2472
- import { useQuery } from "@apollo/client";
2472
+ import { useQuery, useSubscription } from "@apollo/client";
2473
+
2474
+ // src/graphql/subscriptions/chat.ts
2475
+ import { gql as gql8 } from "@apollo/client";
2476
+ var GET_CHAT_MESSAGE = gql8`
2477
+ subscription {
2478
+ getChatMessage {
2479
+ ...ChatFields
2480
+ }
2481
+ }
2482
+ ${CHAT_FIELDS_FRAGMENT}
2483
+ `;
2484
+
2485
+ // src/graphql/hooks/chat/hooksQuery.ts
2473
2486
  var useGetChat = (_id) => {
2474
2487
  const { loading, error, data, refetch } = useQuery(CHAT, {
2475
2488
  fetchPolicy: "network-only",
@@ -2486,13 +2499,18 @@ var useGetUserChats = () => {
2486
2499
  const userChats = data?.userChats;
2487
2500
  return { error, loading, refetch, userChats };
2488
2501
  };
2502
+ var useGetChatSubscription = () => {
2503
+ const { data, loading, error } = useSubscription(GET_CHAT_MESSAGE);
2504
+ const chat = data?.getChat;
2505
+ return { chat, error, loading };
2506
+ };
2489
2507
 
2490
2508
  // src/graphql/hooks/contactUs.ts
2491
2509
  import { useMutation as useMutation4 } from "@apollo/client";
2492
2510
 
2493
2511
  // src/graphql/mutations/contactUs.ts
2494
- import { gql as gql8 } from "@apollo/client";
2495
- var CONTACT_US_MUTATION = gql8`
2512
+ import { gql as gql9 } from "@apollo/client";
2513
+ var CONTACT_US_MUTATION = gql9`
2496
2514
  mutation contactUs($input: ContactUsInputType!) {
2497
2515
  contactUs(input: $input) {
2498
2516
  message
@@ -2510,8 +2528,8 @@ var useContactUs = () => {
2510
2528
  import { useMutation as useMutation5 } from "@apollo/client";
2511
2529
 
2512
2530
  // src/graphql/mutations/market.ts
2513
- import { gql as gql9 } from "@apollo/client";
2514
- var CREATE_MARKET_MUTATION = gql9`
2531
+ import { gql as gql10 } from "@apollo/client";
2532
+ var CREATE_MARKET_MUTATION = gql10`
2515
2533
  mutation createMarket($input: MarketInputType!) {
2516
2534
  createMarket(input: $input) {
2517
2535
  ...MarketFields
@@ -2519,7 +2537,7 @@ var CREATE_MARKET_MUTATION = gql9`
2519
2537
  }
2520
2538
  ${MARKET}
2521
2539
  `;
2522
- var UPDATE_MARKET_MUTATION = gql9`
2540
+ var UPDATE_MARKET_MUTATION = gql10`
2523
2541
  mutation updateMarket($_id: ID!, $input: MarketInputType!) {
2524
2542
  updateMarket(_id: $_id, input: $input) {
2525
2543
  ...MarketFields
@@ -2527,12 +2545,12 @@ var UPDATE_MARKET_MUTATION = gql9`
2527
2545
  }
2528
2546
  ${MARKET}
2529
2547
  `;
2530
- var DELETE_MARKET_MUTATION = gql9`
2548
+ var DELETE_MARKET_MUTATION = gql10`
2531
2549
  mutation deleteMarket($_id: ID!) {
2532
2550
  deleteMarket(_id: $_id)
2533
2551
  }
2534
2552
  `;
2535
- var CREATE_MARKET_INFO_MUTATION = gql9`
2553
+ var CREATE_MARKET_INFO_MUTATION = gql10`
2536
2554
  mutation createMarketInfo($input: MarketInfoInputType!) {
2537
2555
  createMarketInfo(input: $input) {
2538
2556
  ...MarketInfoFields
@@ -2540,7 +2558,7 @@ var CREATE_MARKET_INFO_MUTATION = gql9`
2540
2558
  }
2541
2559
  ${MARKET_INFO}
2542
2560
  `;
2543
- var UPDATE_MARKET_INFO_MUTATION = gql9`
2561
+ var UPDATE_MARKET_INFO_MUTATION = gql10`
2544
2562
  mutation updateMarketInfo($_id: ID!, $input: MarketInfoInputType!) {
2545
2563
  updateMarketInfo(_id: $_id, input: $input) {
2546
2564
  ...MarketInfoFields
@@ -2550,8 +2568,8 @@ var UPDATE_MARKET_INFO_MUTATION = gql9`
2550
2568
  `;
2551
2569
 
2552
2570
  // src/graphql/queries/user.ts
2553
- import { gql as gql10 } from "@apollo/client";
2554
- var GET_USERS = gql10`
2571
+ import { gql as gql11 } from "@apollo/client";
2572
+ var GET_USERS = gql11`
2555
2573
  query getUsers {
2556
2574
  users {
2557
2575
  ...UserFields
@@ -2559,7 +2577,7 @@ var GET_USERS = gql10`
2559
2577
  }
2560
2578
  ${USER_FIELDS_FRAGMENT}
2561
2579
  `;
2562
- var GET_USER = gql10`
2580
+ var GET_USER = gql11`
2563
2581
  query getUser($_id: ID!) {
2564
2582
  user(_id: $_id) {
2565
2583
  ...UserFields
@@ -2567,7 +2585,7 @@ var GET_USER = gql10`
2567
2585
  }
2568
2586
  ${USER_FIELDS_FRAGMENT}
2569
2587
  `;
2570
- var GET_USER_MARKETS = gql10`
2588
+ var GET_USER_MARKETS = gql11`
2571
2589
  query getUserMarkets {
2572
2590
  userMarkets {
2573
2591
  ...MarketFields
@@ -2575,7 +2593,7 @@ var GET_USER_MARKETS = gql10`
2575
2593
  }
2576
2594
  ${MARKET}
2577
2595
  `;
2578
- var GET_USER_STALLHOLDER = gql10`
2596
+ var GET_USER_STALLHOLDER = gql11`
2579
2597
  query getUserStallholder {
2580
2598
  userStallholder {
2581
2599
  ...StallholderFields
@@ -2583,7 +2601,7 @@ var GET_USER_STALLHOLDER = gql10`
2583
2601
  }
2584
2602
  ${STALLHOLDER}
2585
2603
  `;
2586
- var GET_USER_FAVOURITES = gql10`
2604
+ var GET_USER_FAVOURITES = gql11`
2587
2605
  query getUserFavourites {
2588
2606
  userFavourites {
2589
2607
  markets {
@@ -2597,7 +2615,7 @@ var GET_USER_FAVOURITES = gql10`
2597
2615
  ${MARKET}
2598
2616
  ${STALLHOLDER}
2599
2617
  `;
2600
- var GET_USER_NOTIFICATIONS = gql10`
2618
+ var GET_USER_NOTIFICATIONS = gql11`
2601
2619
  query getMissedNotifications {
2602
2620
  userNotifications
2603
2621
  }
@@ -2750,8 +2768,8 @@ var useGetMarketInfo = (marketId) => {
2750
2768
  import { useMutation as useMutation6 } from "@apollo/client";
2751
2769
 
2752
2770
  // src/graphql/mutations/poster.ts
2753
- import { gql as gql11 } from "@apollo/client";
2754
- var CREATE_POSTER_MUTATION = gql11`
2771
+ import { gql as gql12 } from "@apollo/client";
2772
+ var CREATE_POSTER_MUTATION = gql12`
2755
2773
  mutation createPoster($input: PosterInputType!) {
2756
2774
  createPoster(input: $input) {
2757
2775
  message
@@ -2771,8 +2789,8 @@ var useCreatePoster = () => {
2771
2789
  import { useMutation as useMutation7 } from "@apollo/client";
2772
2790
 
2773
2791
  // src/graphql/mutations/pushToken.ts
2774
- import { gql as gql12 } from "@apollo/client";
2775
- var CREATE_PUSH_TOKEN_MUTATION = gql12`
2792
+ import { gql as gql13 } from "@apollo/client";
2793
+ var CREATE_PUSH_TOKEN_MUTATION = gql13`
2776
2794
  mutation createPushToken($input: PushTokenInput!) {
2777
2795
  createPushToken(input: $input) {
2778
2796
  success
@@ -2792,11 +2810,11 @@ var useCreatePushToken = () => {
2792
2810
  import { useMutation as useMutation8 } from "@apollo/client";
2793
2811
 
2794
2812
  // src/graphql/mutations/relation.ts
2795
- import { gql as gql14 } from "@apollo/client";
2813
+ import { gql as gql15 } from "@apollo/client";
2796
2814
 
2797
2815
  // src/graphql/queries/relation.ts
2798
- import { gql as gql13 } from "@apollo/client";
2799
- var RELATION_DATES_FRAGMENT = gql13`
2816
+ import { gql as gql14 } from "@apollo/client";
2817
+ var RELATION_DATES_FRAGMENT = gql14`
2800
2818
  fragment RelationDates on RelationDateType {
2801
2819
  lastUpdateBy
2802
2820
  paymentReference
@@ -2810,7 +2828,7 @@ var RELATION_DATES_FRAGMENT = gql13`
2810
2828
  status
2811
2829
  }
2812
2830
  `;
2813
- var RELATION_FIELDS_FRAGMENT = gql13`
2831
+ var RELATION_FIELDS_FRAGMENT = gql14`
2814
2832
  fragment RelationFields on RelationType {
2815
2833
  _id
2816
2834
  apiMessage
@@ -2827,7 +2845,7 @@ var RELATION_FIELDS_FRAGMENT = gql13`
2827
2845
  }
2828
2846
  ${RELATION_DATES_FRAGMENT}
2829
2847
  `;
2830
- var GET_RELATION = gql13`
2848
+ var GET_RELATION = gql14`
2831
2849
  query getRelation($id: ID!) {
2832
2850
  relation(_id: $id) {
2833
2851
  ...RelationFields
@@ -2835,7 +2853,7 @@ var GET_RELATION = gql13`
2835
2853
  }
2836
2854
  ${RELATION_FIELDS_FRAGMENT}
2837
2855
  `;
2838
- var GET_RELATION_BY_MARKET_AND_STALLHOLDER = gql13`
2856
+ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = gql14`
2839
2857
  query getRelationByMarketAndStallholder($marketId: ID!, $stallholderId: ID!) {
2840
2858
  relationByMarketAndStallholder(
2841
2859
  marketId: $marketId
@@ -2846,7 +2864,7 @@ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = gql13`
2846
2864
  }
2847
2865
  ${RELATION_FIELDS_FRAGMENT}
2848
2866
  `;
2849
- var GET_MARKET_RELATIONS = gql13`
2867
+ var GET_MARKET_RELATIONS = gql14`
2850
2868
  query getMarketRelations($marketId: ID!) {
2851
2869
  marketRelations(marketId: $marketId) {
2852
2870
  ...RelationFields
@@ -2854,7 +2872,7 @@ var GET_MARKET_RELATIONS = gql13`
2854
2872
  }
2855
2873
  ${RELATION_FIELDS_FRAGMENT}
2856
2874
  `;
2857
- var GET_STALLHOLDER_RELATIONS = gql13`
2875
+ var GET_STALLHOLDER_RELATIONS = gql14`
2858
2876
  query getStallholderRelations($stallholderId: ID!) {
2859
2877
  stallholderRelations(stallholderId: $stallholderId) {
2860
2878
  ...RelationFields
@@ -2862,7 +2880,7 @@ var GET_STALLHOLDER_RELATIONS = gql13`
2862
2880
  }
2863
2881
  ${RELATION_FIELDS_FRAGMENT}
2864
2882
  `;
2865
- var GET_RESOURCE_CONNECTIONS = gql13`
2883
+ var GET_RESOURCE_CONNECTIONS = gql14`
2866
2884
  query getResourceConnections(
2867
2885
  $resourceId: ID!
2868
2886
  $resourceType: ResourceTypeEnum!
@@ -2965,7 +2983,7 @@ var GET_RESOURCE_CONNECTIONS = gql13`
2965
2983
  `;
2966
2984
 
2967
2985
  // src/graphql/mutations/relation.ts
2968
- var CREATE_RELATION_MUTATION = gql14`
2986
+ var CREATE_RELATION_MUTATION = gql15`
2969
2987
  mutation createRelation($input: RelationInputType!) {
2970
2988
  createRelation(input: $input) {
2971
2989
  ...RelationFields
@@ -2973,7 +2991,7 @@ var CREATE_RELATION_MUTATION = gql14`
2973
2991
  }
2974
2992
  ${RELATION_FIELDS_FRAGMENT}
2975
2993
  `;
2976
- var UPDATE_RELATION_MUTATION = gql14`
2994
+ var UPDATE_RELATION_MUTATION = gql15`
2977
2995
  mutation updateRelation($_id: ID!, $input: RelationInputType!) {
2978
2996
  updateRelation(_id: $_id, input: $input) {
2979
2997
  ...RelationFields
@@ -2981,7 +2999,7 @@ var UPDATE_RELATION_MUTATION = gql14`
2981
2999
  }
2982
3000
  ${RELATION_FIELDS_FRAGMENT}
2983
3001
  `;
2984
- var DELETE_RELATION_MUTATION = gql14`
3002
+ var DELETE_RELATION_MUTATION = gql15`
2985
3003
  mutation deleteRelation($_id: ID!) {
2986
3004
  deleteRelation(_id: $_id) {
2987
3005
  ...RelationFields
@@ -3197,8 +3215,8 @@ var useGetResourceConnections = (resourceId, resourceType) => {
3197
3215
  import { useMutation as useMutation9 } from "@apollo/client";
3198
3216
 
3199
3217
  // src/graphql/mutations/stallholder.ts
3200
- import { gql as gql15 } from "@apollo/client";
3201
- var CREATE_STALLHOLDER_MUTATION = gql15`
3218
+ import { gql as gql16 } from "@apollo/client";
3219
+ var CREATE_STALLHOLDER_MUTATION = gql16`
3202
3220
  mutation createStallholder($input: StallholderInputType!) {
3203
3221
  createStallholder(input: $input) {
3204
3222
  ...StallholderFields
@@ -3206,7 +3224,7 @@ var CREATE_STALLHOLDER_MUTATION = gql15`
3206
3224
  }
3207
3225
  ${STALLHOLDER}
3208
3226
  `;
3209
- var UPDATE_STALLHOLDER_MUTATION = gql15`
3227
+ var UPDATE_STALLHOLDER_MUTATION = gql16`
3210
3228
  mutation updateStallholder($_id: ID!, $input: StallholderInputType!) {
3211
3229
  updateStallholder(_id: $_id, input: $input) {
3212
3230
  ...StallholderFields
@@ -3214,12 +3232,12 @@ var UPDATE_STALLHOLDER_MUTATION = gql15`
3214
3232
  }
3215
3233
  ${STALLHOLDER}
3216
3234
  `;
3217
- var DELETE_STALLHOLDER_MUTATION = gql15`
3235
+ var DELETE_STALLHOLDER_MUTATION = gql16`
3218
3236
  mutation deleteStallholder($_id: ID!) {
3219
3237
  deleteStallholder(_id: $_id)
3220
3238
  }
3221
3239
  `;
3222
- var CREATE_STALLHOLDER_INFO_MUTATION = gql15`
3240
+ var CREATE_STALLHOLDER_INFO_MUTATION = gql16`
3223
3241
  mutation createStallholderInfo($input: StallholderInfoInputType!) {
3224
3242
  createStallholderInfo(input: $input) {
3225
3243
  ...StallholderInfoFields
@@ -3227,7 +3245,7 @@ var CREATE_STALLHOLDER_INFO_MUTATION = gql15`
3227
3245
  }
3228
3246
  ${STALLHOLDER_INFO}
3229
3247
  `;
3230
- var UPDATE_STALLHOLDER_INFO_MUTATION = gql15`
3248
+ var UPDATE_STALLHOLDER_INFO_MUTATION = gql16`
3231
3249
  mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
3232
3250
  updateStallholderInfo(_id: $_id, input: $input) {
3233
3251
  ...StallholderInfoFields
@@ -3381,11 +3399,11 @@ var useGetStallholderInfo = (stallholderId) => {
3381
3399
  import { useMutation as useMutation10 } from "@apollo/client";
3382
3400
 
3383
3401
  // src/graphql/mutations/testers.ts
3384
- import { gql as gql17 } from "@apollo/client";
3402
+ import { gql as gql18 } from "@apollo/client";
3385
3403
 
3386
3404
  // src/graphql/queries/testers.ts
3387
- import { gql as gql16 } from "@apollo/client";
3388
- var TESTER_FIELDS_FRAGMENT = gql16`
3405
+ import { gql as gql17 } from "@apollo/client";
3406
+ var TESTER_FIELDS_FRAGMENT = gql17`
3389
3407
  fragment TesterFields on TesterType {
3390
3408
  _id
3391
3409
  active
@@ -3398,7 +3416,7 @@ var TESTER_FIELDS_FRAGMENT = gql16`
3398
3416
  updatedAt
3399
3417
  }
3400
3418
  `;
3401
- var GET_TESTERS = gql16`
3419
+ var GET_TESTERS = gql17`
3402
3420
  query getTesters {
3403
3421
  testers {
3404
3422
  ...TesterFields
@@ -3406,7 +3424,7 @@ var GET_TESTERS = gql16`
3406
3424
  }
3407
3425
  ${TESTER_FIELDS_FRAGMENT}
3408
3426
  `;
3409
- var GET_TESTER = gql16`
3427
+ var GET_TESTER = gql17`
3410
3428
  query getTester($_id: ID!) {
3411
3429
  tester(_id: $_id) {
3412
3430
  ...TesterFields
@@ -3416,7 +3434,7 @@ var GET_TESTER = gql16`
3416
3434
  `;
3417
3435
 
3418
3436
  // src/graphql/mutations/testers.ts
3419
- var CREATE_TESTER_MUTATION = gql17`
3437
+ var CREATE_TESTER_MUTATION = gql18`
3420
3438
  mutation createTester($input: TesterInputType!) {
3421
3439
  createTester(input: $input) {
3422
3440
  ...TesterFields
@@ -3424,7 +3442,7 @@ var CREATE_TESTER_MUTATION = gql17`
3424
3442
  }
3425
3443
  ${TESTER_FIELDS_FRAGMENT}
3426
3444
  `;
3427
- var UPDATE_TESTER_MUTATION = gql17`
3445
+ var UPDATE_TESTER_MUTATION = gql18`
3428
3446
  mutation updateTester($_id: ID!, $input: TesterInputType!) {
3429
3447
  updateTester(_id: $_id, input: $input) {
3430
3448
  ...TesterFields
@@ -3432,7 +3450,7 @@ var UPDATE_TESTER_MUTATION = gql17`
3432
3450
  }
3433
3451
  ${TESTER_FIELDS_FRAGMENT}
3434
3452
  `;
3435
- var DELETE_TESTER_MUTATION = gql17`
3453
+ var DELETE_TESTER_MUTATION = gql18`
3436
3454
  mutation deleteTester($_id: ID!) {
3437
3455
  deleteTester(_id: $_id)
3438
3456
  }
@@ -3493,8 +3511,8 @@ var useGetTester = (_id) => {
3493
3511
  import { useMutation as useMutation11 } from "@apollo/client";
3494
3512
 
3495
3513
  // src/graphql/mutations/user.ts
3496
- import { gql as gql18 } from "@apollo/client";
3497
- var CREATE_USER_MUTATION = gql18`
3514
+ import { gql as gql19 } from "@apollo/client";
3515
+ var CREATE_USER_MUTATION = gql19`
3498
3516
  mutation createUser($input: UserInputType!) {
3499
3517
  createUser(input: $input) {
3500
3518
  ...UserFields
@@ -3502,7 +3520,7 @@ var CREATE_USER_MUTATION = gql18`
3502
3520
  }
3503
3521
  ${USER_FIELDS_FRAGMENT}
3504
3522
  `;
3505
- var UPDATE_USER_MUTATION = gql18`
3523
+ var UPDATE_USER_MUTATION = gql19`
3506
3524
  mutation updateUser($_id: ID!, $input: UserInputType!) {
3507
3525
  updateUser(_id: $_id, input: $input) {
3508
3526
  ...UserFields
@@ -3510,12 +3528,12 @@ var UPDATE_USER_MUTATION = gql18`
3510
3528
  }
3511
3529
  ${USER_FIELDS_FRAGMENT}
3512
3530
  `;
3513
- var DELETE_USER_MUTATION = gql18`
3531
+ var DELETE_USER_MUTATION = gql19`
3514
3532
  mutation deleteUser($_id: ID!) {
3515
3533
  deleteUser(_id: $_id)
3516
3534
  }
3517
3535
  `;
3518
- var ADD_USER_FAVOURITE_RESOURCE_MUTATION = gql18`
3536
+ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = gql19`
3519
3537
  mutation addUserFavouriteResource(
3520
3538
  $resourceId: ID!
3521
3539
  $resourceType: ResourceTypeEnum!
@@ -3531,7 +3549,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = gql18`
3531
3549
  }
3532
3550
  ${USER_FIELDS_FRAGMENT}
3533
3551
  `;
3534
- var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = gql18`
3552
+ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = gql19`
3535
3553
  mutation removeUserFavouriteResource(
3536
3554
  $resourceId: ID!
3537
3555
  $resourceType: ResourceTypeEnum!
@@ -3639,21 +3657,14 @@ var useGetUserNotifications = () => {
3639
3657
  return { error, loading, refetch, userNotifications };
3640
3658
  };
3641
3659
 
3642
- // src/graphql/queries/notificationQueries.ts
3643
- import { gql as gql19 } from "@apollo/client";
3644
- var GET_USER_NOTIFICATIONS2 = gql19`
3645
- query GetUserNotifications(
3646
- $userId: String!
3647
- $limit: Int
3648
- $offset: Int
3649
- $isRead: String
3650
- ) {
3651
- userNotifications(
3652
- userId: $userId
3653
- limit: $limit
3654
- offset: $offset
3655
- isRead: $isRead
3656
- ) {
3660
+ // src/graphql/hooks/notifications.ts
3661
+ import { useMutation as useMutation12, useQuery as useQuery7, useApolloClient } from "@apollo/client";
3662
+
3663
+ // src/graphql/mutations/notification.ts
3664
+ import { gql as gql20 } from "@apollo/client";
3665
+ var CREATE_NOTIFICATION = gql20`
3666
+ mutation CreateNotification($input: CreateNotificationInput!) {
3667
+ createNotification(input: $input) {
3657
3668
  id
3658
3669
  userId
3659
3670
  title
@@ -3666,17 +3677,9 @@ var GET_USER_NOTIFICATIONS2 = gql19`
3666
3677
  }
3667
3678
  }
3668
3679
  `;
3669
- var GET_NOTIFICATION_COUNT = gql19`
3670
- query GetNotificationCount($userId: String!) {
3671
- notificationCount(userId: $userId) {
3672
- total
3673
- unread
3674
- }
3675
- }
3676
- `;
3677
- var GET_UNREAD_NOTIFICATIONS = gql19`
3678
- query GetUnreadNotifications($userId: String!, $limit: Int) {
3679
- unreadNotifications(userId: $userId, limit: $limit) {
3680
+ var CREATE_BULK_NOTIFICATIONS = gql20`
3681
+ mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {
3682
+ createBulkNotifications(input: $input) {
3680
3683
  id
3681
3684
  userId
3682
3685
  title
@@ -3689,12 +3692,9 @@ var GET_UNREAD_NOTIFICATIONS = gql19`
3689
3692
  }
3690
3693
  }
3691
3694
  `;
3692
-
3693
- // src/graphql/mutations/notificationMutations.ts
3694
- import { gql as gql20 } from "@apollo/client";
3695
- var CREATE_NOTIFICATION = gql20`
3696
- mutation CreateNotification($input: CreateNotificationInput!) {
3697
- createNotification(input: $input) {
3695
+ var MARK_NOTIFICATION_READ = gql20`
3696
+ mutation MarkNotificationRead($input: MarkNotificationReadInput!) {
3697
+ markNotificationRead(input: $input) {
3698
3698
  id
3699
3699
  userId
3700
3700
  title
@@ -3707,9 +3707,27 @@ var CREATE_NOTIFICATION = gql20`
3707
3707
  }
3708
3708
  }
3709
3709
  `;
3710
- var CREATE_BULK_NOTIFICATIONS = gql20`
3711
- mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {
3712
- createBulkNotifications(input: $input) {
3710
+ var MARK_ALL_NOTIFICATIONS_READ = gql20`
3711
+ mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
3712
+ markAllNotificationsRead(input: $input)
3713
+ }
3714
+ `;
3715
+
3716
+ // src/graphql/queries/notification.ts
3717
+ import { gql as gql21 } from "@apollo/client";
3718
+ var GET_USER_NOTIFICATIONS2 = gql21`
3719
+ query GetUserNotifications(
3720
+ $userId: String!
3721
+ $limit: Int
3722
+ $offset: Int
3723
+ $isRead: String
3724
+ ) {
3725
+ userNotifications(
3726
+ userId: $userId
3727
+ limit: $limit
3728
+ offset: $offset
3729
+ isRead: $isRead
3730
+ ) {
3713
3731
  id
3714
3732
  userId
3715
3733
  title
@@ -3722,9 +3740,17 @@ var CREATE_BULK_NOTIFICATIONS = gql20`
3722
3740
  }
3723
3741
  }
3724
3742
  `;
3725
- var MARK_NOTIFICATION_READ = gql20`
3726
- mutation MarkNotificationRead($input: MarkNotificationReadInput!) {
3727
- markNotificationRead(input: $input) {
3743
+ var GET_NOTIFICATION_COUNT = gql21`
3744
+ query GetNotificationCount($userId: String!) {
3745
+ notificationCount(userId: $userId) {
3746
+ total
3747
+ unread
3748
+ }
3749
+ }
3750
+ `;
3751
+ var GET_UNREAD_NOTIFICATIONS = gql21`
3752
+ query GetUnreadNotifications($userId: String!, $limit: Int) {
3753
+ unreadNotifications(userId: $userId, limit: $limit) {
3728
3754
  id
3729
3755
  userId
3730
3756
  title
@@ -3737,11 +3763,104 @@ var MARK_NOTIFICATION_READ = gql20`
3737
3763
  }
3738
3764
  }
3739
3765
  `;
3740
- var MARK_ALL_NOTIFICATIONS_READ = gql20`
3741
- mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
3742
- markAllNotificationsRead(input: $input)
3743
- }
3744
- `;
3766
+
3767
+ // src/graphql/hooks/notifications.ts
3768
+ var useNotifications = (userId) => {
3769
+ const client = useApolloClient();
3770
+ const {
3771
+ data: notificationsData,
3772
+ loading: notificationsLoading,
3773
+ error: notificationsError,
3774
+ refetch: refetchNotifications
3775
+ } = useQuery7(GET_USER_NOTIFICATIONS2, {
3776
+ variables: { userId, limit: 50, offset: 0 },
3777
+ fetchPolicy: "cache-and-network",
3778
+ skip: !userId
3779
+ });
3780
+ const {
3781
+ data: countData,
3782
+ loading: countLoading,
3783
+ error: countError,
3784
+ refetch: refetchCount
3785
+ } = useQuery7(GET_NOTIFICATION_COUNT, {
3786
+ variables: { userId },
3787
+ fetchPolicy: "cache-and-network",
3788
+ skip: !userId
3789
+ });
3790
+ const {
3791
+ data: unreadData,
3792
+ loading: unreadLoading,
3793
+ error: unreadError,
3794
+ refetch: refetchUnread
3795
+ } = useQuery7(GET_UNREAD_NOTIFICATIONS, {
3796
+ variables: { userId, limit: 20 },
3797
+ fetchPolicy: "cache-and-network",
3798
+ skip: !userId
3799
+ });
3800
+ const [createNotification, { loading: createLoading }] = useMutation12(CREATE_NOTIFICATION);
3801
+ const [createBulkNotifications, { loading: createBulkLoading }] = useMutation12(
3802
+ CREATE_BULK_NOTIFICATIONS
3803
+ );
3804
+ const [markNotificationRead, { loading: markReadLoading }] = useMutation12(
3805
+ MARK_NOTIFICATION_READ
3806
+ );
3807
+ const [markAllNotificationsRead, { loading: markAllReadLoading }] = useMutation12(MARK_ALL_NOTIFICATIONS_READ);
3808
+ const refetchAll = () => {
3809
+ if (userId) {
3810
+ refetchNotifications();
3811
+ refetchCount();
3812
+ refetchUnread();
3813
+ }
3814
+ };
3815
+ const invalidateCache = () => {
3816
+ client.cache.evict({ fieldName: "userNotifications" });
3817
+ client.cache.evict({ fieldName: "notificationCount" });
3818
+ client.cache.evict({ fieldName: "unreadNotifications" });
3819
+ client.cache.gc();
3820
+ };
3821
+ return {
3822
+ // Data
3823
+ notifications: notificationsData?.userNotifications || [],
3824
+ count: countData?.notificationCount || { total: 0, unread: 0 },
3825
+ unreadNotifications: unreadData?.unreadNotifications || [],
3826
+ // Loading states
3827
+ notificationsLoading,
3828
+ countLoading,
3829
+ unreadLoading,
3830
+ createLoading,
3831
+ createBulkLoading,
3832
+ markReadLoading,
3833
+ markAllReadLoading,
3834
+ // Errors
3835
+ notificationsError,
3836
+ countError,
3837
+ unreadError,
3838
+ // Actions
3839
+ createNotification: async (input) => {
3840
+ const result = await createNotification({ variables: { input } });
3841
+ refetchAll();
3842
+ return result;
3843
+ },
3844
+ createBulkNotifications: async (input) => {
3845
+ const result = await createBulkNotifications({ variables: { input } });
3846
+ refetchAll();
3847
+ return result;
3848
+ },
3849
+ markNotificationRead: async (input) => {
3850
+ const result = await markNotificationRead({ variables: { input } });
3851
+ refetchAll();
3852
+ return result;
3853
+ },
3854
+ markAllNotificationsRead: async (input) => {
3855
+ const result = await markAllNotificationsRead({ variables: { input } });
3856
+ refetchAll();
3857
+ return result;
3858
+ },
3859
+ // Utilities
3860
+ refetchAll,
3861
+ invalidateCache
3862
+ };
3863
+ };
3745
3864
 
3746
3865
  // src/hooks/useLocationSearch.ts
3747
3866
  var handleApiError = (error, message) => {
@@ -4923,100 +5042,6 @@ function useContactUsForm(data) {
4923
5042
  };
4924
5043
  }
4925
5044
 
4926
- // src/hooks/useNotifications.ts
4927
- import { useMutation as useMutation12, useQuery as useQuery7, useApolloClient } from "@apollo/client";
4928
- var useNotifications = (userId) => {
4929
- const client = useApolloClient();
4930
- const {
4931
- data: notificationsData,
4932
- loading: notificationsLoading,
4933
- error: notificationsError,
4934
- refetch: refetchNotifications
4935
- } = useQuery7(GET_USER_NOTIFICATIONS2, {
4936
- variables: { userId, limit: 50, offset: 0 },
4937
- fetchPolicy: "cache-and-network"
4938
- });
4939
- const {
4940
- data: countData,
4941
- loading: countLoading,
4942
- error: countError,
4943
- refetch: refetchCount
4944
- } = useQuery7(GET_NOTIFICATION_COUNT, {
4945
- variables: { userId },
4946
- fetchPolicy: "cache-and-network"
4947
- });
4948
- const {
4949
- data: unreadData,
4950
- loading: unreadLoading,
4951
- error: unreadError,
4952
- refetch: refetchUnread
4953
- } = useQuery7(GET_UNREAD_NOTIFICATIONS, {
4954
- variables: { userId, limit: 20 },
4955
- fetchPolicy: "cache-and-network"
4956
- });
4957
- const [createNotification, { loading: createLoading }] = useMutation12(CREATE_NOTIFICATION);
4958
- const [createBulkNotifications, { loading: createBulkLoading }] = useMutation12(
4959
- CREATE_BULK_NOTIFICATIONS
4960
- );
4961
- const [markNotificationRead, { loading: markReadLoading }] = useMutation12(
4962
- MARK_NOTIFICATION_READ
4963
- );
4964
- const [markAllNotificationsRead, { loading: markAllReadLoading }] = useMutation12(MARK_ALL_NOTIFICATIONS_READ);
4965
- const refetchAll = () => {
4966
- refetchNotifications();
4967
- refetchCount();
4968
- refetchUnread();
4969
- };
4970
- const invalidateCache = () => {
4971
- client.cache.evict({ fieldName: "userNotifications" });
4972
- client.cache.evict({ fieldName: "notificationCount" });
4973
- client.cache.evict({ fieldName: "unreadNotifications" });
4974
- client.cache.gc();
4975
- };
4976
- return {
4977
- // Data
4978
- notifications: notificationsData?.userNotifications || [],
4979
- count: countData?.notificationCount || { total: 0, unread: 0 },
4980
- unreadNotifications: unreadData?.unreadNotifications || [],
4981
- // Loading states
4982
- notificationsLoading,
4983
- countLoading,
4984
- unreadLoading,
4985
- createLoading,
4986
- createBulkLoading,
4987
- markReadLoading,
4988
- markAllReadLoading,
4989
- // Errors
4990
- notificationsError,
4991
- countError,
4992
- unreadError,
4993
- // Actions
4994
- createNotification: async (input) => {
4995
- const result = await createNotification({ variables: { input } });
4996
- refetchAll();
4997
- return result;
4998
- },
4999
- createBulkNotifications: async (input) => {
5000
- const result = await createBulkNotifications({ variables: { input } });
5001
- refetchAll();
5002
- return result;
5003
- },
5004
- markNotificationRead: async (input) => {
5005
- const result = await markNotificationRead({ variables: { input } });
5006
- refetchAll();
5007
- return result;
5008
- },
5009
- markAllNotificationsRead: async (input) => {
5010
- const result = await markAllNotificationsRead({ variables: { input } });
5011
- refetchAll();
5012
- return result;
5013
- },
5014
- // Utilities
5015
- refetchAll,
5016
- invalidateCache
5017
- };
5018
- };
5019
-
5020
5045
  // src/storage/index.ts
5021
5046
  var SAVED_PASSWORD_KEY = "savedPassword";
5022
5047
  var SAVED_EMAIL_KEY = "savedEmail";
@@ -5062,8 +5087,6 @@ var fonts = {
5062
5087
  }
5063
5088
  };
5064
5089
  export {
5065
- CREATE_BULK_NOTIFICATIONS,
5066
- CREATE_NOTIFICATION,
5067
5090
  EnumInviteStatus,
5068
5091
  EnumNotification,
5069
5092
  EnumOSType,
@@ -5075,12 +5098,8 @@ export {
5075
5098
  EnumSocialMedia,
5076
5099
  EnumUserLicence,
5077
5100
  EnumUserRole,
5078
- GET_NOTIFICATION_COUNT,
5079
- GET_UNREAD_NOTIFICATIONS,
5080
- GET_USER_NOTIFICATIONS2 as GET_USER_NOTIFICATIONS,
5101
+ GET_CHAT_MESSAGE,
5081
5102
  ImageTypeEnum,
5082
- MARK_ALL_NOTIFICATIONS_READ,
5083
- MARK_NOTIFICATION_READ,
5084
5103
  SAVED_EMAIL_KEY,
5085
5104
  SAVED_PASSWORD_KEY,
5086
5105
  SAVED_REFRESH_TOKEN_KEY,
@@ -5170,6 +5189,7 @@ export {
5170
5189
  useDeleteTester,
5171
5190
  useDeleteUser,
5172
5191
  useGetChat,
5192
+ useGetChatSubscription,
5173
5193
  useGetMarket,
5174
5194
  useGetMarketInfo,
5175
5195
  useGetMarketRelations,