@glissandoo/lib 1.0.5 → 1.0.6
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/models/User/index.d.ts +6 -2
- package/models/User/index.js +7 -3
- package/models/User/types.d.ts +1 -0
- package/package.json +1 -1
package/models/User/index.d.ts
CHANGED
|
@@ -17,18 +17,22 @@ export default class User extends UserBasic<UserData> {
|
|
|
17
17
|
get federationId(): string | null;
|
|
18
18
|
get pushToken(): string | null;
|
|
19
19
|
get tokens(): string[];
|
|
20
|
-
get
|
|
20
|
+
get notifications(): number;
|
|
21
21
|
get language(): import("../../lang").LanguagesTypes;
|
|
22
22
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
23
23
|
get intercomId(): string | null;
|
|
24
|
-
get
|
|
24
|
+
get groupsAdmin(): string[];
|
|
25
25
|
get isAdmin(): boolean;
|
|
26
26
|
get birthDate(): FirebaseFirestore.Timestamp | null;
|
|
27
|
+
/** @deprecated */
|
|
27
28
|
private get devices();
|
|
29
|
+
/** @deprecated */
|
|
28
30
|
get devicesList(): (import("./types").DeviceInfo & {
|
|
29
31
|
id: string;
|
|
30
32
|
})[];
|
|
33
|
+
/** @deprecated */
|
|
31
34
|
get hasDevices(): boolean;
|
|
35
|
+
/** @deprecated */
|
|
32
36
|
get device(): (import("./types").DeviceInfo & {
|
|
33
37
|
id: string;
|
|
34
38
|
}) | null;
|
package/models/User/index.js
CHANGED
|
@@ -54,7 +54,7 @@ class User extends basic_1.default {
|
|
|
54
54
|
get tokens() {
|
|
55
55
|
return this.data.tokens || [];
|
|
56
56
|
}
|
|
57
|
-
get
|
|
57
|
+
get notifications() {
|
|
58
58
|
return this.data.notifications || 0;
|
|
59
59
|
}
|
|
60
60
|
get language() {
|
|
@@ -66,25 +66,29 @@ class User extends basic_1.default {
|
|
|
66
66
|
get intercomId() {
|
|
67
67
|
return this.data.intercom_id || null;
|
|
68
68
|
}
|
|
69
|
-
get
|
|
69
|
+
get groupsAdmin() {
|
|
70
70
|
return this.data.groups_admin || [];
|
|
71
71
|
}
|
|
72
72
|
get isAdmin() {
|
|
73
|
-
return this.
|
|
73
|
+
return this.groupsAdmin.length > 0;
|
|
74
74
|
}
|
|
75
75
|
get birthDate() {
|
|
76
76
|
return this.data.birthDate;
|
|
77
77
|
}
|
|
78
|
+
/** @deprecated */
|
|
78
79
|
get devices() {
|
|
79
80
|
return this.data.devices || {};
|
|
80
81
|
}
|
|
82
|
+
/** @deprecated */
|
|
81
83
|
get devicesList() {
|
|
82
84
|
const list = Object.keys(this.devices).map((id) => Object.assign(this.devices[id], { id }));
|
|
83
85
|
return orderBy_1.default(list, (device) => device.last_seen_at.toDate(), ['desc']);
|
|
84
86
|
}
|
|
87
|
+
/** @deprecated */
|
|
85
88
|
get hasDevices() {
|
|
86
89
|
return this.devicesList.length > 0;
|
|
87
90
|
}
|
|
91
|
+
/** @deprecated */
|
|
88
92
|
get device() {
|
|
89
93
|
if (this.hasDevices) {
|
|
90
94
|
return this.devicesList[0];
|
package/models/User/types.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export interface UserData extends UserBasicData {
|
|
|
55
55
|
federationId: string | null;
|
|
56
56
|
groups_admin: string[];
|
|
57
57
|
birthDate: Timestamp | null;
|
|
58
|
+
/** @deprecated */
|
|
58
59
|
devices: Record<string, DeviceInfo> | null;
|
|
59
60
|
disabledNotifications: Record<string, boolean> | null;
|
|
60
61
|
appConfig: {
|