@timardex/cluemart-shared 1.7.29 → 1.7.30

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 (61) hide show
  1. package/dist/{ad-DaMV_FdN.d.mts → ad-BDx9eYoO.d.mts} +2 -2
  2. package/dist/{ad-CQrQILqt.d.ts → ad-BYbSba4V.d.ts} +2 -2
  3. package/dist/{affiliate-BjNe7vrz.d.ts → affiliate-Cxdq9Q2k.d.ts} +2 -2
  4. package/dist/{affiliate-CRzUWMPv.d.mts → affiliate-kBWfF_ZN.d.mts} +2 -2
  5. package/dist/auth/index.cjs +25 -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-2KVUR42L.mjs → chunk-24JSCOFX.mjs} +2 -2
  11. package/dist/{chunk-PACEDU64.mjs → chunk-3UYXNSNB.mjs} +4 -4
  12. package/dist/{chunk-PACEDU64.mjs.map → chunk-3UYXNSNB.mjs.map} +1 -1
  13. package/dist/{chunk-PFY3LS6P.mjs → chunk-GZYTDNBQ.mjs} +26 -5
  14. package/dist/{chunk-PFY3LS6P.mjs.map → chunk-GZYTDNBQ.mjs.map} +1 -1
  15. package/dist/{chunk-7TL4ZSUO.mjs → chunk-UV5GH6NI.mjs} +10 -2
  16. package/dist/chunk-UV5GH6NI.mjs.map +1 -0
  17. package/dist/{contactUs-ryrB_j4c.d.mts → contactUs-BXjzZEI1.d.mts} +1 -1
  18. package/dist/{contactUs-BCkSecPW.d.ts → contactUs-Dk8zBwW9.d.ts} +1 -1
  19. package/dist/formFields/index.d.mts +1 -1
  20. package/dist/formFields/index.d.ts +1 -1
  21. package/dist/formFields/index.mjs +2 -2
  22. package/dist/{global-Ch11tfC6.d.mts → global-D1ZvBNbG.d.mts} +20 -4
  23. package/dist/{global-CF8hwvkc.d.ts → global-Dot3RjVJ.d.ts} +20 -4
  24. package/dist/graphql/index.cjs +25 -4
  25. package/dist/graphql/index.cjs.map +1 -1
  26. package/dist/graphql/index.d.mts +5 -5
  27. package/dist/graphql/index.d.ts +5 -5
  28. package/dist/graphql/index.mjs +2 -2
  29. package/dist/hooks/index.cjs +53 -16
  30. package/dist/hooks/index.cjs.map +1 -1
  31. package/dist/hooks/index.d.mts +5 -5
  32. package/dist/hooks/index.d.ts +5 -5
  33. package/dist/hooks/index.mjs +32 -16
  34. package/dist/hooks/index.mjs.map +1 -1
  35. package/dist/index.cjs +36 -6
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.mts +21 -5
  38. package/dist/index.d.ts +21 -5
  39. package/dist/index.mjs +35 -6
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/map/index.d.mts +1 -1
  42. package/dist/map/index.d.ts +1 -1
  43. package/dist/{resourceActivities-2SjrHpuU.d.ts → resourceActivities-E-7429jp.d.ts} +1 -1
  44. package/dist/{resourceActivities-isol6rr_.d.mts → resourceActivities-kGzOHndG.d.mts} +1 -1
  45. package/dist/sharing/index.d.mts +1 -1
  46. package/dist/sharing/index.d.ts +1 -1
  47. package/dist/types/index.cjs +9 -0
  48. package/dist/types/index.cjs.map +1 -1
  49. package/dist/types/index.d.mts +7 -7
  50. package/dist/types/index.d.ts +7 -7
  51. package/dist/types/index.mjs +3 -1
  52. package/dist/{user-BdvV_3eW.d.ts → user-Ca0QNirI.d.ts} +1 -1
  53. package/dist/{user-CFVqH8Xk.d.mts → user-JCkXYAQS.d.mts} +1 -1
  54. package/dist/utils/index.cjs +2 -2
  55. package/dist/utils/index.cjs.map +1 -1
  56. package/dist/utils/index.d.mts +4 -4
  57. package/dist/utils/index.d.ts +4 -4
  58. package/dist/utils/index.mjs +2 -2
  59. package/package.json +1 -1
  60. package/dist/chunk-7TL4ZSUO.mjs.map +0 -1
  61. /package/dist/{chunk-2KVUR42L.mjs.map → chunk-24JSCOFX.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-kGzOHndG.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-D1ZvBNbG.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-BDx9eYoO.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-JCkXYAQS.mjs';
8
+ import { A as AffiliateType } from '../affiliate-kBWfF_ZN.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-E-7429jp.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-Dot3RjVJ.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-BYbSba4V.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-Ca0QNirI.js';
8
+ import { A as AffiliateType } from '../affiliate-Cxdq9Q2k.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-24JSCOFX.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-GZYTDNBQ.mjs";
171
171
  import "../chunk-X3OLM35T.mjs";
172
172
  export {
173
173
  ACTIVATE_VENDOR_CLAIM_MUTATION,
@@ -3004,6 +3004,23 @@ var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = import_client3.gql`
3004
3004
  userId
3005
3005
  }
3006
3006
  `;
3007
+ var COUPON_OPTION_FIELDS_FRAGMENT = import_client3.gql`
3008
+ fragment CouponOptionFields on CouponOptionType {
3009
+ type
3010
+ buy
3011
+ get
3012
+ unit
3013
+ visits
3014
+ }
3015
+ `;
3016
+ var COUPON_REWARD_FIELDS_FRAGMENT = import_client3.gql`
3017
+ fragment CouponRewardFields on CouponRewardType {
3018
+ vendorId
3019
+ productId
3020
+ quantity
3021
+ unit
3022
+ }
3023
+ `;
3007
3024
  var COUPON_DATA_FIELDS_FRAGMENT = import_client3.gql`
3008
3025
  fragment CouponDataFields on CouponDataType {
3009
3026
  _id
@@ -3012,10 +3029,14 @@ var COUPON_DATA_FIELDS_FRAGMENT = import_client3.gql`
3012
3029
  ...CouponCodeFields
3013
3030
  }
3014
3031
  couponDescription
3015
- couponOption
3032
+ couponOption {
3033
+ ...CouponOptionFields
3034
+ }
3035
+ couponRewards {
3036
+ ...CouponRewardFields
3037
+ }
3016
3038
  createdAt
3017
3039
  endDate
3018
- participantProductId
3019
3040
  participantUsers {
3020
3041
  ...CouponParticipantUserFields
3021
3042
  }
@@ -3025,7 +3046,9 @@ var COUPON_DATA_FIELDS_FRAGMENT = import_client3.gql`
3025
3046
  updatedAt
3026
3047
  }
3027
3048
  ${COUPON_CODE_FIELDS_FRAGMENT}
3049
+ ${COUPON_OPTION_FIELDS_FRAGMENT}
3028
3050
  ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
3051
+ ${COUPON_REWARD_FIELDS_FRAGMENT}
3029
3052
  `;
3030
3053
  var COUPON = import_client3.gql`
3031
3054
  fragment CouponFields on CouponType {
@@ -3043,8 +3066,6 @@ var COUPON = import_client3.gql`
3043
3066
  }
3044
3067
  ${OWNER_FIELDS_FRAGMENT}
3045
3068
  ${COUPON_DATA_FIELDS_FRAGMENT}
3046
- ${COUPON_CODE_FIELDS_FRAGMENT}
3047
- ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
3048
3069
  `;
3049
3070
  var GET_COUPONS = import_client3.gql`
3050
3071
  query getCoupons {
@@ -5896,14 +5917,36 @@ var appSettingsSchema = yup9.object({
5896
5917
 
5897
5918
  // src/yupSchema/coupon.ts
5898
5919
  var yup10 = __toESM(require("yup"));
5899
- var couponOptionSchema = yup10.object().shape({
5920
+ var couponPurchaseOptionSchema = yup10.object().shape({
5900
5921
  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
5922
  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"),
5923
+ type: yup10.mixed().oneOf(["PURCHASE" /* PURCHASE */], "Type must be PURCHASE").required("Type is required"),
5902
5924
  unit: yup10.string().label("Unit").trim().required("Unit is required")
5903
5925
  });
5926
+ var couponMarketVisitOptionSchema = yup10.object().shape({
5927
+ type: yup10.mixed().oneOf(
5928
+ ["MARKET_VISIT" /* MARKET_VISIT */],
5929
+ "Type must be MARKET_VISIT"
5930
+ ).required("Type is required"),
5931
+ 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")
5932
+ });
5933
+ var couponOptionSchema = yup10.lazy((value) => {
5934
+ const type = value?.type;
5935
+ if (type === "MARKET_VISIT" /* MARKET_VISIT */) {
5936
+ return couponMarketVisitOptionSchema;
5937
+ }
5938
+ return couponPurchaseOptionSchema;
5939
+ });
5940
+ var couponRewardSchema = yup10.object().shape({
5941
+ productId: yup10.string().label("Product").trim().required("Product is required"),
5942
+ 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"),
5943
+ unit: yup10.string().label("Unit").trim().required("Unit is required"),
5944
+ vendorId: yup10.string().label("Vendor").trim().required("Vendor is required")
5945
+ });
5904
5946
  var couponSchema = yup10.object().shape({
5905
5947
  couponDescription: yup10.string().label("Description").trim().required("Description is required"),
5906
5948
  couponOption: couponOptionSchema,
5949
+ couponRewards: yup10.array().of(couponRewardSchema).optional(),
5907
5950
  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
5951
  if (!value) return false;
5909
5952
  return new Date(value) > /* @__PURE__ */ new Date();
@@ -5919,7 +5962,6 @@ var couponSchema = yup10.object().shape({
5919
5962
  }
5920
5963
  )
5921
5964
  }),
5922
- participantProductId: yup10.string().label("Participant Product").trim().required("Participant product is required"),
5923
5965
  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
5966
  if (!value) return false;
5925
5967
  return new Date(value) > /* @__PURE__ */ new Date();
@@ -7308,10 +7350,11 @@ var defaultValues11 = {
7308
7350
  couponOption: {
7309
7351
  buy: 0,
7310
7352
  get: 0,
7353
+ type: "PURCHASE" /* PURCHASE */,
7311
7354
  unit: ""
7312
7355
  },
7356
+ couponRewards: [],
7313
7357
  endDate: /* @__PURE__ */ new Date(),
7314
- participantProductId: "",
7315
7358
  startDate: /* @__PURE__ */ new Date()
7316
7359
  };
7317
7360
  function useCouponForm(data) {
@@ -7332,28 +7375,22 @@ function useCouponForm(data) {
7332
7375
  reset({
7333
7376
  couponDescription: data.couponDescription,
7334
7377
  couponOption: data.couponOption,
7378
+ couponRewards: data.couponRewards,
7335
7379
  endDate: data.endDate,
7336
- participantProductId: data.participantProductId,
7337
7380
  startDate: data.startDate
7338
7381
  });
7339
7382
  } else {
7340
7383
  reset(defaultValues11);
7341
7384
  }
7342
7385
  }, [data]);
7343
- const {
7344
- couponDescription,
7345
- couponOption,
7346
- endDate,
7347
- participantProductId,
7348
- startDate
7349
- } = getValues();
7386
+ const { couponDescription, couponOption, couponRewards, endDate, startDate } = getValues();
7350
7387
  return {
7351
7388
  control,
7352
7389
  fields: {
7353
7390
  couponDescription,
7354
7391
  couponOption,
7392
+ couponRewards,
7355
7393
  endDate,
7356
- participantProductId,
7357
7394
  startDate
7358
7395
  },
7359
7396
  formState,