@timardex/cluemart-shared 1.4.64 → 1.4.65

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 (49) hide show
  1. package/dist/{auth-tx3-QbA9.d.mts → auth-DP4rp8kt.d.mts} +1 -1
  2. package/dist/{auth-n3P2BSCb.d.ts → auth-x87uDA8A.d.ts} +1 -1
  3. package/dist/{chunk-END7A5PN.mjs → chunk-D4QRASAQ.mjs} +1 -1
  4. package/dist/chunk-D4QRASAQ.mjs.map +1 -0
  5. package/dist/{chunk-IN5G5WAE.mjs → chunk-DY47LWPZ.mjs} +2 -2
  6. package/dist/{chunk-ONMJIUN6.mjs → chunk-NBMLTBYC.mjs} +10 -14
  7. package/dist/{chunk-ONMJIUN6.mjs.map → chunk-NBMLTBYC.mjs.map} +1 -1
  8. package/dist/{chunk-5V6JNIPQ.mjs → chunk-WKBWAH6Y.mjs} +3 -3
  9. package/dist/{chunk-5V6JNIPQ.mjs.map → chunk-WKBWAH6Y.mjs.map} +1 -1
  10. package/dist/formFields/index.cjs +2 -2
  11. package/dist/formFields/index.cjs.map +1 -1
  12. package/dist/formFields/index.d.mts +1 -1
  13. package/dist/formFields/index.d.ts +1 -1
  14. package/dist/formFields/index.mjs +2 -2
  15. package/dist/{global-DVDoQmBT.d.ts → global-Cdcu76UE.d.ts} +1 -1
  16. package/dist/{global-BCvKcmiT.d.mts → global-GMlnFp7I.d.mts} +1 -1
  17. package/dist/graphql/index.cjs +9 -13
  18. package/dist/graphql/index.cjs.map +1 -1
  19. package/dist/graphql/index.d.mts +3 -3
  20. package/dist/graphql/index.d.ts +3 -3
  21. package/dist/graphql/index.mjs +1 -1
  22. package/dist/hooks/index.cjs +54 -102
  23. package/dist/hooks/index.cjs.map +1 -1
  24. package/dist/hooks/index.d.mts +3 -3
  25. package/dist/hooks/index.d.ts +3 -3
  26. package/dist/hooks/index.mjs +33 -77
  27. package/dist/hooks/index.mjs.map +1 -1
  28. package/dist/index.cjs +54 -102
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.mts +12 -13
  31. package/dist/index.d.ts +12 -13
  32. package/dist/index.mjs +54 -102
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/{post-CvS5wUjm.d.mts → post-CP-lCMe6.d.mts} +13 -14
  35. package/dist/{post-ByxIVi36.d.ts → post-LlElRzUr.d.ts} +13 -14
  36. package/dist/{resourceActivities-UOB8Bo7j.d.ts → resourceActivities-Qpi5PTJD.d.ts} +1 -1
  37. package/dist/{resourceActivities-BKd6q2ey.d.mts → resourceActivities-sdIDFwub.d.mts} +1 -1
  38. package/dist/types/index.cjs.map +1 -1
  39. package/dist/types/index.d.mts +5 -5
  40. package/dist/types/index.d.ts +5 -5
  41. package/dist/types/index.mjs +1 -1
  42. package/dist/utils/index.cjs +2 -2
  43. package/dist/utils/index.cjs.map +1 -1
  44. package/dist/utils/index.d.mts +1 -1
  45. package/dist/utils/index.d.ts +1 -1
  46. package/dist/utils/index.mjs +1 -1
  47. package/package.json +1 -1
  48. package/dist/chunk-END7A5PN.mjs.map +0 -1
  49. /package/dist/{chunk-IN5G5WAE.mjs.map → chunk-DY47LWPZ.mjs.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
2
  import { EnumResourceType } from '../enums/index.mjs';
3
- import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-BKd6q2ey.mjs';
4
- import { E as EventType, c as EventListItemType, d as EventInfoType, e as RelationType, f as ResourceConnectionsType, U as UnregisteredVendorType, V as VendorType, g as VendorInfoType, h as UserLicenceType } from '../global-BCvKcmiT.mjs';
5
- import { U as UserType, P as PartnerType, R as ResourceByUser, A as AdType, E as EnumAdStatus, S as SubscriptionPlansResponse, a as SubscriptionStatusData, b as PostType, c as EnumPostType, d as AppSettingsType } from '../post-CvS5wUjm.mjs';
3
+ import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-sdIDFwub.mjs';
4
+ import { E as EventType, c as EventListItemType, d as EventInfoType, e as RelationType, f as ResourceConnectionsType, U as UnregisteredVendorType, V as VendorType, g as VendorInfoType, h as UserLicenceType } from '../global-GMlnFp7I.mjs';
5
+ import { U as UserType, P as PartnerType, R as ResourceByUser, A as AdType, E as EnumAdStatus, S as SubscriptionPlansResponse, a as SubscriptionStatusData, b as PostType, c as EnumPostType, d as AppSettingsType } from '../post-CP-lCMe6.mjs';
6
6
  import 'react-hook-form';
7
7
 
8
8
  declare const useAdminUpdateResourceType: () => {
@@ -1,8 +1,8 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
2
  import { EnumResourceType } from '../enums/index.js';
3
- import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-UOB8Bo7j.js';
4
- import { E as EventType, c as EventListItemType, d as EventInfoType, e as RelationType, f as ResourceConnectionsType, U as UnregisteredVendorType, V as VendorType, g as VendorInfoType, h as UserLicenceType } from '../global-DVDoQmBT.js';
5
- import { U as UserType, P as PartnerType, R as ResourceByUser, A as AdType, E as EnumAdStatus, S as SubscriptionPlansResponse, a as SubscriptionStatusData, b as PostType, c as EnumPostType, d as AppSettingsType } from '../post-ByxIVi36.js';
3
+ import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-Qpi5PTJD.js';
4
+ import { E as EventType, c as EventListItemType, d as EventInfoType, e as RelationType, f as ResourceConnectionsType, U as UnregisteredVendorType, V as VendorType, g as VendorInfoType, h as UserLicenceType } from '../global-Cdcu76UE.js';
5
+ import { U as UserType, P as PartnerType, R as ResourceByUser, A as AdType, E as EnumAdStatus, S as SubscriptionPlansResponse, a as SubscriptionStatusData, b as PostType, c as EnumPostType, d as AppSettingsType } from '../post-LlElRzUr.js';
6
6
  import 'react-hook-form';
7
7
 
8
8
  declare const useAdminUpdateResourceType: () => {
@@ -120,7 +120,7 @@ import {
120
120
  useUpdateVendor,
121
121
  useUpdateVendorInfo,
122
122
  useValidateVerificationToken
123
- } from "../chunk-ONMJIUN6.mjs";
123
+ } from "../chunk-NBMLTBYC.mjs";
124
124
  import "../chunk-LDO4DRWY.mjs";
125
125
  export {
126
126
  useAddParticipantToChat,
@@ -317,8 +317,8 @@ var licenseNiceNames = {
317
317
  ["pro_vendor" /* PRO_VENDOR */]: "Pro Stallholder",
318
318
  ["standard_event" /* STANDARD_EVENT */]: "Standard Event",
319
319
  ["standard_vendor" /* STANDARD_VENDOR */]: "Standard Stallholder",
320
- ["pro_plus_event" /* PRO_PLUS_EVENT */]: "Pro+ Event",
321
- ["pro_plus_vendor" /* PRO_PLUS_VENDOR */]: "Pro+ Stallholder",
320
+ ["pro_plus_event" /* PRO_PLUS_EVENT */]: "Pro+Ads Event",
321
+ ["pro_plus_vendor" /* PRO_PLUS_VENDOR */]: "Pro+Ads Stallholder",
322
322
  ["standard_partner" /* STANDARD_PARTNER */]: "Partner"
323
323
  };
324
324
  var cluemartSocialMedia = [
@@ -797,12 +797,12 @@ var validateVerificationTokenSchema = yup5.object().shape({
797
797
  var yup6 = __toESM(require("yup"));
798
798
 
799
799
  // src/types/ad.ts
800
- var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
801
- EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
802
- EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
803
- EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
804
- EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
805
- return EnumAdShowOn2;
800
+ var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn3) => {
801
+ EnumAdShowOn3["EVENTS_PAGE"] = "Events_page";
802
+ EnumAdShowOn3["FRONT_PAGE"] = "Front_page";
803
+ EnumAdShowOn3["PARTNERS_PAGE"] = "Partners_page";
804
+ EnumAdShowOn3["VENDORS_PAGE"] = "Vendors_page";
805
+ return EnumAdShowOn3;
806
806
  })(EnumAdShowOn || {});
807
807
  var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
808
808
  EnumAdStatus2["ACTIVE"] = "Active";
@@ -810,23 +810,20 @@ var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
810
810
  EnumAdStatus2["EXPIRED"] = "Expired";
811
811
  return EnumAdStatus2;
812
812
  })(EnumAdStatus || {});
813
- var EnumAdType = /* @__PURE__ */ ((EnumAdType2) => {
814
- EnumAdType2["SPONSORED"] = "Sponsored";
815
- EnumAdType2["FREE"] = "Free";
816
- return EnumAdType2;
813
+ var EnumAdType = /* @__PURE__ */ ((EnumAdType3) => {
814
+ EnumAdType3["SPONSORED"] = "Sponsored";
815
+ EnumAdType3["FREE"] = "Free";
816
+ return EnumAdType3;
817
817
  })(EnumAdType || {});
818
- var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
819
- EnumAdStyle2["BLOOM"] = "Bloom";
820
- EnumAdStyle2["RISE"] = "Rise";
821
- return EnumAdStyle2;
818
+ var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle3) => {
819
+ EnumAdStyle3["BLOOM"] = "Bloom";
820
+ EnumAdStyle3["RISE"] = "Rise";
821
+ return EnumAdStyle3;
822
822
  })(EnumAdStyle || {});
823
823
 
824
824
  // src/yupSchema/ad.ts
825
825
  var adSchema = yup6.object().shape({
826
826
  active: yup6.boolean().required("Active status is required"),
827
- adStyle: yup6.mixed().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
828
- adType: yup6.mixed().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
829
- clui: yup6.string().nullable().notRequired(),
830
827
  end: yup6.date().required("End date is required").test("is-future-date", "End date must be in the future", (value) => {
831
828
  if (!value) return false;
832
829
  const endDate = new Date(value);
@@ -844,18 +841,16 @@ var adSchema = yup6.object().shape({
844
841
  }
845
842
  )
846
843
  }),
847
- resourceCover: yup6.string().required("Resource cover is required"),
848
- resourceDescription: yup6.string().required("Resource description is required"),
849
- resourceId: yup6.string().required("Resource ID is required"),
850
- resourceLogo: yup6.string().nullable().notRequired(),
851
- resourceName: yup6.string().required("Resource name is required"),
852
- resourceRegion: yup6.string().required("Resource region is required"),
853
- resourceType: yup6.mixed().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource Type is required"),
854
- showOn: yup6.mixed().oneOf(
855
- Object.values(EnumAdShowOn),
856
- "Please select a valid display location"
857
- ).required("Display location is required"),
858
- socialMedia: yup6.array().of(socialMediaSchema).nullable().optional(),
844
+ resource: yup6.object().shape({
845
+ adDescription: yup6.string().trim().required("Ad description is required").max(100, "Ad description must be at most 100 characters"),
846
+ adImage: yup6.string().required("Ad image is required"),
847
+ adStyle: yup6.mixed().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
848
+ adTitle: yup6.string().trim().required("Ad title is required").max(50, "Ad title must be at most 50 characters"),
849
+ adType: yup6.mixed().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
850
+ resourceId: yup6.string().required("Resource ID is required"),
851
+ resourceType: yup6.mixed().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource Type is required")
852
+ }).required("Resource information is required"),
853
+ showOn: yup6.array().of(yup6.mixed().oneOf(Object.values(EnumAdShowOn)).required()).min(1, "At least one display location is required").required("Display location is required"),
859
854
  status: yup6.mixed().oneOf(Object.values(EnumAdStatus)).required("Ad status is required"),
860
855
  start: yup6.date().when("status", {
861
856
  is: (status) => status !== "Active" /* ACTIVE */,
@@ -865,7 +860,7 @@ var adSchema = yup6.object().shape({
865
860
  }),
866
861
  otherwise: () => yup6.date().nullable().notRequired()
867
862
  }),
868
- targetRegion: yup6.string().nullable().notRequired()
863
+ targetRegion: yup6.array().of(yup6.string().required()).min(1, "At least one target region is required").required("Target region is required")
869
864
  });
870
865
 
871
866
  // src/yupSchema/partner.ts
@@ -3778,29 +3773,25 @@ var AD_FIELDS_FRAGMENT = import_client40.gql`
3778
3773
  fragment AdFields on AdType {
3779
3774
  _id
3780
3775
  active
3781
- adStyle
3782
- adType
3783
3776
  clicks
3784
3777
  createdAt
3785
3778
  end
3786
3779
  impressions
3787
- resourceCover
3788
- resourceDescription
3789
- resourceId
3790
- resourceLogo
3791
- resourceName
3792
- resourceRegion
3793
- resourceType
3794
- showOn
3795
- socialMedia {
3796
- ...SocialMediaFields
3780
+ resource {
3781
+ adDescription
3782
+ adImage
3783
+ adStyle
3784
+ adTitle
3785
+ adType
3786
+ resourceId
3787
+ resourceType
3797
3788
  }
3789
+ showOn
3798
3790
  start
3799
3791
  status
3800
3792
  targetRegion
3801
3793
  updatedAt
3802
3794
  }
3803
- ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
3804
3795
  `;
3805
3796
  var GET_ADS = import_client40.gql`
3806
3797
  query getAds {
@@ -5038,27 +5029,25 @@ var import_react2 = __toESM(require("react"));
5038
5029
  var import_react_hook_form12 = require("react-hook-form");
5039
5030
  var defaultValues8 = {
5040
5031
  active: true,
5041
- adStyle: "Bloom" /* BLOOM */,
5042
- // default to bloom
5043
- adType: "Sponsored" /* SPONSORED */,
5044
- // default to sponsored
5045
- clui: null,
5046
5032
  end: /* @__PURE__ */ new Date(),
5047
- resourceCover: "",
5048
- resourceDescription: "",
5049
- resourceId: "",
5050
- resourceLogo: null,
5051
- resourceName: "",
5052
- resourceRegion: "",
5053
- resourceType: "",
5054
- // default to event
5055
- showOn: "Front_page" /* FRONT_PAGE */,
5033
+ resource: {
5034
+ adDescription: "",
5035
+ adImage: "",
5036
+ adStyle: "",
5037
+ // default to bloom
5038
+ adTitle: "",
5039
+ adType: "",
5040
+ // default to sponsored
5041
+ resourceId: "",
5042
+ resourceType: ""
5043
+ // default to event
5044
+ },
5045
+ showOn: [""],
5056
5046
  // default to front page
5057
- socialMedia: [],
5058
5047
  start: /* @__PURE__ */ new Date(),
5059
5048
  status: "Paused" /* PAUSED */,
5060
5049
  // default to paused
5061
- targetRegion: null
5050
+ targetRegion: []
5062
5051
  };
5063
5052
  function useAdForm(data) {
5064
5053
  const {
@@ -5077,18 +5066,9 @@ function useAdForm(data) {
5077
5066
  if (data) {
5078
5067
  reset({
5079
5068
  active: data.active,
5080
- adStyle: data.adStyle,
5081
- adType: data.adType,
5082
- clui: data.clui,
5083
5069
  end: data.end,
5084
- resourceCover: data.resourceCover,
5085
- resourceDescription: data.resourceDescription,
5086
- resourceId: data.resourceId,
5087
- resourceLogo: data.resourceLogo,
5088
- resourceName: data.resourceName,
5089
- resourceRegion: data.resourceRegion,
5090
- resourceType: data.resourceType,
5091
- socialMedia: data.socialMedia,
5070
+ resource: data.resource,
5071
+ showOn: data.showOn,
5092
5072
  start: data.start,
5093
5073
  status: data.status,
5094
5074
  targetRegion: data.targetRegion
@@ -5097,42 +5077,14 @@ function useAdForm(data) {
5097
5077
  reset(defaultValues8);
5098
5078
  }
5099
5079
  }, [data]);
5100
- const {
5101
- active,
5102
- adStyle,
5103
- adType,
5104
- clui,
5105
- end,
5106
- resourceCover,
5107
- resourceDescription,
5108
- resourceId,
5109
- resourceLogo,
5110
- resourceName,
5111
- resourceRegion,
5112
- resourceType,
5113
- showOn,
5114
- socialMedia: socialMedia2,
5115
- start,
5116
- status,
5117
- targetRegion
5118
- } = getValues();
5080
+ const { active, end, resource, showOn, start, status, targetRegion } = getValues();
5119
5081
  return {
5120
5082
  control,
5121
5083
  fields: {
5122
5084
  active,
5123
- adStyle,
5124
- adType,
5125
- clui,
5126
5085
  end,
5127
- resourceCover,
5128
- resourceDescription,
5129
- resourceId,
5130
- resourceLogo,
5131
- resourceName,
5132
- resourceRegion,
5133
- resourceType,
5086
+ resource,
5134
5087
  showOn,
5135
- socialMedia: socialMedia2,
5136
5088
  start,
5137
5089
  status,
5138
5090
  targetRegion