@glissandoo/lib 1.61.0 → 1.61.2
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/auth.js +2 -1
- package/functions/communication.js +2 -1
- package/functions/communicationComment.js +2 -1
- package/functions/customer.js +2 -1
- package/functions/customerGroup.js +2 -1
- package/functions/event.js +5 -2
- package/functions/eventPlayer.js +5 -2
- package/functions/eventRepertory.js +2 -1
- package/functions/federation.js +2 -1
- package/functions/federationPartnership.js +2 -1
- package/functions/group.js +2 -1
- package/functions/groupPlayer.js +2 -1
- package/functions/groupRepertory.js +2 -1
- package/functions/index.js +5 -2
- package/functions/jwt.js +2 -1
- package/functions/misc.js +2 -1
- package/functions/notification.js +2 -1
- package/functions/partner.js +2 -1
- package/functions/partnership.js +2 -1
- package/functions/partnershipGroup.js +2 -1
- package/functions/partnershipPlan.js +2 -1
- package/functions/regions.js +128 -124
- package/functions/subscription.js +2 -1
- package/functions/user.js +2 -1
- package/helpers/appScenes.js +5 -2
- package/helpers/audios.js +9 -5
- package/helpers/auth.js +9 -5
- package/helpers/badges.js +19 -10
- package/helpers/collections.js +5 -2
- package/helpers/countries.js +4 -1
- package/helpers/dlinks.js +5 -2
- package/helpers/errors.js +5 -2
- package/helpers/fileSections/index.js +8 -5
- package/helpers/fileSections/orders.js +16 -11
- package/helpers/glissandooAdmin.js +6 -2
- package/helpers/instruments/index.js +6 -3
- package/helpers/instruments/lists.js +19 -11
- package/helpers/musicStyles/index.js +36 -29
- package/helpers/musicStyles/orders.js +179 -174
- package/helpers/notifications/index.js +122 -119
- package/helpers/notifications/placeholders.js +26 -18
- package/helpers/objects.js +23 -15
- package/helpers/payments.js +8 -5
- package/helpers/plans.js +9 -6
- package/helpers/rates.js +6 -2
- package/helpers/reasons.js +21 -17
- package/helpers/slate.js +12 -5
- package/helpers/styles.js +4 -1
- package/helpers/ts-extras/array-includes.js +5 -1
- package/helpers/ts-extras/as-mutable.js +5 -1
- package/helpers/ts-extras/assert-error.js +5 -1
- package/helpers/ts-extras/index.js +33 -15
- package/helpers/ts-extras/is-defined.js +5 -1
- package/helpers/ts-extras/is-empty.js +5 -1
- package/helpers/ts-extras/is-finite.js +4 -1
- package/helpers/ts-extras/is-infinite.js +5 -1
- package/helpers/ts-extras/is-integer.js +4 -1
- package/helpers/ts-extras/is-present.js +5 -1
- package/helpers/ts-extras/is-safe-integer.js +4 -1
- package/helpers/ts-extras/object-entries.js +4 -1
- package/helpers/ts-extras/object-from-entries.js +4 -1
- package/helpers/ts-extras/object-has-own.js +5 -1
- package/helpers/ts-extras/object-keys.js +4 -1
- package/helpers/ts-extras/set-has.js +5 -1
- package/helpers/types.js +5 -2
- package/helpers/utils.d.ts +1 -0
- package/helpers/utils.js +23 -8
- package/lang/index.js +51 -42
- package/models/Communication/Comment/index.js +12 -5
- package/models/Communication/Comment/types.js +2 -1
- package/models/Communication/index.js +21 -15
- package/models/Communication/types.js +7 -4
- package/models/Counters/Group/Analytics/index.js +12 -5
- package/models/Counters/Group/Analytics/types.js +5 -2
- package/models/Counters/Group/index.js +8 -2
- package/models/Counters/Group/types.js +2 -1
- package/models/Counters/event.js +8 -2
- package/models/Counters/index.js +8 -2
- package/models/Counters/types.js +2 -1
- package/models/Customer/Group/index.js +14 -7
- package/models/Customer/Group/types.js +2 -1
- package/models/Customer/basic.js +10 -4
- package/models/Customer/index.js +11 -5
- package/models/Customer/types.js +5 -2
- package/models/Evento/Player/basic.js +11 -10
- package/models/Evento/Player/index.js +19 -12
- package/models/Evento/Player/types.js +7 -4
- package/models/Evento/Repertory/index.js +10 -3
- package/models/Evento/Repertory/types.js +2 -1
- package/models/Evento/basic.js +18 -12
- package/models/Evento/index.js +38 -32
- package/models/Evento/promoter.js +8 -2
- package/models/Evento/tiny.js +9 -9
- package/models/Evento/types.js +17 -14
- package/models/Federation/Partnership/index.js +10 -3
- package/models/Federation/Partnership/types.js +2 -1
- package/models/Federation/index.js +13 -7
- package/models/Federation/types.js +2 -1
- package/models/Group/Analytics/index.js +12 -5
- package/models/Group/Analytics/types.js +5 -2
- package/models/Group/Event/index.js +12 -6
- package/models/Group/Event/types.js +2 -1
- package/models/Group/Player/Event/index.js +18 -11
- package/models/Group/Player/Event/types.js +2 -1
- package/models/Group/Player/Log/index.js +8 -2
- package/models/Group/Player/Log/types.js +2 -1
- package/models/Group/Player/index.js +25 -18
- package/models/Group/Player/types.js +5 -2
- package/models/Group/Repertory/File/Section/index.js +16 -12
- package/models/Group/Repertory/File/Section/types.js +5 -2
- package/models/Group/Repertory/File/index.js +12 -11
- package/models/Group/Repertory/File/types.js +2 -1
- package/models/Group/Repertory/FilePath/index.js +15 -12
- package/models/Group/Repertory/index.js +32 -25
- package/models/Group/Repertory/types.js +5 -2
- package/models/Group/StageTemplate/index.js +8 -2
- package/models/Group/StageTemplate/types.js +2 -1
- package/models/Group/basic.js +11 -5
- package/models/Group/index.js +47 -41
- package/models/Group/types.js +17 -14
- package/models/Instrument/group.js +11 -6
- package/models/Instrument/index.js +9 -8
- package/models/Metrics/index.js +16 -10
- package/models/Metrics/types.js +2 -1
- package/models/Model/index.js +6 -7
- package/models/Model/lang.js +10 -5
- package/models/MusicStyle/index.js +10 -9
- package/models/Notification/index.js +8 -2
- package/models/Notification/types.js +5 -2
- package/models/Partner/basic.js +12 -6
- package/models/Partner/index.js +10 -4
- package/models/Partner/tiny.js +8 -2
- package/models/Partner/types.js +5 -2
- package/models/Partnership/Group/index.js +12 -5
- package/models/Partnership/Group/types.js +2 -1
- package/models/Partnership/Partner/Subscription/index.js +15 -8
- package/models/Partnership/Partner/Subscription/types.js +5 -2
- package/models/Partnership/Partner/index.js +10 -3
- package/models/Partnership/Partner/types.js +2 -1
- package/models/Partnership/Payment/index.js +8 -2
- package/models/Partnership/Payment/types.js +2 -1
- package/models/Partnership/Plan/basic.js +18 -12
- package/models/Partnership/Plan/index.js +10 -3
- package/models/Partnership/Plan/types.js +5 -2
- package/models/Partnership/basic.js +10 -4
- package/models/Partnership/index.js +11 -5
- package/models/Partnership/types.js +7 -4
- package/models/Payment/basic.js +13 -7
- package/models/Payment/index.js +8 -2
- package/models/Payment/types.js +7 -4
- package/models/Player/basic.js +10 -4
- package/models/Player/types.js +2 -1
- package/models/Repertory/basic.js +8 -2
- package/models/Repertory/types.js +2 -1
- package/models/User/Group/index.js +15 -8
- package/models/User/Group/types.js +2 -1
- package/models/User/Notification/index.js +22 -16
- package/models/User/Notification/types.js +2 -1
- package/models/User/basic.js +10 -4
- package/models/User/index.js +24 -18
- package/models/User/types.js +15 -12
- package/models/WebhookEvent/index.js +8 -2
- package/models/WebhookEvent/types.js +5 -2
- package/package.json +1 -1
- package/types/firestore.js +5 -2
- package/types/messagebirdChatWidget.js +2 -1
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const endOfDay_1 = __importDefault(require("date-fns/endOfDay"));
|
|
7
|
+
const isFuture_1 = __importDefault(require("date-fns/isFuture"));
|
|
8
|
+
const lodash_1 = require("lodash");
|
|
9
|
+
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
10
|
+
const objects_1 = require("../../../helpers/objects");
|
|
11
|
+
const ts_extras_1 = require("../../../helpers/ts-extras");
|
|
12
|
+
const utils_1 = require("../../../helpers/utils");
|
|
13
|
+
const lang_1 = require("../../../lang");
|
|
14
|
+
const tiny_1 = __importDefault(require("../../Evento/tiny"));
|
|
15
|
+
const basic_1 = __importDefault(require("../../Repertory/basic"));
|
|
16
|
+
const types_1 = require("./File/Section/types");
|
|
17
|
+
const types_2 = require("./types");
|
|
18
|
+
class GroupRepertory extends basic_1.default {
|
|
19
|
+
constructor(doc, lang = lang_1.defaultLocale) {
|
|
15
20
|
super(doc);
|
|
21
|
+
this.lang = lang_1.defaultLocale;
|
|
16
22
|
this.lang = lang;
|
|
17
23
|
}
|
|
18
24
|
get groupId() {
|
|
19
|
-
return this.ref.path.split('/')
|
|
25
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
20
26
|
}
|
|
21
27
|
get tagsAlgolia() {
|
|
22
28
|
return this.data.tagsAlgolia || [];
|
|
@@ -33,10 +39,10 @@ export default class GroupRepertory extends Theme {
|
|
|
33
39
|
return this.data.files || {};
|
|
34
40
|
}
|
|
35
41
|
get fileList() {
|
|
36
|
-
return mapToArray(this.files);
|
|
42
|
+
return (0, objects_1.mapToArray)(this.files);
|
|
37
43
|
}
|
|
38
44
|
get sectionIds() {
|
|
39
|
-
return uniq(this.fileList.map((file) => Object.keys(file.sections)).flat());
|
|
45
|
+
return (0, lodash_1.uniq)(this.fileList.map((file) => Object.keys(file.sections)).flat());
|
|
40
46
|
}
|
|
41
47
|
get filesPath() {
|
|
42
48
|
return this.data.filesPath || {};
|
|
@@ -51,7 +57,7 @@ export default class GroupRepertory extends Theme {
|
|
|
51
57
|
return this.data.mainFilePath;
|
|
52
58
|
}
|
|
53
59
|
get visibility() {
|
|
54
|
-
return this.data.visibility || GroupRepertoireVisibility.ByEvent;
|
|
60
|
+
return this.data.visibility || types_2.GroupRepertoireVisibility.ByEvent;
|
|
55
61
|
}
|
|
56
62
|
get votes() {
|
|
57
63
|
return this.data.votes || {};
|
|
@@ -75,11 +81,11 @@ export default class GroupRepertory extends Theme {
|
|
|
75
81
|
return this.data.eventsTL || {};
|
|
76
82
|
}
|
|
77
83
|
get eventsList() {
|
|
78
|
-
return Object.keys(this.eventsTL).map((id) => new
|
|
84
|
+
return Object.keys(this.eventsTL).map((id) => new tiny_1.default(id, this.eventsTL[id], this.lang));
|
|
79
85
|
}
|
|
80
86
|
/** @deprecated use getNextEvents */
|
|
81
87
|
get nextEvents() {
|
|
82
|
-
return this.getEventsByOrder().filter((ev) =>
|
|
88
|
+
return this.getEventsByOrder().filter((ev) => (0, isFuture_1.default)(ev.datetime.toDate()));
|
|
83
89
|
}
|
|
84
90
|
/** @deprecated use getNextEvent */
|
|
85
91
|
get nextEvent() {
|
|
@@ -126,8 +132,8 @@ export default class GroupRepertory extends Theme {
|
|
|
126
132
|
return this.data.claims || {};
|
|
127
133
|
}
|
|
128
134
|
get claimsList() {
|
|
129
|
-
return objectEntries(this.claims)
|
|
130
|
-
.map(([iId, users]) => objectEntries(users || {}).map(([userId, claim]) => ({
|
|
135
|
+
return (0, ts_extras_1.objectEntries)(this.claims)
|
|
136
|
+
.map(([iId, users]) => (0, ts_extras_1.objectEntries)(users || {}).map(([userId, claim]) => ({
|
|
131
137
|
userId,
|
|
132
138
|
instrumentId: iId,
|
|
133
139
|
hasFile: this.hasInstrumentAFile(iId),
|
|
@@ -136,7 +142,7 @@ export default class GroupRepertory extends Theme {
|
|
|
136
142
|
.flat();
|
|
137
143
|
}
|
|
138
144
|
hasInstrumentAFile(instrumentId) {
|
|
139
|
-
return (this.sectionIds.includes(FileSectionIdReserved.All) ||
|
|
145
|
+
return (this.sectionIds.includes(types_1.FileSectionIdReserved.All) ||
|
|
140
146
|
this.sectionIds.includes(instrumentId));
|
|
141
147
|
}
|
|
142
148
|
claimsByInstrument(instrumentId) {
|
|
@@ -166,10 +172,10 @@ export default class GroupRepertory extends Theme {
|
|
|
166
172
|
return this.instruments.find((i) => i.id === id);
|
|
167
173
|
}
|
|
168
174
|
getEventsByOrder(order = 'desc') {
|
|
169
|
-
return
|
|
175
|
+
return (0, orderBy_1.default)(this.eventsList, (e) => e.datetime.toDate(), [order]);
|
|
170
176
|
}
|
|
171
177
|
getNextEvents(endDay = false) {
|
|
172
|
-
return this.getEventsByOrder().filter((ev) => endDay ?
|
|
178
|
+
return this.getEventsByOrder().filter((ev) => endDay ? (0, isFuture_1.default)((0, endOfDay_1.default)(ev.datetime.toDate())) : (0, isFuture_1.default)(ev.datetime.toDate()));
|
|
173
179
|
}
|
|
174
180
|
getNextEvent(endDay = false) {
|
|
175
181
|
const events = this.getNextEvents(endDay);
|
|
@@ -179,3 +185,4 @@ export default class GroupRepertory extends Theme {
|
|
|
179
185
|
return events[events.length - 1];
|
|
180
186
|
}
|
|
181
187
|
}
|
|
188
|
+
exports.default = GroupRepertory;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupRepertoireVisibility = void 0;
|
|
4
|
+
var GroupRepertoireVisibility;
|
|
2
5
|
(function (GroupRepertoireVisibility) {
|
|
3
6
|
GroupRepertoireVisibility["Always"] = "always";
|
|
4
7
|
GroupRepertoireVisibility["ByEvent"] = "byEvent";
|
|
5
|
-
})(GroupRepertoireVisibility || (GroupRepertoireVisibility = {}));
|
|
8
|
+
})(GroupRepertoireVisibility = exports.GroupRepertoireVisibility || (exports.GroupRepertoireVisibility = {}));
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Model_1 = __importDefault(require("../../Model"));
|
|
7
|
+
class GroupStageTemplate extends Model_1.default {
|
|
3
8
|
constructor(doc) {
|
|
4
9
|
super(doc);
|
|
5
10
|
}
|
|
@@ -25,3 +30,4 @@ export default class GroupStageTemplate extends Model {
|
|
|
25
30
|
return this.data.createdAt;
|
|
26
31
|
}
|
|
27
32
|
}
|
|
33
|
+
exports.default = GroupStageTemplate;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/models/Group/basic.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lang_1 = require("../../lang");
|
|
7
|
+
const lang_2 = __importDefault(require("../Model/lang"));
|
|
8
|
+
class GroupBasic extends lang_2.default {
|
|
9
|
+
constructor(doc, lang = lang_1.defaultLocale) {
|
|
5
10
|
super(doc, lang);
|
|
6
11
|
}
|
|
7
12
|
get tinyInfo() {
|
|
@@ -39,7 +44,8 @@ export default class GroupBasic extends ModelWithLang {
|
|
|
39
44
|
return this.data.musicStyle;
|
|
40
45
|
}
|
|
41
46
|
get musicStyleString() {
|
|
42
|
-
const translation = getTranslation(`musicStyles.${this.musicStyle}`, this.lang);
|
|
47
|
+
const translation = (0, lang_1.getTranslation)(`musicStyles.${this.musicStyle}`, this.lang);
|
|
43
48
|
return translation || this.musicStyle;
|
|
44
49
|
}
|
|
45
50
|
}
|
|
51
|
+
exports.default = GroupBasic;
|
package/models/Group/index.js
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const date_fns_1 = require("date-fns");
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
|
+
const collections_1 = require("../../helpers/collections");
|
|
9
|
+
const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
|
|
10
|
+
const orders_1 = require("../../helpers/musicStyles/orders");
|
|
11
|
+
const objects_1 = require("../../helpers/objects");
|
|
12
|
+
const plans_1 = require("../../helpers/plans");
|
|
13
|
+
const lang_1 = require("../../lang");
|
|
14
|
+
const basic_1 = __importDefault(require("./basic"));
|
|
15
|
+
const types_1 = require("./types");
|
|
16
|
+
class Group extends basic_1.default {
|
|
17
|
+
constructor(doc, lang = lang_1.defaultLocale) {
|
|
13
18
|
super(doc, lang);
|
|
19
|
+
this.getPlayer = (userId) => {
|
|
20
|
+
return userId in this.players ? this.players[userId] : null;
|
|
21
|
+
};
|
|
22
|
+
this.isAdmin = (userId) => {
|
|
23
|
+
return this.admins.includes(userId);
|
|
24
|
+
};
|
|
25
|
+
this.isPlayer = (userId) => {
|
|
26
|
+
return this.playerIds.includes(userId);
|
|
27
|
+
};
|
|
14
28
|
}
|
|
15
29
|
get owner() {
|
|
16
30
|
return this.data.owner;
|
|
@@ -83,13 +97,13 @@ export default class Group extends GroupBasic {
|
|
|
83
97
|
...this.players[playerId],
|
|
84
98
|
id: playerId,
|
|
85
99
|
}));
|
|
86
|
-
return orderByMusicStyle(players, 'mainInstrument', this.musicStyle);
|
|
100
|
+
return (0, orders_1.orderByMusicStyle)(players, 'mainInstrument', this.musicStyle);
|
|
87
101
|
}
|
|
88
102
|
get isActive() {
|
|
89
103
|
return this.exists && !this.deletedAt;
|
|
90
104
|
}
|
|
91
105
|
get isDeleted() {
|
|
92
|
-
return !this.exists || !isNull(this.deletedAt);
|
|
106
|
+
return !this.exists || !(0, lodash_1.isNull)(this.deletedAt);
|
|
93
107
|
}
|
|
94
108
|
get intercomId() {
|
|
95
109
|
return this.data.intercom_id || null;
|
|
@@ -105,10 +119,10 @@ export default class Group extends GroupBasic {
|
|
|
105
119
|
return this.data.socialNetworks;
|
|
106
120
|
}
|
|
107
121
|
return {
|
|
108
|
-
[SocialNetwork.Facebook]: null,
|
|
109
|
-
[SocialNetwork.Twitter]: null,
|
|
110
|
-
[SocialNetwork.Instagram]: null,
|
|
111
|
-
[SocialNetwork.YouTube]: null,
|
|
122
|
+
[types_1.SocialNetwork.Facebook]: null,
|
|
123
|
+
[types_1.SocialNetwork.Twitter]: null,
|
|
124
|
+
[types_1.SocialNetwork.Instagram]: null,
|
|
125
|
+
[types_1.SocialNetwork.YouTube]: null,
|
|
112
126
|
};
|
|
113
127
|
}
|
|
114
128
|
getSocialNetworkUrl(id) {
|
|
@@ -119,12 +133,12 @@ export default class Group extends GroupBasic {
|
|
|
119
133
|
}
|
|
120
134
|
get config() {
|
|
121
135
|
return {
|
|
122
|
-
[GroupConfigKey.IncludesMembersToEventsWhenJoined]: GroupConfigKey.IncludesMembersToEventsWhenJoined in this.data.config
|
|
123
|
-
? this.data.config[GroupConfigKey.IncludesMembersToEventsWhenJoined]
|
|
136
|
+
[types_1.GroupConfigKey.IncludesMembersToEventsWhenJoined]: types_1.GroupConfigKey.IncludesMembersToEventsWhenJoined in this.data.config
|
|
137
|
+
? this.data.config[types_1.GroupConfigKey.IncludesMembersToEventsWhenJoined]
|
|
124
138
|
: true,
|
|
125
|
-
[GroupConfigKey.ShowAttendanceToMembers]: GroupConfigKey.ShowAttendanceToMembers in this.data.config
|
|
126
|
-
? this.data.config[GroupConfigKey.ShowAttendanceToMembers]
|
|
127
|
-
: GroupConfigShowAttendanceToMembers.None,
|
|
139
|
+
[types_1.GroupConfigKey.ShowAttendanceToMembers]: types_1.GroupConfigKey.ShowAttendanceToMembers in this.data.config
|
|
140
|
+
? this.data.config[types_1.GroupConfigKey.ShowAttendanceToMembers]
|
|
141
|
+
: types_1.GroupConfigShowAttendanceToMembers.None,
|
|
128
142
|
};
|
|
129
143
|
}
|
|
130
144
|
get status() {
|
|
@@ -137,7 +151,7 @@ export default class Group extends GroupBasic {
|
|
|
137
151
|
return this.data.templates || {};
|
|
138
152
|
}
|
|
139
153
|
get templatesList() {
|
|
140
|
-
return mapToArray(this.templates);
|
|
154
|
+
return (0, objects_1.mapToArray)(this.templates);
|
|
141
155
|
}
|
|
142
156
|
get satisfactionIndex() {
|
|
143
157
|
return this.data.satisfactionIndex || { current: 0, last: 0 };
|
|
@@ -145,20 +159,11 @@ export default class Group extends GroupBasic {
|
|
|
145
159
|
get metadata() {
|
|
146
160
|
return this.data.metadata || {};
|
|
147
161
|
}
|
|
148
|
-
getPlayer = (userId) => {
|
|
149
|
-
return userId in this.players ? this.players[userId] : null;
|
|
150
|
-
};
|
|
151
|
-
isAdmin = (userId) => {
|
|
152
|
-
return this.admins.includes(userId);
|
|
153
|
-
};
|
|
154
|
-
isPlayer = (userId) => {
|
|
155
|
-
return this.playerIds.includes(userId);
|
|
156
|
-
};
|
|
157
162
|
get isExpiredTrial() {
|
|
158
|
-
const isOutDateTrial = isPast(this.trialEndAt);
|
|
163
|
+
const isOutDateTrial = (0, date_fns_1.isPast)(this.trialEndAt);
|
|
159
164
|
const members = this.activePlayers.length;
|
|
160
|
-
const isAboveMembersLimitPlanFree = members > membersPerPlan[PlansGroup.Piano];
|
|
161
|
-
return this.status !== GroupStatus.Premium && isOutDateTrial && isAboveMembersLimitPlanFree;
|
|
165
|
+
const isAboveMembersLimitPlanFree = members > plans_1.membersPerPlan[plans_1.PlansGroup.Piano];
|
|
166
|
+
return this.status !== types_1.GroupStatus.Premium && isOutDateTrial && isAboveMembersLimitPlanFree;
|
|
162
167
|
}
|
|
163
168
|
get firstAnswerAt() {
|
|
164
169
|
return this.data.firstAnswerAt || null;
|
|
@@ -167,22 +172,22 @@ export default class Group extends GroupBasic {
|
|
|
167
172
|
return this.data.repertoireTags || {};
|
|
168
173
|
}
|
|
169
174
|
get repertoireTagsList() {
|
|
170
|
-
return mapToArray(this.repertoireTags);
|
|
175
|
+
return (0, objects_1.mapToArray)(this.repertoireTags);
|
|
171
176
|
}
|
|
172
177
|
getRepertoireTagName(id) {
|
|
173
178
|
if (!(id in this.repertoireTags))
|
|
174
179
|
return null;
|
|
175
180
|
const tag = this.repertoireTags[id];
|
|
176
|
-
return tag.default ? getTranslation(tag.title, this.lang) : tag.title;
|
|
181
|
+
return tag.default ? (0, lang_1.getTranslation)(tag.title, this.lang) : tag.title;
|
|
177
182
|
}
|
|
178
183
|
get trialEndAt() {
|
|
179
184
|
if (this.data.trialEndAt) {
|
|
180
185
|
return this.data.trialEndAt.toDate();
|
|
181
186
|
}
|
|
182
|
-
return addMonths(this.createdAt.toDate(), 1);
|
|
187
|
+
return (0, date_fns_1.addMonths)(this.createdAt.toDate(), 1);
|
|
183
188
|
}
|
|
184
189
|
get glissandooAdminUrl() {
|
|
185
|
-
return getGlissandooAdminEntityURL(CollectionNames.Group, this.id);
|
|
190
|
+
return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Group, this.id);
|
|
186
191
|
}
|
|
187
192
|
get createdOn() {
|
|
188
193
|
return this.data.createdOn;
|
|
@@ -191,7 +196,7 @@ export default class Group extends GroupBasic {
|
|
|
191
196
|
return this.data.instruments || {};
|
|
192
197
|
}
|
|
193
198
|
get instrumentsList() {
|
|
194
|
-
return orderedMapToArray(this.instruments);
|
|
199
|
+
return (0, objects_1.orderedMapToArray)(this.instruments);
|
|
195
200
|
}
|
|
196
201
|
get instrumentsIds() {
|
|
197
202
|
return this.instrumentsList.map(({ id }) => id);
|
|
@@ -203,3 +208,4 @@ export default class Group extends GroupBasic {
|
|
|
203
208
|
return this.data.onboardingMessages || [];
|
|
204
209
|
}
|
|
205
210
|
}
|
|
211
|
+
exports.default = Group;
|
package/models/Group/types.js
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupRepertoireTagDefault = exports.GroupRepertoireTagReserved = exports.SocialNetwork = exports.GroupStatus = exports.GroupConfigShowAttendanceToMembers = exports.GroupConfigKey = exports.GroupCreatedOn = void 0;
|
|
4
|
+
var GroupCreatedOn;
|
|
2
5
|
(function (GroupCreatedOn) {
|
|
3
6
|
GroupCreatedOn["Web"] = "web";
|
|
4
7
|
GroupCreatedOn["App"] = "app";
|
|
5
8
|
GroupCreatedOn["Dashboard"] = "dashboard";
|
|
6
|
-
})(GroupCreatedOn || (GroupCreatedOn = {}));
|
|
7
|
-
|
|
9
|
+
})(GroupCreatedOn = exports.GroupCreatedOn || (exports.GroupCreatedOn = {}));
|
|
10
|
+
var GroupConfigKey;
|
|
8
11
|
(function (GroupConfigKey) {
|
|
9
12
|
GroupConfigKey["IncludesMembersToEventsWhenJoined"] = "includesMembersToEventsWhenJoined";
|
|
10
13
|
GroupConfigKey["ShowAttendanceToMembers"] = "showAttendanceToMembers";
|
|
11
|
-
})(GroupConfigKey || (GroupConfigKey = {}));
|
|
12
|
-
|
|
14
|
+
})(GroupConfigKey = exports.GroupConfigKey || (exports.GroupConfigKey = {}));
|
|
15
|
+
var GroupConfigShowAttendanceToMembers;
|
|
13
16
|
(function (GroupConfigShowAttendanceToMembers) {
|
|
14
17
|
GroupConfigShowAttendanceToMembers["None"] = "none";
|
|
15
18
|
GroupConfigShowAttendanceToMembers["OnlyConfirmed"] = "onlyConfirmed";
|
|
16
19
|
GroupConfigShowAttendanceToMembers["OnlyToSection"] = "onlyToSection";
|
|
17
20
|
GroupConfigShowAttendanceToMembers["All"] = "all";
|
|
18
|
-
})(GroupConfigShowAttendanceToMembers || (GroupConfigShowAttendanceToMembers = {}));
|
|
19
|
-
|
|
21
|
+
})(GroupConfigShowAttendanceToMembers = exports.GroupConfigShowAttendanceToMembers || (exports.GroupConfigShowAttendanceToMembers = {}));
|
|
22
|
+
var GroupStatus;
|
|
20
23
|
(function (GroupStatus) {
|
|
21
24
|
GroupStatus["Premium"] = "premium";
|
|
22
25
|
GroupStatus["Trial"] = "trial";
|
|
23
26
|
GroupStatus["Inactive"] = "inactive";
|
|
24
27
|
GroupStatus["Deleted"] = "deleted";
|
|
25
|
-
})(GroupStatus || (GroupStatus = {}));
|
|
26
|
-
|
|
28
|
+
})(GroupStatus = exports.GroupStatus || (exports.GroupStatus = {}));
|
|
29
|
+
var SocialNetwork;
|
|
27
30
|
(function (SocialNetwork) {
|
|
28
31
|
SocialNetwork["Facebook"] = "facebook";
|
|
29
32
|
SocialNetwork["Twitter"] = "twitter";
|
|
30
33
|
SocialNetwork["Instagram"] = "instagram";
|
|
31
34
|
SocialNetwork["YouTube"] = "youtube";
|
|
32
|
-
})(SocialNetwork || (SocialNetwork = {}));
|
|
33
|
-
|
|
35
|
+
})(SocialNetwork = exports.SocialNetwork || (exports.SocialNetwork = {}));
|
|
36
|
+
var GroupRepertoireTagReserved;
|
|
34
37
|
(function (GroupRepertoireTagReserved) {
|
|
35
38
|
GroupRepertoireTagReserved["NoTag"] = "$noTag";
|
|
36
|
-
})(GroupRepertoireTagReserved || (GroupRepertoireTagReserved = {}));
|
|
37
|
-
|
|
39
|
+
})(GroupRepertoireTagReserved = exports.GroupRepertoireTagReserved || (exports.GroupRepertoireTagReserved = {}));
|
|
40
|
+
var GroupRepertoireTagDefault;
|
|
38
41
|
(function (GroupRepertoireTagDefault) {
|
|
39
42
|
GroupRepertoireTagDefault["First"] = "repertoireTags.1";
|
|
40
43
|
GroupRepertoireTagDefault["Second"] = "repertoireTags.2";
|
|
41
44
|
GroupRepertoireTagDefault["Third"] = "repertoireTags.3";
|
|
42
45
|
GroupRepertoireTagDefault["Fourth"] = "repertoireTags.4";
|
|
43
46
|
GroupRepertoireTagDefault["Principal"] = "repertoireTags.principal";
|
|
44
|
-
})(GroupRepertoireTagDefault || (GroupRepertoireTagDefault = {}));
|
|
47
|
+
})(GroupRepertoireTagDefault = exports.GroupRepertoireTagDefault || (exports.GroupRepertoireTagDefault = {}));
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const _1 = __importDefault(require("."));
|
|
7
|
+
const lang_1 = require("../../lang");
|
|
8
|
+
class GroupInstrument extends _1.default {
|
|
9
|
+
constructor(id, lang = lang_1.defaultLocale, groupInstruments) {
|
|
6
10
|
super(id, lang);
|
|
7
11
|
this.groupInstruments = groupInstruments;
|
|
8
12
|
}
|
|
@@ -18,7 +22,7 @@ export default class GroupInstrument extends Instrument {
|
|
|
18
22
|
if (this.id in this.groupInstruments) {
|
|
19
23
|
return this.groupInstruments[this.id].name;
|
|
20
24
|
}
|
|
21
|
-
return getTranslation('instruments.unknown', this.lang) || this.id;
|
|
25
|
+
return (0, lang_1.getTranslation)('instruments.unknown', this.lang) || this.id;
|
|
22
26
|
}
|
|
23
27
|
get icon() {
|
|
24
28
|
return GroupInstrument.isCustom(this.id) && this.id in this.groupInstruments
|
|
@@ -26,3 +30,4 @@ export default class GroupInstrument extends Instrument {
|
|
|
26
30
|
: super.icon;
|
|
27
31
|
}
|
|
28
32
|
}
|
|
33
|
+
exports.default = GroupInstrument;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(id, lang = defaultLocale) {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const instruments_1 = require("../../helpers/instruments");
|
|
4
|
+
const lang_1 = require("../../lang");
|
|
5
|
+
class Instrument {
|
|
6
|
+
constructor(id, lang = lang_1.defaultLocale) {
|
|
7
7
|
this.id = id;
|
|
8
8
|
this.lang = lang;
|
|
9
9
|
}
|
|
10
10
|
get name() {
|
|
11
|
-
const translation = getTranslation(`instruments.${this.id}`, this.lang);
|
|
11
|
+
const translation = (0, lang_1.getTranslation)(`instruments.${this.id}`, this.lang);
|
|
12
12
|
return translation || this.id;
|
|
13
13
|
}
|
|
14
14
|
get icon() {
|
|
15
|
-
return InstrumentIcons[this.id] || 'warning';
|
|
15
|
+
return instruments_1.InstrumentIcons[this.id] || 'warning';
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
exports.default = Instrument;
|
package/models/Metrics/index.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Model_1 = __importDefault(require("../Model"));
|
|
7
|
+
class Metrics extends Model_1.default {
|
|
8
8
|
constructor(doc) {
|
|
9
9
|
super(doc);
|
|
10
|
+
this.defaultEntity = {
|
|
11
|
+
acc: 0,
|
|
12
|
+
count: 0,
|
|
13
|
+
total: 0,
|
|
14
|
+
};
|
|
15
|
+
this.getEntity = (entity) => {
|
|
16
|
+
return this.data[entity] || this.defaultEntity;
|
|
17
|
+
};
|
|
10
18
|
}
|
|
11
|
-
getEntity = (entity) => {
|
|
12
|
-
return this.data[entity] || this.defaultEntity;
|
|
13
|
-
};
|
|
14
19
|
get users() {
|
|
15
20
|
return this.data.user || this.defaultEntity;
|
|
16
21
|
}
|
|
@@ -39,3 +44,4 @@ export default class Metrics extends Model {
|
|
|
39
44
|
return this.data.createdAt;
|
|
40
45
|
}
|
|
41
46
|
}
|
|
47
|
+
exports.default = Metrics;
|
package/models/Metrics/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/models/Model/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ref;
|
|
6
|
-
_data;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
class Model {
|
|
7
5
|
constructor(doc) {
|
|
8
6
|
this.id = doc.id;
|
|
9
7
|
this._data = doc.data();
|
|
@@ -17,6 +15,7 @@ export default class Model {
|
|
|
17
15
|
if (!this._data || !this._data[name]) {
|
|
18
16
|
return null;
|
|
19
17
|
}
|
|
20
|
-
return get(this._data, name);
|
|
18
|
+
return (0, lodash_1.get)(this._data, name);
|
|
21
19
|
}
|
|
22
20
|
}
|
|
21
|
+
exports.default = Model;
|
package/models/Model/lang.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lang_1 = require("../../lang");
|
|
7
|
+
const Model_1 = __importDefault(require("../Model"));
|
|
8
|
+
class ModelWithLang extends Model_1.default {
|
|
9
|
+
constructor(doc, lang = lang_1.defaultLocale) {
|
|
6
10
|
super(doc);
|
|
7
11
|
this.lang = lang;
|
|
8
12
|
}
|
|
@@ -10,3 +14,4 @@ export default class ModelWithLang extends Model {
|
|
|
10
14
|
this.lang = lang;
|
|
11
15
|
}
|
|
12
16
|
}
|
|
17
|
+
exports.default = ModelWithLang;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
constructor(id, lang = defaultLocale) {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const musicStyles_1 = require("../../helpers/musicStyles");
|
|
5
|
+
const lang_1 = require("../../lang");
|
|
6
|
+
class MusicStyle {
|
|
7
|
+
constructor(id, lang = lang_1.defaultLocale) {
|
|
8
8
|
this.id = id;
|
|
9
9
|
this.lang = lang;
|
|
10
10
|
}
|
|
11
11
|
get name() {
|
|
12
|
-
const translation = getTranslation(`musicStyles.${this.id}`, this.lang);
|
|
12
|
+
const translation = (0, lang_1.getTranslation)(`musicStyles.${this.id}`, this.lang);
|
|
13
13
|
return translation || this.id;
|
|
14
14
|
}
|
|
15
15
|
get cover() {
|
|
16
|
-
return get(MusicStylesCover, this.id);
|
|
16
|
+
return (0, lodash_1.get)(musicStyles_1.MusicStylesCover, this.id);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
exports.default = MusicStyle;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Model_1 = __importDefault(require("../Model"));
|
|
7
|
+
class Notification extends Model_1.default {
|
|
3
8
|
constructor(doc) {
|
|
4
9
|
super(doc);
|
|
5
10
|
}
|
|
@@ -16,3 +21,4 @@ export default class Notification extends Model {
|
|
|
16
21
|
return this.data.createdAt;
|
|
17
22
|
}
|
|
18
23
|
}
|
|
24
|
+
exports.default = Notification;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationActions = void 0;
|
|
4
|
+
var NotificationActions;
|
|
2
5
|
(function (NotificationActions) {
|
|
3
6
|
NotificationActions["BadgeAccPerformancesFirstLevel"] = "badgeAccPerformances.firstLevel";
|
|
4
7
|
NotificationActions["BadgeAccPerformancesUpLevel"] = "badgeAccPerformances.upLevel";
|
|
@@ -87,4 +90,4 @@ export var NotificationActions;
|
|
|
87
90
|
NotificationActions["GroupOnboardingInvite"] = "group.onboarding.invite";
|
|
88
91
|
NotificationActions["GroupOnboardingDashboard"] = "group.onboarding.dashboard";
|
|
89
92
|
NotificationActions["GroupOnboardingEngagement"] = "group.onboarding.engagement";
|
|
90
|
-
})(NotificationActions || (NotificationActions = {}));
|
|
93
|
+
})(NotificationActions = exports.NotificationActions || (exports.NotificationActions = {}));
|