The server API for the app
        
        
            
        
    
    Methods
# static acceptChoirMember(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Accepts a given choir member into the given choir
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | Member data | 
memberId | 
  
  object | The ID of the member to accept | 
choirId | 
  
  string | The choir ID of the choir that the user should be accepted into | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static addChoir(data) → {Promise.<(module:tmaApi~ChoirAccess|module:tmaApi~ServerError)>}
        Adds a choir to the database
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | Choir data | 
choirName | 
  
  string | The name of the choir | 
description | 
  
  string | A description of the choir | 
memberType | 
  
  string | The member type of the member creating the choir | 
memberRole | 
  
  string | The member role of the member creating the choir | 
A promise containing the access code of the generated choir or an error
    
    
    
        
        
Promise.<(module:tmaApi~ChoirAccess|module:tmaApi~ServerError)>
    
    
# static addPerformance(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Adds a new performance for the current user for the provided sheet music and analyzes it immediately
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | |
performanceData | 
  
  string | The performance data to be added | 
sheetMusicId | 
  
  string | The sheet music id to add the performance to, also used to authenticate user so this is required | 
exerciseId | 
  
  string | If not null then the performance will be attached to this exercise otherwise attached to sheet music | 
isDurationExercise | 
  
  Boolean | If exercise, specify if it is a duration exercise | 
measureStart | 
  
  number | Start of performance | 
measureEnd | 
  
  number | End of performance | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static addUser(data) → {Promise.<(null|ServerError)>}
        Adds a user to the database
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  module:tmaApi~User | User data | 
A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|ServerError)>
    
    
# static closeRunningPerformance(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Closes out a running performance with the most recent data and asks to analyze it
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | |
performanceData | 
  
  string | The performance data to be added | 
performanceId | 
  
  string | The performance id to update | 
sheetMusicId | 
  
  string | The sheet music id for the performance | 
exerciseId | 
  
  string | If not null then the performance will be attached to this exercise otherwise attached to sheet music | 
isDurationExercise | 
  
  Boolean | If exercise, specify if it is a duration exercise | 
measureStart | 
  
  number | Start of performance | 
measureEnd | 
  
  number | End of performance | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static constUpdateMember(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Updates a choir member
Must be an admin of the choir to update a member
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | |
memberId | 
  
  string | |
memberType | 
  
  string | |
memberRole | 
  
  string | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static deleteMember(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Deletes a choir member
Must be an admin of the choir to update a member
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | |
memberId | 
  
  string | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static doesUserGetFeedback(data) → {Promise.<(module:tmaApi~GetsFeedback|module:tmaApi~ServerError)>}
        Gets if the user recieves feedback
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | Sheet music data | 
sheetMusicId | 
  
  string | The id of the sheet music the user is singing | 
- A promise containing whether the user gets feedback or an error
    
    
    
        
        
Promise.<(module:tmaApi~GetsFeedback|module:tmaApi~ServerError)>
    
    
# static getChoirMembers(data) → {Promise.<(module:tmaApi~MemberList|module:tmaApi~ServerError)>}
        Gets the given choir members
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | Choir data | 
choirId | 
  
  string | The ID of the choir to receive members of | 
- A promise containing members or an error
    
    
    
        
        
Promise.<(module:tmaApi~MemberList|module:tmaApi~ServerError)>
    
    
# static getExercise(data) → {Promise.<(module:tmaApi~ExerciseGetPackage|module:tmaApi~ServerError)>}
        Gets the alphaTex for an exercise
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | |
sheetMusicId | 
  
  string | The sheet music id from which to generate the exercise | 
trackNumber | 
  
  number | The track number to access (note: this is +1 more than the track index for any array) | 
staffNumber | 
  
  number | The staff number to access (note: this is +1 more than the staff index for any array) | 
measureStart | 
  
  number | The measure number to start with | 
measureEnd | 
  
  number | The measure number to end with | 
isDurationExercise | 
  
  Boolean | If true, generates a duration exercise otherwise just a normal exercise | 
- A promise containing information about the exercise or an error
    
    
    
    
# static getPartSheetMusic(data) → {Promise.<(module:tmaApi~SheetMusicPart|module:tmaApi~ServerError)>}
        Gets a specific part from a specific piece of sheet music
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | Music data | 
sheetMusicId | 
  
  string | The sheet music id to retrieve | 
partName | 
  
  string | The name of the part to be retrieved | 
- A promise containing part information or an error
    
    
    
    
# static getPendingMembers(data) → {Promise.<(module:tmaApi~MemberListExtended|module:tmaApi~ServerError)>}
        Gets pending members of the given choir
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | Choir data | 
choirId | 
  
  string | The ID of the choir to get pending members from | 
- A promise containing pending members or an error
    
    
    
    
# static getPerformanceProgress(data)
        Gets performance progress of member for the given piece of sheet music
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | |
sheetMusicId | 
  
  string | The sheet music id to which the part for the member is being added | 
# static getSheetMusic(data) → {Promise.<(module:tmaApi~SheetMusicInfoList|module:tmaApi~ServerError)>}
        Gets all sheet music for a choir
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Choir data | |
choirId | 
  
  string | The id of the choir to get sheet music info for | 
- A promise containing sheet music info or an error
    
    
    
    
# static getSinglePartSheetMusic(data) → {Promise.<(module:tmaApi~SheetMusicPartGetPackage|module:tmaApi~ServerError)>}
        Gets the sheet music and performance data for the user's specific part
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | |
sheetMusicId | 
  
  string | The sheet music id to retrieve the part from | 
- A promise containing information the sheet music or an error
    
    
    
    
# static getSpecificSheetMusic(data) → {Promise.<(module:tmaApi~SheetMusic|module:tmaApi~ServerError)>}
        Gets a specific piece of sheet music
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | |
sheetMusicId | 
  
  string | The sheet music id to retrieve | 
- A promise containing sheet music information or an error
    
    
    
        
        
Promise.<(module:tmaApi~SheetMusic|module:tmaApi~ServerError)>
    
    
# static getUser() → {Promise.<(module:tmaApi~User|module:tmaApi~ServerError)>}
        Gets the user
    
    
    A promise containing the user or an error
    
    
    
        
        
Promise.<(module:tmaApi~User|module:tmaApi~ServerError)>
    
    
# static getUsersChoirs() → {Promise.<(module:tmaApi~ChoirList|module:tmaApi~ServerError)>}
        Gets the choirs that the current user is a part of
    
    
    A promise containing choir information or an error
    
    
    
        
        
Promise.<(module:tmaApi~ChoirList|module:tmaApi~ServerError)>
    
    
# static getUsersPerformancesForSheetMusic(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Gets all performances for the user for a given piece of sheet music
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | |
sheetMusicId | 
  
  string | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static initializeRunningPerformance(data) → {Promise.<(module:tmaApi~MemberPostNewNoAnalysisPackage|module:tmaApi~ServerError)>}
        Initalizes a performance for the current user for the provided sheet music
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | Music data | 
performanceData | 
  
  string | The performance data to be added | 
sheetMusicId | 
  
  string | The sheet music id to add the performance to, also used to authenticate user so this is required | 
exerciseId | 
  
  string | If not null then the performance will be attached to this exercise otherwise attached to sheet music | 
isDurationExercise | 
  
  Boolean | If exercise, specify if it is a duration exercise | 
measureStart | 
  
  number | Start of performance | 
measureEnd | 
  
  number | End of performance | 
- A promise containing the performance id or an error
    
    
    
    
# static joinChoir(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Adds the user as a pending member of the given choir
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | Member and choir data | 
memberType | 
  
  string | The member type that you are attempting to join as | 
memberRole | 
  
  string | The member role that you are attempting to join as | 
accessCode | 
  
  string | The access code for the choir you are attempting to join | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static pickPartInSheetMusic(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Adds selected part to sheet music for given member receiving nothing
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | |
sheetMusicId | 
  
  string | The sheet music id to which the part for the member is being added | 
part | 
  
  string | The part from the sheet music that the member is selecting | 
memberId | 
  
  string | The member who is selecting a part | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static rejectChoirMember(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Rejects a given choir member from entering the given choir
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  object | Member data | 
memberId | 
  
  object | The ID of the member to reject | 
choirId | 
  
  string | The choir ID of the choir that the user should be rejected from | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static setAxiosAuthToken(authToken)
        Sets the Axios auth token.
The auth token only needs to be set when auth changes.
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
authToken | 
  
  string | The auth token to use for API requests | 
# static updateRunningPerformance(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Updates a stored performance with additional values
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  Object | |
performanceData | 
  
  string | The performance data to be added | 
performanceId | 
  
  string | The performance id to update | 
sheetMusicId | 
  
  string | The sheet music id for the performance | 
- A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
# static updateUser(data) → {Promise.<(null|module:tmaApi~ServerError)>}
        Updates a user in the database
    
    
    Parameters:
| Name | Type | Description | 
|---|---|---|
data | 
  
  module:tmaApi~User | User data | 
A promise containing nothing on success or an error
    
    
    
        
        
Promise.<(null|module:tmaApi~ServerError)>
    
    
Type Definitions
    
        
        
object
    
    
    
            
                # Choir
    A choir
    Properties:
| Name | Type | Description | 
|---|---|---|
choir_id | 
    
    string | The ID of the choir | 
choir_name | 
    
    string | The name of the choir | 
description | 
    
    string | A description of the choir | 
    
        
        
object
    
    
    
            
                # ChoirAccess
    The choir access code
    Properties:
| Name | Type | Description | 
|---|---|---|
accessCode | 
    
    string | The access code of the generated choir | 
    
        
        
object
    
    
    
            
                # ChoirList
    A list of choirs
    Properties:
| Name | Type | Description | 
|---|---|---|
data | 
    
    object | Choir list data | 
choirs | 
    
    Array.<module:tmaApi~Choir> | Choir list | 
    
        
        
object
    
    
    
            
                # ChoirMember
    A choir member
    Properties:
| Name | Type | Description | 
|---|---|---|
first_name | 
    
    string | The first name of the member | 
last_name | 
    
    string | The last name of the member | 
member_role | 
    
    string | The role of the member | 
person_id | 
    
    string | The ID of the person attached to the member | 
has_picture | 
    
    boolean | Whether the given member is attached to a person with a profile picture or not | 
    
        
        
object
    
    
    
            
                # ChoirMemberExtended
    A choir member.
This object contains more member data than the module:tmaApi~ChoirMember.
    Properties:
| Name | Type | Description | 
|---|---|---|
member_id | 
    
    string | The ID of the member | 
first_name | 
    
    string | The first name of the member | 
email | 
    
    string | The email of the member | 
member_type | 
    
    string | The type of the member | 
member_role | 
    
    string | The role of the member | 
has_picture | 
    
    boolean | Indicates if the member has a profile picture | 
    
        
        
object
    
    
    
            
                # ExerciseGetPackage
Properties:
| Name | Type | Description | 
|---|---|---|
sheet_music | 
    
    string | The Tex for the exercise | 
part_list | 
    
    Array.<string> | A list of the part names of the AlphaTex | 
clefs | 
    
    Array.<string> | A list of clefs per staff | 
performance_expectation | 
    
    Array.<number> | A 1D array of even size with the ith index as the midi value and the i+1 index as the duration of that note for i%2==0 | 
lower_upper | 
    
    Array.<number> | A 1D two valued array with the lower and upper midi values | 
measure_lengths | 
    
    Array.<number> | A collection of the lengths of each Measure. The ith index contains the length in seconds of the i+1 Measure | 
part | 
    
    string | The name of the main exercise to be rendered | 
    
        
        
object
    
    
    
            
                # GetsFeedback
Properties:
| Name | Type | Description | 
|---|---|---|
data | 
    
    object | Response data | 
gets_feedback | 
    
    boolean | Indicates if the user gets feedback (i.e. real-time feedback and performance data) | 
    
        
        
object
    
    
    
            
                # MemberList
    A list of choir members
    Properties:
| Name | Type | Description | 
|---|---|---|
data | 
    
    Array.<module:tmaApi~ChoirMember> | Choir member list | 
# MemberListExtended
    A list of choir members.
This array contains more member data than the module:tmaApi~MemberList.
    Properties:
| Name | Type | Description | 
|---|---|---|
data | 
    
    Array.<module:tmaApi~ChoirMemberExtended> | Choir member list | 
    
        
        
object
    
    
    
            
                # MemberPostNewNoAnalysisPackage
Properties:
| Name | Type | Description | 
|---|---|---|
performance_id | 
    
    string | The ID of the newly generated performance data | 
    
        
        
object
    
    
    
            
                # ServerError
    A server error
    Properties:
| Name | Type | Description | 
|---|---|---|
response | 
    
    object | The error response | 
status | 
    
    string | The error status code | 
data | 
    
    object | The error data (usually just a string) | 
    
        
        
object
    
    
    
            
                # SheetMusic
Properties:
| Name | Type | Description | 
|---|---|---|
data | 
    
    object | Sheet music data | 
sheet_music | 
    
    string | The AlphaTex of the sheet music | 
part_list | 
    
    Array.<string> | A list of the part (i.e. track) names | 
clefs | 
    
    Array.<string> | The clefs per staff | 
part | 
    
    string | If not null, then the part of the current user in the sheet music | 
    
        
        
object
    
    
    
            
                # SheetMusicInfo
Properties:
| Name | Type | Description | 
|---|---|---|
sheet_music_id | 
    
    string | The ID of the sheet music | 
title | 
    
    string | The title of the sheet music | 
composer_names | 
    
    string | The names of the composers | 
    
        
        
object
    
    
    
            
                # SheetMusicInfoList
Properties:
| Name | Type | Description | 
|---|---|---|
data | 
    
    Sheet music data | |
sheet_music | 
    
    Array.<module:tmaApi~SheetMusicInfo> | An array of sheet music info | 
    
        
        
object
    
    
    
            
                # SheetMusicPart
Properties:
| Name | Type | Description | 
|---|---|---|
data | 
    
    object | Part data | 
performance_expectation | 
    
    Array.<number> | A 1D array of even size with the ith index as the midi value and the i+1 index as the duration of that note for i%2==0 | 
lower_upper | 
    
    Array.<number> | A 1D two valued array with the lower and upper midi values | 
measure_lengths | 
    
    Array.<number> | A collection of the lengths of each Measure. The ith index contains the length in seconds of the i+1 Measure | 
    
        
        
object
    
    
    
            
                # SheetMusicPartGetPackage
Properties:
| Name | Type | Description | 
|---|---|---|
sheet_music | 
    
    string | The created AlphaTex isolating the user's part | 
part_list | 
    
    Array.<string> | A list of part (i.e. track) names in the generated AlphaTex | 
clefs | 
    
    Array.<string> | Clefs per staff | 
performance_expectation | 
    
    Array.<number> | A 1D array of even size with the ith index as the midi value and the i+1 index as the duration of that note for i%2==0 | 
lower_upper | 
    
    Array.<number> | A 1D two valued array with the lower and upper midi values | 
measure_lengths | 
    
    Array.<number> | A collection of the lengths of each Measure. The ith index contains the length in seconds of the i+1 Measure | 
exerciseId | 
    
    string | The ID of the exercise created | 
    
        
        
object
    
    
    
            
            # User
    A user from the server
    Properties:
| Name | Type | Description | 
|---|---|---|
data | 
    
    object | The response data | 
firstName | 
    
    string | The user's first name | 
lastName | 
    
    string | The user's last name | 
hasPicture | 
    
    boolean | Indicates if the user has a profile picture |