@timardex/cluemart-shared 1.7.29 → 1.7.31

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 (67) hide show
  1. package/dist/{ad-DaMV_FdN.d.mts → ad-BsAes_WS.d.mts} +2 -2
  2. package/dist/{ad-CQrQILqt.d.ts → ad-FrGeJoW6.d.ts} +2 -2
  3. package/dist/{affiliate-BjNe7vrz.d.ts → affiliate-2h_y0IL4.d.ts} +2 -2
  4. package/dist/{affiliate-CRzUWMPv.d.mts → affiliate-KR-MNBCC.d.mts} +2 -2
  5. package/dist/auth/index.cjs +26 -4
  6. package/dist/auth/index.cjs.map +1 -1
  7. package/dist/auth/index.d.mts +3 -3
  8. package/dist/auth/index.d.ts +3 -3
  9. package/dist/auth/index.mjs +1 -1
  10. package/dist/{chunk-PACEDU64.mjs → chunk-3UYXNSNB.mjs} +4 -4
  11. package/dist/{chunk-PACEDU64.mjs.map → chunk-3UYXNSNB.mjs.map} +1 -1
  12. package/dist/{chunk-2KVUR42L.mjs → chunk-BGTWSB5L.mjs} +2 -2
  13. package/dist/{chunk-BIJ5NDXW.mjs → chunk-FSS2CZPR.mjs} +16 -6
  14. package/dist/chunk-FSS2CZPR.mjs.map +1 -0
  15. package/dist/{chunk-PFY3LS6P.mjs → chunk-P2HBORDW.mjs} +27 -5
  16. package/dist/chunk-P2HBORDW.mjs.map +1 -0
  17. package/dist/{chunk-7TL4ZSUO.mjs → chunk-UV5GH6NI.mjs} +10 -2
  18. package/dist/chunk-UV5GH6NI.mjs.map +1 -0
  19. package/dist/{contactUs-BCkSecPW.d.ts → contactUs-CQqOcQk_.d.ts} +1 -1
  20. package/dist/{contactUs-ryrB_j4c.d.mts → contactUs-DOI78kmJ.d.mts} +1 -1
  21. package/dist/formFields/index.cjs +16 -6
  22. package/dist/formFields/index.cjs.map +1 -1
  23. package/dist/formFields/index.d.mts +3 -3
  24. package/dist/formFields/index.d.ts +3 -3
  25. package/dist/formFields/index.mjs +5 -5
  26. package/dist/{global-Ch11tfC6.d.mts → global-C7xIDkiQ.d.mts} +21 -4
  27. package/dist/{global-CF8hwvkc.d.ts → global-D-034Xws.d.ts} +21 -4
  28. package/dist/graphql/index.cjs +26 -4
  29. package/dist/graphql/index.cjs.map +1 -1
  30. package/dist/graphql/index.d.mts +5 -5
  31. package/dist/graphql/index.d.ts +5 -5
  32. package/dist/graphql/index.mjs +2 -2
  33. package/dist/hooks/index.cjs +56 -17
  34. package/dist/hooks/index.cjs.map +1 -1
  35. package/dist/hooks/index.d.mts +5 -5
  36. package/dist/hooks/index.d.ts +5 -5
  37. package/dist/hooks/index.mjs +35 -18
  38. package/dist/hooks/index.mjs.map +1 -1
  39. package/dist/index.cjs +53 -12
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.mts +23 -6
  42. package/dist/index.d.ts +23 -6
  43. package/dist/index.mjs +51 -11
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/map/index.d.mts +1 -1
  46. package/dist/map/index.d.ts +1 -1
  47. package/dist/{resourceActivities-isol6rr_.d.mts → resourceActivities-CoCW9VLu.d.mts} +1 -1
  48. package/dist/{resourceActivities-2SjrHpuU.d.ts → resourceActivities-DMEtduFL.d.ts} +1 -1
  49. package/dist/sharing/index.d.mts +1 -1
  50. package/dist/sharing/index.d.ts +1 -1
  51. package/dist/types/index.cjs +9 -0
  52. package/dist/types/index.cjs.map +1 -1
  53. package/dist/types/index.d.mts +7 -7
  54. package/dist/types/index.d.ts +7 -7
  55. package/dist/types/index.mjs +3 -1
  56. package/dist/{user-CFVqH8Xk.d.mts → user-0qKK4juO.d.mts} +1 -1
  57. package/dist/{user-BdvV_3eW.d.ts → user-Bynr8XGA.d.ts} +1 -1
  58. package/dist/utils/index.cjs +2 -2
  59. package/dist/utils/index.cjs.map +1 -1
  60. package/dist/utils/index.d.mts +4 -4
  61. package/dist/utils/index.d.ts +4 -4
  62. package/dist/utils/index.mjs +2 -2
  63. package/package.json +1 -1
  64. package/dist/chunk-7TL4ZSUO.mjs.map +0 -1
  65. package/dist/chunk-BIJ5NDXW.mjs.map +0 -1
  66. package/dist/chunk-PFY3LS6P.mjs.map +0 -1
  67. /package/dist/{chunk-2KVUR42L.mjs.map → chunk-BGTWSB5L.mjs.map} +0 -0
@@ -1,11 +1,11 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
2
  import { DocumentNode } from 'graphql';
3
- import { A as AdminUpdateResourceType, C as ChatType, R as ReportChatUser, N as NotificationType, a as NotificationCount, b as ResourceActivityType } from '../resourceActivities-isol6rr_.mjs';
4
- import { M as MutationResponse, E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, P as PosterUsageType, e as RelationType, f as ResourceConnectionsType, V as VendorClaimTokenValidation, g as UnregisteredVendorType, h as VendorType, i as VendorInfoType, j as MyPendingVendorClaim, k as UserLicenceType, l as PostType, m as EnumPostType, G as GameDocType, n as GameLeaderboard, o as CouponType } from '../global-Ch11tfC6.mjs';
5
- import { A as AuthMutationResponse, R as RefreshTokenMutationResponse, P as PartnerType, a as AdType, E as EnumAdStatus, b as AppSettingsType, S as SchoolType, c as SchoolReturnType } from '../ad-DaMV_FdN.mjs';
3
+ import { A as AdminUpdateResourceType, C as ChatType, R as ReportChatUser, N as NotificationType, a as NotificationCount, b as ResourceActivityType } from '../resourceActivities-CoCW9VLu.mjs';
4
+ import { M as MutationResponse, E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, P as PosterUsageType, e as RelationType, f as ResourceConnectionsType, V as VendorClaimTokenValidation, g as UnregisteredVendorType, h as VendorType, i as VendorInfoType, j as MyPendingVendorClaim, k as UserLicenceType, l as PostType, m as EnumPostType, G as GameDocType, n as GameLeaderboard, o as CouponType } from '../global-C7xIDkiQ.mjs';
5
+ import { A as AuthMutationResponse, R as RefreshTokenMutationResponse, P as PartnerType, a as AdType, E as EnumAdStatus, b as AppSettingsType, S as SchoolType, c as SchoolReturnType } from '../ad-BsAes_WS.mjs';
6
6
  import { EnumEventDateStatus, EnumResourceType } from '../enums/index.mjs';
7
- import { S as SafeUserType, R as RedeemRewardMutationResponse, b as ResourceByUser, c as SubscriptionPlansResponse, d as SubscriptionStatusData } from '../user-CFVqH8Xk.mjs';
8
- import { A as AffiliateType } from '../affiliate-CRzUWMPv.mjs';
7
+ import { S as SafeUserType, R as RedeemRewardMutationResponse, b as ResourceByUser, c as SubscriptionPlansResponse, d as SubscriptionStatusData } from '../user-0qKK4juO.mjs';
8
+ import { A as AffiliateType } from '../affiliate-KR-MNBCC.mjs';
9
9
  import 'react-hook-form';
10
10
  import '../images/index.mjs';
11
11
 
@@ -1,11 +1,11 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
2
  import { DocumentNode } from 'graphql';
3
- import { A as AdminUpdateResourceType, C as ChatType, R as ReportChatUser, N as NotificationType, a as NotificationCount, b as ResourceActivityType } from '../resourceActivities-2SjrHpuU.js';
4
- import { M as MutationResponse, E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, P as PosterUsageType, e as RelationType, f as ResourceConnectionsType, V as VendorClaimTokenValidation, g as UnregisteredVendorType, h as VendorType, i as VendorInfoType, j as MyPendingVendorClaim, k as UserLicenceType, l as PostType, m as EnumPostType, G as GameDocType, n as GameLeaderboard, o as CouponType } from '../global-CF8hwvkc.js';
5
- import { A as AuthMutationResponse, R as RefreshTokenMutationResponse, P as PartnerType, a as AdType, E as EnumAdStatus, b as AppSettingsType, S as SchoolType, c as SchoolReturnType } from '../ad-CQrQILqt.js';
3
+ import { A as AdminUpdateResourceType, C as ChatType, R as ReportChatUser, N as NotificationType, a as NotificationCount, b as ResourceActivityType } from '../resourceActivities-DMEtduFL.js';
4
+ import { M as MutationResponse, E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, P as PosterUsageType, e as RelationType, f as ResourceConnectionsType, V as VendorClaimTokenValidation, g as UnregisteredVendorType, h as VendorType, i as VendorInfoType, j as MyPendingVendorClaim, k as UserLicenceType, l as PostType, m as EnumPostType, G as GameDocType, n as GameLeaderboard, o as CouponType } from '../global-D-034Xws.js';
5
+ import { A as AuthMutationResponse, R as RefreshTokenMutationResponse, P as PartnerType, a as AdType, E as EnumAdStatus, b as AppSettingsType, S as SchoolType, c as SchoolReturnType } from '../ad-FrGeJoW6.js';
6
6
  import { EnumEventDateStatus, EnumResourceType } from '../enums/index.js';
7
- import { S as SafeUserType, R as RedeemRewardMutationResponse, b as ResourceByUser, c as SubscriptionPlansResponse, d as SubscriptionStatusData } from '../user-BdvV_3eW.js';
8
- import { A as AffiliateType } from '../affiliate-BjNe7vrz.js';
7
+ import { S as SafeUserType, R as RedeemRewardMutationResponse, b as ResourceByUser, c as SubscriptionPlansResponse, d as SubscriptionStatusData } from '../user-Bynr8XGA.js';
8
+ import { A as AffiliateType } from '../affiliate-2h_y0IL4.js';
9
9
  import 'react-hook-form';
10
10
  import '../images/index.js';
11
11
 
@@ -145,7 +145,7 @@ import {
145
145
  useUpdateUser,
146
146
  useUpdateVendor,
147
147
  useUpdateVendorInfo
148
- } from "../chunk-2KVUR42L.mjs";
148
+ } from "../chunk-BGTWSB5L.mjs";
149
149
  import {
150
150
  GET_EVENT,
151
151
  GET_EVENT_INFO,
@@ -167,7 +167,7 @@ import {
167
167
  useRequestPasswordReset,
168
168
  useResetPassword,
169
169
  useValidateVerificationToken
170
- } from "../chunk-PFY3LS6P.mjs";
170
+ } from "../chunk-P2HBORDW.mjs";
171
171
  import "../chunk-X3OLM35T.mjs";
172
172
  export {
173
173
  ACTIVATE_VENDOR_CLAIM_MUTATION,
@@ -1954,9 +1954,10 @@ var eventInfoSchema = yup2.object().shape({
1954
1954
  // src/yupSchema/vendor.ts
1955
1955
  var yup3 = __toESM(require("yup"));
1956
1956
  var vendorMenuSchema = yup3.object({
1957
- description: yup3.string().nullable().optional(),
1957
+ description: yup3.string().trim().nullable().optional(),
1958
1958
  name: yup3.string().trim().nullable().min(3, "Product name must be at least 3 characters").required("Product name is required"),
1959
1959
  price: yup3.number().transform((v, o) => o === "" ? null : v).min(1, "Product price must be greater than 0").required("Product price is required"),
1960
+ priceMax: yup3.number().transform((v, o) => o === "" ? null : v).min(1, "Product max price must be greater than 0").nullable().optional(),
1960
1961
  priceUnit: yup3.string().required("Product unit is required")
1961
1962
  });
1962
1963
  var vendorSchema = globalResourceSchema.shape({
@@ -3004,6 +3005,23 @@ var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = import_client3.gql`
3004
3005
  userId
3005
3006
  }
3006
3007
  `;
3008
+ var COUPON_OPTION_FIELDS_FRAGMENT = import_client3.gql`
3009
+ fragment CouponOptionFields on CouponOptionType {
3010
+ type
3011
+ buy
3012
+ get
3013
+ unit
3014
+ visits
3015
+ }
3016
+ `;
3017
+ var COUPON_REWARD_FIELDS_FRAGMENT = import_client3.gql`
3018
+ fragment CouponRewardFields on CouponRewardType {
3019
+ vendorId
3020
+ productId
3021
+ quantity
3022
+ unit
3023
+ }
3024
+ `;
3007
3025
  var COUPON_DATA_FIELDS_FRAGMENT = import_client3.gql`
3008
3026
  fragment CouponDataFields on CouponDataType {
3009
3027
  _id
@@ -3012,10 +3030,14 @@ var COUPON_DATA_FIELDS_FRAGMENT = import_client3.gql`
3012
3030
  ...CouponCodeFields
3013
3031
  }
3014
3032
  couponDescription
3015
- couponOption
3033
+ couponOption {
3034
+ ...CouponOptionFields
3035
+ }
3036
+ couponRewards {
3037
+ ...CouponRewardFields
3038
+ }
3016
3039
  createdAt
3017
3040
  endDate
3018
- participantProductId
3019
3041
  participantUsers {
3020
3042
  ...CouponParticipantUserFields
3021
3043
  }
@@ -3025,7 +3047,9 @@ var COUPON_DATA_FIELDS_FRAGMENT = import_client3.gql`
3025
3047
  updatedAt
3026
3048
  }
3027
3049
  ${COUPON_CODE_FIELDS_FRAGMENT}
3050
+ ${COUPON_OPTION_FIELDS_FRAGMENT}
3028
3051
  ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
3052
+ ${COUPON_REWARD_FIELDS_FRAGMENT}
3029
3053
  `;
3030
3054
  var COUPON = import_client3.gql`
3031
3055
  fragment CouponFields on CouponType {
@@ -3043,8 +3067,6 @@ var COUPON = import_client3.gql`
3043
3067
  }
3044
3068
  ${OWNER_FIELDS_FRAGMENT}
3045
3069
  ${COUPON_DATA_FIELDS_FRAGMENT}
3046
- ${COUPON_CODE_FIELDS_FRAGMENT}
3047
- ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
3048
3070
  `;
3049
3071
  var GET_COUPONS = import_client3.gql`
3050
3072
  query getCoupons {
@@ -3083,6 +3105,7 @@ var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = import_client4.gql`
3083
3105
  description
3084
3106
  name
3085
3107
  price
3108
+ priceMax
3086
3109
  priceUnit
3087
3110
  productGroups
3088
3111
  updatedAt
@@ -5896,14 +5919,36 @@ var appSettingsSchema = yup9.object({
5896
5919
 
5897
5920
  // src/yupSchema/coupon.ts
5898
5921
  var yup10 = __toESM(require("yup"));
5899
- var couponOptionSchema = yup10.object().shape({
5922
+ var couponPurchaseOptionSchema = yup10.object().shape({
5900
5923
  buy: yup10.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Buy").typeError("Buy must be a number").integer("Buy must be a whole number").min(1, "Buy must be at least 1").required("Buy is required"),
5901
5924
  get: yup10.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Get").typeError("Get must be a number").integer("Get must be a whole number").min(1, "Get must be at least 1").required("Get is required"),
5925
+ type: yup10.mixed().oneOf(["PURCHASE" /* PURCHASE */], "Type must be PURCHASE").required("Type is required"),
5902
5926
  unit: yup10.string().label("Unit").trim().required("Unit is required")
5903
5927
  });
5928
+ var couponMarketVisitOptionSchema = yup10.object().shape({
5929
+ type: yup10.mixed().oneOf(
5930
+ ["MARKET_VISIT" /* MARKET_VISIT */],
5931
+ "Type must be MARKET_VISIT"
5932
+ ).required("Type is required"),
5933
+ visits: yup10.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Visits").typeError("Visits must be a number").integer("Visits must be a whole number").min(1, "Visits must be at least 1").required("Visits is required")
5934
+ });
5935
+ var couponOptionSchema = yup10.lazy((value) => {
5936
+ const type = value?.type;
5937
+ if (type === "MARKET_VISIT" /* MARKET_VISIT */) {
5938
+ return couponMarketVisitOptionSchema;
5939
+ }
5940
+ return couponPurchaseOptionSchema;
5941
+ });
5942
+ var couponRewardSchema = yup10.object().shape({
5943
+ productId: yup10.string().label("Product").trim().required("Product is required"),
5944
+ quantity: yup10.number().transform((_, originalValue) => toOptionalNumber(originalValue)).label("Quantity").typeError("Quantity must be a number").integer("Quantity must be a whole number").min(1, "Quantity must be at least 1").required("Quantity is required"),
5945
+ unit: yup10.string().label("Unit").trim().required("Unit is required"),
5946
+ vendorId: yup10.string().label("Vendor").trim().required("Vendor is required")
5947
+ });
5904
5948
  var couponSchema = yup10.object().shape({
5905
5949
  couponDescription: yup10.string().label("Description").trim().required("Description is required"),
5906
5950
  couponOption: couponOptionSchema,
5951
+ couponRewards: yup10.array().of(couponRewardSchema).optional(),
5907
5952
  endDate: yup10.date().label("End Date").typeError("End date is required").required("End date is required").test("is-future-date", "End date must be in the future", (value) => {
5908
5953
  if (!value) return false;
5909
5954
  return new Date(value) > /* @__PURE__ */ new Date();
@@ -5919,7 +5964,6 @@ var couponSchema = yup10.object().shape({
5919
5964
  }
5920
5965
  )
5921
5966
  }),
5922
- participantProductId: yup10.string().label("Participant Product").trim().required("Participant product is required"),
5923
5967
  startDate: yup10.date().label("Start Date").typeError("Start date is required").required("Start date is required").test("is-future-date", "Start date must be in the future", (value) => {
5924
5968
  if (!value) return false;
5925
5969
  return new Date(value) > /* @__PURE__ */ new Date();
@@ -7308,10 +7352,11 @@ var defaultValues11 = {
7308
7352
  couponOption: {
7309
7353
  buy: 0,
7310
7354
  get: 0,
7355
+ type: "PURCHASE" /* PURCHASE */,
7311
7356
  unit: ""
7312
7357
  },
7358
+ couponRewards: [],
7313
7359
  endDate: /* @__PURE__ */ new Date(),
7314
- participantProductId: "",
7315
7360
  startDate: /* @__PURE__ */ new Date()
7316
7361
  };
7317
7362
  function useCouponForm(data) {
@@ -7332,28 +7377,22 @@ function useCouponForm(data) {
7332
7377
  reset({
7333
7378
  couponDescription: data.couponDescription,
7334
7379
  couponOption: data.couponOption,
7380
+ couponRewards: data.couponRewards,
7335
7381
  endDate: data.endDate,
7336
- participantProductId: data.participantProductId,
7337
7382
  startDate: data.startDate
7338
7383
  });
7339
7384
  } else {
7340
7385
  reset(defaultValues11);
7341
7386
  }
7342
7387
  }, [data]);
7343
- const {
7344
- couponDescription,
7345
- couponOption,
7346
- endDate,
7347
- participantProductId,
7348
- startDate
7349
- } = getValues();
7388
+ const { couponDescription, couponOption, couponRewards, endDate, startDate } = getValues();
7350
7389
  return {
7351
7390
  control,
7352
7391
  fields: {
7353
7392
  couponDescription,
7354
7393
  couponOption,
7394
+ couponRewards,
7355
7395
  endDate,
7356
- participantProductId,
7357
7396
  startDate
7358
7397
  },
7359
7398
  formState,