@timardex/cluemart-shared 1.0.56 → 1.0.58

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.
@@ -134,7 +134,7 @@ type StallholderAttributes = {
134
134
  details?: string | null;
135
135
  isRequired: boolean;
136
136
  };
137
- type StallholderApplyFormFormData = {
137
+ type StallholderInfoFormData = {
138
138
  _id?: string;
139
139
  electricity: StallholderAttributes;
140
140
  foodSafetyGradeFiles?: string[] | null;
@@ -154,26 +154,26 @@ type StallholderApplyFormFormData = {
154
154
  };
155
155
  table: StallholderAttributes;
156
156
  };
157
- interface CreateStallholderApplyFormFormData {
158
- control: Control<StallholderApplyFormFormData, any>;
159
- fields: StallholderApplyFormFormData;
157
+ interface CreateStallholderInfoFormData {
158
+ control: Control<StallholderInfoFormData, any>;
159
+ fields: StallholderInfoFormData;
160
160
  formState: {
161
- errors: FieldErrors<StallholderApplyFormFormData>;
161
+ errors: FieldErrors<StallholderInfoFormData>;
162
162
  };
163
- handleSubmit: UseFormHandleSubmit<StallholderApplyFormFormData, any>;
164
- reset: UseFormReset<StallholderApplyFormFormData>;
165
- setValue: UseFormSetValue<StallholderApplyFormFormData>;
166
- watch: UseFormWatch<StallholderApplyFormFormData>;
163
+ handleSubmit: UseFormHandleSubmit<StallholderInfoFormData, any>;
164
+ reset: UseFormReset<StallholderInfoFormData>;
165
+ setValue: UseFormSetValue<StallholderInfoFormData>;
166
+ watch: UseFormWatch<StallholderInfoFormData>;
167
167
  }
168
168
  interface StallholderType extends BaseResourceType {
169
- applyFormId: string;
169
+ stallholderInfoId: string;
170
170
  categories: StallholderFormData["categories"];
171
171
  locations: StallholderLocation[] | null;
172
172
  multiLocation: boolean;
173
173
  products: StallholderFormData["products"];
174
174
  specialities: string[] | null;
175
175
  }
176
- type StallholderApplyFormType = Omit<StallholderApplyFormFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
176
+ type StallholderInfoType = Omit<StallholderInfoFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
177
177
  _id: string;
178
178
  };
179
179
  interface SatllholderWithConnectionDatesType extends StallholderType {
@@ -336,4 +336,4 @@ interface ResourceConnectionsType {
336
336
  stallholders: SatllholderWithConnectionDatesType[] | null;
337
337
  }
338
338
 
339
- export type { RelationDate as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderLocation as E, FormField as F, GeocodeLocation as G, StallholderAttributes as H, ImageObjectType as I, SatllholderWithConnectionDatesType as J, LocationType as L, MarketType as M, NotificationType 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, StallholderApplyFormType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderApplyFormFormData as i, CreateStallholderApplyFormFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, Nullable as q, ResourceImageType as r, SocialMediaType as s, BaseResourceType as t, Region as u, MapMultiLocation as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationLog as z };
339
+ export type { RelationDate as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderLocation as E, FormField as F, GeocodeLocation as G, StallholderAttributes as H, ImageObjectType as I, SatllholderWithConnectionDatesType as J, LocationType as L, MarketType as M, NotificationType 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, Nullable as q, ResourceImageType as r, SocialMediaType as s, BaseResourceType as t, Region as u, MapMultiLocation as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationLog as z };
@@ -134,7 +134,7 @@ type StallholderAttributes = {
134
134
  details?: string | null;
135
135
  isRequired: boolean;
136
136
  };
137
- type StallholderApplyFormFormData = {
137
+ type StallholderInfoFormData = {
138
138
  _id?: string;
139
139
  electricity: StallholderAttributes;
140
140
  foodSafetyGradeFiles?: string[] | null;
@@ -154,26 +154,26 @@ type StallholderApplyFormFormData = {
154
154
  };
155
155
  table: StallholderAttributes;
156
156
  };
157
- interface CreateStallholderApplyFormFormData {
158
- control: Control<StallholderApplyFormFormData, any>;
159
- fields: StallholderApplyFormFormData;
157
+ interface CreateStallholderInfoFormData {
158
+ control: Control<StallholderInfoFormData, any>;
159
+ fields: StallholderInfoFormData;
160
160
  formState: {
161
- errors: FieldErrors<StallholderApplyFormFormData>;
161
+ errors: FieldErrors<StallholderInfoFormData>;
162
162
  };
163
- handleSubmit: UseFormHandleSubmit<StallholderApplyFormFormData, any>;
164
- reset: UseFormReset<StallholderApplyFormFormData>;
165
- setValue: UseFormSetValue<StallholderApplyFormFormData>;
166
- watch: UseFormWatch<StallholderApplyFormFormData>;
163
+ handleSubmit: UseFormHandleSubmit<StallholderInfoFormData, any>;
164
+ reset: UseFormReset<StallholderInfoFormData>;
165
+ setValue: UseFormSetValue<StallholderInfoFormData>;
166
+ watch: UseFormWatch<StallholderInfoFormData>;
167
167
  }
168
168
  interface StallholderType extends BaseResourceType {
169
- applyFormId: string;
169
+ stallholderInfoId: string;
170
170
  categories: StallholderFormData["categories"];
171
171
  locations: StallholderLocation[] | null;
172
172
  multiLocation: boolean;
173
173
  products: StallholderFormData["products"];
174
174
  specialities: string[] | null;
175
175
  }
176
- type StallholderApplyFormType = Omit<StallholderApplyFormFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
176
+ type StallholderInfoType = Omit<StallholderInfoFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
177
177
  _id: string;
178
178
  };
179
179
  interface SatllholderWithConnectionDatesType extends StallholderType {
@@ -336,4 +336,4 @@ interface ResourceConnectionsType {
336
336
  stallholders: SatllholderWithConnectionDatesType[] | null;
337
337
  }
338
338
 
339
- export type { RelationDate as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderLocation as E, FormField as F, GeocodeLocation as G, StallholderAttributes as H, ImageObjectType as I, SatllholderWithConnectionDatesType as J, LocationType as L, MarketType as M, NotificationType 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, StallholderApplyFormType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderApplyFormFormData as i, CreateStallholderApplyFormFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, Nullable as q, ResourceImageType as r, SocialMediaType as s, BaseResourceType as t, Region as u, MapMultiLocation as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationLog as z };
339
+ export type { RelationDate as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderLocation as E, FormField as F, GeocodeLocation as G, StallholderAttributes as H, ImageObjectType as I, SatllholderWithConnectionDatesType as J, LocationType as L, MarketType as M, NotificationType 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, Nullable as q, ResourceImageType as r, SocialMediaType as s, BaseResourceType as t, Region as u, MapMultiLocation as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationLog as z };
@@ -29,7 +29,7 @@ __export(graphql_exports, {
29
29
  useCreatePoster: () => useCreatePoster,
30
30
  useCreateRelation: () => useCreateRelation,
31
31
  useCreateStallholder: () => useCreateStallholder,
32
- useCreateStallholderApplyForm: () => useCreateStallholderApplyForm,
32
+ useCreateStallholderInfo: () => useCreateStallholderInfo,
33
33
  useCreateTester: () => useCreateTester,
34
34
  useCreateUser: () => useCreateUser,
35
35
  useDeleteChat: () => useDeleteChat,
@@ -50,7 +50,7 @@ __export(graphql_exports, {
50
50
  useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
51
51
  useGetResourceConnections: () => useGetResourceConnections,
52
52
  useGetStallholder: () => useGetStallholder,
53
- useGetStallholderApplyForm: () => useGetStallholderApplyForm,
53
+ useGetStallholderInfo: () => useGetStallholderInfo,
54
54
  useGetStallholderRelations: () => useGetStallholderRelations,
55
55
  useGetStallholders: () => useGetStallholders,
56
56
  useGetStallholdersByRegion: () => useGetStallholdersByRegion,
@@ -78,7 +78,7 @@ __export(graphql_exports, {
78
78
  useUpdateMarketInfo: () => useUpdateMarketInfo,
79
79
  useUpdateRelation: () => useUpdateRelation,
80
80
  useUpdateStallholder: () => useUpdateStallholder,
81
- useUpdateStallholderApplyForm: () => useUpdateStallholderApplyForm,
81
+ useUpdateStallholderInfo: () => useUpdateStallholderInfo,
82
82
  useUpdateTester: () => useUpdateTester,
83
83
  useUpdateUser: () => useUpdateUser,
84
84
  useValidateVerificationToken: () => useValidateVerificationToken
@@ -706,8 +706,8 @@ var STALLHOLDER = import_client10.gql`
706
706
  ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
707
707
  ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
708
708
  `;
709
- var STALLHOLDER_APPLY_FORM = import_client10.gql`
710
- fragment StallholderApplyFormFields on StallholderApplyFormType {
709
+ var STALLHOLDER_INFO = import_client10.gql`
710
+ fragment StallholderInfoFields on StallholderInfoType {
711
711
  _id
712
712
  electricity {
713
713
  details
@@ -768,13 +768,13 @@ var SEARCH_STALLHOLDERS = import_client10.gql`
768
768
  }
769
769
  ${STALLHOLDER}
770
770
  `;
771
- var GET_STALLHOLDER_APPLY_FORM = import_client10.gql`
772
- query getStallholderApplyForm($stallholderId: ID!) {
773
- stallholderApplyForm(stallholderId: $stallholderId) {
774
- ...StallholderApplyFormFields
771
+ var GET_STALLHOLDER_INFO = import_client10.gql`
772
+ query getStallholderInfo($stallholderId: ID!) {
773
+ stallholderInfo(stallholderId: $stallholderId) {
774
+ ...StallholderInfoFields
775
775
  }
776
776
  }
777
- ${STALLHOLDER_APPLY_FORM}
777
+ ${STALLHOLDER_INFO}
778
778
  `;
779
779
 
780
780
  // src/graphql/queries/user.ts
@@ -936,8 +936,8 @@ var useGetMarketsByRegion = (region) => {
936
936
  skip: !region,
937
937
  variables: { region }
938
938
  });
939
- const markets = data?.marketsByRegion;
940
- return { error, loading, markets, refetch };
939
+ const marketsByRegion = data?.marketsByRegion;
940
+ return { error, loading, marketsByRegion, refetch };
941
941
  };
942
942
  var useSearchMarkets = (search, region) => {
943
943
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(SEARCH_MARKETS, {
@@ -945,8 +945,8 @@ var useSearchMarkets = (search, region) => {
945
945
  skip: search.length < 3,
946
946
  variables: { region, search }
947
947
  });
948
- const markets = data?.marketSearch;
949
- return { error, loading, markets, refetch };
948
+ const marketsSearch = data?.marketSearch;
949
+ return { error, loading, marketsSearch, refetch };
950
950
  };
951
951
  var useGetMarketsNearMe = (location) => {
952
952
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(GET_MARKETS_NEAR_ME, {
@@ -959,8 +959,8 @@ var useGetMarketsNearMe = (location) => {
959
959
  // Default to 10km if no radius is provided
960
960
  }
961
961
  });
962
- const markets = data?.marketsNearMe;
963
- return { error, loading, markets, refetch };
962
+ const marketsNearMe = data?.marketsNearMe;
963
+ return { error, loading, marketsNearMe, refetch };
964
964
  };
965
965
  var useGetMarketInfo = (marketId) => {
966
966
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(GET_MARKET_INFO, {
@@ -1314,6 +1314,9 @@ var useDeleteRelation = () => {
1314
1314
  {
1315
1315
  query: GET_RELATION_BY_MARKET_AND_STALLHOLDER,
1316
1316
  variables: { marketId, stallholderId }
1317
+ },
1318
+ {
1319
+ query: USER_CHATS
1317
1320
  }
1318
1321
  ];
1319
1322
  }
@@ -1401,24 +1404,21 @@ var DELETE_STALLHOLDER_MUTATION = import_client20.gql`
1401
1404
  deleteStallholder(_id: $_id)
1402
1405
  }
1403
1406
  `;
1404
- var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
1405
- mutation createStallholderApplyForm($input: StallholderApplyFormInputType!) {
1406
- createStallholderApplyForm(input: $input) {
1407
- ...StallholderApplyFormFields
1407
+ var CREATE_STALLHOLDER_INFO_MUTATION = import_client20.gql`
1408
+ mutation createStallholderInfo($input: StallholderInfoInputType!) {
1409
+ createStallholderInfo(input: $input) {
1410
+ ...StallholderInfoFields
1408
1411
  }
1409
1412
  }
1410
- ${STALLHOLDER_APPLY_FORM}
1413
+ ${STALLHOLDER_INFO}
1411
1414
  `;
1412
- var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
1413
- mutation updateStallholderApplyForm(
1414
- $_id: ID!
1415
- $input: StallholderApplyFormInputType!
1416
- ) {
1417
- updateStallholderApplyForm(_id: $_id, input: $input) {
1418
- ...StallholderApplyFormFields
1415
+ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client20.gql`
1416
+ mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
1417
+ updateStallholderInfo(_id: $_id, input: $input) {
1418
+ ...StallholderInfoFields
1419
1419
  }
1420
1420
  }
1421
- ${STALLHOLDER_APPLY_FORM}
1421
+ ${STALLHOLDER_INFO}
1422
1422
  `;
1423
1423
 
1424
1424
  // src/graphql/hooks/stallholder/hooksMutation.ts
@@ -1461,17 +1461,17 @@ var useDeleteStallholder = () => {
1461
1461
  );
1462
1462
  return { deleteStallholder, error, loading };
1463
1463
  };
1464
- var useCreateStallholderApplyForm = () => {
1465
- const [createStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
1466
- CREATE_STALLHOLDER_APPLY_FORM_MUTATION,
1464
+ var useCreateStallholderInfo = () => {
1465
+ const [createStallholderInfo, { loading, error }] = (0, import_client21.useMutation)(
1466
+ CREATE_STALLHOLDER_INFO_MUTATION,
1467
1467
  {
1468
1468
  awaitRefetchQueries: true,
1469
1469
  refetchQueries: (mutationResult) => {
1470
- const stallholderId = mutationResult?.data?.createStallholderApplyForm?.stallholderId;
1470
+ const stallholderId = mutationResult?.data?.createStallholderInfo?.stallholderId;
1471
1471
  if (!stallholderId) return [];
1472
1472
  return [
1473
1473
  {
1474
- query: GET_STALLHOLDER_APPLY_FORM,
1474
+ query: GET_STALLHOLDER_INFO,
1475
1475
  variables: { stallholderId }
1476
1476
  // Pass the stallholderId for refetching
1477
1477
  }
@@ -1479,19 +1479,19 @@ var useCreateStallholderApplyForm = () => {
1479
1479
  }
1480
1480
  }
1481
1481
  );
1482
- return { createStallholderApplyForm, error, loading };
1482
+ return { createStallholderInfo, error, loading };
1483
1483
  };
1484
- var useUpdateStallholderApplyForm = () => {
1485
- const [updateStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
1486
- UPDATE_STALLHOLDER_APPLY_FORM_MUTATION,
1484
+ var useUpdateStallholderInfo = () => {
1485
+ const [updateStallholderInfo, { loading, error }] = (0, import_client21.useMutation)(
1486
+ UPDATE_STALLHOLDER_INFO_MUTATION,
1487
1487
  {
1488
1488
  awaitRefetchQueries: true,
1489
1489
  refetchQueries: (mutationResult) => {
1490
- const stallholderId = mutationResult?.data?.createStallholderApplyForm?.stallholderId;
1490
+ const stallholderId = mutationResult?.data?.updateStallholderInfo?.stallholderId;
1491
1491
  if (!stallholderId) return [];
1492
1492
  return [
1493
1493
  {
1494
- query: GET_STALLHOLDER_APPLY_FORM,
1494
+ query: GET_STALLHOLDER_INFO,
1495
1495
  variables: { stallholderId }
1496
1496
  // Pass the stallholderId for refetching
1497
1497
  }
@@ -1499,7 +1499,7 @@ var useUpdateStallholderApplyForm = () => {
1499
1499
  }
1500
1500
  }
1501
1501
  );
1502
- return { error, loading, updateStallholderApplyForm };
1502
+ return { error, loading, updateStallholderInfo };
1503
1503
  };
1504
1504
 
1505
1505
  // src/graphql/hooks/stallholder/hooksQuery.ts
@@ -1534,8 +1534,8 @@ var useGetStallholdersByRegion = (region) => {
1534
1534
  variables: { region }
1535
1535
  }
1536
1536
  );
1537
- const stallholders = data?.stallholdersByRegion;
1538
- return { error, loading, refetch, stallholders };
1537
+ const stallholdersByRegion = data?.stallholdersByRegion;
1538
+ return { error, loading, refetch, stallholdersByRegion };
1539
1539
  };
1540
1540
  var useSearchStallholders = (search, region) => {
1541
1541
  const { loading, error, data, refetch } = (0, import_client22.useQuery)(SEARCH_STALLHOLDERS, {
@@ -1543,24 +1543,21 @@ var useSearchStallholders = (search, region) => {
1543
1543
  skip: search.length < 3,
1544
1544
  variables: { region, search }
1545
1545
  });
1546
- const stallholders = data?.stallholderSearch;
1547
- return { error, loading, refetch, stallholders };
1546
+ const stallholderSearch = data?.stallholderSearch;
1547
+ return { error, loading, refetch, stallholderSearch };
1548
1548
  };
1549
- var useGetStallholderApplyForm = (stallholderId) => {
1550
- const { loading, error, data, refetch } = (0, import_client22.useQuery)(
1551
- GET_STALLHOLDER_APPLY_FORM,
1552
- {
1553
- fetchPolicy: "network-only",
1554
- skip: !stallholderId,
1555
- variables: { stallholderId }
1556
- }
1557
- );
1558
- const applyForm = data?.stallholderApplyForm;
1549
+ var useGetStallholderInfo = (stallholderId) => {
1550
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(GET_STALLHOLDER_INFO, {
1551
+ fetchPolicy: "network-only",
1552
+ skip: !stallholderId,
1553
+ variables: { stallholderId }
1554
+ });
1555
+ const stallholderInfo = data?.stallholderInfo;
1559
1556
  return {
1560
- applyForm,
1561
1557
  error,
1562
1558
  loading,
1563
- refetch
1559
+ refetch,
1560
+ stallholderInfo
1564
1561
  };
1565
1562
  };
1566
1563
 
@@ -1909,7 +1906,7 @@ var useContactUs = () => {
1909
1906
  useCreatePoster,
1910
1907
  useCreateRelation,
1911
1908
  useCreateStallholder,
1912
- useCreateStallholderApplyForm,
1909
+ useCreateStallholderInfo,
1913
1910
  useCreateTester,
1914
1911
  useCreateUser,
1915
1912
  useDeleteChat,
@@ -1930,7 +1927,7 @@ var useContactUs = () => {
1930
1927
  useGetRelationByMarketAndStallholder,
1931
1928
  useGetResourceConnections,
1932
1929
  useGetStallholder,
1933
- useGetStallholderApplyForm,
1930
+ useGetStallholderInfo,
1934
1931
  useGetStallholderRelations,
1935
1932
  useGetStallholders,
1936
1933
  useGetStallholdersByRegion,
@@ -1958,7 +1955,7 @@ var useContactUs = () => {
1958
1955
  useUpdateMarketInfo,
1959
1956
  useUpdateRelation,
1960
1957
  useUpdateStallholder,
1961
- useUpdateStallholderApplyForm,
1958
+ useUpdateStallholderInfo,
1962
1959
  useUpdateTester,
1963
1960
  useUpdateUser,
1964
1961
  useValidateVerificationToken