@glissandoo/lib 1.44.1 → 1.44.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.
- package/helpers/objects.d.ts +6 -1
- package/helpers/objects.js +12 -1
- package/models/Group/index.d.ts +1 -3
- package/models/Group/index.js +2 -2
- package/package.json +1 -1
- package/functions/partnershipGroup copy.d.ts +0 -21
- package/functions/partnershipGroup copy.js +0 -2
- package/helpers/notifications.d.ts +0 -37
- package/helpers/notifications.js +0 -126
package/helpers/objects.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
export declare const mapToArray: <K extends string, V, O extends Record<K, V>>(obj: O) => (O[`${Exclude<keyof O, symbol>}`] & {
|
|
1
|
+
export declare const mapToArray: <K extends string, V extends object, O extends Record<K, V>>(obj: O) => (O[`${Exclude<keyof O, symbol>}`] & {
|
|
2
2
|
id: keyof O;
|
|
3
3
|
})[];
|
|
4
|
+
export declare const orderedMapToArray: <K extends string, V extends {
|
|
5
|
+
order: number;
|
|
6
|
+
}, O extends Record<K, V>>(obj: O) => Pick<O[`${Exclude<keyof O, symbol>}`] & {
|
|
7
|
+
id: keyof O;
|
|
8
|
+
}, "id" | Exclude<keyof O[`${Exclude<keyof O, symbol>}`], "order">>[];
|
|
4
9
|
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
10
|
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>;
|
|
6
11
|
export declare const forEach: <K extends string, V>(obj: Record<K, V>, fn: (key: `${Exclude<K, symbol>}`, value: V, index?: number) => unknown) => void;
|
package/helpers/objects.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.forEach = exports.filter = exports.map = exports.mapToArray = void 0;
|
|
3
|
+
exports.forEach = exports.filter = exports.map = exports.orderedMapToArray = exports.mapToArray = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
4
5
|
const ts_extras_1 = require("./ts-extras");
|
|
5
6
|
const mapToArray = (obj) => {
|
|
6
7
|
return (0, ts_extras_1.objectEntries)(obj).map(([key, value]) => ({
|
|
@@ -9,6 +10,16 @@ const mapToArray = (obj) => {
|
|
|
9
10
|
}));
|
|
10
11
|
};
|
|
11
12
|
exports.mapToArray = mapToArray;
|
|
13
|
+
const orderedMapToArray = (obj) => {
|
|
14
|
+
return (0, ts_extras_1.objectEntries)(obj)
|
|
15
|
+
.map(([key, value]) => ({
|
|
16
|
+
...value,
|
|
17
|
+
id: key,
|
|
18
|
+
}))
|
|
19
|
+
.sort((a, b) => a.order - b.order)
|
|
20
|
+
.map((obj) => (0, lodash_1.omit)(obj, 'order'));
|
|
21
|
+
};
|
|
22
|
+
exports.orderedMapToArray = orderedMapToArray;
|
|
12
23
|
const map = (obj, fn) => {
|
|
13
24
|
const entries = (0, ts_extras_1.objectEntries)(obj);
|
|
14
25
|
const mappedEntries = entries.map(([key, value], index) => fn(key, value, index));
|
package/models/Group/index.d.ts
CHANGED
|
@@ -71,8 +71,6 @@ export default class Group extends GroupBasic<GroupData> {
|
|
|
71
71
|
get glissandooAdminUrl(): string;
|
|
72
72
|
get createdOn(): import("./types").GroupCreatedOn;
|
|
73
73
|
get instruments(): Partial<Record<import("../../helpers/instruments").InstrumentId, import("./types").GroupInstrument>>;
|
|
74
|
-
get instrumentsList():
|
|
75
|
-
id: import("../../helpers/instruments").InstrumentId;
|
|
76
|
-
})[];
|
|
74
|
+
get instrumentsList(): import("../../helpers/instruments").InstrumentId[];
|
|
77
75
|
get visitedDashboardAt(): Record<string, import("../../types/firestore").Timestamp>;
|
|
78
76
|
}
|
package/models/Group/index.js
CHANGED
|
@@ -195,10 +195,10 @@ class Group extends basic_1.default {
|
|
|
195
195
|
return this.data.instruments;
|
|
196
196
|
}
|
|
197
197
|
get instrumentsList() {
|
|
198
|
-
return (0, objects_1.
|
|
198
|
+
return (0, objects_1.orderedMapToArray)(this.instruments).map(({ id }) => id);
|
|
199
199
|
}
|
|
200
200
|
get visitedDashboardAt() {
|
|
201
|
-
return this.data.visitedDashboardAt ||
|
|
201
|
+
return this.data.visitedDashboardAt || null;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
exports.default = Group;
|
package/package.json
CHANGED
|
@@ -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,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 {};
|
package/helpers/notifications.js
DELETED
|
@@ -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
|
-
};
|