@glissandoo/lib 1.103.6 → 1.103.7
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/models/Group/Repertory/File/Section/index.d.ts +3 -1
- package/models/Group/Repertory/File/Section/index.js +4 -3
- package/models/Group/Repertory/FilePath/index.d.ts +7 -5
- package/models/Group/Repertory/FilePath/index.js +5 -4
- package/models/Group/index.d.ts +1 -1
- package/models/Group/types.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { InstrumentId } from '../../../../../helpers/instruments';
|
|
2
2
|
import { LanguagesTypes } from '../../../../../lang';
|
|
3
|
+
import { GroupInstruments } from '../../../types';
|
|
3
4
|
import { FileSectionId } from './types';
|
|
4
5
|
export default class GroupRepertoryFileSection {
|
|
5
6
|
id: FileSectionId;
|
|
7
|
+
groupInstruments: GroupInstruments;
|
|
6
8
|
private lang;
|
|
7
|
-
constructor(id: FileSectionId, lang?: LanguagesTypes);
|
|
9
|
+
constructor(id: FileSectionId, instruments: GroupInstruments, lang?: LanguagesTypes);
|
|
8
10
|
get name(): string;
|
|
9
11
|
getOrder(instrumentsIds: InstrumentId[]): number;
|
|
10
12
|
}
|
|
@@ -5,17 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const orders_1 = require("../../../../../helpers/fileSections/orders");
|
|
7
7
|
const lang_1 = require("../../../../../lang");
|
|
8
|
-
const
|
|
8
|
+
const group_1 = __importDefault(require("../../../../Instrument/group"));
|
|
9
9
|
const types_1 = require("./types");
|
|
10
10
|
class GroupRepertoryFileSection {
|
|
11
|
-
constructor(id, lang = lang_1.defaultLocale) {
|
|
11
|
+
constructor(id, instruments, lang = lang_1.defaultLocale) {
|
|
12
12
|
this.id = id;
|
|
13
|
+
this.groupInstruments = instruments;
|
|
13
14
|
this.lang = lang;
|
|
14
15
|
}
|
|
15
16
|
get name() {
|
|
16
17
|
return ((this.id === types_1.FileSectionIdReserved.All
|
|
17
18
|
? (0, lang_1.getTranslation)(`sections.all`, this.lang)
|
|
18
|
-
: new
|
|
19
|
+
: new group_1.default(this.id, this.lang, this.groupInstruments).name) || this.id);
|
|
19
20
|
}
|
|
20
21
|
getOrder(instrumentsIds) {
|
|
21
22
|
return (0, orders_1.getFileSectionsOrder)(instrumentsIds).indexOf(this.id) + 1 || Infinity;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import Group from '../../';
|
|
4
4
|
import { LanguagesTypes } from '../../../../lang';
|
|
5
|
+
import { GroupInstruments } from '../../types';
|
|
5
6
|
import FileSection from '../File/Section';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
7
|
+
import { FileSectionId } from '../File/Section/types';
|
|
8
|
+
import { GroupRepertoireFilePathItem } from '../types';
|
|
8
9
|
export default class ThemeFilePath {
|
|
9
10
|
sectionId: FileSectionId;
|
|
10
11
|
protected data: GroupRepertoireFilePathItem;
|
|
11
12
|
protected lang: LanguagesTypes;
|
|
12
|
-
|
|
13
|
+
protected instruments: GroupInstruments;
|
|
14
|
+
constructor(sectionId: FileSectionId, data: GroupRepertoireFilePathItem, instruments: GroupInstruments, lang?: LanguagesTypes);
|
|
13
15
|
get path(): string;
|
|
14
16
|
get parsedPath(): path.ParsedPath;
|
|
15
17
|
get ext(): string;
|
|
@@ -3,13 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const lang_1 = require("../../../../lang");
|
|
7
|
-
const Section_1 = __importDefault(require("../File/Section"));
|
|
8
6
|
const path_1 = __importDefault(require("path"));
|
|
9
7
|
const audios_1 = require("../../../../helpers/audios");
|
|
8
|
+
const lang_1 = require("../../../../lang");
|
|
9
|
+
const Section_1 = __importDefault(require("../File/Section"));
|
|
10
10
|
class ThemeFilePath {
|
|
11
|
-
constructor(sectionId, data, lang = lang_1.defaultLocale) {
|
|
11
|
+
constructor(sectionId, data, instruments, lang = lang_1.defaultLocale) {
|
|
12
12
|
this.sectionId = sectionId;
|
|
13
|
+
this.instruments = instruments;
|
|
13
14
|
this.data = data;
|
|
14
15
|
this.lang = lang;
|
|
15
16
|
}
|
|
@@ -29,7 +30,7 @@ class ThemeFilePath {
|
|
|
29
30
|
return audios_1.audioExtensions.includes(this.ext);
|
|
30
31
|
}
|
|
31
32
|
get section() {
|
|
32
|
-
return new Section_1.default(this.sectionId, this.lang);
|
|
33
|
+
return new Section_1.default(this.sectionId, this.instruments, this.lang);
|
|
33
34
|
}
|
|
34
35
|
get tag() {
|
|
35
36
|
return this.data.tag;
|
package/models/Group/index.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ export default class Group extends GroupBasic<GroupData> {
|
|
|
82
82
|
get trialEndAt(): Date;
|
|
83
83
|
get glissandooAdminUrl(): string;
|
|
84
84
|
get createdOn(): import("../../helpers/types").CreatedOn;
|
|
85
|
-
get instruments():
|
|
85
|
+
get instruments(): import("./types").GroupInstruments;
|
|
86
86
|
get instrumentsList(): Pick<(import("./types").DefaultGroupInstrument & {
|
|
87
87
|
id: import("../../helpers/instruments").DefaultInstrumentId | `customInstrument-${string}`;
|
|
88
88
|
}) | (CustomGroupInstrument & {
|
package/models/Group/types.d.ts
CHANGED
|
@@ -130,6 +130,7 @@ export interface AGroupCustomInstrument extends CustomGroupInstrument {
|
|
|
130
130
|
id: CustomInstrumentId;
|
|
131
131
|
}
|
|
132
132
|
export type AGroupInstrument = AGroupDefaultInstrument | AGroupCustomInstrument;
|
|
133
|
+
export type GroupInstruments = Partial<Record<DefaultInstrumentId, DefaultGroupInstrument>> & Record<CustomInstrumentId, CustomGroupInstrument>;
|
|
133
134
|
export interface GroupData extends GroupBasicData {
|
|
134
135
|
playerIds: string[];
|
|
135
136
|
players: Record<string, PlayerBasicData>;
|
|
@@ -160,7 +161,7 @@ export interface GroupData extends GroupBasicData {
|
|
|
160
161
|
eventCount: Record<EventType, number>;
|
|
161
162
|
communicationCount: number;
|
|
162
163
|
country: string;
|
|
163
|
-
instruments:
|
|
164
|
+
instruments: GroupInstruments;
|
|
164
165
|
metadata: Record<string, string>;
|
|
165
166
|
firstAnswerAt: Timestamp | null;
|
|
166
167
|
repertoireTags: Record<string, GroupRepertoireTag>;
|