@glissandoo/lib 1.15.0 → 1.15.1
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/.husky/pre-commit +4 -0
- package/README.md +70 -0
- package/{functions → lib/functions}/groupRepertory.d.ts +3 -10
- package/{helpers → lib/helpers}/utils.d.ts +3 -0
- package/{helpers → lib/helpers}/utils.js +5 -1
- package/{models → lib/models}/Group/Repertory/index.d.ts +14 -11
- package/{models → lib/models}/Group/Repertory/index.js +22 -18
- package/{models → lib/models}/Group/Repertory/types.d.ts +33 -4
- package/lib/models/Group/Repertory/types.js +8 -0
- package/{models → lib/models}/Group/index.d.ts +11 -3
- package/{models → lib/models}/Group/index.js +13 -6
- package/{models → lib/models}/Group/types.d.ts +8 -0
- package/package.json +1 -1
- package/models/User/Notification/types.js +0 -2
- /package/{functions → lib/functions}/auth.d.ts +0 -0
- /package/{functions → lib/functions}/auth.js +0 -0
- /package/{functions → lib/functions}/communication.d.ts +0 -0
- /package/{functions → lib/functions}/communication.js +0 -0
- /package/{functions → lib/functions}/communicationComment.d.ts +0 -0
- /package/{functions → lib/functions}/communicationComment.js +0 -0
- /package/{functions → lib/functions}/event.d.ts +0 -0
- /package/{functions → lib/functions}/event.js +0 -0
- /package/{functions → lib/functions}/eventPlayer.d.ts +0 -0
- /package/{functions → lib/functions}/eventPlayer.js +0 -0
- /package/{functions → lib/functions}/eventRepertory.d.ts +0 -0
- /package/{functions → lib/functions}/eventRepertory.js +0 -0
- /package/{functions → lib/functions}/federation.d.ts +0 -0
- /package/{functions → lib/functions}/federation.js +0 -0
- /package/{functions → lib/functions}/federationPartnership.d.ts +0 -0
- /package/{functions → lib/functions}/federationPartnership.js +0 -0
- /package/{functions → lib/functions}/group.d.ts +0 -0
- /package/{functions → lib/functions}/group.js +0 -0
- /package/{functions → lib/functions}/groupPlayer.d.ts +0 -0
- /package/{functions → lib/functions}/groupPlayer.js +0 -0
- /package/{functions → lib/functions}/groupRepertory.js +0 -0
- /package/{functions → lib/functions}/index.d.ts +0 -0
- /package/{functions → lib/functions}/index.js +0 -0
- /package/{functions → lib/functions}/jwt.d.ts +0 -0
- /package/{functions → lib/functions}/jwt.js +0 -0
- /package/{functions → lib/functions}/misc.d.ts +0 -0
- /package/{functions → lib/functions}/misc.js +0 -0
- /package/{functions → lib/functions}/notification.d.ts +0 -0
- /package/{functions → lib/functions}/notification.js +0 -0
- /package/{functions → lib/functions}/partner.d.ts +0 -0
- /package/{functions → lib/functions}/partner.js +0 -0
- /package/{functions → lib/functions}/partnership.d.ts +0 -0
- /package/{functions → lib/functions}/partnership.js +0 -0
- /package/{functions → lib/functions}/partnershipGroup.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipGroup.js +0 -0
- /package/{functions → lib/functions}/partnershipPlan.d.ts +0 -0
- /package/{functions → lib/functions}/partnershipPlan.js +0 -0
- /package/{functions → lib/functions}/regions.d.ts +0 -0
- /package/{functions → lib/functions}/regions.js +0 -0
- /package/{functions → lib/functions}/subscription.d.ts +0 -0
- /package/{functions → lib/functions}/subscription.js +0 -0
- /package/{functions → lib/functions}/user.d.ts +0 -0
- /package/{functions → lib/functions}/user.js +0 -0
- /package/{helpers → lib/helpers}/appScenes.d.ts +0 -0
- /package/{helpers → lib/helpers}/appScenes.js +0 -0
- /package/{helpers → lib/helpers}/auth.d.ts +0 -0
- /package/{helpers → lib/helpers}/auth.js +0 -0
- /package/{helpers → lib/helpers}/badges.d.ts +0 -0
- /package/{helpers → lib/helpers}/badges.js +0 -0
- /package/{helpers → lib/helpers}/collections.d.ts +0 -0
- /package/{helpers → lib/helpers}/collections.js +0 -0
- /package/{helpers → lib/helpers}/dlinks.d.ts +0 -0
- /package/{helpers → lib/helpers}/dlinks.js +0 -0
- /package/{helpers → lib/helpers}/errors.d.ts +0 -0
- /package/{helpers → lib/helpers}/errors.js +0 -0
- /package/{helpers → lib/helpers}/instruments/index.d.ts +0 -0
- /package/{helpers → lib/helpers}/instruments/index.js +0 -0
- /package/{helpers → lib/helpers}/musicStyles/index.d.ts +0 -0
- /package/{helpers → lib/helpers}/musicStyles/index.js +0 -0
- /package/{helpers → lib/helpers}/musicStyles/orders.d.ts +0 -0
- /package/{helpers → lib/helpers}/musicStyles/orders.js +0 -0
- /package/{helpers → lib/helpers}/notifications.d.ts +0 -0
- /package/{helpers → lib/helpers}/notifications.js +0 -0
- /package/{helpers → lib/helpers}/payments.d.ts +0 -0
- /package/{helpers → lib/helpers}/payments.js +0 -0
- /package/{helpers → lib/helpers}/plans.d.ts +0 -0
- /package/{helpers → lib/helpers}/plans.js +0 -0
- /package/{helpers → lib/helpers}/rates.d.ts +0 -0
- /package/{helpers → lib/helpers}/rates.js +0 -0
- /package/{helpers → lib/helpers}/reasons.d.ts +0 -0
- /package/{helpers → lib/helpers}/reasons.js +0 -0
- /package/{helpers → lib/helpers}/slate.d.ts +0 -0
- /package/{helpers → lib/helpers}/slate.js +0 -0
- /package/{helpers → lib/helpers}/styles.d.ts +0 -0
- /package/{helpers → lib/helpers}/styles.js +0 -0
- /package/{helpers → lib/helpers}/types.d.ts +0 -0
- /package/{helpers → lib/helpers}/types.js +0 -0
- /package/{index.d.ts → lib/index.d.ts} +0 -0
- /package/{index.js → lib/index.js} +0 -0
- /package/{lang → lib/lang}/ca.json +0 -0
- /package/{lang → lib/lang}/de.json +0 -0
- /package/{lang → lib/lang}/en.json +0 -0
- /package/{lang → lib/lang}/es.json +0 -0
- /package/{lang → lib/lang}/eu.json +0 -0
- /package/{lang → lib/lang}/gl.json +0 -0
- /package/{lang → lib/lang}/index.d.ts +0 -0
- /package/{lang → lib/lang}/index.js +0 -0
- /package/{lang → lib/lang}/pt.json +0 -0
- /package/{models → lib/models}/Communication/Comment/index.d.ts +0 -0
- /package/{models → lib/models}/Communication/Comment/index.js +0 -0
- /package/{models → lib/models}/Communication/Comment/types.d.ts +0 -0
- /package/{models → lib/models}/Communication/Comment/types.js +0 -0
- /package/{models → lib/models}/Communication/index.d.ts +0 -0
- /package/{models → lib/models}/Communication/index.js +0 -0
- /package/{models → lib/models}/Communication/types.d.ts +0 -0
- /package/{models → lib/models}/Communication/types.js +0 -0
- /package/{models → lib/models}/Counters/Group/Analytics/index.d.ts +0 -0
- /package/{models → lib/models}/Counters/Group/Analytics/index.js +0 -0
- /package/{models → lib/models}/Counters/Group/Analytics/types.d.ts +0 -0
- /package/{models → lib/models}/Counters/Group/Analytics/types.js +0 -0
- /package/{models → lib/models}/Counters/Group/index.d.ts +0 -0
- /package/{models → lib/models}/Counters/Group/index.js +0 -0
- /package/{models → lib/models}/Counters/Group/types.d.ts +0 -0
- /package/{models → lib/models}/Counters/Group/types.js +0 -0
- /package/{models → lib/models}/Counters/event.d.ts +0 -0
- /package/{models → lib/models}/Counters/event.js +0 -0
- /package/{models → lib/models}/Counters/index.d.ts +0 -0
- /package/{models → lib/models}/Counters/index.js +0 -0
- /package/{models → lib/models}/Counters/types.d.ts +0 -0
- /package/{models → lib/models}/Counters/types.js +0 -0
- /package/{models → lib/models}/Evento/Player/index.d.ts +0 -0
- /package/{models → lib/models}/Evento/Player/index.js +0 -0
- /package/{models → lib/models}/Evento/Player/types.d.ts +0 -0
- /package/{models → lib/models}/Evento/Player/types.js +0 -0
- /package/{models → lib/models}/Evento/Repertory/index.d.ts +0 -0
- /package/{models → lib/models}/Evento/Repertory/index.js +0 -0
- /package/{models → lib/models}/Evento/Repertory/types.d.ts +0 -0
- /package/{models → lib/models}/Evento/Repertory/types.js +0 -0
- /package/{models → lib/models}/Evento/basic.d.ts +0 -0
- /package/{models → lib/models}/Evento/basic.js +0 -0
- /package/{models → lib/models}/Evento/index.d.ts +0 -0
- /package/{models → lib/models}/Evento/index.js +0 -0
- /package/{models → lib/models}/Evento/promoter.d.ts +0 -0
- /package/{models → lib/models}/Evento/promoter.js +0 -0
- /package/{models → lib/models}/Evento/tiny.d.ts +0 -0
- /package/{models → lib/models}/Evento/tiny.js +0 -0
- /package/{models → lib/models}/Evento/types.d.ts +0 -0
- /package/{models → lib/models}/Evento/types.js +0 -0
- /package/{models → lib/models}/Federation/Partnership/index.d.ts +0 -0
- /package/{models → lib/models}/Federation/Partnership/index.js +0 -0
- /package/{models → lib/models}/Federation/Partnership/types.d.ts +0 -0
- /package/{models → lib/models}/Federation/Partnership/types.js +0 -0
- /package/{models → lib/models}/Federation/index.d.ts +0 -0
- /package/{models → lib/models}/Federation/index.js +0 -0
- /package/{models → lib/models}/Federation/types.d.ts +0 -0
- /package/{models → lib/models}/Federation/types.js +0 -0
- /package/{models → lib/models}/Group/Analytics/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Analytics/index.js +0 -0
- /package/{models → lib/models}/Group/Analytics/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Analytics/types.js +0 -0
- /package/{models → lib/models}/Group/Event/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Event/index.js +0 -0
- /package/{models → lib/models}/Group/Event/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Event/types.js +0 -0
- /package/{models → lib/models}/Group/Player/Event/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/Event/index.js +0 -0
- /package/{models → lib/models}/Group/Player/Event/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/Event/types.js +0 -0
- /package/{models → lib/models}/Group/Player/Log/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/Log/index.js +0 -0
- /package/{models → lib/models}/Group/Player/Log/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/Log/types.js +0 -0
- /package/{models → lib/models}/Group/Player/index.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/index.js +0 -0
- /package/{models → lib/models}/Group/Player/types.d.ts +0 -0
- /package/{models → lib/models}/Group/Player/types.js +0 -0
- /package/{models → lib/models}/Group/basic.d.ts +0 -0
- /package/{models → lib/models}/Group/basic.js +0 -0
- /package/{models → lib/models}/Group/types.js +0 -0
- /package/{models → lib/models}/Instrument/index.d.ts +0 -0
- /package/{models → lib/models}/Instrument/index.js +0 -0
- /package/{models → lib/models}/Metrics/index.d.ts +0 -0
- /package/{models → lib/models}/Metrics/index.js +0 -0
- /package/{models → lib/models}/Metrics/types.d.ts +0 -0
- /package/{models/Group/Repertory → lib/models/Metrics}/types.js +0 -0
- /package/{models → lib/models}/Model.d.ts +0 -0
- /package/{models → lib/models}/Model.js +0 -0
- /package/{models → lib/models}/MusicStyle/index.d.ts +0 -0
- /package/{models → lib/models}/MusicStyle/index.js +0 -0
- /package/{models → lib/models}/Notification/index.d.ts +0 -0
- /package/{models → lib/models}/Notification/index.js +0 -0
- /package/{models → lib/models}/Notification/types.d.ts +0 -0
- /package/{models → lib/models}/Notification/types.js +0 -0
- /package/{models → lib/models}/Partner/basic.d.ts +0 -0
- /package/{models → lib/models}/Partner/basic.js +0 -0
- /package/{models → lib/models}/Partner/index.d.ts +0 -0
- /package/{models → lib/models}/Partner/index.js +0 -0
- /package/{models → lib/models}/Partner/tiny.d.ts +0 -0
- /package/{models → lib/models}/Partner/tiny.js +0 -0
- /package/{models → lib/models}/Partner/types.d.ts +0 -0
- /package/{models → lib/models}/Partner/types.js +0 -0
- /package/{models → lib/models}/Partnership/Group/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Group/index.js +0 -0
- /package/{models → lib/models}/Partnership/Group/types.d.ts +0 -0
- /package/{models/Metrics → lib/models/Partnership/Group}/types.js +0 -0
- /package/{models → lib/models}/Partnership/Partner/Subscription/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Partner/Subscription/index.js +0 -0
- /package/{models → lib/models}/Partnership/Partner/Subscription/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Partner/Subscription/types.js +0 -0
- /package/{models → lib/models}/Partnership/Partner/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Partner/index.js +0 -0
- /package/{models → lib/models}/Partnership/Partner/types.d.ts +0 -0
- /package/{models/Partnership/Group → lib/models/Partnership/Partner}/types.js +0 -0
- /package/{models → lib/models}/Partnership/Payment/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Payment/index.js +0 -0
- /package/{models → lib/models}/Partnership/Payment/types.d.ts +0 -0
- /package/{models/Partnership/Partner → lib/models/Partnership/Payment}/types.js +0 -0
- /package/{models → lib/models}/Partnership/Plan/basic.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Plan/basic.js +0 -0
- /package/{models → lib/models}/Partnership/Plan/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Plan/index.js +0 -0
- /package/{models → lib/models}/Partnership/Plan/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/Plan/types.js +0 -0
- /package/{models → lib/models}/Partnership/basic.d.ts +0 -0
- /package/{models → lib/models}/Partnership/basic.js +0 -0
- /package/{models → lib/models}/Partnership/index.d.ts +0 -0
- /package/{models → lib/models}/Partnership/index.js +0 -0
- /package/{models → lib/models}/Partnership/types.d.ts +0 -0
- /package/{models → lib/models}/Partnership/types.js +0 -0
- /package/{models → lib/models}/Payment/basic.d.ts +0 -0
- /package/{models → lib/models}/Payment/basic.js +0 -0
- /package/{models → lib/models}/Payment/index.d.ts +0 -0
- /package/{models → lib/models}/Payment/index.js +0 -0
- /package/{models → lib/models}/Payment/types.d.ts +0 -0
- /package/{models → lib/models}/Payment/types.js +0 -0
- /package/{models → lib/models}/Player/basic.d.ts +0 -0
- /package/{models → lib/models}/Player/basic.js +0 -0
- /package/{models → lib/models}/Player/types.d.ts +0 -0
- /package/{models/Partnership/Payment → lib/models/Player}/types.js +0 -0
- /package/{models → lib/models}/Repertory/basic.d.ts +0 -0
- /package/{models → lib/models}/Repertory/basic.js +0 -0
- /package/{models → lib/models}/Repertory/types.d.ts +0 -0
- /package/{models/Player → lib/models/Repertory}/types.js +0 -0
- /package/{models → lib/models}/User/Group/index.d.ts +0 -0
- /package/{models → lib/models}/User/Group/index.js +0 -0
- /package/{models → lib/models}/User/Group/types.d.ts +0 -0
- /package/{models/Repertory → lib/models/User/Group}/types.js +0 -0
- /package/{models → lib/models}/User/Notification/index.d.ts +0 -0
- /package/{models → lib/models}/User/Notification/index.js +0 -0
- /package/{models → lib/models}/User/Notification/types.d.ts +0 -0
- /package/{models/User/Group → lib/models/User/Notification}/types.js +0 -0
- /package/{models → lib/models}/User/basic.d.ts +0 -0
- /package/{models → lib/models}/User/basic.js +0 -0
- /package/{models → lib/models}/User/index.d.ts +0 -0
- /package/{models → lib/models}/User/index.js +0 -0
- /package/{models → lib/models}/User/types.d.ts +0 -0
- /package/{models → lib/models}/User/types.js +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Glissandoo Library
|
|
2
|
+
|
|
3
|
+
## What is this repository for?
|
|
4
|
+
|
|
5
|
+
- This repo contains a common model codebase that all Glissandoo projects can use.
|
|
6
|
+
|
|
7
|
+
## Configuration
|
|
8
|
+
|
|
9
|
+
- This project should work with any Node.js version >= 12 and uses NPM to manage dependencies.
|
|
10
|
+
- To install Node.js, we recommend using NVM, which is a Node.js version manager, and can be installed with the following command:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- Once installed, restart your terminal and you will be able to use the following command to install the desired Node.js version:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
nvm install {version}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- To activate a certain Node.js version, you can use the following command:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
nvm use {version}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Then, install dependencies with the following command:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Developing locally
|
|
35
|
+
|
|
36
|
+
### 0. (Optional) Create a VS Code workspace including lib:
|
|
37
|
+
|
|
38
|
+
- Open your existing project with VS Code. Then, in the upper left menu, go to File > Add Folder to Workspace, and choose the lib repo folder.
|
|
39
|
+
|
|
40
|
+
- Then, in the same menu as before, go to File > Save Workspace As... and save your workspace wherever you like.
|
|
41
|
+
|
|
42
|
+
- Now, you will be able to work in both your current project and the lib repo in the same workspace.
|
|
43
|
+
|
|
44
|
+
### 1. NPM-Link lib to your project:
|
|
45
|
+
|
|
46
|
+
- There is a way to link your local lib project to your current project, so any changes made to your local lib repo will automatically be reflected in your current project.
|
|
47
|
+
|
|
48
|
+
- To do this, open a terminal and go to the lib repo folder. Then, run the following command:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm run link
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This will create a symlink to your lib repo globally.
|
|
55
|
+
|
|
56
|
+
- Now, to tell your project to use the symlink, go to your project folder and run the following command:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm link @glissandoo/lib
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- Now, your project will use the ts-compiled folder of the lib repo as its dependency, but there is one more step left.
|
|
63
|
+
|
|
64
|
+
- Since we use TypeScript, we would need to compile lib for every change we made to it, but we can automate this process by opening a terminal, going into the lib repo folder and keeping the following command running:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run build:watch
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This will compile lib for every change you make to it, so that changes automatically get reflected in your current project.
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { InstrumentId } from '../helpers/instruments';
|
|
2
|
-
import { GroupRepertoryTagAlgoliaData } from '../models/Group/Repertory/types';
|
|
2
|
+
import { GroupRepertoireFile, GroupRepertoireVisibility, GroupRepertoryTagAlgoliaData } from '../models/Group/Repertory/types';
|
|
3
3
|
import { ThemeMediaType } from '../models/Repertory/types';
|
|
4
4
|
export declare namespace GroupRepertoryFbFunctionsTypes {
|
|
5
5
|
interface GroupRepertoryPublishEditParams {
|
|
6
6
|
themeId: string;
|
|
7
7
|
groupId: string;
|
|
8
8
|
title: string;
|
|
9
|
-
scoresByInstruments: boolean;
|
|
10
|
-
isFileIdentify: boolean;
|
|
11
|
-
mainFilePath: string | null;
|
|
12
9
|
compositor: string | null;
|
|
13
10
|
media: ThemeMediaType | null;
|
|
14
11
|
tags: string[] | null;
|
|
15
12
|
tagsAlgolia: GroupRepertoryTagAlgoliaData[] | null;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
id: InstrumentId;
|
|
19
|
-
pages: number[];
|
|
20
|
-
filesPath: string[];
|
|
21
|
-
}> | null;
|
|
13
|
+
files: Record<string, GroupRepertoireFile>;
|
|
14
|
+
visibility: GroupRepertoireVisibility;
|
|
22
15
|
}
|
|
23
16
|
export type PublishParams = GroupRepertoryPublishEditParams;
|
|
24
17
|
export type PublishResult = void;
|
|
@@ -4,3 +4,6 @@ import { Descendant } from './slate';
|
|
|
4
4
|
export declare const replaceVarsBrackets: (string: string, values: MetaNotificationData) => string;
|
|
5
5
|
export declare const replaceKeysNotification: (string: string, values: MetaNotificationData, lang: LanguagesTypes) => string;
|
|
6
6
|
export declare const serializeSlateBlock: (nodes: Descendant[]) => string;
|
|
7
|
+
export declare const objToArray: <T>(obj: Record<string, T>) => (T & {
|
|
8
|
+
id: string;
|
|
9
|
+
})[];
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.serializeSlateBlock = exports.replaceKeysNotification = exports.replaceVarsBrackets = void 0;
|
|
17
|
+
exports.objToArray = exports.serializeSlateBlock = exports.replaceKeysNotification = exports.replaceVarsBrackets = void 0;
|
|
18
18
|
const date_fns_1 = require("date-fns");
|
|
19
19
|
const date_fns_tz_1 = require("date-fns-tz");
|
|
20
20
|
const get_1 = __importDefault(require("lodash/get"));
|
|
@@ -96,3 +96,7 @@ const serializeSlateBlock = (nodes) => {
|
|
|
96
96
|
.join(' ');
|
|
97
97
|
};
|
|
98
98
|
exports.serializeSlateBlock = serializeSlateBlock;
|
|
99
|
+
const objToArray = (obj) => {
|
|
100
|
+
return Object.keys(obj).map((key) => (Object.assign(Object.assign({}, obj[key]), { id: key })));
|
|
101
|
+
};
|
|
102
|
+
exports.objToArray = objToArray;
|
|
@@ -3,18 +3,26 @@ import { InstrumentId } from '../../../helpers/instruments';
|
|
|
3
3
|
import { LanguagesTypes } from '../../../lang';
|
|
4
4
|
import EventoTiny from '../../Evento/tiny';
|
|
5
5
|
import Theme from '../../Repertory/basic';
|
|
6
|
-
import { AGroupRepertoryClaim, GroupRepertoryData } from './types';
|
|
6
|
+
import { AGroupRepertoryClaim, GroupRepertoireSectionId as SectionId, GroupRepertoireVisibility, GroupRepertoryData } from './types';
|
|
7
7
|
export default class GroupRepertory extends Theme<GroupRepertoryData> {
|
|
8
8
|
private lang;
|
|
9
9
|
constructor(doc: firestore.DocumentSnapshot, lang?: LanguagesTypes);
|
|
10
10
|
get groupId(): string;
|
|
11
11
|
get tagsAlgolia(): import("./types").GroupRepertoryTagAlgoliaData[];
|
|
12
|
+
/** @deprecated use sections */
|
|
12
13
|
get instruments(): {
|
|
13
14
|
filesPath: string[] | undefined;
|
|
14
15
|
id: InstrumentId;
|
|
15
16
|
pages: number[];
|
|
16
17
|
}[];
|
|
18
|
+
get files(): Record<string, import("./types").GroupRepertoireFile>;
|
|
19
|
+
get fileList(): (import("./types").GroupRepertoireFile & {
|
|
20
|
+
id: string;
|
|
21
|
+
})[];
|
|
22
|
+
get sections(): SectionId[];
|
|
23
|
+
/** @deprecated use sections */
|
|
17
24
|
get mainFilePath(): string | null;
|
|
25
|
+
get visibility(): GroupRepertoireVisibility;
|
|
18
26
|
get votes(): Record<string, number>;
|
|
19
27
|
get votesCount(): number;
|
|
20
28
|
voteByUserId(userId: string): number | null;
|
|
@@ -26,32 +34,27 @@ export default class GroupRepertory extends Theme<GroupRepertoryData> {
|
|
|
26
34
|
get nextEvents(): EventoTiny[];
|
|
27
35
|
/** @deprecated use getNextEvent */
|
|
28
36
|
get nextEvent(): EventoTiny | null;
|
|
37
|
+
/** @deprecated use sections */
|
|
29
38
|
get scoresByInstruments(): boolean;
|
|
30
39
|
get editedAt(): firestore.Timestamp | null;
|
|
31
40
|
get createdAt(): firestore.Timestamp;
|
|
41
|
+
/** @deprecated use sections */
|
|
32
42
|
get audios(): string[];
|
|
43
|
+
/** @deprecated use sections */
|
|
33
44
|
get identifyAt(): firestore.Timestamp | null;
|
|
45
|
+
/** @deprecated use sections */
|
|
34
46
|
get isIdentify(): boolean;
|
|
35
47
|
get isActive(): boolean;
|
|
36
48
|
get thumbnailURL(): string | null;
|
|
37
49
|
get ownerId(): string;
|
|
38
50
|
get lastEventDatetime(): firestore.Timestamp | null;
|
|
39
|
-
/** @deprecated */
|
|
40
|
-
get viewers(): Record<string, import("./types").GroupRepertoryViewer>;
|
|
41
|
-
/** @deprecated */
|
|
42
|
-
get listViewers(): (import("./types").GroupRepertoryViewer & {
|
|
43
|
-
id: string;
|
|
44
|
-
})[];
|
|
45
|
-
/** @deprecated */
|
|
46
|
-
get totalViews(): number;
|
|
47
51
|
get claims(): Record<string, Record<string, import("./types").GroupRepertoryClaimType>>;
|
|
48
52
|
get claimsList(): AGroupRepertoryClaim[];
|
|
49
53
|
claimsByInstrument(instrumentId: string): Record<string, import("./types").GroupRepertoryClaimType>;
|
|
50
54
|
getPlayersByInstrumentClaimed(instrumentId: string, onlyNoNotified?: boolean): string[];
|
|
51
55
|
isInstrumentClaimed(instrumentId: string): boolean;
|
|
52
56
|
isInstrumentClaimedByPlayer(instrumentId: InstrumentId, userId: string): boolean;
|
|
53
|
-
/** @deprecated */
|
|
54
|
-
getViewer(userId: string): import("./types").GroupRepertoryViewer | null;
|
|
57
|
+
/** @deprecated use sections */
|
|
55
58
|
getInstrument(id: string): {
|
|
56
59
|
filesPath: string[] | undefined;
|
|
57
60
|
id: InstrumentId;
|
|
@@ -5,11 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const endOfDay_1 = __importDefault(require("date-fns/endOfDay"));
|
|
7
7
|
const isFuture_1 = __importDefault(require("date-fns/isFuture"));
|
|
8
|
+
const lodash_1 = require("lodash");
|
|
8
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
9
10
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
11
|
+
const utils_1 = require("../../../helpers/utils");
|
|
10
12
|
const lang_1 = require("../../../lang");
|
|
11
13
|
const tiny_1 = __importDefault(require("../../Evento/tiny"));
|
|
12
14
|
const basic_1 = __importDefault(require("../../Repertory/basic"));
|
|
15
|
+
const types_1 = require("./types");
|
|
13
16
|
class GroupRepertory extends basic_1.default {
|
|
14
17
|
constructor(doc, lang = lang_1.defaultLocale) {
|
|
15
18
|
super(doc);
|
|
@@ -22,13 +25,27 @@ class GroupRepertory extends basic_1.default {
|
|
|
22
25
|
get tagsAlgolia() {
|
|
23
26
|
return this.data.tagsAlgolia || [];
|
|
24
27
|
}
|
|
28
|
+
/** @deprecated use sections */
|
|
25
29
|
get instruments() {
|
|
26
30
|
const instruments = this.data.instruments || [];
|
|
27
31
|
return instruments.map((instrument) => (Object.assign(Object.assign({}, instrument), { filesPath: instrument.filesPath })));
|
|
28
32
|
}
|
|
33
|
+
get files() {
|
|
34
|
+
return this.data.files || {};
|
|
35
|
+
}
|
|
36
|
+
get fileList() {
|
|
37
|
+
return utils_1.objToArray(this.files);
|
|
38
|
+
}
|
|
39
|
+
get sections() {
|
|
40
|
+
return lodash_1.uniq(lodash_1.flatten(this.fileList.map((file) => Object.keys(file.sections))));
|
|
41
|
+
}
|
|
42
|
+
/** @deprecated use sections */
|
|
29
43
|
get mainFilePath() {
|
|
30
44
|
return this.data.mainFilePath;
|
|
31
45
|
}
|
|
46
|
+
get visibility() {
|
|
47
|
+
return this.data.visibility || types_1.GroupRepertoireVisibility.ByEvent;
|
|
48
|
+
}
|
|
32
49
|
get votes() {
|
|
33
50
|
return this.data.votes || {};
|
|
34
51
|
}
|
|
@@ -64,6 +81,7 @@ class GroupRepertory extends basic_1.default {
|
|
|
64
81
|
}
|
|
65
82
|
return this.nextEvents[this.nextEvents.length - 1];
|
|
66
83
|
}
|
|
84
|
+
/** @deprecated use sections */
|
|
67
85
|
get scoresByInstruments() {
|
|
68
86
|
return this.data.scoresByInstruments || false;
|
|
69
87
|
}
|
|
@@ -73,12 +91,15 @@ class GroupRepertory extends basic_1.default {
|
|
|
73
91
|
get createdAt() {
|
|
74
92
|
return this.data.createdAt;
|
|
75
93
|
}
|
|
94
|
+
/** @deprecated use sections */
|
|
76
95
|
get audios() {
|
|
77
96
|
return this.data.audios || [];
|
|
78
97
|
}
|
|
98
|
+
/** @deprecated use sections */
|
|
79
99
|
get identifyAt() {
|
|
80
100
|
return this.data.identifyAt;
|
|
81
101
|
}
|
|
102
|
+
/** @deprecated use sections */
|
|
82
103
|
get isIdentify() {
|
|
83
104
|
return this.identifyAt !== null || this.identifyAt !== undefined;
|
|
84
105
|
}
|
|
@@ -94,20 +115,6 @@ class GroupRepertory extends basic_1.default {
|
|
|
94
115
|
get lastEventDatetime() {
|
|
95
116
|
return this.data.lastEventDatetime || null;
|
|
96
117
|
}
|
|
97
|
-
/** @deprecated */
|
|
98
|
-
get viewers() {
|
|
99
|
-
return this.data.viewers || {};
|
|
100
|
-
}
|
|
101
|
-
/** @deprecated */
|
|
102
|
-
get listViewers() {
|
|
103
|
-
return Object.keys(this.viewers).map((userId) => Object.assign(this.viewers[userId], { id: userId }));
|
|
104
|
-
}
|
|
105
|
-
/** @deprecated */
|
|
106
|
-
get totalViews() {
|
|
107
|
-
return this.listViewers
|
|
108
|
-
.map((viewer) => viewer.count || 0)
|
|
109
|
-
.reduce((acc, current) => acc + current);
|
|
110
|
-
}
|
|
111
118
|
get claims() {
|
|
112
119
|
return this.data.claims || {};
|
|
113
120
|
}
|
|
@@ -142,10 +149,7 @@ class GroupRepertory extends basic_1.default {
|
|
|
142
149
|
}
|
|
143
150
|
return userId in this.claims[instrumentId];
|
|
144
151
|
}
|
|
145
|
-
/** @deprecated */
|
|
146
|
-
getViewer(userId) {
|
|
147
|
-
return userId in this.viewers ? this.viewers[userId] : null;
|
|
148
|
-
}
|
|
152
|
+
/** @deprecated use sections */
|
|
149
153
|
getInstrument(id) {
|
|
150
154
|
return this.instruments.find((i) => i.id === id);
|
|
151
155
|
}
|
|
@@ -2,6 +2,10 @@ import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
|
2
2
|
import { InstrumentId } from '../../../helpers/instruments';
|
|
3
3
|
import { EventTinyData } from '../../Evento/types';
|
|
4
4
|
import { ThemeBasicData } from '../../Repertory/types';
|
|
5
|
+
export declare enum GroupRepertoireVisibility {
|
|
6
|
+
Always = "always",
|
|
7
|
+
ByEvent = "byEvent"
|
|
8
|
+
}
|
|
5
9
|
export interface AGroupRepertoryClaim extends GroupRepertoryClaimType {
|
|
6
10
|
userId: string;
|
|
7
11
|
instrumentId: InstrumentId;
|
|
@@ -24,21 +28,46 @@ export interface GroupRepertoryInstrumentItemData {
|
|
|
24
28
|
pages: number[];
|
|
25
29
|
filesPath?: string[];
|
|
26
30
|
}
|
|
31
|
+
export declare type GroupRepertoireSectionId = InstrumentId | 'all';
|
|
32
|
+
export interface GroupRepertoireScoreFilePage {
|
|
33
|
+
tags: string[];
|
|
34
|
+
}
|
|
35
|
+
export interface AGroupRepertoireScoreFilePage extends GroupRepertoireScoreFilePage {
|
|
36
|
+
id: GroupRepertoireSectionId;
|
|
37
|
+
}
|
|
38
|
+
export interface GroupRepertoireFileSections {
|
|
39
|
+
tags?: string[];
|
|
40
|
+
pages?: Record<number, GroupRepertoireScoreFilePage>;
|
|
41
|
+
}
|
|
42
|
+
export interface GroupRepertoireFile {
|
|
43
|
+
readonly path: string;
|
|
44
|
+
readonly filetype: string;
|
|
45
|
+
readonly uploadedAt: number;
|
|
46
|
+
readonly pageCount: number | null;
|
|
47
|
+
readonly isEncrypted: boolean;
|
|
48
|
+
identifyAt: number | null;
|
|
49
|
+
sections: Partial<Record<GroupRepertoireSectionId, GroupRepertoireFileSections>>;
|
|
50
|
+
}
|
|
27
51
|
export interface GroupRepertoryData extends ThemeBasicData {
|
|
28
52
|
events: string[];
|
|
29
53
|
eventsTL: Record<string, EventTinyData>;
|
|
30
54
|
tagsAlgolia: GroupRepertoryTagAlgoliaData[];
|
|
55
|
+
/** @deprecated */
|
|
31
56
|
mainFilePath: string | null;
|
|
57
|
+
/** @deprecated */
|
|
32
58
|
scoresByInstruments: boolean;
|
|
59
|
+
/** @deprecated */
|
|
33
60
|
instruments: GroupRepertoryInstrumentItemData[];
|
|
34
|
-
|
|
61
|
+
/** @deprecated */
|
|
35
62
|
audios: string[];
|
|
36
|
-
|
|
63
|
+
/** @deprecated */
|
|
37
64
|
identifyAt: Timestamp | null;
|
|
65
|
+
files: Record<string, GroupRepertoireFile>;
|
|
66
|
+
votes: Record<string, number>;
|
|
67
|
+
thumbnailURL: string | null;
|
|
38
68
|
editedAt: Timestamp | null;
|
|
69
|
+
visibility: GroupRepertoireVisibility;
|
|
39
70
|
lastEventDatetime: Timestamp | null;
|
|
40
|
-
/** @deprecated */
|
|
41
|
-
viewers: Record<string, GroupRepertoryViewer>;
|
|
42
71
|
claims: Record<string, Record<string, GroupRepertoryClaimType>>;
|
|
43
72
|
clonedFrom: DocumentReference | null;
|
|
44
73
|
readonly owner: DocumentReference;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupRepertoireVisibility = void 0;
|
|
4
|
+
var GroupRepertoireVisibility;
|
|
5
|
+
(function (GroupRepertoireVisibility) {
|
|
6
|
+
GroupRepertoireVisibility["Always"] = "always";
|
|
7
|
+
GroupRepertoireVisibility["ByEvent"] = "byEvent";
|
|
8
|
+
})(GroupRepertoireVisibility = exports.GroupRepertoireVisibility || (exports.GroupRepertoireVisibility = {}));
|
|
@@ -27,9 +27,13 @@ export default class Group extends GroupBasic<GroupData> {
|
|
|
27
27
|
get communicationCount(): number;
|
|
28
28
|
get country(): string;
|
|
29
29
|
get activePlayers(): string[];
|
|
30
|
-
get playersList():
|
|
30
|
+
get playersList(): {
|
|
31
31
|
id: string;
|
|
32
|
-
|
|
32
|
+
mainInstrument: import("../../helpers/instruments").InstrumentId;
|
|
33
|
+
username: string;
|
|
34
|
+
displayName: string;
|
|
35
|
+
photoURL: string;
|
|
36
|
+
}[];
|
|
33
37
|
get isActive(): boolean;
|
|
34
38
|
get isDeleted(): boolean;
|
|
35
39
|
get intercomId(): string | null;
|
|
@@ -37,9 +41,9 @@ export default class Group extends GroupBasic<GroupData> {
|
|
|
37
41
|
get socialNetworks(): Record<SocialNetwork, string | null>;
|
|
38
42
|
getSocialNetworkUrl(id: SocialNetwork): string | null;
|
|
39
43
|
get config(): Record<import("./types").GroupConfig, boolean>;
|
|
40
|
-
get templates(): Record<string, import("./types").GroupTemplateData>;
|
|
41
44
|
get status(): GroupStatus;
|
|
42
45
|
get planId(): PlansGroup;
|
|
46
|
+
get templates(): Record<string, import("./types").GroupTemplateData>;
|
|
43
47
|
get templatesList(): (import("./types").GroupTemplateData & {
|
|
44
48
|
id: string;
|
|
45
49
|
})[];
|
|
@@ -57,4 +61,8 @@ export default class Group extends GroupBasic<GroupData> {
|
|
|
57
61
|
id: string;
|
|
58
62
|
})[];
|
|
59
63
|
get firstAnswerAt(): FirebaseFirestore.Timestamp | null;
|
|
64
|
+
get repertoireTags(): Record<string, import("./types").GroupRepertoireTag>;
|
|
65
|
+
get repertoireTagsList(): (import("./types").GroupRepertoireTag & {
|
|
66
|
+
id: string;
|
|
67
|
+
})[];
|
|
60
68
|
}
|
|
@@ -7,6 +7,7 @@ const date_fns_1 = require("date-fns");
|
|
|
7
7
|
const lodash_1 = require("lodash");
|
|
8
8
|
const orders_1 = require("../../helpers/musicStyles/orders");
|
|
9
9
|
const plans_1 = require("../../helpers/plans");
|
|
10
|
+
const utils_1 = require("../../helpers/utils");
|
|
10
11
|
const lang_1 = require("../../lang");
|
|
11
12
|
const basic_1 = __importDefault(require("./basic"));
|
|
12
13
|
const types_1 = require("./types");
|
|
@@ -90,7 +91,7 @@ class Group extends basic_1.default {
|
|
|
90
91
|
return Object.keys(this.players);
|
|
91
92
|
}
|
|
92
93
|
get playersList() {
|
|
93
|
-
const players = this.activePlayers.map((playerId) => Object.assign({}, this.players[playerId], { id: playerId }));
|
|
94
|
+
const players = this.activePlayers.map((playerId) => (Object.assign(Object.assign({}, this.players[playerId]), { id: playerId })));
|
|
94
95
|
return orders_1.orderByMusicStyle(players, 'mainInstrument', this.musicStyle);
|
|
95
96
|
}
|
|
96
97
|
get isActive() {
|
|
@@ -125,17 +126,17 @@ class Group extends basic_1.default {
|
|
|
125
126
|
get config() {
|
|
126
127
|
return this.data.config || {};
|
|
127
128
|
}
|
|
128
|
-
get templates() {
|
|
129
|
-
return this.data.templates || {};
|
|
130
|
-
}
|
|
131
129
|
get status() {
|
|
132
130
|
return this.data.status;
|
|
133
131
|
}
|
|
134
132
|
get planId() {
|
|
135
133
|
return this.data.planId;
|
|
136
134
|
}
|
|
135
|
+
get templates() {
|
|
136
|
+
return this.data.templates || {};
|
|
137
|
+
}
|
|
137
138
|
get templatesList() {
|
|
138
|
-
return
|
|
139
|
+
return utils_1.objToArray(this.templates);
|
|
139
140
|
}
|
|
140
141
|
get satisfactionIndex() {
|
|
141
142
|
return this.data.satisfactionIndex || { current: 0, last: 0 };
|
|
@@ -153,10 +154,16 @@ class Group extends basic_1.default {
|
|
|
153
154
|
return this.data.stageTemplates || {};
|
|
154
155
|
}
|
|
155
156
|
get stageTemplatesList() {
|
|
156
|
-
return
|
|
157
|
+
return utils_1.objToArray(this.stageTemplates);
|
|
157
158
|
}
|
|
158
159
|
get firstAnswerAt() {
|
|
159
160
|
return this.data.firstAnswerAt || null;
|
|
160
161
|
}
|
|
162
|
+
get repertoireTags() {
|
|
163
|
+
return this.data.repertoireTags || {};
|
|
164
|
+
}
|
|
165
|
+
get repertoireTagsList() {
|
|
166
|
+
return utils_1.objToArray(this.repertoireTags);
|
|
167
|
+
}
|
|
161
168
|
}
|
|
162
169
|
exports.default = Group;
|
|
@@ -63,6 +63,13 @@ export interface GroupBasicData extends GroupTinyData {
|
|
|
63
63
|
locality: string;
|
|
64
64
|
location: GeoPoint;
|
|
65
65
|
}
|
|
66
|
+
export interface GroupRepertoireTag {
|
|
67
|
+
title: string;
|
|
68
|
+
default: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface AGroupRepertoireTag extends GroupRepertoireTag {
|
|
71
|
+
id: string;
|
|
72
|
+
}
|
|
66
73
|
export interface GroupData extends GroupBasicData {
|
|
67
74
|
playerIds: string[];
|
|
68
75
|
players: Record<string, PlayerBasicData>;
|
|
@@ -92,6 +99,7 @@ export interface GroupData extends GroupBasicData {
|
|
|
92
99
|
stageTemplates: Record<string, StageTemplate>;
|
|
93
100
|
metadata: Record<string, string>;
|
|
94
101
|
firstAnswerAt: Timestamp | null;
|
|
102
|
+
repertoireTags: Record<string, GroupRepertoireTag>;
|
|
95
103
|
readonly owner: DocumentReference;
|
|
96
104
|
readonly createdAt: Timestamp;
|
|
97
105
|
}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|