@positivegrid/pg-mongoose-schema 28.0.0-beta.3 → 28.0.0-beta.5

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,229 @@
1
1
  import { CallbackError, FilterQuery, HydratedDocument, Model, Mongoose, Schema } from "mongoose";
2
2
 
3
+ //#region src/models/user.d.ts
4
+ declare class AuthError extends Error {
5
+ errorCode: string;
6
+ statusCode: number;
7
+ customData?: object;
8
+ constructor(code: string, message?: string, customData?: object);
9
+ }
10
+ declare const FLAG_EMAIL_EVENTS: readonly ["bounce", "complaint", "reject"];
11
+ interface IUserAuth {
12
+ firebase_id?: string;
13
+ google_id?: string;
14
+ apple_id?: string;
15
+ wechat_id?: string;
16
+ }
17
+ interface IUserMetadata {
18
+ gdpr: boolean;
19
+ country: string | null;
20
+ }
21
+ interface IUser {
22
+ username: string;
23
+ email: string;
24
+ password: string;
25
+ user_status: number;
26
+ user_role: number;
27
+ is_active: boolean;
28
+ activate_token: string | null;
29
+ activate_expire: Date | null;
30
+ fb_access_token: string | null;
31
+ facebook_id: string | null;
32
+ shopify_id: any;
33
+ bk_username: string[];
34
+ auth: IUserAuth;
35
+ metadata: IUserMetadata;
36
+ date_joined: Date;
37
+ last_login: Date;
38
+ }
39
+ interface IUserMethods {
40
+ authenticate(plainText: string): boolean;
41
+ makeSalt(): string;
42
+ }
43
+ interface IUserVirtuals {
44
+ id: string;
45
+ }
46
+ type UserDoc = HydratedDocument<IUser, IUserMethods & IUserVirtuals>;
47
+ type Cb$4<T> = (err: CallbackError | null, doc?: T | null) => void;
48
+ interface UserModel extends Model<IUser, {}, IUserMethods, IUserVirtuals> {
49
+ _async_auth(username: string, password: string): Promise<UserDoc>;
50
+ auth(uname: string, password: string, cb?: Cb$4<UserDoc>): Promise<UserDoc> | void;
51
+ login(query: FilterQuery<IUser>, cb: Cb$4<UserDoc>): void;
52
+ loginForPassport(query: FilterQuery<IUser>, cb: (err: unknown, user?: UserDoc) => void): void;
53
+ list(options: {
54
+ criteria?: FilterQuery<IUser>;
55
+ sort?: Record<string, 1 | -1>;
56
+ limit?: number;
57
+ page?: number;
58
+ }, cb: Cb$4<UserDoc[]>): void;
59
+ getUser(username: string, cb: Cb$4<UserDoc>): void;
60
+ getUserPromise(username: string): Promise<UserDoc | null>;
61
+ getUserById(id: string, cb: Cb$4<UserDoc>): void;
62
+ getUserFullData(username: string): Promise<any>;
63
+ getUserDetail(query: FilterQuery<IUser>, projectFields?: Record<string, 1 | 0>): Promise<any[]>;
64
+ getDealerDetail(query: FilterQuery<IUser>): Promise<any[]>;
65
+ createUser(userObj: Partial<IUser>, cb: Cb$4<UserDoc>): void;
66
+ deleteUser(userId: string, cb: Cb$4<unknown>): void;
67
+ findUserByEmail(email: string, cb: Cb$4<UserDoc[]>): void;
68
+ findByEmail(email: string): Promise<UserDoc | null>;
69
+ }
70
+ interface IUserProfile {
71
+ user_id: Schema.Types.ObjectId;
72
+ full_name: string | null;
73
+ first_name: string | null;
74
+ last_name: string | null;
75
+ title: string | null;
76
+ gender: string | null;
77
+ country: string | null;
78
+ postal: string | null;
79
+ city: string | null;
80
+ state: string | null;
81
+ address: string | null;
82
+ phone: string | null;
83
+ description?: string;
84
+ bc_token: string | null;
85
+ facebook_access_token: string | null;
86
+ reset_password_token: string | null;
87
+ profile_image_url: string | null;
88
+ profile_thumb_url: string | null;
89
+ facebook_image_url: string | null;
90
+ facebook_thumb_url: string | null;
91
+ reset_password_expire: Date | null;
92
+ is_email_verified: boolean;
93
+ is_registered: boolean;
94
+ stripe_customer_id: string | null;
95
+ selected_country: string | null;
96
+ date_joined: Date;
97
+ search_mark: number;
98
+ }
99
+ type UserProfileDoc = HydratedDocument<IUserProfile>;
100
+ interface UserProfileModel extends Model<IUserProfile, {}, {}, {}> {
101
+ createProfile(profileObj: Partial<IUserProfile>, cb: Cb$4<UserProfileDoc>): void;
102
+ updateProfileByUserId(userId: string, updateData: Partial<IUserProfile>, cb: Cb$4<UserProfileDoc>): void;
103
+ updateProfile(userId: string, updateProfileData: Partial<IUserProfile>): Promise<UserProfileDoc | null>;
104
+ getUserProfile(userId: string, cb: Cb$4<UserProfileDoc>): void;
105
+ getUserProfilePromise(userId: string): Promise<UserProfileDoc | null>;
106
+ getUserProfileDetail(userId: string, cb?: Cb$4<UserProfileDoc>): void | Promise<UserProfileDoc | null>;
107
+ getUserProfileByCondition(condition: FilterQuery<IUserProfile>, cb: Cb$4<UserProfileDoc>): void;
108
+ }
109
+ interface IUserProduct {
110
+ user_id: Schema.Types.ObjectId;
111
+ product: string;
112
+ platform: string;
113
+ metadata: any;
114
+ last_login: Date;
115
+ }
116
+ interface UserProductModel extends Model<IUserProduct, {}, {}, {}> {
117
+ detectUserProduct(userAgent: string): false | {
118
+ product: string;
119
+ platform: string;
120
+ };
121
+ }
122
+ interface IUserProductTracker {
123
+ user_id: Schema.Types.ObjectId;
124
+ product: string;
125
+ status: number;
126
+ created_on: Date;
127
+ }
128
+ interface IUserAddress {
129
+ user_id: Schema.Types.ObjectId;
130
+ country: string | null;
131
+ zip: string | null;
132
+ city: string | null;
133
+ state: string | null;
134
+ address: string | null;
135
+ phone: string | null;
136
+ default: boolean;
137
+ }
138
+ interface IApikey {
139
+ apikey: string;
140
+ permission: string[];
141
+ description: string;
142
+ status: boolean;
143
+ created_on: Date;
144
+ call_number?: number;
145
+ partner_name?: string;
146
+ updated_on: Date;
147
+ }
148
+ interface IUserReferral {
149
+ user_id: Schema.Types.ObjectId;
150
+ referred_user_email?: string;
151
+ created_on: Date;
152
+ updated_on: Date;
153
+ }
154
+ interface IUserEmailStatus {
155
+ user_id: Schema.Types.ObjectId;
156
+ email_status: string;
157
+ creted_on: Date;
158
+ }
159
+ interface IUserToken {
160
+ tid: string;
161
+ expired_at: Date;
162
+ created_on: Date;
163
+ }
164
+ type UserTokenDoc = HydratedDocument<IUserToken>;
165
+ interface UserTokenModel extends Model<IUserToken, {}, {}, {}> {
166
+ createTokenMeta(): Promise<UserTokenDoc>;
167
+ isValid(tid: string): Promise<boolean>;
168
+ revokeToken(tid: string): Promise<UserTokenDoc | null>;
169
+ }
170
+ interface IUserFollow {
171
+ user_id: Schema.Types.ObjectId;
172
+ follow_user_id: Schema.Types.ObjectId;
173
+ follow_platform?: string;
174
+ }
175
+ interface IUserPoints {
176
+ user_id: Schema.Types.ObjectId;
177
+ points: number;
178
+ lifetime_earned: number;
179
+ created_on: Date;
180
+ updated_on: Date;
181
+ }
182
+ interface IUserRewardHistory {
183
+ user_point_id: Schema.Types.ObjectId;
184
+ point_change: number;
185
+ event: string;
186
+ created_on: Date;
187
+ updated_on: Date;
188
+ }
189
+ interface IRewardPointsRedeemList {
190
+ name: string;
191
+ skus: string[];
192
+ discount_percent: number;
193
+ points_required: number;
194
+ created_on: Date;
195
+ }
196
+ interface IUserRedeemRewardPointsRecord {
197
+ user_id: Schema.Types.ObjectId;
198
+ reward_points_redeem_id: Schema.Types.ObjectId;
199
+ discount_code: string;
200
+ created_on: Date;
201
+ }
202
+ interface IIntermediateUserOrderReward {
203
+ email: string;
204
+ order_id: number;
205
+ price: number;
206
+ status: number;
207
+ created_on: Date;
208
+ }
209
+ type SimpleModel$3<T> = Model<T, {}, {}, {}>;
210
+ interface UserModels {
211
+ User: UserModel;
212
+ UserProfile: UserProfileModel;
213
+ ApiKey: SimpleModel$3<IApikey>;
214
+ UserProduct: UserProductModel;
215
+ UserProductTracker: SimpleModel$3<IUserProductTracker>;
216
+ UserReferral: SimpleModel$3<IUserReferral>;
217
+ UserEmailStatus: SimpleModel$3<IUserEmailStatus>;
218
+ UserToken: UserTokenModel;
219
+ UserFollow: SimpleModel$3<IUserFollow>;
220
+ UserPoints: SimpleModel$3<IUserPoints>;
221
+ UserRewardHistory: SimpleModel$3<IUserRewardHistory>;
222
+ RewardPointsRedeemList: SimpleModel$3<IRewardPointsRedeemList>;
223
+ UserRedeemRewardPointsRecord: SimpleModel$3<IUserRedeemRewardPointsRecord>;
224
+ IntermediateUserOrderReward: SimpleModel$3<IIntermediateUserOrderReward>;
225
+ }
226
+ //#endregion
3
227
  //#region src/models/banks.d.ts
4
228
  interface IBankList {
5
229
  name: string;
@@ -63,9 +287,9 @@ interface IActivationStatus {
63
287
  updated_on: Date;
64
288
  }
65
289
  type DeviceDoc = HydratedDocument<IDevice>;
66
- type Cb$4<T> = (err: CallbackError | null, docs?: T) => void;
290
+ type Cb$3<T> = (err: CallbackError | null, docs?: T) => void;
67
291
  interface DeviceModel extends Model<IDevice, {}, {}, {}> {
68
- getFeaturedPresetListByCondition(queryObj: FilterQuery<IDevice>, cb: Cb$4<DeviceDoc[]>): void;
292
+ getFeaturedPresetListByCondition(queryObj: FilterQuery<IDevice>, cb: Cb$3<DeviceDoc[]>): void;
69
293
  }
70
294
  type IapActivationModel = Model<IIapActivation, {}, {}, {}>;
71
295
  type ActivationStatusModel = Model<IActivationStatus, {}, {}, {}>;
@@ -514,15 +738,15 @@ interface ILicenseVirtuals {
514
738
  } | null;
515
739
  }
516
740
  type LicenseDoc = HydratedDocument<ILicense, ILicenseVirtuals>;
517
- type Cb$3<T> = (err: CallbackError | null, doc?: T) => void;
741
+ type Cb$2<T> = (err: CallbackError | null, doc?: T) => void;
518
742
  interface LicenseModel extends Model<ILicense, {}, {}, ILicenseVirtuals> {
519
743
  hasLicenseOrNot(userId: string, productId: string, cb: (err: Error | null) => void): void;
520
744
  hasLicensePromise(userID: string, productID: string): Promise<LicenseDoc | null>;
521
- getLicenseByRedeem(redeem: string, cb: Cb$3<any[]>): void;
745
+ getLicenseByRedeem(redeem: string, cb: Cb$2<any[]>): void;
522
746
  getLicenseByRedeemPromise(redeem: string, userID: string): Promise<any[]>;
523
- getUserLicense(query: FilterQuery<ILicense>, cb: Cb$3<any[]>): void;
747
+ getUserLicense(query: FilterQuery<ILicense>, cb: Cb$2<any[]>): void;
524
748
  getUserLicensePromise(query: FilterQuery<ILicense>): Promise<any[]>;
525
- getUserPurchase(query: FilterQuery<ILicense>, productType: string, cb: Cb$3<any[]>): void;
749
+ getUserPurchase(query: FilterQuery<ILicense>, productType: string, cb: Cb$2<any[]>): void;
526
750
  getUserPurchasePromise(query: FilterQuery<ILicense>, productType: string, opts?: {
527
751
  isLean?: boolean;
528
752
  }): Promise<any[]>;
@@ -530,7 +754,7 @@ interface LicenseModel extends Model<ILicense, {}, {}, ILicenseVirtuals> {
530
754
  createTrialLicense(data: Partial<ILicense> & {
531
755
  due_date: Date;
532
756
  }): Promise<LicenseDoc>;
533
- createLicense(data: Partial<ILicense>, cb: Cb$3<LicenseDoc>): void;
757
+ createLicense(data: Partial<ILicense>, cb: Cb$2<LicenseDoc>): void;
534
758
  createLicensePromise(data: Partial<ILicense>): Promise<LicenseDoc | null>;
535
759
  removeLicense(licenseID: string): Promise<LicenseDoc | null>;
536
760
  }
@@ -584,28 +808,28 @@ interface BcCartUpdateStatusModel extends Model<any, {}, {}, {}> {
584
808
  interface ProductModel extends Model<IProduct, {}, {}, {
585
809
  id: string;
586
810
  }> {
587
- getProductsByCondition(condition: FilterQuery<IProduct> | null, cb: Cb$3<any[]>): void;
588
- createProduct(data: Partial<IProduct>, cb: Cb$3<any>): void;
811
+ getProductsByCondition(condition: FilterQuery<IProduct> | null, cb: Cb$2<any[]>): void;
812
+ createProduct(data: Partial<IProduct>, cb: Cb$2<any>): void;
589
813
  }
590
- type SimpleModel$3<T> = Model<T, {}, {}, {}>;
814
+ type SimpleModel$2<T> = Model<T, {}, {}, {}>;
591
815
  interface PaymentModels {
592
816
  Product: ProductModel;
593
817
  License: LicenseModel;
594
818
  LicenseUpgradeMeta: LicenseUpgradeMetaModel;
595
- Bundle: SimpleModel$3<any>;
596
- Discount: SimpleModel$3<any>;
597
- EduDomain: SimpleModel$3<any>;
598
- EduUser: SimpleModel$3<any>;
599
- GuestCheckout: SimpleModel$3<any>;
819
+ Bundle: SimpleModel$2<any>;
820
+ Discount: SimpleModel$2<any>;
821
+ EduDomain: SimpleModel$2<any>;
822
+ EduUser: SimpleModel$2<any>;
823
+ GuestCheckout: SimpleModel$2<any>;
600
824
  CnCoupon: CnCouponModel;
601
825
  CnSalesMeta: CnSalesMetaModel;
602
826
  AdditionalPurchase: AdditionalPurchaseModel;
603
827
  BcCartUpdateStatus: BcCartUpdateStatusModel;
604
- UserOrder: SimpleModel$3<any>;
828
+ UserOrder: SimpleModel$2<any>;
605
829
  }
606
830
  //#endregion
607
831
  //#region src/models/pgConfig.d.ts
608
- type Cb$2<T> = (err: CallbackError | null, doc?: T | null) => void;
832
+ type Cb$1<T> = (err: CallbackError | null, doc?: T | null) => void;
609
833
  interface IPgConfig {
610
834
  config_key: string;
611
835
  config_value: any;
@@ -633,9 +857,9 @@ interface ICrashData {
633
857
  }
634
858
  type PgConfigDoc = HydratedDocument<IPgConfig>;
635
859
  interface PgConfigModel extends Model<IPgConfig, {}, {}, {}> {
636
- getConfigByKey(config_key: string, cb: Cb$2<PgConfigDoc>): void;
637
- createOrUpdateConfig(key: string, value: any, doMerge: boolean | Cb$2<PgConfigDoc>, cb?: Cb$2<PgConfigDoc>): void;
638
- deleteConfig(key: string, cb: Cb$2<PgConfigDoc>): void;
860
+ getConfigByKey(config_key: string, cb: Cb$1<PgConfigDoc>): void;
861
+ createOrUpdateConfig(key: string, value: any, doMerge: boolean | Cb$1<PgConfigDoc>, cb?: Cb$1<PgConfigDoc>): void;
862
+ deleteConfig(key: string, cb: Cb$1<PgConfigDoc>): void;
639
863
  }
640
864
  type PgLoggingModel = Model<IPgLogging, {}, {}, {}>;
641
865
  type KeyValueModel = Model<IKeyValue, {}, {}, {}>;
@@ -697,41 +921,41 @@ interface IPresetVirtuals {
697
921
  preset_version: string;
698
922
  }
699
923
  type PresetDoc = HydratedDocument<IPreset, IPresetVirtuals>;
700
- type Cb$1<T> = (err: CallbackError | null, doc?: T | null) => void;
924
+ type Cb<T> = (err: CallbackError | null, doc?: T | null) => void;
701
925
  interface PresetModel extends Model<IPreset, {}, {}, IPresetVirtuals> {
702
- getPresetByUserId(userId: string, cb: Cb$1<PresetDoc[]>): void;
926
+ getPresetByUserId(userId: string, cb: Cb<PresetDoc[]>): void;
703
927
  getPresetByQuery(req: PresetReq, opts?: {
704
928
  full?: boolean;
705
929
  }): Promise<any[]>;
706
930
  getPresetsBySearch(req: PresetReq): Promise<any[]>;
707
- getPresetsList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb$1<PresetDoc[]>): void;
931
+ getPresetsList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb<PresetDoc[]>): void;
708
932
  getPresetsListPromise(query: Record<string, any>, sort: any, req: PresetReq): Promise<PresetDoc[]>;
709
- getMyPresets(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb$1<PresetDoc[]>): void;
933
+ getMyPresets(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb<PresetDoc[]>): void;
710
934
  getOnePresetByCondition(query: Record<string, any>, opts: {
711
935
  sort?: any;
712
936
  select?: string;
713
- }, cb: Cb$1<PresetDoc>): void;
714
- getSinglePreset(id: string, cb: Cb$1<PresetDoc>): void;
715
- getValidSinglePreset(id: string, cb: Cb$1<PresetDoc>): void;
937
+ }, cb: Cb<PresetDoc>): void;
938
+ getSinglePreset(id: string, cb: Cb<PresetDoc>): void;
939
+ getValidSinglePreset(id: string, cb: Cb<PresetDoc>): void;
716
940
  }
717
941
  interface PresetCommentModel extends Model<any, {}, {}, {}> {
718
942
  getPresetComments(presetId: string, req: PresetReq): Promise<any[]>;
719
943
  }
720
944
  interface PresetLikeModel extends Model<any, {}, {}, {}> {
721
- getCountByPresetCondition(query: FilterQuery<any>, condition: string, cb: Cb$1<number>): void;
722
- getPresetLikeList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb$1<any[]>): void;
945
+ getCountByPresetCondition(query: FilterQuery<any>, condition: string, cb: Cb<number>): void;
946
+ getPresetLikeList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb<any[]>): void;
723
947
  getPresetLikeListPromise(query: Record<string, any>, sort: any, req: PresetReq): Promise<any[]>;
724
948
  }
725
- type SimpleModel$2<T> = Model<T, {}, {}, {}>;
949
+ type SimpleModel$1<T> = Model<T, {}, {}, {}>;
726
950
  interface PresetModels {
727
951
  Preset: PresetModel;
728
952
  PresetComment: PresetCommentModel;
729
953
  PresetLike: PresetLikeModel;
730
- PresetDownload: SimpleModel$2<any>;
731
- PopularPresetList: SimpleModel$2<any>;
732
- FakePresetLike: SimpleModel$2<any>;
733
- PresetTagsMeta: SimpleModel$2<any>;
734
- PresetSongMapping: SimpleModel$2<any>;
954
+ PresetDownload: SimpleModel$1<any>;
955
+ PopularPresetList: SimpleModel$1<any>;
956
+ FakePresetLike: SimpleModel$1<any>;
957
+ PresetTagsMeta: SimpleModel$1<any>;
958
+ PresetSongMapping: SimpleModel$1<any>;
735
959
  }
736
960
  //#endregion
737
961
  //#region src/models/promotion.d.ts
@@ -1049,185 +1273,6 @@ interface IToneThemeFeaturedList {
1049
1273
  type ToneThemeFeaturedListDoc = HydratedDocument<IToneThemeFeaturedList>;
1050
1274
  type ToneThemeFeaturedListModel = Model<IToneThemeFeaturedList, {}, {}, {}>;
1051
1275
  //#endregion
1052
- //#region src/models/user.d.ts
1053
- declare const FLAG_EMAIL_EVENTS: readonly ["bounce", "complaint", "reject"];
1054
- interface IUserAuth {
1055
- firebase_id?: string;
1056
- google_id?: string;
1057
- apple_id?: string;
1058
- wechat_id?: string;
1059
- }
1060
- interface IUserMetadata {
1061
- gdpr: boolean;
1062
- country: string | null;
1063
- }
1064
- interface IUser {
1065
- username: string;
1066
- email: string;
1067
- password: string;
1068
- user_status: number;
1069
- user_role: number;
1070
- is_active: boolean;
1071
- activate_token: string | null;
1072
- activate_expire: Date | null;
1073
- fb_access_token: string | null;
1074
- facebook_id: string | null;
1075
- shopify_id: any;
1076
- bk_username: string[];
1077
- auth: IUserAuth;
1078
- metadata: IUserMetadata;
1079
- date_joined: Date;
1080
- last_login: Date;
1081
- }
1082
- interface IUserMethods {
1083
- authenticate(plainText: string): boolean;
1084
- makeSalt(): string;
1085
- }
1086
- interface IUserVirtuals {
1087
- id: string;
1088
- }
1089
- type UserDoc = HydratedDocument<IUser, IUserMethods & IUserVirtuals>;
1090
- type Cb<T> = (err: CallbackError | null, doc?: T | null) => void;
1091
- interface UserModel extends Model<IUser, {}, IUserMethods, IUserVirtuals> {
1092
- _async_auth(username: string, password: string): Promise<UserDoc>;
1093
- auth(uname: string, password: string, cb?: Cb<UserDoc>): Promise<UserDoc> | void;
1094
- login(query: FilterQuery<IUser>, cb: Cb<UserDoc>): void;
1095
- loginForPassport(query: FilterQuery<IUser>, cb: (err: unknown, user?: UserDoc) => void): void;
1096
- list(options: {
1097
- criteria?: FilterQuery<IUser>;
1098
- sort?: Record<string, 1 | -1>;
1099
- limit?: number;
1100
- page?: number;
1101
- }, cb: Cb<UserDoc[]>): void;
1102
- getUser(username: string, cb: Cb<UserDoc>): void;
1103
- getUserPromise(username: string): Promise<UserDoc | null>;
1104
- getUserById(id: string, cb: Cb<UserDoc>): void;
1105
- getUserFullData(username: string): Promise<any>;
1106
- getUserDetail(query: FilterQuery<IUser>, projectFields?: Record<string, 1 | 0>): Promise<any[]>;
1107
- getDealerDetail(query: FilterQuery<IUser>): Promise<any[]>;
1108
- createUser(userObj: Partial<IUser>, cb: Cb<UserDoc>): void;
1109
- deleteUser(userId: string, cb: Cb<unknown>): void;
1110
- findUserByEmail(email: string, cb: Cb<UserDoc[]>): void;
1111
- findByEmail(email: string): Promise<UserDoc | null>;
1112
- }
1113
- interface IUserProfile {
1114
- user_id: Schema.Types.ObjectId;
1115
- full_name: string | null;
1116
- first_name: string | null;
1117
- last_name: string | null;
1118
- title: string | null;
1119
- gender: string | null;
1120
- country: string | null;
1121
- postal: string | null;
1122
- city: string | null;
1123
- state: string | null;
1124
- address: string | null;
1125
- phone: string | null;
1126
- description?: string;
1127
- bc_token: string | null;
1128
- facebook_access_token: string | null;
1129
- reset_password_token: string | null;
1130
- profile_image_url: string | null;
1131
- profile_thumb_url: string | null;
1132
- facebook_image_url: string | null;
1133
- facebook_thumb_url: string | null;
1134
- reset_password_expire: Date | null;
1135
- is_email_verified: boolean;
1136
- is_registered: boolean;
1137
- stripe_customer_id: string | null;
1138
- selected_country: string | null;
1139
- date_joined: Date;
1140
- search_mark: number;
1141
- }
1142
- type UserProfileDoc = HydratedDocument<IUserProfile>;
1143
- interface UserProfileModel extends Model<IUserProfile, {}, {}, {}> {
1144
- createProfile(profileObj: Partial<IUserProfile>, cb: Cb<UserProfileDoc>): void;
1145
- updateProfileByUserId(userId: string, updateData: Partial<IUserProfile>, cb: Cb<UserProfileDoc>): void;
1146
- updateProfile(userId: string, updateProfileData: Partial<IUserProfile>): Promise<UserProfileDoc | null>;
1147
- getUserProfile(userId: string, cb: Cb<UserProfileDoc>): void;
1148
- getUserProfilePromise(userId: string): Promise<UserProfileDoc | null>;
1149
- getUserProfileDetail(userId: string, cb?: Cb<UserProfileDoc>): void | Promise<UserProfileDoc | null>;
1150
- getUserProfileByCondition(condition: FilterQuery<IUserProfile>, cb: Cb<UserProfileDoc>): void;
1151
- }
1152
- interface IUserProduct {
1153
- user_id: Schema.Types.ObjectId;
1154
- product: string;
1155
- platform: string;
1156
- metadata: any;
1157
- last_login: Date;
1158
- }
1159
- interface UserProductModel extends Model<IUserProduct, {}, {}, {}> {
1160
- detectUserProduct(userAgent: string): false | {
1161
- product: string;
1162
- platform: string;
1163
- };
1164
- }
1165
- interface IUserProductTracker {
1166
- user_id: Schema.Types.ObjectId;
1167
- product: string;
1168
- status: number;
1169
- created_on: Date;
1170
- }
1171
- interface IUserAddress {
1172
- user_id: Schema.Types.ObjectId;
1173
- country: string | null;
1174
- zip: string | null;
1175
- city: string | null;
1176
- state: string | null;
1177
- address: string | null;
1178
- phone: string | null;
1179
- default: boolean;
1180
- }
1181
- interface IApikey {
1182
- apikey: string;
1183
- permission: string[];
1184
- description: string;
1185
- status: boolean;
1186
- created_on: Date;
1187
- call_number?: number;
1188
- partner_name?: string;
1189
- updated_on: Date;
1190
- }
1191
- interface IUserReferral {
1192
- user_id: Schema.Types.ObjectId;
1193
- referred_user_email?: string;
1194
- created_on: Date;
1195
- updated_on: Date;
1196
- }
1197
- interface IUserEmailStatus {
1198
- user_id: Schema.Types.ObjectId;
1199
- email_status: string;
1200
- creted_on: Date;
1201
- }
1202
- interface IUserToken {
1203
- tid: string;
1204
- expired_at: Date;
1205
- created_on: Date;
1206
- }
1207
- type UserTokenDoc = HydratedDocument<IUserToken>;
1208
- interface UserTokenModel extends Model<IUserToken, {}, {}, {}> {
1209
- createTokenMeta(): Promise<UserTokenDoc>;
1210
- isValid(tid: string): Promise<boolean>;
1211
- revokeToken(tid: string): Promise<UserTokenDoc | null>;
1212
- }
1213
- interface IUserFollow {
1214
- user_id: Schema.Types.ObjectId;
1215
- follow_user_id: Schema.Types.ObjectId;
1216
- follow_platform?: string;
1217
- }
1218
- type SimpleModel$1<T> = Model<T, {}, {}, {}>;
1219
- interface UserModels {
1220
- User: UserModel;
1221
- UserProfile: UserProfileModel;
1222
- ApiKey: SimpleModel$1<IApikey>;
1223
- UserProduct: UserProductModel;
1224
- UserProductTracker: SimpleModel$1<IUserProductTracker>;
1225
- UserReferral: SimpleModel$1<IUserReferral>;
1226
- UserEmailStatus: SimpleModel$1<IUserEmailStatus>;
1227
- UserToken: UserTokenModel;
1228
- UserFollow: SimpleModel$1<IUserFollow>;
1229
- }
1230
- //#endregion
1231
1276
  //#region src/models/userTrack.d.ts
1232
1277
  declare const LICENSE_ADDITION: {
1233
1278
  readonly PRO: 0;
@@ -1285,4 +1330,4 @@ type DemoUserTrackerDoc = HydratedDocument<IDemoUserTracker>;
1285
1330
  type RegistryType = "account" | "hardware" | undefined;
1286
1331
  declare function register(mongoose: Mongoose, type?: RegistryType): void;
1287
1332
  //#endregion
1288
- export { type AccessTokenModel, type ActivationStatusModel, type AdditionalPurchaseModel, type AuthorizationCodeDoc, type AuthorizationCodeModel, type B2bDealerModel, type B2bRedeemModel, type B2bRedeemOrderModel, type BankListDoc, type BankListModel, type BankPresetsDoc, type BankPresetsModel, type BanksModels, type BcCartUpdateStatusModel, type CAMPAIGN_TYPE, type CnCouponDoc, type CnCouponMethods, type CnCouponModel, type CnSalesMetaModel, type CountryHardwareSkuModel, type CrashDataModel, type DataSourceType, type DemoUserTrackerDoc, type DemoUserTrackerModel, type DeviceDoc, type DeviceModel, type DeviceModels, type FLAG_EMAIL_EVENTS, type FeaturedListDoc, type FeaturedListModel, type FeaturedListModels, type FeaturedPresetModel, type GenericDataModel, type HardwareActivationConflictModel, type HardwareActivationMetaModel, type HardwareActivationRecordModel, type HardwareModels, type HardwareSeriesNumberModel, type HomeConfigDoc, type HomeConfigModel, type IAccessToken, type IActionButton, type IActivationStatus, type IApikey, type IAuthorizationCode, type IB2bDealer, type IB2bRedeem, type IB2bRedeemOrder, type IBankList, type IBankPresets, type ICampaignUserInfo, type ICnCoupon, type ICountryHardwareSku, type ICouponPromotion, type ICrashData, type IDataSource, type IDemoUserTracker, type IDevice, type IFeaturedList, type IFeaturedListVirtuals, type IFeaturedPreset, type IFreeTrial, type IGearTrialMeta, type IGearTrialRecord, type IGenericData, type IHardwareActivationConflict, type IHardwareActivationMeta, type IHardwareActivationRecord, type IHardwareSeriesNumber, type IHomeConfig, type IIapActivation, type IIapEvent, type IIasBuyOption, type IIasPromotion, type IIasStorePageMeta, type IItemInventoryHistory, type IKeyValue, type ILicense, type ILicenseCampaignMeta, type ILicenseCampaignRecord, type ILicenseVirtuals, type IOauthClient, type IOemRedeemPromotion, type IPartnerCoupon, type IPartnerRedeem, type IPartnerSalesHistory, type IPartnerSalesMeta, type IPgConfig, type IPgLogging, type IPreset, type IPresetVirtuals, type IProduct, type IPromotion, type IPublicAnnouncement, type IPublicAnnouncementFreeTrial, type IPublicAnnouncementUserList, type IPublicAnnouncementUserListLog, type IRedeemCode, type IRefreshToken, type ISection, type ISpecialOffer, type ITierSalesMeta, type ITierSalesRules, type IToneTheme, type IToneThemeFeaturedList, type IToneThemeVirtuals, type IUser, type IUserAddress, type IUserAuth, type IUserEmailStatus, type IUserFollow, type IUserMetadata, type IUserMethods, type IUserProduct, type IUserProductTracker, type IUserProfile, type IUserReferral, type IUserToken, type IUserVirtuals, type IWarehouseInventory, type IYotpoLoyalty, type IYotpoLoyaltyBackup, type IapActivationModel, type IapEventModel, type ItemInventoryHistoryModel, type KeyValueModel, type LICENSE_ADDITION, type LicenseAdditionKey, type LicenseDoc, type LicenseModel, type LicenseUpgradeMetaModel, type OEM_APOGEE_SUPPORT_LICENSE, type OEM_FOCUSRITE_SUPPORT_LICENSE, type OEM_PROMOTION_TYPE, type OEM_PROSONUS_SUPPORT_LICENSE, type OauthClientModel, type OauthModels, type OemRedeemPromotionModel, type PRODUCTS, type PURCHASE_ITEM_TYPE, type ParsedGenericSerialNumber, type ParsedSerialNumber, type ParsedSparkSerialNumber, type PartnerCouponModel, type PartnerModels, type PartnerRedeemModel, type PartnerSalesHistoryModel, type PartnerSalesMetaModel, type PaymentModels, type PgConfigDoc, type PgConfigModel, type PgConfigModels, type PgLoggingModel, type PresetCommentModel, type PresetDoc, type PresetLikeModel, type PresetModel, type PresetModels, type Product, type ProductModel, type PromotionModels, type PublicAnnouncementDoc, type PublicAnnouncementFreeTrialModel, type PublicAnnouncementModel, type PublicAnnouncementUserListModel, type RedeemCodeDoc, type RedeemCodeModel, type RefreshTokenModel, RegistryType, type SaveTrackInput, type SectionType, type SimpleModel, type ToneThemeDoc, type ToneThemeFeaturedListDoc, type ToneThemeFeaturedListModel, type ToneThemeModel, type UserDoc, type UserModel, type UserModels, type UserProductModel, type UserProfileDoc, type UserProfileModel, type UserTokenDoc, type UserTokenModel, type UserTrackModels, type WarehouseInventoryModel, type _buildLicenseTierQuery, type _buildPresetVersionQuery, type _buildSortQuery, type _filterKeyword, type _handlePresetVersion, type _identifyHardwareByModel, type _identifyItemTypeBySku, type _oemMetaToLicenseName, type _parseHardwareSerialNumber, type _parsePageParams, type _queryCompatibilityHandler, register as default, register };
1333
+ export { type AccessTokenModel, type ActivationStatusModel, type AdditionalPurchaseModel, AuthError, type AuthorizationCodeDoc, type AuthorizationCodeModel, type B2bDealerModel, type B2bRedeemModel, type B2bRedeemOrderModel, type BankListDoc, type BankListModel, type BankPresetsDoc, type BankPresetsModel, type BanksModels, type BcCartUpdateStatusModel, type CAMPAIGN_TYPE, type CnCouponDoc, type CnCouponMethods, type CnCouponModel, type CnSalesMetaModel, type CountryHardwareSkuModel, type CrashDataModel, type DataSourceType, type DemoUserTrackerDoc, type DemoUserTrackerModel, type DeviceDoc, type DeviceModel, type DeviceModels, type FLAG_EMAIL_EVENTS, type FeaturedListDoc, type FeaturedListModel, type FeaturedListModels, type FeaturedPresetModel, type GenericDataModel, type HardwareActivationConflictModel, type HardwareActivationMetaModel, type HardwareActivationRecordModel, type HardwareModels, type HardwareSeriesNumberModel, type HomeConfigDoc, type HomeConfigModel, type IAccessToken, type IActionButton, type IActivationStatus, type IApikey, type IAuthorizationCode, type IB2bDealer, type IB2bRedeem, type IB2bRedeemOrder, type IBankList, type IBankPresets, type ICampaignUserInfo, type ICnCoupon, type ICountryHardwareSku, type ICouponPromotion, type ICrashData, type IDataSource, type IDemoUserTracker, type IDevice, type IFeaturedList, type IFeaturedListVirtuals, type IFeaturedPreset, type IFreeTrial, type IGearTrialMeta, type IGearTrialRecord, type IGenericData, type IHardwareActivationConflict, type IHardwareActivationMeta, type IHardwareActivationRecord, type IHardwareSeriesNumber, type IHomeConfig, type IIapActivation, type IIapEvent, type IIasBuyOption, type IIasPromotion, type IIasStorePageMeta, type IIntermediateUserOrderReward, type IItemInventoryHistory, type IKeyValue, type ILicense, type ILicenseCampaignMeta, type ILicenseCampaignRecord, type ILicenseVirtuals, type IOauthClient, type IOemRedeemPromotion, type IPartnerCoupon, type IPartnerRedeem, type IPartnerSalesHistory, type IPartnerSalesMeta, type IPgConfig, type IPgLogging, type IPreset, type IPresetVirtuals, type IProduct, type IPromotion, type IPublicAnnouncement, type IPublicAnnouncementFreeTrial, type IPublicAnnouncementUserList, type IPublicAnnouncementUserListLog, type IRedeemCode, type IRefreshToken, type IRewardPointsRedeemList, type ISection, type ISpecialOffer, type ITierSalesMeta, type ITierSalesRules, type IToneTheme, type IToneThemeFeaturedList, type IToneThemeVirtuals, type IUser, type IUserAddress, type IUserAuth, type IUserEmailStatus, type IUserFollow, type IUserMetadata, type IUserMethods, type IUserPoints, type IUserProduct, type IUserProductTracker, type IUserProfile, type IUserRedeemRewardPointsRecord, type IUserReferral, type IUserRewardHistory, type IUserToken, type IUserVirtuals, type IWarehouseInventory, type IYotpoLoyalty, type IYotpoLoyaltyBackup, type IapActivationModel, type IapEventModel, type ItemInventoryHistoryModel, type KeyValueModel, type LICENSE_ADDITION, type LicenseAdditionKey, type LicenseDoc, type LicenseModel, type LicenseUpgradeMetaModel, type OEM_APOGEE_SUPPORT_LICENSE, type OEM_FOCUSRITE_SUPPORT_LICENSE, type OEM_PROMOTION_TYPE, type OEM_PROSONUS_SUPPORT_LICENSE, type OauthClientModel, type OauthModels, type OemRedeemPromotionModel, type PRODUCTS, type PURCHASE_ITEM_TYPE, type ParsedGenericSerialNumber, type ParsedSerialNumber, type ParsedSparkSerialNumber, type PartnerCouponModel, type PartnerModels, type PartnerRedeemModel, type PartnerSalesHistoryModel, type PartnerSalesMetaModel, type PaymentModels, type PgConfigDoc, type PgConfigModel, type PgConfigModels, type PgLoggingModel, type PresetCommentModel, type PresetDoc, type PresetLikeModel, type PresetModel, type PresetModels, type Product, type ProductModel, type PromotionModels, type PublicAnnouncementDoc, type PublicAnnouncementFreeTrialModel, type PublicAnnouncementModel, type PublicAnnouncementUserListModel, type RedeemCodeDoc, type RedeemCodeModel, type RefreshTokenModel, RegistryType, type SaveTrackInput, type SectionType, type SimpleModel, type ToneThemeDoc, type ToneThemeFeaturedListDoc, type ToneThemeFeaturedListModel, type ToneThemeModel, type UserDoc, type UserModel, type UserModels, type UserProductModel, type UserProfileDoc, type UserProfileModel, type UserTokenDoc, type UserTokenModel, type UserTrackModels, type WarehouseInventoryModel, type _buildLicenseTierQuery, type _buildPresetVersionQuery, type _buildSortQuery, type _filterKeyword, type _handlePresetVersion, type _identifyHardwareByModel, type _identifyItemTypeBySku, type _oemMetaToLicenseName, type _parseHardwareSerialNumber, type _parsePageParams, type _queryCompatibilityHandler, register as default, register };