@timardex/cluemart-shared 1.6.130 → 1.7.0

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 (168) hide show
  1. package/dist/ad-CVkVX_z5.d.ts +296 -0
  2. package/dist/ad-DA9ECAhK.d.mts +296 -0
  3. package/dist/affiliate-1RtkLnLP.d.ts +35 -0
  4. package/dist/affiliate-Cos2Syz5.d.mts +35 -0
  5. package/dist/chunk-HZMP7GXC.mjs +5330 -0
  6. package/dist/chunk-HZMP7GXC.mjs.map +1 -0
  7. package/dist/chunk-KZTOISPA.mjs +272 -0
  8. package/dist/chunk-KZTOISPA.mjs.map +1 -0
  9. package/dist/chunk-MVQ3CFQR.mjs +230 -0
  10. package/dist/chunk-MVQ3CFQR.mjs.map +1 -0
  11. package/dist/chunk-NPFJ2CN2.mjs +109 -0
  12. package/dist/chunk-NPFJ2CN2.mjs.map +1 -0
  13. package/dist/chunk-RKIRWZCH.mjs +368 -0
  14. package/dist/chunk-RKIRWZCH.mjs.map +1 -0
  15. package/dist/{chunk-OHHJ3KJJ.mjs → chunk-TAECMXM4.mjs} +267 -304
  16. package/dist/chunk-TAECMXM4.mjs.map +1 -0
  17. package/dist/chunk-VA5YN2K3.mjs +48 -0
  18. package/dist/chunk-VA5YN2K3.mjs.map +1 -0
  19. package/dist/chunk-ZZJSCYJK.mjs +958 -0
  20. package/dist/chunk-ZZJSCYJK.mjs.map +1 -0
  21. package/dist/contactUs-DGrDzJaM.d.mts +11 -0
  22. package/dist/contactUs-H7799pWe.d.ts +11 -0
  23. package/dist/enums/index.cjs +223 -2
  24. package/dist/enums/index.cjs.map +1 -1
  25. package/dist/enums/index.d.mts +164 -5
  26. package/dist/enums/index.d.ts +164 -5
  27. package/dist/enums/index.mjs +41 -1
  28. package/dist/formFields/index.cjs +168 -403
  29. package/dist/formFields/index.cjs.map +1 -1
  30. package/dist/formFields/index.d.mts +3 -6
  31. package/dist/formFields/index.d.ts +3 -6
  32. package/dist/formFields/index.mjs +47 -921
  33. package/dist/formFields/index.mjs.map +1 -1
  34. package/dist/global-BUUfmCo7.d.mts +698 -0
  35. package/dist/global-fKbMmluy.d.ts +698 -0
  36. package/dist/graphql/index.cjs +3329 -3340
  37. package/dist/graphql/index.cjs.map +1 -1
  38. package/dist/graphql/index.d.mts +487 -690
  39. package/dist/graphql/index.d.ts +487 -690
  40. package/dist/graphql/index.mjs +153 -2552
  41. package/dist/graphql/index.mjs.map +1 -1
  42. package/dist/hooks/index.cjs +3478 -773
  43. package/dist/hooks/index.cjs.map +1 -1
  44. package/dist/hooks/index.d.mts +6 -13
  45. package/dist/hooks/index.d.ts +6 -13
  46. package/dist/hooks/index.mjs +99 -193
  47. package/dist/hooks/index.mjs.map +1 -1
  48. package/dist/images/apple-maps-icon.webp.d.ts +1 -8
  49. package/dist/images/banner-horizontal.webp.d.ts +1 -8
  50. package/dist/images/banner-vertical.webp.d.ts +1 -8
  51. package/dist/images/cluiTui.webp.d.ts +1 -8
  52. package/dist/images/corporate.webp.d.ts +1 -8
  53. package/dist/images/facebook.webp.d.ts +1 -8
  54. package/dist/images/gazebo-top.webp.d.ts +1 -8
  55. package/dist/images/google-maps-icon.webp.d.ts +1 -8
  56. package/dist/images/googleMaps-logo-dark.webp.d.ts +1 -8
  57. package/dist/images/googleMaps-logo-light.webp.d.ts +1 -8
  58. package/dist/images/index.mjs +21 -86
  59. package/dist/images/index.mjs.map +1 -1
  60. package/dist/images/instagram.webp.d.ts +1 -8
  61. package/dist/images/logo-atr.webp.d.ts +1 -8
  62. package/dist/images/logo-dark.webp.d.ts +1 -8
  63. package/dist/images/logo.webp.d.ts +1 -8
  64. package/dist/images/meet.webp.d.ts +1 -8
  65. package/dist/images/mini-market1.webp.d.ts +1 -8
  66. package/dist/images/mini-market2.webp.d.ts +1 -8
  67. package/dist/images/mini-market3.webp.d.ts +1 -8
  68. package/dist/images/mini-market4.webp.d.ts +1 -8
  69. package/dist/images/mini-market5.webp.d.ts +1 -8
  70. package/dist/images/poll.webp.d.ts +1 -8
  71. package/dist/images/poster1.webp.d.ts +1 -8
  72. package/dist/images/poster2.webp.d.ts +1 -8
  73. package/dist/images/poster3.webp.d.ts +1 -8
  74. package/dist/images/poster4.webp.d.ts +1 -8
  75. package/dist/images/private.webp.d.ts +1 -8
  76. package/dist/images/qr-code.webp.d.ts +1 -8
  77. package/dist/images/school.webp.d.ts +1 -8
  78. package/dist/images/sima.webp.d.ts +1 -8
  79. package/dist/images/store-android.webp.d.ts +1 -8
  80. package/dist/images/store-ios.webp.d.ts +1 -8
  81. package/dist/images/tablas.webp.d.ts +1 -8
  82. package/dist/images/telefonos.webp.d.ts +1 -8
  83. package/dist/images/tiktok.webp.d.ts +1 -8
  84. package/dist/images/tip.webp.d.ts +1 -8
  85. package/dist/images/ugralos.webp.d.ts +1 -8
  86. package/dist/images/waze-maps-icon.webp.d.ts +1 -8
  87. package/dist/images/website.webp.d.ts +1 -8
  88. package/dist/images/youtube.webp.d.ts +1 -8
  89. package/dist/index.cjs +5883 -7079
  90. package/dist/index.cjs.map +1 -1
  91. package/dist/index.d.mts +1692 -2966
  92. package/dist/index.d.ts +1692 -2966
  93. package/dist/index.mjs +5020 -6162
  94. package/dist/index.mjs.map +1 -1
  95. package/dist/map/index.cjs +9 -14
  96. package/dist/map/index.cjs.map +1 -1
  97. package/dist/map/index.d.mts +14 -18
  98. package/dist/map/index.d.ts +14 -18
  99. package/dist/map/index.mjs +9 -14
  100. package/dist/map/index.mjs.map +1 -1
  101. package/dist/resourceActivities-BL_12IAo.d.ts +125 -0
  102. package/dist/resourceActivities-zczOntNk.d.mts +125 -0
  103. package/dist/sharing/index.cjs +1272 -63
  104. package/dist/sharing/index.cjs.map +1 -1
  105. package/dist/sharing/index.d.mts +7 -32
  106. package/dist/sharing/index.d.ts +7 -32
  107. package/dist/sharing/index.mjs +30 -188
  108. package/dist/sharing/index.mjs.map +1 -1
  109. package/dist/theme/index.mjs +5 -41
  110. package/dist/theme/index.mjs.map +1 -1
  111. package/dist/types/index.cjs +110 -868
  112. package/dist/types/index.cjs.map +1 -1
  113. package/dist/types/index.d.mts +24 -230
  114. package/dist/types/index.d.ts +24 -230
  115. package/dist/types/index.mjs +27 -61
  116. package/dist/utils/index.cjs +214 -608
  117. package/dist/utils/index.cjs.map +1 -1
  118. package/dist/utils/index.d.mts +53 -107
  119. package/dist/utils/index.d.ts +53 -107
  120. package/dist/utils/index.mjs +15 -43
  121. package/package.json +12 -40
  122. package/dist/affiliate-Bqqlffw8.d.mts +0 -36
  123. package/dist/affiliate-Btlp5XUp.d.ts +0 -36
  124. package/dist/affiliateAdapters-BW3BY7c5.d.mts +0 -118
  125. package/dist/affiliateAdapters-C51ISmuA.d.ts +0 -118
  126. package/dist/apollo/index.cjs +0 -1383
  127. package/dist/apollo/index.cjs.map +0 -1
  128. package/dist/apollo/index.d.mts +0 -323
  129. package/dist/apollo/index.d.ts +0 -323
  130. package/dist/apollo/index.mjs +0 -1295
  131. package/dist/apollo/index.mjs.map +0 -1
  132. package/dist/auth/index.cjs +0 -3322
  133. package/dist/auth/index.cjs.map +0 -1
  134. package/dist/auth/index.d.mts +0 -164
  135. package/dist/auth/index.d.ts +0 -164
  136. package/dist/auth/index.mjs +0 -379
  137. package/dist/auth/index.mjs.map +0 -1
  138. package/dist/auth-BOmAO53v.d.ts +0 -169
  139. package/dist/auth-CsITA95p.d.mts +0 -169
  140. package/dist/chunk-DATBGC2K.mjs +0 -347
  141. package/dist/chunk-DATBGC2K.mjs.map +0 -1
  142. package/dist/chunk-DDHECBJR.mjs +0 -726
  143. package/dist/chunk-DDHECBJR.mjs.map +0 -1
  144. package/dist/chunk-INQCDU24.mjs +0 -139
  145. package/dist/chunk-INQCDU24.mjs.map +0 -1
  146. package/dist/chunk-NWWKI4PJ.mjs +0 -297
  147. package/dist/chunk-NWWKI4PJ.mjs.map +0 -1
  148. package/dist/chunk-OHHJ3KJJ.mjs.map +0 -1
  149. package/dist/chunk-RAYUJODN.mjs +0 -45
  150. package/dist/chunk-RAYUJODN.mjs.map +0 -1
  151. package/dist/chunk-TOEFAEF2.mjs +0 -69
  152. package/dist/chunk-TOEFAEF2.mjs.map +0 -1
  153. package/dist/chunk-UKW7NZEQ.mjs +0 -2813
  154. package/dist/chunk-UKW7NZEQ.mjs.map +0 -1
  155. package/dist/dailyClue-C6WXY73z.d.mts +0 -105
  156. package/dist/dailyClue-C6WXY73z.d.ts +0 -105
  157. package/dist/event-C9K7CSg4.d.ts +0 -53
  158. package/dist/event-W0NhL5Cd.d.mts +0 -53
  159. package/dist/global-BbSFfYdd.d.ts +0 -181
  160. package/dist/global-C6v9tRji.d.mts +0 -181
  161. package/dist/graphql-CDOfA79A.d.ts +0 -1253
  162. package/dist/graphql-CcvzTs9k.d.mts +0 -1253
  163. package/dist/resourceActivities-CS8YRIIL.d.mts +0 -89
  164. package/dist/resourceActivities-DOdNPkhW.d.ts +0 -89
  165. package/dist/subscription-Cj_qBA7u.d.mts +0 -20
  166. package/dist/subscription-OiJ50uJb.d.ts +0 -20
  167. package/dist/vendor-DmMi2qmx.d.mts +0 -73
  168. package/dist/vendor-M9hVZlni.d.ts +0 -73
@@ -1,3322 +0,0 @@
1
- "use strict";
2
- "use client";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/auth/index.ts
32
- var auth_exports = {};
33
- __export(auth_exports, {
34
- ADMIN_APP_ROLES: () => ADMIN_APP_ROLES,
35
- ADMIN_DASHBOARD_CONTEXTS: () => ADMIN_DASHBOARD_CONTEXTS,
36
- DEFAULT_LIMITS: () => DEFAULT_LIMITS,
37
- NO_LICENCE_FLAGS: () => NO_LICENCE_FLAGS,
38
- PERMISSIONS: () => PERMISSIONS,
39
- ROLE_PERMISSIONS: () => ROLE_PERMISSIONS,
40
- UserProvider: () => UserProvider,
41
- WILDCARD_PERMISSION: () => WILDCARD_PERMISSION,
42
- canAccessAdminApp: () => canAccessAdminApp,
43
- canAccessAdminPath: () => canAccessAdminPath,
44
- createAuthManager: () => createAuthManager,
45
- getDefaultAdminHome: () => getDefaultAdminHome,
46
- getLicenceFlagsByRole: () => getLicenceFlagsByRole,
47
- getPermissionsForRoles: () => getPermissionsForRoles,
48
- getUsableAdminContexts: () => getUsableAdminContexts,
49
- hasAllPermissions: () => hasAllPermissions,
50
- hasAnyPermission: () => hasAnyPermission,
51
- hasAnyRole: () => hasAnyRole,
52
- hasLicence: () => hasLicence,
53
- hasPermission: () => hasPermission,
54
- hasRole: () => hasRole,
55
- hasUserLicenceType: () => hasUserLicenceType,
56
- isLicencedResourceType: () => isLicencedResourceType,
57
- isProfileBadgeLicence: () => isProfileBadgeLicence,
58
- permissionListIncludes: () => permissionListIncludes,
59
- resolveAdminContextFromPath: () => resolveAdminContextFromPath,
60
- useAuthCore: () => useAuthCore,
61
- useAuthUser: () => useAuthUser
62
- });
63
- module.exports = __toCommonJS(auth_exports);
64
-
65
- // src/auth/createAuthManager.ts
66
- function createAuthManager() {
67
- let logoutFn = null;
68
- let userRefetchFn = null;
69
- let logoutPromise = null;
70
- return {
71
- handleRefetchUser: async () => {
72
- if (userRefetchFn) {
73
- await userRefetchFn();
74
- } else {
75
- console.warn("\u274C User refetch function not set!");
76
- }
77
- },
78
- logout() {
79
- if (logoutPromise !== null) return logoutPromise;
80
- if (logoutFn === null) {
81
- console.warn("\u274C Logout function not set!");
82
- return Promise.resolve();
83
- }
84
- logoutPromise = logoutFn().finally(() => {
85
- logoutPromise = null;
86
- });
87
- return logoutPromise;
88
- },
89
- setLogout(fn) {
90
- logoutFn = fn;
91
- },
92
- setUserRefetch(fn) {
93
- userRefetchFn = fn;
94
- }
95
- };
96
- }
97
-
98
- // src/types/subscription.ts
99
- var TIERS_BY_PRIORITY = ["pro_plus", "pro", "standard"];
100
- var TIER_FROM_LICENCE = {
101
- ["pro_event" /* ProEvent */]: "pro",
102
- ["pro_plus_event" /* ProPlusEvent */]: "pro_plus",
103
- ["pro_plus_vendor" /* ProPlusVendor */]: "pro_plus",
104
- ["pro_vendor" /* ProVendor */]: "pro",
105
- ["standard_event" /* StandardEvent */]: "standard",
106
- ["standard_partner" /* StandardPartner */]: "standard",
107
- ["standard_vendor" /* StandardVendor */]: "standard",
108
- ["standard_affiliate" /* StandardAffiliate */]: "standard",
109
- ["standard_school" /* StandardSchool */]: "standard"
110
- };
111
-
112
- // src/auth/licenceUtils.ts
113
- function isLicencedResourceType(resourceType) {
114
- return resourceType !== "affiliate" /* Affiliate */ && resourceType !== "school" /* School */;
115
- }
116
- function isProfileBadgeLicence(licenceType) {
117
- return licenceType !== "standard_affiliate" /* StandardAffiliate */ && licenceType !== "standard_school" /* StandardSchool */;
118
- }
119
- var hasUserLicenceType = (authUser, licenceType) => authUser?.licences?.some((licence) => licence.licenceType === licenceType) ?? false;
120
- var hasLicence = (authUser, licenceType) => {
121
- const directLicence = authUser?.licences?.some(
122
- (licence) => licence.licenceType?.includes(licenceType)
123
- ) ?? false;
124
- return {
125
- directLicence
126
- };
127
- };
128
- var DEFAULT_LIMITS = {
129
- // 1 means calendar/productMenu is enabled, 0 means disabled
130
- availability: { pro: 1, pro_plus: 1, standard: 0 },
131
- calendar: { pro: 1, pro_plus: 1, standard: 0 },
132
- images: { pro: 12, pro_plus: 12, standard: 6 },
133
- posters: { pro: 5, pro_plus: 5, standard: 5 },
134
- productsList: { pro: 1, pro_plus: 1, standard: 0 },
135
- relationShare: { pro: 1, pro_plus: 1, standard: 0 },
136
- statistics: { pro: 1, pro_plus: 1, standard: 0 }
137
- };
138
- var NO_LICENCE_FLAGS = {
139
- event: {
140
- pro_plus: false,
141
- // eslint-disable-next-line sort-keys
142
- pro: false,
143
- standard: false
144
- },
145
- partner: {
146
- pro_plus: false,
147
- // eslint-disable-next-line sort-keys
148
- pro: false,
149
- standard: false
150
- },
151
- vendor: {
152
- pro_plus: false,
153
- // eslint-disable-next-line sort-keys
154
- pro: false,
155
- standard: false
156
- }
157
- };
158
- function getLicenceFlagsByRole(licences) {
159
- const normalized = licences?.map((l) => l.toLowerCase()) ?? [];
160
- const hasAnyLicence = normalized.length > 0;
161
- function resolve(role) {
162
- const result = {
163
- pro_plus: false,
164
- // eslint-disable-next-line sort-keys
165
- pro: false,
166
- standard: false
167
- };
168
- for (const tier of TIERS_BY_PRIORITY) {
169
- if (normalized.some((l) => l.startsWith(`${tier}_${role}`))) {
170
- result[tier] = true;
171
- break;
172
- }
173
- }
174
- if (!hasAnyLicence) {
175
- result.pro = true;
176
- }
177
- return result;
178
- }
179
- return {
180
- event: resolve("event" /* Event */),
181
- partner: resolve("partner" /* Partner */),
182
- vendor: resolve("vendor" /* Vendor */)
183
- };
184
- }
185
-
186
- // src/auth/permissions/permissions.ts
187
- var PERMISSIONS = [
188
- "*",
189
- // Dashboards
190
- "dashboard.admin",
191
- "dashboard.affiliate",
192
- "dashboard.customer",
193
- "dashboard.event",
194
- "dashboard.partner",
195
- "dashboard.school",
196
- "dashboard.vendor",
197
- // Admin: users
198
- "users.delete",
199
- "users.read",
200
- "users.update",
201
- // Admin: events
202
- "events.create",
203
- "events.delete",
204
- "events.read",
205
- "events.update",
206
- // Admin: vendors
207
- "vendors.create",
208
- "vendors.delete",
209
- "vendors.read",
210
- "vendors.update",
211
- // Admin: partners
212
- "partners.create",
213
- "partners.delete",
214
- "partners.read",
215
- "partners.update",
216
- // Admin: schools
217
- "schools.create",
218
- "schools.delete",
219
- "schools.read",
220
- "schools.update",
221
- // Admin: affiliates
222
- "affiliates.create",
223
- "affiliates.delete",
224
- "affiliates.read",
225
- "affiliates.update",
226
- // Admin: ads / posts / settings
227
- "ads.create",
228
- "ads.delete",
229
- "ads.read",
230
- "ads.update",
231
- "posts.create",
232
- "posts.delete",
233
- "posts.read",
234
- "posts.update",
235
- "settings.read",
236
- "settings.update",
237
- // Product: own-resource management
238
- "affiliates.manage_own",
239
- "events.manage_own",
240
- "partners.manage_own",
241
- "schools.manage_own",
242
- "vendors.manage_own"
243
- ];
244
- var WILDCARD_PERMISSION = "*";
245
-
246
- // src/auth/permissions/rolePermissions.ts
247
- var ADMIN_PERMISSIONS = [
248
- "dashboard.admin",
249
- "events.read",
250
- "events.create",
251
- "events.update",
252
- "events.delete",
253
- "vendors.read",
254
- "vendors.create",
255
- "vendors.update",
256
- "vendors.delete",
257
- "partners.read",
258
- "partners.create",
259
- "partners.update",
260
- "partners.delete",
261
- "schools.read",
262
- "schools.create",
263
- "schools.update",
264
- "schools.delete",
265
- "affiliates.read",
266
- "affiliates.create",
267
- "affiliates.update",
268
- "affiliates.delete",
269
- "ads.read",
270
- "ads.create",
271
- "ads.update",
272
- "ads.delete",
273
- "posts.read",
274
- "posts.create",
275
- "posts.update",
276
- "posts.delete"
277
- ];
278
- var ROLE_PERMISSIONS = {
279
- ["super_admin" /* SuperAdmin */]: ["*"],
280
- ["admin" /* Admin */]: ADMIN_PERMISSIONS,
281
- ["customer" /* Customer */]: ["dashboard.customer"],
282
- ["event" /* Event */]: ["dashboard.event", "events.manage_own"],
283
- ["vendor" /* Vendor */]: ["dashboard.vendor", "vendors.manage_own"],
284
- ["partner" /* Partner */]: ["dashboard.partner", "partners.manage_own"],
285
- ["school" /* School */]: ["dashboard.school", "schools.manage_own"],
286
- ["affiliate" /* Affiliate */]: [
287
- "dashboard.affiliate",
288
- "affiliates.manage_own"
289
- ]
290
- };
291
-
292
- // src/auth/permissions/helpers.ts
293
- function normalizeRoles(roles) {
294
- if (!roles?.length) return [];
295
- return roles;
296
- }
297
- function getPermissionsForRoles(roles) {
298
- const seen = /* @__PURE__ */ new Set();
299
- const result = [];
300
- for (const role of normalizeRoles(roles)) {
301
- const perms = ROLE_PERMISSIONS[role] ?? [];
302
- for (const perm of perms) {
303
- if (!seen.has(perm)) {
304
- seen.add(perm);
305
- result.push(perm);
306
- }
307
- }
308
- }
309
- return result;
310
- }
311
- function permissionListIncludes(permissions, permission) {
312
- if (!permissions?.length) return false;
313
- const set = new Set(permissions);
314
- if (set.has(WILDCARD_PERMISSION)) return true;
315
- return set.has(permission);
316
- }
317
- function hasPermission(roles, permission) {
318
- return permissionListIncludes(getPermissionsForRoles(roles), permission);
319
- }
320
- function hasAnyPermission(roles, permissions) {
321
- if (permissions.length === 0) return false;
322
- const granted = getPermissionsForRoles(roles);
323
- return permissions.some((p) => permissionListIncludes(granted, p));
324
- }
325
- function hasAllPermissions(roles, permissions) {
326
- if (permissions.length === 0) return true;
327
- const granted = getPermissionsForRoles(roles);
328
- return permissions.every((p) => permissionListIncludes(granted, p));
329
- }
330
- function hasRole(roles, role) {
331
- return normalizeRoles(roles).includes(role);
332
- }
333
- function hasAnyRole(roles, checkRoles) {
334
- if (checkRoles.length === 0) return false;
335
- const set = new Set(normalizeRoles(roles));
336
- return checkRoles.some((r) => set.has(r));
337
- }
338
-
339
- // src/auth/permissions/adminAppAccess.ts
340
- var ADMIN_APP_ROLES = [
341
- "super_admin" /* SuperAdmin */,
342
- "admin" /* Admin */,
343
- "event" /* Event */,
344
- "vendor" /* Vendor */,
345
- "partner" /* Partner */,
346
- "school" /* School */,
347
- "affiliate" /* Affiliate */
348
- ];
349
- var ADMIN_DASHBOARD_CONTEXTS = [
350
- {
351
- context: "staff",
352
- home: "/dashboard",
353
- label: "Staff",
354
- pathPrefixes: ["/dashboard"],
355
- roles: ["super_admin" /* SuperAdmin */, "admin" /* Admin */]
356
- },
357
- {
358
- context: "event",
359
- home: "/event/dashboard",
360
- label: "Events",
361
- pathPrefixes: ["/event"],
362
- roles: ["event" /* Event */]
363
- },
364
- {
365
- context: "vendor",
366
- home: "/vendor/dashboard",
367
- label: "Stallholders",
368
- pathPrefixes: ["/vendor"],
369
- roles: ["vendor" /* Vendor */]
370
- },
371
- {
372
- context: "partner",
373
- home: "/partner/dashboard",
374
- label: "Partners",
375
- pathPrefixes: ["/partner"],
376
- roles: ["partner" /* Partner */]
377
- },
378
- {
379
- context: "school",
380
- home: "/school/dashboard",
381
- label: "Schools",
382
- pathPrefixes: ["/school"],
383
- roles: ["school" /* School */]
384
- },
385
- {
386
- context: "affiliate",
387
- home: "/affiliate/dashboard",
388
- label: "Affiliate",
389
- pathPrefixes: ["/affiliate"],
390
- roles: ["affiliate" /* Affiliate */]
391
- }
392
- ];
393
- function canAccessAdminApp(roles) {
394
- return hasAnyRole(roles, ADMIN_APP_ROLES);
395
- }
396
- function getUsableAdminContexts(roles) {
397
- return ADMIN_DASHBOARD_CONTEXTS.filter((ctx) => hasAnyRole(roles, ctx.roles));
398
- }
399
- function getDefaultAdminHome(roles, preferredContext) {
400
- const usable = getUsableAdminContexts(roles);
401
- if (usable.length === 0) {
402
- return "/login";
403
- }
404
- if (preferredContext) {
405
- const preferred = usable.find((ctx) => ctx.context === preferredContext);
406
- if (preferred) return preferred.home;
407
- }
408
- return usable[0].home;
409
- }
410
- function resolveAdminContextFromPath(pathname) {
411
- for (const ctx of ADMIN_DASHBOARD_CONTEXTS) {
412
- if (ctx.pathPrefixes.some(
413
- (prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`)
414
- )) {
415
- return ctx.context;
416
- }
417
- }
418
- return null;
419
- }
420
- function canAccessAdminPath(roles, pathname) {
421
- if (!canAccessAdminApp(roles)) return false;
422
- const context = resolveAdminContextFromPath(pathname);
423
- if (!context) {
424
- return true;
425
- }
426
- const info = ADMIN_DASHBOARD_CONTEXTS.find((ctx) => ctx.context === context);
427
- if (!info) return false;
428
- return hasAnyRole(roles, info.roles);
429
- }
430
-
431
- // src/auth/useAuthCore.ts
432
- var import_react = require("react");
433
-
434
- // src/graphql/hooks/auth.ts
435
- var import_client3 = require("@apollo/client");
436
-
437
- // src/graphql/mutations/auth.ts
438
- var import_client2 = require("@apollo/client");
439
-
440
- // src/generated/operations.ts
441
- var import_client = require("@apollo/client");
442
- var ApolloReactHooks = __toESM(require("@apollo/client"));
443
- var AdFieldsFragmentDoc = import_client.gql`
444
- fragment AdFields on AdType {
445
- _id
446
- active
447
- clicks
448
- createdAt
449
- end
450
- impressions
451
- resource {
452
- adDescription
453
- adImage
454
- adStyle
455
- adTitle
456
- adType
457
- resourceId
458
- resourceSlug
459
- resourceName
460
- resourceRegion
461
- resourceType
462
- }
463
- showOn
464
- start
465
- status
466
- targetRegion
467
- updatedAt
468
- }
469
- `;
470
- var AppSettingsFieldsFragmentDoc = import_client.gql`
471
- fragment AppSettingsFields on AppSettingsType {
472
- _id
473
- appVersion
474
- createdAt
475
- isOfflineMode
476
- key
477
- minimumRedeemableAffiliatePoints
478
- updatedAt
479
- }
480
- `;
481
- var ChatReportFieldsFragmentDoc = import_client.gql`
482
- fragment ChatReportFields on ReportChatUserType {
483
- _id
484
- chatId
485
- createdAt
486
- reason {
487
- reasonType
488
- details
489
- }
490
- reportedUserId
491
- reporterUserId
492
- resolved
493
- updatedAt
494
- }
495
- `;
496
- var NotificationFieldsFragmentDoc = import_client.gql`
497
- fragment NotificationFields on Notification {
498
- _id
499
- userId
500
- title
501
- message
502
- type
503
- isRead
504
- data {
505
- resourceId
506
- resourceName
507
- resourceType
508
- }
509
- createdAt
510
- updatedAt
511
- }
512
- `;
513
- var ChatMessageFieldsFragmentDoc = import_client.gql`
514
- fragment ChatMessageFields on ChatMessageType {
515
- _id
516
- content
517
- createdAt
518
- replyToMessageId
519
- replyPreview {
520
- senderId
521
- senderName
522
- contentPreview
523
- }
524
- likedBy {
525
- userId
526
- createdAt
527
- }
528
- senderId
529
- seenBy {
530
- userId
531
- seenAt
532
- }
533
- updatedAt
534
- }
535
- `;
536
- var ChatParticipantFieldsFragmentDoc = import_client.gql`
537
- fragment ChatParticipantFields on ChatParticipantType {
538
- active
539
- userAvatar
540
- userEmail
541
- userId
542
- userName
543
- }
544
- `;
545
- var ChatFieldsFragmentDoc = import_client.gql`
546
- fragment ChatFields on ChatType {
547
- _id
548
- active
549
- chatDescription
550
- chatName
551
- chatType
552
- createdAt
553
- deletedAt
554
- messages {
555
- ...ChatMessageFields
556
- }
557
- participants {
558
- ...ChatParticipantFields
559
- }
560
- region
561
- updatedAt
562
- }
563
- ${ChatMessageFieldsFragmentDoc}
564
- ${ChatParticipantFieldsFragmentDoc}`;
565
- var StallTypeFieldsFragmentDoc = import_client.gql`
566
- fragment StallTypeFields on StallTypeType {
567
- label
568
- price
569
- stallCapacity
570
- }
571
- `;
572
- var EventInfoFieldsFragmentDoc = import_client.gql`
573
- fragment EventInfoFields on EventInfoType {
574
- _id
575
- applicationDeadlineHours
576
- dateTime {
577
- dateStatus
578
- endDate
579
- endTime
580
- stallTypes {
581
- ...StallTypeFields
582
- }
583
- startDate
584
- startTime
585
- }
586
- eventId
587
- packInTime
588
- paymentDueHours
589
- paymentInfo {
590
- accountHolderName
591
- accountNumber
592
- link
593
- paymentMethod
594
- }
595
- refundPolicy {
596
- category
597
- label
598
- value
599
- }
600
- requirements {
601
- category
602
- label
603
- value
604
- }
605
- }
606
- ${StallTypeFieldsFragmentDoc}`;
607
- var LocationGeoFieldsFragmentDoc = import_client.gql`
608
- fragment LocationGeoFields on LocationGeoType {
609
- coordinates
610
- type
611
- }
612
- `;
613
- var ResourceActivityFieldsFragmentDoc = import_client.gql`
614
- fragment ResourceActivityFields on ResourceActivityType {
615
- resourceId
616
- resourceType
617
- activity {
618
- activityType
619
- location {
620
- ...LocationGeoFields
621
- }
622
- dateStatus
623
- startDate
624
- startTime
625
- timestamp
626
- userAgent
627
- userId
628
- }
629
- }
630
- ${LocationGeoFieldsFragmentDoc}`;
631
- var ResourceImageFieldsFragmentDoc = import_client.gql`
632
- fragment ResourceImageFields on ResourceImageType {
633
- active
634
- source
635
- title
636
- }
637
- `;
638
- var SchoolRegisteredUsersFieldsFragmentDoc = import_client.gql`
639
- fragment SchoolRegisteredUsersFields on SchoolRegisteredUserType {
640
- _id
641
- active
642
- avatar {
643
- ...ResourceImageFields
644
- }
645
- email
646
- firstName
647
- lastName
648
- }
649
- ${ResourceImageFieldsFragmentDoc}`;
650
- var VendorAttributesFieldsFragmentDoc = import_client.gql`
651
- fragment VendorAttributesFields on VendorAttributesType {
652
- details
653
- isRequired
654
- }
655
- `;
656
- var VendorInfoFieldsFragmentDoc = import_client.gql`
657
- fragment VendorInfoFields on VendorInfoType {
658
- _id
659
- compliance {
660
- foodBeverageLicense
661
- liabilityInsurance
662
- }
663
- documents {
664
- ...ResourceImageFields
665
- }
666
- requirements {
667
- electricity {
668
- ...VendorAttributesFields
669
- }
670
- gazebo {
671
- ...VendorAttributesFields
672
- }
673
- table {
674
- ...VendorAttributesFields
675
- }
676
- }
677
- product {
678
- foodFlavors
679
- packaging
680
- priceRange {
681
- max
682
- min
683
- }
684
- producedIn
685
- }
686
- stallInfo {
687
- size {
688
- depth
689
- width
690
- }
691
- }
692
- vendorId
693
- }
694
- ${ResourceImageFieldsFragmentDoc}
695
- ${VendorAttributesFieldsFragmentDoc}`;
696
- var ContactDetailsFieldsFragmentDoc = import_client.gql`
697
- fragment ContactDetailsFields on ContactDetailsType {
698
- email
699
- landlinePhone
700
- mobilePhone
701
- }
702
- `;
703
- var DateTimeFieldsFragmentDoc = import_client.gql`
704
- fragment DateTimeFields on DateTimeType {
705
- dateStatus
706
- endDate
707
- endTime
708
- startDate
709
- startTime
710
- }
711
- `;
712
- var LocationFieldsFragmentDoc = import_client.gql`
713
- fragment LocationFields on LocationType {
714
- city
715
- country
716
- fullAddress
717
- geo {
718
- ...LocationGeoFields
719
- }
720
- latitude
721
- longitude
722
- region
723
- }
724
- ${LocationGeoFieldsFragmentDoc}`;
725
- var OwnerFieldsFragmentDoc = import_client.gql`
726
- fragment OwnerFields on OwnerType {
727
- email
728
- userId
729
- }
730
- `;
731
- var PosterUsageFieldsFragmentDoc = import_client.gql`
732
- fragment PosterUsageFields on PosterUsageType {
733
- month
734
- count
735
- }
736
- `;
737
- var RelationDatesFragmentDoc = import_client.gql`
738
- fragment RelationDates on RelationDateType {
739
- dateTime {
740
- dateStatus
741
- endDate
742
- endTime
743
- startDate
744
- startTime
745
- stallType {
746
- ...StallTypeFields
747
- }
748
- }
749
- lastUpdateBy {
750
- resourceId
751
- userEmail
752
- }
753
- paymentReference
754
- status
755
- }
756
- ${StallTypeFieldsFragmentDoc}`;
757
- var RelatedPostFieldsFragmentDoc = import_client.gql`
758
- fragment RelatedPostFields on RelatedPostType {
759
- postActive
760
- postId
761
- postSlug
762
- postType
763
- }
764
- `;
765
- var SocialMediaFieldsFragmentDoc = import_client.gql`
766
- fragment SocialMediaFields on SocialMediaType {
767
- name
768
- link
769
- }
770
- `;
771
- var SocialShareResourceFieldsFragmentDoc = import_client.gql`
772
- fragment SocialShareResourceFields on SocialShareResourceType {
773
- qrCode {
774
- ...ResourceImageFields
775
- }
776
- socialImage {
777
- ...ResourceImageFields
778
- }
779
- }
780
- ${ResourceImageFieldsFragmentDoc}`;
781
- var TermsAgreementFieldsFragmentDoc = import_client.gql`
782
- fragment TermsAgreementFields on TermsAgreementType {
783
- appBuildNumber
784
- appId
785
- appVersion
786
- brand
787
- deviceName
788
- installationId
789
- manufacturer
790
- modelName
791
- osName
792
- osVersion
793
- termVersion
794
- timestamp
795
- }
796
- `;
797
- var EventFieldsFragmentDoc = import_client.gql`
798
- fragment EventFields on EventType {
799
- _id
800
- active
801
- adIds
802
- approvedAt
803
- cover {
804
- ...ResourceImageFields
805
- }
806
- claimed
807
- createdAt
808
- contactDetails {
809
- ...ContactDetailsFields
810
- }
811
- dateTime {
812
- ...DateTimeFields
813
- }
814
- description
815
- deletedAt
816
- googlePlaceId
817
- images {
818
- ...ResourceImageFields
819
- }
820
- eventType
821
- location {
822
- ...LocationFields
823
- }
824
- logo {
825
- ...ResourceImageFields
826
- }
827
- eventInfoId
828
- name
829
- nzbn
830
- owner {
831
- ...OwnerFields
832
- }
833
- promoCodes
834
- provider
835
- posterUsage {
836
- ...PosterUsageFields
837
- }
838
- region
839
- relations {
840
- relationId
841
- relationDates {
842
- ...RelationDates
843
- }
844
- }
845
- rating
846
- reviewCount
847
- rainOrShine
848
- relatedPost {
849
- ...RelatedPostFields
850
- }
851
- socialMedia {
852
- ...SocialMediaFields
853
- }
854
- sharePublic {
855
- ...SocialShareResourceFields
856
- }
857
- shareRelation {
858
- ...SocialShareResourceFields
859
- }
860
- slug
861
- tags
862
- termsAgreement {
863
- ...TermsAgreementFields
864
- }
865
- updatedAt
866
- }
867
- ${ResourceImageFieldsFragmentDoc}
868
- ${ContactDetailsFieldsFragmentDoc}
869
- ${DateTimeFieldsFragmentDoc}
870
- ${LocationFieldsFragmentDoc}
871
- ${OwnerFieldsFragmentDoc}
872
- ${PosterUsageFieldsFragmentDoc}
873
- ${RelationDatesFragmentDoc}
874
- ${RelatedPostFieldsFragmentDoc}
875
- ${SocialMediaFieldsFragmentDoc}
876
- ${SocialShareResourceFieldsFragmentDoc}
877
- ${TermsAgreementFieldsFragmentDoc}`;
878
- var EventListItemFieldsFragmentDoc = import_client.gql`
879
- fragment EventListItemFields on EventListItemType {
880
- _id
881
- active
882
- approvedAt
883
- claimed
884
- cover {
885
- ...ResourceImageFields
886
- }
887
- createdAt
888
- dateTime {
889
- ...DateTimeFields
890
- }
891
- deletedAt
892
- description
893
- eventType
894
- googlePlaceId
895
- images {
896
- ...ResourceImageFields
897
- }
898
- location {
899
- ...LocationFields
900
- }
901
- logo {
902
- ...ResourceImageFields
903
- }
904
- name
905
- rainOrShine
906
- rating
907
- region
908
- relations {
909
- relationId
910
- relationDates {
911
- ...RelationDates
912
- }
913
- }
914
- reviewCount
915
- slug
916
- updatedAt
917
- }
918
- ${ResourceImageFieldsFragmentDoc}
919
- ${DateTimeFieldsFragmentDoc}
920
- ${LocationFieldsFragmentDoc}
921
- ${RelationDatesFragmentDoc}`;
922
- var PartnerFieldsFragmentDoc = import_client.gql`
923
- fragment PartnerFields on PartnerType {
924
- _id
925
- active
926
- adIds
927
- approvedAt
928
- cover {
929
- ...ResourceImageFields
930
- }
931
- createdAt
932
- contactDetails {
933
- ...ContactDetailsFields
934
- }
935
- description
936
- deletedAt
937
- images {
938
- ...ResourceImageFields
939
- }
940
- location {
941
- ...LocationFields
942
- }
943
- logo {
944
- ...ResourceImageFields
945
- }
946
- name
947
- nzbn
948
- owner {
949
- ...OwnerFields
950
- }
951
- partnerType
952
- posterUsage {
953
- ...PosterUsageFields
954
- }
955
- rating
956
- region
957
- reviewCount
958
- relatedPost {
959
- ...RelatedPostFields
960
- }
961
- socialMedia {
962
- ...SocialMediaFields
963
- }
964
- slug
965
- sharePublic {
966
- ...SocialShareResourceFields
967
- }
968
- termsAgreement {
969
- ...TermsAgreementFields
970
- }
971
- updatedAt
972
- }
973
- ${ResourceImageFieldsFragmentDoc}
974
- ${ContactDetailsFieldsFragmentDoc}
975
- ${LocationFieldsFragmentDoc}
976
- ${OwnerFieldsFragmentDoc}
977
- ${PosterUsageFieldsFragmentDoc}
978
- ${RelatedPostFieldsFragmentDoc}
979
- ${SocialMediaFieldsFragmentDoc}
980
- ${SocialShareResourceFieldsFragmentDoc}
981
- ${TermsAgreementFieldsFragmentDoc}`;
982
- var RelationFieldsFragmentDoc = import_client.gql`
983
- fragment RelationFields on RelationType {
984
- _id
985
- active
986
- chatId
987
- createdAt
988
- lastUpdateBy
989
- eventId
990
- relationDates {
991
- ...RelationDates
992
- }
993
- relationType
994
- vendorId
995
- updatedAt
996
- }
997
- ${RelationDatesFragmentDoc}`;
998
- var SchoolCampaignFieldsFragmentDoc = import_client.gql`
999
- fragment SchoolCampaignFields on SchoolCampaignType {
1000
- endDate
1001
- name
1002
- startDate
1003
- }
1004
- `;
1005
- var SchoolFieldsFragmentDoc = import_client.gql`
1006
- fragment SchoolFields on SchoolType {
1007
- _id
1008
- active
1009
- approvedAt
1010
- campaigns {
1011
- ...SchoolCampaignFields
1012
- }
1013
- contactDetails {
1014
- ...ContactDetailsFields
1015
- }
1016
- location {
1017
- ...LocationFields
1018
- }
1019
- createdAt
1020
- deletedAt
1021
- logo {
1022
- ...ResourceImageFields
1023
- }
1024
- name
1025
- owner {
1026
- ...OwnerFields
1027
- }
1028
- overallPoints
1029
- ranking
1030
- region
1031
- studentCount
1032
- schoolCode
1033
- socialMedia {
1034
- ...SocialMediaFields
1035
- }
1036
- termsAgreement {
1037
- ...TermsAgreementFields
1038
- }
1039
- updatedAt
1040
- }
1041
- ${SchoolCampaignFieldsFragmentDoc}
1042
- ${ContactDetailsFieldsFragmentDoc}
1043
- ${LocationFieldsFragmentDoc}
1044
- ${ResourceImageFieldsFragmentDoc}
1045
- ${OwnerFieldsFragmentDoc}
1046
- ${SocialMediaFieldsFragmentDoc}
1047
- ${TermsAgreementFieldsFragmentDoc}`;
1048
- var UnregisteredVendorInvitationFieldsFragmentDoc = import_client.gql`
1049
- fragment UnregisteredVendorInvitationFields on UnregisteredVendorInvitationType {
1050
- dateTime {
1051
- ...DateTimeFields
1052
- }
1053
- inviterId
1054
- }
1055
- ${DateTimeFieldsFragmentDoc}`;
1056
- var UnregisteredVendorFieldsFragmentDoc = import_client.gql`
1057
- fragment UnregisteredVendorFields on UnregisteredVendorType {
1058
- _id
1059
- active
1060
- categoryIds
1061
- claimed
1062
- createdAt
1063
- deletedAt
1064
- email
1065
- invitations {
1066
- ...UnregisteredVendorInvitationFields
1067
- }
1068
- name
1069
- region
1070
- updatedAt
1071
- }
1072
- ${UnregisteredVendorInvitationFieldsFragmentDoc}`;
1073
- var LicenceFieldsFragmentDoc = import_client.gql`
1074
- fragment LicenceFields on UserLicenceType {
1075
- expiryDate
1076
- issuedDate
1077
- licenceType
1078
- prevLicenceType
1079
- }
1080
- `;
1081
- var RedeemedRewardFieldsFragmentDoc = import_client.gql`
1082
- fragment RedeemedRewardFields on RedeemedRewardType {
1083
- name
1084
- pointsUsed
1085
- redeemedAt
1086
- }
1087
- `;
1088
- var StripeSubscriptionFieldsFragmentDoc = import_client.gql`
1089
- fragment StripeSubscriptionFields on StripeSubscriptionType {
1090
- customerId
1091
- subscriptionId
1092
- status
1093
- currentPlan
1094
- startDate
1095
- endDate
1096
- }
1097
- `;
1098
- var UserActivityFieldsFragmentDoc = import_client.gql`
1099
- fragment UserActivityFields on UserActivityType {
1100
- favourites {
1101
- events
1102
- partners
1103
- vendors
1104
- }
1105
- going {
1106
- events {
1107
- resourceId
1108
- dateTime {
1109
- ...DateTimeFields
1110
- }
1111
- }
1112
- }
1113
- interested {
1114
- events {
1115
- resourceId
1116
- dateTime {
1117
- ...DateTimeFields
1118
- }
1119
- }
1120
- }
1121
- present {
1122
- events {
1123
- resourceId
1124
- dateTime {
1125
- ...DateTimeFields
1126
- }
1127
- }
1128
- }
1129
- }
1130
- ${DateTimeFieldsFragmentDoc}`;
1131
- var UserFieldsFragmentDoc = import_client.gql`
1132
- fragment UserFields on UserType {
1133
- _id
1134
- active
1135
- affiliate
1136
- avatar {
1137
- ...ResourceImageFields
1138
- }
1139
- createdAt
1140
- deletedAt
1141
- email
1142
- events
1143
- firstName
1144
- game
1145
- isTester
1146
- lastName
1147
- licences {
1148
- ...LicenceFields
1149
- }
1150
- location {
1151
- ...LocationFields
1152
- }
1153
- partner
1154
- overallPoints
1155
- platform
1156
- preferredRegion
1157
- permissions
1158
- promoCodes
1159
- roles
1160
- redeemedRewards {
1161
- ...RedeemedRewardFields
1162
- }
1163
- school
1164
- stripe {
1165
- ...StripeSubscriptionFields
1166
- }
1167
- termsAgreement {
1168
- ...TermsAgreementFields
1169
- }
1170
- userActivity {
1171
- ...UserActivityFields
1172
- }
1173
- vendor
1174
- updatedAt
1175
- }
1176
- ${ResourceImageFieldsFragmentDoc}
1177
- ${LicenceFieldsFragmentDoc}
1178
- ${LocationFieldsFragmentDoc}
1179
- ${RedeemedRewardFieldsFragmentDoc}
1180
- ${StripeSubscriptionFieldsFragmentDoc}
1181
- ${TermsAgreementFieldsFragmentDoc}
1182
- ${UserActivityFieldsFragmentDoc}`;
1183
- var CategoryFieldsFragmentDoc = import_client.gql`
1184
- fragment CategoryFields on CategoryType {
1185
- id
1186
- name
1187
- subcategories {
1188
- id
1189
- items {
1190
- id
1191
- name
1192
- }
1193
- name
1194
- }
1195
- }
1196
- `;
1197
- var VendorDateTimeFieldsFragmentDoc = import_client.gql`
1198
- fragment VendorDateTimeFields on VendorDateTimeType {
1199
- dateStatus
1200
- endDate
1201
- endTime
1202
- startDate
1203
- startTime
1204
- }
1205
- `;
1206
- var VendorProductListFieldsFragmentDoc = import_client.gql`
1207
- fragment VendorProductListFields on VendorProductListType {
1208
- description
1209
- name
1210
- price
1211
- priceUnit
1212
- productGroups
1213
- }
1214
- `;
1215
- var VendorFieldsFragmentDoc = import_client.gql`
1216
- fragment VendorFields on VendorType {
1217
- _id
1218
- active
1219
- adIds
1220
- approvedAt
1221
- availability {
1222
- corporate
1223
- private
1224
- school
1225
- }
1226
- vendorInfoId
1227
- categories {
1228
- ...CategoryFields
1229
- }
1230
- calendar {
1231
- active
1232
- calendarData {
1233
- dateTime {
1234
- ...VendorDateTimeFields
1235
- }
1236
- description
1237
- location {
1238
- ...LocationFields
1239
- }
1240
- }
1241
- }
1242
- contactDetails {
1243
- ...ContactDetailsFields
1244
- }
1245
- cover {
1246
- ...ResourceImageFields
1247
- }
1248
- createdAt
1249
- claimed
1250
- description
1251
- deletedAt
1252
- foodTruck
1253
- images {
1254
- ...ResourceImageFields
1255
- }
1256
- logo {
1257
- ...ResourceImageFields
1258
- }
1259
- name
1260
- owner {
1261
- ...OwnerFields
1262
- }
1263
- products {
1264
- active
1265
- productsList {
1266
- ...VendorProductListFields
1267
- }
1268
- }
1269
- promoCodes
1270
- posterUsage {
1271
- ...PosterUsageFields
1272
- }
1273
- rating
1274
- region
1275
- reviewCount
1276
- relatedPost {
1277
- ...RelatedPostFields
1278
- }
1279
- relations {
1280
- relationId
1281
- relationDates {
1282
- ...RelationDates
1283
- }
1284
- }
1285
- slug
1286
- socialMedia {
1287
- ...SocialMediaFields
1288
- }
1289
- sharePublic {
1290
- ...SocialShareResourceFields
1291
- }
1292
- shareRelation {
1293
- ...SocialShareResourceFields
1294
- }
1295
- termsAgreement {
1296
- ...TermsAgreementFields
1297
- }
1298
- updatedAt
1299
- vendorType
1300
- unregisteredVendorId
1301
- }
1302
- ${CategoryFieldsFragmentDoc}
1303
- ${VendorDateTimeFieldsFragmentDoc}
1304
- ${LocationFieldsFragmentDoc}
1305
- ${ContactDetailsFieldsFragmentDoc}
1306
- ${ResourceImageFieldsFragmentDoc}
1307
- ${OwnerFieldsFragmentDoc}
1308
- ${VendorProductListFieldsFragmentDoc}
1309
- ${PosterUsageFieldsFragmentDoc}
1310
- ${RelatedPostFieldsFragmentDoc}
1311
- ${RelationDatesFragmentDoc}
1312
- ${SocialMediaFieldsFragmentDoc}
1313
- ${SocialShareResourceFieldsFragmentDoc}
1314
- ${TermsAgreementFieldsFragmentDoc}`;
1315
- var AffiliateRewardFieldsFragmentDoc = import_client.gql`
1316
- fragment AffiliateRewardFields on AffiliateRewardType {
1317
- createdAt
1318
- redeemedAt
1319
- rewardDescription
1320
- rewardType
1321
- rewardValue
1322
- }
1323
- `;
1324
- var AffiliateBankAccountDetailsFieldsFragmentDoc = import_client.gql`
1325
- fragment AffiliateBankAccountDetailsFields on AffiliateBankAccountDetailsType {
1326
- accountHolderName
1327
- accountNumber
1328
- }
1329
- `;
1330
- var AffiliateDetailsFieldsFragmentDoc = import_client.gql`
1331
- fragment AffiliateDetailsFields on AffiliateDetailsType {
1332
- bankAccountDetails {
1333
- ...AffiliateBankAccountDetailsFields
1334
- }
1335
- contactDetails {
1336
- mobilePhone
1337
- }
1338
- irdNumber
1339
- participantType
1340
- email
1341
- firstName
1342
- lastName
1343
- location {
1344
- ...LocationFields
1345
- }
1346
- socialMedia {
1347
- ...SocialMediaFields
1348
- }
1349
- termsAgreement {
1350
- ...TermsAgreementFields
1351
- }
1352
- }
1353
- ${AffiliateBankAccountDetailsFieldsFragmentDoc}
1354
- ${LocationFieldsFragmentDoc}
1355
- ${SocialMediaFieldsFragmentDoc}
1356
- ${TermsAgreementFieldsFragmentDoc}`;
1357
- var AffiliateResourceFieldsFragmentDoc = import_client.gql`
1358
- fragment AffiliateResourceFields on AffiliateResourceType {
1359
- resourceActive
1360
- resourceDeletedAt
1361
- resourceId
1362
- resourceName
1363
- resourceOwner {
1364
- ...OwnerFields
1365
- }
1366
- resourceType
1367
- rewards {
1368
- ...AffiliateRewardFields
1369
- }
1370
- }
1371
- ${OwnerFieldsFragmentDoc}
1372
- ${AffiliateRewardFieldsFragmentDoc}`;
1373
- var AffiliateFieldsFragmentDoc = import_client.gql`
1374
- fragment AffiliateFields on AffiliateType {
1375
- _id
1376
- active
1377
- affiliateBonusRewards {
1378
- ...AffiliateRewardFields
1379
- }
1380
- affiliateCode
1381
- affiliateDetails {
1382
- ...AffiliateDetailsFields
1383
- }
1384
- affiliateResources {
1385
- ...AffiliateResourceFields
1386
- }
1387
- approvedAt
1388
- createdAt
1389
- deletedAt
1390
- redeemHistory {
1391
- paidAt
1392
- redeemedAt
1393
- rewardValue
1394
- }
1395
- overallPoints
1396
- owner {
1397
- ...OwnerFields
1398
- }
1399
- updatedAt
1400
- }
1401
- ${AffiliateRewardFieldsFragmentDoc}
1402
- ${AffiliateDetailsFieldsFragmentDoc}
1403
- ${AffiliateResourceFieldsFragmentDoc}
1404
- ${OwnerFieldsFragmentDoc}`;
1405
- var GameDateFieldsFragmentDoc = import_client.gql`
1406
- fragment GameDateFields on GameDateType {
1407
- startDate
1408
- endDate
1409
- }
1410
- `;
1411
- var DailyClueBaseGameFieldsFragmentDoc = import_client.gql`
1412
- fragment DailyClueBaseGameFields on DailyClueBaseGameType {
1413
- gameDate {
1414
- ...GameDateFields
1415
- }
1416
- gameSolution
1417
- }
1418
- ${GameDateFieldsFragmentDoc}`;
1419
- var DailyClueGameDataFieldsFragmentDoc = import_client.gql`
1420
- fragment DailyClueGameDataFields on DailyClueGameDataType {
1421
- gameFields {
1422
- ...DailyClueBaseGameFields
1423
- }
1424
- lastFoundDate
1425
- points
1426
- letterInfo {
1427
- collected
1428
- solutionShuffled
1429
- todaysClue
1430
- todaysLetter
1431
- todaysPlacement
1432
- }
1433
- streak
1434
- }
1435
- ${DailyClueBaseGameFieldsFragmentDoc}`;
1436
- var PuzzleAnswerFieldsFragmentDoc = import_client.gql`
1437
- fragment PuzzleAnswerFields on PuzzleAnswerType {
1438
- answer
1439
- answerId
1440
- correct
1441
- }
1442
- `;
1443
- var PuzzleQuestionFieldsFragmentDoc = import_client.gql`
1444
- fragment PuzzleQuestionFields on PuzzleQuestionType {
1445
- answers {
1446
- ...PuzzleAnswerFields
1447
- }
1448
- question
1449
- questionId
1450
- }
1451
- ${PuzzleAnswerFieldsFragmentDoc}`;
1452
- var PuzzleBaseGameFieldsFragmentDoc = import_client.gql`
1453
- fragment PuzzleBaseGameFields on PuzzleBaseGameType {
1454
- questions {
1455
- ...PuzzleQuestionFields
1456
- }
1457
- }
1458
- ${PuzzleQuestionFieldsFragmentDoc}`;
1459
- var PuzzleAnsweredQuestionFieldsFragmentDoc = import_client.gql`
1460
- fragment PuzzleAnsweredQuestionFields on PuzzleAnsweredQuestionType {
1461
- questionId
1462
- selectedAnswerId
1463
- }
1464
- `;
1465
- var PuzzleGameDataFieldsFragmentDoc = import_client.gql`
1466
- fragment PuzzleGameDataFields on PuzzleGameDataType {
1467
- gameFields {
1468
- ...PuzzleBaseGameFields
1469
- }
1470
- answeredQuestions {
1471
- ...PuzzleAnsweredQuestionFields
1472
- }
1473
- points
1474
- streak
1475
- }
1476
- ${PuzzleBaseGameFieldsFragmentDoc}
1477
- ${PuzzleAnsweredQuestionFieldsFragmentDoc}`;
1478
- var GameDataFieldsFragmentDoc = import_client.gql`
1479
- fragment GameDataFields on GameDataType {
1480
- dailyClue {
1481
- ...DailyClueGameDataFields
1482
- }
1483
- miniQuiz {
1484
- ...PuzzleGameDataFields
1485
- }
1486
- oddOneOut {
1487
- ...PuzzleGameDataFields
1488
- }
1489
- }
1490
- ${DailyClueGameDataFieldsFragmentDoc}
1491
- ${PuzzleGameDataFieldsFragmentDoc}`;
1492
- var GameHistoryFieldsFragmentDoc = import_client.gql`
1493
- fragment GameHistoryFields on GameHistoryType {
1494
- createdAt
1495
- gameDate {
1496
- ...GameDateFields
1497
- }
1498
- gameStatus
1499
- gameTitle
1500
- gameType
1501
- gameTypeId
1502
- overallGamePoints
1503
- pointsEarned
1504
- }
1505
- ${GameDateFieldsFragmentDoc}`;
1506
- var GameFieldsFragmentDoc = import_client.gql`
1507
- fragment GameFields on GameType {
1508
- _id
1509
- active
1510
- createdAt
1511
- gameData {
1512
- ...GameDataFields
1513
- }
1514
- gameHistory {
1515
- ...GameHistoryFields
1516
- }
1517
- gameType
1518
- gameTypeId
1519
- gameTitle
1520
- updatedAt
1521
- }
1522
- ${GameDataFieldsFragmentDoc}
1523
- ${GameHistoryFieldsFragmentDoc}`;
1524
- var GameDocFieldsFragmentDoc = import_client.gql`
1525
- fragment GameDocFields on GameDocType {
1526
- _id
1527
- active
1528
- createdAt
1529
- deletedAt
1530
- games {
1531
- ...GameFields
1532
- }
1533
- owner {
1534
- ...OwnerFields
1535
- }
1536
- points
1537
- updatedAt
1538
- }
1539
- ${GameFieldsFragmentDoc}
1540
- ${OwnerFieldsFragmentDoc}`;
1541
- var BaseGameFieldsFragmentDoc = import_client.gql`
1542
- fragment BaseGameFields on BaseGameType {
1543
- gameTypeId
1544
- gameTitle
1545
- gameType
1546
- dailyClue {
1547
- ...DailyClueBaseGameFields
1548
- }
1549
- miniQuiz {
1550
- ...PuzzleBaseGameFields
1551
- }
1552
- oddOneOut {
1553
- ...PuzzleBaseGameFields
1554
- }
1555
- }
1556
- ${DailyClueBaseGameFieldsFragmentDoc}
1557
- ${PuzzleBaseGameFieldsFragmentDoc}`;
1558
- var PostContentDataFieldsFragmentDoc = import_client.gql`
1559
- fragment PostContentDataFields on PostContentData {
1560
- game {
1561
- ...BaseGameFields
1562
- }
1563
- textarea {
1564
- title
1565
- data
1566
- }
1567
- images {
1568
- ...ResourceImageFields
1569
- }
1570
- video {
1571
- source
1572
- title
1573
- }
1574
- list {
1575
- title
1576
- items {
1577
- text
1578
- }
1579
- }
1580
- }
1581
- ${BaseGameFieldsFragmentDoc}
1582
- ${ResourceImageFieldsFragmentDoc}`;
1583
- var PostContentFieldsFragmentDoc = import_client.gql`
1584
- fragment PostContentFields on PostContentType {
1585
- contentData {
1586
- ...PostContentDataFields
1587
- }
1588
- contentOrder
1589
- contentType
1590
- }
1591
- ${PostContentDataFieldsFragmentDoc}`;
1592
- var PostResourceFieldsFragmentDoc = import_client.gql`
1593
- fragment PostResourceFields on PostResourceType {
1594
- resourceId
1595
- resourceSlug
1596
- resourceRegion
1597
- resourceType
1598
- }
1599
- `;
1600
- var PostFieldsFragmentDoc = import_client.gql`
1601
- fragment PostFields on PostType {
1602
- _id
1603
- active
1604
- approvedAt
1605
- caption
1606
- content {
1607
- ...PostContentFields
1608
- }
1609
- cover {
1610
- ...ResourceImageFields
1611
- }
1612
- createdAt
1613
- deletedAt
1614
- postType
1615
- resource {
1616
- ...PostResourceFields
1617
- }
1618
- tags
1619
- title
1620
- slug
1621
- sharePublic {
1622
- ...SocialShareResourceFields
1623
- }
1624
- updatedAt
1625
- }
1626
- ${PostContentFieldsFragmentDoc}
1627
- ${ResourceImageFieldsFragmentDoc}
1628
- ${PostResourceFieldsFragmentDoc}
1629
- ${SocialShareResourceFieldsFragmentDoc}`;
1630
- var CreateAdDocument = import_client.gql`
1631
- mutation createAd($input: AdInputType!) {
1632
- createAd(input: $input) {
1633
- data {
1634
- ...AdFields
1635
- }
1636
- message
1637
- }
1638
- }
1639
- ${AdFieldsFragmentDoc}`;
1640
- var UpdateAdDocument = import_client.gql`
1641
- mutation updateAd($_id: ID!, $input: AdInputType!) {
1642
- updateAd(_id: $_id, input: $input) {
1643
- data {
1644
- ...AdFields
1645
- }
1646
- message
1647
- }
1648
- }
1649
- ${AdFieldsFragmentDoc}`;
1650
- var DeleteAdDocument = import_client.gql`
1651
- mutation deleteAd($_id: ID!) {
1652
- deleteAd(_id: $_id) {
1653
- data
1654
- message
1655
- }
1656
- }
1657
- `;
1658
- var AdminUpdateResourceTypeDocument = import_client.gql`
1659
- mutation adminUpdateResourceType($input: AdminUpdateResourceInputType!) {
1660
- adminUpdateResourceType(input: $input) {
1661
- data {
1662
- active
1663
- resourceId
1664
- resourceType
1665
- }
1666
- message
1667
- }
1668
- }
1669
- `;
1670
- var AdminResendUserVerificationEmailDocument = import_client.gql`
1671
- mutation adminResendUserVerificationEmail($userId: ID!) {
1672
- adminResendUserVerificationEmail(userId: $userId) {
1673
- data
1674
- message
1675
- }
1676
- }
1677
- `;
1678
- var AdminPermanentlyDeleteResourceDocument = import_client.gql`
1679
- mutation adminPermanentlyDeleteResource($resourceId: ID!, $resourceType: ResourceTypeEnum!) {
1680
- adminPermanentlyDeleteResource(
1681
- resourceId: $resourceId
1682
- resourceType: $resourceType
1683
- ) {
1684
- data
1685
- message
1686
- }
1687
- }
1688
- `;
1689
- var UpdateAffiliateDetailsDocument = import_client.gql`
1690
- mutation updateAffiliateDetails($input: AffiliateDetailsInputType!, $affiliateId: ID!) {
1691
- updateAffiliateDetails(input: $input, affiliateId: $affiliateId) {
1692
- data {
1693
- ...AffiliateFields
1694
- }
1695
- message
1696
- }
1697
- }
1698
- ${AffiliateFieldsFragmentDoc}`;
1699
- var DeleteAffiliateDocument = import_client.gql`
1700
- mutation deleteAffiliate($_id: ID!) {
1701
- deleteAffiliate(_id: $_id) {
1702
- data
1703
- message
1704
- }
1705
- }
1706
- `;
1707
- var RedeemAffiliateRewardDocument = import_client.gql`
1708
- mutation redeemAffiliateReward($affiliateId: ID!) {
1709
- redeemAffiliateReward(affiliateId: $affiliateId) {
1710
- data {
1711
- ...AffiliateFields
1712
- }
1713
- message
1714
- }
1715
- }
1716
- ${AffiliateFieldsFragmentDoc}`;
1717
- var AssignAffiliateResourceRewardDocument = import_client.gql`
1718
- mutation assignAffiliateResourceReward($affiliateId: ID!, $resourceId: ID!, $resourceType: ResourceTypeEnum!, $rewardType: AffiliateRewardEnumType!) {
1719
- assignAffiliateResourceReward(
1720
- affiliateId: $affiliateId
1721
- resourceId: $resourceId
1722
- resourceType: $resourceType
1723
- rewardType: $rewardType
1724
- ) {
1725
- data {
1726
- ...AffiliateFields
1727
- }
1728
- message
1729
- }
1730
- }
1731
- ${AffiliateFieldsFragmentDoc}`;
1732
- var AssignAffiliateBonusRewardDocument = import_client.gql`
1733
- mutation assignAffiliateBonusReward($affiliateId: ID!, $rewardType: AffiliateRewardEnumType!) {
1734
- assignAffiliateBonusReward(affiliateId: $affiliateId, rewardType: $rewardType) {
1735
- data {
1736
- ...AffiliateFields
1737
- }
1738
- message
1739
- }
1740
- }
1741
- ${AffiliateFieldsFragmentDoc}`;
1742
- var UpdateAppSettingsDocument = import_client.gql`
1743
- mutation updateAppSettings($input: AppSettingsInputType!) {
1744
- updateAppSettings(input: $input) {
1745
- data
1746
- message
1747
- }
1748
- }
1749
- `;
1750
- var CrawlGoogleMarketsDocument = import_client.gql`
1751
- mutation crawlGoogleMarkets {
1752
- crawlGoogleMarkets {
1753
- data
1754
- message
1755
- }
1756
- }
1757
- `;
1758
- var UpdateGoogleImportedMarketsDocument = import_client.gql`
1759
- mutation updateGoogleImportedMarkets {
1760
- updateGoogleImportedMarkets {
1761
- data
1762
- message
1763
- }
1764
- }
1765
- `;
1766
- var RegisterDocument = import_client.gql`
1767
- mutation register($input: RegisterInputType!) {
1768
- register(input: $input) {
1769
- data {
1770
- refreshToken
1771
- token
1772
- user {
1773
- ...UserFields
1774
- }
1775
- }
1776
- message
1777
- }
1778
- }
1779
- ${UserFieldsFragmentDoc}`;
1780
- var LoginDocument = import_client.gql`
1781
- mutation login($input: LoginInputType!) {
1782
- login(input: $input) {
1783
- data {
1784
- refreshToken
1785
- token
1786
- user {
1787
- ...UserFields
1788
- }
1789
- }
1790
- message
1791
- }
1792
- }
1793
- ${UserFieldsFragmentDoc}`;
1794
- var LogoutDocument = import_client.gql`
1795
- mutation logout {
1796
- logout {
1797
- data
1798
- message
1799
- }
1800
- }
1801
- `;
1802
- var RefreshTokenDocument = import_client.gql`
1803
- mutation refreshToken($input: RefreshTokenInputType!) {
1804
- refreshToken(input: $input) {
1805
- data {
1806
- refreshToken
1807
- token
1808
- }
1809
- message
1810
- }
1811
- }
1812
- `;
1813
- var ResetPasswordDocument = import_client.gql`
1814
- mutation resetPassword($input: ResetPasswordInputType!) {
1815
- resetPassword(input: $input) {
1816
- data
1817
- message
1818
- }
1819
- }
1820
- `;
1821
- var RequestPasswordResetDocument = import_client.gql`
1822
- mutation requestPasswordReset($input: RequestPasswordResetInputType!) {
1823
- requestPasswordReset(input: $input) {
1824
- data
1825
- message
1826
- }
1827
- }
1828
- `;
1829
- var ValidateVerificationTokenDocument = import_client.gql`
1830
- mutation validateVerificationToken($input: ValidateVerificationTokenInputType!) {
1831
- validateVerificationToken(input: $input) {
1832
- data
1833
- message
1834
- }
1835
- }
1836
- `;
1837
- var CreatePrivateChatDocument = import_client.gql`
1838
- mutation createPrivateChat($userId: ID!) {
1839
- createPrivateChat(userId: $userId) {
1840
- data {
1841
- ...ChatFields
1842
- }
1843
- message
1844
- }
1845
- }
1846
- ${ChatFieldsFragmentDoc}`;
1847
- var SendChatMessageDocument = import_client.gql`
1848
- mutation sendChatMessage($_id: ID!, $input: ChatMessageInputType!) {
1849
- sendChatMessage(_id: $_id, input: $input) {
1850
- data {
1851
- ...ChatFields
1852
- }
1853
- message
1854
- }
1855
- }
1856
- ${ChatFieldsFragmentDoc}`;
1857
- var DeleteChatDocument = import_client.gql`
1858
- mutation deleteChat($_id: ID!) {
1859
- deleteChat(_id: $_id) {
1860
- data
1861
- message
1862
- }
1863
- }
1864
- `;
1865
- var AddParticipantToChatDocument = import_client.gql`
1866
- mutation addParticipantToChat($chatId: ID!, $userId: ID!) {
1867
- addParticipantToChat(chatId: $chatId, userId: $userId) {
1868
- data {
1869
- ...ChatFields
1870
- }
1871
- message
1872
- }
1873
- }
1874
- ${ChatFieldsFragmentDoc}`;
1875
- var RemoveParticipantFromChatDocument = import_client.gql`
1876
- mutation removeParticipantFromChat($chatId: ID!, $userId: ID!) {
1877
- removeParticipantFromChat(chatId: $chatId, userId: $userId) {
1878
- data {
1879
- success
1880
- region
1881
- }
1882
- message
1883
- }
1884
- }
1885
- `;
1886
- var ToggleChatMessageLikeDocument = import_client.gql`
1887
- mutation toggleChatMessageLike($chatId: ID!, $messageId: ID!) {
1888
- toggleChatMessageLike(chatId: $chatId, messageId: $messageId) {
1889
- data {
1890
- ...ChatFields
1891
- }
1892
- message
1893
- }
1894
- }
1895
- ${ChatFieldsFragmentDoc}`;
1896
- var MarkChatMessagesSeenDocument = import_client.gql`
1897
- mutation markChatMessagesSeen($chatId: ID!, $messageIds: [ID!]!) {
1898
- markChatMessagesSeen(chatId: $chatId, messageIds: $messageIds) {
1899
- data {
1900
- ...ChatFields
1901
- }
1902
- message
1903
- }
1904
- }
1905
- ${ChatFieldsFragmentDoc}`;
1906
- var ReportChatUserDocument = import_client.gql`
1907
- mutation reportChatUser($input: ReportChatUserInputType!) {
1908
- reportChatUser(input: $input) {
1909
- data {
1910
- ...ChatReportFields
1911
- }
1912
- message
1913
- }
1914
- }
1915
- ${ChatReportFieldsFragmentDoc}`;
1916
- var ContactUsDocument = import_client.gql`
1917
- mutation contactUs($input: ContactUsInputType!) {
1918
- contactUs(input: $input) {
1919
- data
1920
- message
1921
- }
1922
- }
1923
- `;
1924
- var CreateEventDocument = import_client.gql`
1925
- mutation createEvent($input: EventInputType!) {
1926
- createEvent(input: $input) {
1927
- data {
1928
- ...EventFields
1929
- }
1930
- message
1931
- }
1932
- }
1933
- ${EventFieldsFragmentDoc}`;
1934
- var UpdateEventDocument = import_client.gql`
1935
- mutation updateEvent($_id: ID!, $input: EventInputType!) {
1936
- updateEvent(_id: $_id, input: $input) {
1937
- data {
1938
- ...EventFields
1939
- }
1940
- message
1941
- }
1942
- }
1943
- ${EventFieldsFragmentDoc}`;
1944
- var DeleteEventDocument = import_client.gql`
1945
- mutation deleteEvent($_id: ID!) {
1946
- deleteEvent(_id: $_id) {
1947
- data
1948
- message
1949
- }
1950
- }
1951
- `;
1952
- var CreateEventInfoDocument = import_client.gql`
1953
- mutation createEventInfo($input: EventInfoInputType!) {
1954
- createEventInfo(input: $input) {
1955
- data {
1956
- ...EventInfoFields
1957
- }
1958
- message
1959
- }
1960
- }
1961
- ${EventInfoFieldsFragmentDoc}`;
1962
- var UpdateEventInfoDocument = import_client.gql`
1963
- mutation updateEventInfo($_id: ID!, $input: EventInfoInputType!) {
1964
- updateEventInfo(_id: $_id, input: $input) {
1965
- data {
1966
- ...EventInfoFields
1967
- }
1968
- message
1969
- }
1970
- }
1971
- ${EventInfoFieldsFragmentDoc}`;
1972
- var StartGameDocument = import_client.gql`
1973
- mutation startGame($input: BaseGameInputType!) {
1974
- startGame(input: $input) {
1975
- data {
1976
- ...GameDocFields
1977
- }
1978
- message
1979
- }
1980
- }
1981
- ${GameDocFieldsFragmentDoc}`;
1982
- var LeaveGameDocument = import_client.gql`
1983
- mutation leaveGame($_id: ID!, $gameType: GameTypeEnumType!, $gameTypeId: String!) {
1984
- leaveGame(_id: $_id, gameType: $gameType, gameTypeId: $gameTypeId) {
1985
- data
1986
- message
1987
- }
1988
- }
1989
- `;
1990
- var UpdateDailyClueGameDocument = import_client.gql`
1991
- mutation updateDailyClueGame($_id: ID!, $foundLetter: String!, $gameType: GameTypeEnumType!, $gameTypeId: String!) {
1992
- updateDailyClueGame(
1993
- _id: $_id
1994
- foundLetter: $foundLetter
1995
- gameType: $gameType
1996
- gameTypeId: $gameTypeId
1997
- ) {
1998
- data {
1999
- ...GameDocFields
2000
- }
2001
- message
2002
- }
2003
- }
2004
- ${GameDocFieldsFragmentDoc}`;
2005
- var UpdatePuzzleGameDocument = import_client.gql`
2006
- mutation updatePuzzleGame($_id: ID!, $answeredQuestions: [PuzzleAnsweredQuestionInputType!]!, $gameType: GameTypeEnumType!, $gameTypeId: String!) {
2007
- updatePuzzleGame(
2008
- _id: $_id
2009
- answeredQuestions: $answeredQuestions
2010
- gameType: $gameType
2011
- gameTypeId: $gameTypeId
2012
- ) {
2013
- data {
2014
- ...GameDocFields
2015
- }
2016
- message
2017
- }
2018
- }
2019
- ${GameDocFieldsFragmentDoc}`;
2020
- var CreateBulkNotificationsDocument = import_client.gql`
2021
- mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
2022
- createBulkNotifications(input: $input) {
2023
- data
2024
- message
2025
- }
2026
- }
2027
- `;
2028
- var MarkNotificationReadDocument = import_client.gql`
2029
- mutation markNotificationRead($_id: ID!) {
2030
- markNotificationRead(_id: $_id) {
2031
- data {
2032
- ...NotificationFields
2033
- }
2034
- message
2035
- }
2036
- }
2037
- ${NotificationFieldsFragmentDoc}`;
2038
- var MarkAllNotificationsReadDocument = import_client.gql`
2039
- mutation markAllNotificationsRead {
2040
- markAllNotificationsRead {
2041
- data
2042
- message
2043
- }
2044
- }
2045
- `;
2046
- var DeleteNotificationDocument = import_client.gql`
2047
- mutation deleteNotification($_id: ID!) {
2048
- deleteNotification(_id: $_id) {
2049
- data
2050
- message
2051
- }
2052
- }
2053
- `;
2054
- var DeleteAllNotificationsDocument = import_client.gql`
2055
- mutation deleteAllNotifications {
2056
- deleteAllNotifications {
2057
- data
2058
- message
2059
- }
2060
- }
2061
- `;
2062
- var CreatePartnerDocument = import_client.gql`
2063
- mutation createPartner($input: PartnerInputType!) {
2064
- createPartner(input: $input) {
2065
- data {
2066
- ...PartnerFields
2067
- }
2068
- message
2069
- }
2070
- }
2071
- ${PartnerFieldsFragmentDoc}`;
2072
- var UpdatePartnerDocument = import_client.gql`
2073
- mutation updatePartner($_id: ID!, $input: PartnerInputType!) {
2074
- updatePartner(_id: $_id, input: $input) {
2075
- data {
2076
- ...PartnerFields
2077
- }
2078
- message
2079
- }
2080
- }
2081
- ${PartnerFieldsFragmentDoc}`;
2082
- var DeletePartnerDocument = import_client.gql`
2083
- mutation deletePartner($_id: ID!) {
2084
- deletePartner(_id: $_id) {
2085
- data
2086
- message
2087
- }
2088
- }
2089
- `;
2090
- var CreatePostDocument = import_client.gql`
2091
- mutation createPost($input: PostInputType!) {
2092
- createPost(input: $input) {
2093
- data {
2094
- ...PostFields
2095
- }
2096
- message
2097
- }
2098
- }
2099
- ${PostFieldsFragmentDoc}`;
2100
- var UpdatePostDocument = import_client.gql`
2101
- mutation updatePost($_id: ID!, $input: PostInputType!) {
2102
- updatePost(_id: $_id, input: $input) {
2103
- data {
2104
- ...PostFields
2105
- }
2106
- message
2107
- }
2108
- }
2109
- ${PostFieldsFragmentDoc}`;
2110
- var DeletePostDocument = import_client.gql`
2111
- mutation deletePost($_id: ID!) {
2112
- deletePost(_id: $_id) {
2113
- data
2114
- message
2115
- }
2116
- }
2117
- `;
2118
- var CreatePosterDocument = import_client.gql`
2119
- mutation createPoster($input: PosterInputType!) {
2120
- createPoster(input: $input) {
2121
- data {
2122
- posterUsage {
2123
- ...PosterUsageFields
2124
- }
2125
- }
2126
- message
2127
- }
2128
- }
2129
- ${PosterUsageFieldsFragmentDoc}`;
2130
- var CreatePushTokenDocument = import_client.gql`
2131
- mutation createPushToken($input: PushTokenInput!) {
2132
- createPushToken(input: $input) {
2133
- data {
2134
- success
2135
- }
2136
- message
2137
- }
2138
- }
2139
- `;
2140
- var GetAdsDocument = import_client.gql`
2141
- query getAds {
2142
- ads {
2143
- ...AdFields
2144
- }
2145
- }
2146
- ${AdFieldsFragmentDoc}`;
2147
- var GetAdDocument = import_client.gql`
2148
- query getAd($_id: ID!) {
2149
- ad(_id: $_id) {
2150
- ...AdFields
2151
- }
2152
- }
2153
- ${AdFieldsFragmentDoc}`;
2154
- var GetAdsByRegionDocument = import_client.gql`
2155
- query getAdsByRegion($region: String!, $status: AdStatusTypeEnum) {
2156
- adsByRegion(region: $region, status: $status) {
2157
- ...AdFields
2158
- }
2159
- }
2160
- ${AdFieldsFragmentDoc}`;
2161
- var GetAffiliateDocument = import_client.gql`
2162
- query getAffiliate($_id: ID!) {
2163
- affiliate(_id: $_id) {
2164
- ...AffiliateFields
2165
- }
2166
- }
2167
- ${AffiliateFieldsFragmentDoc}`;
2168
- var GetAffiliatesDocument = import_client.gql`
2169
- query getAffiliates {
2170
- affiliates {
2171
- ...AffiliateFields
2172
- }
2173
- }
2174
- ${AffiliateFieldsFragmentDoc}`;
2175
- var GetAppSettingsDocument = import_client.gql`
2176
- query getAppSettings {
2177
- appSettings {
2178
- ...AppSettingsFields
2179
- }
2180
- }
2181
- ${AppSettingsFieldsFragmentDoc}`;
2182
- var ChatDocument = import_client.gql`
2183
- query chat($_id: ID!) {
2184
- chat(_id: $_id) {
2185
- ...ChatFields
2186
- }
2187
- }
2188
- ${ChatFieldsFragmentDoc}`;
2189
- var UserChatsDocument = import_client.gql`
2190
- query userChats {
2191
- userChats {
2192
- ...ChatFields
2193
- }
2194
- }
2195
- ${ChatFieldsFragmentDoc}`;
2196
- var GetChatsByRegionDocument = import_client.gql`
2197
- query getChatsByRegion($region: String!) {
2198
- chatsByRegion(region: $region) {
2199
- ...ChatFields
2200
- }
2201
- }
2202
- ${ChatFieldsFragmentDoc}`;
2203
- var GetEventsDocument = import_client.gql`
2204
- query getEvents($dateStatus: EventDateStatusEnumType) {
2205
- events(dateStatus: $dateStatus) {
2206
- ...EventListItemFields
2207
- }
2208
- }
2209
- ${EventListItemFieldsFragmentDoc}`;
2210
- var GetEventDocument = import_client.gql`
2211
- query getEvent($_id: ID!) {
2212
- event(_id: $_id) {
2213
- ...EventFields
2214
- }
2215
- }
2216
- ${EventFieldsFragmentDoc}`;
2217
- var GetEventByPlaceIdDocument = import_client.gql`
2218
- query getEventByPlaceId($googlePlaceId: String!) {
2219
- eventByPlaceId(googlePlaceId: $googlePlaceId) {
2220
- ...EventListItemFields
2221
- }
2222
- }
2223
- ${EventListItemFieldsFragmentDoc}`;
2224
- var GetEventsByRegionDocument = import_client.gql`
2225
- query getEventsByRegion($region: String!, $options: ResourcesByRegionOptions, $dateStatus: EventDateStatusEnumType) {
2226
- eventsByRegion(region: $region, options: $options, dateStatus: $dateStatus) {
2227
- ...EventListItemFields
2228
- }
2229
- }
2230
- ${EventListItemFieldsFragmentDoc}`;
2231
- var SearchEventsDocument = import_client.gql`
2232
- query searchEvents($region: String!, $search: String, $tags: [String], $dateStatus: EventDateStatusEnumType) {
2233
- eventsSearch(
2234
- region: $region
2235
- search: $search
2236
- tags: $tags
2237
- dateStatus: $dateStatus
2238
- ) {
2239
- ...EventListItemFields
2240
- }
2241
- }
2242
- ${EventListItemFieldsFragmentDoc}`;
2243
- var GetEventsNearMeDocument = import_client.gql`
2244
- query getEventsNearMe($latitude: Float!, $longitude: Float!, $radius: Int, $dateStatus: EventDateStatusEnumType) {
2245
- eventsNearMe(
2246
- latitude: $latitude
2247
- longitude: $longitude
2248
- radius: $radius
2249
- dateStatus: $dateStatus
2250
- ) {
2251
- ...EventListItemFields
2252
- }
2253
- }
2254
- ${EventListItemFieldsFragmentDoc}`;
2255
- var GetEventInfoDocument = import_client.gql`
2256
- query getEventInfo($eventId: ID!) {
2257
- eventInfo(eventId: $eventId) {
2258
- ...EventInfoFields
2259
- }
2260
- }
2261
- ${EventInfoFieldsFragmentDoc}`;
2262
- var GetGamesDocument = import_client.gql`
2263
- query getGames {
2264
- games {
2265
- ...GameDocFields
2266
- }
2267
- }
2268
- ${GameDocFieldsFragmentDoc}`;
2269
- var GetGameDocument = import_client.gql`
2270
- query getGame($_id: ID) {
2271
- game(_id: $_id) {
2272
- ...GameDocFields
2273
- }
2274
- }
2275
- ${GameDocFieldsFragmentDoc}`;
2276
- var GetGameLeaderboardDocument = import_client.gql`
2277
- query getGameLeaderboard {
2278
- gameLeaderboard {
2279
- gameHistory {
2280
- ...GameHistoryFields
2281
- }
2282
- overallPoints
2283
- owner {
2284
- ...OwnerFields
2285
- }
2286
- }
2287
- }
2288
- ${GameHistoryFieldsFragmentDoc}
2289
- ${OwnerFieldsFragmentDoc}`;
2290
- var GetUserNotificationsDocument = import_client.gql`
2291
- query getUserNotifications($limit: Int, $offset: Int) {
2292
- userNotifications(limit: $limit, offset: $offset) {
2293
- ...NotificationFields
2294
- }
2295
- }
2296
- ${NotificationFieldsFragmentDoc}`;
2297
- var GetNotificationCountDocument = import_client.gql`
2298
- query getNotificationCount {
2299
- notificationCount {
2300
- total
2301
- unread
2302
- }
2303
- }
2304
- `;
2305
- var GetPartnersDocument = import_client.gql`
2306
- query getPartners {
2307
- partners {
2308
- ...PartnerFields
2309
- }
2310
- }
2311
- ${PartnerFieldsFragmentDoc}`;
2312
- var GetPartnerDocument = import_client.gql`
2313
- query getPartner($_id: ID!) {
2314
- partner(_id: $_id) {
2315
- ...PartnerFields
2316
- }
2317
- }
2318
- ${PartnerFieldsFragmentDoc}`;
2319
- var GetPartnersByRegionDocument = import_client.gql`
2320
- query getPartnersByRegion($region: String!, $options: ResourcesByRegionOptions) {
2321
- partnersByRegion(region: $region, options: $options) {
2322
- ...PartnerFields
2323
- }
2324
- }
2325
- ${PartnerFieldsFragmentDoc}`;
2326
- var SearchPartnersDocument = import_client.gql`
2327
- query searchPartners($search: String!, $region: String!) {
2328
- partnersSearch(search: $search, region: $region) {
2329
- ...PartnerFields
2330
- }
2331
- }
2332
- ${PartnerFieldsFragmentDoc}`;
2333
- var GetPostsDocument = import_client.gql`
2334
- query getPosts {
2335
- posts {
2336
- ...PostFields
2337
- }
2338
- }
2339
- ${PostFieldsFragmentDoc}`;
2340
- var GetPostDocument = import_client.gql`
2341
- query getPost($_id: ID!) {
2342
- post(_id: $_id) {
2343
- ...PostFields
2344
- }
2345
- }
2346
- ${PostFieldsFragmentDoc}`;
2347
- var GetPostsByTypeDocument = import_client.gql`
2348
- query getPostsByType($postType: PostTypeEnum!) {
2349
- postsByType(postType: $postType) {
2350
- ...PostFields
2351
- }
2352
- }
2353
- ${PostFieldsFragmentDoc}`;
2354
- var GetRelationDocument = import_client.gql`
2355
- query getRelation($_id: ID!) {
2356
- relation(_id: $_id) {
2357
- ...RelationFields
2358
- }
2359
- }
2360
- ${RelationFieldsFragmentDoc}`;
2361
- var GetRelationByEventAndVendorDocument = import_client.gql`
2362
- query getRelationByEventAndVendor($eventId: ID!, $vendorId: ID!) {
2363
- relationByEventAndVendor(eventId: $eventId, vendorId: $vendorId) {
2364
- ...RelationFields
2365
- }
2366
- }
2367
- ${RelationFieldsFragmentDoc}`;
2368
- var GetEventRelationsDocument = import_client.gql`
2369
- query getEventRelations($eventId: ID!) {
2370
- eventRelations(eventId: $eventId) {
2371
- ...RelationFields
2372
- }
2373
- }
2374
- ${RelationFieldsFragmentDoc}`;
2375
- var GetVendorRelationsDocument = import_client.gql`
2376
- query getVendorRelations($vendorId: ID!) {
2377
- vendorRelations(vendorId: $vendorId) {
2378
- ...RelationFields
2379
- }
2380
- }
2381
- ${RelationFieldsFragmentDoc}`;
2382
- var GetResourceConnectionsDocument = import_client.gql`
2383
- query getResourceConnections($resourceId: ID!, $resourceType: ResourceTypeEnum!) {
2384
- resourceConnections(resourceId: $resourceId, resourceType: $resourceType) {
2385
- events {
2386
- ...EventListItemFields
2387
- }
2388
- vendors {
2389
- ...VendorFields
2390
- }
2391
- }
2392
- }
2393
- ${EventListItemFieldsFragmentDoc}
2394
- ${VendorFieldsFragmentDoc}`;
2395
- var GetResourceActivityDocument = import_client.gql`
2396
- query getResourceActivity($resourceType: ResourceTypeEnum!, $resourceId: ID!) {
2397
- resourceActivity(resourceType: $resourceType, resourceId: $resourceId) {
2398
- ...ResourceActivityFields
2399
- }
2400
- }
2401
- ${ResourceActivityFieldsFragmentDoc}`;
2402
- var GetSchoolDocument = import_client.gql`
2403
- query getSchool($_id: ID!) {
2404
- school(_id: $_id) {
2405
- school {
2406
- ...SchoolFields
2407
- }
2408
- users {
2409
- ...SchoolRegisteredUsersFields
2410
- }
2411
- }
2412
- }
2413
- ${SchoolFieldsFragmentDoc}
2414
- ${SchoolRegisteredUsersFieldsFragmentDoc}`;
2415
- var GetSchoolsDocument = import_client.gql`
2416
- query getSchools {
2417
- schools {
2418
- ...SchoolFields
2419
- }
2420
- }
2421
- ${SchoolFieldsFragmentDoc}`;
2422
- var GetEventBySlugDocument = import_client.gql`
2423
- query getEventBySlug($slug: String!) {
2424
- eventBySlug(slug: $slug) {
2425
- _id
2426
- }
2427
- }
2428
- `;
2429
- var GetVendorBySlugDocument = import_client.gql`
2430
- query getVendorBySlug($slug: String!) {
2431
- vendorBySlug(slug: $slug) {
2432
- _id
2433
- }
2434
- }
2435
- `;
2436
- var GetPartnerBySlugDocument = import_client.gql`
2437
- query getPartnerBySlug($slug: String!) {
2438
- partnerBySlug(slug: $slug) {
2439
- _id
2440
- }
2441
- }
2442
- `;
2443
- var GetPostBySlugDocument = import_client.gql`
2444
- query getPostBySlug($slug: String!, $postType: PostTypeEnum!) {
2445
- postBySlug(slug: $slug, postType: $postType) {
2446
- _id
2447
- }
2448
- }
2449
- `;
2450
- var GetSubscriptionStatusDocument = import_client.gql`
2451
- query getSubscriptionStatus {
2452
- getSubscriptionStatus {
2453
- subscriptionId
2454
- status
2455
- priceId
2456
- currentPlan
2457
- }
2458
- }
2459
- `;
2460
- var GetSubscriptionPlansDocument = import_client.gql`
2461
- query getSubscriptionPlans {
2462
- getSubscriptionPlans {
2463
- plans {
2464
- name
2465
- description
2466
- licenceType
2467
- billingPeriod
2468
- stripeProductId
2469
- stripePriceId
2470
- isEligibleForDiscount
2471
- pricing {
2472
- basePrice
2473
- discountedPrice
2474
- hasDiscount
2475
- discountPercent
2476
- discountAmount
2477
- currency
2478
- formattedBasePrice
2479
- formattedDiscountedPrice
2480
- }
2481
- }
2482
- isNewUser
2483
- isTester
2484
- appliedDiscountType
2485
- }
2486
- }
2487
- `;
2488
- var GetUsersDocument = import_client.gql`
2489
- query getUsers {
2490
- users {
2491
- ...UserFields
2492
- }
2493
- }
2494
- ${UserFieldsFragmentDoc}`;
2495
- var GetUserDocument = import_client.gql`
2496
- query getUser($_id: ID!) {
2497
- user(_id: $_id) {
2498
- ...UserFields
2499
- }
2500
- }
2501
- ${UserFieldsFragmentDoc}`;
2502
- var GetUserEventsDocument = import_client.gql`
2503
- query getUserEvents {
2504
- userEvents {
2505
- ...EventFields
2506
- }
2507
- }
2508
- ${EventFieldsFragmentDoc}`;
2509
- var GetUserVendorsDocument = import_client.gql`
2510
- query getUserVendors {
2511
- userVendors {
2512
- ...VendorFields
2513
- }
2514
- }
2515
- ${VendorFieldsFragmentDoc}`;
2516
- var GetUserPartnersDocument = import_client.gql`
2517
- query getUserPartners {
2518
- userPartners {
2519
- ...PartnerFields
2520
- }
2521
- }
2522
- ${PartnerFieldsFragmentDoc}`;
2523
- var GetUserActivitiesDocument = import_client.gql`
2524
- query getUserActivities {
2525
- userActivities {
2526
- favourites {
2527
- events {
2528
- ...EventListItemFields
2529
- }
2530
- partners {
2531
- ...PartnerFields
2532
- }
2533
- vendors {
2534
- ...VendorFields
2535
- }
2536
- }
2537
- going {
2538
- events {
2539
- ...EventListItemFields
2540
- }
2541
- }
2542
- interested {
2543
- events {
2544
- ...EventListItemFields
2545
- }
2546
- }
2547
- present {
2548
- events {
2549
- ...EventListItemFields
2550
- }
2551
- }
2552
- }
2553
- }
2554
- ${EventListItemFieldsFragmentDoc}
2555
- ${PartnerFieldsFragmentDoc}
2556
- ${VendorFieldsFragmentDoc}`;
2557
- var GetUserResourcesDocument = import_client.gql`
2558
- query getUserResources($userId: ID!) {
2559
- userResources(userId: $userId) {
2560
- resources {
2561
- _id
2562
- active
2563
- logo
2564
- name
2565
- resourceType
2566
- }
2567
- }
2568
- }
2569
- `;
2570
- var GetVendorsDocument = import_client.gql`
2571
- query getVendors {
2572
- vendors {
2573
- ...VendorFields
2574
- }
2575
- }
2576
- ${VendorFieldsFragmentDoc}`;
2577
- var GetVendorDocument = import_client.gql`
2578
- query getVendor($_id: ID!) {
2579
- vendor(_id: $_id) {
2580
- ...VendorFields
2581
- }
2582
- }
2583
- ${VendorFieldsFragmentDoc}`;
2584
- var GetVendorsByRegionDocument = import_client.gql`
2585
- query getVendorsByRegion($region: String!, $options: ResourcesByRegionOptions) {
2586
- vendorsByRegion(region: $region, options: $options) {
2587
- ...VendorFields
2588
- }
2589
- }
2590
- ${VendorFieldsFragmentDoc}`;
2591
- var SearchVendorsDocument = import_client.gql`
2592
- query searchVendors($search: String!, $region: String!) {
2593
- vendorSearch(search: $search, region: $region) {
2594
- ...VendorFields
2595
- }
2596
- }
2597
- ${VendorFieldsFragmentDoc}`;
2598
- var GetVendorInfoDocument = import_client.gql`
2599
- query getVendorInfo($vendorId: ID!) {
2600
- vendorInfo(vendorId: $vendorId) {
2601
- ...VendorInfoFields
2602
- }
2603
- }
2604
- ${VendorInfoFieldsFragmentDoc}`;
2605
- var GetUnregisteredVendorsDocument = import_client.gql`
2606
- query getUnregisteredVendors {
2607
- unregisteredVendors {
2608
- ...UnregisteredVendorFields
2609
- }
2610
- }
2611
- ${UnregisteredVendorFieldsFragmentDoc}`;
2612
- var GetUnregisteredVendorsByInviterIdDocument = import_client.gql`
2613
- query getUnregisteredVendorsByInviterId($inviterId: ID!) {
2614
- unregisteredVendorsByInviterId(inviterId: $inviterId) {
2615
- ...UnregisteredVendorFields
2616
- }
2617
- }
2618
- ${UnregisteredVendorFieldsFragmentDoc}`;
2619
- var GetUnregisteredVendorDocument = import_client.gql`
2620
- query getUnregisteredVendor($_id: ID!) {
2621
- unregisteredVendor(_id: $_id) {
2622
- ...UnregisteredVendorFields
2623
- }
2624
- }
2625
- ${UnregisteredVendorFieldsFragmentDoc}`;
2626
- var CreateRelationDocument = import_client.gql`
2627
- mutation createRelation($input: RelationInputType!) {
2628
- createRelation(input: $input) {
2629
- data {
2630
- ...RelationFields
2631
- }
2632
- message
2633
- }
2634
- }
2635
- ${RelationFieldsFragmentDoc}`;
2636
- var UpdateRelationDocument = import_client.gql`
2637
- mutation updateRelation($_id: ID!, $input: RelationInputType!) {
2638
- updateRelation(_id: $_id, input: $input) {
2639
- data {
2640
- ...RelationFields
2641
- }
2642
- message
2643
- }
2644
- }
2645
- ${RelationFieldsFragmentDoc}`;
2646
- var DeleteRelationDocument = import_client.gql`
2647
- mutation deleteRelation($_id: ID!) {
2648
- deleteRelation(_id: $_id) {
2649
- data {
2650
- ...RelationFields
2651
- }
2652
- message
2653
- }
2654
- }
2655
- ${RelationFieldsFragmentDoc}`;
2656
- var CreateResourceActivityDocument = import_client.gql`
2657
- mutation createResourceActivity($input: ResourceActivityInputType!) {
2658
- createResourceActivity(input: $input) {
2659
- data
2660
- message
2661
- }
2662
- }
2663
- `;
2664
- var CreateSchoolDocument = import_client.gql`
2665
- mutation createSchool($input: SchoolInputType!) {
2666
- createSchool(input: $input) {
2667
- data {
2668
- ...SchoolFields
2669
- }
2670
- message
2671
- }
2672
- }
2673
- ${SchoolFieldsFragmentDoc}`;
2674
- var UpdateSchoolDocument = import_client.gql`
2675
- mutation updateSchool($_id: ID!, $input: SchoolInputType!) {
2676
- updateSchool(_id: $_id, input: $input) {
2677
- data {
2678
- ...SchoolFields
2679
- }
2680
- message
2681
- }
2682
- }
2683
- ${SchoolFieldsFragmentDoc}`;
2684
- var DeleteSchoolDocument = import_client.gql`
2685
- mutation deleteSchool($_id: ID!) {
2686
- deleteSchool(_id: $_id) {
2687
- data
2688
- message
2689
- }
2690
- }
2691
- `;
2692
- var RequestMarketingMaterialDocument = import_client.gql`
2693
- mutation requestMarketingMaterial($input: MarketingMaterialRequestInputType!) {
2694
- requestMarketingMaterial(input: $input) {
2695
- data
2696
- message
2697
- }
2698
- }
2699
- `;
2700
- var CreateCheckoutSessionDocument = import_client.gql`
2701
- mutation createCheckoutSession($planId: LicencesEnumType!, $billingPeriod: BillingPeriodEnumType) {
2702
- createCheckoutSession(planId: $planId, billingPeriod: $billingPeriod) {
2703
- data {
2704
- sessionId
2705
- checkoutUrl
2706
- }
2707
- message
2708
- }
2709
- }
2710
- `;
2711
- var CancelSubscriptionDocument = import_client.gql`
2712
- mutation cancelSubscription {
2713
- cancelSubscription {
2714
- data
2715
- message
2716
- }
2717
- }
2718
- `;
2719
- var UpdateSubscriptionPlanDocument = import_client.gql`
2720
- mutation updateSubscriptionPlan($newPlanId: LicencesEnumType!, $billingPeriod: BillingPeriodEnumType) {
2721
- updateSubscriptionPlan(newPlanId: $newPlanId, billingPeriod: $billingPeriod) {
2722
- data {
2723
- subscriptionId
2724
- status
2725
- priceId
2726
- currentPlan
2727
- }
2728
- message
2729
- }
2730
- }
2731
- `;
2732
- var CreateCustomerPortalDocument = import_client.gql`
2733
- mutation createCustomerPortal($returnUrl: String) {
2734
- createCustomerPortal(returnUrl: $returnUrl) {
2735
- data {
2736
- portalUrl
2737
- }
2738
- message
2739
- }
2740
- }
2741
- `;
2742
- var UpdateUserDocument = import_client.gql`
2743
- mutation updateUser($_id: ID!, $input: UserInputType!) {
2744
- updateUser(_id: $_id, input: $input) {
2745
- data {
2746
- ...UserFields
2747
- }
2748
- message
2749
- }
2750
- }
2751
- ${UserFieldsFragmentDoc}`;
2752
- var DeleteUserDocument = import_client.gql`
2753
- mutation deleteUser($email: String!) {
2754
- deleteUser(email: $email) {
2755
- data
2756
- message
2757
- }
2758
- }
2759
- `;
2760
- var RedeemRewardDocument = import_client.gql`
2761
- mutation redeemReward($input: RedeemRewardInputType!) {
2762
- redeemReward(input: $input) {
2763
- data {
2764
- userId
2765
- }
2766
- message
2767
- }
2768
- }
2769
- `;
2770
- var AddUserFavouriteResourceDocument = import_client.gql`
2771
- mutation addUserFavouriteResource($resourceId: ID!, $resourceType: ResourceTypeEnum!) {
2772
- addUserFavouriteResource(resourceId: $resourceId, resourceType: $resourceType) {
2773
- data {
2774
- ...UserFields
2775
- }
2776
- message
2777
- }
2778
- }
2779
- ${UserFieldsFragmentDoc}`;
2780
- var RemoveUserFavouriteResourceDocument = import_client.gql`
2781
- mutation removeUserFavouriteResource($resourceId: ID!, $resourceType: ResourceTypeEnum!) {
2782
- removeUserFavouriteResource(
2783
- resourceId: $resourceId
2784
- resourceType: $resourceType
2785
- ) {
2786
- data {
2787
- ...UserFields
2788
- }
2789
- message
2790
- }
2791
- }
2792
- ${UserFieldsFragmentDoc}`;
2793
- var AddUserInterestResourceDocument = import_client.gql`
2794
- mutation addUserInterestResource($input: UserActivityInputType!) {
2795
- addUserInterestResource(input: $input) {
2796
- data {
2797
- ...UserFields
2798
- }
2799
- message
2800
- }
2801
- }
2802
- ${UserFieldsFragmentDoc}`;
2803
- var RemoveUserInterestResourceDocument = import_client.gql`
2804
- mutation removeUserInterestResource($input: UserActivityInputType!) {
2805
- removeUserInterestResource(input: $input) {
2806
- data {
2807
- ...UserFields
2808
- }
2809
- message
2810
- }
2811
- }
2812
- ${UserFieldsFragmentDoc}`;
2813
- var AddUserGoingResourceDocument = import_client.gql`
2814
- mutation addUserGoingResource($input: UserActivityInputType!) {
2815
- addUserGoingResource(input: $input) {
2816
- data {
2817
- ...UserFields
2818
- }
2819
- message
2820
- }
2821
- }
2822
- ${UserFieldsFragmentDoc}`;
2823
- var RemoveUserGoingResourceDocument = import_client.gql`
2824
- mutation removeUserGoingResource($input: UserActivityInputType!) {
2825
- removeUserGoingResource(input: $input) {
2826
- data {
2827
- ...UserFields
2828
- }
2829
- message
2830
- }
2831
- }
2832
- ${UserFieldsFragmentDoc}`;
2833
- var AddUserPresentResourceDocument = import_client.gql`
2834
- mutation addUserPresentResource($input: UserActivityInputType!) {
2835
- addUserPresentResource(input: $input) {
2836
- data {
2837
- ...UserFields
2838
- }
2839
- message
2840
- }
2841
- }
2842
- ${UserFieldsFragmentDoc}`;
2843
- var RemoveUserPresentResourceDocument = import_client.gql`
2844
- mutation removeUserPresentResource($input: UserActivityInputType!) {
2845
- removeUserPresentResource(input: $input) {
2846
- data {
2847
- ...UserFields
2848
- }
2849
- message
2850
- }
2851
- }
2852
- ${UserFieldsFragmentDoc}`;
2853
- var SelectStandardPackageDocument = import_client.gql`
2854
- mutation selectStandardPackage($selectedLicence: LicencesEnumType!) {
2855
- selectStandardPackage(selectedLicence: $selectedLicence) {
2856
- data {
2857
- licences {
2858
- ...LicenceFields
2859
- }
2860
- userId
2861
- }
2862
- message
2863
- }
2864
- }
2865
- ${LicenceFieldsFragmentDoc}`;
2866
- var CreateVendorDocument = import_client.gql`
2867
- mutation createVendor($input: VendorInputType!) {
2868
- createVendor(input: $input) {
2869
- data {
2870
- ...VendorFields
2871
- }
2872
- message
2873
- }
2874
- }
2875
- ${VendorFieldsFragmentDoc}`;
2876
- var UpdateVendorDocument = import_client.gql`
2877
- mutation updateVendor($_id: ID!, $input: VendorInputType!) {
2878
- updateVendor(_id: $_id, input: $input) {
2879
- data {
2880
- ...VendorFields
2881
- }
2882
- message
2883
- }
2884
- }
2885
- ${VendorFieldsFragmentDoc}`;
2886
- var DeleteVendorDocument = import_client.gql`
2887
- mutation deleteVendor($_id: ID!) {
2888
- deleteVendor(_id: $_id) {
2889
- data
2890
- message
2891
- }
2892
- }
2893
- `;
2894
- var CreateVendorInfoDocument = import_client.gql`
2895
- mutation createVendorInfo($input: VendorInfoInputType!) {
2896
- createVendorInfo(input: $input) {
2897
- data {
2898
- ...VendorInfoFields
2899
- }
2900
- message
2901
- }
2902
- }
2903
- ${VendorInfoFieldsFragmentDoc}`;
2904
- var UpdateVendorInfoDocument = import_client.gql`
2905
- mutation updateVendorInfo($_id: ID!, $input: VendorInfoInputType!) {
2906
- updateVendorInfo(_id: $_id, input: $input) {
2907
- data {
2908
- ...VendorInfoFields
2909
- }
2910
- message
2911
- }
2912
- }
2913
- ${VendorInfoFieldsFragmentDoc}`;
2914
- var CreateUnregisteredVendorDocument = import_client.gql`
2915
- mutation createUnregisteredVendor($input: UnregisteredVendorInputType!) {
2916
- createUnregisteredVendor(input: $input) {
2917
- data {
2918
- ...UnregisteredVendorFields
2919
- }
2920
- message
2921
- }
2922
- }
2923
- ${UnregisteredVendorFieldsFragmentDoc}`;
2924
- var UpdateUnregisteredVendorDocument = import_client.gql`
2925
- mutation updateUnregisteredVendor($_id: ID!, $input: UnregisteredVendorInputType!) {
2926
- updateUnregisteredVendor(_id: $_id, input: $input) {
2927
- data {
2928
- ...UnregisteredVendorFields
2929
- }
2930
- message
2931
- }
2932
- }
2933
- ${UnregisteredVendorFieldsFragmentDoc}`;
2934
- var DeleteUnregisteredVendorDocument = import_client.gql`
2935
- mutation deleteUnregisteredVendor($_id: ID!) {
2936
- deleteUnregisteredVendor(_id: $_id) {
2937
- data
2938
- message
2939
- }
2940
- }
2941
- `;
2942
- var UnlinkUnregisteredVendorByInviterIdDocument = import_client.gql`
2943
- mutation unlinkUnregisteredVendorByInviterId($_id: ID!, $inviterId: ID!) {
2944
- unlinkUnregisteredVendorByInviterId(_id: $_id, inviterId: $inviterId) {
2945
- data
2946
- message
2947
- }
2948
- }
2949
- `;
2950
- var GetChatMessageDocument = import_client.gql`
2951
- subscription GetChatMessage {
2952
- getChatMessage {
2953
- ...ChatFields
2954
- }
2955
- }
2956
- ${ChatFieldsFragmentDoc}`;
2957
- var UserNotificationsSubscriptionDocument = import_client.gql`
2958
- subscription UserNotificationsSubscription {
2959
- getUserNotifications {
2960
- ...NotificationFields
2961
- }
2962
- }
2963
- ${NotificationFieldsFragmentDoc}`;
2964
- var NotificationCountSubscriptionDocument = import_client.gql`
2965
- subscription NotificationCountSubscription {
2966
- getNotificationCount {
2967
- total
2968
- unread
2969
- }
2970
- }
2971
- `;
2972
-
2973
- // src/graphql/mutations/auth.ts
2974
- var REGISTER_MUTATION = import_client2.gql`
2975
- mutation register($input: RegisterInputType!) {
2976
- register(input: $input) {
2977
- data {
2978
- refreshToken
2979
- token
2980
- user {
2981
- ...UserFields
2982
- }
2983
- }
2984
- message
2985
- }
2986
- }
2987
- ${UserFieldsFragmentDoc}
2988
- `;
2989
- var LOGIN_MUTATION = import_client2.gql`
2990
- mutation login($input: LoginInputType!) {
2991
- login(input: $input) {
2992
- data {
2993
- refreshToken
2994
- token
2995
- user {
2996
- ...UserFields
2997
- }
2998
- }
2999
- message
3000
- }
3001
- }
3002
- ${UserFieldsFragmentDoc}
3003
- `;
3004
- var LOGOUT_MUTATION = import_client2.gql`
3005
- mutation logout {
3006
- logout {
3007
- data
3008
- message
3009
- }
3010
- }
3011
- `;
3012
- var REFRESH_TOKEN_MUTATION = import_client2.gql`
3013
- mutation refreshToken($input: RefreshTokenInputType!) {
3014
- refreshToken(input: $input) {
3015
- data {
3016
- refreshToken
3017
- token
3018
- }
3019
- message
3020
- }
3021
- }
3022
- `;
3023
- var RESET_PASSWORD_MUTATION = import_client2.gql`
3024
- mutation resetPassword($input: ResetPasswordInputType!) {
3025
- resetPassword(input: $input) {
3026
- data
3027
- message
3028
- }
3029
- }
3030
- `;
3031
- var REQUEST_PASSWORD_RESET_MUTATION = import_client2.gql`
3032
- mutation requestPasswordReset($input: RequestPasswordResetInputType!) {
3033
- requestPasswordReset(input: $input) {
3034
- data
3035
- message
3036
- }
3037
- }
3038
- `;
3039
- var VALIDATE_VERIFICATION_TOKEN_MUTATION = import_client2.gql`
3040
- mutation validateVerificationToken(
3041
- $input: ValidateVerificationTokenInputType!
3042
- ) {
3043
- validateVerificationToken(input: $input) {
3044
- data
3045
- message
3046
- }
3047
- }
3048
- `;
3049
-
3050
- // src/graphql/hooks/auth.ts
3051
- var useLogout = () => {
3052
- const [logout, { loading, error }] = (0, import_client3.useMutation)(LOGOUT_MUTATION);
3053
- return { error, loading, logout };
3054
- };
3055
-
3056
- // src/graphql/hooks/user/hooksQuery.ts
3057
- var import_client4 = require("@apollo/client");
3058
- var useGetUser = (_id) => {
3059
- const { loading, error, data, refetch } = (0, import_client4.useQuery)(
3060
- GetUserDocument,
3061
- {
3062
- fetchPolicy: "network-only",
3063
- skip: !_id || _id === "",
3064
- variables: { _id }
3065
- }
3066
- );
3067
- const user = data?.user;
3068
- return { error, loading, refetch, user };
3069
- };
3070
-
3071
- // src/storage/index.ts
3072
- var USER_STORAGE_KEY = "authUser";
3073
-
3074
- // src/types/userAdapters.ts
3075
- var PERMISSION_SET = new Set(PERMISSIONS);
3076
- function toUserPermissions(permissions) {
3077
- return permissions.filter(
3078
- (permission) => PERMISSION_SET.has(permission)
3079
- );
3080
- }
3081
-
3082
- // src/auth/useAuthCore.ts
3083
- function useAuthCore(adapters) {
3084
- const {
3085
- storage,
3086
- authManager,
3087
- afterLogout,
3088
- shouldCallLogoutMutation = () => true,
3089
- notifyLogoutSuccess,
3090
- notifySessionExpired,
3091
- onError
3092
- } = adapters;
3093
- const [authUser, setAuthUser] = (0, import_react.useState)(null);
3094
- const [isLoading, setIsLoading] = (0, import_react.useState)(true);
3095
- const userId = (0, import_react.useMemo)(() => authUser?._id ?? "", [authUser?._id]);
3096
- const { refetch } = useGetUser(userId);
3097
- const { logout, loading } = useLogout();
3098
- const handleSetAuthUser = (0, import_react.useCallback)(
3099
- async (user) => {
3100
- setAuthUser(user);
3101
- if (user) {
3102
- await storage.setItem(USER_STORAGE_KEY, JSON.stringify(user));
3103
- } else {
3104
- await storage.removeItem(USER_STORAGE_KEY);
3105
- }
3106
- },
3107
- [storage]
3108
- );
3109
- const handleRefetchUser = (0, import_react.useCallback)(async () => {
3110
- if (!authUser) return;
3111
- try {
3112
- const result = await refetch();
3113
- if (!result) return;
3114
- const { data } = result;
3115
- if (data?.user) await handleSetAuthUser(data.user);
3116
- } catch (error) {
3117
- onError?.(error, { action: "refetchUser" });
3118
- console.warn(
3119
- "Failed to refetch user:",
3120
- error instanceof Error ? error.message : error
3121
- );
3122
- }
3123
- }, [authUser, handleSetAuthUser, onError, refetch]);
3124
- const licences = (0, import_react.useCallback)(
3125
- (resourceId) => {
3126
- const myLicences = authUser?.licences?.map((licence) => licence.licenceType).filter((type) => type != null) ?? [];
3127
- const myResourceIds = [
3128
- authUser?.vendor ?? null,
3129
- authUser?.partner ?? null,
3130
- ...authUser?.events ?? []
3131
- ].filter((id) => id != null);
3132
- return myResourceIds.includes(resourceId) ? getLicenceFlagsByRole(myLicences) : NO_LICENCE_FLAGS;
3133
- },
3134
- [authUser]
3135
- );
3136
- const getLicenseAccessLevel = (0, import_react.useCallback)(
3137
- (limitType, resourceId, resourceType) => {
3138
- if (!isLicencedResourceType(resourceType)) {
3139
- return 0;
3140
- }
3141
- if (resourceId === "") {
3142
- return DEFAULT_LIMITS[limitType].pro;
3143
- }
3144
- const roleLicences = licences(resourceId)[resourceType];
3145
- if (roleLicences.pro_plus) return DEFAULT_LIMITS[limitType].pro_plus;
3146
- if (roleLicences.pro) return DEFAULT_LIMITS[limitType].pro;
3147
- if (roleLicences.standard) return DEFAULT_LIMITS[limitType].standard;
3148
- return 0;
3149
- },
3150
- [licences]
3151
- );
3152
- const hasVendorLicence = (0, import_react.useMemo)(
3153
- () => hasLicence(authUser, "vendor"),
3154
- [authUser]
3155
- );
3156
- const hasPartnerLicence = (0, import_react.useMemo)(
3157
- () => hasLicence(authUser, "partner"),
3158
- [authUser]
3159
- );
3160
- const hasEventLicence = (0, import_react.useMemo)(
3161
- () => hasLicence(authUser, "event"),
3162
- [authUser]
3163
- );
3164
- const hasUserLicence = (0, import_react.useCallback)(
3165
- (licenceType) => hasUserLicenceType(authUser, licenceType),
3166
- [authUser]
3167
- );
3168
- const permissions = (0, import_react.useMemo)(() => {
3169
- if (authUser?.permissions != null) {
3170
- return toUserPermissions(authUser.permissions);
3171
- }
3172
- return getPermissionsForRoles(authUser?.roles);
3173
- }, [authUser?.permissions, authUser?.roles]);
3174
- const hasPermissionFn = (0, import_react.useCallback)(
3175
- (permission) => permissionListIncludes(permissions, permission),
3176
- [permissions]
3177
- );
3178
- const hasRoleFn = (0, import_react.useCallback)(
3179
- (role) => hasRole(authUser?.roles, role),
3180
- [authUser?.roles]
3181
- );
3182
- const isAdmin = (0, import_react.useMemo)(
3183
- () => hasRole(authUser?.roles, "admin" /* Admin */) || permissionListIncludes(permissions, "dashboard.admin") || permissionListIncludes(permissions, "*"),
3184
- [authUser?.roles, permissions]
3185
- );
3186
- const isSuperAdmin = (0, import_react.useMemo)(
3187
- () => hasRole(authUser?.roles, "super_admin" /* SuperAdmin */),
3188
- [authUser?.roles]
3189
- );
3190
- const isAffiliate = (0, import_react.useMemo)(
3191
- () => hasRole(authUser?.roles, "affiliate" /* Affiliate */) && authUser?.affiliate !== null && authUser?.affiliate !== void 0,
3192
- [authUser?.roles, authUser?.affiliate]
3193
- );
3194
- const isSchool = (0, import_react.useMemo)(
3195
- () => hasRole(authUser?.roles, "school" /* School */) && authUser?.school !== null && authUser?.school !== void 0,
3196
- [authUser?.roles, authUser?.school]
3197
- );
3198
- (0, import_react.useEffect)(() => {
3199
- const loadUser = async () => {
3200
- try {
3201
- const userJson = await storage.getItem(USER_STORAGE_KEY);
3202
- await handleSetAuthUser(userJson ? JSON.parse(userJson) : null);
3203
- } catch (error) {
3204
- onError?.(error, { action: "loadUserFromStorage" });
3205
- console.error("Failed to load user from storage:", error);
3206
- } finally {
3207
- setIsLoading(false);
3208
- }
3209
- };
3210
- void loadUser();
3211
- }, []);
3212
- const logoutWithReason = (0, import_react.useCallback)(
3213
- async (reason) => {
3214
- try {
3215
- if (shouldCallLogoutMutation(reason)) {
3216
- try {
3217
- const result = await logout();
3218
- const message = result?.data?.logout?.message;
3219
- if (message) {
3220
- notifyLogoutSuccess?.(message);
3221
- }
3222
- } catch (err) {
3223
- onError?.(err, { action: "logout" });
3224
- console.warn("Logout request failed (ignored):", err);
3225
- }
3226
- }
3227
- } finally {
3228
- await afterLogout(reason);
3229
- setAuthUser(null);
3230
- await storage.removeItem(USER_STORAGE_KEY);
3231
- }
3232
- },
3233
- [
3234
- afterLogout,
3235
- logout,
3236
- notifyLogoutSuccess,
3237
- onError,
3238
- shouldCallLogoutMutation,
3239
- storage
3240
- ]
3241
- );
3242
- const handleLogoutExplicit = (0, import_react.useCallback)(
3243
- () => logoutWithReason("manual"),
3244
- [logoutWithReason]
3245
- );
3246
- const handleLogoutExpired = (0, import_react.useCallback)(async () => {
3247
- const hadSession = authUser != null;
3248
- if (!hadSession) return;
3249
- await logoutWithReason("expired");
3250
- notifySessionExpired?.();
3251
- }, [authUser, logoutWithReason, notifySessionExpired]);
3252
- (0, import_react.useEffect)(() => {
3253
- authManager.setLogout(() => handleLogoutExpired());
3254
- authManager.setUserRefetch(() => handleRefetchUser());
3255
- }, [authManager, handleLogoutExpired, handleRefetchUser]);
3256
- return {
3257
- authUser,
3258
- getLicenseAccessLevel,
3259
- handleLogoutExplicit,
3260
- hasEventLicence,
3261
- hasPartnerLicence,
3262
- hasPermission: hasPermissionFn,
3263
- hasRole: hasRoleFn,
3264
- hasUserLicence,
3265
- hasVendorLicence,
3266
- isAdmin,
3267
- isAffiliate,
3268
- isLoading: loading || isLoading,
3269
- isSchool,
3270
- isSuperAdmin,
3271
- permissions,
3272
- refetchUser: handleRefetchUser,
3273
- setUser: handleSetAuthUser
3274
- };
3275
- }
3276
-
3277
- // src/auth/UserProvider.tsx
3278
- var import_react2 = require("react");
3279
- var import_jsx_runtime = require("react/jsx-runtime");
3280
- var UserContext = (0, import_react2.createContext)(void 0);
3281
- var UserProvider = ({ children, value }) => {
3282
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserContext.Provider, { value, children });
3283
- };
3284
- var useAuthUser = () => {
3285
- const context = (0, import_react2.useContext)(UserContext);
3286
- if (!context) {
3287
- throw new Error("useAuthUser must be used within a UserProvider");
3288
- }
3289
- return context;
3290
- };
3291
- // Annotate the CommonJS export names for ESM import in node:
3292
- 0 && (module.exports = {
3293
- ADMIN_APP_ROLES,
3294
- ADMIN_DASHBOARD_CONTEXTS,
3295
- DEFAULT_LIMITS,
3296
- NO_LICENCE_FLAGS,
3297
- PERMISSIONS,
3298
- ROLE_PERMISSIONS,
3299
- UserProvider,
3300
- WILDCARD_PERMISSION,
3301
- canAccessAdminApp,
3302
- canAccessAdminPath,
3303
- createAuthManager,
3304
- getDefaultAdminHome,
3305
- getLicenceFlagsByRole,
3306
- getPermissionsForRoles,
3307
- getUsableAdminContexts,
3308
- hasAllPermissions,
3309
- hasAnyPermission,
3310
- hasAnyRole,
3311
- hasLicence,
3312
- hasPermission,
3313
- hasRole,
3314
- hasUserLicenceType,
3315
- isLicencedResourceType,
3316
- isProfileBadgeLicence,
3317
- permissionListIncludes,
3318
- resolveAdminContextFromPath,
3319
- useAuthCore,
3320
- useAuthUser
3321
- });
3322
- //# sourceMappingURL=index.cjs.map