UNPKG

@novo-learning/novo-sdk

Version:

SDK for the Novolanguage Speech Analysis API

1 lines 15.2 kB
{"openapi":"3.0.0","paths":{"/v1/files":{"post":{"operationId":"uploadFile","summary":"","description":"Upload a file (audio) to secure storage","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUploadResultDtoV1"}}}},"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUploadResultDtoV1"}}}}},"tags":["files"],"security":[{"access_token":[]}]}},"/v1/files/{id}":{"get":{"operationId":"downloadFile","summary":"","description":"Download a file","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArrayBuffer"}}}}},"tags":["files"],"security":[{"access_token":[]}]},"delete":{"operationId":"deleteFile","summary":"","description":"Delete a file","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["files"]}},"/v1/attempts":{"post":{"operationId":"createAttempt","summary":"","description":"Create an attempt","parameters":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"attempt":{"type":"string"},"audio":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttemptResponseDtoV1"}}}}},"tags":["attempts"],"security":[{"access_token":[]}]},"get":{"operationId":"getAttempts","summary":"","description":"Get a list of attempts","parameters":[{"name":"publisherId","required":false,"in":"query","schema":{"type":"string"}},{"name":"groupId","required":false,"in":"query","schema":{"type":"string"}},{"name":"userId","required":false,"in":"query","schema":{"type":"string"}},{"name":"expired","required":false,"in":"query","description":"Filter on being expired","schema":{"type":"boolean"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttemptResponseDtoV1"}}}}}},"tags":["attempts"],"security":[{"access_token":[]}]}},"/v1/attempts/{id}":{"get":{"operationId":"getAttempt","summary":"","description":"Get an attempt","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttemptResponseDtoV1"}}}},"404":{"description":"Returned when the attempt with the specified id is not found","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["attempts"],"security":[{"access_token":[]}]},"patch":{"operationId":"updateAttempt","summary":"","description":"Update an attempt","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAttemptDtoV1"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttemptResponseDtoV1"}}}},"404":{"description":"Returned when the attempt with the specified id is not found","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["attempts"],"security":[{"access_token":[]}]},"delete":{"operationId":"removeAttempt","summary":"","description":"Remove an attempt","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""},"404":{"description":"Returned when the attempt with the specified id is not found","content":{"application/json":{"schema":{"type":"string"}}}}},"tags":["attempts"],"security":[{"access_token":[]}]}},"/v1/attempts/delete":{"post":{"operationId":"deleteAttempts","summary":"","description":"Delete many attempts","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttemptsFilterDtoV1"}}}},"responses":{"200":{"description":""},"201":{"description":""}},"tags":["attempts"],"security":[{"access_token":[]}]}},"/v1/attempts/download":{"post":{"operationId":"downloadAttempts","summary":"","description":"Download many attempts for analysis","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"publisherId":{"type":"string"},"offset":{"type":"number"},"limit":{"type":"number"},"filter":{"type":"object"}},"required":["publisherId"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttemptResponseDtoV1"}}}}},"201":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AttemptResponseDtoV1"}}}}}},"tags":["attempts"],"security":[{"access_token":[]}]}}},"info":{"title":"Data API","description":"The data API stores speech data and analysis results","version":"1.0","contact":{}},"tags":[{"name":"files","description":""},{"name":"attempts","description":""}],"servers":[],"components":{"schemas":{"FileUploadResultDtoV1":{"type":"object","properties":{"id":{"type":"string","description":"File id"}},"required":["id"]},"ArrayBuffer":{"type":"object","properties":{}},"ConfidenceDtoV1":{"type":"object","properties":{"llr":{"type":"number","description":"Likelihood-ratio"},"prob":{"type":"number","description":"Probability"}},"required":["llr","prob"]},"PhraseCorrectness":{"type":"object","properties":{}},"ScoreDtoV1":{"type":"object","properties":{"accuracy":{"type":"number","description":"The accuracy","format":"int"},"fluency":{"type":"number","description":"The fluency","format":"int"},"velocity":{"type":"number","description":"The velocity","format":"int"}}},"TimingDtoV1":{"type":"object","properties":{"begin":{"type":"number","description":"Position in milliseconds within the audio stream where the word begins","format":"number"},"end":{"type":"number","description":"Position in milliseconds within the audio stream where the word ends","format":"number"}},"required":["begin","end"]},"WordCorrectness":{"type":"object","properties":{}},"AsrRecognizedPhoneDtoV1":{"type":"object","properties":{"phone":{"type":"string","description":"The phone"},"confidence":{"description":"The confidence of this phone","allOf":[{"$ref":"#/components/schemas/ConfidenceDtoV1"}]}},"required":["phone"]},"PhoneCorrectness":{"type":"object","properties":{}},"PhoneRecognitionDtoV1":{"type":"object","properties":{"timing":{"description":"The interval in the audio for this word","allOf":[{"$ref":"#/components/schemas/TimingDtoV1"}]},"target":{"description":"The target phone recognition result","allOf":[{"$ref":"#/components/schemas/AsrRecognizedPhoneDtoV1"}]},"recognized":{"description":"The recognized phone","allOf":[{"$ref":"#/components/schemas/AsrRecognizedPhoneDtoV1"}]},"correct":{"type":"boolean","description":"Is the phone correctly uttered?"},"correctness":{"description":"Is the phone correctly uttered?","allOf":[{"$ref":"#/components/schemas/PhoneCorrectness"}]}},"required":["recognized"]},"AlignmentEntryDtoV1":{"type":"object","properties":{"deleted":{"type":"string","description":"A deletion"},"inserted":{"type":"string","description":"An insertion"}}},"LetterAlignmentDtoV1":{"type":"object","properties":{"letter":{"type":"string","description":"A letter in a word","format":"string"},"phones":{"description":"The phones in a pronunciation corresponding to the letter","type":"array","items":{"type":"string"}},"correct":{"type":"boolean","description":"Is the letter pronounced correctly?"}},"required":["letter","phones","correct"]},"WordFeatureLetterDtoV1":{"type":"object","properties":{"letter":{"type":"string","description":"Letter of a word"},"part":{"type":"boolean","description":"Indicates if the letter is used in the evaluation of the word feature"}},"required":["letter","part"]},"WordFeatureDtoV1":{"type":"object","properties":{"id":{"type":"string","description":"Identifier for the word feature"},"categoryId":{"type":"string","description":"Category identifier for the word feature"},"correct":{"type":"boolean","description":"Have the phones on which the word feature focusses been uttered correctly?"},"letters":{"description":"For each letter of the word whether it is used in the evaluation of the word feature","type":"array","items":{"$ref":"#/components/schemas/WordFeatureLetterDtoV1"}}},"required":["id","correct"]},"WordRecognitionDtoV1":{"type":"object","properties":{"timing":{"description":"The interval in the audio for this word","allOf":[{"$ref":"#/components/schemas/TimingDtoV1"}]},"word":{"type":"string","description":"The recognized text"},"correct":{"type":"boolean","description":"Does the utterence match the text?"},"correctness":{"description":"Is the word pronounced correctly?","allOf":[{"$ref":"#/components/schemas/WordCorrectness"}]},"confidence":{"description":"The confidence of this phone","allOf":[{"$ref":"#/components/schemas/ConfidenceDtoV1"}]},"score":{"description":"The score","allOf":[{"$ref":"#/components/schemas/ScoreDtoV1"}]},"phones":{"description":"The recognized phonemes","type":"array","items":{"$ref":"#/components/schemas/PhoneRecognitionDtoV1"}},"alignment":{"description":"Insertion, deletions and substitutions between the recognized and closest correct target","type":"array","items":{"$ref":"#/components/schemas/AlignmentEntryDtoV1"}},"promptToken":{"type":"string","description":"The token in the prompt which corresponds to this word"},"letterAlignment":{"description":"The alignment between letters and phones","type":"array","items":{"$ref":"#/components/schemas/LetterAlignmentDtoV1"}},"wordFeatures":{"description":"Evaluation of the word features","type":"array","items":{"$ref":"#/components/schemas/WordFeatureDtoV1"}}},"required":["word"]},"PhraseRecognitionDtoV1":{"type":"object","properties":{"timing":{"description":"The interval in the audio for this phrase","allOf":[{"$ref":"#/components/schemas/TimingDtoV1"}]},"phrase":{"type":"string","description":"The recognized text"},"correct":{"type":"boolean","description":"Does the utterence match the text?"},"correctness":{"description":"Is the pronunciation correct?","allOf":[{"$ref":"#/components/schemas/PhraseCorrectness"}]},"words":{"description":"The recognized words","minItems":1,"type":"array","items":{"$ref":"#/components/schemas/WordRecognitionDtoV1"}}},"required":["phrase","words"]},"AttemptSummaryDto":{"type":"object","properties":{"id":{"type":"string","description":"The identifier of the attempt","format":"UUID"},"audioKey":{"type":"string","description":"The audio key needed to retrieve the recording","format":"string"}}},"ExerciseResultDtoV1":{"type":"object","properties":{"confidence":{"description":"The confidence score of the recognition result","allOf":[{"$ref":"#/components/schemas/ConfidenceDtoV1"}]},"correct":{"type":"boolean","description":"Has the exercise been completed correctly?"},"correctness":{"description":"Has the exercise been completed correctly?","allOf":[{"$ref":"#/components/schemas/PhraseCorrectness"}]},"score":{"description":"The score","allOf":[{"$ref":"#/components/schemas/ScoreDtoV1"}]},"recognized":{"description":"The recognized words","minItems":1,"type":"array","items":{"$ref":"#/components/schemas/WordRecognitionDtoV1"}},"phrases":{"description":"The recognized phrases","minItems":1,"type":"array","items":{"$ref":"#/components/schemas/PhraseRecognitionDtoV1"}},"alignment":{"description":"Insertion, deletions and substitutions between the recognized and correct target","type":"array","items":{"$ref":"#/components/schemas/AlignmentEntryDtoV1"}},"wordFeatures":{"description":"The word features","type":"array","items":{"$ref":"#/components/schemas/WordFeatureDtoV1"}},"attempt":{"description":"A summary of the stored attempt","allOf":[{"$ref":"#/components/schemas/AttemptSummaryDto"}]},"speechDetected":{"type":"boolean","description":"Indicates if speech has been detected in the audio"},"exerciseId":{"type":"string","description":"Identifier of the exercise","format":"UUID"},"phrase":{"type":"string","description":"The prompt or recognised choice"},"respondedAt":{"format":"date-time","type":"string","description":"The timestamp in UTC at which the attempt was made in ISO8601 format: YYYY-MM-DDThhmmss.sssZ"}}},"AttemptResponseDtoV1":{"type":"object","properties":{"id":{"type":"string","description":"Id of the attempt"},"userId":{"type":"string","description":"Id of the user who made the attempt"},"groupId":{"type":"string","description":"Id of the group to which the user who made the attempt belongs"},"exerciseResult":{"description":"The analyzed result","allOf":[{"$ref":"#/components/schemas/ExerciseResultDtoV1"}]},"exerciseId":{"type":"string","description":"Identifier of the exercise","format":"UUID"},"dateTime":{"format":"date-time","type":"string","description":"The timestamp in UTC at which the attempt was made in ISO8601 format: YYYY-MM-DDThhmmss.sssZ"},"audioKey":{"type":"string","description":"Identifier for the audio of the attempt"},"timeout":{"type":"boolean","description":"If timeout message was sent"},"duration":{"type":"number","description":"The duration of the recording in milliseconds"},"metadata":{"type":"object","description":"Dictionary with meta data about the exercise, like an identifier for the goal of the exercise"}},"required":["id","userId","exerciseResult","dateTime"]},"UpdateAttemptDtoV1":{"type":"object","properties":{"exerciseResult":{"description":"The analyzed result","allOf":[{"$ref":"#/components/schemas/ExerciseResultDtoV1"}]},"exerciseId":{"type":"string","description":"Identifier of the exercise","format":"UUID"},"audioKey":{"type":"string","description":"Identifier for the audio of the attempt"},"timeout":{"type":"boolean","description":"Indicates if a timeout was triggered"},"duration":{"type":"number","description":""}},"required":["exerciseResult"]},"AttemptsFilterDtoV1":{"type":"object","properties":{"publisherId":{"type":"string"},"groupId":{"type":"string"},"userId":{"type":"string"},"expired":{"type":"boolean"}}},"CreateAttemptDtoV1":{"type":"object","properties":{"attemptId":{"type":"string","description":"Identifier used for retrieval of this attempt"},"language":{"enum":["ar-idn","de","en","nl","zh","fr","es"],"type":"string","description":"The language"},"exerciseResult":{"description":"The analyzed result","allOf":[{"$ref":"#/components/schemas/ExerciseResultDtoV1"}]},"exerciseId":{"type":"string","description":"Identifier of the exercise","format":"UUID"},"audioKey":{"type":"string","description":"Identifier for the audio of the attempt; should start with publisherId_userId othewise this will be prepended"},"timeout":{"type":"boolean","description":"Indicates if a timeout was triggered"},"duration":{"type":"number","description":""},"metadata":{"type":"object","description":"Dictionary with meta data about the exercise, like an identifier for the goal of the exercise"}},"required":["exerciseResult"]}}}}