@glissandoo/lib 1.1.12 → 1.3.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/group.d.ts +1 -2
- package/helpers/instruments/index.d.ts +3 -0
- package/helpers/instruments/index.js +6 -1
- package/helpers/musicStyles/index.d.ts +1 -0
- package/helpers/musicStyles/orders.d.ts +3 -3
- package/helpers/musicStyles/orders.js +3 -1
- package/lang/index.d.ts +1 -1
- package/lang/index.js +1 -5
- package/models/Evento/basic.js +1 -1
- package/models/Evento/tiny.js +1 -1
- package/models/Group/basic.d.ts +1 -1
- package/models/Group/basic.js +2 -1
- package/models/Group/types.d.ts +2 -2
- package/models/Instrument/index.js +2 -1
- package/models/MusicStyle/index.d.ts +3 -3
- package/models/MusicStyle/index.js +2 -1
- package/models/Player/basic.js +2 -1
- package/models/User/Group/index.js +2 -1
- package/models/User/Notification/index.js +3 -1
- package/package.json +1 -1
package/functions/group.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MusicStyleId } from '../helpers/musicStyles';
|
|
2
1
|
import { GroupBasicData, GroupData, GroupStatus } from '../models/Group/types';
|
|
3
2
|
export declare namespace GroupFbFunctionsTypes {
|
|
4
3
|
interface PublishParams {
|
|
@@ -6,7 +5,7 @@ export declare namespace GroupFbFunctionsTypes {
|
|
|
6
5
|
locality: string;
|
|
7
6
|
latitude: number;
|
|
8
7
|
longitude: number;
|
|
9
|
-
musicStyle:
|
|
8
|
+
musicStyle: string;
|
|
10
9
|
photoURL: string;
|
|
11
10
|
}
|
|
12
11
|
interface PublishResult {
|
|
@@ -2,6 +2,7 @@ import { LanguagesTypes } from '../../lang';
|
|
|
2
2
|
import Instrument from '../../models/Instrument';
|
|
3
3
|
export declare enum InstrumentId {
|
|
4
4
|
Accordion = "accordion",
|
|
5
|
+
Bagpipes = "bagpipes",
|
|
5
6
|
Banjo = "banjo",
|
|
6
7
|
Baritone = "baritone",
|
|
7
8
|
Bass = "bass",
|
|
@@ -9,6 +10,7 @@ export declare enum InstrumentId {
|
|
|
9
10
|
BassDrum = "bass-drum",
|
|
10
11
|
Bassoon = "bassoon",
|
|
11
12
|
BassoonContra = "contraBass",
|
|
13
|
+
Castanets = "castanets",
|
|
12
14
|
Cello = "cello",
|
|
13
15
|
Choir = "choir",
|
|
14
16
|
Clarinet = "clarinet",
|
|
@@ -45,6 +47,7 @@ export declare enum InstrumentId {
|
|
|
45
47
|
SaxLow = "lowSaxophone",
|
|
46
48
|
SaxSoprano = "sopranoSaxophone",
|
|
47
49
|
SaxTenor = "tenorSax",
|
|
50
|
+
Silbote = "silbote",
|
|
48
51
|
Singer = "singer",
|
|
49
52
|
Soprano = "soprano",
|
|
50
53
|
Tabal = "tabal",
|
|
@@ -8,6 +8,7 @@ const Instrument_1 = __importDefault(require("../../models/Instrument"));
|
|
|
8
8
|
var InstrumentId;
|
|
9
9
|
(function (InstrumentId) {
|
|
10
10
|
InstrumentId["Accordion"] = "accordion";
|
|
11
|
+
InstrumentId["Bagpipes"] = "bagpipes";
|
|
11
12
|
InstrumentId["Banjo"] = "banjo";
|
|
12
13
|
InstrumentId["Baritone"] = "baritone";
|
|
13
14
|
InstrumentId["Bass"] = "bass";
|
|
@@ -15,6 +16,7 @@ var InstrumentId;
|
|
|
15
16
|
InstrumentId["BassDrum"] = "bass-drum";
|
|
16
17
|
InstrumentId["Bassoon"] = "bassoon";
|
|
17
18
|
InstrumentId["BassoonContra"] = "contraBass";
|
|
19
|
+
InstrumentId["Castanets"] = "castanets";
|
|
18
20
|
InstrumentId["Cello"] = "cello";
|
|
19
21
|
InstrumentId["Choir"] = "choir";
|
|
20
22
|
InstrumentId["Clarinet"] = "clarinet";
|
|
@@ -51,6 +53,7 @@ var InstrumentId;
|
|
|
51
53
|
InstrumentId["SaxLow"] = "lowSaxophone";
|
|
52
54
|
InstrumentId["SaxSoprano"] = "sopranoSaxophone";
|
|
53
55
|
InstrumentId["SaxTenor"] = "tenorSax";
|
|
56
|
+
InstrumentId["Silbote"] = "silbote";
|
|
54
57
|
InstrumentId["Singer"] = "singer";
|
|
55
58
|
InstrumentId["Soprano"] = "soprano";
|
|
56
59
|
InstrumentId["Tabal"] = "tabal";
|
|
@@ -71,6 +74,7 @@ var InstrumentId;
|
|
|
71
74
|
})(InstrumentId = exports.InstrumentId || (exports.InstrumentId = {}));
|
|
72
75
|
exports.InstrumentIcons = {
|
|
73
76
|
[InstrumentId.Accordion]: 'accordion',
|
|
77
|
+
[InstrumentId.Bagpipes]: 'bagpipes',
|
|
74
78
|
[InstrumentId.Banjo]: 'banjo',
|
|
75
79
|
[InstrumentId.Baritone]: 'choirMen',
|
|
76
80
|
[InstrumentId.BassChoir]: 'choirMen',
|
|
@@ -78,6 +82,7 @@ exports.InstrumentIcons = {
|
|
|
78
82
|
[InstrumentId.BassDrum]: 'drumBass',
|
|
79
83
|
[InstrumentId.Bassoon]: 'bassoon',
|
|
80
84
|
[InstrumentId.BassoonContra]: 'bassoon',
|
|
85
|
+
[InstrumentId.Castanets]: 'castanets',
|
|
81
86
|
[InstrumentId.Cello]: 'cello',
|
|
82
87
|
[InstrumentId.Choir]: 'choirMen',
|
|
83
88
|
[InstrumentId.ClarinetBass]: 'clarinet',
|
|
@@ -114,6 +119,7 @@ exports.InstrumentIcons = {
|
|
|
114
119
|
[InstrumentId.SaxLow]: 'saxophoneHigh',
|
|
115
120
|
[InstrumentId.SaxSoprano]: 'saxophone',
|
|
116
121
|
[InstrumentId.SaxTenor]: 'saxophone',
|
|
122
|
+
[InstrumentId.Silbote]: 'silbote',
|
|
117
123
|
[InstrumentId.Singer]: 'microphone',
|
|
118
124
|
[InstrumentId.Soprano]: 'choirWomen',
|
|
119
125
|
[InstrumentId.Tabal]: 'tabal',
|
|
@@ -133,7 +139,6 @@ exports.InstrumentIcons = {
|
|
|
133
139
|
[InstrumentId.Violin]: 'violin',
|
|
134
140
|
};
|
|
135
141
|
const hideInstruments = [
|
|
136
|
-
InstrumentId.Accordion,
|
|
137
142
|
InstrumentId.Banjo,
|
|
138
143
|
InstrumentId.Harmonica,
|
|
139
144
|
InstrumentId.DJ,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { InstrumentId } from '../instruments';
|
|
2
|
-
import {
|
|
3
|
-
export declare const getInstrumentsOrderByMusicStyle: (musicStyle:
|
|
4
|
-
export declare const orderByMusicStyle: <T>(list: T[], field: string, musicStyle:
|
|
2
|
+
import { MusicStyleType } from './index';
|
|
3
|
+
export declare const getInstrumentsOrderByMusicStyle: (musicStyle: MusicStyleType) => InstrumentId[];
|
|
4
|
+
export declare const orderByMusicStyle: <T>(list: T[], field: string, musicStyle: MusicStyleType) => T[];
|
|
@@ -117,7 +117,9 @@ const orders = {
|
|
|
117
117
|
instruments_1.InstrumentId.DrumSet,
|
|
118
118
|
],
|
|
119
119
|
};
|
|
120
|
-
const getInstrumentsOrderByMusicStyle = (musicStyle) =>
|
|
120
|
+
const getInstrumentsOrderByMusicStyle = (musicStyle) => {
|
|
121
|
+
return musicStyle in orders ? orders[musicStyle] : Object.values(instruments_1.InstrumentId);
|
|
122
|
+
};
|
|
121
123
|
exports.getInstrumentsOrderByMusicStyle = getInstrumentsOrderByMusicStyle;
|
|
122
124
|
const orderByMusicStyle = (list, field, musicStyle) => {
|
|
123
125
|
const order = exports.getInstrumentsOrderByMusicStyle(musicStyle);
|
package/lang/index.d.ts
CHANGED
|
@@ -1084,5 +1084,5 @@ export declare const getDateLang: (lang: LanguagesTypes) => {
|
|
|
1084
1084
|
time: string;
|
|
1085
1085
|
};
|
|
1086
1086
|
};
|
|
1087
|
-
export declare const getTranslation: (key: string, lang: LanguagesTypes) => string;
|
|
1087
|
+
export declare const getTranslation: (key: string, lang: LanguagesTypes) => string | null;
|
|
1088
1088
|
export default languageProvider;
|
package/lang/index.js
CHANGED
|
@@ -91,11 +91,7 @@ const getDateLang = (lang) => {
|
|
|
91
91
|
};
|
|
92
92
|
exports.getDateLang = getDateLang;
|
|
93
93
|
const getTranslation = (key, lang) => {
|
|
94
|
-
|
|
95
|
-
if (!translation) {
|
|
96
|
-
return '';
|
|
97
|
-
}
|
|
98
|
-
return translation;
|
|
94
|
+
return get_1.default(languageProvider, [lang, 'messages', key]) || null;
|
|
99
95
|
};
|
|
100
96
|
exports.getTranslation = getTranslation;
|
|
101
97
|
exports.default = languageProvider;
|
package/models/Evento/basic.js
CHANGED
|
@@ -36,7 +36,7 @@ class EventoBasic extends Model_1.default {
|
|
|
36
36
|
if (this.displayName) {
|
|
37
37
|
return this.displayName;
|
|
38
38
|
}
|
|
39
|
-
return lang_1.getTranslation(this.type, this.lang) || lang_1.getTranslation('event', this.lang);
|
|
39
|
+
return (lang_1.getTranslation(this.type, this.lang) || lang_1.getTranslation('event', this.lang) || 'event');
|
|
40
40
|
}
|
|
41
41
|
get type() {
|
|
42
42
|
return this.data.type;
|
package/models/Evento/tiny.js
CHANGED
|
@@ -14,7 +14,7 @@ class EventoTiny {
|
|
|
14
14
|
if (this.displayName) {
|
|
15
15
|
return this.displayName;
|
|
16
16
|
}
|
|
17
|
-
return lang_1.getTranslation(this.type, this.lang) || lang_1.getTranslation('event', this.lang);
|
|
17
|
+
return (lang_1.getTranslation(this.type, this.lang) || lang_1.getTranslation('event', this.lang) || this.type);
|
|
18
18
|
}
|
|
19
19
|
get type() {
|
|
20
20
|
return this.data.type;
|
package/models/Group/basic.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ export default class GroupBasic<D> extends Model<D & GroupBasicData> {
|
|
|
12
12
|
get locality(): string;
|
|
13
13
|
get location(): FirebaseFirestore.GeoPoint;
|
|
14
14
|
get username(): string;
|
|
15
|
-
get musicStyle():
|
|
15
|
+
get musicStyle(): string;
|
|
16
16
|
get musicStyleString(): string;
|
|
17
17
|
}
|
package/models/Group/basic.js
CHANGED
|
@@ -45,7 +45,8 @@ class GroupBasic extends Model_1.default {
|
|
|
45
45
|
return this.data.musicStyle;
|
|
46
46
|
}
|
|
47
47
|
get musicStyleString() {
|
|
48
|
-
|
|
48
|
+
const translation = lang_1.getTranslation(`musicStyles.${this.musicStyle}`, this.lang);
|
|
49
|
+
return translation || this.musicStyle;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
exports.default = GroupBasic;
|
package/models/Group/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentReference, GeoPoint, Timestamp } from '@google-cloud/firestore';
|
|
2
|
-
import {
|
|
2
|
+
import { MusicStyleType } from '../../helpers/musicStyles';
|
|
3
3
|
import { PlayerBasicData } from '../Player/types';
|
|
4
4
|
export declare enum GroupConfig {
|
|
5
5
|
IncludesMembersToEventsWhenJoined = "includesMembersToEventsWhenJoined"
|
|
@@ -39,7 +39,7 @@ export interface GroupTinyData {
|
|
|
39
39
|
}
|
|
40
40
|
export interface GroupBasicData extends GroupTinyData {
|
|
41
41
|
username: string;
|
|
42
|
-
musicStyle:
|
|
42
|
+
musicStyle: MusicStyleType;
|
|
43
43
|
locality: string;
|
|
44
44
|
location: GeoPoint;
|
|
45
45
|
}
|
|
@@ -8,7 +8,8 @@ class Instrument {
|
|
|
8
8
|
this.lang = lang;
|
|
9
9
|
}
|
|
10
10
|
get name() {
|
|
11
|
-
|
|
11
|
+
const translation = lang_1.getTranslation(`instruments.${this.id}`, this.lang);
|
|
12
|
+
return translation || this.id;
|
|
12
13
|
}
|
|
13
14
|
get icon() {
|
|
14
15
|
return instruments_1.InstrumentIcons[this.id] || 'warning';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MusicStyleType } from '../../helpers/musicStyles';
|
|
2
2
|
import { LanguagesTypes } from '../../lang';
|
|
3
3
|
export default class MusicStyle {
|
|
4
|
-
id:
|
|
4
|
+
id: MusicStyleType;
|
|
5
5
|
private lang;
|
|
6
|
-
constructor(id:
|
|
6
|
+
constructor(id: MusicStyleType, lang?: LanguagesTypes);
|
|
7
7
|
get name(): string;
|
|
8
8
|
}
|
|
@@ -7,7 +7,8 @@ class MusicStyle {
|
|
|
7
7
|
this.lang = lang;
|
|
8
8
|
}
|
|
9
9
|
get name() {
|
|
10
|
-
|
|
10
|
+
const translation = lang_1.getTranslation(`musicStyles.${this.id}`, this.lang);
|
|
11
|
+
return translation || this.id;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
exports.default = MusicStyle;
|
package/models/Player/basic.js
CHANGED
|
@@ -21,7 +21,8 @@ class PlayerBasic extends basic_1.default {
|
|
|
21
21
|
return this.data.mainInstrument;
|
|
22
22
|
}
|
|
23
23
|
get instrument() {
|
|
24
|
-
|
|
24
|
+
const translation = lang_1.getTranslation(`instruments.${this.mainInstrument}`, this.lang);
|
|
25
|
+
return translation || this.mainInstrument;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
exports.default = PlayerBasic;
|
|
@@ -18,7 +18,8 @@ class UserGroup extends basic_1.default {
|
|
|
18
18
|
return this.data.mainInstrument;
|
|
19
19
|
}
|
|
20
20
|
get instrument() {
|
|
21
|
-
|
|
21
|
+
const translation = lang_1.getTranslation(`instruments.${this.mainInstrument}`, this.lang);
|
|
22
|
+
return translation || this.mainInstrument;
|
|
22
23
|
}
|
|
23
24
|
get instruments() {
|
|
24
25
|
return this.data.instruments || [];
|
|
@@ -12,7 +12,9 @@ class Notification extends Model_1.default {
|
|
|
12
12
|
super(doc);
|
|
13
13
|
this.getTranslationByAction = (key) => {
|
|
14
14
|
const translation = lang_1.getTranslation(`${this.action}.${key}`, this.lang);
|
|
15
|
-
return
|
|
15
|
+
return !translation
|
|
16
|
+
? this.action
|
|
17
|
+
: utils_1.replaceKeysNotification(translation, this.meta, this.lang);
|
|
16
18
|
};
|
|
17
19
|
this.lang = lang;
|
|
18
20
|
}
|