@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.
Files changed (166) hide show
  1. package/functions/auth.js +2 -1
  2. package/functions/communication.js +2 -1
  3. package/functions/communicationComment.js +2 -1
  4. package/functions/customer.js +2 -1
  5. package/functions/customerGroup.js +2 -1
  6. package/functions/event.js +5 -2
  7. package/functions/eventPlayer.js +5 -2
  8. package/functions/eventRepertory.js +2 -1
  9. package/functions/federation.js +2 -1
  10. package/functions/federationPartnership.js +2 -1
  11. package/functions/group.js +2 -1
  12. package/functions/groupPlayer.js +2 -1
  13. package/functions/groupRepertory.js +2 -1
  14. package/functions/index.js +5 -2
  15. package/functions/jwt.js +2 -1
  16. package/functions/misc.js +2 -1
  17. package/functions/notification.js +2 -1
  18. package/functions/partner.js +2 -1
  19. package/functions/partnership.js +2 -1
  20. package/functions/partnershipGroup.js +2 -1
  21. package/functions/partnershipPlan.js +2 -1
  22. package/functions/regions.js +128 -124
  23. package/functions/subscription.js +2 -1
  24. package/functions/user.js +2 -1
  25. package/helpers/appScenes.js +5 -2
  26. package/helpers/audios.js +9 -5
  27. package/helpers/auth.js +9 -5
  28. package/helpers/badges.js +19 -10
  29. package/helpers/collections.js +5 -2
  30. package/helpers/countries.js +4 -1
  31. package/helpers/dlinks.js +5 -2
  32. package/helpers/errors.js +5 -2
  33. package/helpers/fileSections/index.js +8 -5
  34. package/helpers/fileSections/orders.js +16 -11
  35. package/helpers/glissandooAdmin.js +6 -2
  36. package/helpers/instruments/index.js +6 -3
  37. package/helpers/instruments/lists.js +19 -11
  38. package/helpers/musicStyles/index.js +36 -29
  39. package/helpers/musicStyles/orders.js +179 -174
  40. package/helpers/notifications/index.js +122 -119
  41. package/helpers/notifications/placeholders.js +26 -18
  42. package/helpers/objects.js +23 -15
  43. package/helpers/payments.js +8 -5
  44. package/helpers/plans.js +9 -6
  45. package/helpers/rates.js +6 -2
  46. package/helpers/reasons.js +21 -17
  47. package/helpers/slate.js +12 -5
  48. package/helpers/styles.js +4 -1
  49. package/helpers/ts-extras/array-includes.js +5 -1
  50. package/helpers/ts-extras/as-mutable.js +5 -1
  51. package/helpers/ts-extras/assert-error.js +5 -1
  52. package/helpers/ts-extras/index.js +33 -15
  53. package/helpers/ts-extras/is-defined.js +5 -1
  54. package/helpers/ts-extras/is-empty.js +5 -1
  55. package/helpers/ts-extras/is-finite.js +4 -1
  56. package/helpers/ts-extras/is-infinite.js +5 -1
  57. package/helpers/ts-extras/is-integer.js +4 -1
  58. package/helpers/ts-extras/is-present.js +5 -1
  59. package/helpers/ts-extras/is-safe-integer.js +4 -1
  60. package/helpers/ts-extras/object-entries.js +4 -1
  61. package/helpers/ts-extras/object-from-entries.js +4 -1
  62. package/helpers/ts-extras/object-has-own.js +5 -1
  63. package/helpers/ts-extras/object-keys.js +4 -1
  64. package/helpers/ts-extras/set-has.js +5 -1
  65. package/helpers/types.js +5 -2
  66. package/helpers/utils.d.ts +1 -0
  67. package/helpers/utils.js +23 -8
  68. package/lang/index.js +51 -42
  69. package/models/Communication/Comment/index.js +12 -5
  70. package/models/Communication/Comment/types.js +2 -1
  71. package/models/Communication/index.js +21 -15
  72. package/models/Communication/types.js +7 -4
  73. package/models/Counters/Group/Analytics/index.js +12 -5
  74. package/models/Counters/Group/Analytics/types.js +5 -2
  75. package/models/Counters/Group/index.js +8 -2
  76. package/models/Counters/Group/types.js +2 -1
  77. package/models/Counters/event.js +8 -2
  78. package/models/Counters/index.js +8 -2
  79. package/models/Counters/types.js +2 -1
  80. package/models/Customer/Group/index.js +14 -7
  81. package/models/Customer/Group/types.js +2 -1
  82. package/models/Customer/basic.js +10 -4
  83. package/models/Customer/index.js +11 -5
  84. package/models/Customer/types.js +5 -2
  85. package/models/Evento/Player/basic.js +11 -10
  86. package/models/Evento/Player/index.js +19 -12
  87. package/models/Evento/Player/types.js +7 -4
  88. package/models/Evento/Repertory/index.js +10 -3
  89. package/models/Evento/Repertory/types.js +2 -1
  90. package/models/Evento/basic.js +18 -12
  91. package/models/Evento/index.js +38 -32
  92. package/models/Evento/promoter.js +8 -2
  93. package/models/Evento/tiny.js +9 -9
  94. package/models/Evento/types.js +17 -14
  95. package/models/Federation/Partnership/index.js +10 -3
  96. package/models/Federation/Partnership/types.js +2 -1
  97. package/models/Federation/index.js +13 -7
  98. package/models/Federation/types.js +2 -1
  99. package/models/Group/Analytics/index.js +12 -5
  100. package/models/Group/Analytics/types.js +5 -2
  101. package/models/Group/Event/index.js +12 -6
  102. package/models/Group/Event/types.js +2 -1
  103. package/models/Group/Player/Event/index.js +18 -11
  104. package/models/Group/Player/Event/types.js +2 -1
  105. package/models/Group/Player/Log/index.js +8 -2
  106. package/models/Group/Player/Log/types.js +2 -1
  107. package/models/Group/Player/index.js +25 -18
  108. package/models/Group/Player/types.js +5 -2
  109. package/models/Group/Repertory/File/Section/index.js +16 -12
  110. package/models/Group/Repertory/File/Section/types.js +5 -2
  111. package/models/Group/Repertory/File/index.js +12 -11
  112. package/models/Group/Repertory/File/types.js +2 -1
  113. package/models/Group/Repertory/FilePath/index.js +15 -12
  114. package/models/Group/Repertory/index.js +32 -25
  115. package/models/Group/Repertory/types.js +5 -2
  116. package/models/Group/StageTemplate/index.js +8 -2
  117. package/models/Group/StageTemplate/types.js +2 -1
  118. package/models/Group/basic.js +11 -5
  119. package/models/Group/index.js +47 -41
  120. package/models/Group/types.js +17 -14
  121. package/models/Instrument/group.js +11 -6
  122. package/models/Instrument/index.js +9 -8
  123. package/models/Metrics/index.js +16 -10
  124. package/models/Metrics/types.js +2 -1
  125. package/models/Model/index.js +6 -7
  126. package/models/Model/lang.js +10 -5
  127. package/models/MusicStyle/index.js +10 -9
  128. package/models/Notification/index.js +8 -2
  129. package/models/Notification/types.js +5 -2
  130. package/models/Partner/basic.js +12 -6
  131. package/models/Partner/index.js +10 -4
  132. package/models/Partner/tiny.js +8 -2
  133. package/models/Partner/types.js +5 -2
  134. package/models/Partnership/Group/index.js +12 -5
  135. package/models/Partnership/Group/types.js +2 -1
  136. package/models/Partnership/Partner/Subscription/index.js +15 -8
  137. package/models/Partnership/Partner/Subscription/types.js +5 -2
  138. package/models/Partnership/Partner/index.js +10 -3
  139. package/models/Partnership/Partner/types.js +2 -1
  140. package/models/Partnership/Payment/index.js +8 -2
  141. package/models/Partnership/Payment/types.js +2 -1
  142. package/models/Partnership/Plan/basic.js +18 -12
  143. package/models/Partnership/Plan/index.js +10 -3
  144. package/models/Partnership/Plan/types.js +5 -2
  145. package/models/Partnership/basic.js +10 -4
  146. package/models/Partnership/index.js +11 -5
  147. package/models/Partnership/types.js +7 -4
  148. package/models/Payment/basic.js +13 -7
  149. package/models/Payment/index.js +8 -2
  150. package/models/Payment/types.js +7 -4
  151. package/models/Player/basic.js +10 -4
  152. package/models/Player/types.js +2 -1
  153. package/models/Repertory/basic.js +8 -2
  154. package/models/Repertory/types.js +2 -1
  155. package/models/User/Group/index.js +15 -8
  156. package/models/User/Group/types.js +2 -1
  157. package/models/User/Notification/index.js +22 -16
  158. package/models/User/Notification/types.js +2 -1
  159. package/models/User/basic.js +10 -4
  160. package/models/User/index.js +24 -18
  161. package/models/User/types.js +15 -12
  162. package/models/WebhookEvent/index.js +8 -2
  163. package/models/WebhookEvent/types.js +5 -2
  164. package/package.json +1 -1
  165. package/types/firestore.js +5 -2
  166. package/types/messagebirdChatWidget.js +2 -1
@@ -1,22 +1,28 @@
1
- import endOfDay from 'date-fns/endOfDay';
2
- import isFuture from 'date-fns/isFuture';
3
- import { uniq } from 'lodash';
4
- import orderBy from 'lodash/orderBy';
5
- import { mapToArray } from '../../../helpers/objects';
6
- import { objectEntries } from '../../../helpers/ts-extras';
7
- import { defaultLocale } from '../../../lang';
8
- import EventoTiny from '../../Evento/tiny';
9
- import Theme from '../../Repertory/basic';
10
- import { FileSectionIdReserved } from './File/Section/types';
11
- import { GroupRepertoireVisibility } from './types';
12
- export default class GroupRepertory extends Theme {
13
- lang = defaultLocale;
14
- constructor(doc, lang = defaultLocale) {
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('/').at(-3);
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 EventoTiny(id, this.eventsTL[id], this.lang));
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) => isFuture(ev.datetime.toDate()));
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 orderBy(this.eventsList, (e) => e.datetime.toDate(), [order]);
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 ? isFuture(endOfDay(ev.datetime.toDate())) : isFuture(ev.datetime.toDate()));
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
- export var GroupRepertoireVisibility;
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
- import Model from '../../Model';
2
- export default class GroupStageTemplate extends Model {
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
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,12 @@
1
- import { defaultLocale, getTranslation } from '../../lang';
2
- import ModelWithLang from '../Model/lang';
3
- export default class GroupBasic extends ModelWithLang {
4
- constructor(doc, lang = defaultLocale) {
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;
@@ -1,16 +1,30 @@
1
- import { addMonths, isPast } from 'date-fns';
2
- import { isNull } from 'lodash';
3
- import { CollectionNames } from '../../helpers/collections';
4
- import { getGlissandooAdminEntityURL } from '../../helpers/glissandooAdmin';
5
- import { orderByMusicStyle } from '../../helpers/musicStyles/orders';
6
- import { mapToArray, orderedMapToArray } from '../../helpers/objects';
7
- import { PlansGroup, membersPerPlan } from '../../helpers/plans';
8
- import { defaultLocale, getTranslation } from '../../lang';
9
- import GroupBasic from './basic';
10
- import { GroupConfigKey, GroupConfigShowAttendanceToMembers, GroupStatus, SocialNetwork, } from './types';
11
- export default class Group extends GroupBasic {
12
- constructor(doc, lang = defaultLocale) {
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;
@@ -1,44 +1,47 @@
1
- export var GroupCreatedOn;
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
- export var GroupConfigKey;
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
- export var GroupConfigShowAttendanceToMembers;
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
- export var GroupStatus;
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
- export var SocialNetwork;
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
- export var GroupRepertoireTagReserved;
35
+ })(SocialNetwork = exports.SocialNetwork || (exports.SocialNetwork = {}));
36
+ var GroupRepertoireTagReserved;
34
37
  (function (GroupRepertoireTagReserved) {
35
38
  GroupRepertoireTagReserved["NoTag"] = "$noTag";
36
- })(GroupRepertoireTagReserved || (GroupRepertoireTagReserved = {}));
37
- export var GroupRepertoireTagDefault;
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
- import Instrument from '.';
2
- import { defaultLocale, getTranslation } from '../../lang';
3
- export default class GroupInstrument extends Instrument {
4
- groupInstruments;
5
- constructor(id, lang = defaultLocale, groupInstruments) {
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
- import { InstrumentIcons } from '../../helpers/instruments';
2
- import { defaultLocale, getTranslation } from '../../lang';
3
- export default class Instrument {
4
- id;
5
- lang;
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;
@@ -1,16 +1,21 @@
1
- import Model from '../Model';
2
- export default class Metrics extends Model {
3
- defaultEntity = {
4
- acc: 0,
5
- count: 0,
6
- total: 0,
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;
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,7 @@
1
- import { get } from 'lodash';
2
- export default class Model {
3
- id;
4
- exists;
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;
@@ -1,8 +1,12 @@
1
- import { defaultLocale } from '../../lang';
2
- import Model from '../Model';
3
- export default class ModelWithLang extends Model {
4
- lang;
5
- constructor(doc, lang = defaultLocale) {
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
- import { get } from 'lodash';
2
- import { MusicStylesCover } from '../../helpers/musicStyles';
3
- import { defaultLocale, getTranslation } from '../../lang';
4
- export default class MusicStyle {
5
- id;
6
- lang;
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
- import Model from '../Model';
2
- export default class Notification extends Model {
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
- export var NotificationActions;
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 = {}));