@timardex/cluemart-server-shared 1.0.297 → 1.0.300
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.
- package/dist/{Affiliate-DGmeZnDs.d.ts → Affiliate-BxNv9k41.d.mts} +3 -24
- package/dist/{Affiliate-DaZKnzMu.d.mts → Affiliate-DRuifOv4.d.ts} +3 -24
- package/dist/{Chat-Bnqec74U.d.mts → Chat-Wn7yfc3v.d.mts} +1 -1
- package/dist/{Chat-Bnqec74U.d.ts → Chat-Wn7yfc3v.d.ts} +1 -1
- package/dist/{chunk-YXUJ4VQU.mjs → chunk-6PNG5BI5.mjs} +1 -1
- package/dist/chunk-6PNG5BI5.mjs.map +1 -0
- package/dist/{chunk-NBJNO6FV.mjs → chunk-6WS5FH7A.mjs} +12 -77
- package/dist/chunk-6WS5FH7A.mjs.map +1 -0
- package/dist/index.cjs +13 -192
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -26
- package/dist/index.d.ts +5 -26
- package/dist/index.mjs +13 -191
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +11 -76
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +6 -6
- package/dist/mongoose/index.d.ts +6 -6
- package/dist/mongoose/index.mjs +1 -3
- package/dist/service/index.cjs +13 -190
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +2 -2
- package/dist/service/index.d.ts +2 -2
- package/dist/service/index.mjs +4 -120
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-NBJNO6FV.mjs.map +0 -1
- package/dist/chunk-YXUJ4VQU.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType,
|
|
2
|
+
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, AffiliateRewardType, AffiliateResourceType, AffiliateType, EnumAffiliateRewardType, PromoCodeType, EnumUserLicence, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
|
|
3
3
|
import * as mongoose from 'mongoose';
|
|
4
4
|
import mongoose__default from 'mongoose';
|
|
5
5
|
export { default as mongoose } from 'mongoose';
|
|
@@ -37,7 +37,7 @@ declare enum EnumPubSubEvents {
|
|
|
37
37
|
}
|
|
38
38
|
interface AuthUser {
|
|
39
39
|
email: string;
|
|
40
|
-
|
|
40
|
+
roles: EnumUserRole[];
|
|
41
41
|
userId: ObjectId;
|
|
42
42
|
}
|
|
43
43
|
interface SubscriptionPayload {
|
|
@@ -160,15 +160,6 @@ declare const userLicenseSchema: mongoose__default.Schema<UserLicenceType, mongo
|
|
|
160
160
|
} & {
|
|
161
161
|
__v: number;
|
|
162
162
|
}>;
|
|
163
|
-
declare const associatesSchema: mongoose__default.Schema<AssociateType, mongoose__default.Model<AssociateType, any, any, any, mongoose__default.Document<unknown, any, AssociateType, any, {}> & AssociateType & {
|
|
164
|
-
_id: mongoose__default.Types.ObjectId;
|
|
165
|
-
} & {
|
|
166
|
-
__v: number;
|
|
167
|
-
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, AssociateType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<AssociateType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<AssociateType> & {
|
|
168
|
-
_id: mongoose__default.Types.ObjectId;
|
|
169
|
-
} & {
|
|
170
|
-
__v: number;
|
|
171
|
-
}>;
|
|
172
163
|
declare const ContactDetailsSchema: mongoose__default.Schema<ResourceContactDetailsType, mongoose__default.Model<ResourceContactDetailsType, any, any, any, mongoose__default.Document<unknown, any, ResourceContactDetailsType, any, {}> & ResourceContactDetailsType & {
|
|
173
164
|
_id: mongoose__default.Types.ObjectId;
|
|
174
165
|
} & {
|
|
@@ -282,18 +273,6 @@ declare const baseResourceFields: {
|
|
|
282
273
|
required: boolean;
|
|
283
274
|
type: DateConstructor;
|
|
284
275
|
};
|
|
285
|
-
associates: {
|
|
286
|
-
required: boolean;
|
|
287
|
-
type: mongoose__default.Schema<AssociateType, mongoose__default.Model<AssociateType, any, any, any, mongoose__default.Document<unknown, any, AssociateType, any, {}> & AssociateType & {
|
|
288
|
-
_id: mongoose__default.Types.ObjectId;
|
|
289
|
-
} & {
|
|
290
|
-
__v: number;
|
|
291
|
-
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, AssociateType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<AssociateType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<AssociateType> & {
|
|
292
|
-
_id: mongoose__default.Types.ObjectId;
|
|
293
|
-
} & {
|
|
294
|
-
__v: number;
|
|
295
|
-
}>[];
|
|
296
|
-
};
|
|
297
276
|
contactDetails: {
|
|
298
277
|
required: boolean;
|
|
299
278
|
type: mongoose__default.Schema<ResourceContactDetailsType, mongoose__default.Model<ResourceContactDetailsType, any, any, any, mongoose__default.Document<unknown, any, ResourceContactDetailsType, any, {}> & ResourceContactDetailsType & {
|
|
@@ -530,7 +509,7 @@ declare const ResourceActivityModel: mongoose__default.Model<ResourceActivityTyp
|
|
|
530
509
|
type SchemaUserActivityEvent = Omit<UserActivityEvent, "resourceId"> & {
|
|
531
510
|
resourceId: ObjectId;
|
|
532
511
|
};
|
|
533
|
-
type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActivity" | "_id" | "game" | "school" | "affiliate"> & {
|
|
512
|
+
type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActivity" | "_id" | "game" | "school" | "affiliate" | "permissions"> & {
|
|
534
513
|
_id: ObjectId;
|
|
535
514
|
affiliate: ObjectId;
|
|
536
515
|
events: ObjectId[];
|
|
@@ -555,7 +534,7 @@ type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActi
|
|
|
555
534
|
};
|
|
556
535
|
};
|
|
557
536
|
};
|
|
558
|
-
declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "vendor" | "events" | "partner" | "userActivity" | "game" | "school" | "affiliate"> & {
|
|
537
|
+
declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "vendor" | "events" | "partner" | "userActivity" | "game" | "school" | "affiliate" | "permissions"> & {
|
|
559
538
|
_id: ObjectId;
|
|
560
539
|
affiliate: ObjectId;
|
|
561
540
|
events: ObjectId[];
|
|
@@ -973,4 +952,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
|
|
|
973
952
|
*/
|
|
974
953
|
declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
|
|
975
954
|
|
|
976
|
-
export { ACTIVE_NOT_DELETED_FILTER, AFFILIATE_REWARDS, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, activeAffiliateCodeExists,
|
|
955
|
+
export { ACTIVE_NOT_DELETED_FILTER, AFFILIATE_REWARDS, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, baseResourceFields, connectToDatabase, convertObjectIdsToStrings, createAffiliateReward, dateTimeSchema, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, socialShareResourceSchema, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense, userLicenseSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType,
|
|
2
|
+
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, AffiliateRewardType, AffiliateResourceType, AffiliateType, EnumAffiliateRewardType, PromoCodeType, EnumUserLicence, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
|
|
3
3
|
import * as mongoose from 'mongoose';
|
|
4
4
|
import mongoose__default from 'mongoose';
|
|
5
5
|
export { default as mongoose } from 'mongoose';
|
|
@@ -37,7 +37,7 @@ declare enum EnumPubSubEvents {
|
|
|
37
37
|
}
|
|
38
38
|
interface AuthUser {
|
|
39
39
|
email: string;
|
|
40
|
-
|
|
40
|
+
roles: EnumUserRole[];
|
|
41
41
|
userId: ObjectId;
|
|
42
42
|
}
|
|
43
43
|
interface SubscriptionPayload {
|
|
@@ -160,15 +160,6 @@ declare const userLicenseSchema: mongoose__default.Schema<UserLicenceType, mongo
|
|
|
160
160
|
} & {
|
|
161
161
|
__v: number;
|
|
162
162
|
}>;
|
|
163
|
-
declare const associatesSchema: mongoose__default.Schema<AssociateType, mongoose__default.Model<AssociateType, any, any, any, mongoose__default.Document<unknown, any, AssociateType, any, {}> & AssociateType & {
|
|
164
|
-
_id: mongoose__default.Types.ObjectId;
|
|
165
|
-
} & {
|
|
166
|
-
__v: number;
|
|
167
|
-
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, AssociateType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<AssociateType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<AssociateType> & {
|
|
168
|
-
_id: mongoose__default.Types.ObjectId;
|
|
169
|
-
} & {
|
|
170
|
-
__v: number;
|
|
171
|
-
}>;
|
|
172
163
|
declare const ContactDetailsSchema: mongoose__default.Schema<ResourceContactDetailsType, mongoose__default.Model<ResourceContactDetailsType, any, any, any, mongoose__default.Document<unknown, any, ResourceContactDetailsType, any, {}> & ResourceContactDetailsType & {
|
|
173
164
|
_id: mongoose__default.Types.ObjectId;
|
|
174
165
|
} & {
|
|
@@ -282,18 +273,6 @@ declare const baseResourceFields: {
|
|
|
282
273
|
required: boolean;
|
|
283
274
|
type: DateConstructor;
|
|
284
275
|
};
|
|
285
|
-
associates: {
|
|
286
|
-
required: boolean;
|
|
287
|
-
type: mongoose__default.Schema<AssociateType, mongoose__default.Model<AssociateType, any, any, any, mongoose__default.Document<unknown, any, AssociateType, any, {}> & AssociateType & {
|
|
288
|
-
_id: mongoose__default.Types.ObjectId;
|
|
289
|
-
} & {
|
|
290
|
-
__v: number;
|
|
291
|
-
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, AssociateType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<AssociateType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<AssociateType> & {
|
|
292
|
-
_id: mongoose__default.Types.ObjectId;
|
|
293
|
-
} & {
|
|
294
|
-
__v: number;
|
|
295
|
-
}>[];
|
|
296
|
-
};
|
|
297
276
|
contactDetails: {
|
|
298
277
|
required: boolean;
|
|
299
278
|
type: mongoose__default.Schema<ResourceContactDetailsType, mongoose__default.Model<ResourceContactDetailsType, any, any, any, mongoose__default.Document<unknown, any, ResourceContactDetailsType, any, {}> & ResourceContactDetailsType & {
|
|
@@ -530,7 +509,7 @@ declare const ResourceActivityModel: mongoose__default.Model<ResourceActivityTyp
|
|
|
530
509
|
type SchemaUserActivityEvent = Omit<UserActivityEvent, "resourceId"> & {
|
|
531
510
|
resourceId: ObjectId;
|
|
532
511
|
};
|
|
533
|
-
type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActivity" | "_id" | "game" | "school" | "affiliate"> & {
|
|
512
|
+
type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActivity" | "_id" | "game" | "school" | "affiliate" | "permissions"> & {
|
|
534
513
|
_id: ObjectId;
|
|
535
514
|
affiliate: ObjectId;
|
|
536
515
|
events: ObjectId[];
|
|
@@ -555,7 +534,7 @@ type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActi
|
|
|
555
534
|
};
|
|
556
535
|
};
|
|
557
536
|
};
|
|
558
|
-
declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "vendor" | "events" | "partner" | "userActivity" | "game" | "school" | "affiliate"> & {
|
|
537
|
+
declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "vendor" | "events" | "partner" | "userActivity" | "game" | "school" | "affiliate" | "permissions"> & {
|
|
559
538
|
_id: ObjectId;
|
|
560
539
|
affiliate: ObjectId;
|
|
561
540
|
events: ObjectId[];
|
|
@@ -973,4 +952,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
|
|
|
973
952
|
*/
|
|
974
953
|
declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
|
|
975
954
|
|
|
976
|
-
export { ACTIVE_NOT_DELETED_FILTER, AFFILIATE_REWARDS, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, activeAffiliateCodeExists,
|
|
955
|
+
export { ACTIVE_NOT_DELETED_FILTER, AFFILIATE_REWARDS, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, baseResourceFields, connectToDatabase, convertObjectIdsToStrings, createAffiliateReward, dateTimeSchema, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, socialShareResourceSchema, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense, userLicenseSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -3278,9 +3278,6 @@ var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
|
|
|
3278
3278
|
return EnumRelationResource22;
|
|
3279
3279
|
})(EnumRelationResource || {});
|
|
3280
3280
|
var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceType22) => {
|
|
3281
|
-
EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_EVENT"] = "added_as_associate_event";
|
|
3282
|
-
EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_PARTNER"] = "added_as_associate_partner";
|
|
3283
|
-
EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_VENDOR"] = "added_as_associate_vendor";
|
|
3284
3281
|
EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
|
|
3285
3282
|
EnumNotificationResourceType22["AFFILIATE_REWARD_RECEIVED"] = "affiliate_reward_received";
|
|
3286
3283
|
EnumNotificationResourceType22["APPROVED_EVENT"] = "approved_event";
|
|
@@ -3352,13 +3349,13 @@ var EnumUserLicence = /* @__PURE__ */ ((EnumUserLicence22) => {
|
|
|
3352
3349
|
})(EnumUserLicence || {});
|
|
3353
3350
|
var EnumUserRole = /* @__PURE__ */ ((EnumUserRole22) => {
|
|
3354
3351
|
EnumUserRole22["ADMIN"] = "admin";
|
|
3355
|
-
EnumUserRole22["SUPER_ADMIN"] = "super_admin";
|
|
3356
|
-
EnumUserRole22["CUSTOMER"] = "customer";
|
|
3357
|
-
EnumUserRole22["MARKETING"] = "marketing";
|
|
3358
|
-
EnumUserRole22["MODERATOR"] = "moderator";
|
|
3359
|
-
EnumUserRole22["SUPPORT"] = "support";
|
|
3360
3352
|
EnumUserRole22["AFFILIATE"] = "affiliate";
|
|
3353
|
+
EnumUserRole22["CUSTOMER"] = "customer";
|
|
3354
|
+
EnumUserRole22["EVENT"] = "event";
|
|
3355
|
+
EnumUserRole22["PARTNER"] = "partner";
|
|
3361
3356
|
EnumUserRole22["SCHOOL"] = "school";
|
|
3357
|
+
EnumUserRole22["SUPER_ADMIN"] = "super_admin";
|
|
3358
|
+
EnumUserRole22["VENDOR"] = "vendor";
|
|
3362
3359
|
return EnumUserRole22;
|
|
3363
3360
|
})(EnumUserRole || {});
|
|
3364
3361
|
var EnumEventDateStatus = /* @__PURE__ */ ((EnumEventDateStatus22) => {
|
|
@@ -4944,17 +4941,6 @@ var LICENCE_FIELDS_FRAGMENT = gql`
|
|
|
4944
4941
|
prevLicenceType
|
|
4945
4942
|
}
|
|
4946
4943
|
`;
|
|
4947
|
-
var ASSOCIATES_FIELDS_FRAGMENT = gql`
|
|
4948
|
-
fragment AssociatesFields on AssociateType {
|
|
4949
|
-
email
|
|
4950
|
-
resourceId
|
|
4951
|
-
resourceType
|
|
4952
|
-
licence {
|
|
4953
|
-
...LicenceFields
|
|
4954
|
-
}
|
|
4955
|
-
}
|
|
4956
|
-
${LICENCE_FIELDS_FRAGMENT}
|
|
4957
|
-
`;
|
|
4958
4944
|
var TERMS_AGREEMENT_FIELDS_FRAGMENT = gql`
|
|
4959
4945
|
fragment TermsAgreementFields on TermsAgreementType {
|
|
4960
4946
|
appBuildNumber
|
|
@@ -5045,9 +5031,6 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
5045
5031
|
fragment UserFields on UserType {
|
|
5046
5032
|
_id
|
|
5047
5033
|
active
|
|
5048
|
-
associates {
|
|
5049
|
-
...AssociatesFields
|
|
5050
|
-
}
|
|
5051
5034
|
affiliate
|
|
5052
5035
|
avatar {
|
|
5053
5036
|
...ResourceImageFields
|
|
@@ -5070,8 +5053,9 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
5070
5053
|
overallPoints
|
|
5071
5054
|
platform
|
|
5072
5055
|
preferredRegion
|
|
5056
|
+
permissions
|
|
5073
5057
|
promoCodes
|
|
5074
|
-
|
|
5058
|
+
roles
|
|
5075
5059
|
redeemedRewards {
|
|
5076
5060
|
...RedeemedRewardFields
|
|
5077
5061
|
}
|
|
@@ -5086,7 +5070,6 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
5086
5070
|
updatedAt
|
|
5087
5071
|
}
|
|
5088
5072
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
5089
|
-
${ASSOCIATES_FIELDS_FRAGMENT}
|
|
5090
5073
|
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
5091
5074
|
${USER_ACTIVITY_FIELDS_FRAGMENT}
|
|
5092
5075
|
${LICENCE_FIELDS_FRAGMENT}
|
|
@@ -5232,9 +5215,6 @@ var EVENT = gql`
|
|
|
5232
5215
|
fragment EventFields on EventType {
|
|
5233
5216
|
_id
|
|
5234
5217
|
active
|
|
5235
|
-
associates {
|
|
5236
|
-
...AssociatesFields
|
|
5237
|
-
}
|
|
5238
5218
|
adIds
|
|
5239
5219
|
approvedAt
|
|
5240
5220
|
cover {
|
|
@@ -5307,7 +5287,6 @@ var EVENT = gql`
|
|
|
5307
5287
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
5308
5288
|
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
5309
5289
|
${POSTER_USAGE_FIELDS_FRAGMENT}
|
|
5310
|
-
${ASSOCIATES_FIELDS_FRAGMENT}
|
|
5311
5290
|
${CONTACT_DETAILS_FIELDS_FRAGMENT}
|
|
5312
5291
|
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
5313
5292
|
${RELATION_DATES_FRAGMENT}
|
|
@@ -5420,9 +5399,6 @@ var VENDOR = gql`
|
|
|
5420
5399
|
fragment VendorFields on VendorType {
|
|
5421
5400
|
_id
|
|
5422
5401
|
active
|
|
5423
|
-
associates {
|
|
5424
|
-
...AssociatesFields
|
|
5425
|
-
}
|
|
5426
5402
|
adIds
|
|
5427
5403
|
approvedAt
|
|
5428
5404
|
availability {
|
|
@@ -5513,7 +5489,6 @@ var VENDOR = gql`
|
|
|
5513
5489
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
5514
5490
|
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
5515
5491
|
${POSTER_USAGE_FIELDS_FRAGMENT}
|
|
5516
|
-
${ASSOCIATES_FIELDS_FRAGMENT}
|
|
5517
5492
|
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
5518
5493
|
${CONTACT_DETAILS_FIELDS_FRAGMENT}
|
|
5519
5494
|
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
@@ -5666,9 +5641,6 @@ var PARTNER = gql`
|
|
|
5666
5641
|
fragment PartnerFields on PartnerType {
|
|
5667
5642
|
_id
|
|
5668
5643
|
active
|
|
5669
|
-
associates {
|
|
5670
|
-
...AssociatesFields
|
|
5671
|
-
}
|
|
5672
5644
|
adIds
|
|
5673
5645
|
approvedAt
|
|
5674
5646
|
cover {
|
|
@@ -5719,7 +5691,6 @@ var PARTNER = gql`
|
|
|
5719
5691
|
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
5720
5692
|
${LOCATION_FIELDS_FRAGMENT}
|
|
5721
5693
|
${OWNER_FIELDS_FRAGMENT}
|
|
5722
|
-
${ASSOCIATES_FIELDS_FRAGMENT}
|
|
5723
5694
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
5724
5695
|
${POSTER_USAGE_FIELDS_FRAGMENT}
|
|
5725
5696
|
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
@@ -6166,7 +6137,6 @@ var CHAT_MESSAGE_FIELDS_FRAGMENT = gql`
|
|
|
6166
6137
|
var CHAT_PARTICIPANT = gql`
|
|
6167
6138
|
fragment ChatParticipantFields on ChatParticipantType {
|
|
6168
6139
|
active
|
|
6169
|
-
isAssociate
|
|
6170
6140
|
userAvatar
|
|
6171
6141
|
userEmail
|
|
6172
6142
|
userId
|
|
@@ -7644,7 +7614,6 @@ var MessageSchema = new MongooseSchema2(
|
|
|
7644
7614
|
var ParticipantSchema = new MongooseSchema2(
|
|
7645
7615
|
{
|
|
7646
7616
|
active: { default: true, required: true, type: Boolean },
|
|
7647
|
-
isAssociate: { default: null, required: false, type: Boolean },
|
|
7648
7617
|
userAvatar: { required: false, type: String },
|
|
7649
7618
|
userEmail: { required: true, type: String },
|
|
7650
7619
|
userId: {
|
|
@@ -7969,26 +7938,6 @@ var userLicenseSchema = new MongooseSchema6(
|
|
|
7969
7938
|
},
|
|
7970
7939
|
{ _id: false, timestamps: false }
|
|
7971
7940
|
);
|
|
7972
|
-
var associatesSchema = new MongooseSchema6(
|
|
7973
|
-
{
|
|
7974
|
-
email: { required: true, type: String },
|
|
7975
|
-
licence: {
|
|
7976
|
-
required: true,
|
|
7977
|
-
type: userLicenseSchema
|
|
7978
|
-
},
|
|
7979
|
-
resourceId: {
|
|
7980
|
-
required: true,
|
|
7981
|
-
type: String
|
|
7982
|
-
},
|
|
7983
|
-
resourceType: {
|
|
7984
|
-
enum: Object.values(EnumResourceType),
|
|
7985
|
-
required: true,
|
|
7986
|
-
type: String
|
|
7987
|
-
}
|
|
7988
|
-
},
|
|
7989
|
-
{ _id: false }
|
|
7990
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
7991
|
-
);
|
|
7992
7941
|
var ContactDetailsSchema = new MongooseSchema6(
|
|
7993
7942
|
{
|
|
7994
7943
|
email: { required: false, type: String },
|
|
@@ -8104,10 +8053,6 @@ var baseResourceFields = {
|
|
|
8104
8053
|
type: [mongoose6.Schema.Types.ObjectId]
|
|
8105
8054
|
},
|
|
8106
8055
|
approvedAt: { default: null, required: false, type: Date },
|
|
8107
|
-
associates: {
|
|
8108
|
-
required: false,
|
|
8109
|
-
type: [associatesSchema]
|
|
8110
|
-
},
|
|
8111
8056
|
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
8112
8057
|
cover: {
|
|
8113
8058
|
required: true,
|
|
@@ -8251,7 +8196,7 @@ schema4.index({ isRead: 1, userId: 1 });
|
|
|
8251
8196
|
schema4.index({ createdAt: -1, userId: 1 });
|
|
8252
8197
|
var NotificationModel = mongoose8.models.Notification || mongoose8.model("Notification", schema4);
|
|
8253
8198
|
|
|
8254
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
8199
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-X3OLM35T.mjs
|
|
8255
8200
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
8256
8201
|
EnumOSPlatform22["ANDROID"] = "android";
|
|
8257
8202
|
EnumOSPlatform22["IOS"] = "ios";
|
|
@@ -8412,10 +8357,6 @@ var schema7 = new MongooseSchema11(
|
|
|
8412
8357
|
required: false,
|
|
8413
8358
|
type: mongoose11.Schema.Types.ObjectId
|
|
8414
8359
|
},
|
|
8415
|
-
associates: {
|
|
8416
|
-
required: false,
|
|
8417
|
-
type: [associatesSchema]
|
|
8418
|
-
},
|
|
8419
8360
|
avatar: {
|
|
8420
8361
|
required: false,
|
|
8421
8362
|
type: ResourceImageTypeSchema
|
|
@@ -8476,11 +8417,11 @@ var schema7 = new MongooseSchema11(
|
|
|
8476
8417
|
required: false,
|
|
8477
8418
|
type: String
|
|
8478
8419
|
},
|
|
8479
|
-
|
|
8480
|
-
default: EnumUserRole.CUSTOMER,
|
|
8420
|
+
roles: {
|
|
8421
|
+
default: [EnumUserRole.CUSTOMER],
|
|
8481
8422
|
enum: Object.values(EnumUserRole),
|
|
8482
8423
|
required: true,
|
|
8483
|
-
type: String
|
|
8424
|
+
type: [String]
|
|
8484
8425
|
},
|
|
8485
8426
|
school: {
|
|
8486
8427
|
ref: "School",
|
|
@@ -8515,7 +8456,6 @@ var schema7 = new MongooseSchema11(
|
|
|
8515
8456
|
},
|
|
8516
8457
|
{ strict: false, timestamps: true }
|
|
8517
8458
|
);
|
|
8518
|
-
schema7.index({ "associates.email": 1 });
|
|
8519
8459
|
schema7.index({ "licences.expiryDate": 1 });
|
|
8520
8460
|
schema7.index({ "licences.licenceType": 1 });
|
|
8521
8461
|
var UserModel = mongoose11.models.User || mongoose11.model("User", schema7);
|
|
@@ -8633,7 +8573,6 @@ schema9.index({ name: 1 });
|
|
|
8633
8573
|
schema9.index({ description: 1 });
|
|
8634
8574
|
schema9.index({ region: 1 });
|
|
8635
8575
|
schema9.index({ "categories.name": 1 });
|
|
8636
|
-
schema9.index({ "associates.email": 1 });
|
|
8637
8576
|
schema9.index({ slug: 1 });
|
|
8638
8577
|
var VendorModel = mongoose13.models.Vendor || mongoose13.model("Vendor", schema9);
|
|
8639
8578
|
|
|
@@ -8772,7 +8711,6 @@ schema12.index({ description: 1 });
|
|
|
8772
8711
|
schema12.index({ region: 1 });
|
|
8773
8712
|
schema12.index({ "location.geo": "2dsphere" });
|
|
8774
8713
|
schema12.index({ tags: 1 });
|
|
8775
|
-
schema12.index({ "associates.email": 1 });
|
|
8776
8714
|
schema12.index({ deletedAt: 1 });
|
|
8777
8715
|
schema12.index({ "dateTime.dateStatus": 1 });
|
|
8778
8716
|
schema12.index({ slug: 1 });
|
|
@@ -8801,7 +8739,6 @@ schema13.index({ name: 1 });
|
|
|
8801
8739
|
schema13.index({ description: 1 });
|
|
8802
8740
|
schema13.index({ region: 1 });
|
|
8803
8741
|
schema13.index({ "location.geo": "2dsphere" });
|
|
8804
|
-
schema13.index({ "associates.email": 1 });
|
|
8805
8742
|
schema13.index({ slug: 1 });
|
|
8806
8743
|
var PartnerModel = mongoose17.models.Partner || mongoose17.model("Partner", schema13);
|
|
8807
8744
|
|
|
@@ -9750,112 +9687,6 @@ async function updateAdStatuses() {
|
|
|
9750
9687
|
);
|
|
9751
9688
|
}
|
|
9752
9689
|
|
|
9753
|
-
// src/service/associate.ts
|
|
9754
|
-
import mongoose28 from "mongoose";
|
|
9755
|
-
function normalizeObjectId(id) {
|
|
9756
|
-
return typeof id === "string" ? new mongoose28.Types.ObjectId(id) : id;
|
|
9757
|
-
}
|
|
9758
|
-
async function getAssociateEmailsForResource({
|
|
9759
|
-
normalizedResourceId,
|
|
9760
|
-
resourceType
|
|
9761
|
-
}) {
|
|
9762
|
-
const usersWithAssociates = await UserModel.find(
|
|
9763
|
-
{
|
|
9764
|
-
associates: {
|
|
9765
|
-
$elemMatch: {
|
|
9766
|
-
resourceId: normalizedResourceId,
|
|
9767
|
-
resourceType
|
|
9768
|
-
}
|
|
9769
|
-
}
|
|
9770
|
-
},
|
|
9771
|
-
{
|
|
9772
|
-
associates: 1
|
|
9773
|
-
}
|
|
9774
|
-
).lean();
|
|
9775
|
-
return [
|
|
9776
|
-
...new Set(
|
|
9777
|
-
usersWithAssociates.flatMap(
|
|
9778
|
-
(user) => (user.associates ?? []).filter(
|
|
9779
|
-
(associate) => associate.resourceId === normalizedResourceId && associate.resourceType === resourceType
|
|
9780
|
-
).map((associate) => associate.email)
|
|
9781
|
-
)
|
|
9782
|
-
)
|
|
9783
|
-
];
|
|
9784
|
-
}
|
|
9785
|
-
async function pullAssociatesFromUsers({
|
|
9786
|
-
normalizedResourceId,
|
|
9787
|
-
resourceType
|
|
9788
|
-
}) {
|
|
9789
|
-
await UserModel.updateMany(
|
|
9790
|
-
{
|
|
9791
|
-
associates: {
|
|
9792
|
-
$elemMatch: {
|
|
9793
|
-
resourceId: normalizedResourceId,
|
|
9794
|
-
resourceType
|
|
9795
|
-
}
|
|
9796
|
-
}
|
|
9797
|
-
},
|
|
9798
|
-
{
|
|
9799
|
-
$pull: {
|
|
9800
|
-
associates: {
|
|
9801
|
-
resourceId: normalizedResourceId,
|
|
9802
|
-
resourceType
|
|
9803
|
-
}
|
|
9804
|
-
}
|
|
9805
|
-
}
|
|
9806
|
-
);
|
|
9807
|
-
}
|
|
9808
|
-
async function pullAssociateParticipantsFromChats(resourceOwnerId, associateEmails) {
|
|
9809
|
-
await ChatModel.updateMany(
|
|
9810
|
-
{
|
|
9811
|
-
active: true,
|
|
9812
|
-
chatType: EnumChatType.RELATION,
|
|
9813
|
-
deletedAt: null,
|
|
9814
|
-
participants: {
|
|
9815
|
-
$elemMatch: {
|
|
9816
|
-
userId: resourceOwnerId
|
|
9817
|
-
}
|
|
9818
|
-
}
|
|
9819
|
-
},
|
|
9820
|
-
{
|
|
9821
|
-
$pull: {
|
|
9822
|
-
participants: {
|
|
9823
|
-
isAssociate: true,
|
|
9824
|
-
userEmail: {
|
|
9825
|
-
$in: associateEmails
|
|
9826
|
-
}
|
|
9827
|
-
}
|
|
9828
|
-
}
|
|
9829
|
-
}
|
|
9830
|
-
);
|
|
9831
|
-
}
|
|
9832
|
-
async function removeAssociateFromResource({
|
|
9833
|
-
resourceId,
|
|
9834
|
-
resourceOwnerId,
|
|
9835
|
-
resourceType
|
|
9836
|
-
}) {
|
|
9837
|
-
try {
|
|
9838
|
-
const scope = {
|
|
9839
|
-
normalizedResourceId: resourceId.toString(),
|
|
9840
|
-
resourceType
|
|
9841
|
-
};
|
|
9842
|
-
const associateEmails = await getAssociateEmailsForResource(scope);
|
|
9843
|
-
if (associateEmails.length === 0) {
|
|
9844
|
-
return;
|
|
9845
|
-
}
|
|
9846
|
-
await pullAssociatesFromUsers(scope);
|
|
9847
|
-
await pullAssociateParticipantsFromChats(
|
|
9848
|
-
normalizeObjectId(resourceOwnerId),
|
|
9849
|
-
associateEmails
|
|
9850
|
-
);
|
|
9851
|
-
} catch (error) {
|
|
9852
|
-
console.error(
|
|
9853
|
-
`[removeAssociateFromResource] Failed for resourceId=${resourceId}, resourceType=${resourceType}`,
|
|
9854
|
-
error
|
|
9855
|
-
);
|
|
9856
|
-
}
|
|
9857
|
-
}
|
|
9858
|
-
|
|
9859
9690
|
// src/service/vendor.ts
|
|
9860
9691
|
async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
9861
9692
|
try {
|
|
@@ -9872,7 +9703,6 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
9872
9703
|
const updateData = {};
|
|
9873
9704
|
const isStandardVendor = licenceType === EnumUserLicence.STANDARD_VENDOR;
|
|
9874
9705
|
if (isStandardVendor) {
|
|
9875
|
-
updateData.associates = [];
|
|
9876
9706
|
updateData.availability = {
|
|
9877
9707
|
corporate: false,
|
|
9878
9708
|
private: false,
|
|
@@ -9892,25 +9722,18 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
9892
9722
|
active: isStandardVendor ? index < 6 : true
|
|
9893
9723
|
}));
|
|
9894
9724
|
await VendorModel.updateOne({ _id: vendor._id }, { $set: updateData });
|
|
9895
|
-
if (isStandardVendor) {
|
|
9896
|
-
await removeAssociateFromResource({
|
|
9897
|
-
resourceId: vendor._id,
|
|
9898
|
-
resourceOwnerId: vendor.owner.userId,
|
|
9899
|
-
resourceType: EnumResourceType.VENDOR
|
|
9900
|
-
});
|
|
9901
|
-
}
|
|
9902
9725
|
} catch (error) {
|
|
9903
9726
|
console.error("[updateVendorBasedOnUserLicense] Failed:", error);
|
|
9904
9727
|
}
|
|
9905
9728
|
}
|
|
9906
9729
|
|
|
9907
9730
|
// src/service/objectIdToString.ts
|
|
9908
|
-
import
|
|
9731
|
+
import mongoose28 from "mongoose";
|
|
9909
9732
|
function convertObjectIdsToStrings(obj) {
|
|
9910
9733
|
if (obj === null || obj === void 0) {
|
|
9911
9734
|
return obj;
|
|
9912
9735
|
}
|
|
9913
|
-
if (obj instanceof
|
|
9736
|
+
if (obj instanceof mongoose28.Types.ObjectId) {
|
|
9914
9737
|
return obj.toString();
|
|
9915
9738
|
}
|
|
9916
9739
|
if (obj instanceof Date) {
|
|
@@ -10125,7 +9948,6 @@ export {
|
|
|
10125
9948
|
VendorModel,
|
|
10126
9949
|
VerificationTokenModel,
|
|
10127
9950
|
activeAffiliateCodeExists,
|
|
10128
|
-
associatesSchema,
|
|
10129
9951
|
awardAffiliateVendorSubscriptionRewards,
|
|
10130
9952
|
baseResourceFields,
|
|
10131
9953
|
connectToDatabase,
|