UNPKG

@itslanguage/api

Version:
203 lines (177 loc) 1.47 MB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["itslApi"] = factory(); else root["itslApi"] = factory(); })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./build/api/index.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./build/api/auth/index.js": /*!*********************************!*\ !*** ./build/api/auth/index.js ***! \*********************************/ /*! exports provided: assembleScope, impersonate, authenticate */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"assembleScope\", function() { return assembleScope; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"impersonate\", function() { return impersonate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"authenticate\", function() { return authenticate; });\n/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/web.url */ \"./node_modules/core-js/modules/web.url.js\");\n/* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _communication__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../communication */ \"./build/api/communication/index.js\");\n\n\n\n\n/**\n * This file contains a set of functions which makes authentication easier.\n *\n * @see {@link https://itslanguage.github.io/itslanguage-docs/api/oauth2/index.html}\n *\n * @module api/authentication\n */\n\n/**\n * Assemble the scope form the given individual pieces.\n *\n * The scope is used to identify what the authenticated is allowed to do. It can slo be used by\n * admin and tenant users to impersonate as a tenant, organisation or user.\n *\n * Keep in mind that in order to specify the user, the scope also needs to be specified.\n *\n * @see {@link https://itslanguage.github.io/itslanguage-docs/api/oauth2/index.html#impersonation}\n *\n * @param {string} [tenant] - The ID of the tenant which is requesting this scope.\n * @param {string} [organisation] - The ID of the organisation which is requesting this scope.\n * @param {string} [user] - The ID of the user which is requesting this scope.\n *\n * @throws {Error} - When no arguments are provided.\n *\n * @returns {string} - The assembled scope.\n */\n\nfunction assembleScope(tenant, organisation, user) {\n if (!tenant && !organisation && !user) {\n throw new Error('Arguments are required to assemble scope.');\n }\n\n var scope = \"tenant/\" + tenant;\n\n if (organisation) {\n scope += \"/organisation/\" + organisation;\n\n if (user) {\n scope += \"/user/\" + user;\n }\n } // The special admin user, no tenant and organisation provided\n\n\n if (!tenant && !organisation && user) {\n scope = \"user/\" + user;\n } // The TENANT user, has no organisation\n\n\n if (tenant && !organisation && user) {\n scope += \"/user/\" + user;\n }\n\n return scope;\n}\n/**\n * Impersonate some other tenant, user or organisation. The impersonation will be done by using\n * the authorisation token for the current user.\n *\n * On a successful impersonation, the settings are updated so every follow-up API requests is\n * authorized by the access_token required with this impersonation.\n *\n * As an admin or tenant user it is possible to do impersonation. This goes from top to down. So, a\n * tenant user can impersonate an organisation, or an user in an organisation. But an user can't\n * impersonate.\n *\n * @see {@link https://itslanguage.github.io/itslanguage-docs/api/oauth2/index.html#impersonation}\n *\n * @param {string} [scope] - The scope of the impersonation. Omitting this value will cause the API\n * to return a token for the current user.\n *\n * @returns {Promise} - A promise which will resolve if the authentication concluded successfully,\n * it'll reject in any other case. It resolves with the response body of the token request.\n */\n\nfunction impersonate(scope) {\n var body = new URLSearchParams();\n body.set('grant_type', 'client_credentials');\n\n if (scope) {\n body.set('scope', scope);\n }\n\n return Object(_communication__WEBPACK_IMPORTED_MODULE_3__[\"authorisedRequest\"])('POST', '/tokens', body).then(result => {\n Object(_communication__WEBPACK_IMPORTED_MODULE_3__[\"updateSettings\"])({\n authorizationToken: result.access_token\n });\n return result;\n });\n}\n/**\n * Authenticate for the given credentials with the given scope.\n *\n * On a successful authentication, the settings are updated so every follow-up API requests is\n * authorized by the currently authenticated user.\n *\n * @param {string} username - The username to authenticate with.\n * @param {string} password - The password to authenticate with.\n * @param {string} [scope] - The scope of the authentication. Omitting this\n * value will cause the API to infer the scope.\n *\n * @returns {Promise} - A promise which will resolve if the authentication concluded successfully,\n * it'll reject in any other case. It resolves with the response body of the token request.\n */\n\nfunction authenticate(username, password, scope) {\n var body = new URLSearchParams();\n body.set('grant_type', 'password');\n body.set('username', username);\n body.set('password', password);\n\n if (scope) {\n body.set('scope', scope);\n }\n\n return Object(_communication__WEBPACK_IMPORTED_MODULE_3__[\"request\"])('POST', '/tokens', body).then(result => {\n Object(_communication__WEBPACK_IMPORTED_MODULE_3__[\"updateSettings\"])({\n authorizationToken: result.access_token\n });\n return result;\n });\n}\n\n//# sourceURL=webpack://itslApi/./build/api/auth/index.js?"); /***/ }), /***/ "./build/api/basicauth/index.js": /*!**************************************!*\ !*** ./build/api/basicauth/index.js ***! \**************************************/ /*! exports provided: create */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony import */ var _communication__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../communication */ \"./build/api/communication/index.js\");\n/**\n * This file contains the readily available functions which interact with the ITSLanguage user API.\n * Users can have username/password based credentials (basicauth). These credentials can be managed\n * using the REST API. Only users with administrative powers can perform these calls.\n *\n * @see {@link https://itslanguage.github.io/itslanguage-docs/api/basicauths/index.html}\n *\n * @module api/basicauth\n */\n\n/**\n * The URL for the basicAuth handler.\n * @type {string}\n */\n\nvar url = '/user/basicauths';\n/**\n * Create a basicAuth for the current user.\n * To create a basicAuth for another user, impersonate the user first.\n * A username must be unique in an organisation, but not across them.\n *\n * @param {string} basicAuth - The Id of the user to create or overwrite a profile for.\n * @param {string} [basicAuth.username] - The profile containing information about the user.\n * @param {string} [basicAuth.password ] - The groups this user is part of.\n *\n * @returns {Promise} - The basicauth creation promise.\n */\n// eslint-disable-next-line import/prefer-default-export\n\nfunction create(basicAuth) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_0__[\"authorisedRequest\"])('POST', url, basicAuth);\n}\n\n//# sourceURL=webpack://itslApi/./build/api/basicauth/index.js?"); /***/ }), /***/ "./build/api/broadcaster/index.js": /*!****************************************!*\ !*** ./build/api/broadcaster/index.js ***! \****************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var event_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! event-emitter */ \"./node_modules/event-emitter/index.js\");\n/* harmony import */ var event_emitter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(event_emitter__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * This module exposes the single event emitter. All events are sent through\n * this emitter. For usage; see the documentation of\n * [event-emitter][GitHub event-emitter].\n *\n * [GitHub event-emitter]: https://github.com/medikoo/event-emitter\n *\n * @module api/broadcaster\n */\n\n/**\n * The single event channel used throughout the ITSLanguage API.\n *\n * @type {event-emitter.EventEmitter}\n */\n\nvar broadcaster = event_emitter__WEBPACK_IMPORTED_MODULE_0___default()();\n/* harmony default export */ __webpack_exports__[\"default\"] = (broadcaster);\n\n//# sourceURL=webpack://itslApi/./build/api/broadcaster/index.js?"); /***/ }), /***/ "./build/api/categories/index.js": /*!***************************************!*\ !*** ./build/api/categories/index.js ***! \***************************************/ /*! exports provided: create, update, getById, getAll, getAllWithParentId */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"update\", function() { return update; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getById\", function() { return getById; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAll\", function() { return getAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAllWithParentId\", function() { return getAllWithParentId; });\n/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.promise */ \"./node_modules/core-js/modules/es.promise.js\");\n/* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.url */ \"./node_modules/core-js/modules/web.url.js\");\n/* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _communication__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../communication */ \"./build/api/communication/index.js\");\n\n\n\n\n\n\n/**\n * This file contains the readily available functions which interact with the\n * ITSLanguage categories API.\n *\n * Categorize Speech Challenges or categories.\n *\n * @see {@link https://itslanguage.github.io/itslanguage-docs/api/categories/index.html}\n *\n * @module api/categories\n */\n\n/**\n * The URL for the category handler(s).\n * @type {string}\n */\n\nvar url = '/categories';\n/**\n * Create a new category.\n *\n * The most convenient way to pas a category to this create function is to make use of the FormData\n * object.\n *\n * @param {Object} category - The category to create.\n * @param {string} [category.id] - The category identifier. If none is given, one is generated.\n * @param {string} [category.parent] - Identifier of the parent category.\n * @param {string} [category.name] - A name for the category.\n * @param {string} [category.description] - A possible more verbose description about the category.\n * @param {string} [category.color] - A color, preferably in RGB format.\n * @param {blob} [category.image] - An image to show with the category.\n * @param {blob} [category.icon] - An icon to show with the category.\n * @param {string} [category.speechChallenges] - Speech Challenge identifiers categorized in the\n * category.\n *\n * @returns {Promise} - The category creation promise.\n */\n\nfunction create(category) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_5__[\"authorisedRequest\"])('POST', url, category);\n}\n/**\n * Update one or more properties of an existing category.\n *\n * @param {string} id - The category identified.\n * @param {Object} properties - The properties of the category to update.\n * @param {string} [properties.parent] - Identifier of the parent category.\n * @param {string} [properties.name] - A name for the category.\n * @param {string} [properties.description] - A more verbose description about the category.\n * @param {string} [properties.color] - A color, preferably in RGB format.\n * @param {blob} [properties.image] - An image to show with the category.\n * @param {blob} [properties.icon] - An icon to show with the category.\n * @param {Array} [properties.speechChallenges] - An array of Speech Challenges identifiers\n * categorized in the category.\n *\n * @returns {Promise} - The category update promise.\n */\n\nfunction update(id, properties) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_5__[\"authorisedRequest\"])('PUT', url + \"/\" + id, properties);\n}\n/**\n * Get a single category by its ID.\n *\n * @param {string} id - The ID of the desired category.\n *\n * @returns {Promise} - The promise for the category.\n */\n\nfunction getById(id) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_5__[\"authorisedRequest\"])('GET', url + \"/\" + id);\n}\n/**\n * Get a all top level categories.\n * Top level categories are categories without a parent category.\n *\n * By default all categories are fetched though it is allowed to pass filters as a\n * `URLSearchParams` object.\n *\n * @param {URLSearchParams} [filters] - The filters to apply to the category list.\n *\n * @throws {Promise<string>} - If the given optional filters are not an instance of\n * `URLSearchParams`.\n *\n * @returns {Promise} - The promise for the categories.\n */\n\nfunction getAll(filters) {\n var urlWithFilters = url;\n\n if (filters) {\n if (!(filters instanceof URLSearchParams)) {\n return Promise.reject(new Error('The filters should be a `URLSearchParams` object.'));\n }\n\n urlWithFilters += \"?\" + filters.toString();\n }\n\n return Object(_communication__WEBPACK_IMPORTED_MODULE_5__[\"authorisedRequest\"])('GET', urlWithFilters);\n}\n/**\n * Get all categories that share the same parent.\n *\n * @param {string} id - The category identifier.\n *\n * @returns {Promise} - A promise and when fulfilled the requested categories.\n */\n\nfunction getAllWithParentId(id) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_5__[\"authorisedRequest\"])('GET', url + \"/\" + id + \"/categories\");\n}\n\n//# sourceURL=webpack://itslApi/./build/api/categories/index.js?"); /***/ }), /***/ "./build/api/challenges/choice/index.js": /*!**********************************************!*\ !*** ./build/api/challenges/choice/index.js ***! \**********************************************/ /*! exports provided: create, getById, getAll */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getById\", function() { return getById; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAll\", function() { return getAll; });\n/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ \"./node_modules/core-js/modules/es.array.iterator.js\");\n/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.promise */ \"./node_modules/core-js/modules/es.promise.js\");\n/* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ \"./node_modules/core-js/modules/es.regexp.to-string.js\");\n/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ \"./node_modules/core-js/modules/web.dom-collections.iterator.js\");\n/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/web.url */ \"./node_modules/core-js/modules/web.url.js\");\n/* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _communication__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../communication */ \"./build/api/communication/index.js\");\n\n\n\n\n\n\n/**\n * This file contains the readily available functions which interact with the\n * ITSLanguage choice challenge API.\n *\n * @module api/challenges/choice\n */\n\n/**\n * The URL for the choice challenge handler(s).\n * @type {string}\n */\n\nvar url = '/challenges/choice';\n/**\n * Create a new choice challenge.\n *\n * @param {Object} challenge - The challenge to create.\n *\n * @returns {Promise} - The challenge creation promise.\n */\n\nfunction create(challenge) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_5__[\"authorisedRequest\"])('POST', url, challenge);\n}\n/**\n * Get a single choice challenge by its ID.\n *\n * @param {string} id - The ID of the desired choice challenge.\n *\n * @returns {Promise} - The promise for the choice challenge.\n */\n\nfunction getById(id) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_5__[\"authorisedRequest\"])('GET', url + \"/\" + id);\n}\n/**\n * Get a all choice challenges.\n *\n * By default all choice challenges are fetched though it is allowed to pass filters as a\n * `URLSearchParams` object.\n *\n * @param {URLSearchParams} [filters] - The filters to apply to the category list.\n *\n * @throws {Promise<string>} - If the given optional filters are not an instance of\n * `URLSearchParams`.\n *\n * @returns {Promise} - The promise for the choice challenges.\n */\n\nfunction getAll(filters) {\n var urlWithFilters = url;\n\n if (filters) {\n if (!(filters instanceof URLSearchParams)) {\n return Promise.reject(new Error('The filters should be a `URLSearchParams` object.'));\n }\n\n urlWithFilters += \"?\" + filters.toString();\n }\n\n return Object(_communication__WEBPACK_IMPORTED_MODULE_5__[\"authorisedRequest\"])('GET', urlWithFilters);\n}\n\n//# sourceURL=webpack://itslApi/./build/api/challenges/choice/index.js?"); /***/ }), /***/ "./build/api/challenges/choice/recognition.js": /*!****************************************************!*\ !*** ./build/api/challenges/choice/recognition.js ***! \****************************************************/ /*! exports provided: create, getById, getAll, prepare, prepareChallenge, recogniseAudioStream, recognise, recogniseNonStreaming */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getById\", function() { return getById; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAll\", function() { return getAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prepare\", function() { return prepare; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prepareChallenge\", function() { return prepareChallenge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"recogniseAudioStream\", function() { return recogniseAudioStream; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"recognise\", function() { return recognise; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"recogniseNonStreaming\", function() { return recogniseNonStreaming; });\n/* harmony import */ var _utils_audio_over_socket__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/audio-over-socket */ \"./build/api/utils/audio-over-socket.js\");\n/* harmony import */ var _communication__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../communication */ \"./build/api/communication/index.js\");\n/* harmony import */ var _communication_websocket__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../communication/websocket */ \"./build/api/communication/websocket.js\");\n/**\n * This file contains the readily available functions which interact with the\n * ITSLanguage choice recognition API.\n *\n * Speech recognitions can be stored and retrieved for user submitted audio using the ITSLanguage\n * Speech API. The actual recognitions are performed by the ITSLanguage websocket server.\n *\n * For streaming, note that this is one of the \"nested\" or \"composite\" APIs; You can only obtain the\n * data if you provide a reference to the challenge for which you want a recording.\n *\n * @module api/challenges/choice/recognition\n */\n\n\n\n/**\n * The URL for the choice recognition challenge handler(s).\n *\n * @param challengeId\n * @returns {string}\n */\n\nvar url = challengeId => \"/challenges/choice/\" + challengeId + \"/recognitions\";\n/**\n * Submit an audio fragment for recognition. The recognition is created for the current\n * authenticated user.\n *\n * @see https://itslanguage.github.io/itslanguage-docs/api/recognitions/index.html#create-a-choice-recognition\n * @param {string} challengeId - The ID of the challenge to relate the recognition to.\n * @param {Blob} audio - The actual audio.\n * @param {string} recognised - The recognised string.\n * @param {string} [recognitionId=null] - Unique identifier for the recognition. If none is given,\n * one is generated.\n * @returns {Promise} - The created recognition with an url to download the audio if needed.\n */\n\n\nfunction create(challengeId, audio, recognised, recognitionId) {\n if (recognitionId === void 0) {\n recognitionId = null;\n }\n\n var recognition = {\n audio,\n recognised\n };\n\n if (recognitionId) {\n recognition.id = recognitionId;\n }\n\n return Object(_communication__WEBPACK_IMPORTED_MODULE_1__[\"authorisedRequest\"])('POST', \"\" + url(challengeId), recognition);\n}\n/**\n * Get a single ChoiceRecognition by its ID.\n *\n * @see https://itslanguage.github.io/itslanguage-docs/api/recognitions/index.html#get-a-single-choice-recognition\n * @param {string} challengeId - ID of the Choice Challenge to get all the recognitions for.\n * @param {string} id - ID of the choice recognition to get.\n * @returns {Promise} - Promise with the Choice Recognition as result if successful.\n */\n\nfunction getById(challengeId, id) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_1__[\"authorisedRequest\"])('GET', url(challengeId) + \"/\" + id);\n}\n/**\n * Get all Choice Recognitions for a specific Choice Challenge.\n *\n * @see https://itslanguage.github.io/itslanguage-docs/api/recognitions/index.html#list-choice-recognitions\n * @param {string} challengeId - ID of the Choice Challenge to get all the recognitions for.\n * @returns {Promise} - Promise with the Choice Recognitions as result if successful.\n */\n\nfunction getAll(challengeId) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_1__[\"authorisedRequest\"])('GET', \"\" + url(challengeId));\n}\n/**\n * This is the starting point for a choice recognition. A unique recognition id is generated,\n * which serves a leading role in the recognition. Each other call requires the recognition id\n * as a parameter.\n *\n * If other RPCs are called without this RPC being called first, the error\n * `nl.itslanguage.session_not_initialised` will be returned.\n *\n * @see https://itslanguage.github.io/itslanguage-docs/websocket/choice_recognitions/index.html#initialising-a-choice-recognition\n * @returns {Promise} - Returns a promise. When successfully the ID of the recognition is returned.\n */\n\nfunction prepare() {\n return Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_2__[\"makeWebsocketCall\"])('choice.init_recognition');\n}\n/**\n * Before performing the recognition, a WFST needs to be prepared for the challenge. When the RPC is\n * called, the challenge is initialised asynchronously. When the challenge is to be used, the server\n * automatically waits for the challenge initialisation to finish. If the initialisation results in\n * an error, the error is relayed to the client.\n *\n * @see https://itslanguage.github.io/itslanguage-docs/websocket/choice_recognitions/index.html#initialise-choice-challenge\n * @param {string} recognitionId - The ID of the recognition to prepare the challenge for.\n * @param {string} challengeId - The ID of the challenge to prepare.\n * @returns {Promise} - If succesful the promise returns nothing. On error, there will be an error.\n */\n\nfunction prepareChallenge(recognitionId, challengeId) {\n return Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_2__[\"makeWebsocketCall\"])('choice.init_challenge', {\n args: [recognitionId, challengeId]\n });\n}\n/**\n * Based on a recognitionId and a recorder register a RPC call that will be used to send the audio\n * across the line. The actual registration will not be done here, but we send the RPC that the\n * backend needs to call to the 'nl.itslanguage.choice.recognise' function.\n *\n * @param {string} recognitionId - The ID of the recognition to send audio for.\n * @param {MediaRecorder} recorder - Audio recorder instance.\n * @returns {Promise} - When all good, the result will have the actual recognition.\n */\n\nfunction recogniseAudioStream(recognitionId, recorder) {\n // Generate a somewhat unique RPC name\n var rpcNameToRegister = \"choice.stream.\" + Math.floor(Date.now() / 1000);\n return Object(_utils_audio_over_socket__WEBPACK_IMPORTED_MODULE_0__[\"registerStreamForRecorder\"])(recorder, rpcNameToRegister) // We don't use rpcNameToRegister here because it lacks some namespacing info. The\n // registration.procedure does have the needed information.\n .then(registration => Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_2__[\"makeWebsocketCall\"])('choice.recognise', {\n args: [recognitionId, registration.procedure]\n }));\n}\n/**\n * Easy function to do a recognition in one go. This is the \"dance of the RPC's\" that needs to be\n * done in order to get correct feedback from the backend.\n *\n * @param {string} challengeId - The ID of the challenge to take the recognition for.\n * @param {MediaRecorder} recorder - Audio recorder instance.\n * @returns {Promise<*>} - If all good it returns the actual recognition. If not, any error can be\n * expected to be returned.\n */\n\nfunction recognise(challengeId, recorder) {\n var recognitionId;\n return prepare().then(rId => {\n recognitionId = rId;\n return rId;\n }).then(() => prepareChallenge(recognitionId, challengeId)).then(() => recogniseAudioStream(recognitionId, recorder).then(result => result));\n}\n/**\n * Easy function to do a recognition in one go. This is the \"dance of the RPC's\" that needs to be\n * done in order to get correct feedback from the backend.\n *\n * This function is here to support possible old backend servers where we did not use the streaming\n * for choice challenges yet. It is deprecated and will be removed in the first minor update of the\n * api sdk.\n *\n * @deprecated\n * @param {string} challengeId - The ID of the challenge to take the recognition for.\n * @param {MediaRecorder} recorder - Audio recorder instance.\n * @returns {Promise<*>} - If all good it returns the actual recognition. If not, any error can be\n * expected to be returned.\n */\n\nfunction recogniseNonStreaming(challengeId, recorder) {\n var recognitionId;\n return prepare().then(rId => {\n recognitionId = rId;\n return rId;\n }).then(() => prepareChallenge(recognitionId, challengeId)).then(() => Object(_utils_audio_over_socket__WEBPACK_IMPORTED_MODULE_0__[\"prepareServerForAudio\"])(recognitionId, recorder, 'choice.init_audio')).then(() => Object(_utils_audio_over_socket__WEBPACK_IMPORTED_MODULE_0__[\"encodeAndSendAudioOnDataAvailable\"])(recognitionId, recorder, 'choice.write')).then(() => Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_2__[\"makeWebsocketCall\"])('choice.recognise', {\n args: [recognitionId]\n }));\n}\n\n//# sourceURL=webpack://itslApi/./build/api/challenges/choice/recognition.js?"); /***/ }), /***/ "./build/api/challenges/feedback/index.js": /*!************************************************!*\ !*** ./build/api/challenges/feedback/index.js ***! \************************************************/ /*! exports provided: create, getById, getAll */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getById\", function() { return getById; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAll\", function() { return getAll; });\n/* harmony import */ var _communication__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../communication */ \"./build/api/communication/index.js\");\n/**\n * This file contains the functions that are needed to interact with\n * the ITSLanguage Feedback API.\n *\n * @module api/challenges/feedback\n */\n\n/**\n * The URL for the feedback challenge handler(s).\n * @type {string}\n */\n\nvar url = '/feedback';\n/**\n * Create new feedback.\n *\n * @param {Object} feedback - The feedback to create.\n *\n * @returns {Promise} - The feedback creation promise.\n */\n\nfunction create(feedback) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_0__[\"authorisedRequest\"])('POST', url, feedback);\n}\n/**\n * Get a single feedback challenge by its ID.\n * Feedback can only be get by the owning user or by a user with the TEACHER role.\n *\n * @see https://itslanguage.github.io/itslanguage-docs/api/feedback/index.html#get-feedback-by-id\n *\n * @param {string} id - The ID of the desired feedback challenge to get.\n *\n * @returns {Promise} - The promise for the feedback challenge.\n */\n\nfunction getById(id) {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_0__[\"authorisedRequest\"])('GET', url + \"/\" + id);\n}\n/**\n * Get all feedback. It will only return feedback that the user may see.\n * Feedback can only be get by the owning user or by a user with the TEACHER role.\n *\n * @returns {Promise} - The promise for the feedback challenges.\n */\n\nfunction getAll() {\n return Object(_communication__WEBPACK_IMPORTED_MODULE_0__[\"authorisedRequest\"])('GET', url);\n}\n\n//# sourceURL=webpack://itslApi/./build/api/challenges/feedback/index.js?"); /***/ }), /***/ "./build/api/challenges/feedback/speech.js": /*!*************************************************!*\ !*** ./build/api/challenges/feedback/speech.js ***! \*************************************************/ /*! exports provided: prepare, listenAndReply, pause, resume, feedback */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prepare\", function() { return prepare; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"listenAndReply\", function() { return listenAndReply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pause\", function() { return pause; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"resume\", function() { return resume; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"feedback\", function() { return feedback; });\n/* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.promise */ \"./node_modules/core-js/modules/es.promise.js\");\n/* harmony import */ var core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_promise_finally__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.promise.finally */ \"./node_modules/core-js/modules/es.promise.finally.js\");\n/* harmony import */ var core_js_modules_es_promise_finally__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise_finally__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils_audio_over_socket__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/audio-over-socket */ \"./build/api/utils/audio-over-socket.js\");\n/* harmony import */ var _communication_websocket__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../communication/websocket */ \"./build/api/communication/websocket.js\");\n\n\n\n/**\n * This file contains the functions that are needed to interact with the ITSLanguage Speech\n * Feedback API.\n *\n * It's possible to get feedback while recording. After every sentence feedback is provided\n * indicating whether or not the sentence was read well. This will be done through the\n * ITSLanguage WebSocket Server.\n *\n * The general approach for getting real-time feedback is:\n * - Prepare the speech feedback\n * - Register audio procedure for streaming\n * - Start listening for audio\n *\n * To read up on the Speech feedback:\n * @see https://itslanguage.github.io/itslanguage-docs/websocket/feedback/index.html\n *\n * To read more on Speech Challenges:\n * @see https://itslanguage.github.io/itslanguage-docs/api/speech_challenges/index.html\n *\n * @module api/challenges/feedback/speech\n */\n\n\n/**\n * Prepare a new Speech Feedback.\n * Should be called upon each new speech feedback.\n * The backend will generate an unique ID for the feedback and prepare a speech challenge.\n *\n * @param {string} challengeId - The ID of the challenge to prepare.\n * @returns {Promise} - The ID of the Speech Feedback.\n */\n\nfunction prepare(challengeId) {\n return Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_3__[\"makeWebsocketCall\"])('feedback.prepare', {\n args: [challengeId]\n });\n}\n/**\n * In order to receive feedback the server needs to listen for audio on a registered audio rpc.\n * While listening the server will reply using progressive results. The server will stop listening\n * when the audio rpc returns.\n *\n * If you call this function the SDK will register an RPC method to the realm on which audio will be\n * streamed to the backend.\n *\n * @param {string} feedbackId - The Id of the Feedback Challenge.\n * @param {Function} progressCb - A callback which will be used to receive progress on.\n * @param {MediaRecorder} recorder - Audio recorder instance.\n * @param {string} [dataEvent] - Optional the event to collect data from.\n * @returns {Promise} - After each sentence there will be real-time feedback on that sentence. This\n * feedback will be given through the progressiveResultsCb function. When the rpc is done, the\n * promise will return an recording with the appropriate feedback per sentence.\n */\n\nfunction listenAndReply(feedbackId, progressCb, recorder, dataEvent) {\n // Generate a somewhat unique RPC name\n var rpcNameToRegister = \"feedback.stream.\" + Math.floor(Date.now() / 1000); // Below we use registration.procedure instead of rpcNameToRegister. This is because the later\n // lacks some namespace information that we do need.\n\n return Object(_utils_audio_over_socket__WEBPACK_IMPORTED_MODULE_2__[\"registerStreamForRecorder\"])(recorder, rpcNameToRegister, dataEvent).then(registration => Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_3__[\"makeWebsocketCall\"])('feedback.listen_and_reply', {\n args: [feedbackId, registration.procedure],\n progressCb: progressCb.bind(null, feedbackId)\n }));\n}\n/**\n * Feedback can be paused. This will stop the backend from processing the audio stream and returning\n * feedback.\n *\n * Important note: Pausing the feedback will not stop the feedback. Also make sure to stop sending\n * data from the recorder to the backend.\n *\n * @param {string} feedbackId - The ID of the feedback to pause.\n * @returns {Promise} - An error if something went wrong.\n */\n\nfunction pause(feedbackId) {\n return Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_3__[\"makeWebsocketCall\"])('feedback.pause', {\n args: [feedbackId]\n });\n}\n/**\n * A paused feedback can be resumed at a sentence in the challenge. If not provided, it will resume\n * at the first sentence.\n *\n * @param {string} feedbackId - The ID of the feedback to resume.\n * @param {string} sentenceId - The ID of the sentence to resume feedback from.\n * @returns {Promise} - An error if something went wrong.\n */\n\nfunction resume(feedbackId, sentenceId) {\n if (sentenceId === void 0) {\n sentenceId = 0;\n }\n\n return Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_3__[\"makeWebsocketCall\"])('feedback.resume', {\n args: [feedbackId, sentenceId]\n });\n}\n/**\n * Function for convenience. Using this function calls the corresponding functions so that the\n * required backend flow is backed up.\n *\n * It will call the following functions (and more important, in the correct order):\n * - {@link prepare}.\n * - {@link listenAndReply}.\n *\n * @param {string} challengeId - The Id of the Challenge to get feedback on.\n * @param {Function} progressiveResultsCb - A callback which will be used to receive progress on.\n * @param {MediaRecorder} recorder - Audio recorder instance.\n * @param {string} dataEvent - The event to use to collect data from.\n * @returns {Promise} - After each sentence there will be real-time feedback on that sentence. This\n * feedback will be given through the progressiveResultsCb function. When the rpc is done, the\n * promise will return an recording with the appropriate feedback per sentence.\n */\n\nfunction feedback(challengeId, progressiveResultsCb, recorder, dataEvent) {\n return prepare(challengeId).then(feedbackId => listenAndReply(feedbackId, progressiveResultsCb, recorder, dataEvent)).finally(() => Object(_communication_websocket__WEBPACK_IMPORTED_MODULE_3__[\"closeWebsocketConnection\"])());\n}\n\n//# sourceURL=webpack://itslApi/./build/api/challenges/feedback/speech.js?"); /***/ }), /***/ "./build/api/challenges/index.js": /*!***************************************!*\ !*** ./build/api/challenges/index.js ***! \***************************************/ /*! exports provided: choice, choiceRecognition, feedback, feedbackSpeech, pronunciation, pronunciationAnalysis, speech, speechRecording */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"choice\", function() { return choice; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"choiceRecognition\", function() { return choiceRecognition; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"feedback\", function() { return feedback; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"feedbackSpeech\", function() { return feedbackSpeech; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pronunciation\", function() { return pronunciation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pronunciationAnalysis\", function() { return pronunciationAnalysis; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"speech\", function() { return speech; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"speechRecording\", function() { return speechRecording; });\n/* harmony import */ var _choice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./choice */ \"./build/api/challenges/choice/index.js\");\n/* harmony import */ var _choice_recognition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./choice/recognition */ \"./build/api/challenges/choice/recognition.js\");\n/* harmony import */ var _feedback__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./feedback */ \"./build/api/challenges/feedback/index.js\");\n/* harmony import */ var _feedback_speech__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./feedback/speech */ \"./build/api/challenges/feedback/speech.js\");\n/* harmony import */ var _pronunciation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pronunciation */ \"./build/api/challenges/pronunciation/index.js\");\n/* harmony import */ var _pronunciation_analysis__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./pronunciation/analysis */ \"./build/api/challenges/pronunciation/analysis.js\");\n/* harmony import */ var _speech__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./speech */ \"./build/api/challenges/speech/index.js\");\n/* harmony import */ var _speech_recordings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./speech/recordings */ \"./build/api/challenges/speech/recordings.js\");\n/**\n * This file exports all the available challenges and their APIs for convenience only.\n *\n * @module api/challenges\n */\n\n\n\n\n\n\n\n\n/**\n * @type {module:api/challenges/choice}\n */\n\nvar choice = _choice__WEBPACK_IMPORTED_MODULE_0__;\n/**\n * @type {module:api/challenges/choice/recognition}\n */\n\nvar choiceRecognition = _choice_recognition__WEBPACK_IMPORTED_MODULE_1__;\n/**\n * @type {module:api/challenges/feedback}\n */\n\nvar feedback = _feedback__WEBPACK_IMPORTED_MODULE_2__;\n/**\n * @type {module:api/challenges/feedback/speech}\n */\n\nvar feedbackSpeech = _feedback_speech__WEBPACK_IMPORTED_MODULE_3__;\n/**\n * @type {module:api/challenges/pronunciation}\n */\n\nvar pronunciation = _pronunciation__WEBPACK_IMPORTED_MODULE_4__;\n/**\n * @type {module:api/challenges/pronunciation/analysis}\n */\n\nvar pronunciationAnalysis = _pronunciation_analysis__WEBPACK_IMPORTED_MODULE_5__;\n/**\n * @type {module:api/challenges/s