@timardex/cluemart-server-shared 1.0.302 → 1.0.304

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,6 +1,6 @@
1
- import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { EnumAffiliateRewardType, AffiliateRewardType, PromoCodeType, UserLicenceType, UserType, EnumUserLicence, DateTimeType, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
3
1
  import * as mongoose from 'mongoose';
2
+ import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
3
+ import { PromoCodeType, UserLicenceType, UserType, EnumAffiliateRewardType, EnumUserLicence, DateTimeType, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
4
4
  import { n as SchemaAffiliateResourceType, S as SchemaOwnerType, i as SchemaRelationType } from '../Affiliate-BxNv9k41.mjs';
5
5
  import { G as GraphQLContext, O as ObjectId, f as SchemaCreateBulkNotificationInput } from '../Chat-Wn7yfc3v.mjs';
6
6
  import dayjs from 'dayjs';
@@ -44,43 +44,6 @@ type AwardAffiliateVendorSubscriptionRewardsResult = {
44
44
  */
45
45
  declare function awardAffiliateVendorSubscriptionRewards(now?: Date): Promise<AwardAffiliateVendorSubscriptionRewardsResult>;
46
46
 
47
- declare const AFFILIATE_REWARDS: {
48
- NEW_EVENT_REGISTRATION: {
49
- description: string;
50
- value: number;
51
- };
52
- NEW_VENDOR_REGISTRATION: {
53
- description: string;
54
- value: number;
55
- };
56
- ACTIVE_VENDOR_PRO_SUBSCRIPTION: {
57
- description: string;
58
- value: number;
59
- };
60
- ACTIVE_VENDOR_STANDARD_SUBSCRIPTION: {
61
- description: string;
62
- value: number;
63
- };
64
- ACTIVE_VENDOR_BONUS_REWARD: {
65
- description: string;
66
- value: number;
67
- };
68
- ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS: {
69
- description: string;
70
- value: number;
71
- };
72
- };
73
- /**
74
- * Create an affiliate reward
75
- * @param rewardType - The type of reward
76
- * @param createdAt - The date the reward was received
77
- * @returns The affiliate reward
78
- * @example
79
- * const reward = createAffiliateReward(EnumAffiliateRewardType.NEW_EVENT_REGISTRATION, new Date());
80
- * console.log(reward);
81
- */
82
- declare function createAffiliateReward(rewardType: EnumAffiliateRewardType, createdAt: Date): AffiliateRewardType;
83
-
84
47
  /**
85
48
  * Loads the affiliate whose `affiliateCode` matches the given promo code.
86
49
  *
@@ -182,6 +145,10 @@ declare function updateAdStatuses(): Promise<void>;
182
145
 
183
146
  declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
184
147
 
148
+ /**
149
+ * True when `value` is a valid Mongo ObjectId string.
150
+ */
151
+ declare function isValidObjectId(value: string): boolean;
185
152
  /**
186
153
  * Recursively converts all ObjectId fields to strings in an object
187
154
  * This is needed because GraphQL expects string IDs, not ObjectIds
@@ -222,4 +189,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
222
189
  */
223
190
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
224
191
 
225
- export { ACTIVE_NOT_DELETED_FILTER, AFFILIATE_REWARDS, type AwardAffiliateVendorSubscriptionRewardsResult, type NotificationPubSub, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, connectToDatabase, convertObjectIdsToStrings, createAffiliateReward, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
192
+ export { ACTIVE_NOT_DELETED_FILTER, type AwardAffiliateVendorSubscriptionRewardsResult, type NotificationPubSub, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, isValidObjectId, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
@@ -1,6 +1,6 @@
1
- import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { EnumAffiliateRewardType, AffiliateRewardType, PromoCodeType, UserLicenceType, UserType, EnumUserLicence, DateTimeType, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
3
1
  import * as mongoose from 'mongoose';
2
+ import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
3
+ import { PromoCodeType, UserLicenceType, UserType, EnumAffiliateRewardType, EnumUserLicence, DateTimeType, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
4
4
  import { n as SchemaAffiliateResourceType, S as SchemaOwnerType, i as SchemaRelationType } from '../Affiliate-DRuifOv4.js';
5
5
  import { G as GraphQLContext, O as ObjectId, f as SchemaCreateBulkNotificationInput } from '../Chat-Wn7yfc3v.js';
6
6
  import dayjs from 'dayjs';
@@ -44,43 +44,6 @@ type AwardAffiliateVendorSubscriptionRewardsResult = {
44
44
  */
45
45
  declare function awardAffiliateVendorSubscriptionRewards(now?: Date): Promise<AwardAffiliateVendorSubscriptionRewardsResult>;
46
46
 
47
- declare const AFFILIATE_REWARDS: {
48
- NEW_EVENT_REGISTRATION: {
49
- description: string;
50
- value: number;
51
- };
52
- NEW_VENDOR_REGISTRATION: {
53
- description: string;
54
- value: number;
55
- };
56
- ACTIVE_VENDOR_PRO_SUBSCRIPTION: {
57
- description: string;
58
- value: number;
59
- };
60
- ACTIVE_VENDOR_STANDARD_SUBSCRIPTION: {
61
- description: string;
62
- value: number;
63
- };
64
- ACTIVE_VENDOR_BONUS_REWARD: {
65
- description: string;
66
- value: number;
67
- };
68
- ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS: {
69
- description: string;
70
- value: number;
71
- };
72
- };
73
- /**
74
- * Create an affiliate reward
75
- * @param rewardType - The type of reward
76
- * @param createdAt - The date the reward was received
77
- * @returns The affiliate reward
78
- * @example
79
- * const reward = createAffiliateReward(EnumAffiliateRewardType.NEW_EVENT_REGISTRATION, new Date());
80
- * console.log(reward);
81
- */
82
- declare function createAffiliateReward(rewardType: EnumAffiliateRewardType, createdAt: Date): AffiliateRewardType;
83
-
84
47
  /**
85
48
  * Loads the affiliate whose `affiliateCode` matches the given promo code.
86
49
  *
@@ -182,6 +145,10 @@ declare function updateAdStatuses(): Promise<void>;
182
145
 
183
146
  declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
184
147
 
148
+ /**
149
+ * True when `value` is a valid Mongo ObjectId string.
150
+ */
151
+ declare function isValidObjectId(value: string): boolean;
185
152
  /**
186
153
  * Recursively converts all ObjectId fields to strings in an object
187
154
  * This is needed because GraphQL expects string IDs, not ObjectIds
@@ -222,4 +189,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
222
189
  */
223
190
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
224
191
 
225
- export { ACTIVE_NOT_DELETED_FILTER, AFFILIATE_REWARDS, type AwardAffiliateVendorSubscriptionRewardsResult, type NotificationPubSub, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, connectToDatabase, convertObjectIdsToStrings, createAffiliateReward, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
192
+ export { ACTIVE_NOT_DELETED_FILTER, type AwardAffiliateVendorSubscriptionRewardsResult, type NotificationPubSub, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, isValidObjectId, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };