Module

tmaApi

The server API for the app
Author:

View Source vendors/AWS/tmaApi.js, line 4

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

View Source vendors/AWS/tmaApi.js, line 154

- 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

View Source vendors/AWS/tmaApi.js, line 87

A promise containing the access code of the generated choir or an error

# 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

View Source vendors/AWS/tmaApi.js, line 347

- 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

View Source vendors/AWS/tmaApi.js, line 57

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

View Source vendors/AWS/tmaApi.js, line 377

- 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

View Source vendors/AWS/tmaApi.js, line 391

- 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

View Source vendors/AWS/tmaApi.js, line 403

- 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

View Source vendors/AWS/tmaApi.js, line 217

- A promise containing whether the user gets feedback or an error

# 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

View Source vendors/AWS/tmaApi.js, line 138

- A promise containing members or an error

# 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

View Source vendors/AWS/tmaApi.js, line 445

- 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

View Source vendors/AWS/tmaApi.js, line 306

- 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

View Source vendors/AWS/tmaApi.js, line 196

- 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

View Source vendors/AWS/tmaApi.js, line 498

# 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

View Source vendors/AWS/tmaApi.js, line 258

- 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

View Source vendors/AWS/tmaApi.js, line 471

- 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

View Source vendors/AWS/tmaApi.js, line 282

- A promise containing sheet music information or an error

# static getUser() → {Promise.<(module:tmaApi~User|module:tmaApi~ServerError)>}

Gets the user

View Source vendors/AWS/tmaApi.js, line 47

A promise containing the user or an error

# static getUsersChoirs() → {Promise.<(module:tmaApi~ChoirList|module:tmaApi~ServerError)>}

Gets the choirs that the current user is a part of

View Source vendors/AWS/tmaApi.js, line 111

A promise containing choir information or an error

# 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

View Source vendors/AWS/tmaApi.js, line 414

- 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

View Source vendors/AWS/tmaApi.js, line 331

- 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

View Source vendors/AWS/tmaApi.js, line 234

- 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

View Source vendors/AWS/tmaApi.js, line 488

- 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

View Source vendors/AWS/tmaApi.js, line 166

- 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

View Source vendors/AWS/tmaApi.js, line 21

# 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

View Source vendors/AWS/tmaApi.js, line 360

- 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

View Source vendors/AWS/tmaApi.js, line 67

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

View Source vendors/AWS/tmaApi.js, line 98

object

# ChoirAccess

The choir access code
Properties:
Name Type Description
accessCode string The access code of the generated choir

View Source vendors/AWS/tmaApi.js, line 71

object

# ChoirList

A list of choirs
Properties:
Name Type Description
data object Choir list data
choirs Array.<module:tmaApi~Choir> Choir list

View Source vendors/AWS/tmaApi.js, line 91

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

View Source vendors/AWS/tmaApi.js, line 121

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

View Source vendors/AWS/tmaApi.js, line 177

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

View Source vendors/AWS/tmaApi.js, line 422

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)

View Source vendors/AWS/tmaApi.js, line 204

object

# MemberList

A list of choir members
Properties:
Name Type Description
data Array.<module:tmaApi~ChoirMember> Choir member list

View Source vendors/AWS/tmaApi.js, line 115

# 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

View Source vendors/AWS/tmaApi.js, line 170

object

# MemberPostNewNoAnalysisPackage

Properties:
Name Type Description
performance_id string The ID of the newly generated performance data

View Source vendors/AWS/tmaApi.js, line 314

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)

View Source vendors/AWS/tmaApi.js, line 25

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

View Source vendors/AWS/tmaApi.js, line 266

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

View Source vendors/AWS/tmaApi.js, line 244

object

# SheetMusicInfoList

Properties:
Name Type Description
data Sheet music data
sheet_music Array.<module:tmaApi~SheetMusicInfo> An array of sheet music info

View Source vendors/AWS/tmaApi.js, line 238

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

View Source vendors/AWS/tmaApi.js, line 290

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

View Source vendors/AWS/tmaApi.js, line 453

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

View Source vendors/AWS/tmaApi.js, line 33