@glissandoo/lib 1.0.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/communication.d.ts +31 -0
- package/functions/communication.js +2 -0
- package/functions/event.d.ts +113 -0
- package/functions/event.js +18 -0
- package/functions/eventPlayer.d.ts +20 -0
- package/functions/eventPlayer.js +13 -0
- package/functions/eventRepertory.d.ts +9 -0
- package/functions/eventRepertory.js +2 -0
- package/functions/federation.d.ts +23 -0
- package/functions/federation.js +2 -0
- package/functions/federationPartnership.d.ts +34 -0
- package/functions/federationPartnership.js +2 -0
- package/functions/group.d.ts +32 -0
- package/functions/group.js +2 -0
- package/functions/groupPlayer.d.ts +37 -0
- package/functions/groupPlayer.js +2 -0
- package/functions/groupRepertory.d.ts +54 -0
- package/functions/groupRepertory.js +2 -0
- package/functions/index.d.ts +73 -0
- package/functions/index.js +77 -0
- package/functions/misc.d.ts +9 -0
- package/functions/misc.js +2 -0
- package/functions/notification.d.ts +4 -0
- package/functions/notification.js +2 -0
- package/functions/partner.d.ts +63 -0
- package/functions/partner.js +2 -0
- package/functions/partnership.d.ts +23 -0
- package/functions/partnership.js +2 -0
- package/functions/partnershipGroup.d.ts +12 -0
- package/functions/partnershipGroup.js +2 -0
- package/functions/partnershipPlan.d.ts +23 -0
- package/functions/partnershipPlan.js +2 -0
- package/functions/regions.d.ts +6 -0
- package/functions/regions.js +85 -0
- package/functions/subscription.d.ts +20 -0
- package/functions/subscription.js +2 -0
- package/functions/user.d.ts +19 -0
- package/functions/user.js +2 -0
- package/helpers/appScenes.d.ts +45 -0
- package/helpers/appScenes.js +49 -0
- package/helpers/badges.d.ts +21 -0
- package/helpers/badges.js +162 -0
- package/helpers/collections.d.ts +28 -0
- package/helpers/collections.js +32 -0
- package/helpers/instruments/index.d.ts +67 -0
- package/helpers/instruments/index.js +145 -0
- package/helpers/musicStyles/index.d.ts +9 -0
- package/helpers/musicStyles/index.js +16 -0
- package/helpers/musicStyles/orders.d.ts +4 -0
- package/helpers/musicStyles/orders.js +128 -0
- package/helpers/notifications.d.ts +40 -0
- package/helpers/notifications.js +120 -0
- package/helpers/payments.d.ts +2 -0
- package/helpers/payments.js +9 -0
- package/helpers/utils.d.ts +6 -0
- package/helpers/utils.js +99 -0
- package/index.d.ts +0 -0
- package/index.js +1 -0
- package/lang/ca.json +194 -0
- package/lang/de.json +194 -0
- package/lang/en.json +194 -0
- package/lang/es.json +194 -0
- package/lang/gl.json +194 -0
- package/lang/index.d.ts +1078 -0
- package/lang/index.js +101 -0
- package/models/Communication/index.d.ts +47 -0
- package/models/Communication/index.js +138 -0
- package/models/Communication/types.d.ts +53 -0
- package/models/Communication/types.js +13 -0
- package/models/Counters/index.d.ts +7 -0
- package/models/Counters/index.js +15 -0
- package/models/Counters/types.d.ts +3 -0
- package/models/Counters/types.js +2 -0
- package/models/Evento/Player/index.d.ts +17 -0
- package/models/Evento/Player/index.js +45 -0
- package/models/Evento/Player/types.d.ts +15 -0
- package/models/Evento/Player/types.js +8 -0
- package/models/Evento/Repertory/index.d.ts +9 -0
- package/models/Evento/Repertory/index.js +22 -0
- package/models/Evento/Repertory/types.d.ts +5 -0
- package/models/Evento/Repertory/types.js +2 -0
- package/models/Evento/basic.d.ts +22 -0
- package/models/Evento/basic.js +72 -0
- package/models/Evento/index.d.ts +66 -0
- package/models/Evento/index.js +178 -0
- package/models/Evento/promoter.d.ts +11 -0
- package/models/Evento/promoter.js +24 -0
- package/models/Evento/tiny.d.ts +13 -0
- package/models/Evento/tiny.js +32 -0
- package/models/Evento/types.d.ts +76 -0
- package/models/Evento/types.js +22 -0
- package/models/Federation/Partnership/index.d.ts +12 -0
- package/models/Federation/Partnership/index.js +31 -0
- package/models/Federation/Partnership/types.d.ts +8 -0
- package/models/Federation/Partnership/types.js +2 -0
- package/models/Federation/index.d.ts +20 -0
- package/models/Federation/index.js +54 -0
- package/models/Federation/types.d.ts +16 -0
- package/models/Federation/types.js +2 -0
- package/models/Group/Analytics/index.d.ts +11 -0
- package/models/Group/Analytics/index.js +29 -0
- package/models/Group/Analytics/types.d.ts +20 -0
- package/models/Group/Analytics/types.js +13 -0
- package/models/Group/Event/index.d.ts +15 -0
- package/models/Group/Event/index.js +38 -0
- package/models/Group/Event/types.d.ts +11 -0
- package/models/Group/Event/types.js +2 -0
- package/models/Group/Player/Event/index.d.ts +17 -0
- package/models/Group/Player/Event/index.js +42 -0
- package/models/Group/Player/Event/types.d.ts +8 -0
- package/models/Group/Player/Event/types.js +2 -0
- package/models/Group/Player/Log/index.d.ts +12 -0
- package/models/Group/Player/Log/index.js +24 -0
- package/models/Group/Player/Log/types.d.ts +11 -0
- package/models/Group/Player/Log/types.js +2 -0
- package/models/Group/Player/index.d.ts +55 -0
- package/models/Group/Player/index.js +221 -0
- package/models/Group/Player/types.d.ts +43 -0
- package/models/Group/Player/types.js +9 -0
- package/models/Group/Repertory/index.d.ts +67 -0
- package/models/Group/Repertory/index.js +149 -0
- package/models/Group/Repertory/types.d.ts +43 -0
- package/models/Group/Repertory/types.js +2 -0
- package/models/Group/basic.d.ts +17 -0
- package/models/Group/basic.js +51 -0
- package/models/Group/index.d.ts +43 -0
- package/models/Group/index.js +115 -0
- package/models/Group/types.d.ts +68 -0
- package/models/Group/types.js +21 -0
- package/models/Instrument/index.d.ts +9 -0
- package/models/Instrument/index.js +17 -0
- package/models/Metrics/index.d.ts +17 -0
- package/models/Metrics/index.js +47 -0
- package/models/Metrics/types.d.ts +12 -0
- package/models/Metrics/types.js +2 -0
- package/models/Model.d.ts +10 -0
- package/models/Model.js +21 -0
- package/models/MusicStyle/index.d.ts +8 -0
- package/models/MusicStyle/index.js +13 -0
- package/models/Notification/index.d.ts +12 -0
- package/models/Notification/index.js +26 -0
- package/models/Notification/types.d.ts +71 -0
- package/models/Notification/types.js +68 -0
- package/models/Partner/basic.d.ts +14 -0
- package/models/Partner/basic.js +43 -0
- package/models/Partner/index.d.ts +16 -0
- package/models/Partner/index.js +48 -0
- package/models/Partner/tiny.d.ts +9 -0
- package/models/Partner/tiny.js +24 -0
- package/models/Partner/types.d.ts +43 -0
- package/models/Partner/types.js +9 -0
- package/models/Partnership/Group/index.d.ts +8 -0
- package/models/Partnership/Group/index.js +17 -0
- package/models/Partnership/Group/types.d.ts +2 -0
- package/models/Partnership/Group/types.js +2 -0
- package/models/Partnership/Partner/Subscription/index.d.ts +19 -0
- package/models/Partnership/Partner/Subscription/index.js +56 -0
- package/models/Partnership/Partner/Subscription/types.d.ts +21 -0
- package/models/Partnership/Partner/Subscription/types.js +9 -0
- package/models/Partnership/Partner/index.d.ts +9 -0
- package/models/Partnership/Partner/index.js +22 -0
- package/models/Partnership/Partner/types.d.ts +5 -0
- package/models/Partnership/Partner/types.js +2 -0
- package/models/Partnership/Payment/index.d.ts +8 -0
- package/models/Partnership/Payment/index.js +18 -0
- package/models/Partnership/Payment/types.d.ts +6 -0
- package/models/Partnership/Payment/types.js +2 -0
- package/models/Partnership/Plan/basic.d.ts +19 -0
- package/models/Partnership/Plan/basic.js +65 -0
- package/models/Partnership/Plan/index.d.ts +12 -0
- package/models/Partnership/Plan/index.js +31 -0
- package/models/Partnership/Plan/types.d.ts +23 -0
- package/models/Partnership/Plan/types.js +10 -0
- package/models/Partnership/basic.d.ts +17 -0
- package/models/Partnership/basic.js +58 -0
- package/models/Partnership/index.d.ts +18 -0
- package/models/Partnership/index.js +55 -0
- package/models/Partnership/types.d.ts +37 -0
- package/models/Partnership/types.js +9 -0
- package/models/Payment/basic.d.ts +17 -0
- package/models/Payment/basic.js +53 -0
- package/models/Payment/index.d.ts +13 -0
- package/models/Payment/index.js +33 -0
- package/models/Payment/types.d.ts +32 -0
- package/models/Payment/types.js +17 -0
- package/models/Player/basic.d.ts +10 -0
- package/models/Player/basic.js +27 -0
- package/models/Player/types.d.ts +8 -0
- package/models/Player/types.js +2 -0
- package/models/Repertory/basic.d.ts +11 -0
- package/models/Repertory/basic.js +32 -0
- package/models/Repertory/types.d.ts +21 -0
- package/models/Repertory/types.js +2 -0
- package/models/User/Group/index.d.ts +15 -0
- package/models/User/Group/index.js +36 -0
- package/models/User/Group/types.d.ts +10 -0
- package/models/User/Group/types.js +2 -0
- package/models/User/Notification/index.d.ts +25 -0
- package/models/User/Notification/index.js +73 -0
- package/models/User/Notification/types.d.ts +25 -0
- package/models/User/Notification/types.js +2 -0
- package/models/User/basic.d.ts +13 -0
- package/models/User/basic.js +35 -0
- package/models/User/index.d.ts +46 -0
- package/models/User/index.js +119 -0
- package/models/User/types.d.ts +68 -0
- package/models/User/types.js +26 -0
- package/package.json +39 -0
|
@@ -0,0 +1,145 @@
|
|
|
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
|
+
exports.list = exports.InstrumentIcons = exports.InstrumentId = void 0;
|
|
7
|
+
const Instrument_1 = __importDefault(require("../../models/Instrument"));
|
|
8
|
+
var InstrumentId;
|
|
9
|
+
(function (InstrumentId) {
|
|
10
|
+
InstrumentId["Accordion"] = "accordion";
|
|
11
|
+
InstrumentId["Banjo"] = "banjo";
|
|
12
|
+
InstrumentId["Baritone"] = "baritone";
|
|
13
|
+
InstrumentId["Bass"] = "bass";
|
|
14
|
+
InstrumentId["BassChoir"] = "bass-choir";
|
|
15
|
+
InstrumentId["BassDrum"] = "bass-drum";
|
|
16
|
+
InstrumentId["Bassoon"] = "bassoon";
|
|
17
|
+
InstrumentId["BassoonContra"] = "contraBass";
|
|
18
|
+
InstrumentId["Cello"] = "cello";
|
|
19
|
+
InstrumentId["Choir"] = "choir";
|
|
20
|
+
InstrumentId["Clarinet"] = "clarinet";
|
|
21
|
+
InstrumentId["ClarinetBass"] = "bassClarinet";
|
|
22
|
+
InstrumentId["ClarinetLittle"] = "littleClarinet";
|
|
23
|
+
InstrumentId["ContraAlto"] = "contraAlto";
|
|
24
|
+
InstrumentId["Cornet"] = "cornet";
|
|
25
|
+
InstrumentId["CounterTenor"] = "counterTenor";
|
|
26
|
+
InstrumentId["Cymbals"] = "cymbals";
|
|
27
|
+
InstrumentId["DJ"] = "dj";
|
|
28
|
+
InstrumentId["DoubleBass"] = "doubleBass";
|
|
29
|
+
InstrumentId["DrumSet"] = "drumSet";
|
|
30
|
+
InstrumentId["Dulzaina"] = "dulzaina";
|
|
31
|
+
InstrumentId["ElectricGuitar"] = "electricGuitar";
|
|
32
|
+
InstrumentId["EnglishHorn"] = "englishHorn";
|
|
33
|
+
InstrumentId["Euphonium"] = "euphonium";
|
|
34
|
+
InstrumentId["FlugeHorn"] = "flugelhorn";
|
|
35
|
+
InstrumentId["Flute"] = "flute";
|
|
36
|
+
InstrumentId["FluteLow"] = "low-flute";
|
|
37
|
+
InstrumentId["FrenchHorn"] = "frenchHorn";
|
|
38
|
+
InstrumentId["Guitar"] = "guitar";
|
|
39
|
+
InstrumentId["Harmonica"] = "harmonica";
|
|
40
|
+
InstrumentId["Harp"] = "harp";
|
|
41
|
+
InstrumentId["Keyboard"] = "keyboard";
|
|
42
|
+
InstrumentId["Mallets"] = "mallets";
|
|
43
|
+
InstrumentId["MezzoSoprano"] = "mezzosoproano";
|
|
44
|
+
InstrumentId["MusicConductor"] = "musicConductor";
|
|
45
|
+
InstrumentId["Oboe"] = "oboe";
|
|
46
|
+
InstrumentId["Percussion"] = "percussion";
|
|
47
|
+
InstrumentId["Piano"] = "piano";
|
|
48
|
+
InstrumentId["Piccolo"] = "piccolo";
|
|
49
|
+
InstrumentId["SaxAlto"] = "altoSaxophone";
|
|
50
|
+
InstrumentId["SaxBaritone"] = "baritoneSax";
|
|
51
|
+
InstrumentId["SaxLow"] = "lowSaxophone";
|
|
52
|
+
InstrumentId["SaxSoprano"] = "sopranoSaxophone";
|
|
53
|
+
InstrumentId["SaxTenor"] = "tenorSax";
|
|
54
|
+
InstrumentId["Singer"] = "singer";
|
|
55
|
+
InstrumentId["Soprano"] = "soprano";
|
|
56
|
+
InstrumentId["Tabal"] = "tabal";
|
|
57
|
+
InstrumentId["Tenor"] = "tenor";
|
|
58
|
+
InstrumentId["Timpani"] = "timpani";
|
|
59
|
+
InstrumentId["Trombone"] = "trombone";
|
|
60
|
+
InstrumentId["TromboneHigh"] = "highTrombone";
|
|
61
|
+
InstrumentId["TromboneLow"] = "lowTrombone";
|
|
62
|
+
InstrumentId["Trumpet"] = "trumpet";
|
|
63
|
+
InstrumentId["TrumpetLow"] = "lowTrumpet";
|
|
64
|
+
InstrumentId["TrumpetPiccolo"] = "piccoloTrumpet";
|
|
65
|
+
InstrumentId["Tuba"] = "tuba";
|
|
66
|
+
InstrumentId["TubaWagnerian"] = "tuba-wagnerian";
|
|
67
|
+
InstrumentId["Txistu"] = "txistu";
|
|
68
|
+
InstrumentId["Ukelele"] = "ukelele";
|
|
69
|
+
InstrumentId["Viola"] = "viola";
|
|
70
|
+
InstrumentId["Violin"] = "violin";
|
|
71
|
+
})(InstrumentId = exports.InstrumentId || (exports.InstrumentId = {}));
|
|
72
|
+
exports.InstrumentIcons = {
|
|
73
|
+
[InstrumentId.Accordion]: 'accordion',
|
|
74
|
+
[InstrumentId.Banjo]: 'banjo',
|
|
75
|
+
[InstrumentId.Baritone]: 'choirMen',
|
|
76
|
+
[InstrumentId.BassChoir]: 'choirMen',
|
|
77
|
+
[InstrumentId.Bass]: 'guitarBass',
|
|
78
|
+
[InstrumentId.BassDrum]: 'drumBass',
|
|
79
|
+
[InstrumentId.Bassoon]: 'bassoon',
|
|
80
|
+
[InstrumentId.BassoonContra]: 'bassoon',
|
|
81
|
+
[InstrumentId.Cello]: 'cello',
|
|
82
|
+
[InstrumentId.Choir]: 'choirMen',
|
|
83
|
+
[InstrumentId.ClarinetBass]: 'clarinet',
|
|
84
|
+
[InstrumentId.ClarinetLittle]: 'clarinet',
|
|
85
|
+
[InstrumentId.Clarinet]: 'clarinet',
|
|
86
|
+
[InstrumentId.ContraAlto]: 'choirWomen',
|
|
87
|
+
[InstrumentId.Cornet]: 'cornet',
|
|
88
|
+
[InstrumentId.CounterTenor]: 'choirMen',
|
|
89
|
+
[InstrumentId.Cymbals]: 'cymbals',
|
|
90
|
+
[InstrumentId.DJ]: 'dj',
|
|
91
|
+
[InstrumentId.DoubleBass]: 'cello',
|
|
92
|
+
[InstrumentId.DrumSet]: 'drumSet',
|
|
93
|
+
[InstrumentId.Dulzaina]: 'dulzaina',
|
|
94
|
+
[InstrumentId.ElectricGuitar]: 'guitarElectric',
|
|
95
|
+
[InstrumentId.EnglishHorn]: 'clarinet',
|
|
96
|
+
[InstrumentId.Euphonium]: 'tuba',
|
|
97
|
+
[InstrumentId.FlugeHorn]: 'trumpet',
|
|
98
|
+
[InstrumentId.FluteLow]: 'flute',
|
|
99
|
+
[InstrumentId.Flute]: 'flute',
|
|
100
|
+
[InstrumentId.FrenchHorn]: 'frenchHorn',
|
|
101
|
+
[InstrumentId.Guitar]: 'guitar',
|
|
102
|
+
[InstrumentId.Harmonica]: 'harmonica',
|
|
103
|
+
[InstrumentId.Harp]: 'harp',
|
|
104
|
+
[InstrumentId.Keyboard]: 'piano',
|
|
105
|
+
[InstrumentId.Mallets]: 'xylophone',
|
|
106
|
+
[InstrumentId.MezzoSoprano]: 'choirWomen',
|
|
107
|
+
[InstrumentId.MusicConductor]: 'bandmastersMace',
|
|
108
|
+
[InstrumentId.Oboe]: 'oboe',
|
|
109
|
+
[InstrumentId.Percussion]: 'drumSnare',
|
|
110
|
+
[InstrumentId.Piano]: 'pianoClassic',
|
|
111
|
+
[InstrumentId.Piccolo]: 'piccolo',
|
|
112
|
+
[InstrumentId.SaxAlto]: 'saxophone',
|
|
113
|
+
[InstrumentId.SaxBaritone]: 'saxophoneHigh',
|
|
114
|
+
[InstrumentId.SaxLow]: 'saxophoneHigh',
|
|
115
|
+
[InstrumentId.SaxSoprano]: 'saxophone',
|
|
116
|
+
[InstrumentId.SaxTenor]: 'saxophone',
|
|
117
|
+
[InstrumentId.Singer]: 'microphone',
|
|
118
|
+
[InstrumentId.Soprano]: 'choirWomen',
|
|
119
|
+
[InstrumentId.Tabal]: 'tabal',
|
|
120
|
+
[InstrumentId.Tenor]: 'choirMen',
|
|
121
|
+
[InstrumentId.TromboneHigh]: 'trombone',
|
|
122
|
+
[InstrumentId.TromboneLow]: 'trombone',
|
|
123
|
+
[InstrumentId.Trombone]: 'trombone',
|
|
124
|
+
[InstrumentId.Trumpet]: 'trumpet',
|
|
125
|
+
[InstrumentId.TrumpetLow]: 'trumpet',
|
|
126
|
+
[InstrumentId.TrumpetPiccolo]: 'trumpet',
|
|
127
|
+
[InstrumentId.TubaWagnerian]: 'tuba',
|
|
128
|
+
[InstrumentId.Tuba]: 'tuba',
|
|
129
|
+
[InstrumentId.Timpani]: 'timpani',
|
|
130
|
+
[InstrumentId.Txistu]: 'txistu',
|
|
131
|
+
[InstrumentId.Ukelele]: 'guitar',
|
|
132
|
+
[InstrumentId.Viola]: 'violin',
|
|
133
|
+
[InstrumentId.Violin]: 'violin',
|
|
134
|
+
};
|
|
135
|
+
const hideInstruments = [
|
|
136
|
+
InstrumentId.Accordion,
|
|
137
|
+
InstrumentId.Banjo,
|
|
138
|
+
InstrumentId.Harmonica,
|
|
139
|
+
InstrumentId.DJ,
|
|
140
|
+
InstrumentId.Choir,
|
|
141
|
+
];
|
|
142
|
+
const list = (lang) => Object.values(InstrumentId)
|
|
143
|
+
.filter((id) => !hideInstruments.includes(id))
|
|
144
|
+
.map((key) => new Instrument_1.default(key, lang));
|
|
145
|
+
exports.list = list;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LanguagesTypes } from '../../lang';
|
|
2
|
+
import MusicStyle from '../../models/MusicStyle';
|
|
3
|
+
export declare enum MusicStyleId {
|
|
4
|
+
Band = "banda-de-musica",
|
|
5
|
+
BigBand = "big-band",
|
|
6
|
+
Choir = "coro",
|
|
7
|
+
Orchestra = "orquesta-sinfonica"
|
|
8
|
+
}
|
|
9
|
+
export declare const list: (lang: LanguagesTypes) => MusicStyle[];
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
exports.list = exports.MusicStyleId = void 0;
|
|
7
|
+
const MusicStyle_1 = __importDefault(require("../../models/MusicStyle"));
|
|
8
|
+
var MusicStyleId;
|
|
9
|
+
(function (MusicStyleId) {
|
|
10
|
+
MusicStyleId["Band"] = "banda-de-musica";
|
|
11
|
+
MusicStyleId["BigBand"] = "big-band";
|
|
12
|
+
MusicStyleId["Choir"] = "coro";
|
|
13
|
+
MusicStyleId["Orchestra"] = "orquesta-sinfonica";
|
|
14
|
+
})(MusicStyleId = exports.MusicStyleId || (exports.MusicStyleId = {}));
|
|
15
|
+
const list = (lang) => Object.values(MusicStyleId).map((key) => new MusicStyle_1.default(key, lang));
|
|
16
|
+
exports.list = list;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InstrumentId } from '../instruments';
|
|
2
|
+
import { MusicStyleId } from './index';
|
|
3
|
+
export declare const getInstrumentsOrderByMusicStyle: (musicStyle: MusicStyleId) => InstrumentId[];
|
|
4
|
+
export declare const orderByMusicStyle: <T>(list: T[], field: string, musicStyle: MusicStyleId) => T[];
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
exports.orderByMusicStyle = exports.getInstrumentsOrderByMusicStyle = void 0;
|
|
7
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
+
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
9
|
+
const sortBy_1 = __importDefault(require("lodash/sortBy"));
|
|
10
|
+
const instruments_1 = require("../instruments");
|
|
11
|
+
const index_1 = require("./index");
|
|
12
|
+
const orders = {
|
|
13
|
+
[index_1.MusicStyleId.Band]: [
|
|
14
|
+
instruments_1.InstrumentId.MusicConductor,
|
|
15
|
+
instruments_1.InstrumentId.Piccolo,
|
|
16
|
+
instruments_1.InstrumentId.Flute,
|
|
17
|
+
instruments_1.InstrumentId.Oboe,
|
|
18
|
+
instruments_1.InstrumentId.EnglishHorn,
|
|
19
|
+
instruments_1.InstrumentId.Bassoon,
|
|
20
|
+
instruments_1.InstrumentId.BassoonContra,
|
|
21
|
+
instruments_1.InstrumentId.ClarinetLittle,
|
|
22
|
+
instruments_1.InstrumentId.Clarinet,
|
|
23
|
+
instruments_1.InstrumentId.ClarinetBass,
|
|
24
|
+
instruments_1.InstrumentId.SaxSoprano,
|
|
25
|
+
instruments_1.InstrumentId.SaxAlto,
|
|
26
|
+
instruments_1.InstrumentId.SaxTenor,
|
|
27
|
+
instruments_1.InstrumentId.SaxBaritone,
|
|
28
|
+
instruments_1.InstrumentId.FrenchHorn,
|
|
29
|
+
instruments_1.InstrumentId.FlugeHorn,
|
|
30
|
+
instruments_1.InstrumentId.Trumpet,
|
|
31
|
+
instruments_1.InstrumentId.Trombone,
|
|
32
|
+
instruments_1.InstrumentId.TromboneLow,
|
|
33
|
+
instruments_1.InstrumentId.Euphonium,
|
|
34
|
+
instruments_1.InstrumentId.Tuba,
|
|
35
|
+
instruments_1.InstrumentId.Cello,
|
|
36
|
+
instruments_1.InstrumentId.DoubleBass,
|
|
37
|
+
instruments_1.InstrumentId.Percussion,
|
|
38
|
+
instruments_1.InstrumentId.BassDrum,
|
|
39
|
+
instruments_1.InstrumentId.Cymbals,
|
|
40
|
+
instruments_1.InstrumentId.Timpani,
|
|
41
|
+
instruments_1.InstrumentId.Mallets,
|
|
42
|
+
instruments_1.InstrumentId.DrumSet,
|
|
43
|
+
],
|
|
44
|
+
[index_1.MusicStyleId.Orchestra]: [
|
|
45
|
+
instruments_1.InstrumentId.MusicConductor,
|
|
46
|
+
instruments_1.InstrumentId.Violin,
|
|
47
|
+
instruments_1.InstrumentId.Viola,
|
|
48
|
+
instruments_1.InstrumentId.Cello,
|
|
49
|
+
instruments_1.InstrumentId.DoubleBass,
|
|
50
|
+
instruments_1.InstrumentId.Piccolo,
|
|
51
|
+
instruments_1.InstrumentId.Flute,
|
|
52
|
+
instruments_1.InstrumentId.FluteLow,
|
|
53
|
+
instruments_1.InstrumentId.Oboe,
|
|
54
|
+
instruments_1.InstrumentId.EnglishHorn,
|
|
55
|
+
instruments_1.InstrumentId.Bassoon,
|
|
56
|
+
instruments_1.InstrumentId.BassoonContra,
|
|
57
|
+
instruments_1.InstrumentId.ClarinetLittle,
|
|
58
|
+
instruments_1.InstrumentId.Clarinet,
|
|
59
|
+
instruments_1.InstrumentId.ClarinetBass,
|
|
60
|
+
instruments_1.InstrumentId.SaxSoprano,
|
|
61
|
+
instruments_1.InstrumentId.SaxAlto,
|
|
62
|
+
instruments_1.InstrumentId.SaxTenor,
|
|
63
|
+
instruments_1.InstrumentId.SaxBaritone,
|
|
64
|
+
instruments_1.InstrumentId.FrenchHorn,
|
|
65
|
+
instruments_1.InstrumentId.FlugeHorn,
|
|
66
|
+
instruments_1.InstrumentId.Trumpet,
|
|
67
|
+
instruments_1.InstrumentId.TrumpetLow,
|
|
68
|
+
instruments_1.InstrumentId.TrumpetPiccolo,
|
|
69
|
+
instruments_1.InstrumentId.Trombone,
|
|
70
|
+
instruments_1.InstrumentId.TromboneHigh,
|
|
71
|
+
instruments_1.InstrumentId.TromboneLow,
|
|
72
|
+
instruments_1.InstrumentId.Euphonium,
|
|
73
|
+
instruments_1.InstrumentId.Tuba,
|
|
74
|
+
instruments_1.InstrumentId.Percussion,
|
|
75
|
+
instruments_1.InstrumentId.BassDrum,
|
|
76
|
+
instruments_1.InstrumentId.Cymbals,
|
|
77
|
+
instruments_1.InstrumentId.Timpani,
|
|
78
|
+
instruments_1.InstrumentId.Mallets,
|
|
79
|
+
],
|
|
80
|
+
[index_1.MusicStyleId.Choir]: [
|
|
81
|
+
instruments_1.InstrumentId.MusicConductor,
|
|
82
|
+
instruments_1.InstrumentId.Soprano,
|
|
83
|
+
instruments_1.InstrumentId.MezzoSoprano,
|
|
84
|
+
instruments_1.InstrumentId.ContraAlto,
|
|
85
|
+
instruments_1.InstrumentId.CounterTenor,
|
|
86
|
+
instruments_1.InstrumentId.BassChoir,
|
|
87
|
+
instruments_1.InstrumentId.Tenor,
|
|
88
|
+
instruments_1.InstrumentId.Baritone,
|
|
89
|
+
instruments_1.InstrumentId.Choir,
|
|
90
|
+
],
|
|
91
|
+
[index_1.MusicStyleId.BigBand]: [
|
|
92
|
+
instruments_1.InstrumentId.MusicConductor,
|
|
93
|
+
instruments_1.InstrumentId.Piccolo,
|
|
94
|
+
instruments_1.InstrumentId.Flute,
|
|
95
|
+
instruments_1.InstrumentId.FluteLow,
|
|
96
|
+
instruments_1.InstrumentId.Oboe,
|
|
97
|
+
instruments_1.InstrumentId.EnglishHorn,
|
|
98
|
+
instruments_1.InstrumentId.Bassoon,
|
|
99
|
+
instruments_1.InstrumentId.BassoonContra,
|
|
100
|
+
instruments_1.InstrumentId.ClarinetLittle,
|
|
101
|
+
instruments_1.InstrumentId.Clarinet,
|
|
102
|
+
instruments_1.InstrumentId.ClarinetBass,
|
|
103
|
+
instruments_1.InstrumentId.SaxSoprano,
|
|
104
|
+
instruments_1.InstrumentId.SaxAlto,
|
|
105
|
+
instruments_1.InstrumentId.SaxTenor,
|
|
106
|
+
instruments_1.InstrumentId.SaxBaritone,
|
|
107
|
+
instruments_1.InstrumentId.FrenchHorn,
|
|
108
|
+
instruments_1.InstrumentId.FlugeHorn,
|
|
109
|
+
instruments_1.InstrumentId.Trumpet,
|
|
110
|
+
instruments_1.InstrumentId.Trombone,
|
|
111
|
+
instruments_1.InstrumentId.TromboneLow,
|
|
112
|
+
instruments_1.InstrumentId.Euphonium,
|
|
113
|
+
instruments_1.InstrumentId.Tuba,
|
|
114
|
+
instruments_1.InstrumentId.Cello,
|
|
115
|
+
instruments_1.InstrumentId.DoubleBass,
|
|
116
|
+
instruments_1.InstrumentId.Percussion,
|
|
117
|
+
instruments_1.InstrumentId.DrumSet,
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
const getInstrumentsOrderByMusicStyle = (musicStyle) => musicStyle in orders ? orders[musicStyle] : Object.values(instruments_1.InstrumentId);
|
|
121
|
+
exports.getInstrumentsOrderByMusicStyle = getInstrumentsOrderByMusicStyle;
|
|
122
|
+
const orderByMusicStyle = (list, field, musicStyle) => {
|
|
123
|
+
const order = exports.getInstrumentsOrderByMusicStyle(musicStyle);
|
|
124
|
+
const noMatch = list.filter((player) => !order.includes(get_1.default(player, field)));
|
|
125
|
+
const match = list.filter((player) => order.includes(get_1.default(player, field)));
|
|
126
|
+
return sortBy_1.default(match, [(player) => order.indexOf(get_1.default(player, field)), 'displayName']).concat(orderBy_1.default(noMatch, field, 'asc'));
|
|
127
|
+
};
|
|
128
|
+
exports.orderByMusicStyle = orderByMusicStyle;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { EventoFbFunctionsTypes } from '../functions/event';
|
|
2
|
+
import { NotificationActions } from '../models/Notification/types';
|
|
3
|
+
import { BadgesTypes } from './badges';
|
|
4
|
+
export declare const notificationActionsBadges: {
|
|
5
|
+
[key in BadgesTypes]: {
|
|
6
|
+
firstLevel: NotificationActions;
|
|
7
|
+
upLevel: NotificationActions;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare enum NotificationEventActions {
|
|
11
|
+
Create = "create",
|
|
12
|
+
Cancel = "cancel",
|
|
13
|
+
EditAttendance = "editAttendance",
|
|
14
|
+
EditComments = "editComments",
|
|
15
|
+
EditDatetime = "editDatetime",
|
|
16
|
+
EditLocality = "editLocality",
|
|
17
|
+
EditRepertory = "editRepertory",
|
|
18
|
+
EditTitle = "editTitle",
|
|
19
|
+
AddPlayers = "addPlayers",
|
|
20
|
+
RemovePlayer = "removePlayers",
|
|
21
|
+
ConfirmAssistance = "confirmAssistance",
|
|
22
|
+
DeclineAssistance = "declineAssistance",
|
|
23
|
+
Reminder = "reminder",
|
|
24
|
+
ReminderEveningConfirm = "reminderEveningConfirm",
|
|
25
|
+
ReminderEveningPending = "reminderEveningPending",
|
|
26
|
+
ReminderMorningConfirm = "reminderMorningConfirm",
|
|
27
|
+
ReminderMorningPending = "reminderMorningPending",
|
|
28
|
+
ReminderRollcall = "reminderRollcall"
|
|
29
|
+
}
|
|
30
|
+
declare type RealtionScopeToNotification = Record<EventoFbFunctionsTypes.EditScope, NotificationEventActions>;
|
|
31
|
+
export declare const editScopeToAction: RealtionScopeToNotification;
|
|
32
|
+
declare type RelationActionNotification = Record<NotificationEventActions, NotificationActions>;
|
|
33
|
+
export declare const notificationPerformance: RelationActionNotification;
|
|
34
|
+
export declare const notificationSinglePractice: RelationActionNotification;
|
|
35
|
+
export declare const notificationMultiplePractice: RelationActionNotification;
|
|
36
|
+
export declare const disabledNotificationsByUserConfig: {
|
|
37
|
+
eventAssistanceConfirm: NotificationActions[];
|
|
38
|
+
eventAssistanceDecline: NotificationActions[];
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.disabledNotificationsByUserConfig = exports.notificationMultiplePractice = exports.notificationSinglePractice = exports.notificationPerformance = exports.editScopeToAction = exports.NotificationEventActions = exports.notificationActionsBadges = void 0;
|
|
4
|
+
const types_1 = require("../models/Notification/types");
|
|
5
|
+
const badges_1 = require("./badges");
|
|
6
|
+
exports.notificationActionsBadges = {
|
|
7
|
+
[badges_1.BadgesTypes.AccPerformances]: {
|
|
8
|
+
firstLevel: types_1.NotificationActions.BadgeAccPerformancesFirstLevel,
|
|
9
|
+
upLevel: types_1.NotificationActions.BadgeAccPerformancesUpLevel,
|
|
10
|
+
},
|
|
11
|
+
[badges_1.BadgesTypes.AccPractices]: {
|
|
12
|
+
firstLevel: types_1.NotificationActions.BadgeAccPracticesFirstLevel,
|
|
13
|
+
upLevel: types_1.NotificationActions.BadgeAccPracticesUpLevel,
|
|
14
|
+
},
|
|
15
|
+
[badges_1.BadgesTypes.AnswerEvents]: {
|
|
16
|
+
firstLevel: types_1.NotificationActions.BadgeAnswerEventsFirstLevel,
|
|
17
|
+
upLevel: types_1.NotificationActions.BadgeAnswerEventsUpLevel,
|
|
18
|
+
},
|
|
19
|
+
[badges_1.BadgesTypes.StrikePractices]: {
|
|
20
|
+
firstLevel: types_1.NotificationActions.BadgeStrikePracticesFirstLevel,
|
|
21
|
+
upLevel: types_1.NotificationActions.BadgeStrikePracticesUpLevel,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
var NotificationEventActions;
|
|
25
|
+
(function (NotificationEventActions) {
|
|
26
|
+
NotificationEventActions["Create"] = "create";
|
|
27
|
+
NotificationEventActions["Cancel"] = "cancel";
|
|
28
|
+
NotificationEventActions["EditAttendance"] = "editAttendance";
|
|
29
|
+
NotificationEventActions["EditComments"] = "editComments";
|
|
30
|
+
NotificationEventActions["EditDatetime"] = "editDatetime";
|
|
31
|
+
NotificationEventActions["EditLocality"] = "editLocality";
|
|
32
|
+
NotificationEventActions["EditRepertory"] = "editRepertory";
|
|
33
|
+
NotificationEventActions["EditTitle"] = "editTitle";
|
|
34
|
+
NotificationEventActions["AddPlayers"] = "addPlayers";
|
|
35
|
+
NotificationEventActions["RemovePlayer"] = "removePlayers";
|
|
36
|
+
NotificationEventActions["ConfirmAssistance"] = "confirmAssistance";
|
|
37
|
+
NotificationEventActions["DeclineAssistance"] = "declineAssistance";
|
|
38
|
+
NotificationEventActions["Reminder"] = "reminder";
|
|
39
|
+
NotificationEventActions["ReminderEveningConfirm"] = "reminderEveningConfirm";
|
|
40
|
+
NotificationEventActions["ReminderEveningPending"] = "reminderEveningPending";
|
|
41
|
+
NotificationEventActions["ReminderMorningConfirm"] = "reminderMorningConfirm";
|
|
42
|
+
NotificationEventActions["ReminderMorningPending"] = "reminderMorningPending";
|
|
43
|
+
NotificationEventActions["ReminderRollcall"] = "reminderRollcall";
|
|
44
|
+
})(NotificationEventActions = exports.NotificationEventActions || (exports.NotificationEventActions = {}));
|
|
45
|
+
exports.editScopeToAction = {
|
|
46
|
+
title: NotificationEventActions.EditTitle,
|
|
47
|
+
locality: NotificationEventActions.EditLocality,
|
|
48
|
+
comments: NotificationEventActions.EditComments,
|
|
49
|
+
attendance: NotificationEventActions.EditAttendance,
|
|
50
|
+
};
|
|
51
|
+
exports.notificationPerformance = {
|
|
52
|
+
cancel: types_1.NotificationActions.PerformanceCancel,
|
|
53
|
+
create: types_1.NotificationActions.PerformanceCreate,
|
|
54
|
+
editAttendance: types_1.NotificationActions.PerformanceEditAttendance,
|
|
55
|
+
editComments: types_1.NotificationActions.PerformanceEditComments,
|
|
56
|
+
editDatetime: types_1.NotificationActions.PerformanceEditDatetime,
|
|
57
|
+
editLocality: types_1.NotificationActions.PerformanceEditLocality,
|
|
58
|
+
editRepertory: types_1.NotificationActions.PerformanceEditRepertory,
|
|
59
|
+
editTitle: types_1.NotificationActions.PerformanceEditTitle,
|
|
60
|
+
addPlayers: types_1.NotificationActions.PerformancePlayersAdd,
|
|
61
|
+
removePlayers: types_1.NotificationActions.PerformancePlayersRemove,
|
|
62
|
+
confirmAssistance: types_1.NotificationActions.PerformanceAssistanceConfirm,
|
|
63
|
+
declineAssistance: types_1.NotificationActions.PerformanceAssistanceDecline,
|
|
64
|
+
reminder: types_1.NotificationActions.PerformanceReminder,
|
|
65
|
+
reminderEveningConfirm: types_1.NotificationActions.PerformanceEveningReminderConfirm,
|
|
66
|
+
reminderEveningPending: types_1.NotificationActions.PerformanceEveningReminderPending,
|
|
67
|
+
reminderMorningConfirm: types_1.NotificationActions.PerformanceMorningReminderConfirm,
|
|
68
|
+
reminderMorningPending: types_1.NotificationActions.PerformanceMorningReminderPending,
|
|
69
|
+
reminderRollcall: types_1.NotificationActions.PerformanceRollCallReminder,
|
|
70
|
+
};
|
|
71
|
+
exports.notificationSinglePractice = {
|
|
72
|
+
cancel: types_1.NotificationActions.PracticeCancel,
|
|
73
|
+
create: types_1.NotificationActions.PracticeCreate,
|
|
74
|
+
editAttendance: types_1.NotificationActions.PracticeEditAttendance,
|
|
75
|
+
editComments: types_1.NotificationActions.PracticeEditComments,
|
|
76
|
+
editDatetime: types_1.NotificationActions.PracticeEditDatetime,
|
|
77
|
+
editLocality: types_1.NotificationActions.PracticeEditLocality,
|
|
78
|
+
editRepertory: types_1.NotificationActions.PracticeEditRepertory,
|
|
79
|
+
editTitle: types_1.NotificationActions.PracticeEditTitle,
|
|
80
|
+
addPlayers: types_1.NotificationActions.PracticePlayersAdd,
|
|
81
|
+
removePlayers: types_1.NotificationActions.PracticePlayersRemove,
|
|
82
|
+
confirmAssistance: types_1.NotificationActions.PracticeAssistanceConfirm,
|
|
83
|
+
declineAssistance: types_1.NotificationActions.PracticeAssistanceDecline,
|
|
84
|
+
reminder: types_1.NotificationActions.PracticeReminder,
|
|
85
|
+
reminderEveningConfirm: types_1.NotificationActions.PracticeEveningReminderConfirm,
|
|
86
|
+
reminderEveningPending: types_1.NotificationActions.PracticeEveningReminderPending,
|
|
87
|
+
reminderMorningConfirm: types_1.NotificationActions.PracticeMorningReminderConfirm,
|
|
88
|
+
reminderMorningPending: types_1.NotificationActions.PracticeMorningReminderPending,
|
|
89
|
+
reminderRollcall: types_1.NotificationActions.PracticeRollCallReminder,
|
|
90
|
+
};
|
|
91
|
+
exports.notificationMultiplePractice = {
|
|
92
|
+
cancel: types_1.NotificationActions.PracticesCancel,
|
|
93
|
+
create: types_1.NotificationActions.PracticesCreate,
|
|
94
|
+
editAttendance: types_1.NotificationActions.PracticesEditAttendance,
|
|
95
|
+
editComments: types_1.NotificationActions.PracticesEditComments,
|
|
96
|
+
editDatetime: types_1.NotificationActions.PracticesEditDatetime,
|
|
97
|
+
editLocality: types_1.NotificationActions.PracticesEditLocality,
|
|
98
|
+
editRepertory: types_1.NotificationActions.PracticesEditRepertory,
|
|
99
|
+
editTitle: types_1.NotificationActions.PracticesEditTitle,
|
|
100
|
+
addPlayers: types_1.NotificationActions.PracticesPlayersAdd,
|
|
101
|
+
removePlayers: types_1.NotificationActions.PracticesPlayersRemove,
|
|
102
|
+
confirmAssistance: types_1.NotificationActions.PracticeAssistanceConfirm,
|
|
103
|
+
declineAssistance: types_1.NotificationActions.PracticeAssistanceDecline,
|
|
104
|
+
reminder: types_1.NotificationActions.PracticeReminder,
|
|
105
|
+
reminderEveningConfirm: types_1.NotificationActions.PracticeEveningReminderConfirm,
|
|
106
|
+
reminderEveningPending: types_1.NotificationActions.PracticeEveningReminderPending,
|
|
107
|
+
reminderMorningConfirm: types_1.NotificationActions.PracticeMorningReminderConfirm,
|
|
108
|
+
reminderMorningPending: types_1.NotificationActions.PracticeMorningReminderPending,
|
|
109
|
+
reminderRollcall: types_1.NotificationActions.PracticeRollCallReminder,
|
|
110
|
+
};
|
|
111
|
+
exports.disabledNotificationsByUserConfig = {
|
|
112
|
+
eventAssistanceConfirm: [
|
|
113
|
+
types_1.NotificationActions.PerformanceAssistanceConfirm,
|
|
114
|
+
types_1.NotificationActions.PracticeAssistanceConfirm,
|
|
115
|
+
],
|
|
116
|
+
eventAssistanceDecline: [
|
|
117
|
+
types_1.NotificationActions.PerformanceAssistanceDecline,
|
|
118
|
+
types_1.NotificationActions.PracticeAssistanceDecline,
|
|
119
|
+
],
|
|
120
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paymentStatusErrors = void 0;
|
|
4
|
+
const types_1 = require("../models/Payment/types");
|
|
5
|
+
exports.paymentStatusErrors = [
|
|
6
|
+
types_1.PaymentStatus.Error,
|
|
7
|
+
types_1.PaymentStatus.Chargeback,
|
|
8
|
+
types_1.PaymentStatus.Canceled,
|
|
9
|
+
];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Node } from 'slate';
|
|
2
|
+
import { LanguagesTypes } from '../lang';
|
|
3
|
+
import { MetaNotificationData } from '../models/User/Notification/types';
|
|
4
|
+
export declare const replaceVarsBrackets: (string: string, values: MetaNotificationData) => string;
|
|
5
|
+
export declare const replaceKeysNotification: (string: string, values: MetaNotificationData, lang: LanguagesTypes) => string;
|
|
6
|
+
export declare const serializeSlateBlock: (nodes: Node[]) => string;
|
package/helpers/utils.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.serializeSlateBlock = exports.replaceKeysNotification = exports.replaceVarsBrackets = void 0;
|
|
18
|
+
const date_fns_1 = require("date-fns");
|
|
19
|
+
const date_fns_tz_1 = require("date-fns-tz");
|
|
20
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
21
|
+
const lang_1 = require("../lang");
|
|
22
|
+
const Instrument_1 = __importDefault(require("../models/Instrument"));
|
|
23
|
+
const replaceVarsBrackets = (string, values) => {
|
|
24
|
+
const matches = string.match(/[^[\]]+(?=])/g);
|
|
25
|
+
let replaceString = string;
|
|
26
|
+
if (matches && matches.length > 0) {
|
|
27
|
+
matches.forEach((match) => {
|
|
28
|
+
replaceString = replaceString.replace(`[${match}]`, get_1.default(values, match));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return replaceString;
|
|
32
|
+
};
|
|
33
|
+
exports.replaceVarsBrackets = replaceVarsBrackets;
|
|
34
|
+
const replaceKeysNotification = (string, values, lang) => {
|
|
35
|
+
const dateLang = lang_1.getDateLang(lang);
|
|
36
|
+
const matches = string.match(/(\{).+?(\})/g);
|
|
37
|
+
const { extra } = values, other = __rest(values, ["extra"]);
|
|
38
|
+
const newValues = { extra };
|
|
39
|
+
Object.keys(other || {}).forEach((key) => Object.assign(newValues, {
|
|
40
|
+
[key]: Object.values(get_1.default(other, key)),
|
|
41
|
+
}));
|
|
42
|
+
let replaceString = string;
|
|
43
|
+
if (matches && matches.length > 0) {
|
|
44
|
+
matches.forEach((match) => {
|
|
45
|
+
const value = match.slice(1, -1);
|
|
46
|
+
const typeKeyMatch = value.split(':');
|
|
47
|
+
const type = typeKeyMatch[0];
|
|
48
|
+
const key = typeKeyMatch[1];
|
|
49
|
+
switch (type) {
|
|
50
|
+
case 'instrument': {
|
|
51
|
+
const instrumentId = get_1.default(newValues, key.split('.'));
|
|
52
|
+
const instrument = new Instrument_1.default(instrumentId, lang);
|
|
53
|
+
if (instrument) {
|
|
54
|
+
replaceString = replaceString.replace(match, instrument.name.toLowerCase());
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case 'date': {
|
|
59
|
+
const timestamp = get_1.default(newValues, key.split('.'));
|
|
60
|
+
if (!timestamp) {
|
|
61
|
+
replaceString = replaceString.replace(match, '');
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const dateUTC = date_fns_tz_1.utcToZonedTime(timestamp.toDate(), 'Europe/Madrid');
|
|
65
|
+
const formatValue = typeKeyMatch[2] || 'shortDate';
|
|
66
|
+
const dateFormat = date_fns_1.format(dateUTC, get_1.default(dateLang.format, formatValue), {
|
|
67
|
+
locale: dateLang.locale,
|
|
68
|
+
});
|
|
69
|
+
replaceString = replaceString.replace(match, dateFormat);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case 'string': {
|
|
74
|
+
replaceString = replaceString.replace(match, get_1.default(newValues, key.split('.')));
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
default: {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return replaceString;
|
|
84
|
+
};
|
|
85
|
+
exports.replaceKeysNotification = replaceKeysNotification;
|
|
86
|
+
const serializeSlateBlock = (nodes) => {
|
|
87
|
+
return nodes
|
|
88
|
+
.map((node) => {
|
|
89
|
+
const children = get_1.default(node, 'children');
|
|
90
|
+
if (children) {
|
|
91
|
+
return exports.serializeSlateBlock(children);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return node.text.trim() || '';
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
.join(' ');
|
|
98
|
+
};
|
|
99
|
+
exports.serializeSlateBlock = serializeSlateBlock;
|
package/index.d.ts
ADDED
|
File without changes
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|