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

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.
@@ -0,0 +1,1288 @@
1
+ import { CallbackError, FilterQuery, HydratedDocument, Model, Mongoose, Schema } from "mongoose";
2
+
3
+ //#region src/models/banks.d.ts
4
+ interface IBankList {
5
+ name: string;
6
+ creator_id: Schema.Types.ObjectId;
7
+ description?: string;
8
+ preset_for: string;
9
+ created_on: Date;
10
+ updated_on: Date;
11
+ }
12
+ interface IBankPresets {
13
+ name: string;
14
+ creator_id: Schema.Types.ObjectId;
15
+ bank_id: Schema.Types.ObjectId;
16
+ status: number;
17
+ description?: string;
18
+ preset_data: any;
19
+ preset_meta?: any;
20
+ image_url?: string;
21
+ thumb_url?: string;
22
+ created_on: Date;
23
+ updated_on: Date;
24
+ }
25
+ type BankListDoc = HydratedDocument<IBankList>;
26
+ type BankPresetsDoc = HydratedDocument<IBankPresets>;
27
+ type BankListModel = Model<IBankList, {}, {}, {}>;
28
+ type BankPresetsModel = Model<IBankPresets, {}, {}, {}>;
29
+ interface BanksModels {
30
+ BankList: BankListModel;
31
+ BankPresets: BankPresetsModel;
32
+ }
33
+ //#endregion
34
+ //#region src/models/device.d.ts
35
+ interface IDevice {
36
+ user_id: Schema.Types.ObjectId;
37
+ device_udid: string;
38
+ display_name?: string;
39
+ mac_address?: string;
40
+ machine_id?: string;
41
+ platform?: string;
42
+ architecture?: string;
43
+ os_version?: string;
44
+ model?: string;
45
+ activate_random?: string;
46
+ other_info?: string;
47
+ created_on: Date;
48
+ }
49
+ interface IIapActivation {
50
+ user_id: Schema.Types.ObjectId;
51
+ device_id: Schema.Types.ObjectId;
52
+ main_product: string;
53
+ status: number;
54
+ created_on: Date;
55
+ updated_on: Date;
56
+ }
57
+ interface IActivationStatus {
58
+ user_id: Schema.Types.ObjectId;
59
+ device_id: Schema.Types.ObjectId;
60
+ license_id: Schema.Types.ObjectId;
61
+ status: number;
62
+ created_on: Date;
63
+ updated_on: Date;
64
+ }
65
+ type DeviceDoc = HydratedDocument<IDevice>;
66
+ type Cb$4<T> = (err: CallbackError | null, docs?: T) => void;
67
+ interface DeviceModel extends Model<IDevice, {}, {}, {}> {
68
+ getFeaturedPresetListByCondition(queryObj: FilterQuery<IDevice>, cb: Cb$4<DeviceDoc[]>): void;
69
+ }
70
+ type IapActivationModel = Model<IIapActivation, {}, {}, {}>;
71
+ type ActivationStatusModel = Model<IActivationStatus, {}, {}, {}>;
72
+ interface DeviceModels {
73
+ Device: DeviceModel;
74
+ ActivationStatus: ActivationStatusModel;
75
+ IapActivation: IapActivationModel;
76
+ }
77
+ //#endregion
78
+ //#region src/models/featuredList.d.ts
79
+ interface IFeaturedList {
80
+ title: string;
81
+ description: string | null;
82
+ image_url: string | null;
83
+ thumb_url: string | null;
84
+ embed_url: string | null;
85
+ bg_url: string | null;
86
+ order: number;
87
+ type: string | null;
88
+ permission: any;
89
+ metadata: any[] | null;
90
+ is_shown: boolean;
91
+ list_for: string;
92
+ created_on: Date;
93
+ updated_on: Date;
94
+ }
95
+ interface IFeaturedListVirtuals {
96
+ id: string;
97
+ }
98
+ interface IFeaturedPreset {
99
+ featured_list_id: Schema.Types.ObjectId;
100
+ preset_id: Schema.Types.ObjectId;
101
+ order: number;
102
+ created_on: Date;
103
+ }
104
+ type FeaturedListDoc = HydratedDocument<IFeaturedList, IFeaturedListVirtuals>;
105
+ interface FeaturedListModel extends Model<IFeaturedList, {}, {}, IFeaturedListVirtuals> {
106
+ getFeaturedPresetListByCondition(reqQuery: Record<string, any>): Promise<any[]>;
107
+ getLimitedPresetLists(reqQuery: Record<string, any>): Promise<any[]>;
108
+ }
109
+ type FeaturedPresetModel = Model<IFeaturedPreset, {}, {}, {}>;
110
+ interface FeaturedListModels {
111
+ FeaturedList: FeaturedListModel;
112
+ FeaturedPreset: FeaturedPresetModel;
113
+ }
114
+ //#endregion
115
+ //#region src/models/hardware.d.ts
116
+ interface ParsedSparkSerialNumber {
117
+ hwName: string;
118
+ hwModel: string;
119
+ hwWattage: string;
120
+ hwProductType: string;
121
+ hwVersion: string;
122
+ hwYear: string;
123
+ hwMonth: string;
124
+ hwPattern: string[];
125
+ }
126
+ interface ParsedGenericSerialNumber {
127
+ hwName: string;
128
+ hwModel: string;
129
+ hwWattage: string;
130
+ hwVersion: string;
131
+ hwProductionPhase: string;
132
+ hwPattern: string[];
133
+ }
134
+ type ParsedSerialNumber = ParsedSparkSerialNumber | ParsedGenericSerialNumber;
135
+ interface IHardwareSeriesNumber {
136
+ hw_sn: string;
137
+ channel: string | null;
138
+ status: number;
139
+ metadata?: any;
140
+ created_on: Date;
141
+ }
142
+ interface IHardwareActivationMeta {
143
+ pattern: string[];
144
+ hw_sn_pattern: any;
145
+ hw_activate_license: Schema.Types.ObjectId[];
146
+ status: number;
147
+ created_on: Date;
148
+ }
149
+ interface IHardwareActivationRecord {
150
+ user_id: Schema.Types.ObjectId;
151
+ hw_sn_id: Schema.Types.ObjectId;
152
+ hw_meta_id: Schema.Types.ObjectId | null;
153
+ hw_partner_id: Schema.Types.ObjectId | null;
154
+ activate_license: Schema.Types.ObjectId[];
155
+ status: number;
156
+ activate_on: Date;
157
+ }
158
+ interface IHardwareActivationConflict {
159
+ user_id: Schema.Types.ObjectId;
160
+ hw_sn_id: Schema.Types.ObjectId;
161
+ created_on: Date;
162
+ }
163
+ interface IPartnerCoupon {
164
+ partner: string;
165
+ code: string;
166
+ status: number;
167
+ hw_sn_id?: Schema.Types.ObjectId;
168
+ created_on: Date;
169
+ }
170
+ interface IWarehouseInventory {
171
+ warehouse: string;
172
+ country: string[];
173
+ status: number;
174
+ items: {
175
+ sku: string;
176
+ type: string;
177
+ total: number;
178
+ available: number;
179
+ transit: number;
180
+ lock: number;
181
+ }[];
182
+ created_on: Date;
183
+ }
184
+ interface IItemInventoryHistory {
185
+ warehouse: string;
186
+ sku: string;
187
+ total: number;
188
+ available: number;
189
+ transit: number;
190
+ lock: number;
191
+ created_on: Date;
192
+ }
193
+ interface ICountryHardwareSku {
194
+ country: string[];
195
+ items: {
196
+ name?: string;
197
+ hw_sku: string[];
198
+ }[];
199
+ level: {
200
+ level?: number;
201
+ min?: number;
202
+ max?: number;
203
+ days?: string;
204
+ }[];
205
+ sale_threshold?: number;
206
+ sale_region?: string;
207
+ sale_overwrite: {
208
+ level?: number;
209
+ days?: string;
210
+ }[];
211
+ not_sold: string[];
212
+ not_sold_threshold?: number;
213
+ express_ship_days?: string;
214
+ status: number;
215
+ created_on: Date;
216
+ }
217
+ interface HardwareSeriesNumberModel extends Model<IHardwareSeriesNumber, {}, {}, {}> {
218
+ parseHardwareSeriesNumber(hwSn: string): Promise<ParsedSerialNumber>;
219
+ parseHardwareSerialNumberNoPromise(hwSn: string): ParsedSerialNumber | string;
220
+ }
221
+ interface HardwareActivationMetaModel extends Model<IHardwareActivationMeta, {}, {}, {}> {
222
+ findMostMatchingMeta(snPatternArr: string[], opts?: {
223
+ allowEmpty?: boolean;
224
+ }): Promise<IHardwareActivationMeta | null>;
225
+ }
226
+ type HardwareActivationRecordModel = Model<IHardwareActivationRecord, {}, {}, {}>;
227
+ type HardwareActivationConflictModel = Model<IHardwareActivationConflict, {}, {}, {}>;
228
+ type PartnerCouponModel = Model<IPartnerCoupon, {}, {}, {}>;
229
+ type WarehouseInventoryModel = Model<IWarehouseInventory, {}, {}, {}>;
230
+ type ItemInventoryHistoryModel = Model<IItemInventoryHistory, {}, {}, {}>;
231
+ type CountryHardwareSkuModel = Model<ICountryHardwareSku, {}, {}, {}>;
232
+ interface HardwareModels {
233
+ HardwareSeriesNumber: HardwareSeriesNumberModel;
234
+ HardwareActivationMeta: HardwareActivationMetaModel;
235
+ HardwareActivationRecord: HardwareActivationRecordModel;
236
+ HardwareActivationConflict: HardwareActivationConflictModel;
237
+ PartnerCoupon: PartnerCouponModel;
238
+ WarehouseInventory: WarehouseInventoryModel;
239
+ ItemInventoryHistory: ItemInventoryHistoryModel;
240
+ CountryHardwareSku: CountryHardwareSkuModel;
241
+ }
242
+ declare function _identifyHardwareByModel(model: string): string | false;
243
+ declare function _parseHardwareSerialNumber(hwSn: string): ParsedSerialNumber;
244
+ //#endregion
245
+ //#region src/models/homeConfig.d.ts
246
+ type DataSourceType = "tone_theme_query" | "tone_theme_ids" | "tone_theme_id";
247
+ type SectionType = "tone_theme_banner" | "tone_theme_list" | "tone_theme_lists";
248
+ interface IDataSource {
249
+ type: DataSourceType;
250
+ tone_theme_id: string | null;
251
+ query: any;
252
+ ids: string[];
253
+ limit: number;
254
+ }
255
+ interface ISection {
256
+ section_type: SectionType;
257
+ title: string | null;
258
+ order: number;
259
+ data_source: IDataSource;
260
+ }
261
+ interface IHomeConfig {
262
+ config_for: string;
263
+ locale: string;
264
+ sections: ISection[];
265
+ is_active: boolean;
266
+ created_on: Date;
267
+ updated_on: Date;
268
+ }
269
+ type HomeConfigDoc = HydratedDocument<IHomeConfig>;
270
+ type HomeConfigModel = Model<IHomeConfig, {}, {}, {}>;
271
+ //#endregion
272
+ //#region src/models/oauth.d.ts
273
+ interface IOauthClient {
274
+ name: string;
275
+ clientId: string;
276
+ clientSecret: string;
277
+ }
278
+ interface IAuthorizationCode {
279
+ code: string;
280
+ clientId: Schema.Types.ObjectId;
281
+ redirectURI: string;
282
+ userId: Schema.Types.ObjectId;
283
+ scopes: string[];
284
+ expiresAt: Date;
285
+ codeChallenge?: string;
286
+ codeChallengeMethod: string;
287
+ date: Date;
288
+ }
289
+ interface IAccessToken {
290
+ token: string;
291
+ expirationDate: Date;
292
+ userId: Schema.Types.ObjectId;
293
+ clientId: Schema.Types.ObjectId;
294
+ scopes: string[];
295
+ date: Date;
296
+ }
297
+ interface IRefreshToken {
298
+ refreshToken: string;
299
+ clientId: Schema.Types.ObjectId;
300
+ expirationDate: Date;
301
+ userId: Schema.Types.ObjectId;
302
+ scopes: string[];
303
+ date: Date;
304
+ }
305
+ type OauthClientModel = Model<IOauthClient, {}, {}, {}>;
306
+ type AuthorizationCodeModel = Model<IAuthorizationCode, {}, {}, {}>;
307
+ type AccessTokenModel = Model<IAccessToken, {}, {}, {}>;
308
+ type RefreshTokenModel = Model<IRefreshToken, {}, {}, {}>;
309
+ type AuthorizationCodeDoc = HydratedDocument<IAuthorizationCode>;
310
+ interface OauthModels {
311
+ OauthClient: OauthClientModel;
312
+ RefreshTokens: RefreshTokenModel;
313
+ AccessToken: AccessTokenModel;
314
+ AuthorizationCode: AuthorizationCodeModel;
315
+ }
316
+ //#endregion
317
+ //#region src/models/partner.d.ts
318
+ declare const PURCHASE_ITEM_TYPE: readonly ["license", "bundle"];
319
+ declare const OEM_PROMOTION_TYPE: readonly ["discount_coupon"];
320
+ interface IPartnerSalesMeta {
321
+ partner_name: string;
322
+ sales_product: Schema.Types.ObjectId | null;
323
+ sales_bundle: Schema.Types.ObjectId | null;
324
+ b2b_redeem_id: number | null;
325
+ pg_sales_price: number;
326
+ purchase_price: number;
327
+ status: number;
328
+ created_on: Date;
329
+ }
330
+ interface IPartnerRedeem {
331
+ partner_name: string;
332
+ sales_item_id: Schema.Types.ObjectId;
333
+ purchase_price: number;
334
+ redeem_keycode: string;
335
+ buyer: any;
336
+ order_number: string | null;
337
+ status: number;
338
+ metadata: any;
339
+ created_on: Date;
340
+ updated_on: Date;
341
+ }
342
+ interface IPartnerSalesHistory {
343
+ partner_name: string;
344
+ sku: string;
345
+ title: string;
346
+ previous_price: number;
347
+ current_price: number;
348
+ updated_on: Date;
349
+ }
350
+ interface IB2bRedeemOrder {
351
+ dealer_id: Schema.Types.ObjectId;
352
+ order_id: number;
353
+ order_detail: {
354
+ product_id: Schema.Types.ObjectId | null;
355
+ bundle_id: Schema.Types.ObjectId | null;
356
+ quantity: number;
357
+ }[];
358
+ order_amount: number;
359
+ status: number;
360
+ created_on: Date;
361
+ }
362
+ interface IB2bRedeem {
363
+ redeem_code: string;
364
+ status: number;
365
+ redeem_order_id: Schema.Types.ObjectId;
366
+ apply_user_id: Schema.Types.ObjectId | null;
367
+ created_on: Date;
368
+ }
369
+ interface IB2bDealer {
370
+ dealer_id: Schema.Types.ObjectId;
371
+ business_name: string;
372
+ business_address: string;
373
+ business_phone: string;
374
+ business_website: string | null;
375
+ business_tax_id: string | null;
376
+ business_vat_id: string | null;
377
+ members: string[];
378
+ created_on: Date;
379
+ }
380
+ interface IOemRedeemPromotion {
381
+ redeem_product: string;
382
+ product_type: string;
383
+ partner_name: string;
384
+ promotion_type: string;
385
+ promotion_data: any;
386
+ status: number;
387
+ created_on: Date;
388
+ }
389
+ interface PartnerSalesMetaModel extends Model<IPartnerSalesMeta, {}, {}, {}> {
390
+ getPartnerSalesMeta(partnerName: string): Promise<any[]>;
391
+ getSalesMetaWithSku(sku: string, partnerName: string): Promise<any>;
392
+ }
393
+ type PartnerRedeemModel = Model<IPartnerRedeem, {}, {}, {}>;
394
+ type PartnerSalesHistoryModel = Model<IPartnerSalesHistory, {}, {}, {}>;
395
+ type B2bRedeemOrderModel = Model<IB2bRedeemOrder, {}, {}, {}>;
396
+ type B2bRedeemModel = Model<IB2bRedeem, {}, {}, {}>;
397
+ type B2bDealerModel = Model<IB2bDealer, {}, {}, {}>;
398
+ interface OemRedeemPromotionModel extends Model<IOemRedeemPromotion, {}, {}, {}> {
399
+ findRedeemFullfillPromotion(redeemData: {
400
+ metadata?: {
401
+ OEM_Name?: string;
402
+ product_name?: string;
403
+ type?: string;
404
+ [k: string]: any;
405
+ };
406
+ }): Promise<HydratedDocument<IOemRedeemPromotion>[]>;
407
+ }
408
+ interface PartnerModels {
409
+ PartnerSalesMeta: PartnerSalesMetaModel;
410
+ PartnerRedeem: PartnerRedeemModel;
411
+ PartnerSalesHistory: PartnerSalesHistoryModel;
412
+ B2bRedeemOrder: B2bRedeemOrderModel;
413
+ B2bRedeem: B2bRedeemModel;
414
+ B2bDealer: B2bDealerModel;
415
+ OemRedeemPromotion: OemRedeemPromotionModel;
416
+ }
417
+ declare function _identifyItemTypeBySku(sku: string): "bundle" | "product" | false;
418
+ //#endregion
419
+ //#region src/models/payment.d.ts
420
+ declare const OEM_FOCUSRITE_SUPPORT_LICENSE: {
421
+ support_type: {
422
+ product_name: string;
423
+ type: string;
424
+ };
425
+ display_name: string;
426
+ }[];
427
+ declare const OEM_APOGEE_SUPPORT_LICENSE: {
428
+ support_type: {
429
+ product_name: string;
430
+ type: string;
431
+ };
432
+ display_name: string;
433
+ }[];
434
+ declare const OEM_PROSONUS_SUPPORT_LICENSE: {
435
+ support_type: {
436
+ product_name: string;
437
+ type: string;
438
+ };
439
+ display_name: string;
440
+ }[];
441
+ declare function _oemMetaToLicenseName(redeemMeta: Record<string, any>): {
442
+ oem_name: string;
443
+ license_name: string;
444
+ } | null;
445
+ interface IProduct {
446
+ sku: string;
447
+ name: string;
448
+ display_name: string;
449
+ description: string;
450
+ price: number;
451
+ product_type: number;
452
+ status: number;
453
+ quota: number;
454
+ addition: number;
455
+ version: string;
456
+ max_purchase?: number;
457
+ can_upgrade_addition?: boolean;
458
+ can_free_trial: boolean;
459
+ upgrade?: {
460
+ to?: Schema.Types.ObjectId;
461
+ price?: number;
462
+ description?: string;
463
+ };
464
+ upgrade_metadata?: {
465
+ to?: Schema.Types.ObjectId;
466
+ price?: number;
467
+ description?: string;
468
+ }[];
469
+ discount?: any;
470
+ gift_list: Schema.Types.ObjectId[] | null;
471
+ require_list: any;
472
+ require_one_list: Schema.Types.ObjectId[];
473
+ require_one_bundles: Schema.Types.ObjectId[];
474
+ free_upgrade_list: {
475
+ has?: Schema.Types.ObjectId;
476
+ to?: Schema.Types.ObjectId;
477
+ }[];
478
+ remap_product_sku?: string;
479
+ extra_payment_fields?: any;
480
+ created_on: Date;
481
+ updated_on: Date;
482
+ }
483
+ interface ILicense {
484
+ user_id: Schema.Types.ObjectId;
485
+ product_id: Schema.Types.ObjectId;
486
+ bc_order_id: number | null;
487
+ bc_coupon: string[] | null;
488
+ quota: number;
489
+ from_redeem: string | null;
490
+ redeem_id?: Schema.Types.ObjectId;
491
+ from_bundle: Schema.Types.ObjectId | null;
492
+ from_hardware: Schema.Types.ObjectId | null;
493
+ from_gift: Schema.Types.ObjectId | null;
494
+ from_guest: Schema.Types.ObjectId | null;
495
+ from_remap?: Schema.Types.ObjectId;
496
+ from_free_trial: Schema.Types.ObjectId | null;
497
+ upgrade_to: Schema.Types.ObjectId | null;
498
+ price_amount: number | null;
499
+ due_date: Date | null;
500
+ iap_device_id: string | null;
501
+ iap_source: string | null;
502
+ metadata: string | null;
503
+ custom_metadata: any;
504
+ status: number;
505
+ created_on: Date;
506
+ updated_on: Date;
507
+ }
508
+ interface ILicenseVirtuals {
509
+ id: string;
510
+ product: any;
511
+ oem: {
512
+ oem_name: string;
513
+ license_name: string;
514
+ } | null;
515
+ }
516
+ type LicenseDoc = HydratedDocument<ILicense, ILicenseVirtuals>;
517
+ type Cb$3<T> = (err: CallbackError | null, doc?: T) => void;
518
+ interface LicenseModel extends Model<ILicense, {}, {}, ILicenseVirtuals> {
519
+ hasLicenseOrNot(userId: string, productId: string, cb: (err: Error | null) => void): void;
520
+ hasLicensePromise(userID: string, productID: string): Promise<LicenseDoc | null>;
521
+ getLicenseByRedeem(redeem: string, cb: Cb$3<any[]>): void;
522
+ getLicenseByRedeemPromise(redeem: string, userID: string): Promise<any[]>;
523
+ getUserLicense(query: FilterQuery<ILicense>, cb: Cb$3<any[]>): void;
524
+ getUserLicensePromise(query: FilterQuery<ILicense>): Promise<any[]>;
525
+ getUserPurchase(query: FilterQuery<ILicense>, productType: string, cb: Cb$3<any[]>): void;
526
+ getUserPurchasePromise(query: FilterQuery<ILicense>, productType: string, opts?: {
527
+ isLean?: boolean;
528
+ }): Promise<any[]>;
529
+ getUserIapLicenses(userId: string, iapIds: string[]): Promise<any[]>;
530
+ createTrialLicense(data: Partial<ILicense> & {
531
+ due_date: Date;
532
+ }): Promise<LicenseDoc>;
533
+ createLicense(data: Partial<ILicense>, cb: Cb$3<LicenseDoc>): void;
534
+ createLicensePromise(data: Partial<ILicense>): Promise<LicenseDoc | null>;
535
+ removeLicense(licenseID: string): Promise<LicenseDoc | null>;
536
+ }
537
+ interface LicenseUpgradeMetaModel extends Model<any, {}, {}, {}> {
538
+ saveUpgradeOrder(bcCartId: string, userId: string, fromProductId: string, toProductId: string): Promise<unknown>;
539
+ saveBundleUpgradeOrder(bcCartId: string, userId: string, ownedProductIds: string[], toBundleId: string): Promise<unknown>;
540
+ updateLicenseUpgradeStatusIfExist(bcCartId: string, userId: string, targetProductId: string): Promise<unknown>;
541
+ updateBundleUpgradeStatusIfExist(bcCartId: string, userId: string, targetBundleId: string): Promise<unknown>;
542
+ }
543
+ interface AdditionalPurchaseModel extends Model<any, {}, {}, {}> {
544
+ canPurchaseAdditional(ownedSku: string[], additionalSku: string[]): Promise<boolean>;
545
+ verifyAdditionalPurchase(skus: string[]): Promise<boolean>;
546
+ }
547
+ interface CnSalesMetaModel extends Model<any, {}, {}, {}> {
548
+ getAllSaleItems(query?: FilterQuery<any>): Promise<any[]>;
549
+ }
550
+ interface ICnCoupon {
551
+ code: string;
552
+ user_id?: Schema.Types.ObjectId;
553
+ stripe_order_id?: string;
554
+ multiple_use?: boolean;
555
+ value?: number;
556
+ ratio?: number;
557
+ type: number;
558
+ status: number;
559
+ created_on: Date;
560
+ expired_on?: Date;
561
+ }
562
+ interface CnCouponMethods {
563
+ calculateFinalPrice(price: number): number | string;
564
+ calculateDeducted(price: number): number | string;
565
+ consumeCoupon(args: {
566
+ orderId: string;
567
+ }): Promise<unknown>;
568
+ }
569
+ type CnCouponDoc = HydratedDocument<ICnCoupon, CnCouponMethods>;
570
+ interface CnCouponModel extends Model<ICnCoupon, {}, CnCouponMethods, {}> {
571
+ createCoupon(args: {
572
+ value: number;
573
+ user?: {
574
+ _id: unknown;
575
+ };
576
+ }): Promise<CnCouponDoc>;
577
+ findCoupon(code: string): Promise<CnCouponDoc | null>;
578
+ }
579
+ interface BcCartUpdateStatusModel extends Model<any, {}, {}, {}> {
580
+ initCartUpdate(cartId: string, itemId: string): Promise<unknown>;
581
+ finishCartUpdate(cartId: string, itemId: string): Promise<unknown>;
582
+ handleCartUpdateError(cartId: string, itemId: string): Promise<unknown>;
583
+ }
584
+ interface ProductModel extends Model<IProduct, {}, {}, {
585
+ id: string;
586
+ }> {
587
+ getProductsByCondition(condition: FilterQuery<IProduct> | null, cb: Cb$3<any[]>): void;
588
+ createProduct(data: Partial<IProduct>, cb: Cb$3<any>): void;
589
+ }
590
+ type SimpleModel$3<T> = Model<T, {}, {}, {}>;
591
+ interface PaymentModels {
592
+ Product: ProductModel;
593
+ License: LicenseModel;
594
+ 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>;
600
+ CnCoupon: CnCouponModel;
601
+ CnSalesMeta: CnSalesMetaModel;
602
+ AdditionalPurchase: AdditionalPurchaseModel;
603
+ BcCartUpdateStatus: BcCartUpdateStatusModel;
604
+ UserOrder: SimpleModel$3<any>;
605
+ }
606
+ //#endregion
607
+ //#region src/models/pgConfig.d.ts
608
+ type Cb$2<T> = (err: CallbackError | null, doc?: T | null) => void;
609
+ interface IPgConfig {
610
+ config_key: string;
611
+ config_value: any;
612
+ created_on: Date;
613
+ }
614
+ interface IPgLogging {
615
+ type: string;
616
+ log_id: string;
617
+ log_content: any;
618
+ user_id?: Schema.Types.ObjectId;
619
+ created_on: Date;
620
+ }
621
+ interface IKeyValue {
622
+ key: string;
623
+ value: any;
624
+ created_on: Date;
625
+ expire_at: Date | null;
626
+ }
627
+ interface ICrashData {
628
+ product: string;
629
+ crash_data: any;
630
+ email: string | null;
631
+ crash_file: string;
632
+ created_on: Date;
633
+ }
634
+ type PgConfigDoc = HydratedDocument<IPgConfig>;
635
+ 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;
639
+ }
640
+ type PgLoggingModel = Model<IPgLogging, {}, {}, {}>;
641
+ type KeyValueModel = Model<IKeyValue, {}, {}, {}>;
642
+ type CrashDataModel = Model<ICrashData, {}, {}, {}>;
643
+ interface PgConfigModels {
644
+ PgConfig: PgConfigModel;
645
+ PgLogging: PgLoggingModel;
646
+ KeyValue: KeyValueModel;
647
+ CrashData: CrashDataModel;
648
+ }
649
+ //#endregion
650
+ //#region src/models/preset.d.ts
651
+ declare function _queryCompatibilityHandler(query: Record<string, any>): Record<string, any>;
652
+ type PresetReq = {
653
+ query: Record<string, any>;
654
+ };
655
+ declare function _handlePresetVersion(queryObj: Record<string, any>, req: PresetReq): Record<string, any>;
656
+ declare function _buildPresetVersionQuery(version: string, comparison: string): Record<string, any> | false;
657
+ declare function _buildSortQuery(orderParam?: string): Record<string, 1 | -1>;
658
+ declare function _buildLicenseTierQuery(licenseTierParam: string): Record<string, any>;
659
+ declare function _parsePageParams(data: any): {
660
+ page_size: number;
661
+ page: number;
662
+ };
663
+ declare function _filterKeyword(keyword: string): string;
664
+ interface IPreset {
665
+ name: string;
666
+ creator_id: Schema.Types.ObjectId;
667
+ preset_for: string;
668
+ status: number;
669
+ description?: string;
670
+ tags: string[] | null;
671
+ is_featured: boolean;
672
+ category?: string;
673
+ active_effects?: string;
674
+ preset_data?: string;
675
+ preset_features: any;
676
+ version?: {
677
+ major?: number;
678
+ minor?: number;
679
+ };
680
+ preset_meta?: any;
681
+ preset_scene?: any[];
682
+ license_tier: string[] | null;
683
+ num_comments: number;
684
+ num_downloads: number;
685
+ num_likes: number;
686
+ rating_sum: number;
687
+ rating_avg: number;
688
+ rating_count: number;
689
+ image_url?: string;
690
+ thumb_url?: string;
691
+ signal_chain_type?: "in1" | "in2";
692
+ created_on: Date;
693
+ updated_on: Date;
694
+ }
695
+ interface IPresetVirtuals {
696
+ id: string;
697
+ preset_version: string;
698
+ }
699
+ type PresetDoc = HydratedDocument<IPreset, IPresetVirtuals>;
700
+ type Cb$1<T> = (err: CallbackError | null, doc?: T | null) => void;
701
+ interface PresetModel extends Model<IPreset, {}, {}, IPresetVirtuals> {
702
+ getPresetByUserId(userId: string, cb: Cb$1<PresetDoc[]>): void;
703
+ getPresetByQuery(req: PresetReq, opts?: {
704
+ full?: boolean;
705
+ }): Promise<any[]>;
706
+ getPresetsBySearch(req: PresetReq): Promise<any[]>;
707
+ getPresetsList(query: Record<string, any>, sort: any, req: PresetReq, cb: Cb$1<PresetDoc[]>): void;
708
+ 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;
710
+ getOnePresetByCondition(query: Record<string, any>, opts: {
711
+ sort?: any;
712
+ 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;
716
+ }
717
+ interface PresetCommentModel extends Model<any, {}, {}, {}> {
718
+ getPresetComments(presetId: string, req: PresetReq): Promise<any[]>;
719
+ }
720
+ 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;
723
+ getPresetLikeListPromise(query: Record<string, any>, sort: any, req: PresetReq): Promise<any[]>;
724
+ }
725
+ type SimpleModel$2<T> = Model<T, {}, {}, {}>;
726
+ interface PresetModels {
727
+ Preset: PresetModel;
728
+ PresetComment: PresetCommentModel;
729
+ 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>;
735
+ }
736
+ //#endregion
737
+ //#region src/models/promotion.d.ts
738
+ declare const CAMPAIGN_TYPE: readonly ["free_upgrade"];
739
+ interface ILicenseCampaignMeta {
740
+ campaign_type: string;
741
+ campaign_detail: any;
742
+ status: number;
743
+ start_date: Date | null;
744
+ end_date: Date | null;
745
+ created_on: Date;
746
+ }
747
+ interface ILicenseCampaignRecord {
748
+ user_id: Schema.Types.ObjectId;
749
+ campaign_event_id: Schema.Types.ObjectId;
750
+ status: number;
751
+ created_on: Date;
752
+ }
753
+ interface IActionButton {
754
+ type: string;
755
+ text: string;
756
+ value?: any;
757
+ read: boolean;
758
+ }
759
+ interface IPublicAnnouncement {
760
+ title: string;
761
+ content: string;
762
+ type?: string;
763
+ country: string[];
764
+ image: string | null;
765
+ image_type?: string;
766
+ message_type?: string;
767
+ action_button: IActionButton[];
768
+ show_countdown: boolean;
769
+ announce_for: string[];
770
+ target_audience_device: string[];
771
+ device_os?: string;
772
+ device_list: string[];
773
+ announce_license_tier: string[];
774
+ announce_mobile_iap: string[];
775
+ user_list_num: number;
776
+ user_list_status: number;
777
+ user_list_failure: number;
778
+ user_list_log: string | null;
779
+ user_list_filename: string | null;
780
+ start_time: Date | null;
781
+ end_time: Date | null;
782
+ locale: string;
783
+ order: number;
784
+ created_on: Date;
785
+ }
786
+ interface IPublicAnnouncementFreeTrial {
787
+ pa_id: Schema.Types.ObjectId;
788
+ user_id: Schema.Types.ObjectId;
789
+ product_id: Schema.Types.ObjectId | null;
790
+ expansion_id: Schema.Types.ObjectId | null;
791
+ status: number;
792
+ expire_on: Date;
793
+ created_on: Date;
794
+ }
795
+ interface IPublicAnnouncementUserList {
796
+ pa_id: Schema.Types.ObjectId;
797
+ email: string;
798
+ user_id?: Schema.Types.ObjectId;
799
+ status: number;
800
+ created_on: Date;
801
+ }
802
+ interface ICampaignUserInfo {
803
+ campaign: string;
804
+ email: string;
805
+ name?: string;
806
+ redeem?: string;
807
+ metadata?: any;
808
+ created_on: Date;
809
+ }
810
+ interface ICouponPromotion {
811
+ email: string;
812
+ code: string;
813
+ referral?: string;
814
+ event?: string;
815
+ type?: string;
816
+ metadata?: any;
817
+ status: number;
818
+ created_on: Date;
819
+ }
820
+ interface IFreeTrial {
821
+ campaign_name: string;
822
+ campaign_code: string;
823
+ content: string | null;
824
+ products: Schema.Types.ObjectId[];
825
+ status: number;
826
+ start_time: Date;
827
+ end_time: Date;
828
+ trial_days: number;
829
+ not_allow_same_product: boolean;
830
+ created_by: string | null;
831
+ terminate?: {
832
+ reason?: string;
833
+ user?: string;
834
+ time?: Date;
835
+ };
836
+ metadata: any;
837
+ created_on: Date;
838
+ updated_on: Date;
839
+ }
840
+ interface IGearTrialMeta {
841
+ title: string;
842
+ announce_for: string[];
843
+ target_audience_device: string[];
844
+ locale: string;
845
+ target_product_sku: string[];
846
+ expires: number;
847
+ status: number;
848
+ created_on: Date;
849
+ }
850
+ interface IGearTrialRecord {
851
+ gear_trial_id: Schema.Types.ObjectId;
852
+ user_id: Schema.Types.ObjectId;
853
+ expire_on: Date;
854
+ created_on: Date;
855
+ }
856
+ interface IYotpoLoyalty {
857
+ user_id: Schema.Types.ObjectId;
858
+ main_region: string;
859
+ active_regions: {
860
+ code: string;
861
+ points_balance: number;
862
+ points_earned: number;
863
+ }[];
864
+ history: {
865
+ created_at: string;
866
+ date: string;
867
+ completed_on: string | null;
868
+ action: string | null;
869
+ points: number;
870
+ status: string | null;
871
+ action_name: string | null;
872
+ order_ids: string[];
873
+ }[];
874
+ created_on: Date;
875
+ updated_on: Date;
876
+ }
877
+ interface IYotpoLoyaltyBackup {
878
+ email: string;
879
+ store_code: string;
880
+ status: number;
881
+ created_on: Date;
882
+ }
883
+ interface IPromotion {
884
+ name: string;
885
+ start_date: Date;
886
+ end_date: Date;
887
+ items: {
888
+ sku: string;
889
+ sale_price: number;
890
+ price: number;
891
+ name: string;
892
+ }[];
893
+ }
894
+ interface ISpecialOffer {
895
+ title: string;
896
+ content: string;
897
+ image: string | null;
898
+ action_button: IActionButton[];
899
+ announce_for: string[];
900
+ target_audience_device: string[];
901
+ start_time: Date | null;
902
+ end_time: Date | null;
903
+ created_on: Date;
904
+ locale: string;
905
+ }
906
+ interface IIasBuyOption {
907
+ type: string;
908
+ sku: string;
909
+ description: string;
910
+ cta_name: string;
911
+ created_on: Date;
912
+ locale: string;
913
+ }
914
+ interface IIasStorePageMeta {
915
+ product: string;
916
+ expansion: boolean;
917
+ license: string;
918
+ buy_option: Schema.Types.ObjectId[];
919
+ created_on: Date;
920
+ promotion_target_audiance: string;
921
+ promotion_discount: string;
922
+ product_description: string;
923
+ quote_image: string;
924
+ locale: string;
925
+ cta_image?: string;
926
+ cta_button_text?: string;
927
+ cta_button_show_svg?: boolean;
928
+ cta_button_action_url?: string;
929
+ }
930
+ interface IIasPromotion {
931
+ start_time: Date;
932
+ end_time: Date;
933
+ quote_image: string;
934
+ created_on: Date;
935
+ }
936
+ interface IPublicAnnouncementUserListLog {
937
+ pa_id: Schema.Types.ObjectId;
938
+ message?: any;
939
+ }
940
+ interface ITierSalesMeta {
941
+ campaign_key: string;
942
+ current_tier_sales_rule?: Schema.Types.ObjectId;
943
+ current_tier_startdate: Date | null;
944
+ process_log: {
945
+ from_tier_id: Schema.Types.ObjectId;
946
+ to_tier_id: Schema.Types.ObjectId;
947
+ updated_on: Date;
948
+ }[];
949
+ status: number;
950
+ updated_on: Date;
951
+ }
952
+ interface ITierSalesRules {
953
+ campaign_key: string;
954
+ tier_level: number;
955
+ tier_type: number;
956
+ pre_rule_id?: Schema.Types.ObjectId;
957
+ price: number;
958
+ ta_sku: string;
959
+ next_sku: string | null;
960
+ goal: {
961
+ type?: string;
962
+ value?: number;
963
+ }[];
964
+ force_switch_tier: Date | null;
965
+ is_final_tier: boolean;
966
+ status: number;
967
+ created_on: Date;
968
+ }
969
+ interface PublicAnnouncementModel extends Model<IPublicAnnouncement, {}, {}, {}> {
970
+ getAvailableAnnouncement(params?: Record<string, any>): Promise<any[]>;
971
+ }
972
+ interface PublicAnnouncementFreeTrialModel extends Model<IPublicAnnouncementFreeTrial, {}, {}, {}> {
973
+ getCurrentActiveFreeTrial(params: {
974
+ userId: string;
975
+ }): Promise<any[]>;
976
+ }
977
+ interface PublicAnnouncementUserListModel extends Model<IPublicAnnouncementUserList, {}, {}, {}> {
978
+ getAvailableAnnouncementByEmail(email: string): Promise<any[]>;
979
+ }
980
+ type SimpleModel<T> = Model<T, {}, {}, {}>;
981
+ interface PromotionModels {
982
+ LicenseCampaignMeta: SimpleModel<ILicenseCampaignMeta>;
983
+ LicenseCampaignRecord: SimpleModel<ILicenseCampaignRecord>;
984
+ PublicAnnouncement: PublicAnnouncementModel;
985
+ PublicAnnouncementUserList: PublicAnnouncementUserListModel;
986
+ PublicAnnouncementUserListLog: SimpleModel<IPublicAnnouncementUserListLog>;
987
+ PublicAnnouncementFreeTrial: PublicAnnouncementFreeTrialModel;
988
+ IasBuyOption: SimpleModel<IIasBuyOption>;
989
+ IasStorePageMeta: SimpleModel<IIasStorePageMeta>;
990
+ IasPromotion: SimpleModel<IIasPromotion>;
991
+ SpecialOffer: SimpleModel<ISpecialOffer>;
992
+ Promotion: SimpleModel<IPromotion>;
993
+ CampaignUserInfo: SimpleModel<ICampaignUserInfo>;
994
+ CouponPromotion: SimpleModel<ICouponPromotion>;
995
+ TierSalesMeta: SimpleModel<ITierSalesMeta>;
996
+ TierSalesRules: SimpleModel<ITierSalesRules>;
997
+ GearTrialMeta: SimpleModel<IGearTrialMeta>;
998
+ GearTrialRecord: SimpleModel<IGearTrialRecord>;
999
+ YotpoLoyalty: SimpleModel<IYotpoLoyalty>;
1000
+ YotpoLoyaltyBackup: SimpleModel<IYotpoLoyaltyBackup>;
1001
+ FreeTrial: SimpleModel<IFreeTrial>;
1002
+ }
1003
+ type PublicAnnouncementDoc = HydratedDocument<IPublicAnnouncement>;
1004
+ //#endregion
1005
+ //#region src/models/redeem.d.ts
1006
+ interface IRedeemCode {
1007
+ code: string;
1008
+ product_id: Schema.Types.ObjectId | null;
1009
+ bundle_id: Schema.Types.ObjectId | null;
1010
+ user_id: Schema.Types.ObjectId | null;
1011
+ status: number;
1012
+ expire_on: Date | null;
1013
+ trial_due_date: Date | null;
1014
+ tracker: string;
1015
+ metadata?: any;
1016
+ created_on: Date;
1017
+ updated_on: Date;
1018
+ }
1019
+ type RedeemCodeDoc = HydratedDocument<IRedeemCode>;
1020
+ type RedeemCodeModel = Model<IRedeemCode, {}, {}, {}>;
1021
+ //#endregion
1022
+ //#region src/models/toneTheme.d.ts
1023
+ interface IToneTheme {
1024
+ title: string;
1025
+ description: string | null;
1026
+ cover_image_url: string | null;
1027
+ thumb_url: string | null;
1028
+ order: number;
1029
+ is_shown: boolean;
1030
+ list_for: string;
1031
+ category: string | null;
1032
+ tags: string[];
1033
+ created_on: Date;
1034
+ updated_on: Date;
1035
+ }
1036
+ interface IToneThemeVirtuals {
1037
+ id: string;
1038
+ }
1039
+ type ToneThemeDoc = HydratedDocument<IToneTheme, IToneThemeVirtuals>;
1040
+ type ToneThemeModel = Model<IToneTheme, {}, {}, IToneThemeVirtuals>;
1041
+ //#endregion
1042
+ //#region src/models/toneThemeFeaturedList.d.ts
1043
+ interface IToneThemeFeaturedList {
1044
+ tone_theme_id: Schema.Types.ObjectId;
1045
+ featured_list_id: Schema.Types.ObjectId;
1046
+ order: number;
1047
+ created_on: Date;
1048
+ }
1049
+ type ToneThemeFeaturedListDoc = HydratedDocument<IToneThemeFeaturedList>;
1050
+ type ToneThemeFeaturedListModel = Model<IToneThemeFeaturedList, {}, {}, {}>;
1051
+ //#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
+ //#region src/models/userTrack.d.ts
1232
+ declare const LICENSE_ADDITION: {
1233
+ readonly PRO: 0;
1234
+ readonly DEMO: 1;
1235
+ readonly STD: 2;
1236
+ readonly LITE: 3;
1237
+ readonly ELITE: 4;
1238
+ };
1239
+ type LicenseAdditionKey = keyof typeof LICENSE_ADDITION;
1240
+ declare const PRODUCTS: readonly ["fx2", "amp2", "fx1", "amp1"];
1241
+ type Product = typeof PRODUCTS[number];
1242
+ interface IGenericData {
1243
+ data_type: string;
1244
+ data_key: string;
1245
+ data_value: any;
1246
+ data_meta: any;
1247
+ created_on: Date;
1248
+ }
1249
+ interface IIapEvent {
1250
+ user_id: Schema.Types.ObjectId;
1251
+ app_name: string;
1252
+ onesignal_id: string | null;
1253
+ redeem_code: Schema.Types.ObjectId | null;
1254
+ created_on: Date;
1255
+ region?: string;
1256
+ }
1257
+ interface IDemoUserTracker {
1258
+ user_id: Schema.Types.ObjectId;
1259
+ product: string;
1260
+ addition: number;
1261
+ started_at: Date;
1262
+ updated_at: Date | null;
1263
+ created_on: Date;
1264
+ }
1265
+ interface SaveTrackInput {
1266
+ userID: string;
1267
+ product: string;
1268
+ addition: string;
1269
+ startedAt: string | number;
1270
+ updatedAt?: string | number;
1271
+ }
1272
+ type GenericDataModel = Model<IGenericData, {}, {}, {}>;
1273
+ type IapEventModel = Model<IIapEvent, {}, {}, {}>;
1274
+ interface DemoUserTrackerModel extends Model<IDemoUserTracker, {}, {}, {}> {
1275
+ saveTrackData(data: SaveTrackInput): Promise<true>;
1276
+ }
1277
+ interface UserTrackModels {
1278
+ GenericData: GenericDataModel;
1279
+ IapEvent: IapEventModel;
1280
+ DemoUserTracker: DemoUserTrackerModel;
1281
+ }
1282
+ type DemoUserTrackerDoc = HydratedDocument<IDemoUserTracker>;
1283
+ //#endregion
1284
+ //#region src/index.d.ts
1285
+ type RegistryType = "account" | "hardware" | undefined;
1286
+ declare function register(mongoose: Mongoose, type?: RegistryType): void;
1287
+ //#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 };