@timardex/cluemart-shared 1.0.79 → 1.0.80
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/chunk-SCXVJDGI.mjs +114 -0
- package/dist/chunk-SCXVJDGI.mjs.map +1 -0
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/{global-Drk9CYfv.d.ts → global-Bieh1fh8.d.mts} +2 -10
- package/dist/{global-2TLPFthS.d.mts → global-By7aHQ1y.d.ts} +2 -10
- package/dist/graphql/index.cjs +152 -104
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +11 -13
- package/dist/graphql/index.d.ts +11 -13
- package/dist/graphql/index.mjs +32 -84
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +202 -0
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +26 -3
- package/dist/hooks/index.d.ts +26 -3
- package/dist/hooks/index.mjs +104 -0
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +248 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +69 -20
- package/dist/index.d.ts +69 -20
- package/dist/index.mjs +220 -82
- package/dist/index.mjs.map +1 -1
- package/dist/{contactUs-CQ9xTjlE.d.mts → notification-H4hE5cdq.d.mts} +38 -1
- package/dist/{contactUs-CQ9xTjlE.d.ts → notification-H4hE5cdq.d.ts} +38 -1
- 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/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// src/graphql/queries/notificationQueries.ts
|
|
2
|
+
import { gql } from "@apollo/client";
|
|
3
|
+
var GET_USER_NOTIFICATIONS = gql`
|
|
4
|
+
query GetUserNotifications(
|
|
5
|
+
$userId: String!
|
|
6
|
+
$limit: Int
|
|
7
|
+
$offset: Int
|
|
8
|
+
$isRead: String
|
|
9
|
+
) {
|
|
10
|
+
userNotifications(
|
|
11
|
+
userId: $userId
|
|
12
|
+
limit: $limit
|
|
13
|
+
offset: $offset
|
|
14
|
+
isRead: $isRead
|
|
15
|
+
) {
|
|
16
|
+
id
|
|
17
|
+
userId
|
|
18
|
+
title
|
|
19
|
+
message
|
|
20
|
+
type
|
|
21
|
+
isRead
|
|
22
|
+
data
|
|
23
|
+
createdAt
|
|
24
|
+
updatedAt
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
var GET_NOTIFICATION_COUNT = gql`
|
|
29
|
+
query GetNotificationCount($userId: String!) {
|
|
30
|
+
notificationCount(userId: $userId) {
|
|
31
|
+
total
|
|
32
|
+
unread
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
var GET_UNREAD_NOTIFICATIONS = gql`
|
|
37
|
+
query GetUnreadNotifications($userId: String!, $limit: Int) {
|
|
38
|
+
unreadNotifications(userId: $userId, limit: $limit) {
|
|
39
|
+
id
|
|
40
|
+
userId
|
|
41
|
+
title
|
|
42
|
+
message
|
|
43
|
+
type
|
|
44
|
+
isRead
|
|
45
|
+
data
|
|
46
|
+
createdAt
|
|
47
|
+
updatedAt
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
// src/graphql/mutations/notificationMutations.ts
|
|
53
|
+
import { gql as gql2 } from "@apollo/client";
|
|
54
|
+
var CREATE_NOTIFICATION = gql2`
|
|
55
|
+
mutation CreateNotification($input: CreateNotificationInput!) {
|
|
56
|
+
createNotification(input: $input) {
|
|
57
|
+
id
|
|
58
|
+
userId
|
|
59
|
+
title
|
|
60
|
+
message
|
|
61
|
+
type
|
|
62
|
+
isRead
|
|
63
|
+
data
|
|
64
|
+
createdAt
|
|
65
|
+
updatedAt
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
var CREATE_BULK_NOTIFICATIONS = gql2`
|
|
70
|
+
mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {
|
|
71
|
+
createBulkNotifications(input: $input) {
|
|
72
|
+
id
|
|
73
|
+
userId
|
|
74
|
+
title
|
|
75
|
+
message
|
|
76
|
+
type
|
|
77
|
+
isRead
|
|
78
|
+
data
|
|
79
|
+
createdAt
|
|
80
|
+
updatedAt
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
var MARK_NOTIFICATION_READ = gql2`
|
|
85
|
+
mutation MarkNotificationRead($input: MarkNotificationReadInput!) {
|
|
86
|
+
markNotificationRead(input: $input) {
|
|
87
|
+
id
|
|
88
|
+
userId
|
|
89
|
+
title
|
|
90
|
+
message
|
|
91
|
+
type
|
|
92
|
+
isRead
|
|
93
|
+
data
|
|
94
|
+
createdAt
|
|
95
|
+
updatedAt
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
var MARK_ALL_NOTIFICATIONS_READ = gql2`
|
|
100
|
+
mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
|
|
101
|
+
markAllNotificationsRead(input: $input)
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
GET_USER_NOTIFICATIONS,
|
|
107
|
+
GET_NOTIFICATION_COUNT,
|
|
108
|
+
GET_UNREAD_NOTIFICATIONS,
|
|
109
|
+
CREATE_NOTIFICATION,
|
|
110
|
+
CREATE_BULK_NOTIFICATIONS,
|
|
111
|
+
MARK_NOTIFICATION_READ,
|
|
112
|
+
MARK_ALL_NOTIFICATIONS_READ
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=chunk-SCXVJDGI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/graphql/queries/notificationQueries.ts","../src/graphql/mutations/notificationMutations.ts"],"sourcesContent":["import { gql } from \"@apollo/client\";\n\nexport const GET_USER_NOTIFICATIONS = gql`\n query GetUserNotifications(\n $userId: String!\n $limit: Int\n $offset: Int\n $isRead: String\n ) {\n userNotifications(\n userId: $userId\n limit: $limit\n offset: $offset\n isRead: $isRead\n ) {\n id\n userId\n title\n message\n type\n isRead\n data\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const GET_NOTIFICATION_COUNT = gql`\n query GetNotificationCount($userId: String!) {\n notificationCount(userId: $userId) {\n total\n unread\n }\n }\n`;\n\nexport const GET_UNREAD_NOTIFICATIONS = gql`\n query GetUnreadNotifications($userId: String!, $limit: Int) {\n unreadNotifications(userId: $userId, limit: $limit) {\n id\n userId\n title\n message\n type\n isRead\n data\n createdAt\n updatedAt\n }\n }\n`;\n","import { gql } from \"@apollo/client\";\n\nexport const CREATE_NOTIFICATION = gql`\n mutation CreateNotification($input: CreateNotificationInput!) {\n createNotification(input: $input) {\n id\n userId\n title\n message\n type\n isRead\n data\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const CREATE_BULK_NOTIFICATIONS = gql`\n mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {\n createBulkNotifications(input: $input) {\n id\n userId\n title\n message\n type\n isRead\n data\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const MARK_NOTIFICATION_READ = gql`\n mutation MarkNotificationRead($input: MarkNotificationReadInput!) {\n markNotificationRead(input: $input) {\n id\n userId\n title\n message\n type\n isRead\n data\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const MARK_ALL_NOTIFICATIONS_READ = gql`\n mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {\n markAllNotificationsRead(input: $input)\n }\n`;\n"],"mappings":";AAAA,SAAS,WAAW;AAEb,IAAM,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0B/B,IAAM,yBAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS/B,IAAM,2BAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACrCxC,SAAS,OAAAA,YAAW;AAEb,IAAM,sBAAsBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB5B,IAAM,4BAA4BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBlC,IAAM,yBAAyBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB/B,IAAM,8BAA8BA;AAAA;AAAA;AAAA;AAAA;","names":["gql"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-
|
|
1
|
+
import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-Bieh1fh8.mjs';
|
|
2
2
|
import '../enums/index.mjs';
|
|
3
3
|
import 'react-hook-form';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-
|
|
1
|
+
import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-By7aHQ1y.js';
|
|
2
2
|
import '../enums/index.js';
|
|
3
3
|
import 'react-hook-form';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnumResourceType, EnumInviteStatus, EnumRelationResource, EnumPaymentMethod, EnumUserLicence, EnumUserRole, EnumSocialMedia
|
|
1
|
+
import { EnumResourceType, EnumInviteStatus, EnumRelationResource, EnumPaymentMethod, EnumUserLicence, EnumUserRole, EnumSocialMedia } from './enums/index.mjs';
|
|
2
2
|
import { Control, FieldErrors, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
|
|
3
3
|
|
|
4
4
|
type RelationDate = {
|
|
@@ -319,17 +319,9 @@ type ImageObjectType = {
|
|
|
319
319
|
type: string;
|
|
320
320
|
name: string;
|
|
321
321
|
};
|
|
322
|
-
type NotificationType = {
|
|
323
|
-
createdBy: string;
|
|
324
|
-
important: boolean;
|
|
325
|
-
message: string;
|
|
326
|
-
notifyUser: string | null;
|
|
327
|
-
resourceId: string;
|
|
328
|
-
resourceType: EnumNotification;
|
|
329
|
-
};
|
|
330
322
|
interface ResourceConnectionsType {
|
|
331
323
|
markets: MarketWithConnectionDatesType[] | null;
|
|
332
324
|
stallholders: SatllholderWithConnectionDatesType[] | null;
|
|
333
325
|
}
|
|
334
326
|
|
|
335
|
-
export type {
|
|
327
|
+
export type { StallholderLocation as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderAttributes as E, FormField as F, GeocodeLocation as G, SatllholderWithConnectionDatesType as H, ImageObjectType as I, LocationType as L, MarketType as M, Nullable as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, UserType as U, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderInfoType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderInfoFormData as i, CreateStallholderInfoFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, ResourceImageType as q, SocialMediaType as r, BaseResourceType as s, Region as t, MapMultiLocation as u, SubcategoryItems as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationDate as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnumResourceType, EnumInviteStatus, EnumRelationResource, EnumPaymentMethod, EnumUserLicence, EnumUserRole, EnumSocialMedia
|
|
1
|
+
import { EnumResourceType, EnumInviteStatus, EnumRelationResource, EnumPaymentMethod, EnumUserLicence, EnumUserRole, EnumSocialMedia } from './enums/index.js';
|
|
2
2
|
import { Control, FieldErrors, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
|
|
3
3
|
|
|
4
4
|
type RelationDate = {
|
|
@@ -319,17 +319,9 @@ type ImageObjectType = {
|
|
|
319
319
|
type: string;
|
|
320
320
|
name: string;
|
|
321
321
|
};
|
|
322
|
-
type NotificationType = {
|
|
323
|
-
createdBy: string;
|
|
324
|
-
important: boolean;
|
|
325
|
-
message: string;
|
|
326
|
-
notifyUser: string | null;
|
|
327
|
-
resourceId: string;
|
|
328
|
-
resourceType: EnumNotification;
|
|
329
|
-
};
|
|
330
322
|
interface ResourceConnectionsType {
|
|
331
323
|
markets: MarketWithConnectionDatesType[] | null;
|
|
332
324
|
stallholders: SatllholderWithConnectionDatesType[] | null;
|
|
333
325
|
}
|
|
334
326
|
|
|
335
|
-
export type {
|
|
327
|
+
export type { StallholderLocation as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderAttributes as E, FormField as F, GeocodeLocation as G, SatllholderWithConnectionDatesType as H, ImageObjectType as I, LocationType as L, MarketType as M, Nullable as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, UserType as U, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderInfoType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderInfoFormData as i, CreateStallholderInfoFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, ResourceImageType as q, SocialMediaType as r, BaseResourceType as s, Region as t, MapMultiLocation as u, SubcategoryItems as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationDate as z };
|
package/dist/graphql/index.cjs
CHANGED
|
@@ -20,6 +20,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/graphql/index.ts
|
|
21
21
|
var graphql_exports = {};
|
|
22
22
|
__export(graphql_exports, {
|
|
23
|
+
CREATE_BULK_NOTIFICATIONS: () => CREATE_BULK_NOTIFICATIONS,
|
|
24
|
+
CREATE_NOTIFICATION: () => CREATE_NOTIFICATION,
|
|
25
|
+
GET_NOTIFICATION_COUNT: () => GET_NOTIFICATION_COUNT,
|
|
26
|
+
GET_UNREAD_NOTIFICATIONS: () => GET_UNREAD_NOTIFICATIONS,
|
|
27
|
+
GET_USER_NOTIFICATIONS: () => GET_USER_NOTIFICATIONS2,
|
|
28
|
+
MARK_ALL_NOTIFICATIONS_READ: () => MARK_ALL_NOTIFICATIONS_READ,
|
|
29
|
+
MARK_NOTIFICATION_READ: () => MARK_NOTIFICATION_READ,
|
|
23
30
|
useAddParticipantToChat: () => useAddParticipantToChat,
|
|
24
31
|
useAddUserFavouriteResource: () => useAddUserFavouriteResource,
|
|
25
32
|
useAdminUpdateResourceType: () => useAdminUpdateResourceType,
|
|
@@ -41,14 +48,12 @@ __export(graphql_exports, {
|
|
|
41
48
|
useDeleteTester: () => useDeleteTester,
|
|
42
49
|
useDeleteUser: () => useDeleteUser,
|
|
43
50
|
useGetChat: () => useGetChat,
|
|
44
|
-
useGetChatSubscription: () => useGetChatSubscription,
|
|
45
51
|
useGetMarket: () => useGetMarket,
|
|
46
52
|
useGetMarketInfo: () => useGetMarketInfo,
|
|
47
53
|
useGetMarketRelations: () => useGetMarketRelations,
|
|
48
54
|
useGetMarkets: () => useGetMarkets,
|
|
49
55
|
useGetMarketsByRegion: () => useGetMarketsByRegion,
|
|
50
56
|
useGetMarketsNearMe: () => useGetMarketsNearMe,
|
|
51
|
-
useGetNotification: () => useGetNotification,
|
|
52
57
|
useGetRelation: () => useGetRelation,
|
|
53
58
|
useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
|
|
54
59
|
useGetResourceConnections: () => useGetResourceConnections,
|
|
@@ -1667,81 +1672,15 @@ var useGetStallholderInfo = (stallholderId) => {
|
|
|
1667
1672
|
};
|
|
1668
1673
|
};
|
|
1669
1674
|
|
|
1670
|
-
// src/graphql/hooks/subscriptions.ts
|
|
1671
|
-
var import_client31 = require("@apollo/client");
|
|
1672
|
-
|
|
1673
|
-
// src/graphql/subscriptions/chat.ts
|
|
1674
|
-
var import_client29 = require("@apollo/client");
|
|
1675
|
-
var GET_CHAT_MESSAGE = import_client29.gql`
|
|
1676
|
-
subscription {
|
|
1677
|
-
getChatMessage {
|
|
1678
|
-
...ChatFields
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
${CHAT_FIELDS_FRAGMENT}
|
|
1682
|
-
`;
|
|
1683
|
-
|
|
1684
|
-
// src/graphql/subscriptions/notification.ts
|
|
1685
|
-
var import_client30 = require("@apollo/client");
|
|
1686
|
-
var NOTIFICATION_FIELDS_FRAGMENT = import_client30.gql`
|
|
1687
|
-
fragment NotificationFields on NotificationType {
|
|
1688
|
-
createdBy
|
|
1689
|
-
important
|
|
1690
|
-
message
|
|
1691
|
-
notifyUser
|
|
1692
|
-
resourceId
|
|
1693
|
-
resourceType
|
|
1694
|
-
}
|
|
1695
|
-
`;
|
|
1696
|
-
var GET_GLOBAL_NOTIFICATION = import_client30.gql`
|
|
1697
|
-
subscription {
|
|
1698
|
-
getGlobalNotification {
|
|
1699
|
-
...NotificationFields
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
${NOTIFICATION_FIELDS_FRAGMENT}
|
|
1703
|
-
`;
|
|
1704
|
-
var GET_RELATION_NOTIFICATION = import_client30.gql`
|
|
1705
|
-
subscription {
|
|
1706
|
-
getRelationNotification {
|
|
1707
|
-
...NotificationFields
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
${NOTIFICATION_FIELDS_FRAGMENT}
|
|
1711
|
-
`;
|
|
1712
|
-
|
|
1713
|
-
// src/graphql/hooks/subscriptions.ts
|
|
1714
|
-
var useGetNotification = () => {
|
|
1715
|
-
const {
|
|
1716
|
-
data: global,
|
|
1717
|
-
loading: loadingGlobal,
|
|
1718
|
-
error: errorGlobal
|
|
1719
|
-
} = (0, import_client31.useSubscription)(GET_GLOBAL_NOTIFICATION);
|
|
1720
|
-
const {
|
|
1721
|
-
data: relation,
|
|
1722
|
-
loading: loadingImportant,
|
|
1723
|
-
error: errorImportant
|
|
1724
|
-
} = (0, import_client31.useSubscription)(GET_RELATION_NOTIFICATION);
|
|
1725
|
-
const error = errorGlobal || errorImportant;
|
|
1726
|
-
const loading = loadingGlobal || loadingImportant;
|
|
1727
|
-
const notification = relation?.getRelationNotification || global?.getGlobalNotification;
|
|
1728
|
-
return { error, loading, notification };
|
|
1729
|
-
};
|
|
1730
|
-
var useGetChatSubscription = () => {
|
|
1731
|
-
const { data, loading, error } = (0, import_client31.useSubscription)(GET_CHAT_MESSAGE);
|
|
1732
|
-
const chat = data?.getChat;
|
|
1733
|
-
return { chat, error, loading };
|
|
1734
|
-
};
|
|
1735
|
-
|
|
1736
1675
|
// src/graphql/hooks/testers/hooksMutation.ts
|
|
1737
|
-
var
|
|
1676
|
+
var import_client31 = require("@apollo/client");
|
|
1738
1677
|
|
|
1739
1678
|
// src/graphql/mutations/testers.ts
|
|
1740
|
-
var
|
|
1679
|
+
var import_client30 = require("@apollo/client");
|
|
1741
1680
|
|
|
1742
1681
|
// src/graphql/queries/testers.ts
|
|
1743
|
-
var
|
|
1744
|
-
var TESTER_FIELDS_FRAGMENT =
|
|
1682
|
+
var import_client29 = require("@apollo/client");
|
|
1683
|
+
var TESTER_FIELDS_FRAGMENT = import_client29.gql`
|
|
1745
1684
|
fragment TesterFields on TesterType {
|
|
1746
1685
|
_id
|
|
1747
1686
|
active
|
|
@@ -1754,7 +1693,7 @@ var TESTER_FIELDS_FRAGMENT = import_client32.gql`
|
|
|
1754
1693
|
updatedAt
|
|
1755
1694
|
}
|
|
1756
1695
|
`;
|
|
1757
|
-
var GET_TESTERS =
|
|
1696
|
+
var GET_TESTERS = import_client29.gql`
|
|
1758
1697
|
query getTesters {
|
|
1759
1698
|
testers {
|
|
1760
1699
|
...TesterFields
|
|
@@ -1762,7 +1701,7 @@ var GET_TESTERS = import_client32.gql`
|
|
|
1762
1701
|
}
|
|
1763
1702
|
${TESTER_FIELDS_FRAGMENT}
|
|
1764
1703
|
`;
|
|
1765
|
-
var GET_TESTER =
|
|
1704
|
+
var GET_TESTER = import_client29.gql`
|
|
1766
1705
|
query getTester($_id: ID!) {
|
|
1767
1706
|
tester(_id: $_id) {
|
|
1768
1707
|
...TesterFields
|
|
@@ -1772,7 +1711,7 @@ var GET_TESTER = import_client32.gql`
|
|
|
1772
1711
|
`;
|
|
1773
1712
|
|
|
1774
1713
|
// src/graphql/mutations/testers.ts
|
|
1775
|
-
var CREATE_TESTER_MUTATION =
|
|
1714
|
+
var CREATE_TESTER_MUTATION = import_client30.gql`
|
|
1776
1715
|
mutation createTester($input: TesterInputType!) {
|
|
1777
1716
|
createTester(input: $input) {
|
|
1778
1717
|
...TesterFields
|
|
@@ -1780,7 +1719,7 @@ var CREATE_TESTER_MUTATION = import_client33.gql`
|
|
|
1780
1719
|
}
|
|
1781
1720
|
${TESTER_FIELDS_FRAGMENT}
|
|
1782
1721
|
`;
|
|
1783
|
-
var UPDATE_TESTER_MUTATION =
|
|
1722
|
+
var UPDATE_TESTER_MUTATION = import_client30.gql`
|
|
1784
1723
|
mutation updateTester($_id: ID!, $input: TesterInputType!) {
|
|
1785
1724
|
updateTester(_id: $_id, input: $input) {
|
|
1786
1725
|
...TesterFields
|
|
@@ -1788,7 +1727,7 @@ var UPDATE_TESTER_MUTATION = import_client33.gql`
|
|
|
1788
1727
|
}
|
|
1789
1728
|
${TESTER_FIELDS_FRAGMENT}
|
|
1790
1729
|
`;
|
|
1791
|
-
var DELETE_TESTER_MUTATION =
|
|
1730
|
+
var DELETE_TESTER_MUTATION = import_client30.gql`
|
|
1792
1731
|
mutation deleteTester($_id: ID!) {
|
|
1793
1732
|
deleteTester(_id: $_id)
|
|
1794
1733
|
}
|
|
@@ -1796,7 +1735,7 @@ var DELETE_TESTER_MUTATION = import_client33.gql`
|
|
|
1796
1735
|
|
|
1797
1736
|
// src/graphql/hooks/testers/hooksMutation.ts
|
|
1798
1737
|
var useCreateTester = () => {
|
|
1799
|
-
const [createTester, { data, loading, error }] = (0,
|
|
1738
|
+
const [createTester, { data, loading, error }] = (0, import_client31.useMutation)(
|
|
1800
1739
|
CREATE_TESTER_MUTATION
|
|
1801
1740
|
);
|
|
1802
1741
|
return {
|
|
@@ -1807,7 +1746,7 @@ var useCreateTester = () => {
|
|
|
1807
1746
|
};
|
|
1808
1747
|
};
|
|
1809
1748
|
var useUpdateTester = () => {
|
|
1810
|
-
const [updateTester, { data, loading, error }] = (0,
|
|
1749
|
+
const [updateTester, { data, loading, error }] = (0, import_client31.useMutation)(
|
|
1811
1750
|
UPDATE_TESTER_MUTATION
|
|
1812
1751
|
);
|
|
1813
1752
|
return {
|
|
@@ -1818,16 +1757,16 @@ var useUpdateTester = () => {
|
|
|
1818
1757
|
};
|
|
1819
1758
|
};
|
|
1820
1759
|
var useDeleteTester = () => {
|
|
1821
|
-
const [deleteTester, { loading, error }] = (0,
|
|
1760
|
+
const [deleteTester, { loading, error }] = (0, import_client31.useMutation)(
|
|
1822
1761
|
DELETE_TESTER_MUTATION
|
|
1823
1762
|
);
|
|
1824
1763
|
return { deleteTester, error, loading };
|
|
1825
1764
|
};
|
|
1826
1765
|
|
|
1827
1766
|
// src/graphql/hooks/testers/hooksQuery.ts
|
|
1828
|
-
var
|
|
1767
|
+
var import_client32 = require("@apollo/client");
|
|
1829
1768
|
var useGetTesters = () => {
|
|
1830
|
-
const { data, loading, error, refetch } = (0,
|
|
1769
|
+
const { data, loading, error, refetch } = (0, import_client32.useQuery)(GET_TESTERS);
|
|
1831
1770
|
const testers = data?.testers;
|
|
1832
1771
|
return {
|
|
1833
1772
|
error,
|
|
@@ -1837,7 +1776,7 @@ var useGetTesters = () => {
|
|
|
1837
1776
|
};
|
|
1838
1777
|
};
|
|
1839
1778
|
var useGetTester = (_id) => {
|
|
1840
|
-
const { data, loading, error, refetch } = (0,
|
|
1779
|
+
const { data, loading, error, refetch } = (0, import_client32.useQuery)(GET_TESTER, {
|
|
1841
1780
|
skip: !_id,
|
|
1842
1781
|
variables: { _id }
|
|
1843
1782
|
});
|
|
@@ -1846,11 +1785,11 @@ var useGetTester = (_id) => {
|
|
|
1846
1785
|
};
|
|
1847
1786
|
|
|
1848
1787
|
// src/graphql/hooks/user/hooksMutation.ts
|
|
1849
|
-
var
|
|
1788
|
+
var import_client34 = require("@apollo/client");
|
|
1850
1789
|
|
|
1851
1790
|
// src/graphql/mutations/user.ts
|
|
1852
|
-
var
|
|
1853
|
-
var CREATE_USER_MUTATION =
|
|
1791
|
+
var import_client33 = require("@apollo/client");
|
|
1792
|
+
var CREATE_USER_MUTATION = import_client33.gql`
|
|
1854
1793
|
mutation createUser($input: UserInputType!) {
|
|
1855
1794
|
createUser(input: $input) {
|
|
1856
1795
|
...UserFields
|
|
@@ -1858,7 +1797,7 @@ var CREATE_USER_MUTATION = import_client36.gql`
|
|
|
1858
1797
|
}
|
|
1859
1798
|
${USER_FIELDS_FRAGMENT}
|
|
1860
1799
|
`;
|
|
1861
|
-
var UPDATE_USER_MUTATION =
|
|
1800
|
+
var UPDATE_USER_MUTATION = import_client33.gql`
|
|
1862
1801
|
mutation updateUser($_id: ID!, $input: UserInputType!) {
|
|
1863
1802
|
updateUser(_id: $_id, input: $input) {
|
|
1864
1803
|
...UserFields
|
|
@@ -1866,12 +1805,12 @@ var UPDATE_USER_MUTATION = import_client36.gql`
|
|
|
1866
1805
|
}
|
|
1867
1806
|
${USER_FIELDS_FRAGMENT}
|
|
1868
1807
|
`;
|
|
1869
|
-
var DELETE_USER_MUTATION =
|
|
1808
|
+
var DELETE_USER_MUTATION = import_client33.gql`
|
|
1870
1809
|
mutation deleteUser($_id: ID!) {
|
|
1871
1810
|
deleteUser(_id: $_id)
|
|
1872
1811
|
}
|
|
1873
1812
|
`;
|
|
1874
|
-
var ADD_USER_FAVOURITE_RESOURCE_MUTATION =
|
|
1813
|
+
var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client33.gql`
|
|
1875
1814
|
mutation addUserFavouriteResource(
|
|
1876
1815
|
$resourceId: ID!
|
|
1877
1816
|
$resourceType: ResourceTypeEnum!
|
|
@@ -1887,7 +1826,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client36.gql`
|
|
|
1887
1826
|
}
|
|
1888
1827
|
${USER_FIELDS_FRAGMENT}
|
|
1889
1828
|
`;
|
|
1890
|
-
var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION =
|
|
1829
|
+
var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client33.gql`
|
|
1891
1830
|
mutation removeUserFavouriteResource(
|
|
1892
1831
|
$resourceId: ID!
|
|
1893
1832
|
$resourceType: ResourceTypeEnum!
|
|
@@ -1906,11 +1845,11 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client36.gql`
|
|
|
1906
1845
|
|
|
1907
1846
|
// src/graphql/hooks/user/hooksMutation.ts
|
|
1908
1847
|
var useCreateUser = () => {
|
|
1909
|
-
const [createUser, { loading, error }] = (0,
|
|
1848
|
+
const [createUser, { loading, error }] = (0, import_client34.useMutation)(CREATE_USER_MUTATION);
|
|
1910
1849
|
return { createUser, error, loading };
|
|
1911
1850
|
};
|
|
1912
1851
|
var useUpdateUser = () => {
|
|
1913
|
-
const [updateUser, { loading, error }] = (0,
|
|
1852
|
+
const [updateUser, { loading, error }] = (0, import_client34.useMutation)(UPDATE_USER_MUTATION, {
|
|
1914
1853
|
awaitRefetchQueries: true,
|
|
1915
1854
|
refetchQueries: (mutationResult) => {
|
|
1916
1855
|
const userId = mutationResult?.data?.updateUser?._id;
|
|
@@ -1921,11 +1860,11 @@ var useUpdateUser = () => {
|
|
|
1921
1860
|
return { error, loading, updateUser };
|
|
1922
1861
|
};
|
|
1923
1862
|
var useDeleteUser = () => {
|
|
1924
|
-
const [deleteUser, { loading, error }] = (0,
|
|
1863
|
+
const [deleteUser, { loading, error }] = (0, import_client34.useMutation)(DELETE_USER_MUTATION);
|
|
1925
1864
|
return { deleteUser, error, loading };
|
|
1926
1865
|
};
|
|
1927
1866
|
var useAddUserFavouriteResource = () => {
|
|
1928
|
-
const [addUserFavouriteResource, { loading, error }] = (0,
|
|
1867
|
+
const [addUserFavouriteResource, { loading, error }] = (0, import_client34.useMutation)(
|
|
1929
1868
|
ADD_USER_FAVOURITE_RESOURCE_MUTATION,
|
|
1930
1869
|
{
|
|
1931
1870
|
awaitRefetchQueries: true,
|
|
@@ -1935,7 +1874,7 @@ var useAddUserFavouriteResource = () => {
|
|
|
1935
1874
|
return { addUserFavouriteResource, error, loading };
|
|
1936
1875
|
};
|
|
1937
1876
|
var useRemoveUserFavouriteResource = () => {
|
|
1938
|
-
const [removeUserFavouriteResource, { loading, error }] = (0,
|
|
1877
|
+
const [removeUserFavouriteResource, { loading, error }] = (0, import_client34.useMutation)(
|
|
1939
1878
|
REMOVE_USER_FAVOURITE_RESOURCE_MUTATION,
|
|
1940
1879
|
{
|
|
1941
1880
|
awaitRefetchQueries: true,
|
|
@@ -1946,37 +1885,37 @@ var useRemoveUserFavouriteResource = () => {
|
|
|
1946
1885
|
};
|
|
1947
1886
|
|
|
1948
1887
|
// src/graphql/hooks/user/hooksQuery.ts
|
|
1949
|
-
var
|
|
1888
|
+
var import_client35 = require("@apollo/client");
|
|
1950
1889
|
var useGetUsers = () => {
|
|
1951
|
-
const { loading, error, data, refetch } = (0,
|
|
1890
|
+
const { loading, error, data, refetch } = (0, import_client35.useQuery)(GET_USERS, {
|
|
1952
1891
|
fetchPolicy: "network-only"
|
|
1953
1892
|
});
|
|
1954
1893
|
const users = data?.users;
|
|
1955
1894
|
return { error, loading, refetch, users };
|
|
1956
1895
|
};
|
|
1957
1896
|
var useGetUser = (_id) => {
|
|
1958
|
-
const { loading, error, data, refetch } = (0,
|
|
1897
|
+
const { loading, error, data, refetch } = (0, import_client35.useQuery)(GET_USER, {
|
|
1959
1898
|
variables: { _id }
|
|
1960
1899
|
});
|
|
1961
1900
|
const user = data?.user;
|
|
1962
1901
|
return { error, loading, refetch, user };
|
|
1963
1902
|
};
|
|
1964
1903
|
var useGetUserMarkets = () => {
|
|
1965
|
-
const { loading, error, data, refetch } = (0,
|
|
1904
|
+
const { loading, error, data, refetch } = (0, import_client35.useQuery)(GET_USER_MARKETS, {
|
|
1966
1905
|
fetchPolicy: "network-only"
|
|
1967
1906
|
});
|
|
1968
1907
|
const userMarkets = data?.userMarkets;
|
|
1969
1908
|
return { error, loading, refetch, userMarkets };
|
|
1970
1909
|
};
|
|
1971
1910
|
var useGetUserStallholder = () => {
|
|
1972
|
-
const { loading, error, data, refetch } = (0,
|
|
1911
|
+
const { loading, error, data, refetch } = (0, import_client35.useQuery)(GET_USER_STALLHOLDER, {
|
|
1973
1912
|
fetchPolicy: "network-only"
|
|
1974
1913
|
});
|
|
1975
1914
|
const userStallholder = data?.userStallholder;
|
|
1976
1915
|
return { error, loading, refetch, userStallholder };
|
|
1977
1916
|
};
|
|
1978
1917
|
var useGetUserFavourites = () => {
|
|
1979
|
-
const { loading, error, data, refetch } = (0,
|
|
1918
|
+
const { loading, error, data, refetch } = (0, import_client35.useQuery)(GET_USER_FAVOURITES, {
|
|
1980
1919
|
fetchPolicy: "network-only"
|
|
1981
1920
|
});
|
|
1982
1921
|
const markets = data?.userFavourites.markets;
|
|
@@ -1988,14 +1927,125 @@ var useGetUserFavourites = () => {
|
|
|
1988
1927
|
return { error, loading, refetch, userFavourites };
|
|
1989
1928
|
};
|
|
1990
1929
|
var useGetUserNotifications = () => {
|
|
1991
|
-
const { loading, error, data, refetch } = (0,
|
|
1930
|
+
const { loading, error, data, refetch } = (0, import_client35.useQuery)(GET_USER_NOTIFICATIONS, {
|
|
1992
1931
|
fetchPolicy: "network-only"
|
|
1993
1932
|
});
|
|
1994
1933
|
const userNotifications = data?.userNotifications;
|
|
1995
1934
|
return { error, loading, refetch, userNotifications };
|
|
1996
1935
|
};
|
|
1936
|
+
|
|
1937
|
+
// src/graphql/queries/notificationQueries.ts
|
|
1938
|
+
var import_client36 = require("@apollo/client");
|
|
1939
|
+
var GET_USER_NOTIFICATIONS2 = import_client36.gql`
|
|
1940
|
+
query GetUserNotifications(
|
|
1941
|
+
$userId: String!
|
|
1942
|
+
$limit: Int
|
|
1943
|
+
$offset: Int
|
|
1944
|
+
$isRead: String
|
|
1945
|
+
) {
|
|
1946
|
+
userNotifications(
|
|
1947
|
+
userId: $userId
|
|
1948
|
+
limit: $limit
|
|
1949
|
+
offset: $offset
|
|
1950
|
+
isRead: $isRead
|
|
1951
|
+
) {
|
|
1952
|
+
id
|
|
1953
|
+
userId
|
|
1954
|
+
title
|
|
1955
|
+
message
|
|
1956
|
+
type
|
|
1957
|
+
isRead
|
|
1958
|
+
data
|
|
1959
|
+
createdAt
|
|
1960
|
+
updatedAt
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
`;
|
|
1964
|
+
var GET_NOTIFICATION_COUNT = import_client36.gql`
|
|
1965
|
+
query GetNotificationCount($userId: String!) {
|
|
1966
|
+
notificationCount(userId: $userId) {
|
|
1967
|
+
total
|
|
1968
|
+
unread
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
`;
|
|
1972
|
+
var GET_UNREAD_NOTIFICATIONS = import_client36.gql`
|
|
1973
|
+
query GetUnreadNotifications($userId: String!, $limit: Int) {
|
|
1974
|
+
unreadNotifications(userId: $userId, limit: $limit) {
|
|
1975
|
+
id
|
|
1976
|
+
userId
|
|
1977
|
+
title
|
|
1978
|
+
message
|
|
1979
|
+
type
|
|
1980
|
+
isRead
|
|
1981
|
+
data
|
|
1982
|
+
createdAt
|
|
1983
|
+
updatedAt
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
`;
|
|
1987
|
+
|
|
1988
|
+
// src/graphql/mutations/notificationMutations.ts
|
|
1989
|
+
var import_client37 = require("@apollo/client");
|
|
1990
|
+
var CREATE_NOTIFICATION = import_client37.gql`
|
|
1991
|
+
mutation CreateNotification($input: CreateNotificationInput!) {
|
|
1992
|
+
createNotification(input: $input) {
|
|
1993
|
+
id
|
|
1994
|
+
userId
|
|
1995
|
+
title
|
|
1996
|
+
message
|
|
1997
|
+
type
|
|
1998
|
+
isRead
|
|
1999
|
+
data
|
|
2000
|
+
createdAt
|
|
2001
|
+
updatedAt
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
`;
|
|
2005
|
+
var CREATE_BULK_NOTIFICATIONS = import_client37.gql`
|
|
2006
|
+
mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {
|
|
2007
|
+
createBulkNotifications(input: $input) {
|
|
2008
|
+
id
|
|
2009
|
+
userId
|
|
2010
|
+
title
|
|
2011
|
+
message
|
|
2012
|
+
type
|
|
2013
|
+
isRead
|
|
2014
|
+
data
|
|
2015
|
+
createdAt
|
|
2016
|
+
updatedAt
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
`;
|
|
2020
|
+
var MARK_NOTIFICATION_READ = import_client37.gql`
|
|
2021
|
+
mutation MarkNotificationRead($input: MarkNotificationReadInput!) {
|
|
2022
|
+
markNotificationRead(input: $input) {
|
|
2023
|
+
id
|
|
2024
|
+
userId
|
|
2025
|
+
title
|
|
2026
|
+
message
|
|
2027
|
+
type
|
|
2028
|
+
isRead
|
|
2029
|
+
data
|
|
2030
|
+
createdAt
|
|
2031
|
+
updatedAt
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
`;
|
|
2035
|
+
var MARK_ALL_NOTIFICATIONS_READ = import_client37.gql`
|
|
2036
|
+
mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
|
|
2037
|
+
markAllNotificationsRead(input: $input)
|
|
2038
|
+
}
|
|
2039
|
+
`;
|
|
1997
2040
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1998
2041
|
0 && (module.exports = {
|
|
2042
|
+
CREATE_BULK_NOTIFICATIONS,
|
|
2043
|
+
CREATE_NOTIFICATION,
|
|
2044
|
+
GET_NOTIFICATION_COUNT,
|
|
2045
|
+
GET_UNREAD_NOTIFICATIONS,
|
|
2046
|
+
GET_USER_NOTIFICATIONS,
|
|
2047
|
+
MARK_ALL_NOTIFICATIONS_READ,
|
|
2048
|
+
MARK_NOTIFICATION_READ,
|
|
1999
2049
|
useAddParticipantToChat,
|
|
2000
2050
|
useAddUserFavouriteResource,
|
|
2001
2051
|
useAdminUpdateResourceType,
|
|
@@ -2017,14 +2067,12 @@ var useGetUserNotifications = () => {
|
|
|
2017
2067
|
useDeleteTester,
|
|
2018
2068
|
useDeleteUser,
|
|
2019
2069
|
useGetChat,
|
|
2020
|
-
useGetChatSubscription,
|
|
2021
2070
|
useGetMarket,
|
|
2022
2071
|
useGetMarketInfo,
|
|
2023
2072
|
useGetMarketRelations,
|
|
2024
2073
|
useGetMarkets,
|
|
2025
2074
|
useGetMarketsByRegion,
|
|
2026
2075
|
useGetMarketsNearMe,
|
|
2027
|
-
useGetNotification,
|
|
2028
2076
|
useGetRelation,
|
|
2029
2077
|
useGetRelationByMarketAndStallholder,
|
|
2030
2078
|
useGetResourceConnections,
|