jp.db.schemas 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/index.d.ts +10 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +28 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/schemas/purchase.schema.d.ts +29 -0
  6. package/dist/schemas/purchase.schema.d.ts.map +1 -0
  7. package/dist/schemas/purchase.schema.js +82 -0
  8. package/dist/schemas/purchase.schema.js.map +1 -0
  9. package/dist/schemas/user.fb.schema.d.ts +22 -0
  10. package/dist/schemas/user.fb.schema.d.ts.map +1 -0
  11. package/dist/schemas/user.fb.schema.js +53 -0
  12. package/dist/schemas/user.fb.schema.js.map +1 -0
  13. package/dist/schemas/user.google.schema.d.ts +19 -0
  14. package/dist/schemas/user.google.schema.d.ts.map +1 -0
  15. package/dist/schemas/user.google.schema.js +41 -0
  16. package/dist/schemas/user.google.schema.js.map +1 -0
  17. package/dist/schemas/user.ok.schema.d.ts +39 -0
  18. package/dist/schemas/user.ok.schema.d.ts.map +1 -0
  19. package/dist/schemas/user.ok.schema.js +80 -0
  20. package/dist/schemas/user.ok.schema.js.map +1 -0
  21. package/dist/schemas/user.schema.d.ts +99 -0
  22. package/dist/schemas/user.schema.d.ts.map +1 -0
  23. package/dist/schemas/user.schema.js +287 -0
  24. package/dist/schemas/user.schema.js.map +1 -0
  25. package/dist/schemas/user.tg.schema.d.ts +21 -0
  26. package/dist/schemas/user.tg.schema.d.ts.map +1 -0
  27. package/dist/schemas/user.tg.schema.js +49 -0
  28. package/dist/schemas/user.tg.schema.js.map +1 -0
  29. package/dist/schemas/user.vk.schema.d.ts +44 -0
  30. package/dist/schemas/user.vk.schema.d.ts.map +1 -0
  31. package/dist/schemas/user.vk.schema.js +100 -0
  32. package/dist/schemas/user.vk.schema.js.map +1 -0
  33. package/dist/schemas/user.ya.schema.d.ts +19 -0
  34. package/dist/schemas/user.ya.schema.d.ts.map +1 -0
  35. package/dist/schemas/user.ya.schema.js +41 -0
  36. package/dist/schemas/user.ya.schema.js.map +1 -0
  37. package/package.json +30 -0
  38. package/readme.md +3 -0
  39. package/src/index.ts +27 -0
  40. package/src/schemas/purchase.schema.ts +54 -0
  41. package/src/schemas/user.fb.schema.ts +33 -0
  42. package/src/schemas/user.google.schema.ts +24 -0
  43. package/src/schemas/user.ok.schema.ts +55 -0
  44. package/src/schemas/user.schema.ts +227 -0
  45. package/src/schemas/user.tg.schema.ts +30 -0
  46. package/src/schemas/user.vk.schema.ts +70 -0
  47. package/src/schemas/user.ya.schema.ts +24 -0
@@ -0,0 +1,54 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument, SchemaTypes, Types } from 'mongoose';
3
+
4
+ export type PurchaseDocument = HydratedDocument<Purchase>;
5
+
6
+ @Schema()
7
+ export class Purchase {
8
+ @Prop({ type: SchemaTypes.ObjectId })
9
+ productId: Types.ObjectId;
10
+
11
+ @Prop()
12
+ title: string;
13
+
14
+ @Prop()
15
+ amount: number;
16
+
17
+ @Prop()
18
+ currency: string;
19
+
20
+ @Prop()
21
+ datetime: Date;
22
+
23
+ @Prop()
24
+ type: string;
25
+
26
+ @Prop()
27
+ vkOrderId?: number;
28
+
29
+ @Prop()
30
+ okOrderId?: string;
31
+
32
+ @Prop()
33
+ yaOrderId?: string;
34
+
35
+ @Prop()
36
+ fbOrderId?: string;
37
+
38
+ @Prop()
39
+ googlePlayOrderId?: string;
40
+
41
+ @Prop()
42
+ ruStoreOrderId?: string;
43
+
44
+ @Prop()
45
+ ticketAmount?: number;
46
+
47
+ @Prop()
48
+ guid: string;
49
+
50
+ @Prop()
51
+ chips?: number;
52
+ }
53
+
54
+ export const PurchaseSchema = SchemaFactory.createForClass(Purchase);
@@ -0,0 +1,33 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type FBUserDocument = HydratedDocument<FBUser>;
5
+
6
+ @Schema()
7
+ export class FBUser {
8
+ @Prop()
9
+ contextId?: string;
10
+
11
+ @Prop()
12
+ contextType: string;
13
+
14
+ @Prop()
15
+ locale: string;
16
+
17
+ @Prop()
18
+ platform: string;
19
+
20
+ @Prop()
21
+ sdkVersion: string;
22
+
23
+ @Prop()
24
+ playerName: string;
25
+
26
+ @Prop()
27
+ playerPic: string;
28
+
29
+ @Prop()
30
+ playerId: string;
31
+ }
32
+
33
+ export const FBUserSchema = SchemaFactory.createForClass(FBUser);
@@ -0,0 +1,24 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type GoogleUserDocument = HydratedDocument<GoogleUser>;
5
+
6
+ @Schema()
7
+ export class GoogleUser {
8
+ @Prop()
9
+ userId: string;
10
+
11
+ @Prop()
12
+ fullName: string;
13
+
14
+ @Prop()
15
+ language: string;
16
+
17
+ @Prop()
18
+ avatarUrl: string;
19
+
20
+ @Prop()
21
+ email: string;
22
+ }
23
+
24
+ export const GoogleUserSchema = SchemaFactory.createForClass(GoogleUser);
@@ -0,0 +1,55 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type OKUserLocationDocument = HydratedDocument<OKUserLocation>;
5
+
6
+ @Schema()
7
+ export class OKUserLocation {
8
+ @Prop()
9
+ id: number;
10
+
11
+ @Prop()
12
+ city: String;
13
+
14
+ @Prop()
15
+ country: String;
16
+
17
+ @Prop()
18
+ countryCode: String;
19
+
20
+ @Prop()
21
+ countryName: String;
22
+ }
23
+
24
+ export const OKUserLocationSchema = SchemaFactory.createForClass(OKUserLocation);
25
+
26
+ export type OKUserDocument = HydratedDocument<OKUser>;
27
+
28
+ @Schema()
29
+ export class OKUser {
30
+ @Prop()
31
+ uid: string;
32
+
33
+ @Prop()
34
+ birthday: string;
35
+
36
+ @Prop()
37
+ birthdaySet: boolean;
38
+
39
+ @Prop()
40
+ age: number;
41
+
42
+ @Prop()
43
+ first_name: string;
44
+
45
+ @Prop()
46
+ last_name: string;
47
+
48
+ @Prop()
49
+ location: OKUserLocation;
50
+
51
+ @Prop()
52
+ pic128x128: string;
53
+ }
54
+
55
+ export const OKUserSchema = SchemaFactory.createForClass(OKUser);
@@ -0,0 +1,227 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ import { VKUser } from './user.vk.schema';
5
+ import { Purchase } from './purchase.schema';
6
+ import { OKUserLocation } from './user.ok.schema';
7
+ import { YAUser } from './user.ya.schema';
8
+ import { TGUser } from './user.tg.schema';
9
+ import { GoogleUser } from './user.google.schema';
10
+ import { FBUser } from './user.fb.schema';
11
+
12
+ export type UserDocument = HydratedDocument<User>;
13
+
14
+ export type IUserWinnerRating = {
15
+ month: string;
16
+ rank: number;
17
+ profit: number;
18
+ }
19
+
20
+ export type IUserFriend = {
21
+ userIdWhoAdded: string
22
+ addedUserId: string;
23
+ friendId: string;
24
+ confirmed: boolean;
25
+ channelId: string;
26
+ lastVisitChannel?: Date;
27
+ };
28
+
29
+ @Schema()
30
+ export class User {
31
+ @Prop()
32
+ login?: string;
33
+
34
+ @Prop()
35
+ password?: string;
36
+
37
+ @Prop()
38
+ fullName: string;
39
+
40
+ @Prop()
41
+ fullNameAlias: string;
42
+
43
+ @Prop()
44
+ balance: number;
45
+
46
+ @Prop()
47
+ avatarUrl: string;
48
+
49
+ @Prop()
50
+ avatarAliasUrl: string;
51
+
52
+ @Prop()
53
+ avatarFrame: string;
54
+
55
+ @Prop()
56
+ theme: string;
57
+
58
+ @Prop()
59
+ language: string;
60
+
61
+ @Prop()
62
+ cardSkin: string;
63
+
64
+ @Prop()
65
+ gameSounds: string;
66
+
67
+ @Prop({ type: VKUser })
68
+ vkUser?: VKUser;
69
+
70
+ @Prop({ type: OKUserLocation })
71
+ okUser?: OKUserLocation;
72
+
73
+ @Prop({ type: YAUser })
74
+ yaUser?: YAUser;
75
+
76
+ @Prop({ type: GoogleUser })
77
+ googleUser?: GoogleUser;
78
+
79
+ @Prop({ type: FBUser })
80
+ fbUser?: FBUser;
81
+
82
+ @Prop({ type: TGUser })
83
+ tgUser?: TGUser;
84
+
85
+ @Prop()
86
+ everydayEnterCount: number;
87
+
88
+ @Prop()
89
+ lastEnter: Date;
90
+
91
+ @Prop()
92
+ lastLoginClientVersion: string;
93
+
94
+ @Prop()
95
+ lastLoginClientChannel: string;
96
+
97
+ @Prop()
98
+ lastLoginClientDevice: string;
99
+
100
+ @Prop()
101
+ lastLoginClientOS: string;
102
+
103
+ @Prop()
104
+ lastLoginClientBrowser: string;
105
+
106
+ @Prop()
107
+ lastLoginClientDeviceWidth: number;
108
+
109
+ @Prop()
110
+ lastLoginClientDeviceHeight: number;
111
+
112
+ @Prop()
113
+ lastLoginClientIsMobile: boolean;
114
+
115
+ @Prop({ type: Array<Purchase> })
116
+ purchases: Array<Purchase>;
117
+
118
+ @Prop()
119
+ likedNotifications: Array<string>;
120
+
121
+ @Prop()
122
+ lastReadNotificationsDate?: Date;
123
+
124
+ @Prop()
125
+ experience: number;
126
+
127
+ @Prop()
128
+ level: number;
129
+
130
+ @Prop()
131
+ gamesPlayed: number;
132
+
133
+ @Prop()
134
+ gamesWon: number;
135
+
136
+ @Prop()
137
+ gamesTheBestSet: number;
138
+
139
+ @Prop()
140
+ gamesMaxProfit: number;
141
+
142
+ @Prop()
143
+ isBannedInChat: boolean;
144
+
145
+ @Prop()
146
+ friends: IUserFriend[];
147
+
148
+ @Prop()
149
+ roomTable: string;
150
+
151
+ @Prop()
152
+ disableEditName: boolean;
153
+
154
+ @Prop()
155
+ winnerRatings: Array<IUserWinnerRating>;
156
+
157
+ @Prop()
158
+ colorSchema: string;
159
+
160
+ @Prop()
161
+ registerDate: Date;
162
+
163
+ @Prop()
164
+ premiumExpired: Date;
165
+
166
+ @Prop()
167
+ watchedPremiumExpiredScreenCounter: number;
168
+
169
+ @Prop()
170
+ lastRewardAdvView?: Date;
171
+
172
+ @Prop()
173
+ achievements?: Array<string>;
174
+
175
+ @Prop()
176
+ earnProfitCount: number;
177
+
178
+ @Prop()
179
+ winSharksCount: number;
180
+
181
+ @Prop()
182
+ fastTournamentsWonCount: number;
183
+
184
+ @Prop()
185
+ allInWinCount: number;
186
+
187
+ @Prop()
188
+ watchedAdvRewardCount: number;
189
+
190
+ @Prop()
191
+ textedMessagesCount: number;
192
+
193
+ @Prop()
194
+ sentReactionsCount: number;
195
+
196
+ @Prop()
197
+ setTwoPairCount: number;
198
+
199
+ @Prop()
200
+ setThreeOfAKind: number;
201
+
202
+ @Prop()
203
+ setStraightCount: number;
204
+
205
+ @Prop()
206
+ setFlushCount: number;
207
+
208
+ @Prop()
209
+ setFullHouseCount: number;
210
+
211
+ @Prop()
212
+ setFourOfAKindCount: number;
213
+
214
+ @Prop()
215
+ setStraightFlushCount: number;
216
+
217
+ @Prop()
218
+ bannedUsers: Array<string>;
219
+
220
+ @Prop()
221
+ bgPattern: string;
222
+
223
+ @Prop()
224
+ isNewUser: boolean;
225
+ }
226
+
227
+ export const UserSchema = SchemaFactory.createForClass(User);
@@ -0,0 +1,30 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type TGUserDocument = HydratedDocument<TGUser>;
5
+
6
+ @Schema()
7
+ export class TGUser {
8
+ @Prop()
9
+ id: number;
10
+
11
+ @Prop()
12
+ firstName: string;
13
+
14
+ @Prop()
15
+ lastName: string;
16
+
17
+ @Prop()
18
+ username: string;
19
+
20
+ @Prop()
21
+ languageCode: string;
22
+
23
+ @Prop()
24
+ photoUrl: string;
25
+
26
+ @Prop()
27
+ allowsWriteToPm: boolean;
28
+ }
29
+
30
+ export const TGUserSchema = SchemaFactory.createForClass(TGUser);
@@ -0,0 +1,70 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type VKUserCityDocument = HydratedDocument<VKUserCity>;
5
+
6
+ @Schema()
7
+ export class VKUserCity {
8
+ @Prop()
9
+ id: number;
10
+
11
+ @Prop()
12
+ title: string;
13
+ }
14
+
15
+ export const VKUserCitySchema = SchemaFactory.createForClass(VKUserCity);
16
+
17
+ export type VKUserDocument = HydratedDocument<VKUser>;
18
+
19
+ @Schema()
20
+ export class VKUser {
21
+ @Prop()
22
+ id: number;
23
+
24
+ @Prop()
25
+ first_name: string;
26
+
27
+ @Prop()
28
+ last_name: string;
29
+
30
+ @Prop()
31
+ sex: number;
32
+
33
+ @Prop()
34
+ bdate: string;
35
+
36
+ @Prop()
37
+ city: VKUserCity;
38
+
39
+ @Prop()
40
+ country: VKUserCity;
41
+
42
+ @Prop()
43
+ photo_100: string;
44
+
45
+ @Prop()
46
+ photo_200: string;
47
+
48
+ @Prop()
49
+ photo_max_orig: string;
50
+
51
+ @Prop()
52
+ timezone: number;
53
+
54
+ @Prop()
55
+ is_closed: boolean;
56
+
57
+ @Prop()
58
+ can_access_closed: boolean;
59
+
60
+ @Prop()
61
+ can_invite_to_chats: boolean;
62
+
63
+ @Prop()
64
+ is_app_ios: boolean;
65
+
66
+ @Prop()
67
+ is_vk_user_id?: boolean;
68
+ }
69
+
70
+ export const VKUserSchema = SchemaFactory.createForClass(VKUser);
@@ -0,0 +1,24 @@
1
+ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
2
+ import { HydratedDocument } from 'mongoose';
3
+
4
+ export type YAUserDocument = HydratedDocument<YAUser>;
5
+
6
+ @Schema()
7
+ export class YAUser {
8
+ @Prop()
9
+ userId: string;
10
+
11
+ @Prop()
12
+ fullName: string;
13
+
14
+ @Prop()
15
+ language: string;
16
+
17
+ @Prop()
18
+ avatarUrl: string;
19
+
20
+ @Prop()
21
+ isGuest: boolean;
22
+ }
23
+
24
+ export const YAUserSchema = SchemaFactory.createForClass(YAUser);