@edgenets/utils 0.0.18 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/types/user.d.ts +86 -42
- package/dist/types/user.d.ts.map +1 -1
- package/dist/types/user.js +1 -6
- package/dist/types/user.js.map +1 -1
- package/package.json +1 -1
package/dist/types/user.d.ts
CHANGED
@@ -1,50 +1,94 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
export type UserRole = "admin" | "member" | "guest";
|
2
|
+
export type UserStatus = "active" | "inactive" | "banned";
|
3
|
+
export type WalletType = "ton" | "evm" | "btc";
|
4
|
+
export type BadgeType = "season" | "special";
|
5
|
+
export type InviterType = "user" | "channel";
|
6
|
+
export type PointTransactionType = "earn" | "spend" | "expire";
|
7
|
+
export type PointTransactionReason = "purchase" | "bonus" | "refund" | "manual" | "other";
|
8
|
+
export interface PointTransaction {
|
9
|
+
userId: string;
|
10
|
+
type: PointTransactionType;
|
11
|
+
reason: string;
|
12
|
+
amount: number;
|
13
|
+
timestamp: number;
|
14
|
+
metadata?: Record<string, unknown>;
|
6
15
|
}
|
7
|
-
export interface
|
8
|
-
|
9
|
-
name
|
10
|
-
|
11
|
-
|
12
|
-
iss: string;
|
13
|
-
aud: string;
|
14
|
-
sub: string;
|
15
|
-
iat: number;
|
16
|
-
exp: number;
|
17
|
-
authTime: number;
|
18
|
-
firebase: FirebaseInfo;
|
19
|
-
telegram_uid: number;
|
20
|
-
username?: string;
|
21
|
-
firstName?: string;
|
22
|
-
lastName?: string;
|
23
|
-
languageCode?: string;
|
24
|
-
isPremium?: boolean;
|
16
|
+
export interface GameEntry {
|
17
|
+
gameId: string;
|
18
|
+
name?: string;
|
19
|
+
enteredAt: number;
|
20
|
+
metadata?: Record<string, unknown>;
|
25
21
|
}
|
26
|
-
export interface
|
22
|
+
export interface Inviter {
|
23
|
+
type: InviterType;
|
27
24
|
id: string;
|
28
|
-
|
29
|
-
username?: string;
|
30
|
-
firstName?: string;
|
31
|
-
lastName?: string;
|
32
|
-
languageCode?: string;
|
33
|
-
isPremium?: boolean;
|
34
|
-
email?: string;
|
35
|
-
emailVerified?: boolean;
|
36
|
-
createdAt?: Date;
|
37
|
-
updatedAt?: Date;
|
25
|
+
name?: string;
|
38
26
|
metadata?: Record<string, unknown>;
|
39
27
|
}
|
40
|
-
export
|
41
|
-
|
42
|
-
|
43
|
-
|
28
|
+
export interface UserAddress {
|
29
|
+
addressLine1: string;
|
30
|
+
addressLine2?: string;
|
31
|
+
city: string;
|
32
|
+
state?: string;
|
33
|
+
postalCode: string;
|
34
|
+
country: string;
|
35
|
+
}
|
36
|
+
export interface Wallet {
|
37
|
+
type: WalletType;
|
38
|
+
address: string;
|
39
|
+
metadata?: Record<string, unknown>;
|
44
40
|
}
|
45
|
-
export interface
|
46
|
-
|
47
|
-
|
41
|
+
export interface Badge {
|
42
|
+
id: string;
|
43
|
+
name: string;
|
44
|
+
type: BadgeType;
|
45
|
+
awardedAt: number;
|
46
|
+
level?: number;
|
47
|
+
metadata?: Record<string, unknown>;
|
48
|
+
}
|
49
|
+
export interface User {
|
50
|
+
id: string;
|
51
|
+
name: string;
|
52
|
+
email: string;
|
53
|
+
phone?: string;
|
54
|
+
avatarUrl?: string;
|
55
|
+
role: UserRole;
|
56
|
+
status: UserStatus;
|
57
|
+
points?: number;
|
58
|
+
rankLevel?: string;
|
59
|
+
rankPosition?: number;
|
60
|
+
badges?: Badge[];
|
61
|
+
inviter?: Inviter;
|
62
|
+
inviteCode?: string;
|
63
|
+
inviteCount?: number;
|
64
|
+
addresses?: UserAddress[];
|
65
|
+
wallets?: Wallet[];
|
66
|
+
isVip?: boolean;
|
67
|
+
/**
|
68
|
+
* metadata 信息可能包含如下信息
|
69
|
+
*
|
70
|
+
* iss: string; // issuer - 发放令牌的机构
|
71
|
+
* aud: string; // audience - 接收令牌的一方
|
72
|
+
* sub: string; // subject - 通常是与 `userId` 一致
|
73
|
+
* iat: number; // issued at - 令牌签发时间
|
74
|
+
* exp: number; // expiration - 令牌过期时间
|
75
|
+
* authTime: number; // 认证时间
|
76
|
+
* firebase: FirebaseInfo;
|
77
|
+
* telegram {
|
78
|
+
* id: number;
|
79
|
+
* username?: string;
|
80
|
+
* firstName?: string;
|
81
|
+
* lastName?: string;
|
82
|
+
* languageCode?: string;
|
83
|
+
* isPremium?: boolean;
|
84
|
+
* };
|
85
|
+
* discord: {};
|
86
|
+
*/
|
87
|
+
metadata?: Record<string, unknown>;
|
88
|
+
preferences?: Record<string, unknown>;
|
89
|
+
gamesPlayed?: GameEntry[];
|
90
|
+
createdAt?: number;
|
91
|
+
updatedAt?: number;
|
92
|
+
lastLoginAt?: number;
|
48
93
|
}
|
49
|
-
export {};
|
50
94
|
//# sourceMappingURL=user.d.ts.map
|
package/dist/types/user.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"AAAA,UAAU,
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7C,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAC9B,UAAU,GACV,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,OAAO,CAAC;AAIZ,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,oBAAoB,CA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AI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IAEnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAEjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAGhB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtC,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC;IAE1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/types/user.js
CHANGED
package/dist/types/user.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/types/user.ts"],"names":[],"mappings":""}
|