@glissandoo/lib 1.104.33 → 1.105.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.
- package/functions/groupPlayer.d.ts +16 -0
- package/functions/index.d.ts +5 -1
- package/functions/index.js +5 -1
- package/functions/regions.js +5 -1
- package/models/Offer/index.js +1 -1
- package/models/Partnership/Partner/index.d.ts +1 -1
- package/models/User/extended.d.ts +2 -1
- package/models/User/extended.js +5 -1
- package/models/User/index.d.ts +1 -0
- package/models/User/index.js +4 -1
- package/models/User/types.d.ts +5 -2
- package/models/User/types.js +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { InstrumentId } from '../helpers/instruments';
|
|
2
|
+
import { LanguagesTypes } from '../lang';
|
|
2
3
|
import { AdminPermissions } from '../models/Group/types';
|
|
4
|
+
import { UserRegisterVia } from '../models/User/types';
|
|
3
5
|
export declare namespace GroupPlayerFbFunctionsTypes {
|
|
4
6
|
interface SetPermissionsParams {
|
|
5
7
|
userId: string;
|
|
@@ -15,6 +17,20 @@ export declare namespace GroupPlayerFbFunctionsTypes {
|
|
|
15
17
|
notify: boolean;
|
|
16
18
|
}
|
|
17
19
|
type AddResult = void;
|
|
20
|
+
interface AddPlayerParams {
|
|
21
|
+
groupId: string;
|
|
22
|
+
name: string;
|
|
23
|
+
lastname: string;
|
|
24
|
+
email: string | null;
|
|
25
|
+
mainInstrument: InstrumentId;
|
|
26
|
+
instruments: InstrumentId[];
|
|
27
|
+
lang: LanguagesTypes;
|
|
28
|
+
via: UserRegisterVia;
|
|
29
|
+
}
|
|
30
|
+
type AddPlayerResult = {
|
|
31
|
+
status: 'invitation-sent' | 'add-existing-user' | 'add-fake-user';
|
|
32
|
+
userId: string;
|
|
33
|
+
};
|
|
18
34
|
interface JoinGroupParams {
|
|
19
35
|
groupId: string;
|
|
20
36
|
mainInstrument: InstrumentId;
|
package/functions/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare enum FbFunctionName {
|
|
2
|
-
|
|
2
|
+
AuthGetToken = "auth-getToken",
|
|
3
|
+
AuthLogin = "auth-login",
|
|
4
|
+
AuthLogout = "auth-logout",
|
|
5
|
+
AuthStatus = "auth-status",
|
|
3
6
|
CommunicationCommentPublish = "communicationComment-publish",
|
|
4
7
|
CommunicationEdit = "communication-edit",
|
|
5
8
|
CommunicationPublish = "communication-publish",
|
|
@@ -75,6 +78,7 @@ export declare enum FbFunctionName {
|
|
|
75
78
|
GroupOnCreate = "group-onCreate",
|
|
76
79
|
GroupOnUpdate = "group-onUpdate",
|
|
77
80
|
GroupPlayerAdd = "groupPlayer-add",
|
|
81
|
+
GroupPlayerAddPlayer = "groupPlayer-addPlayer",
|
|
78
82
|
GroupPlayerEventOnUpdate = "groupPlayerEvent-onUpdate",
|
|
79
83
|
GroupPlayerJoin = "groupPlayer-joinGroup",
|
|
80
84
|
GroupPlayerLeave = "groupPlayer-leave",
|
package/functions/index.js
CHANGED
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FbFunctionName = void 0;
|
|
4
4
|
var FbFunctionName;
|
|
5
5
|
(function (FbFunctionName) {
|
|
6
|
-
FbFunctionName["
|
|
6
|
+
FbFunctionName["AuthGetToken"] = "auth-getToken";
|
|
7
|
+
FbFunctionName["AuthLogin"] = "auth-login";
|
|
8
|
+
FbFunctionName["AuthLogout"] = "auth-logout";
|
|
9
|
+
FbFunctionName["AuthStatus"] = "auth-status";
|
|
7
10
|
FbFunctionName["CommunicationCommentPublish"] = "communicationComment-publish";
|
|
8
11
|
FbFunctionName["CommunicationEdit"] = "communication-edit";
|
|
9
12
|
FbFunctionName["CommunicationPublish"] = "communication-publish";
|
|
@@ -79,6 +82,7 @@ var FbFunctionName;
|
|
|
79
82
|
FbFunctionName["GroupOnCreate"] = "group-onCreate";
|
|
80
83
|
FbFunctionName["GroupOnUpdate"] = "group-onUpdate";
|
|
81
84
|
FbFunctionName["GroupPlayerAdd"] = "groupPlayer-add";
|
|
85
|
+
FbFunctionName["GroupPlayerAddPlayer"] = "groupPlayer-addPlayer";
|
|
82
86
|
FbFunctionName["GroupPlayerEventOnUpdate"] = "groupPlayerEvent-onUpdate";
|
|
83
87
|
FbFunctionName["GroupPlayerJoin"] = "groupPlayer-joinGroup";
|
|
84
88
|
FbFunctionName["GroupPlayerLeave"] = "groupPlayer-leave";
|
package/functions/regions.js
CHANGED
|
@@ -10,7 +10,10 @@ var GCloudRegions;
|
|
|
10
10
|
})(GCloudRegions = exports.GCloudRegions || (exports.GCloudRegions = {}));
|
|
11
11
|
const defaultRegion = GCloudRegions.UsCentral1;
|
|
12
12
|
const regionByFunctions = {
|
|
13
|
-
[index_1.FbFunctionName.
|
|
13
|
+
[index_1.FbFunctionName.AuthGetToken]: GCloudRegions.EuropeWest6,
|
|
14
|
+
[index_1.FbFunctionName.AuthLogin]: GCloudRegions.EuropeWest6,
|
|
15
|
+
[index_1.FbFunctionName.AuthLogout]: GCloudRegions.EuropeWest6,
|
|
16
|
+
[index_1.FbFunctionName.AuthStatus]: GCloudRegions.EuropeWest6,
|
|
14
17
|
[index_1.FbFunctionName.CommunicationCommentPublish]: GCloudRegions.EuropeWest6,
|
|
15
18
|
[index_1.FbFunctionName.CommunicationEdit]: GCloudRegions.UsCentral1,
|
|
16
19
|
[index_1.FbFunctionName.CommunicationPublish]: GCloudRegions.UsCentral1,
|
|
@@ -86,6 +89,7 @@ const regionByFunctions = {
|
|
|
86
89
|
[index_1.FbFunctionName.GroupOnCreate]: GCloudRegions.UsCentral1,
|
|
87
90
|
[index_1.FbFunctionName.GroupOnUpdate]: GCloudRegions.UsCentral1,
|
|
88
91
|
[index_1.FbFunctionName.GroupPlayerAdd]: GCloudRegions.UsCentral1,
|
|
92
|
+
[index_1.FbFunctionName.GroupPlayerAddPlayer]: GCloudRegions.EuropeWest6,
|
|
89
93
|
[index_1.FbFunctionName.GroupPlayerEventOnUpdate]: GCloudRegions.UsCentral1,
|
|
90
94
|
[index_1.FbFunctionName.GroupPlayerJoin]: GCloudRegions.UsCentral1,
|
|
91
95
|
[index_1.FbFunctionName.GroupPlayerLeave]: GCloudRegions.UsCentral1,
|
package/models/Offer/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export default class PartnershipPartner extends ModelWithLang<PartnershipPartner
|
|
|
11
11
|
get photoURL(): string;
|
|
12
12
|
get displayName(): string;
|
|
13
13
|
get NIF(): string | null;
|
|
14
|
-
get email(): string;
|
|
14
|
+
get email(): string | null;
|
|
15
15
|
get phone(): string | null;
|
|
16
16
|
get birthdate(): FirebaseFirestore.Timestamp | null;
|
|
17
17
|
get sepaMandate(): {
|
|
@@ -5,8 +5,9 @@ import { UserExtendedData } from './types';
|
|
|
5
5
|
export default class UserExtended<D> extends UserBasic<D & UserExtendedData> {
|
|
6
6
|
constructor(doc: DocumentModel, lang?: LanguagesTypes);
|
|
7
7
|
get extendedInfo(): UserExtendedData;
|
|
8
|
+
get fakeUser(): boolean;
|
|
8
9
|
get locality(): string | null;
|
|
9
10
|
get location(): FirebaseFirestore.GeoPoint | null;
|
|
10
11
|
get birthDate(): FirebaseFirestore.Timestamp | null;
|
|
11
|
-
get email(): string;
|
|
12
|
+
get email(): string | null;
|
|
12
13
|
}
|
package/models/User/extended.js
CHANGED
|
@@ -16,8 +16,12 @@ class UserExtended extends basic_1.default {
|
|
|
16
16
|
locality: this.locality,
|
|
17
17
|
location: this.location,
|
|
18
18
|
birthDate: this.birthDate,
|
|
19
|
+
fakeUser: this.fakeUser,
|
|
19
20
|
};
|
|
20
21
|
}
|
|
22
|
+
get fakeUser() {
|
|
23
|
+
return this.data.fakeUser || false;
|
|
24
|
+
}
|
|
21
25
|
get locality() {
|
|
22
26
|
return this.data.locality || null;
|
|
23
27
|
}
|
|
@@ -28,7 +32,7 @@ class UserExtended extends basic_1.default {
|
|
|
28
32
|
return this.data.birthDate || null;
|
|
29
33
|
}
|
|
30
34
|
get email() {
|
|
31
|
-
return this.data.email;
|
|
35
|
+
return this.data.email || null;
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
exports.default = UserExtended;
|
package/models/User/index.d.ts
CHANGED
package/models/User/index.js
CHANGED
|
@@ -23,7 +23,7 @@ class User extends extended_1.default {
|
|
|
23
23
|
return (0, lodash_1.isString)(this.displayName) && (0, lodash_1.isString)(this.photoURL) && (0, lodash_1.isString)(this.email);
|
|
24
24
|
}
|
|
25
25
|
get role() {
|
|
26
|
-
return this.data.role;
|
|
26
|
+
return this.data.role || types_2.UserRole.User;
|
|
27
27
|
}
|
|
28
28
|
get isSuperAdmin() {
|
|
29
29
|
return this.role === types_2.UserRole.SuperAdmin;
|
|
@@ -171,5 +171,8 @@ class User extends extended_1.default {
|
|
|
171
171
|
get lastBiweeklyEmailAt() {
|
|
172
172
|
return this.data.lastBiweeklyEmailAt || null;
|
|
173
173
|
}
|
|
174
|
+
get groupInvites() {
|
|
175
|
+
return this.data.groupsInvite || [];
|
|
176
|
+
}
|
|
174
177
|
}
|
|
175
178
|
exports.default = User;
|
package/models/User/types.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ export declare enum UserRole {
|
|
|
10
10
|
}
|
|
11
11
|
export declare enum UserRegisterVia {
|
|
12
12
|
Web = "web",
|
|
13
|
-
App = "app"
|
|
13
|
+
App = "app",
|
|
14
|
+
Invitation = "invitation"
|
|
14
15
|
}
|
|
15
16
|
export declare enum UserAppConfig {
|
|
16
17
|
DefaultGroupId = "default_group_id",
|
|
@@ -66,10 +67,11 @@ export interface UserBasicData extends UserTinyData {
|
|
|
66
67
|
lastname: string;
|
|
67
68
|
}
|
|
68
69
|
export interface UserExtendedData extends UserBasicData {
|
|
69
|
-
email: string;
|
|
70
|
+
email: string | null;
|
|
70
71
|
locality: string | null;
|
|
71
72
|
location: GeoPoint | null;
|
|
72
73
|
birthDate: Timestamp | null;
|
|
74
|
+
fakeUser: boolean;
|
|
73
75
|
}
|
|
74
76
|
export interface UserData extends UserExtendedData {
|
|
75
77
|
instruments: string[];
|
|
@@ -119,6 +121,7 @@ export interface UserData extends UserExtendedData {
|
|
|
119
121
|
registerVia: UserRegisterVia;
|
|
120
122
|
lastAppLoginAt: Timestamp | null;
|
|
121
123
|
lastWebLoginAt: Timestamp | null;
|
|
124
|
+
groupsInvite: string[];
|
|
122
125
|
}
|
|
123
126
|
export interface AUserBasicData extends UserBasicData {
|
|
124
127
|
id: string;
|
package/models/User/types.js
CHANGED
|
@@ -10,6 +10,7 @@ var UserRegisterVia;
|
|
|
10
10
|
(function (UserRegisterVia) {
|
|
11
11
|
UserRegisterVia["Web"] = "web";
|
|
12
12
|
UserRegisterVia["App"] = "app";
|
|
13
|
+
UserRegisterVia["Invitation"] = "invitation";
|
|
13
14
|
})(UserRegisterVia = exports.UserRegisterVia || (exports.UserRegisterVia = {}));
|
|
14
15
|
var UserAppConfig;
|
|
15
16
|
(function (UserAppConfig) {
|