@glissandoo/lib 1.41.0 → 1.42.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.
@@ -1,5 +1,5 @@
1
- export declare const mapToArray: <V>(obj: Record<string, V>) => (V & {
2
- id: string;
1
+ export declare const mapToArray: <K extends string, V, O extends Record<K, V>>(obj: O) => (O[`${Exclude<keyof O, symbol>}`] & {
2
+ id: keyof O;
3
3
  })[];
4
4
  export declare const map: <KIn extends string, VIn, KOut extends string, VOut>(obj: Record<KIn, VIn>, fn: (key: `${KIn}`, value: VIn, index?: number) => [KOut, VOut]) => Record<KOut, VOut>;
5
5
  export declare const filter: <K extends string, V>(obj: Record<K, V>, fn: (key: `${Exclude<K, symbol>}`, value: V, index?: number) => unknown) => Record<`${Exclude<K, symbol>}`, V>;
@@ -70,4 +70,8 @@ export default class Group extends GroupBasic<GroupData> {
70
70
  get trialEndAt(): Date;
71
71
  get glissandooAdminUrl(): string;
72
72
  get createdOn(): import("./types").GroupCreatedOn;
73
+ get instruments(): Partial<Record<import("../../helpers/instruments").InstrumentId, import("./types").GroupInstrument>>;
74
+ get instrumentsList(): (import("./types").GroupInstrument & {
75
+ id: import("../../helpers/instruments").InstrumentId;
76
+ })[];
73
77
  }
@@ -191,5 +191,11 @@ class Group extends basic_1.default {
191
191
  get createdOn() {
192
192
  return this.data.createdOn;
193
193
  }
194
+ get instruments() {
195
+ return this.data.instruments;
196
+ }
197
+ get instrumentsList() {
198
+ return (0, objects_1.mapToArray)(this.instruments).sort((a, b) => a.order - b.order);
199
+ }
194
200
  }
195
201
  exports.default = Group;
@@ -1,3 +1,4 @@
1
+ import { InstrumentId } from '../../helpers/instruments';
1
2
  import { MusicStyleType } from '../../helpers/musicStyles';
2
3
  import { PlansGroup } from '../../helpers/plans';
3
4
  import { StageTemplate } from '../../helpers/types';
@@ -85,6 +86,12 @@ export interface GroupRepertoireTag {
85
86
  export interface AGroupRepertoireTag extends GroupRepertoireTag {
86
87
  id: string;
87
88
  }
89
+ export interface GroupInstrument {
90
+ order: number;
91
+ }
92
+ export interface AGroupInstrument extends GroupInstrument {
93
+ id: InstrumentId;
94
+ }
88
95
  export interface GroupData extends GroupBasicData {
89
96
  playerIds: string[];
90
97
  players: Record<string, PlayerBasicData>;
@@ -113,6 +120,7 @@ export interface GroupData extends GroupBasicData {
113
120
  communicationCount: number;
114
121
  country: string;
115
122
  stageTemplates: Record<string, StageTemplate>;
123
+ instruments: Partial<Record<InstrumentId, GroupInstrument>>;
116
124
  metadata: Record<string, string>;
117
125
  firstAnswerAt: Timestamp | null;
118
126
  repertoireTags: Record<string, GroupRepertoireTag>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.41.0",
3
+ "version": "1.42.0",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,21 +0,0 @@
1
- import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
- export declare namespace PartnershipGroupFbFunctionsTypes {
3
- interface AddParams {
4
- partnershipId: string;
5
- groupId: string;
6
- }
7
- type AddResult = void;
8
- interface SetPlanParams {
9
- partnershipId: string;
10
- groupId: string;
11
- planId: PlansGroup;
12
- planPeriod: PlanPeriod;
13
- planDiscount: string | null;
14
- }
15
- type SetPlanResult = void;
16
- interface RemoveParams {
17
- partnershipId: string;
18
- groupId: string;
19
- }
20
- type RemoveResult = void;
21
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,37 +0,0 @@
1
- import { EventoFbFunctionsTypes } from '../functions/event';
2
- import { NotificationActions } from '../models/Notification/types';
3
- import { UserNotificationSettings } from '../models/User/types';
4
- import { BadgesTypes } from './badges';
5
- export declare const notificationActionsBadges: Record<BadgesTypes, {
6
- firstLevel: NotificationActions;
7
- upLevel: NotificationActions;
8
- }>;
9
- export declare enum NotificationEventActions {
10
- Create = "create",
11
- Cancel = "cancel",
12
- EditAttendance = "editAttendance",
13
- EditComments = "editComments",
14
- EditDatetime = "editDatetime",
15
- EditLocality = "editLocality",
16
- EditRepertory = "editRepertory",
17
- EditStage = "editStage",
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
- type RealtionScopeToNotification = Record<EventoFbFunctionsTypes.EditScope, NotificationEventActions>;
31
- export declare const editScopeToAction: RealtionScopeToNotification;
32
- 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 userNotificationSettings: Record<UserNotificationSettings, NotificationActions[]>;
37
- export {};
@@ -1,126 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.userNotificationSettings = exports.notificationMultiplePractice = exports.notificationSinglePractice = exports.notificationPerformance = exports.editScopeToAction = exports.NotificationEventActions = exports.notificationActionsBadges = void 0;
4
- const types_1 = require("../models/Notification/types");
5
- const types_2 = require("../models/User/types");
6
- const badges_1 = require("./badges");
7
- exports.notificationActionsBadges = {
8
- [badges_1.BadgesTypes.AccPerformances]: {
9
- firstLevel: types_1.NotificationActions.BadgeAccPerformancesFirstLevel,
10
- upLevel: types_1.NotificationActions.BadgeAccPerformancesUpLevel,
11
- },
12
- [badges_1.BadgesTypes.AccPractices]: {
13
- firstLevel: types_1.NotificationActions.BadgeAccPracticesFirstLevel,
14
- upLevel: types_1.NotificationActions.BadgeAccPracticesUpLevel,
15
- },
16
- [badges_1.BadgesTypes.AnswerEvents]: {
17
- firstLevel: types_1.NotificationActions.BadgeAnswerEventsFirstLevel,
18
- upLevel: types_1.NotificationActions.BadgeAnswerEventsUpLevel,
19
- },
20
- [badges_1.BadgesTypes.StrikePractices]: {
21
- firstLevel: types_1.NotificationActions.BadgeStrikePracticesFirstLevel,
22
- upLevel: types_1.NotificationActions.BadgeStrikePracticesUpLevel,
23
- },
24
- };
25
- var NotificationEventActions;
26
- (function (NotificationEventActions) {
27
- NotificationEventActions["Create"] = "create";
28
- NotificationEventActions["Cancel"] = "cancel";
29
- NotificationEventActions["EditAttendance"] = "editAttendance";
30
- NotificationEventActions["EditComments"] = "editComments";
31
- NotificationEventActions["EditDatetime"] = "editDatetime";
32
- NotificationEventActions["EditLocality"] = "editLocality";
33
- NotificationEventActions["EditRepertory"] = "editRepertory";
34
- NotificationEventActions["EditStage"] = "editStage";
35
- NotificationEventActions["EditTitle"] = "editTitle";
36
- NotificationEventActions["AddPlayers"] = "addPlayers";
37
- NotificationEventActions["RemovePlayer"] = "removePlayers";
38
- NotificationEventActions["ConfirmAssistance"] = "confirmAssistance";
39
- NotificationEventActions["DeclineAssistance"] = "declineAssistance";
40
- NotificationEventActions["Reminder"] = "reminder";
41
- NotificationEventActions["ReminderEveningConfirm"] = "reminderEveningConfirm";
42
- NotificationEventActions["ReminderEveningPending"] = "reminderEveningPending";
43
- NotificationEventActions["ReminderMorningConfirm"] = "reminderMorningConfirm";
44
- NotificationEventActions["ReminderMorningPending"] = "reminderMorningPending";
45
- NotificationEventActions["ReminderRollcall"] = "reminderRollcall";
46
- })(NotificationEventActions = exports.NotificationEventActions || (exports.NotificationEventActions = {}));
47
- exports.editScopeToAction = {
48
- title: NotificationEventActions.EditTitle,
49
- locality: NotificationEventActions.EditLocality,
50
- comments: NotificationEventActions.EditComments,
51
- attendance: NotificationEventActions.EditAttendance,
52
- stage: NotificationEventActions.EditStage,
53
- };
54
- exports.notificationPerformance = {
55
- cancel: types_1.NotificationActions.PerformanceCancel,
56
- create: types_1.NotificationActions.PerformanceCreate,
57
- editAttendance: types_1.NotificationActions.PerformanceEditAttendance,
58
- editComments: types_1.NotificationActions.PerformanceEditComments,
59
- editDatetime: types_1.NotificationActions.PerformanceEditDatetime,
60
- editLocality: types_1.NotificationActions.PerformanceEditLocality,
61
- editRepertory: types_1.NotificationActions.PerformanceEditRepertory,
62
- editTitle: types_1.NotificationActions.PerformanceEditTitle,
63
- editStage: types_1.NotificationActions.PerformanceEditStage,
64
- addPlayers: types_1.NotificationActions.PerformancePlayersAdd,
65
- removePlayers: types_1.NotificationActions.PerformancePlayersRemove,
66
- confirmAssistance: types_1.NotificationActions.PerformanceAssistanceConfirm,
67
- declineAssistance: types_1.NotificationActions.PerformanceAssistanceDecline,
68
- reminder: types_1.NotificationActions.PerformanceReminder,
69
- reminderEveningConfirm: types_1.NotificationActions.PerformanceEveningReminderConfirm,
70
- reminderEveningPending: types_1.NotificationActions.PerformanceEveningReminderPending,
71
- reminderMorningConfirm: types_1.NotificationActions.PerformanceMorningReminderConfirm,
72
- reminderMorningPending: types_1.NotificationActions.PerformanceMorningReminderPending,
73
- reminderRollcall: types_1.NotificationActions.PerformanceRollCallReminder,
74
- };
75
- exports.notificationSinglePractice = {
76
- cancel: types_1.NotificationActions.PracticeCancel,
77
- create: types_1.NotificationActions.PracticeCreate,
78
- editAttendance: types_1.NotificationActions.PracticeEditAttendance,
79
- editComments: types_1.NotificationActions.PracticeEditComments,
80
- editDatetime: types_1.NotificationActions.PracticeEditDatetime,
81
- editLocality: types_1.NotificationActions.PracticeEditLocality,
82
- editRepertory: types_1.NotificationActions.PracticeEditRepertory,
83
- editTitle: types_1.NotificationActions.PracticeEditTitle,
84
- editStage: types_1.NotificationActions.PracticeEditStage,
85
- addPlayers: types_1.NotificationActions.PracticePlayersAdd,
86
- removePlayers: types_1.NotificationActions.PracticePlayersRemove,
87
- confirmAssistance: types_1.NotificationActions.PracticeAssistanceConfirm,
88
- declineAssistance: types_1.NotificationActions.PracticeAssistanceDecline,
89
- reminder: types_1.NotificationActions.PracticeReminder,
90
- reminderEveningConfirm: types_1.NotificationActions.PracticeEveningReminderConfirm,
91
- reminderEveningPending: types_1.NotificationActions.PracticeEveningReminderPending,
92
- reminderMorningConfirm: types_1.NotificationActions.PracticeMorningReminderConfirm,
93
- reminderMorningPending: types_1.NotificationActions.PracticeMorningReminderPending,
94
- reminderRollcall: types_1.NotificationActions.PracticeRollCallReminder,
95
- };
96
- exports.notificationMultiplePractice = {
97
- cancel: types_1.NotificationActions.PracticesCancel,
98
- create: types_1.NotificationActions.PracticesCreate,
99
- editAttendance: types_1.NotificationActions.PracticesEditAttendance,
100
- editComments: types_1.NotificationActions.PracticesEditComments,
101
- editDatetime: types_1.NotificationActions.PracticesEditDatetime,
102
- editLocality: types_1.NotificationActions.PracticesEditLocality,
103
- editRepertory: types_1.NotificationActions.PracticesEditRepertory,
104
- editTitle: types_1.NotificationActions.PracticesEditTitle,
105
- editStage: types_1.NotificationActions.PracticesEditStage,
106
- addPlayers: types_1.NotificationActions.PracticesPlayersAdd,
107
- removePlayers: types_1.NotificationActions.PracticesPlayersRemove,
108
- confirmAssistance: types_1.NotificationActions.PracticeAssistanceConfirm,
109
- declineAssistance: types_1.NotificationActions.PracticeAssistanceDecline,
110
- reminder: types_1.NotificationActions.PracticeReminder,
111
- reminderEveningConfirm: types_1.NotificationActions.PracticeEveningReminderConfirm,
112
- reminderEveningPending: types_1.NotificationActions.PracticeEveningReminderPending,
113
- reminderMorningConfirm: types_1.NotificationActions.PracticeMorningReminderConfirm,
114
- reminderMorningPending: types_1.NotificationActions.PracticeMorningReminderPending,
115
- reminderRollcall: types_1.NotificationActions.PracticeRollCallReminder,
116
- };
117
- exports.userNotificationSettings = {
118
- [types_2.UserNotificationSettings.AttendanceConfirmed]: [
119
- types_1.NotificationActions.PerformanceAssistanceConfirm,
120
- types_1.NotificationActions.PracticeAssistanceConfirm,
121
- ],
122
- [types_2.UserNotificationSettings.AttendanceDeclined]: [
123
- types_1.NotificationActions.PerformanceAssistanceDecline,
124
- types_1.NotificationActions.PracticeAssistanceDecline,
125
- ],
126
- };