@positivegrid/pg-mongoose-schema 28.0.0-beta.3 → 28.0.0-beta.4
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.cjs +212 -153
- package/dist/index.d.mts +221 -215
- package/dist/index.mjs +213 -151
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,190 @@
|
|
|
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
|
+
type SimpleModel$3<T> = Model<T, {}, {}, {}>;
|
|
176
|
+
interface UserModels {
|
|
177
|
+
User: UserModel;
|
|
178
|
+
UserProfile: UserProfileModel;
|
|
179
|
+
ApiKey: SimpleModel$3<IApikey>;
|
|
180
|
+
UserProduct: UserProductModel;
|
|
181
|
+
UserProductTracker: SimpleModel$3<IUserProductTracker>;
|
|
182
|
+
UserReferral: SimpleModel$3<IUserReferral>;
|
|
183
|
+
UserEmailStatus: SimpleModel$3<IUserEmailStatus>;
|
|
184
|
+
UserToken: UserTokenModel;
|
|
185
|
+
UserFollow: SimpleModel$3<IUserFollow>;
|
|
186
|
+
}
|
|
187
|
+
//#endregion
|
|
3
188
|
//#region src/models/banks.d.ts
|
|
4
189
|
interface IBankList {
|
|
5
190
|
name: string;
|
|
@@ -63,9 +248,9 @@ interface IActivationStatus {
|
|
|
63
248
|
updated_on: Date;
|
|
64
249
|
}
|
|
65
250
|
type DeviceDoc = HydratedDocument<IDevice>;
|
|
66
|
-
type Cb$
|
|
251
|
+
type Cb$3<T> = (err: CallbackError | null, docs?: T) => void;
|
|
67
252
|
interface DeviceModel extends Model<IDevice, {}, {}, {}> {
|
|
68
|
-
getFeaturedPresetListByCondition(queryObj: FilterQuery<IDevice>, cb: Cb$
|
|
253
|
+
getFeaturedPresetListByCondition(queryObj: FilterQuery<IDevice>, cb: Cb$3<DeviceDoc[]>): void;
|
|
69
254
|
}
|
|
70
255
|
type IapActivationModel = Model<IIapActivation, {}, {}, {}>;
|
|
71
256
|
type ActivationStatusModel = Model<IActivationStatus, {}, {}, {}>;
|
|
@@ -514,15 +699,15 @@ interface ILicenseVirtuals {
|
|
|
514
699
|
} | null;
|
|
515
700
|
}
|
|
516
701
|
type LicenseDoc = HydratedDocument<ILicense, ILicenseVirtuals>;
|
|
517
|
-
type Cb$
|
|
702
|
+
type Cb$2<T> = (err: CallbackError | null, doc?: T) => void;
|
|
518
703
|
interface LicenseModel extends Model<ILicense, {}, {}, ILicenseVirtuals> {
|
|
519
704
|
hasLicenseOrNot(userId: string, productId: string, cb: (err: Error | null) => void): void;
|
|
520
705
|
hasLicensePromise(userID: string, productID: string): Promise<LicenseDoc | null>;
|
|
521
|
-
getLicenseByRedeem(redeem: string, cb: Cb$
|
|
706
|
+
getLicenseByRedeem(redeem: string, cb: Cb$2<any[]>): void;
|
|
522
707
|
getLicenseByRedeemPromise(redeem: string, userID: string): Promise<any[]>;
|
|
523
|
-
getUserLicense(query: FilterQuery<ILicense>, cb: Cb$
|
|
708
|
+
getUserLicense(query: FilterQuery<ILicense>, cb: Cb$2<any[]>): void;
|
|
524
709
|
getUserLicensePromise(query: FilterQuery<ILicense>): Promise<any[]>;
|
|
525
|
-
getUserPurchase(query: FilterQuery<ILicense>, productType: string, cb: Cb$
|
|
710
|
+
getUserPurchase(query: FilterQuery<ILicense>, productType: string, cb: Cb$2<any[]>): void;
|
|
526
711
|
getUserPurchasePromise(query: FilterQuery<ILicense>, productType: string, opts?: {
|
|
527
712
|
isLean?: boolean;
|
|
528
713
|
}): Promise<any[]>;
|
|
@@ -530,7 +715,7 @@ interface LicenseModel extends Model<ILicense, {}, {}, ILicenseVirtuals> {
|
|
|
530
715
|
createTrialLicense(data: Partial<ILicense> & {
|
|
531
716
|
due_date: Date;
|
|
532
717
|
}): Promise<LicenseDoc>;
|
|
533
|
-
createLicense(data: Partial<ILicense>, cb: Cb$
|
|
718
|
+
createLicense(data: Partial<ILicense>, cb: Cb$2<LicenseDoc>): void;
|
|
534
719
|
createLicensePromise(data: Partial<ILicense>): Promise<LicenseDoc | null>;
|
|
535
720
|
removeLicense(licenseID: string): Promise<LicenseDoc | null>;
|
|
536
721
|
}
|
|
@@ -584,28 +769,28 @@ interface BcCartUpdateStatusModel extends Model<any, {}, {}, {}> {
|
|
|
584
769
|
interface ProductModel extends Model<IProduct, {}, {}, {
|
|
585
770
|
id: string;
|
|
586
771
|
}> {
|
|
587
|
-
getProductsByCondition(condition: FilterQuery<IProduct> | null, cb: Cb$
|
|
588
|
-
createProduct(data: Partial<IProduct>, cb: Cb$
|
|
772
|
+
getProductsByCondition(condition: FilterQuery<IProduct> | null, cb: Cb$2<any[]>): void;
|
|
773
|
+
createProduct(data: Partial<IProduct>, cb: Cb$2<any>): void;
|
|
589
774
|
}
|
|
590
|
-
type SimpleModel$
|
|
775
|
+
type SimpleModel$2<T> = Model<T, {}, {}, {}>;
|
|
591
776
|
interface PaymentModels {
|
|
592
777
|
Product: ProductModel;
|
|
593
778
|
License: LicenseModel;
|
|
594
779
|
LicenseUpgradeMeta: LicenseUpgradeMetaModel;
|
|
595
|
-
Bundle: SimpleModel$
|
|
596
|
-
Discount: SimpleModel$
|
|
597
|
-
EduDomain: SimpleModel$
|
|
598
|
-
EduUser: SimpleModel$
|
|
599
|
-
GuestCheckout: SimpleModel$
|
|
780
|
+
Bundle: SimpleModel$2<any>;
|
|
781
|
+
Discount: SimpleModel$2<any>;
|
|
782
|
+
EduDomain: SimpleModel$2<any>;
|
|
783
|
+
EduUser: SimpleModel$2<any>;
|
|
784
|
+
GuestCheckout: SimpleModel$2<any>;
|
|
600
785
|
CnCoupon: CnCouponModel;
|
|
601
786
|
CnSalesMeta: CnSalesMetaModel;
|
|
602
787
|
AdditionalPurchase: AdditionalPurchaseModel;
|
|
603
788
|
BcCartUpdateStatus: BcCartUpdateStatusModel;
|
|
604
|
-
UserOrder: SimpleModel$
|
|
789
|
+
UserOrder: SimpleModel$2<any>;
|
|
605
790
|
}
|
|
606
791
|
//#endregion
|
|
607
792
|
//#region src/models/pgConfig.d.ts
|
|
608
|
-
type Cb$
|
|
793
|
+
type Cb$1<T> = (err: CallbackError | null, doc?: T | null) => void;
|
|
609
794
|
interface IPgConfig {
|
|
610
795
|
config_key: string;
|
|
611
796
|
config_value: any;
|
|
@@ -633,9 +818,9 @@ interface ICrashData {
|
|
|
633
818
|
}
|
|
634
819
|
type PgConfigDoc = HydratedDocument<IPgConfig>;
|
|
635
820
|
interface PgConfigModel extends Model<IPgConfig, {}, {}, {}> {
|
|
636
|
-
getConfigByKey(config_key: string, cb: Cb$
|
|
637
|
-
createOrUpdateConfig(key: string, value: any, doMerge: boolean | Cb$
|
|
638
|
-
deleteConfig(key: string, cb: Cb$
|
|
821
|
+
getConfigByKey(config_key: string, cb: Cb$1<PgConfigDoc>): void;
|
|
822
|
+
createOrUpdateConfig(key: string, value: any, doMerge: boolean | Cb$1<PgConfigDoc>, cb?: Cb$1<PgConfigDoc>): void;
|
|
823
|
+
deleteConfig(key: string, cb: Cb$1<PgConfigDoc>): void;
|
|
639
824
|
}
|
|
640
825
|
type PgLoggingModel = Model<IPgLogging, {}, {}, {}>;
|
|
641
826
|
type KeyValueModel = Model<IKeyValue, {}, {}, {}>;
|
|
@@ -697,41 +882,41 @@ interface IPresetVirtuals {
|
|
|
697
882
|
preset_version: string;
|
|
698
883
|
}
|
|
699
884
|
type PresetDoc = HydratedDocument<IPreset, IPresetVirtuals>;
|
|
700
|
-
type Cb
|
|
885
|
+
type Cb<T> = (err: CallbackError | null, doc?: T | null) => void;
|
|
701
886
|
interface PresetModel extends Model<IPreset, {}, {}, IPresetVirtuals> {
|
|
702
|
-
getPresetByUserId(userId: string, cb: Cb
|
|
887
|
+
getPresetByUserId(userId: string, cb: Cb<PresetDoc[]>): void;
|
|
703
888
|
getPresetByQuery(req: PresetReq, opts?: {
|
|
704
889
|
full?: boolean;
|
|
705
890
|
}): Promise<any[]>;
|
|
706
891
|
getPresetsBySearch(req: PresetReq): Promise<any[]>;
|
|
707
|
-
getPresetsList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb
|
|
892
|
+
getPresetsList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb<PresetDoc[]>): void;
|
|
708
893
|
getPresetsListPromise(query: Record<string, any>, sort: any, req: PresetReq): Promise<PresetDoc[]>;
|
|
709
|
-
getMyPresets(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb
|
|
894
|
+
getMyPresets(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb<PresetDoc[]>): void;
|
|
710
895
|
getOnePresetByCondition(query: Record<string, any>, opts: {
|
|
711
896
|
sort?: any;
|
|
712
897
|
select?: string;
|
|
713
|
-
}, cb: Cb
|
|
714
|
-
getSinglePreset(id: string, cb: Cb
|
|
715
|
-
getValidSinglePreset(id: string, cb: Cb
|
|
898
|
+
}, cb: Cb<PresetDoc>): void;
|
|
899
|
+
getSinglePreset(id: string, cb: Cb<PresetDoc>): void;
|
|
900
|
+
getValidSinglePreset(id: string, cb: Cb<PresetDoc>): void;
|
|
716
901
|
}
|
|
717
902
|
interface PresetCommentModel extends Model<any, {}, {}, {}> {
|
|
718
903
|
getPresetComments(presetId: string, req: PresetReq): Promise<any[]>;
|
|
719
904
|
}
|
|
720
905
|
interface PresetLikeModel extends Model<any, {}, {}, {}> {
|
|
721
|
-
getCountByPresetCondition(query: FilterQuery<any>, condition: string, cb: Cb
|
|
722
|
-
getPresetLikeList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb
|
|
906
|
+
getCountByPresetCondition(query: FilterQuery<any>, condition: string, cb: Cb<number>): void;
|
|
907
|
+
getPresetLikeList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb<any[]>): void;
|
|
723
908
|
getPresetLikeListPromise(query: Record<string, any>, sort: any, req: PresetReq): Promise<any[]>;
|
|
724
909
|
}
|
|
725
|
-
type SimpleModel$
|
|
910
|
+
type SimpleModel$1<T> = Model<T, {}, {}, {}>;
|
|
726
911
|
interface PresetModels {
|
|
727
912
|
Preset: PresetModel;
|
|
728
913
|
PresetComment: PresetCommentModel;
|
|
729
914
|
PresetLike: PresetLikeModel;
|
|
730
|
-
PresetDownload: SimpleModel$
|
|
731
|
-
PopularPresetList: SimpleModel$
|
|
732
|
-
FakePresetLike: SimpleModel$
|
|
733
|
-
PresetTagsMeta: SimpleModel$
|
|
734
|
-
PresetSongMapping: SimpleModel$
|
|
915
|
+
PresetDownload: SimpleModel$1<any>;
|
|
916
|
+
PopularPresetList: SimpleModel$1<any>;
|
|
917
|
+
FakePresetLike: SimpleModel$1<any>;
|
|
918
|
+
PresetTagsMeta: SimpleModel$1<any>;
|
|
919
|
+
PresetSongMapping: SimpleModel$1<any>;
|
|
735
920
|
}
|
|
736
921
|
//#endregion
|
|
737
922
|
//#region src/models/promotion.d.ts
|
|
@@ -1049,185 +1234,6 @@ interface IToneThemeFeaturedList {
|
|
|
1049
1234
|
type ToneThemeFeaturedListDoc = HydratedDocument<IToneThemeFeaturedList>;
|
|
1050
1235
|
type ToneThemeFeaturedListModel = Model<IToneThemeFeaturedList, {}, {}, {}>;
|
|
1051
1236
|
//#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
1237
|
//#region src/models/userTrack.d.ts
|
|
1232
1238
|
declare const LICENSE_ADDITION: {
|
|
1233
1239
|
readonly PRO: 0;
|
|
@@ -1285,4 +1291,4 @@ type DemoUserTrackerDoc = HydratedDocument<IDemoUserTracker>;
|
|
|
1285
1291
|
type RegistryType = "account" | "hardware" | undefined;
|
|
1286
1292
|
declare function register(mongoose: Mongoose, type?: RegistryType): void;
|
|
1287
1293
|
//#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 };
|
|
1294
|
+
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 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 };
|