@timardex/cluemart-server-shared 2.5.0 → 3.0.0

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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, AdDailyPriceType, AdBookingType, AdMetricsType, AdSettingsType, ChatType, ParticipantType, ChatMessageType, NotificationType, CreateBulkNotificationInput, EnumUserRole, BillingCatalogEntryType, BillingCatalogPriceHistoryEntry, EnumBillingPeriod, EnumUserLicence, BILLING_CATALOG_KEYS, ReportChatUser, OwnerType, Category, ResourceContactDetailsType, ResourceImageType, RelatedPostType, SocialMediaType, PosterUsageType, SocialShareResourceType, TermsAgreement, DateTimeType, LocationGeoType, LocationType, UserLicenceType, GoogleImportedMarket, PushTokenType, RelationType, RelationDate, ResourceActivityType, StripeSubscription, UserActivityEvent, UserType, VendorType, VendorProductList, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, EventInfoType, StallType, RefundPolicy, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameDocType, GameType, SchoolType, AffiliateType, AffiliateResourceType, AffiliateRewardType, CouponType, CouponDataType, CouponParticipantUserType, EnumResourceType, PromoCodeType, EnumAffiliateRewardType, EnumPointType, UserOverallPointsEntry, EventListItemType, DateTimeWithPriceType, EnumNotificationResourceType, EnumNotificationType, LicenceExpiryDate } from '@timardex/cluemart-shared';
2
+ import { AdType, AdDailyPriceType, AdBookingType, AdMetricsType, ChatType, ParticipantType, ChatMessageType, NotificationType, CreateBulkNotificationInput, EnumUserRole, BillingCatalogEntryType, BillingCatalogPriceHistoryEntry, EnumBillingPeriod, EnumUserLicence, BILLING_CATALOG_KEYS, ReportChatUser, OwnerType, Category, ResourceContactDetailsType, ResourceImageType, RelatedPostType, SocialMediaType, PosterUsageType, SocialShareResourceType, TermsAgreement, DateTimeType, LocationGeoType, LocationType, UserLicenceType, GoogleImportedMarket, PushTokenType, RelationType, RelationDate, ResourceActivityType, StripeSubscription, UserActivityEvent, UserType, VendorType, VendorProductList, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, EventInfoType, StallType, RefundPolicy, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameDocType, GameType, SchoolType, AffiliateType, AffiliateResourceType, AffiliateRewardType, CouponType, CouponDataType, CouponParticipantUserType, EnumResourceType, PromoCodeType, EnumAffiliateRewardType, EnumPointType, UserOverallPointsEntry, EventListItemType, DateTimeWithPriceType, EnumNotificationResourceType, EnumNotificationType, LicenceExpiryDate } from '@timardex/cluemart-shared';
3
3
  export { updateSingleDateTimeStatus } from '@timardex/cluemart-shared';
4
4
  import * as mongoose from 'mongoose';
5
5
  import mongoose__default from 'mongoose';
@@ -44,24 +44,6 @@ declare const AdMetricsModel: mongoose__default.Model<AdMetricsType, {}, {}, {},
44
44
  __v: number;
45
45
  }, any>;
46
46
 
47
- type AdSettingsDocument = AdSettingsType & {
48
- minAppearancesPerHour?: number;
49
- paidSlotsPerPlacement?: number;
50
- reservedSlotsPerPlacement?: number;
51
- rotationSeconds?: number;
52
- };
53
- declare const DEFAULT_AD_SETTINGS: AdSettingsType;
54
- declare const AdSettingsModel: mongoose__default.Model<AdSettingsDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, AdSettingsDocument, {}, {}> & AdSettingsType & {
55
- minAppearancesPerHour?: number;
56
- paidSlotsPerPlacement?: number;
57
- reservedSlotsPerPlacement?: number;
58
- rotationSeconds?: number;
59
- } & Required<{
60
- _id: "default";
61
- }> & {
62
- __v: number;
63
- }, any>;
64
-
65
47
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
66
48
  senderId: ObjectId;
67
49
  };
@@ -115,10 +97,17 @@ declare enum EnumPubSubEvents {
115
97
  GET_NOTIFICATIONS_COUNT = "GET_NOTIFICATIONS_COUNT",
116
98
  USER_TYPING = "USER_TYPING"
117
99
  }
100
+ /** Clients that own their own refresh-token slot on the user document. */
101
+ type AuthTokenClient = "mobile" | "admin";
118
102
  interface AuthUser {
119
103
  email: string;
120
104
  roles: EnumUserRole[];
121
105
  userId: ObjectId;
106
+ /**
107
+ * Which client slot this token belongs to. Absent only on tokens issued
108
+ * before the per-client rollout; those can no longer refresh.
109
+ */
110
+ client?: AuthTokenClient;
122
111
  /** Set when this token represents an impersonation session. */
123
112
  impersonationSessionId?: string;
124
113
  /** The SUPER_ADMIN who started the impersonation session. */
@@ -582,6 +571,9 @@ type SchemaUserType = Omit<UserType, "vendor" | "coupon" | "events" | "partner"
582
571
  events: ObjectId[];
583
572
  game: ObjectId;
584
573
  partner: ObjectId;
574
+ /** Server-only hashed refresh tokens; never exposed to clients. */
575
+ refreshTokenAdmin?: string | null;
576
+ refreshTokenMobile?: string | null;
585
577
  school: ObjectId;
586
578
  stripe?: SchemaStripeSubscription;
587
579
  vendor: ObjectId;
@@ -623,6 +615,9 @@ declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mon
623
615
  events: ObjectId[];
624
616
  game: ObjectId;
625
617
  partner: ObjectId;
618
+ /** Server-only hashed refresh tokens; never exposed to clients. */
619
+ refreshTokenAdmin?: string | null;
620
+ refreshTokenMobile?: string | null;
626
621
  school: ObjectId;
627
622
  stripe?: SchemaStripeSubscription;
628
623
  vendor: ObjectId;
@@ -821,7 +816,12 @@ declare const PostModel: mongoose__default.Model<PostType, {}, {}, {}, mongoose_
821
816
  declare const APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
822
817
  type SchemaAppSettingsType = AppSettingsType & {
823
818
  adSettings: {
819
+ approvalRequired: boolean;
820
+ minAppearancesPerHour?: number;
824
821
  mobileDisplayEnabled: boolean;
822
+ paidSlotsPerPlacement?: number;
823
+ reservedSlotsPerPlacement?: number;
824
+ rotationSeconds?: number;
825
825
  webDisplayEnabled: boolean;
826
826
  };
827
827
  };
@@ -834,7 +834,12 @@ declare const AppSettingModel: mongoose__default.Model<SchemaAppSettingsType, {}
834
834
  updatedAt: Date | null;
835
835
  } & {
836
836
  adSettings: {
837
+ approvalRequired: boolean;
838
+ minAppearancesPerHour?: number;
837
839
  mobileDisplayEnabled: boolean;
840
+ paidSlotsPerPlacement?: number;
841
+ reservedSlotsPerPlacement?: number;
842
+ rotationSeconds?: number;
838
843
  webDisplayEnabled: boolean;
839
844
  };
840
845
  } & Required<{
@@ -843,6 +848,28 @@ declare const AppSettingModel: mongoose__default.Model<SchemaAppSettingsType, {}
843
848
  __v: number;
844
849
  }, any>;
845
850
 
851
+ /**
852
+ * Single-use record backing a WebView auto-login handoff.
853
+ *
854
+ * The app mints a short-lived signed token and opens the admin site with it;
855
+ * the admin site exchanges the token for its own admin-slot session. Keeping
856
+ * the `jti` here (with an atomic `usedAt` update) makes the token replay-proof
857
+ * across server instances — a purely in-memory store would not.
858
+ */
859
+ interface AuthHandoffTokenType {
860
+ createdAt: Date;
861
+ expiresAt: Date;
862
+ jti: string;
863
+ updatedAt: Date;
864
+ usedAt: Date | null;
865
+ userId: ObjectId;
866
+ }
867
+ declare const AuthHandoffTokenModel: mongoose__default.Model<AuthHandoffTokenType, {}, {}, {}, mongoose__default.Document<unknown, {}, AuthHandoffTokenType, {}, {}> & AuthHandoffTokenType & {
868
+ _id: mongoose__default.Types.ObjectId;
869
+ } & {
870
+ __v: number;
871
+ }, any>;
872
+
846
873
  type SchemaGameType = Omit<GameType, "_id"> & {
847
874
  _id: ObjectId;
848
875
  };
@@ -1522,4 +1549,4 @@ declare function checkOwnerHasLicence({ userId, resourceType, }: {
1522
1549
  resourceType: EnumResourceType;
1523
1550
  }): Promise<void>;
1524
1551
 
1525
- export { ACTIVE_NOT_DELETED_FILTER, AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, AdMetricsModel, AdModel, AdSettingsModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EnumPubSubEvents, EventDateArchiveModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, ImpersonationAuditModel, ImpersonationSessionModel, LicenceCategory, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, REMINDER_WINDOW_MAX_HOURS, REMINDER_WINDOW_MIN_HOURS, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, SUBSCRIPTION_REWARD_TIMEZONE, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaAppSettingsType, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventDateArchiveType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaImpersonationAuditType, type SchemaImpersonationSessionType, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaStripeSubscription, 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, buildInitialBillingCatalogEntries, buildLicenceExpiryPipeline, buildUserHasEnoughPointsFilter, buildUserPointAwardEntry, buildUserPointCreditFilter, buildUserPointDebitPipeline, buildUserPointEntryRemovalPipeline, checkOwnerHasLicence, connectToDatabase, convertObjectIdsToStrings, createLicenceObject, dateTimeSchema, dedupeArchivedSlotsByStartDateTime, didRemoveAnyEventDates, didRemoveAnyStartedDates, downgradeVendorProFeatures, ensureUserLicenseCompliance, ensureUserLicenseComplianceForUser, eventLicences, findAffiliateByPromoCode, findEventOrImportedMarketById, getBillingCatalogDefinition, getEventResourceInfo, getHighestLicenceForCategory, getLicenceCategory, getLicenceExpiryMode, getPartnerResourceInfo, getPayingEventStripeSubscriptionPlan, getPayingStripeSubscriptionPlan, getPayingVendorStripeSubscriptionPlan, getSubscriptionRewardPeriodBounds, getVendorResourceInfo, handleEventLicenceCompliance, handlePartnerLicenceCompliance, handleVendorLicenceCompliance, hasValidLicence, isStandardLicence, isValidObjectId, licenceCategoryMapping, licencePriority, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, partnerLicences, persistArchivedEventDates, processLicenseReminder, processUserCompliance, processUserLicenseReminders, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, remindUsersAboutLicenseExpiration, replaceUserLicenceWithObject, restoreVendorProFeatures, saveNotificationsInDb, schemaAdresource, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, splitEventDatesForArchive, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToCanceled, upgradeUserToLicence, userLicenseSchema, vendorOwnerHasProLicence, vendorProductTypeSchema };
1552
+ export { ACTIVE_NOT_DELETED_FILTER, AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, AdMetricsModel, AdModel, AffiliateModel, AppSettingModel, AuthHandoffTokenModel, type AuthHandoffTokenType, type AuthTokenClient, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, EnumPubSubEvents, EventDateArchiveModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, ImpersonationAuditModel, ImpersonationSessionModel, LicenceCategory, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, REMINDER_WINDOW_MAX_HOURS, REMINDER_WINDOW_MIN_HOURS, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, SUBSCRIPTION_REWARD_TIMEZONE, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaAppSettingsType, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventDateArchiveType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaImpersonationAuditType, type SchemaImpersonationSessionType, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaStripeSubscription, 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, buildInitialBillingCatalogEntries, buildLicenceExpiryPipeline, buildUserHasEnoughPointsFilter, buildUserPointAwardEntry, buildUserPointCreditFilter, buildUserPointDebitPipeline, buildUserPointEntryRemovalPipeline, checkOwnerHasLicence, connectToDatabase, convertObjectIdsToStrings, createLicenceObject, dateTimeSchema, dedupeArchivedSlotsByStartDateTime, didRemoveAnyEventDates, didRemoveAnyStartedDates, downgradeVendorProFeatures, ensureUserLicenseCompliance, ensureUserLicenseComplianceForUser, eventLicences, findAffiliateByPromoCode, findEventOrImportedMarketById, getBillingCatalogDefinition, getEventResourceInfo, getHighestLicenceForCategory, getLicenceCategory, getLicenceExpiryMode, getPartnerResourceInfo, getPayingEventStripeSubscriptionPlan, getPayingStripeSubscriptionPlan, getPayingVendorStripeSubscriptionPlan, getSubscriptionRewardPeriodBounds, getVendorResourceInfo, handleEventLicenceCompliance, handlePartnerLicenceCompliance, handleVendorLicenceCompliance, hasValidLicence, isStandardLicence, isValidObjectId, licenceCategoryMapping, licencePriority, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, partnerLicences, persistArchivedEventDates, processLicenseReminder, processUserCompliance, processUserLicenseReminders, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, remindUsersAboutLicenseExpiration, replaceUserLicenceWithObject, restoreVendorProFeatures, saveNotificationsInDb, schemaAdresource, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, splitEventDatesForArchive, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToCanceled, upgradeUserToLicence, userLicenseSchema, vendorOwnerHasProLicence, vendorProductTypeSchema };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, AdDailyPriceType, AdBookingType, AdMetricsType, AdSettingsType, ChatType, ParticipantType, ChatMessageType, NotificationType, CreateBulkNotificationInput, EnumUserRole, BillingCatalogEntryType, BillingCatalogPriceHistoryEntry, EnumBillingPeriod, EnumUserLicence, BILLING_CATALOG_KEYS, ReportChatUser, OwnerType, Category, ResourceContactDetailsType, ResourceImageType, RelatedPostType, SocialMediaType, PosterUsageType, SocialShareResourceType, TermsAgreement, DateTimeType, LocationGeoType, LocationType, UserLicenceType, GoogleImportedMarket, PushTokenType, RelationType, RelationDate, ResourceActivityType, StripeSubscription, UserActivityEvent, UserType, VendorType, VendorProductList, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, EventInfoType, StallType, RefundPolicy, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameDocType, GameType, SchoolType, AffiliateType, AffiliateResourceType, AffiliateRewardType, CouponType, CouponDataType, CouponParticipantUserType, EnumResourceType, PromoCodeType, EnumAffiliateRewardType, EnumPointType, UserOverallPointsEntry, EventListItemType, DateTimeWithPriceType, EnumNotificationResourceType, EnumNotificationType, LicenceExpiryDate } from '@timardex/cluemart-shared';
2
+ import { AdType, AdDailyPriceType, AdBookingType, AdMetricsType, ChatType, ParticipantType, ChatMessageType, NotificationType, CreateBulkNotificationInput, EnumUserRole, BillingCatalogEntryType, BillingCatalogPriceHistoryEntry, EnumBillingPeriod, EnumUserLicence, BILLING_CATALOG_KEYS, ReportChatUser, OwnerType, Category, ResourceContactDetailsType, ResourceImageType, RelatedPostType, SocialMediaType, PosterUsageType, SocialShareResourceType, TermsAgreement, DateTimeType, LocationGeoType, LocationType, UserLicenceType, GoogleImportedMarket, PushTokenType, RelationType, RelationDate, ResourceActivityType, StripeSubscription, UserActivityEvent, UserType, VendorType, VendorProductList, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, EventInfoType, StallType, RefundPolicy, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameDocType, GameType, SchoolType, AffiliateType, AffiliateResourceType, AffiliateRewardType, CouponType, CouponDataType, CouponParticipantUserType, EnumResourceType, PromoCodeType, EnumAffiliateRewardType, EnumPointType, UserOverallPointsEntry, EventListItemType, DateTimeWithPriceType, EnumNotificationResourceType, EnumNotificationType, LicenceExpiryDate } from '@timardex/cluemart-shared';
3
3
  export { updateSingleDateTimeStatus } from '@timardex/cluemart-shared';
4
4
  import * as mongoose from 'mongoose';
5
5
  import mongoose__default from 'mongoose';
@@ -44,24 +44,6 @@ declare const AdMetricsModel: mongoose__default.Model<AdMetricsType, {}, {}, {},
44
44
  __v: number;
45
45
  }, any>;
46
46
 
47
- type AdSettingsDocument = AdSettingsType & {
48
- minAppearancesPerHour?: number;
49
- paidSlotsPerPlacement?: number;
50
- reservedSlotsPerPlacement?: number;
51
- rotationSeconds?: number;
52
- };
53
- declare const DEFAULT_AD_SETTINGS: AdSettingsType;
54
- declare const AdSettingsModel: mongoose__default.Model<AdSettingsDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, AdSettingsDocument, {}, {}> & AdSettingsType & {
55
- minAppearancesPerHour?: number;
56
- paidSlotsPerPlacement?: number;
57
- reservedSlotsPerPlacement?: number;
58
- rotationSeconds?: number;
59
- } & Required<{
60
- _id: "default";
61
- }> & {
62
- __v: number;
63
- }, any>;
64
-
65
47
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
66
48
  senderId: ObjectId;
67
49
  };
@@ -115,10 +97,17 @@ declare enum EnumPubSubEvents {
115
97
  GET_NOTIFICATIONS_COUNT = "GET_NOTIFICATIONS_COUNT",
116
98
  USER_TYPING = "USER_TYPING"
117
99
  }
100
+ /** Clients that own their own refresh-token slot on the user document. */
101
+ type AuthTokenClient = "mobile" | "admin";
118
102
  interface AuthUser {
119
103
  email: string;
120
104
  roles: EnumUserRole[];
121
105
  userId: ObjectId;
106
+ /**
107
+ * Which client slot this token belongs to. Absent only on tokens issued
108
+ * before the per-client rollout; those can no longer refresh.
109
+ */
110
+ client?: AuthTokenClient;
122
111
  /** Set when this token represents an impersonation session. */
123
112
  impersonationSessionId?: string;
124
113
  /** The SUPER_ADMIN who started the impersonation session. */
@@ -582,6 +571,9 @@ type SchemaUserType = Omit<UserType, "vendor" | "coupon" | "events" | "partner"
582
571
  events: ObjectId[];
583
572
  game: ObjectId;
584
573
  partner: ObjectId;
574
+ /** Server-only hashed refresh tokens; never exposed to clients. */
575
+ refreshTokenAdmin?: string | null;
576
+ refreshTokenMobile?: string | null;
585
577
  school: ObjectId;
586
578
  stripe?: SchemaStripeSubscription;
587
579
  vendor: ObjectId;
@@ -623,6 +615,9 @@ declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mon
623
615
  events: ObjectId[];
624
616
  game: ObjectId;
625
617
  partner: ObjectId;
618
+ /** Server-only hashed refresh tokens; never exposed to clients. */
619
+ refreshTokenAdmin?: string | null;
620
+ refreshTokenMobile?: string | null;
626
621
  school: ObjectId;
627
622
  stripe?: SchemaStripeSubscription;
628
623
  vendor: ObjectId;
@@ -821,7 +816,12 @@ declare const PostModel: mongoose__default.Model<PostType, {}, {}, {}, mongoose_
821
816
  declare const APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
822
817
  type SchemaAppSettingsType = AppSettingsType & {
823
818
  adSettings: {
819
+ approvalRequired: boolean;
820
+ minAppearancesPerHour?: number;
824
821
  mobileDisplayEnabled: boolean;
822
+ paidSlotsPerPlacement?: number;
823
+ reservedSlotsPerPlacement?: number;
824
+ rotationSeconds?: number;
825
825
  webDisplayEnabled: boolean;
826
826
  };
827
827
  };
@@ -834,7 +834,12 @@ declare const AppSettingModel: mongoose__default.Model<SchemaAppSettingsType, {}
834
834
  updatedAt: Date | null;
835
835
  } & {
836
836
  adSettings: {
837
+ approvalRequired: boolean;
838
+ minAppearancesPerHour?: number;
837
839
  mobileDisplayEnabled: boolean;
840
+ paidSlotsPerPlacement?: number;
841
+ reservedSlotsPerPlacement?: number;
842
+ rotationSeconds?: number;
838
843
  webDisplayEnabled: boolean;
839
844
  };
840
845
  } & Required<{
@@ -843,6 +848,28 @@ declare const AppSettingModel: mongoose__default.Model<SchemaAppSettingsType, {}
843
848
  __v: number;
844
849
  }, any>;
845
850
 
851
+ /**
852
+ * Single-use record backing a WebView auto-login handoff.
853
+ *
854
+ * The app mints a short-lived signed token and opens the admin site with it;
855
+ * the admin site exchanges the token for its own admin-slot session. Keeping
856
+ * the `jti` here (with an atomic `usedAt` update) makes the token replay-proof
857
+ * across server instances — a purely in-memory store would not.
858
+ */
859
+ interface AuthHandoffTokenType {
860
+ createdAt: Date;
861
+ expiresAt: Date;
862
+ jti: string;
863
+ updatedAt: Date;
864
+ usedAt: Date | null;
865
+ userId: ObjectId;
866
+ }
867
+ declare const AuthHandoffTokenModel: mongoose__default.Model<AuthHandoffTokenType, {}, {}, {}, mongoose__default.Document<unknown, {}, AuthHandoffTokenType, {}, {}> & AuthHandoffTokenType & {
868
+ _id: mongoose__default.Types.ObjectId;
869
+ } & {
870
+ __v: number;
871
+ }, any>;
872
+
846
873
  type SchemaGameType = Omit<GameType, "_id"> & {
847
874
  _id: ObjectId;
848
875
  };
@@ -1522,4 +1549,4 @@ declare function checkOwnerHasLicence({ userId, resourceType, }: {
1522
1549
  resourceType: EnumResourceType;
1523
1550
  }): Promise<void>;
1524
1551
 
1525
- export { ACTIVE_NOT_DELETED_FILTER, AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, AdMetricsModel, AdModel, AdSettingsModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EnumPubSubEvents, EventDateArchiveModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, ImpersonationAuditModel, ImpersonationSessionModel, LicenceCategory, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, REMINDER_WINDOW_MAX_HOURS, REMINDER_WINDOW_MIN_HOURS, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, SUBSCRIPTION_REWARD_TIMEZONE, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaAppSettingsType, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventDateArchiveType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaImpersonationAuditType, type SchemaImpersonationSessionType, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaStripeSubscription, 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, buildInitialBillingCatalogEntries, buildLicenceExpiryPipeline, buildUserHasEnoughPointsFilter, buildUserPointAwardEntry, buildUserPointCreditFilter, buildUserPointDebitPipeline, buildUserPointEntryRemovalPipeline, checkOwnerHasLicence, connectToDatabase, convertObjectIdsToStrings, createLicenceObject, dateTimeSchema, dedupeArchivedSlotsByStartDateTime, didRemoveAnyEventDates, didRemoveAnyStartedDates, downgradeVendorProFeatures, ensureUserLicenseCompliance, ensureUserLicenseComplianceForUser, eventLicences, findAffiliateByPromoCode, findEventOrImportedMarketById, getBillingCatalogDefinition, getEventResourceInfo, getHighestLicenceForCategory, getLicenceCategory, getLicenceExpiryMode, getPartnerResourceInfo, getPayingEventStripeSubscriptionPlan, getPayingStripeSubscriptionPlan, getPayingVendorStripeSubscriptionPlan, getSubscriptionRewardPeriodBounds, getVendorResourceInfo, handleEventLicenceCompliance, handlePartnerLicenceCompliance, handleVendorLicenceCompliance, hasValidLicence, isStandardLicence, isValidObjectId, licenceCategoryMapping, licencePriority, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, partnerLicences, persistArchivedEventDates, processLicenseReminder, processUserCompliance, processUserLicenseReminders, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, remindUsersAboutLicenseExpiration, replaceUserLicenceWithObject, restoreVendorProFeatures, saveNotificationsInDb, schemaAdresource, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, splitEventDatesForArchive, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToCanceled, upgradeUserToLicence, userLicenseSchema, vendorOwnerHasProLicence, vendorProductTypeSchema };
1552
+ export { ACTIVE_NOT_DELETED_FILTER, AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, AdMetricsModel, AdModel, AffiliateModel, AppSettingModel, AuthHandoffTokenModel, type AuthHandoffTokenType, type AuthTokenClient, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, EnumPubSubEvents, EventDateArchiveModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, ImpersonationAuditModel, ImpersonationSessionModel, LicenceCategory, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, REMINDER_WINDOW_MAX_HOURS, REMINDER_WINDOW_MIN_HOURS, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, SUBSCRIPTION_REWARD_TIMEZONE, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaAppSettingsType, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventDateArchiveType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaImpersonationAuditType, type SchemaImpersonationSessionType, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaStripeSubscription, 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, buildInitialBillingCatalogEntries, buildLicenceExpiryPipeline, buildUserHasEnoughPointsFilter, buildUserPointAwardEntry, buildUserPointCreditFilter, buildUserPointDebitPipeline, buildUserPointEntryRemovalPipeline, checkOwnerHasLicence, connectToDatabase, convertObjectIdsToStrings, createLicenceObject, dateTimeSchema, dedupeArchivedSlotsByStartDateTime, didRemoveAnyEventDates, didRemoveAnyStartedDates, downgradeVendorProFeatures, ensureUserLicenseCompliance, ensureUserLicenseComplianceForUser, eventLicences, findAffiliateByPromoCode, findEventOrImportedMarketById, getBillingCatalogDefinition, getEventResourceInfo, getHighestLicenceForCategory, getLicenceCategory, getLicenceExpiryMode, getPartnerResourceInfo, getPayingEventStripeSubscriptionPlan, getPayingStripeSubscriptionPlan, getPayingVendorStripeSubscriptionPlan, getSubscriptionRewardPeriodBounds, getVendorResourceInfo, handleEventLicenceCompliance, handlePartnerLicenceCompliance, handleVendorLicenceCompliance, hasValidLicence, isStandardLicence, isValidObjectId, licenceCategoryMapping, licencePriority, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, partnerLicences, persistArchivedEventDates, processLicenseReminder, processUserCompliance, processUserLicenseReminders, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, remindUsersAboutLicenseExpiration, replaceUserLicenceWithObject, restoreVendorProFeatures, saveNotificationsInDb, schemaAdresource, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, splitEventDatesForArchive, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToCanceled, upgradeUserToLicence, userLicenseSchema, vendorOwnerHasProLicence, vendorProductTypeSchema };