define('application/models/configuration', [
'antie/runtimecontext'
], function (
RuntimeContext
) {
'use strict';
var numberMapping = {},
idMapping = {},
channelNumbers = [];
return {
/**
* The Api response codes.
*/
RESPONSE_CODES: {
OK: 'OK', // Result successful
KO: 'KO' // Result unsuccessful
},
/**
* The API response Error Codes.
*/
API_ERROR_CODES: {
USER_HAS_NO_RIGHTS: '403-10100',
// Stream Error Codes
CONCURRENT_STREAM_LIMIT_REACHED_1: '500-3169',
CONCURRENT_STREAM_LIMIT_REACHED_2: '500-3170',
CONCURRENT_STREAM_LIMIT_REACHED_3: '500-3501',
CONCURRENT_STREAM_LIMIT_REACHED_4: '400-3501',
DISNEY: '500-1339',
DISNEYREF: '500-REF-1339'
},
/**
* The accepted channels.
*/
CHANNELS: {
beta: [18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 32, 33, 34, 109, 175, 190, 205, 251],
staging: [18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 32, 33, 34, 109, 175, 190, 205, 251],
prod: [18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 32, 33, 34, 109, 175, 190, 205, 251],
gosChannels: [223, 224, 225]
},
/**
* Sets the channel map.
*
* @param {string|number} id - The id.
* @param {string|number} number - The number.
*/
setChannelMap: function (id, number) {
numberMapping[number] = id;
idMapping[id] = number;
channelNumbers.push(number);
},
/**
* Gets the GOS channels.
*
* @returns {Array} - The array of the GOS IDs.
*/
getGosChannels: function () {
return this.CHANNELS['gosChannels'];
},
/**
* Gets the channel for the given number.
*
* @param {string|number} number - The number.
* @returns {string|number} - The id.
*/
getChannelForNumber: function (number) {
return numberMapping[number];
},
/**
* Gets the channel for the given id.
*
* @param {string|number} id - The id.
* @returns {string|number} - The number.
*/
getChannelForId: function (id) {
return idMapping[id];
},
/**
* Returns all channel numbers.
*
* @returns {Array} - The channel numbers.
*/
getChannelNumbers: function () {
return channelNumbers;
},
/**
* Returns the channels.
*
* @returns {Array} - The channels.
*/
getChannels: function () {
return this.CHANNELS[RuntimeContext.getCurrentApplication().getAPISetting()];
},
/**
* The Apis.
*/
APIS: {
BETA: 'beta',
PROD: 'prod',
STAGING: 'staging'
}
};
});