@glissandoo/lib 1.14.1 → 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.
Files changed (255) hide show
  1. package/.husky/pre-commit +4 -0
  2. package/README.md +70 -0
  3. package/{functions → lib/functions}/groupRepertory.d.ts +17 -10
  4. package/{functions → lib/functions}/index.d.ts +1 -0
  5. package/{functions → lib/functions}/index.js +1 -0
  6. package/{functions → lib/functions}/regions.js +1 -0
  7. package/{helpers → lib/helpers}/utils.d.ts +3 -0
  8. package/{helpers → lib/helpers}/utils.js +5 -1
  9. package/{models → lib/models}/Group/Repertory/index.d.ts +14 -11
  10. package/{models → lib/models}/Group/Repertory/index.js +22 -18
  11. package/{models → lib/models}/Group/Repertory/types.d.ts +33 -4
  12. package/lib/models/Group/Repertory/types.js +8 -0
  13. package/{models → lib/models}/Group/index.d.ts +11 -3
  14. package/{models → lib/models}/Group/index.js +13 -6
  15. package/{models → lib/models}/Group/types.d.ts +8 -0
  16. package/package.json +1 -1
  17. package/functions/payments.d.ts +0 -12
  18. package/functions/payments.js +0 -2
  19. package/functions/stripe.d.ts +0 -12
  20. package/functions/stripe.js +0 -2
  21. package/models/User/Notification/types.js +0 -2
  22. /package/{functions → lib/functions}/auth.d.ts +0 -0
  23. /package/{functions → lib/functions}/auth.js +0 -0
  24. /package/{functions → lib/functions}/communication.d.ts +0 -0
  25. /package/{functions → lib/functions}/communication.js +0 -0
  26. /package/{functions → lib/functions}/communicationComment.d.ts +0 -0
  27. /package/{functions → lib/functions}/communicationComment.js +0 -0
  28. /package/{functions → lib/functions}/event.d.ts +0 -0
  29. /package/{functions → lib/functions}/event.js +0 -0
  30. /package/{functions → lib/functions}/eventPlayer.d.ts +0 -0
  31. /package/{functions → lib/functions}/eventPlayer.js +0 -0
  32. /package/{functions → lib/functions}/eventRepertory.d.ts +0 -0
  33. /package/{functions → lib/functions}/eventRepertory.js +0 -0
  34. /package/{functions → lib/functions}/federation.d.ts +0 -0
  35. /package/{functions → lib/functions}/federation.js +0 -0
  36. /package/{functions → lib/functions}/federationPartnership.d.ts +0 -0
  37. /package/{functions → lib/functions}/federationPartnership.js +0 -0
  38. /package/{functions → lib/functions}/group.d.ts +0 -0
  39. /package/{functions → lib/functions}/group.js +0 -0
  40. /package/{functions → lib/functions}/groupPlayer.d.ts +0 -0
  41. /package/{functions → lib/functions}/groupPlayer.js +0 -0
  42. /package/{functions → lib/functions}/groupRepertory.js +0 -0
  43. /package/{functions → lib/functions}/jwt.d.ts +0 -0
  44. /package/{functions → lib/functions}/jwt.js +0 -0
  45. /package/{functions → lib/functions}/misc.d.ts +0 -0
  46. /package/{functions → lib/functions}/misc.js +0 -0
  47. /package/{functions → lib/functions}/notification.d.ts +0 -0
  48. /package/{functions → lib/functions}/notification.js +0 -0
  49. /package/{functions → lib/functions}/partner.d.ts +0 -0
  50. /package/{functions → lib/functions}/partner.js +0 -0
  51. /package/{functions → lib/functions}/partnership.d.ts +0 -0
  52. /package/{functions → lib/functions}/partnership.js +0 -0
  53. /package/{functions → lib/functions}/partnershipGroup.d.ts +0 -0
  54. /package/{functions → lib/functions}/partnershipGroup.js +0 -0
  55. /package/{functions → lib/functions}/partnershipPlan.d.ts +0 -0
  56. /package/{functions → lib/functions}/partnershipPlan.js +0 -0
  57. /package/{functions → lib/functions}/regions.d.ts +0 -0
  58. /package/{functions → lib/functions}/subscription.d.ts +0 -0
  59. /package/{functions → lib/functions}/subscription.js +0 -0
  60. /package/{functions → lib/functions}/user.d.ts +0 -0
  61. /package/{functions → lib/functions}/user.js +0 -0
  62. /package/{helpers → lib/helpers}/appScenes.d.ts +0 -0
  63. /package/{helpers → lib/helpers}/appScenes.js +0 -0
  64. /package/{helpers → lib/helpers}/auth.d.ts +0 -0
  65. /package/{helpers → lib/helpers}/auth.js +0 -0
  66. /package/{helpers → lib/helpers}/badges.d.ts +0 -0
  67. /package/{helpers → lib/helpers}/badges.js +0 -0
  68. /package/{helpers → lib/helpers}/collections.d.ts +0 -0
  69. /package/{helpers → lib/helpers}/collections.js +0 -0
  70. /package/{helpers → lib/helpers}/dlinks.d.ts +0 -0
  71. /package/{helpers → lib/helpers}/dlinks.js +0 -0
  72. /package/{helpers → lib/helpers}/errors.d.ts +0 -0
  73. /package/{helpers → lib/helpers}/errors.js +0 -0
  74. /package/{helpers → lib/helpers}/instruments/index.d.ts +0 -0
  75. /package/{helpers → lib/helpers}/instruments/index.js +0 -0
  76. /package/{helpers → lib/helpers}/musicStyles/index.d.ts +0 -0
  77. /package/{helpers → lib/helpers}/musicStyles/index.js +0 -0
  78. /package/{helpers → lib/helpers}/musicStyles/orders.d.ts +0 -0
  79. /package/{helpers → lib/helpers}/musicStyles/orders.js +0 -0
  80. /package/{helpers → lib/helpers}/notifications.d.ts +0 -0
  81. /package/{helpers → lib/helpers}/notifications.js +0 -0
  82. /package/{helpers → lib/helpers}/payments.d.ts +0 -0
  83. /package/{helpers → lib/helpers}/payments.js +0 -0
  84. /package/{helpers → lib/helpers}/plans.d.ts +0 -0
  85. /package/{helpers → lib/helpers}/plans.js +0 -0
  86. /package/{helpers → lib/helpers}/rates.d.ts +0 -0
  87. /package/{helpers → lib/helpers}/rates.js +0 -0
  88. /package/{helpers → lib/helpers}/reasons.d.ts +0 -0
  89. /package/{helpers → lib/helpers}/reasons.js +0 -0
  90. /package/{helpers → lib/helpers}/slate.d.ts +0 -0
  91. /package/{helpers → lib/helpers}/slate.js +0 -0
  92. /package/{helpers → lib/helpers}/styles.d.ts +0 -0
  93. /package/{helpers → lib/helpers}/styles.js +0 -0
  94. /package/{helpers → lib/helpers}/types.d.ts +0 -0
  95. /package/{helpers → lib/helpers}/types.js +0 -0
  96. /package/{index.d.ts → lib/index.d.ts} +0 -0
  97. /package/{index.js → lib/index.js} +0 -0
  98. /package/{lang → lib/lang}/ca.json +0 -0
  99. /package/{lang → lib/lang}/de.json +0 -0
  100. /package/{lang → lib/lang}/en.json +0 -0
  101. /package/{lang → lib/lang}/es.json +0 -0
  102. /package/{lang → lib/lang}/eu.json +0 -0
  103. /package/{lang → lib/lang}/gl.json +0 -0
  104. /package/{lang → lib/lang}/index.d.ts +0 -0
  105. /package/{lang → lib/lang}/index.js +0 -0
  106. /package/{lang → lib/lang}/pt.json +0 -0
  107. /package/{models → lib/models}/Communication/Comment/index.d.ts +0 -0
  108. /package/{models → lib/models}/Communication/Comment/index.js +0 -0
  109. /package/{models → lib/models}/Communication/Comment/types.d.ts +0 -0
  110. /package/{models → lib/models}/Communication/Comment/types.js +0 -0
  111. /package/{models → lib/models}/Communication/index.d.ts +0 -0
  112. /package/{models → lib/models}/Communication/index.js +0 -0
  113. /package/{models → lib/models}/Communication/types.d.ts +0 -0
  114. /package/{models → lib/models}/Communication/types.js +0 -0
  115. /package/{models → lib/models}/Counters/Group/Analytics/index.d.ts +0 -0
  116. /package/{models → lib/models}/Counters/Group/Analytics/index.js +0 -0
  117. /package/{models → lib/models}/Counters/Group/Analytics/types.d.ts +0 -0
  118. /package/{models → lib/models}/Counters/Group/Analytics/types.js +0 -0
  119. /package/{models → lib/models}/Counters/Group/index.d.ts +0 -0
  120. /package/{models → lib/models}/Counters/Group/index.js +0 -0
  121. /package/{models → lib/models}/Counters/Group/types.d.ts +0 -0
  122. /package/{models → lib/models}/Counters/Group/types.js +0 -0
  123. /package/{models → lib/models}/Counters/event.d.ts +0 -0
  124. /package/{models → lib/models}/Counters/event.js +0 -0
  125. /package/{models → lib/models}/Counters/index.d.ts +0 -0
  126. /package/{models → lib/models}/Counters/index.js +0 -0
  127. /package/{models → lib/models}/Counters/types.d.ts +0 -0
  128. /package/{models → lib/models}/Counters/types.js +0 -0
  129. /package/{models → lib/models}/Evento/Player/index.d.ts +0 -0
  130. /package/{models → lib/models}/Evento/Player/index.js +0 -0
  131. /package/{models → lib/models}/Evento/Player/types.d.ts +0 -0
  132. /package/{models → lib/models}/Evento/Player/types.js +0 -0
  133. /package/{models → lib/models}/Evento/Repertory/index.d.ts +0 -0
  134. /package/{models → lib/models}/Evento/Repertory/index.js +0 -0
  135. /package/{models → lib/models}/Evento/Repertory/types.d.ts +0 -0
  136. /package/{models → lib/models}/Evento/Repertory/types.js +0 -0
  137. /package/{models → lib/models}/Evento/basic.d.ts +0 -0
  138. /package/{models → lib/models}/Evento/basic.js +0 -0
  139. /package/{models → lib/models}/Evento/index.d.ts +0 -0
  140. /package/{models → lib/models}/Evento/index.js +0 -0
  141. /package/{models → lib/models}/Evento/promoter.d.ts +0 -0
  142. /package/{models → lib/models}/Evento/promoter.js +0 -0
  143. /package/{models → lib/models}/Evento/tiny.d.ts +0 -0
  144. /package/{models → lib/models}/Evento/tiny.js +0 -0
  145. /package/{models → lib/models}/Evento/types.d.ts +0 -0
  146. /package/{models → lib/models}/Evento/types.js +0 -0
  147. /package/{models → lib/models}/Federation/Partnership/index.d.ts +0 -0
  148. /package/{models → lib/models}/Federation/Partnership/index.js +0 -0
  149. /package/{models → lib/models}/Federation/Partnership/types.d.ts +0 -0
  150. /package/{models → lib/models}/Federation/Partnership/types.js +0 -0
  151. /package/{models → lib/models}/Federation/index.d.ts +0 -0
  152. /package/{models → lib/models}/Federation/index.js +0 -0
  153. /package/{models → lib/models}/Federation/types.d.ts +0 -0
  154. /package/{models → lib/models}/Federation/types.js +0 -0
  155. /package/{models → lib/models}/Group/Analytics/index.d.ts +0 -0
  156. /package/{models → lib/models}/Group/Analytics/index.js +0 -0
  157. /package/{models → lib/models}/Group/Analytics/types.d.ts +0 -0
  158. /package/{models → lib/models}/Group/Analytics/types.js +0 -0
  159. /package/{models → lib/models}/Group/Event/index.d.ts +0 -0
  160. /package/{models → lib/models}/Group/Event/index.js +0 -0
  161. /package/{models → lib/models}/Group/Event/types.d.ts +0 -0
  162. /package/{models → lib/models}/Group/Event/types.js +0 -0
  163. /package/{models → lib/models}/Group/Player/Event/index.d.ts +0 -0
  164. /package/{models → lib/models}/Group/Player/Event/index.js +0 -0
  165. /package/{models → lib/models}/Group/Player/Event/types.d.ts +0 -0
  166. /package/{models → lib/models}/Group/Player/Event/types.js +0 -0
  167. /package/{models → lib/models}/Group/Player/Log/index.d.ts +0 -0
  168. /package/{models → lib/models}/Group/Player/Log/index.js +0 -0
  169. /package/{models → lib/models}/Group/Player/Log/types.d.ts +0 -0
  170. /package/{models → lib/models}/Group/Player/Log/types.js +0 -0
  171. /package/{models → lib/models}/Group/Player/index.d.ts +0 -0
  172. /package/{models → lib/models}/Group/Player/index.js +0 -0
  173. /package/{models → lib/models}/Group/Player/types.d.ts +0 -0
  174. /package/{models → lib/models}/Group/Player/types.js +0 -0
  175. /package/{models → lib/models}/Group/basic.d.ts +0 -0
  176. /package/{models → lib/models}/Group/basic.js +0 -0
  177. /package/{models → lib/models}/Group/types.js +0 -0
  178. /package/{models → lib/models}/Instrument/index.d.ts +0 -0
  179. /package/{models → lib/models}/Instrument/index.js +0 -0
  180. /package/{models → lib/models}/Metrics/index.d.ts +0 -0
  181. /package/{models → lib/models}/Metrics/index.js +0 -0
  182. /package/{models → lib/models}/Metrics/types.d.ts +0 -0
  183. /package/{models/Group/Repertory → lib/models/Metrics}/types.js +0 -0
  184. /package/{models → lib/models}/Model.d.ts +0 -0
  185. /package/{models → lib/models}/Model.js +0 -0
  186. /package/{models → lib/models}/MusicStyle/index.d.ts +0 -0
  187. /package/{models → lib/models}/MusicStyle/index.js +0 -0
  188. /package/{models → lib/models}/Notification/index.d.ts +0 -0
  189. /package/{models → lib/models}/Notification/index.js +0 -0
  190. /package/{models → lib/models}/Notification/types.d.ts +0 -0
  191. /package/{models → lib/models}/Notification/types.js +0 -0
  192. /package/{models → lib/models}/Partner/basic.d.ts +0 -0
  193. /package/{models → lib/models}/Partner/basic.js +0 -0
  194. /package/{models → lib/models}/Partner/index.d.ts +0 -0
  195. /package/{models → lib/models}/Partner/index.js +0 -0
  196. /package/{models → lib/models}/Partner/tiny.d.ts +0 -0
  197. /package/{models → lib/models}/Partner/tiny.js +0 -0
  198. /package/{models → lib/models}/Partner/types.d.ts +0 -0
  199. /package/{models → lib/models}/Partner/types.js +0 -0
  200. /package/{models → lib/models}/Partnership/Group/index.d.ts +0 -0
  201. /package/{models → lib/models}/Partnership/Group/index.js +0 -0
  202. /package/{models → lib/models}/Partnership/Group/types.d.ts +0 -0
  203. /package/{models/Metrics → lib/models/Partnership/Group}/types.js +0 -0
  204. /package/{models → lib/models}/Partnership/Partner/Subscription/index.d.ts +0 -0
  205. /package/{models → lib/models}/Partnership/Partner/Subscription/index.js +0 -0
  206. /package/{models → lib/models}/Partnership/Partner/Subscription/types.d.ts +0 -0
  207. /package/{models → lib/models}/Partnership/Partner/Subscription/types.js +0 -0
  208. /package/{models → lib/models}/Partnership/Partner/index.d.ts +0 -0
  209. /package/{models → lib/models}/Partnership/Partner/index.js +0 -0
  210. /package/{models → lib/models}/Partnership/Partner/types.d.ts +0 -0
  211. /package/{models/Partnership/Group → lib/models/Partnership/Partner}/types.js +0 -0
  212. /package/{models → lib/models}/Partnership/Payment/index.d.ts +0 -0
  213. /package/{models → lib/models}/Partnership/Payment/index.js +0 -0
  214. /package/{models → lib/models}/Partnership/Payment/types.d.ts +0 -0
  215. /package/{models/Partnership/Partner → lib/models/Partnership/Payment}/types.js +0 -0
  216. /package/{models → lib/models}/Partnership/Plan/basic.d.ts +0 -0
  217. /package/{models → lib/models}/Partnership/Plan/basic.js +0 -0
  218. /package/{models → lib/models}/Partnership/Plan/index.d.ts +0 -0
  219. /package/{models → lib/models}/Partnership/Plan/index.js +0 -0
  220. /package/{models → lib/models}/Partnership/Plan/types.d.ts +0 -0
  221. /package/{models → lib/models}/Partnership/Plan/types.js +0 -0
  222. /package/{models → lib/models}/Partnership/basic.d.ts +0 -0
  223. /package/{models → lib/models}/Partnership/basic.js +0 -0
  224. /package/{models → lib/models}/Partnership/index.d.ts +0 -0
  225. /package/{models → lib/models}/Partnership/index.js +0 -0
  226. /package/{models → lib/models}/Partnership/types.d.ts +0 -0
  227. /package/{models → lib/models}/Partnership/types.js +0 -0
  228. /package/{models → lib/models}/Payment/basic.d.ts +0 -0
  229. /package/{models → lib/models}/Payment/basic.js +0 -0
  230. /package/{models → lib/models}/Payment/index.d.ts +0 -0
  231. /package/{models → lib/models}/Payment/index.js +0 -0
  232. /package/{models → lib/models}/Payment/types.d.ts +0 -0
  233. /package/{models → lib/models}/Payment/types.js +0 -0
  234. /package/{models → lib/models}/Player/basic.d.ts +0 -0
  235. /package/{models → lib/models}/Player/basic.js +0 -0
  236. /package/{models → lib/models}/Player/types.d.ts +0 -0
  237. /package/{models/Partnership/Payment → lib/models/Player}/types.js +0 -0
  238. /package/{models → lib/models}/Repertory/basic.d.ts +0 -0
  239. /package/{models → lib/models}/Repertory/basic.js +0 -0
  240. /package/{models → lib/models}/Repertory/types.d.ts +0 -0
  241. /package/{models/Player → lib/models/Repertory}/types.js +0 -0
  242. /package/{models → lib/models}/User/Group/index.d.ts +0 -0
  243. /package/{models → lib/models}/User/Group/index.js +0 -0
  244. /package/{models → lib/models}/User/Group/types.d.ts +0 -0
  245. /package/{models/Repertory → lib/models/User/Group}/types.js +0 -0
  246. /package/{models → lib/models}/User/Notification/index.d.ts +0 -0
  247. /package/{models → lib/models}/User/Notification/index.js +0 -0
  248. /package/{models → lib/models}/User/Notification/types.d.ts +0 -0
  249. /package/{models/User/Group → lib/models/User/Notification}/types.js +0 -0
  250. /package/{models → lib/models}/User/basic.d.ts +0 -0
  251. /package/{models → lib/models}/User/basic.js +0 -0
  252. /package/{models → lib/models}/User/index.d.ts +0 -0
  253. /package/{models → lib/models}/User/index.js +0 -0
  254. /package/{models → lib/models}/User/types.d.ts +0 -0
  255. /package/{models → lib/models}/User/types.js +0 -0
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
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
- audios: string[] | null;
17
- instruments: Array<{
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;
@@ -52,6 +45,20 @@ export declare namespace GroupRepertoryFbFunctionsTypes {
52
45
  score?: number;
53
46
  }
54
47
  export type IdentifyInstrumentsResult = IdentifyInstrumentItem[];
48
+ export interface IdentifyInstrumentsFromFileNamesFile {
49
+ fileName: string;
50
+ fileId: string;
51
+ }
52
+ export interface IdentifyInstrumentsFromFileNamesParams {
53
+ groupId: string;
54
+ files: IdentifyInstrumentsFromFileNamesFile[];
55
+ }
56
+ export interface IdentifyInstrumentsFromFileNamesItem {
57
+ fileId: number | string;
58
+ instrument?: InstrumentId;
59
+ score?: number;
60
+ }
61
+ export type IdentifyInstrumentsFromFileNamesResult = IdentifyInstrumentsFromFileNamesItem[];
55
62
  export interface RateParams {
56
63
  groupId: string;
57
64
  themeId: string;
@@ -56,6 +56,7 @@ export declare enum FbFunctionName {
56
56
  GroupRepertoryDownloadThemeFiles = "groupRepertory-downloadThemeFiles",
57
57
  GroupRepertoryEdit = "groupRepertory-edit",
58
58
  GroupRepertoryIdentifyInstruments = "groupRepertory-identifyInstruments",
59
+ GroupRepertoryIdentifyInstrumentsFromFileNames = "groupRepertory-identifyInstrumentsFromFileNames",
59
60
  GroupRepertoryOnCreate = "groupRepertory-onCreate",
60
61
  GroupRepertoryOnUpdate = "groupRepertory-onUpdate",
61
62
  GroupRepertoryPublish = "groupRepertory-publish",
@@ -60,6 +60,7 @@ var FbFunctionName;
60
60
  FbFunctionName["GroupRepertoryDownloadThemeFiles"] = "groupRepertory-downloadThemeFiles";
61
61
  FbFunctionName["GroupRepertoryEdit"] = "groupRepertory-edit";
62
62
  FbFunctionName["GroupRepertoryIdentifyInstruments"] = "groupRepertory-identifyInstruments";
63
+ FbFunctionName["GroupRepertoryIdentifyInstrumentsFromFileNames"] = "groupRepertory-identifyInstrumentsFromFileNames";
63
64
  FbFunctionName["GroupRepertoryOnCreate"] = "groupRepertory-onCreate";
64
65
  FbFunctionName["GroupRepertoryOnUpdate"] = "groupRepertory-onUpdate";
65
66
  FbFunctionName["GroupRepertoryPublish"] = "groupRepertory-publish";
@@ -38,6 +38,7 @@ const regionByFunctions = {
38
38
  [index_1.FbFunctionName.GroupRepertoryRate]: GCloudRegions.EuropeWest6,
39
39
  [index_1.FbFunctionName.GroupRepertoryDownloadThemeFiles]: GCloudRegions.UsCentral1,
40
40
  [index_1.FbFunctionName.GroupRepertoryIdentifyInstruments]: GCloudRegions.UsCentral1,
41
+ [index_1.FbFunctionName.GroupRepertoryIdentifyInstrumentsFromFileNames]: GCloudRegions.UsCentral1,
41
42
  [index_1.FbFunctionName.GroupRepertoryClaimMusicSheet]: GCloudRegions.UsCentral1,
42
43
  [index_1.FbFunctionName.GroupRepertoryOnCreate]: GCloudRegions.UsCentral1,
43
44
  [index_1.FbFunctionName.GroupRepertoryOnUpdate]: GCloudRegions.UsCentral1,
@@ -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
- votes: Record<string, number>;
61
+ /** @deprecated */
35
62
  audios: string[];
36
- thumbnailURL: string | null;
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(): (import("../Player/types").PlayerBasicData & {
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 Object.keys(this.templates).map((templateId) => Object.assign({}, this.templates[templateId], { id: templateId }));
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 Object.keys(this.stageTemplates).map((templateId) => Object.assign({}, this.stageTemplates[templateId], { id: templateId }));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.14.1",
3
+ "version": "1.15.1",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,12 +0,0 @@
1
- import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
- export declare namespace PaymentsFbFunctionsTypes {
3
- interface StripeSessionParams {
4
- partnershipId: string;
5
- groupId: string;
6
- planId: PlansGroup;
7
- planPeriod: PlanPeriod;
8
- }
9
- interface StripeSessionResult {
10
- url: string;
11
- }
12
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
- export declare namespace StripeFbFunctionsTypes {
3
- interface SessionParams {
4
- partnershipId: string;
5
- groupId: string;
6
- planId: PlansGroup;
7
- planPeriod: PlanPeriod;
8
- }
9
- interface SessionResult {
10
- url: string;
11
- }
12
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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