@timardex/cluemart-shared 1.0.93 → 1.0.95

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.
@@ -1,4 +1,4 @@
1
- import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-Bieh1fh8.mjs';
1
+ import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-D5MQQdDQ.mjs';
2
2
  import '../enums/index.mjs';
3
3
  import 'react-hook-form';
4
4
 
@@ -1,4 +1,4 @@
1
- import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-By7aHQ1y.js';
1
+ import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-NGrcgZDJ.js';
2
2
  import '../enums/index.js';
3
3
  import 'react-hook-form';
4
4
 
@@ -1,4 +1,4 @@
1
- import { EnumResourceType, EnumInviteStatus, EnumRelationResource, EnumPaymentMethod, EnumUserLicence, EnumUserRole, EnumSocialMedia } from './enums/index.mjs';
1
+ import { EnumResourceType, EnumInviteStatus, EnumRelationResource, EnumPaymentMethod, EnumSocialMedia } from './enums/index.mjs';
2
2
  import { Control, FieldErrors, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
3
3
 
4
4
  type RelationDate = {
@@ -169,52 +169,6 @@ interface SatllholderWithConnectionDatesType extends StallholderType {
169
169
  relationDates: RelationDate[] | undefined;
170
170
  }
171
171
 
172
- type UserFormData = {
173
- _id?: string;
174
- active: boolean;
175
- avatar?: ResourceImageType | null;
176
- avatarUpload?: ResourceImageType | null;
177
- confirmPassword: string;
178
- email: string;
179
- firstName: string;
180
- lastName: string;
181
- password: string;
182
- preferredRegion: string;
183
- role: EnumUserRole;
184
- };
185
- interface CreateUserFormData {
186
- control: Control<UserFormData, any>;
187
- fields: UserFormData;
188
- formState: {
189
- errors: FieldErrors<UserFormData>;
190
- };
191
- handleSubmit: UseFormHandleSubmit<UserFormData, any>;
192
- reset: UseFormReset<UserFormData>;
193
- setValue: UseFormSetValue<UserFormData>;
194
- watch: UseFormWatch<UserFormData>;
195
- }
196
- interface UserType {
197
- _id: string;
198
- active: boolean;
199
- avatar: ResourceImageType | null;
200
- createdAt: string;
201
- email: string;
202
- favourites: {
203
- markets: string[];
204
- stallholders: string[];
205
- };
206
- firstName: string;
207
- lastName: string;
208
- licences: EnumUserLicence[] | null;
209
- markets: string[] | null;
210
- password: string;
211
- preferredRegion: string;
212
- refreshToken: string | null;
213
- role: EnumUserRole;
214
- stallholder: string | null;
215
- updatedAt: string;
216
- }
217
-
218
172
  type Nullable<T> = {
219
173
  [K in keyof T]: T[K] | null | undefined;
220
174
  };
@@ -241,10 +195,17 @@ interface BaseResourceTypeFormData {
241
195
  region: string;
242
196
  socialMedia?: SocialMediaType[] | null;
243
197
  }
198
+ type OwnerType = {
199
+ _id: string;
200
+ avatar: string | null;
201
+ email: string;
202
+ licences: string[];
203
+ name: string;
204
+ };
244
205
  type BaseResourceType = Omit<BaseResourceTypeFormData, "_id" | "coverUpload" | "imagesUpload" | "logoUpload"> & {
245
206
  _id: string;
246
207
  createdAt: string;
247
- owner: Pick<UserType, "_id" | "email" | "licences">;
208
+ owner: OwnerType;
248
209
  relationIds: string[] | null;
249
210
  updatedAt: string;
250
211
  };
@@ -324,4 +285,4 @@ interface ResourceConnectionsType {
324
285
  stallholders: SatllholderWithConnectionDatesType[] | null;
325
286
  }
326
287
 
327
- export type { StallholderLocation as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderAttributes as E, FormField as F, GeocodeLocation as G, SatllholderWithConnectionDatesType as H, ImageObjectType as I, LocationType as L, MarketType as M, Nullable as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, UserType as U, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderInfoType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderInfoFormData as i, CreateStallholderInfoFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, ResourceImageType as q, SocialMediaType as r, BaseResourceType as s, Region as t, MapMultiLocation as u, SubcategoryItems as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationDate as z };
288
+ export type { StallholderAttributes as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, SatllholderWithConnectionDatesType as E, FormField as F, GeocodeLocation as G, ImageObjectType as I, LocationType as L, MarketType as M, Nullable as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderInfoType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderInfoFormData as i, CreateStallholderInfoFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, ResourceImageType as o, SocialMediaType as p, OwnerType as q, BaseResourceType as r, Region as s, MapMultiLocation as t, SubcategoryItems as u, Subcategory as v, DateTimeWithPriceType as w, MarketWithConnectionDatesType as x, RelationDate as y, StallholderLocation as z };
@@ -1,4 +1,4 @@
1
- import { EnumResourceType, EnumInviteStatus, EnumRelationResource, EnumPaymentMethod, EnumUserLicence, EnumUserRole, EnumSocialMedia } from './enums/index.js';
1
+ import { EnumResourceType, EnumInviteStatus, EnumRelationResource, EnumPaymentMethod, EnumSocialMedia } from './enums/index.js';
2
2
  import { Control, FieldErrors, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
3
3
 
4
4
  type RelationDate = {
@@ -169,52 +169,6 @@ interface SatllholderWithConnectionDatesType extends StallholderType {
169
169
  relationDates: RelationDate[] | undefined;
170
170
  }
171
171
 
172
- type UserFormData = {
173
- _id?: string;
174
- active: boolean;
175
- avatar?: ResourceImageType | null;
176
- avatarUpload?: ResourceImageType | null;
177
- confirmPassword: string;
178
- email: string;
179
- firstName: string;
180
- lastName: string;
181
- password: string;
182
- preferredRegion: string;
183
- role: EnumUserRole;
184
- };
185
- interface CreateUserFormData {
186
- control: Control<UserFormData, any>;
187
- fields: UserFormData;
188
- formState: {
189
- errors: FieldErrors<UserFormData>;
190
- };
191
- handleSubmit: UseFormHandleSubmit<UserFormData, any>;
192
- reset: UseFormReset<UserFormData>;
193
- setValue: UseFormSetValue<UserFormData>;
194
- watch: UseFormWatch<UserFormData>;
195
- }
196
- interface UserType {
197
- _id: string;
198
- active: boolean;
199
- avatar: ResourceImageType | null;
200
- createdAt: string;
201
- email: string;
202
- favourites: {
203
- markets: string[];
204
- stallholders: string[];
205
- };
206
- firstName: string;
207
- lastName: string;
208
- licences: EnumUserLicence[] | null;
209
- markets: string[] | null;
210
- password: string;
211
- preferredRegion: string;
212
- refreshToken: string | null;
213
- role: EnumUserRole;
214
- stallholder: string | null;
215
- updatedAt: string;
216
- }
217
-
218
172
  type Nullable<T> = {
219
173
  [K in keyof T]: T[K] | null | undefined;
220
174
  };
@@ -241,10 +195,17 @@ interface BaseResourceTypeFormData {
241
195
  region: string;
242
196
  socialMedia?: SocialMediaType[] | null;
243
197
  }
198
+ type OwnerType = {
199
+ _id: string;
200
+ avatar: string | null;
201
+ email: string;
202
+ licences: string[];
203
+ name: string;
204
+ };
244
205
  type BaseResourceType = Omit<BaseResourceTypeFormData, "_id" | "coverUpload" | "imagesUpload" | "logoUpload"> & {
245
206
  _id: string;
246
207
  createdAt: string;
247
- owner: Pick<UserType, "_id" | "email" | "licences">;
208
+ owner: OwnerType;
248
209
  relationIds: string[] | null;
249
210
  updatedAt: string;
250
211
  };
@@ -324,4 +285,4 @@ interface ResourceConnectionsType {
324
285
  stallholders: SatllholderWithConnectionDatesType[] | null;
325
286
  }
326
287
 
327
- export type { StallholderLocation as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderAttributes as E, FormField as F, GeocodeLocation as G, SatllholderWithConnectionDatesType as H, ImageObjectType as I, LocationType as L, MarketType as M, Nullable as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, UserType as U, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderInfoType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderInfoFormData as i, CreateStallholderInfoFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, ResourceImageType as q, SocialMediaType as r, BaseResourceType as s, Region as t, MapMultiLocation as u, SubcategoryItems as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationDate as z };
288
+ export type { StallholderAttributes as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, SatllholderWithConnectionDatesType as E, FormField as F, GeocodeLocation as G, ImageObjectType as I, LocationType as L, MarketType as M, Nullable as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderInfoType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderInfoFormData as i, CreateStallholderInfoFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, ResourceImageType as o, SocialMediaType as p, OwnerType as q, BaseResourceType as r, Region as s, MapMultiLocation as t, SubcategoryItems as u, Subcategory as v, DateTimeWithPriceType as w, MarketWithConnectionDatesType as x, RelationDate as y, StallholderLocation as z };
@@ -25,7 +25,6 @@ __export(graphql_exports, {
25
25
  useAdminUpdateResourceType: () => useAdminUpdateResourceType,
26
26
  useContactUs: () => useContactUs,
27
27
  useCreateBulkNotifications: () => useCreateBulkNotifications,
28
- useCreateChat: () => useCreateChat,
29
28
  useCreateMarket: () => useCreateMarket,
30
29
  useCreateMarketInfo: () => useCreateMarketInfo,
31
30
  useCreatePoster: () => useCreatePoster,
@@ -129,8 +128,10 @@ var RESOURCE_IMAGE_FIELDS_FRAGMENT = import_client2.gql`
129
128
  var OWNER_FIELDS_FRAGMENT = import_client2.gql`
130
129
  fragment OwnerFields on OwnerType {
131
130
  _id
131
+ avatar
132
132
  email
133
133
  licences
134
+ name
134
135
  }
135
136
  `;
136
137
  var CATEGORY_FIELDS_FRAGMENT = import_client2.gql`
@@ -622,13 +623,12 @@ var CHAT_FIELDS_FRAGMENT = import_client8.gql`
622
623
  }
623
624
  name
624
625
  participants {
625
- userId
626
- userName
627
- userAvatar
626
+ ...OwnerFields
628
627
  }
629
628
  updatedAt
630
629
  }
631
630
  ${CHAT_MESSAGE_FIELDS_FRAGMENT}
631
+ ${OWNER_FIELDS_FRAGMENT}
632
632
  `;
633
633
  var CHAT = import_client8.gql`
634
634
  query chat($_id: ID!) {
@@ -656,14 +656,6 @@ var GET_CHAT_MESSAGE = import_client8.gql`
656
656
  `;
657
657
 
658
658
  // src/graphql/mutations/chat.ts
659
- var CREATE_CHAT_MUTATION = import_client9.gql`
660
- mutation createChat($input: ChatInputType!) {
661
- createChat(input: $input) {
662
- ...ChatFields
663
- }
664
- }
665
- ${CHAT_FIELDS_FRAGMENT}
666
- `;
667
659
  var SEND_CHAT_MESSAGE_MUTATION = import_client9.gql`
668
660
  mutation sendChatMessage($_id: ID!, $input: ChatMessageInputType!) {
669
661
  sendChatMessage(_id: $_id, input: $input) {
@@ -695,25 +687,6 @@ var REMOVE_PARTICIPANT_FROM_CHAT_MUTATION = import_client9.gql`
695
687
  `;
696
688
 
697
689
  // src/graphql/hooks/chat/hooksMutation.ts
698
- var useCreateChat = () => {
699
- const [createChat, { loading, error }] = (0, import_client10.useMutation)(CREATE_CHAT_MUTATION, {
700
- awaitRefetchQueries: true,
701
- refetchQueries: (mutationResult) => {
702
- const chatId = mutationResult?.data?.createChat?._id;
703
- return [
704
- {
705
- query: USER_CHATS,
706
- variables: { userId: mutationResult?.data?.createChat?.userId }
707
- },
708
- {
709
- query: CHAT,
710
- variables: { _id: chatId }
711
- }
712
- ];
713
- }
714
- });
715
- return { createChat, error, loading };
716
- };
717
690
  var useSendChatMessage = () => {
718
691
  const [sendChatMessage, { loading, error }] = (0, import_client10.useMutation)(
719
692
  SEND_CHAT_MESSAGE_MUTATION,
@@ -2119,7 +2092,6 @@ var useGetUserFavourites = () => {
2119
2092
  useAdminUpdateResourceType,
2120
2093
  useContactUs,
2121
2094
  useCreateBulkNotifications,
2122
- useCreateChat,
2123
2095
  useCreateMarket,
2124
2096
  useCreateMarketInfo,
2125
2097
  useCreatePoster,