From 1fed5aefab82eca7da5c39203984043fa05e1e80 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Tue, 21 Feb 2023 08:49:15 +0700 Subject: [PATCH] feat: add nuance, riva, ibm --- config/test.json | 13 + index.js | 32 + lib/get-ibm-access-token.js | 48 + lib/get-nuance-access-token.js | 49 + lib/get-tts-voices.js | 111 ++ lib/purge-tts-cache.js | 46 + lib/synth-audio.js | 436 +++++ lib/utils.js | 25 + package-lock.json | 1902 ++++++++++++++++++++++ package.json | 2 + protos/riva/proto/riva_audio.proto | 36 + protos/riva/proto/riva_tts.proto | 77 + stubs/riva/proto/riva_audio_grpc_pb.js | 1 + stubs/riva/proto/riva_audio_pb.js | 31 + stubs/riva/proto/riva_tts_grpc_pb.js | 99 ++ stubs/riva/proto/riva_tts_pb.js | 1278 +++++++++++++++ test/docker_start.js | 12 + test/docker_stop.js | 12 + test/ibm.js | 78 + test/index.js | 5 + test/nuance.js | 50 + test/synth.js | 382 +++++ test/tmp/redis.conf | 2054 ++++++++++++++++++++++++ 23 files changed, 6779 insertions(+) create mode 100644 config/test.json create mode 100644 lib/get-ibm-access-token.js create mode 100644 lib/get-nuance-access-token.js create mode 100644 lib/get-tts-voices.js create mode 100644 lib/purge-tts-cache.js create mode 100644 lib/synth-audio.js create mode 100644 lib/utils.js create mode 100644 protos/riva/proto/riva_audio.proto create mode 100644 protos/riva/proto/riva_tts.proto create mode 100644 stubs/riva/proto/riva_audio_grpc_pb.js create mode 100644 stubs/riva/proto/riva_audio_pb.js create mode 100644 stubs/riva/proto/riva_tts_grpc_pb.js create mode 100644 stubs/riva/proto/riva_tts_pb.js create mode 100644 test/docker_start.js create mode 100644 test/docker_stop.js create mode 100644 test/ibm.js create mode 100644 test/index.js create mode 100644 test/nuance.js create mode 100644 test/synth.js create mode 100644 test/tmp/redis.conf diff --git a/config/test.json b/config/test.json new file mode 100644 index 0000000..0d3ad28 --- /dev/null +++ b/config/test.json @@ -0,0 +1,13 @@ +{ + "logging": { + "level": "error" + }, + "redis": { + "host": "127.0.0.1", + "port": 3379 + }, + "redis-auth": { + "host": "127.0.0.1", + "port": 3380 + } +} \ No newline at end of file diff --git a/index.js b/index.js index e69de29..e34b4c0 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,32 @@ +const {noopLogger} = require('./lib/utils'); +const promisify = require('@jambonz/promisify-redis'); +const redis = promisify(require('redis')); + +module.exports = (opts, logger) => { + const {host = '127.0.0.1', port = 6379, tls = false} = opts; + logger = logger || noopLogger; + + const url = process.env.JAMBONES_REDIS_USERNAME && process.env.JAMBONES_REDIS_PASSWORD ? + `${process.env.JAMBONES_REDIS_USERNAME}:${process.env.JAMBONES_REDIS_PASSWORD}@${host}:${port}` : + `${host}:${port}`; + const client = redis.createClient(tls ? `rediss://${url}` : `redis://${url}`); + ['ready', 'connect', 'reconnecting', 'error', 'end', 'warning'] + .forEach((event) => { + client.on(event, (...args) => { + if ('error' === event) { + if (process.env.NODE_ENV === 'test' && args[0]?.code === 'ECONNREFUSED') return; + logger.error({...args}, '@jambonz/realtimedb-helpers - redis error'); + } + else logger.debug({args}, `redis event ${event}`); + }); + }); + + return { + client, + purgeTtsCache: require('./lib/purge-tts-cache').bind(null, client, logger), + synthAudio: require('./lib/synth-audio').bind(null, client, logger), + getNuanceAccessToken: require('./lib/get-nuance-access-token').bind(null, client, logger), + getIbmAccessToken: require('./lib/get-ibm-access-token').bind(null, client, logger), + getTtsVoices: require('./lib/get-tts-voices').bind(null, client, logger), + }; +}; diff --git a/lib/get-ibm-access-token.js b/lib/get-ibm-access-token.js new file mode 100644 index 0000000..0e48192 --- /dev/null +++ b/lib/get-ibm-access-token.js @@ -0,0 +1,48 @@ +const formurlencoded = require('form-urlencoded'); +const {Pool} = require('undici'); +const pool = new Pool('https://iam.cloud.ibm.com'); +const {makeIbmKey, noopLogger} = require('./utils'); +const debug = require('debug')('jambonz:realtimedb-helpers'); +const HTTP_TIMEOUT = 5000; + +async function getIbmAccessToken(client, logger, apiKey) { + logger = logger || noopLogger; + try { + const key = makeIbmKey(apiKey); + const access_token = await client.getAsync(key); + if (access_token) return {access_token, servedFromCache: true}; + + /* access token not found in cache, so fetch it from Ibm */ + const payload = { + grant_type: 'urn:ibm:params:oauth:grant-type:apikey', + apikey: apiKey + }; + const {statusCode, headers, body} = await pool.request({ + path: '/identity/token', + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: formurlencoded(payload), + timeout: HTTP_TIMEOUT, + followRedirects: false + }); + + if (200 !== statusCode) { + const json = await body.json(); + logger.debug({statusCode, headers, body: json}, 'error fetching access token from Ibm'); + const err = new Error(); + err.statusCode = statusCode; + throw err; + } + const json = await body.json(); + await client.set(key, json.access_token, 'EX', json.expires_in - 30); + return {...json, servedFromCache: false}; + } catch (err) { + debug(err, 'getIbmAccessToken: Error retrieving Ibm access token'); + logger.error(err, 'getIbmAccessToken: Error retrieving Ibm access token for client_id ${clientId}'); + throw err; + } +} + +module.exports = getIbmAccessToken; diff --git a/lib/get-nuance-access-token.js b/lib/get-nuance-access-token.js new file mode 100644 index 0000000..a13c75a --- /dev/null +++ b/lib/get-nuance-access-token.js @@ -0,0 +1,49 @@ +const formurlencoded = require('form-urlencoded'); +const {Pool} = require('undici'); +const pool = new Pool('https://auth.crt.nuance.com'); +const {makeNuanceKey, makeBasicAuthHeader, noopLogger} = require('./utils'); +const debug = require('debug')('jambonz:realtimedb-helpers'); +const HTTP_TIMEOUT = 5000; + +async function getNuanceAccessToken(client, logger, clientId, secret, scope) { + logger = logger || noopLogger; + try { + const key = makeNuanceKey(clientId, secret, scope); + const access_token = await client.getAsync(key); + if (access_token) return {access_token, servedFromCache: true}; + + /* access token not found in cache, so fetch it from Nuance */ + const payload = { + grant_type: 'client_credentials', + scope + }; + const auth = makeBasicAuthHeader(clientId, secret); + const {statusCode, headers, body} = await pool.request({ + path: '/oauth2/token', + method: 'POST', + headers: { + ...auth, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: formurlencoded(payload), + timeout: HTTP_TIMEOUT, + followRedirects: false + }); + + if (200 !== statusCode) { + logger.debug({statusCode, headers, body: body.text()}, 'error fetching access token from Nuance'); + const err = new Error(); + err.statusCode = statusCode; + throw err; + } + const json = await body.json(); + await client.set(key, json.access_token, 'EX', json.expires_in - 30); + return {...json, servedFromCache: false}; + } catch (err) { + debug(err, `getNuanceAccessToken: Error retrieving Nuance access token for client_id ${clientId}`); + logger.error(err, `getNuanceAccessToken: Error retrieving Nuance access token for client_id ${clientId}`); + throw err; + } +} + +module.exports = getNuanceAccessToken; diff --git a/lib/get-tts-voices.js b/lib/get-tts-voices.js new file mode 100644 index 0000000..d2236a9 --- /dev/null +++ b/lib/get-tts-voices.js @@ -0,0 +1,111 @@ +const assert = require('assert'); +const {noopLogger, createNuanceClient} = require('./utils'); +const getNuanceAccessToken = require('./get-nuance-access-token'); +const {GetVoicesRequest, Voice} = require('../stubs/nuance/synthesizer_pb'); +const TextToSpeechV1 = require('ibm-watson/text-to-speech/v1'); +const { IamAuthenticator } = require('ibm-watson/auth'); + +const getIbmVoices = async(client, logger, credentials) => { + const {tts_region, tts_api_key} = credentials; + console.log(`region: ${tts_region}, api_key: ${tts_api_key}`); + + const textToSpeech = new TextToSpeechV1({ + authenticator: new IamAuthenticator({ + apikey: tts_api_key, + }), + serviceUrl: `https://api.${tts_region}.text-to-speech.watson.cloud.ibm.com` + }); + + const voices = await textToSpeech.listVoices(); + return voices; +}; + +const getNuanceVoices = async(client, logger, credentials) => { + const {client_id: clientId, secret: secret} = credentials; + + return new Promise(async(resolve, reject) => { + /* get a nuance access token */ + let token, nuanceClient; + try { + const access_token = await getNuanceAccessToken(client, logger, clientId, secret, 'tts'); + token = access_token.access_token; + nuanceClient = await createNuanceClient(token); + } catch (err) { + logger.error({err}, 'getTtsVoices: error retrieving access token'); + return reject(err); + } + /* retrieve all voices */ + const v = new Voice(); + const request = new GetVoicesRequest(); + request.setVoice(v); + + nuanceClient.getVoices(request, (err, response) => { + if (err) { + logger.error({err, clientId, secret, token}, 'getTtsVoices: error retrieving voices'); + return reject(err); + } + + /* return all the voices that are not restricted and eliminate duplicates */ + const voices = response.getVoicesList() + .map((v) => { + return { + language: v.getLanguage(), + name: v.getName(), + model: v.getModel(), + gender: v.getGender() === 1 ? 'male' : 'female', + restricted: v.getRestricted() + }; + }); + const v = voices + .filter((v) => v.restricted === false) + .map((v) => { + delete v.restricted; + return v; + }) + .sort((a, b) => { + if (a.language < b.language) return -1; + if (a.language > b.language) return 1; + if (a.name < b.name) return -1; + return 1; + }); + const arr = [...new Set(v.map((v) => JSON.stringify(v)))] + .map((v) => JSON.parse(v)); + resolve(arr); + }); + }); +}; + +/** + * Synthesize speech to an mp3 file, and also cache the generated speech + * in redis (base64 format) for 24 hours so as to avoid unnecessarily paying + * time and again for speech synthesis of the same text. + * It is the responsibility of the caller to unlink the mp3 file after use. + * + * @param {*} client - redis client + * @param {*} logger - pino logger + * @param {object} opts - options + * @param {string} opts.vendor - 'google' or 'aws' ('polly' is an alias for 'aws') + * @param {string} opt.language - language code + * @param {string} opts.voice - voice identifier + * @param {string} opts.text - text or ssml to synthesize + * @returns object containing filepath to an mp3 file in the /tmp folder containing + * the synthesized audio, and a variable indicating whether it was served from cache + */ +async function getTtsVoices(client, logger, {vendor, credentials}) { + logger = logger || noopLogger; + + assert.ok(['nuance', 'ibm'].includes(vendor), + `getTtsVoices not supported for vendor ${vendor}`); + + switch (vendor) { + case 'nuance': + return getNuanceVoices(client, logger, credentials); + case 'ibm': + return getIbmVoices(client, logger, credentials); + default: + break; + } +} + + +module.exports = getTtsVoices; diff --git a/lib/purge-tts-cache.js b/lib/purge-tts-cache.js new file mode 100644 index 0000000..ce17794 --- /dev/null +++ b/lib/purge-tts-cache.js @@ -0,0 +1,46 @@ +const {noopLogger, makeSynthKey} = require('./utils'); +const debug = require('debug')('jambonz:realtimedb-helpers'); + +/** + * Scan TTS Cache and purge records, use specific settings to purge just one + * @param {object} opts - options + * @param {boolean} opts.all - purge all records or only one specific, true by default + * @param {string} opts.vendor - 'google' or 'aws' ('polly' is an alias for 'aws') + * @param {string} opts.language - language code + * @param {string} opts.voice - voice identifier + * @param {string} opts.text - text or ssml to synthesize + * @returns {object} result - {error, purgedCount} + */ +async function purgeTtsCache(client, logger, {all, vendor, language, voice, deploymentId, engine, text} = {all: true}) { + logger = logger || noopLogger; + + let purgedCount = 0, error; + + try { + if (all) { + const keys = await client.keysAsync('tts:*'); + purgedCount = await client.delAsync(keys); + + } else { + const key = makeSynthKey({ + vendor, + language: language || '', + voice: voice || deploymentId, + engine, + text, + }); + purgedCount = await client.delAsync(key); + if (purgedCount === 0) error = 'Specified item not found'; + } + + } catch (err) { + debug(err, 'purgeTtsCache: Error'); + logger.error(err, 'purgeTtsCache: Error'); + error = err.message ?? 'Unknown Error'; + } + + logger.info(`purgeTtsCache: purged ${purgedCount} records`); + return {error, purgedCount}; +} + +module.exports = purgeTtsCache; diff --git a/lib/synth-audio.js b/lib/synth-audio.js new file mode 100644 index 0000000..e1773d4 --- /dev/null +++ b/lib/synth-audio.js @@ -0,0 +1,436 @@ +const assert = require('assert'); +const fs = require('fs'); +const bent = require('bent'); +const ttsGoogle = require('@google-cloud/text-to-speech'); +//const Polly = require('aws-sdk/clients/polly'); +const { PollyClient, SynthesizeSpeechCommand } = require('@aws-sdk/client-polly'); + +const sdk = require('microsoft-cognitiveservices-speech-sdk'); +const TextToSpeechV1 = require('ibm-watson/text-to-speech/v1'); +const { IamAuthenticator } = require('ibm-watson/auth'); +const { + AudioConfig, + ResultReason, + SpeechConfig, + SpeechSynthesizer, + CancellationDetails, + SpeechSynthesisOutputFormat +} = sdk; +const {makeSynthKey, createNuanceClient, noopLogger, createRivaClient} = require('./utils'); +const getNuanceAccessToken = require('./get-nuance-access-token'); +const { + SynthesisRequest, + Voice, + AudioFormat, + AudioParameters, + PCM, + Input, + Text, + SSML, + EventParameters +} = require('../stubs/nuance/synthesizer_pb'); +const {SynthesizeSpeechRequest} = require('../stubs/riva/proto/riva_tts_pb'); +const {AudioEncoding} = require('../stubs/riva/proto/riva_audio_pb'); +const debug = require('debug')('jambonz:realtimedb-helpers'); +const EXPIRES = 3600 * 24; // cache tts for 24 hours +const TMP_FOLDER = '/tmp'; + +/** + * Synthesize speech to an mp3 file, and also cache the generated speech + * in redis (base64 format) for 24 hours so as to avoid unnecessarily paying + * time and again for speech synthesis of the same text. + * It is the responsibility of the caller to unlink the mp3 file after use. + * + * @param {*} client - redis client + * @param {*} logger - pino logger + * @param {object} opts - options + * @param {string} opts.vendor - 'google' or 'aws' ('polly' is an alias for 'aws') + * @param {string} opt.language - language code + * @param {string} opts.voice - voice identifier + * @param {string} opts.text - text or ssml to synthesize + * @param {boolean} opts.disableTtsCache - disable TTS Cache retrieval + * @returns object containing filepath to an mp3 file in the /tmp folder containing + * the synthesized audio, and a variable indicating whether it was served from cache + */ +async function synthAudio(client, logger, stats, { + vendor, language, voice, gender, text, engine, salt, model, credentials, deploymentId, disableTtsCache +}) { + let audioBuffer; + let servedFromCache = false; + let rtt; + logger = logger || noopLogger; + + assert.ok(['google', 'aws', 'polly', 'microsoft', 'wellsaid', 'nuance', 'nvidia', 'ibm'].includes(vendor), + `synthAudio supported vendors are google, aws, microsoft, nuance, nvidia and wellsaid, not ${vendor}`); + if ('google' === vendor) { + assert.ok(language, 'synthAudio requires language when google is used'); + } + else if (['aws', 'polly'].includes(vendor)) { + assert.ok(voice, 'synthAudio requires voice when aws polly is used'); + } + else if ('microsoft' === vendor) { + assert.ok(language || deploymentId, 'synthAudio requires language when microsoft is used'); + assert.ok(voice || deploymentId, 'synthAudio requires voice when microsoft is used'); + } + else if ('nuance' === vendor) { + assert.ok(voice, 'synthAudio requires voice when nuance is used'); + assert.ok(credentials.client_id, 'synthAudio requires client_id in credentials when nuance is used'); + assert.ok(credentials.secret, 'synthAudio requires client_id in credentials when nuance is used'); + } + else if ('nvidia' === vendor) { + assert.ok(voice, 'synthAudio requires voice when nvidia is used'); + assert.ok(language, 'synthAudio requires language when nvidia is used'); + assert.ok(credentials.riva_uri, 'synthAudio requires riva_uri in credentials when nuance is used'); + } + else if ('ibm' === vendor) { + assert.ok(voice, 'synthAudio requires voice when ibm is used'); + assert.ok(credentials.tts_region, 'synthAudio requires tts_region in credentials when ibm watson is used'); + assert.ok(credentials.tts_api_key, 'synthAudio requires tts_api_key in credentials when nuance is used'); + } + else if ('wellsaid' === vendor) { + language = 'en-US'; // WellSaid only supports English atm + assert.ok(voice, 'synthAudio requires voice when wellsaid is used'); + assert.ok(!text.startsWith(' logger.info(err, 'Error setting expires')); + } + if (!cached) { + // not found in cache - go get it from speech vendor and add to cache + debug('result was NOT found in cache'); + stats.increment('tts.cache.requests', ['found:no']); + let vendorLabel = vendor; + const startAt = process.hrtime(); + switch (vendor) { + case 'google': + audioBuffer = await synthGoogle(logger, {credentials, stats, language, voice, gender, text}); + break; + case 'aws': + case 'polly': + vendorLabel = 'aws'; + audioBuffer = await synthPolly(logger, {credentials, stats, language, voice, text, engine}); + break; + case 'azure': + case 'microsoft': + vendorLabel = 'microsoft'; + audioBuffer = await synthMicrosoft(logger, {credentials, stats, language, voice, text, deploymentId, filePath}); + break; + case 'nuance': + model = model || 'enhanced'; + audioBuffer = await synthNuance(client, logger, {credentials, stats, voice, model, text}); + break; + case 'nvidia': + audioBuffer = await synthNvidia(client, logger, {credentials, stats, language, voice, model, text}); + break; + case 'ibm': + audioBuffer = await synthIbm(logger, {credentials, stats, voice, text}); + break; + case 'wellsaid': + audioBuffer = await synthWellSaid(logger, {credentials, stats, language, voice, text, filePath}); + break; + default: + assert(`synthAudio: unsupported speech vendor ${vendor}`); + } + const diff = process.hrtime(startAt); + const time = diff[0] * 1e3 + diff[1] * 1e-6; + rtt = time.toFixed(0); + stats.histogram('tts.response_time', rtt, [`vendor:${vendorLabel}`]); + debug(`tts rtt time for ${text.length} chars on ${vendorLabel}: ${rtt}`); + logger.info(`tts rtt time for ${text.length} chars on ${vendorLabel}: ${rtt}`); + + client.setexAsync(key, EXPIRES, audioBuffer.toString('base64')) + .catch((err) => logger.error(err, `error calling setex on key ${key}`)); + + if (['microsoft'].includes(vendor)) return {filePath, servedFromCache, rtt}; + } + + return new Promise((resolve, reject) => { + fs.writeFile(filePath, audioBuffer, (err) => { + if (err) return reject(err); + resolve({filePath, servedFromCache, rtt}); + }); + }); +} + +const synthPolly = async(logger, {credentials, stats, language, voice, engine, text}) => { + try { + const polly = new PollyClient(credentials); + const opts = { + Engine: engine, + OutputFormat: 'mp3', + Text: text, + LanguageCode: language, + TextType: text.startsWith('') ? 'ssml' : 'text', + VoiceId: voice + }; + const command = new SynthesizeSpeechCommand(opts); + const data = await polly.send(command); + const chunks = []; + return new Promise((resolve, reject) => { + data.AudioStream + .on('error', (err) => { + logger.info({err}, 'synthAudio: Error synthesizing speech using aws polly'); + stats.increment('tts.count', ['vendor:aws', 'accepted:no']); + reject(err); + }) + .on('data', (chunk) => { + chunks.push(chunk); + }) + .on('end', () => resolve(Buffer.concat(chunks))); + }); + } catch (err) { + logger.info({err}, 'synthAudio: Error synthesizing speech using aws polly'); + stats.increment('tts.count', ['vendor:aws', 'accepted:no']); + throw err; + } +}; + +const synthGoogle = async(logger, {credentials, stats, language, voice, gender, text}) => { + const client = new ttsGoogle.TextToSpeechClient(credentials); + const opts = { + voice: { + name: voice, + languageCode: language, + ssmlGender: gender || 'SSML_VOICE_GENDER_UNSPECIFIED' + }, + audioConfig: {audioEncoding: 'MP3'} + }; + Object.assign(opts, {input: text.startsWith('') ? {ssml: text} : {text}}); + try { + const responses = await client.synthesizeSpeech(opts); + stats.increment('tts.count', ['vendor:google', 'accepted:yes']); + client.close(); + return responses[0].audioContent; + } catch (err) { + console.error(err); + logger.info({err, opts}, 'synthAudio: Error synthesizing speech using google'); + stats.increment('tts.count', ['vendor:google', 'accepted:no']); + client && client.close(); + throw err; + } +}; + +const synthIbm = async(logger, {credentials, stats, voice, text}) => { + const {tts_api_key, tts_region} = credentials; + const params = { + text, + voice, + accept: 'audio/mp3' + }; + + try { + const textToSpeech = new TextToSpeechV1({ + authenticator: new IamAuthenticator({ + apikey: tts_api_key, + }), + serviceUrl: `https://api.${tts_region}.text-to-speech.watson.cloud.ibm.com` + }); + + const r = await textToSpeech.synthesize(params); + const chunks = []; + for await (const chunk of r.result) { + chunks.push(chunk); + } + return Buffer.concat(chunks); + } catch (err) { + logger.info({err, params}, 'synthAudio: Error synthesizing speech using ibm'); + stats.increment('tts.count', ['vendor:ibm', 'accepted:no']); + throw new Error(err.statusText || err.message); + } +}; + +const synthMicrosoft = async(logger, { + credentials, + stats, + language, + voice, + text, + filePath +}) => { + try { + const {api_key: apiKey, region, use_custom_tts, custom_tts_endpoint} = credentials; + let content = text; + const speechConfig = SpeechConfig.fromSubscription(apiKey, region); + speechConfig.speechSynthesisLanguage = language; + speechConfig.speechSynthesisVoiceName = voice; + if (use_custom_tts && custom_tts_endpoint) { + speechConfig.endpointId = custom_tts_endpoint; + + /** + * Note: it seems that to use custom voice ssml is required with the voice attribute + * Otherwise sending plain text we get "Voice does not match" + */ + if (!content.startsWith('${text}`; + } + speechConfig.speechSynthesisOutputFormat = SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3; + const config = AudioConfig.fromAudioFileOutput(filePath); + const synthesizer = new SpeechSynthesizer(speechConfig, config); + + if (content.startsWith('')) { + /* microsoft enforces some properties and uses voice xml element so if the user did not supply do it for them */ + const words = content.slice(7, -8).trim().replace(/(\r\n|\n|\r)/gm, ' '); + // eslint-disable-next-line max-len + content = `${words}`; + logger.info({content}, 'synthMicrosoft'); + } + + return new Promise((resolve, reject) => { + const speakAsync = content.startsWith(' { + switch (result.reason) { + case ResultReason.Canceled: + const cancellation = CancellationDetails.fromResult(result); + logger.info({reason: cancellation.errorDetails}, 'synthAudio: (Microsoft) synthesis canceled'); + synthesizer.close(); + reject(cancellation.errorDetails); + break; + case ResultReason.SynthesizingAudioCompleted: + stats.increment('tts.count', ['vendor:microsoft', 'accepted:yes']); + synthesizer.close(); + fs.readFile(filePath, (err, data) => { + if (err) return reject(err); + resolve(data); + }); + break; + default: + logger.info({result}, 'synthAudio: (Microsoft) unexpected result'); + break; + } + }, + (err) => { + logger.info({err}, 'synthAudio: (Microsoft) error synthesizing'); + stats.increment('tts.count', ['vendor:microsoft', 'accepted:no']); + synthesizer.close(); + reject(err); + }); + }); + } catch (err) { + logger.info({err}, 'synthAudio: Error synthesizing speech using Microsoft'); + stats.increment('tts.count', ['vendor:google', 'accepted:no']); + } +}; + +const synthWellSaid = async(logger, {credentials, stats, language, voice, gender, text}) => { + const {api_key} = credentials; + try { + const post = bent('https://api.wellsaidlabs.com', 'POST', 'buffer', { + 'X-Api-Key': api_key, + 'Accept': 'audio/mpeg', + 'Content-Type': 'application/json' + }); + const mp3 = await post('/v1/tts/stream', { + text, + speaker_id: voice + }); + return mp3; + } catch (err) { + logger.info({err}, 'testWellSaidTts returned error'); + throw err; + } +}; + +const synthNuance = async(client, logger, {credentials, stats, voice, model, text}) => { + /* get a nuance access token */ + const {client_id, secret} = credentials; + const {access_token} = await getNuanceAccessToken(client, logger, client_id, secret, 'tts'); + const nuanceClient = await createNuanceClient(access_token); + + const v = new Voice(); + const p = new AudioParameters(); + const f = new AudioFormat(); + const pcm = new PCM(); + const params = new EventParameters(); + const request = new SynthesisRequest(); + const input = new Input(); + + if (text.startsWith(' { + nuanceClient.unarySynthesize(request, (err, response) => { + if (err) { + console.error(err); + return reject(err); + } + const status = response.getStatus(); + const code = status.getCode(); + if (code !== 200) { + const message = status.getMessage(); + const details = status.getDetails(); + return reject({code, message, details}); + } + resolve(Buffer.from(response.getAudio())); + }); + }); +}; + +const synthNvidia = async(client, logger, {credentials, stats, language, voice, model, text}) => { + const {riva_uri} = credentials; + const rivaClient = await createRivaClient(riva_uri); + + const request = new SynthesizeSpeechRequest(); + request.setVoiceName(voice); + request.setLanguageCode(language); + request.setSampleRateHz(8000); + request.setEncoding(AudioEncoding.LINEAR_PCM); + request.setText(text); + + return new Promise((resolve, reject) => { + console.log(`language ${language} voice ${voice} model ${model} text ${text}`); + rivaClient.synthesize(request, (err, response) => { + if (err) { + console.error(err); + return reject(err); + } + resolve(Buffer.from(response.getAudio())); + }); + }); +}; + +module.exports = synthAudio; diff --git a/lib/utils.js b/lib/utils.js new file mode 100644 index 0000000..8945086 --- /dev/null +++ b/lib/utils.js @@ -0,0 +1,25 @@ +const crypto = require('crypto'); +/** + * Future TODO: cache recently used connections to providers + * to avoid connection overhead during a call. + * Will need to periodically age them out to avoid memory leaks. + */ +//const nuanceClientMap = new Map(); + +function makeSynthKey({vendor, language, voice, engine = '', text}) { + const hash = crypto.createHash('sha1'); + hash.update(`${language}:${vendor}:${voice}:${engine}:${text}`); + return `tts:${hash.digest('hex')}`; +} + +const noopLogger = { + info: () => {}, + debug: () => {}, + error: () => {} +}; + + +module.exports = { + makeSynthKey, + noopLogger +}; diff --git a/package-lock.json b/package-lock.json index 7d26957..47addb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "@aws-sdk/client-polly": "^3.269.0", "@google-cloud/text-to-speech": "^4.2.0", "@grpc/grpc-js": "^1.8.7", "@jambonz/realtimedb-helpers": "^0.6.3", @@ -21,6 +22,7 @@ "undici": "^5.18.0" }, "devDependencies": { + "config": "^3.3.9", "eslint": "^8.33.0", "eslint-plugin-promise": "^6.1.1", "nyc": "^15.1.0", @@ -41,6 +43,998 @@ "node": ">=6.0.0" } }, + "node_modules/@aws-crypto/ie11-detection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz", + "integrity": "sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz", + "integrity": "sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==", + "dependencies": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/sha256-js": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-3.0.0.tgz", + "integrity": "sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-js/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-3.0.0.tgz", + "integrity": "sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz", + "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/util/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-sdk/abort-controller": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.272.0.tgz", + "integrity": "sha512-s2TV3phapcTwZNr4qLxbfuQuE9ZMP4RoJdkvRRCkKdm6jslsWLJf2Zlcxti/23hOlINUMYv2iXE2pftIgWGdpg==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-polly": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-polly/-/client-polly-3.272.0.tgz", + "integrity": "sha512-umu0Ux4Pnwz2ox7SKzqyNxzcFyxSNEdAzhM4saFZtd4souMyA9rCSea+VYOF4ksG5hvTGgQIQv1I44MiK/DWLw==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.272.0", + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/credential-provider-node": "3.272.0", + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/hash-node": "3.272.0", + "@aws-sdk/invalid-dependency": "3.272.0", + "@aws-sdk/middleware-content-length": "3.272.0", + "@aws-sdk/middleware-endpoint": "3.272.0", + "@aws-sdk/middleware-host-header": "3.272.0", + "@aws-sdk/middleware-logger": "3.272.0", + "@aws-sdk/middleware-recursion-detection": "3.272.0", + "@aws-sdk/middleware-retry": "3.272.0", + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/middleware-signing": "3.272.0", + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/middleware-user-agent": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/smithy-client": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.272.0", + "@aws-sdk/util-defaults-mode-node": "3.272.0", + "@aws-sdk/util-endpoints": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "@aws-sdk/util-stream-browser": "3.272.0", + "@aws-sdk/util-stream-node": "3.272.0", + "@aws-sdk/util-user-agent-browser": "3.272.0", + "@aws-sdk/util-user-agent-node": "3.272.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.272.0.tgz", + "integrity": "sha512-xn9a0IGONwQIARmngThoRhF1lLGjHAD67sUaShgIMaIMc6ipVYN6alWG1VuUpoUQ6iiwMEt0CHdfCyLyUV/fTA==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/hash-node": "3.272.0", + "@aws-sdk/invalid-dependency": "3.272.0", + "@aws-sdk/middleware-content-length": "3.272.0", + "@aws-sdk/middleware-endpoint": "3.272.0", + "@aws-sdk/middleware-host-header": "3.272.0", + "@aws-sdk/middleware-logger": "3.272.0", + "@aws-sdk/middleware-recursion-detection": "3.272.0", + "@aws-sdk/middleware-retry": "3.272.0", + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/middleware-user-agent": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/smithy-client": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.272.0", + "@aws-sdk/util-defaults-mode-node": "3.272.0", + "@aws-sdk/util-endpoints": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "@aws-sdk/util-user-agent-browser": "3.272.0", + "@aws-sdk/util-user-agent-node": "3.272.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.272.0.tgz", + "integrity": "sha512-ECcXu3xoa1yggnGKMTh29eWNHiF/wC6r5Uqbla22eOOosyh0+Z6lkJ3JUSLOUKCkBXA4Cs/tJL9UDFBrKbSlvA==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/hash-node": "3.272.0", + "@aws-sdk/invalid-dependency": "3.272.0", + "@aws-sdk/middleware-content-length": "3.272.0", + "@aws-sdk/middleware-endpoint": "3.272.0", + "@aws-sdk/middleware-host-header": "3.272.0", + "@aws-sdk/middleware-logger": "3.272.0", + "@aws-sdk/middleware-recursion-detection": "3.272.0", + "@aws-sdk/middleware-retry": "3.272.0", + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/middleware-user-agent": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/smithy-client": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.272.0", + "@aws-sdk/util-defaults-mode-node": "3.272.0", + "@aws-sdk/util-endpoints": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "@aws-sdk/util-user-agent-browser": "3.272.0", + "@aws-sdk/util-user-agent-node": "3.272.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sts": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.272.0.tgz", + "integrity": "sha512-kigxCxURp3WupufGaL/LABMb7UQfzAQkKcj9royizL3ItJ0vw5kW/JFrPje5IW1mfLgdPF7PI9ShOjE0fCLTqA==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/credential-provider-node": "3.272.0", + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/hash-node": "3.272.0", + "@aws-sdk/invalid-dependency": "3.272.0", + "@aws-sdk/middleware-content-length": "3.272.0", + "@aws-sdk/middleware-endpoint": "3.272.0", + "@aws-sdk/middleware-host-header": "3.272.0", + "@aws-sdk/middleware-logger": "3.272.0", + "@aws-sdk/middleware-recursion-detection": "3.272.0", + "@aws-sdk/middleware-retry": "3.272.0", + "@aws-sdk/middleware-sdk-sts": "3.272.0", + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/middleware-signing": "3.272.0", + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/middleware-user-agent": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/smithy-client": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.272.0", + "@aws-sdk/util-defaults-mode-node": "3.272.0", + "@aws-sdk/util-endpoints": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "@aws-sdk/util-user-agent-browser": "3.272.0", + "@aws-sdk/util-user-agent-node": "3.272.0", + "@aws-sdk/util-utf8": "3.254.0", + "fast-xml-parser": "4.0.11", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/config-resolver": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/config-resolver/-/config-resolver-3.272.0.tgz", + "integrity": "sha512-Dr4CffRVNsOp3LRNdpvcH6XuSgXOSLblWliCy/5I86cNl567KVMxujVx6uPrdTXYs2h1rt3MNl6jQGnAiJeTbw==", + "dependencies": { + "@aws-sdk/signature-v4": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-config-provider": "3.208.0", + "@aws-sdk/util-middleware": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.272.0.tgz", + "integrity": "sha512-QI65NbLnKLYHyTYhXaaUrq6eVsCCrMUb05WDA7+TJkWkjXesovpjc8vUKgFiLSxmgKmb2uOhHNcDyObKMrYQFw==", + "dependencies": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-imds": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-imds/-/credential-provider-imds-3.272.0.tgz", + "integrity": "sha512-wwAfVY1jTFQEfxVfdYD5r5ieYGl+0g4nhekVxNMqE8E1JeRDd18OqiwAflzpgBIqxfqvCUkf+vl5JYyacMkNAQ==", + "dependencies": { + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.272.0.tgz", + "integrity": "sha512-iE3CDzK5NcupHYjfYjBdY1JCy8NLEoRUsboEjG0i0gy3S3jVpDeVHX1dLVcL/slBFj6GiM7SoNV/UfKnJf3Gaw==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.272.0", + "@aws-sdk/credential-provider-imds": "3.272.0", + "@aws-sdk/credential-provider-process": "3.272.0", + "@aws-sdk/credential-provider-sso": "3.272.0", + "@aws-sdk/credential-provider-web-identity": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.272.0.tgz", + "integrity": "sha512-FI8uvwM1IxiRSvbkdKv8DZG5vxU3ezaseTaB1fHWTxEUFb0pWIoHX9oeOKer9Fj31SOZTCNAaYFURbSRuZlm/w==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.272.0", + "@aws-sdk/credential-provider-imds": "3.272.0", + "@aws-sdk/credential-provider-ini": "3.272.0", + "@aws-sdk/credential-provider-process": "3.272.0", + "@aws-sdk/credential-provider-sso": "3.272.0", + "@aws-sdk/credential-provider-web-identity": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.272.0.tgz", + "integrity": "sha512-hiCAjWWm2PeBFp5cjkxqyam/XADjiS+e7GzwC34TbZn3LisS0uoweLojj9tD11NnnUhyhbLteUvu5+rotOLwrg==", + "dependencies": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.272.0.tgz", + "integrity": "sha512-hwYaulyiU/7chKKFecxCeo0ls6Dxs7h+5EtoYcJJGvfpvCncyOZF35t00OAsCd3Wo7HkhhgfpGdb6dmvCNQAZQ==", + "dependencies": { + "@aws-sdk/client-sso": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/token-providers": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.272.0.tgz", + "integrity": "sha512-ImrHMkcgneGa/HadHAQXPwOrX26sAKuB8qlMxZF/ZCM2B55u8deY+ZVkVuraeKb7YsahMGehPFOfRAF6mvFI5Q==", + "dependencies": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/fetch-http-handler": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.272.0.tgz", + "integrity": "sha512-1Qhm9e0RbS1Xf4CZqUbQyUMkDLd7GrsRXWIvm9b86/vgeV8/WnjO3CMue9D51nYgcyQORhYXv6uVjAYCWbUExA==", + "dependencies": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/querystring-builder": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/hash-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/hash-node/-/hash-node-3.272.0.tgz", + "integrity": "sha512-40dwND+iAm3VtPHPZu7/+CIdVJFk2s0cWZt1lOiMPMSXycSYJ45wMk7Lly3uoqRx0uWfFK5iT2OCv+fJi5jTng==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-buffer-from": "3.208.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/invalid-dependency": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/invalid-dependency/-/invalid-dependency-3.272.0.tgz", + "integrity": "sha512-ysW6wbjl1Y78txHUQ/Tldj2Rg1BI7rpMO9B9xAF6yAX3mQ7t6SUPQG/ewOGvH2208NBIl3qP5e/hDf0Q6r/1iw==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/is-array-buffer": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/is-array-buffer/-/is-array-buffer-3.201.0.tgz", + "integrity": "sha512-UPez5qLh3dNgt0DYnPD/q0mVJY84rA17QE26hVNOW3fAji8W2wrwrxdacWOxyXvlxWsVRcKmr+lay1MDqpAMfg==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-content-length": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-content-length/-/middleware-content-length-3.272.0.tgz", + "integrity": "sha512-sAbDZSTNmLX+UTGwlUHJBWy0QGQkiClpHwVFXACon+aG0ySLNeRKEVYs6NCPYldw4cj6hveLUn50cX44ukHErw==", + "dependencies": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-endpoint": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-endpoint/-/middleware-endpoint-3.272.0.tgz", + "integrity": "sha512-Dk3JVjj7SxxoUKv3xGiOeBksvPtFhTDrVW75XJ98Ymv8gJH5L1sq4hIeJAHRKogGiRFq2J73mnZSlM9FVXEylg==", + "dependencies": { + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/signature-v4": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-config-provider": "3.208.0", + "@aws-sdk/util-middleware": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.272.0.tgz", + "integrity": "sha512-Q8K7bMMFZnioUXpxn57HIt4p+I63XaNAawMLIZ5B4F2piyukbQeM9q2XVKMGwqLvijHR8CyP5nHrtKqVuINogQ==", + "dependencies": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.272.0.tgz", + "integrity": "sha512-u2SQ0hWrFwxbxxYMG5uMEgf01pQY5jauK/LYWgGIvuCmFgiyRQQP3oN7kkmsxnS9MWmNmhbyQguX2NY02s5e9w==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.272.0.tgz", + "integrity": "sha512-Gp/eKWeUWVNiiBdmUM2qLkBv+VLSJKoWAO+aKmyxxwjjmWhE0FrfA1NQ1a3g+NGMhRbAfQdaYswRAKsul70ISg==", + "dependencies": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-retry": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-retry/-/middleware-retry-3.272.0.tgz", + "integrity": "sha512-pCGvHM7C76VbO/dFerH+Vwf7tGv7j+e+eGrvhQ35mRghCtfIou/WMfTZlD1TNee93crrAQQVZKjtW3dMB3WCzg==", + "dependencies": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/service-error-classification": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-middleware": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "tslib": "^2.3.1", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-retry/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@aws-sdk/middleware-sdk-sts": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.272.0.tgz", + "integrity": "sha512-VvYPg7LrDIjUOWueSzo2wBzcNG7dw+cmzV6zAKaLxf0RC5jeAP4hE0OzDiiZfDrjNghEzgq/V+0NO+LewqYL9Q==", + "dependencies": { + "@aws-sdk/middleware-signing": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/signature-v4": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-serde": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-serde/-/middleware-serde-3.272.0.tgz", + "integrity": "sha512-kW1uOxgPSwtXPB5rm3QLdWomu42lkYpQL94tM1BjyFOWmBLO2lQhk5a7Dw6HkTozT9a+vxtscLChRa6KZe61Hw==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.272.0.tgz", + "integrity": "sha512-4LChFK4VAR91X+dupqM8fQqYhFGE0G4Bf9rQlVTgGSbi2KUOmpqXzH0/WKE228nKuEhmH8+Qd2VPSAE2JcyAUA==", + "dependencies": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/signature-v4": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-middleware": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-stack": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-stack/-/middleware-stack-3.272.0.tgz", + "integrity": "sha512-jhwhknnPBGhfXAGV5GXUWfEhDFoP/DN8MPCO2yC5OAxyp6oVJ8lTPLkZYMTW5VL0c0eG44dXpF4Ib01V+PlDrQ==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.272.0.tgz", + "integrity": "sha512-Qy7/0fsDJxY5l0bEk7WKDfqb4Os/sCAgFR2zEvrhDtbkhYPf72ysvg/nRUTncmCbo8tOok4SJii2myk8KMfjjw==", + "dependencies": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/node-config-provider": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-config-provider/-/node-config-provider-3.272.0.tgz", + "integrity": "sha512-YYCIBh9g1EQo7hm2l22HX5Yr9RoPQ2RCvhzKvF1n1e8t1QH4iObQrYUtqHG4khcm64Cft8C5MwZmgzHbya5Z6Q==", + "dependencies": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/node-http-handler": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.272.0.tgz", + "integrity": "sha512-VrW9PjhhngeyYp4yGYPe5S0vgZH6NwU3Po9xAgayUeE37Inr7LS1YteFMHdpgsUUeNXnh7d06CXqHo1XjtqOKA==", + "dependencies": { + "@aws-sdk/abort-controller": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/querystring-builder": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/property-provider": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/property-provider/-/property-provider-3.272.0.tgz", + "integrity": "sha512-V1pZTaH5eqpAt8O8CzbItHhOtzIfFuWymvwZFkAtwKuaHpnl7jjrTouV482zoq8AD/fF+VVSshwBKYA7bhidIw==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/protocol-http": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/protocol-http/-/protocol-http-3.272.0.tgz", + "integrity": "sha512-4JQ54v5Yn08jspNDeHo45CaSn1CvTJqS1Ywgr79eU6jBExtguOWv6LNtwVSBD9X37v88iqaxt8iu1Z3pZZAJeg==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/querystring-builder": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-builder/-/querystring-builder-3.272.0.tgz", + "integrity": "sha512-ndo++7GkdCj5tBXE6rGcITpSpZS4PfyV38wntGYAlj9liL1omk3bLZRY6uzqqkJpVHqbg2fD7O2qHNItzZgqhw==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/querystring-parser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-parser/-/querystring-parser-3.272.0.tgz", + "integrity": "sha512-5oS4/9n6N1LZW9tI3qq/0GnCuWoOXRgcHVB+AJLRBvDbEe+GI+C/xK1tKLsfpDNgsQJHc4IPQoIt4megyZ/1+A==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/service-error-classification": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/service-error-classification/-/service-error-classification-3.272.0.tgz", + "integrity": "sha512-REoltM1LK9byyIufLqx9znhSolPcHQgVHIA2S0zu5sdt5qER4OubkLAXuo4MBbisUTmh8VOOvIyUb5ijZCXq1w==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/shared-ini-file-loader": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.272.0.tgz", + "integrity": "sha512-lzFPohp5sy2XvwFjZIzLVCRpC0i5cwBiaXmFzXYQZJm6FSCszHO4ax+m9yrtlyVFF/2YPWl+/bzNthy4aJtseA==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/signature-v4": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4/-/signature-v4-3.272.0.tgz", + "integrity": "sha512-pWxnHG1NqJWMwlhJ6NHNiUikOL00DHROmxah6krJPMPq4I3am2KY2Rs/8ouWhnEXKaHAv4EQhSALJ+7Mq5S4/A==", + "dependencies": { + "@aws-sdk/is-array-buffer": "3.201.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-hex-encoding": "3.201.0", + "@aws-sdk/util-middleware": "3.272.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/smithy-client": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/smithy-client/-/smithy-client-3.272.0.tgz", + "integrity": "sha512-pvdleJ3kaRvyRw2pIZnqL85ZlWBOZrPKmR9I69GCvlyrfdjRBhbSjIEZ+sdhZudw0vdHxq25AGoLUXhofVLf5Q==", + "dependencies": { + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.272.0.tgz", + "integrity": "sha512-0GISJ4IKN2rXvbSddB775VjBGSKhYIGQnAdMqbvxi9LB6pSvVxcH9aIL28G0spiuL+dy3yGQZ8RlJPAyP9JW9A==", + "dependencies": { + "@aws-sdk/client-sso-oidc": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.272.0.tgz", + "integrity": "sha512-MmmL6vxMGP5Bsi+4wRx4mxYlU/LX6M0noOXrDh/x5FfG7/4ZOar/nDxqDadhJtNM88cuWVHZWY59P54JzkGWmA==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/url-parser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/url-parser/-/url-parser-3.272.0.tgz", + "integrity": "sha512-vX/Tx02PlnQ/Kgtf5TnrNDHPNbY+amLZjW0Z1d9vzAvSZhQ4i9Y18yxoRDIaDTCNVRDjdhV8iuctW+05PB5JtQ==", + "dependencies": { + "@aws-sdk/querystring-parser": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-base64": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64/-/util-base64-3.208.0.tgz", + "integrity": "sha512-PQniZph5A6N7uuEOQi+1hnMz/FSOK/8kMFyFO+4DgA1dZ5pcKcn5wiFwHkcTb/BsgVqQa3Jx0VHNnvhlS8JyTg==", + "dependencies": { + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-body-length-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-browser/-/util-body-length-browser-3.188.0.tgz", + "integrity": "sha512-8VpnwFWXhnZ/iRSl9mTf+VKOX9wDE8QtN4bj9pBfxwf90H1X7E8T6NkiZD3k+HubYf2J94e7DbeHs7fuCPW5Qg==", + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-body-length-node": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-node/-/util-body-length-node-3.208.0.tgz", + "integrity": "sha512-3zj50e5g7t/MQf53SsuuSf0hEELzMtD8RX8C76f12OSRo2Bca4FLLYHe0TZbxcfQHom8/hOaeZEyTyMogMglqg==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-buffer-from": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-buffer-from/-/util-buffer-from-3.208.0.tgz", + "integrity": "sha512-7L0XUixNEFcLUGPeBF35enCvB9Xl+K6SQsmbrPk1P3mlV9mguWSDQqbOBwY1Ir0OVbD6H/ZOQU7hI/9RtRI0Zw==", + "dependencies": { + "@aws-sdk/is-array-buffer": "3.201.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-config-provider": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-config-provider/-/util-config-provider-3.208.0.tgz", + "integrity": "sha512-DSRqwrERUsT34ug+anlMBIFooBEGwM8GejC7q00Y/9IPrQy50KnG5PW2NiTjuLKNi7pdEOlwTSEocJE15eDZIg==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-defaults-mode-browser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-browser/-/util-defaults-mode-browser-3.272.0.tgz", + "integrity": "sha512-W8ZVJSZRuUBg8l0JEZzUc+9fKlthVp/cdE+pFeF8ArhZelOLCiaeCrMaZAeJusaFzIpa6cmOYQAjtSMVyrwRtg==", + "dependencies": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@aws-sdk/util-defaults-mode-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-node/-/util-defaults-mode-node-3.272.0.tgz", + "integrity": "sha512-U0NTcbMw6KFk7uz/avBmfxQSTREEiX6JDMH68oN/3ux4AICd2I4jHyxnloSWGuiER1FxZf1dEJ8ZTwy8Ibl21Q==", + "dependencies": { + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/credential-provider-imds": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.272.0.tgz", + "integrity": "sha512-c4MPUaJt2G6gGpoiwIOqDfUa98c1J63RpYvf/spQEKOtC/tF5Gfqlxuq8FnAl5lHnrqj1B9ZXLLxFhHtDR0IiQ==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-hex-encoding": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.201.0.tgz", + "integrity": "sha512-7t1vR1pVxKx0motd3X9rI3m/xNp78p3sHtP5yo4NP4ARpxyJ0fokBomY8ScaH2D/B+U5o9ARxldJUdMqyBlJcA==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.208.0.tgz", + "integrity": "sha512-iua1A2+P7JJEDHVgvXrRJSvsnzG7stYSGQnBVphIUlemwl6nN5D+QrgbjECtrbxRz8asYFHSzhdhECqN+tFiBg==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-middleware": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-middleware/-/util-middleware-3.272.0.tgz", + "integrity": "sha512-Abw8m30arbwxqmeMMha5J11ESpHUNmCeSqSzE8/C4B8jZQtHY4kq7f+upzcNIQ11lsd+uzBEzNG3+dDRi0XOJQ==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-retry": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-retry/-/util-retry-3.272.0.tgz", + "integrity": "sha512-Ngha5414LR4gRHURVKC9ZYXsEJhMkm+SJ+44wlzOhavglfdcKKPUsibz5cKY1jpUV7oKECwaxHWpBB8r6h+hOg==", + "dependencies": { + "@aws-sdk/service-error-classification": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@aws-sdk/util-stream-browser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-stream-browser/-/util-stream-browser-3.272.0.tgz", + "integrity": "sha512-vD514YffKxBjV/erjUNgkXcb/mzXAz3uk/KUFMXsodo3cA4Z8WxL4P0p1O09FVuJlNa0gZ8mhFPNzNOekh31GA==", + "dependencies": { + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-hex-encoding": "3.201.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-stream-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-stream-node/-/util-stream-node-3.272.0.tgz", + "integrity": "sha512-s7dGeM1ImzihqBKgrpaeZokLnPUk3H4Et5oiM+t+TpRxotXTecJPyuD0p76HRgO8KSXfVT5Nxw/FoHXqj1fiMg==", + "dependencies": { + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-uri-escape": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-uri-escape/-/util-uri-escape-3.201.0.tgz", + "integrity": "sha512-TeTWbGx4LU2c5rx0obHeDFeO9HvwYwQtMh1yniBz00pQb6Qt6YVOETVQikRZ+XRQwEyCg/dA375UplIpiy54mA==", + "dependencies": { + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.272.0.tgz", + "integrity": "sha512-Lp5QX5bH6uuwBlIdr7w7OAcAI50ttyskb++yUr9i+SPvj6RI2dsfIBaK4mDg1qUdM5LeUdvIyqwj3XHjFKAAvA==", + "dependencies": { + "@aws-sdk/types": "3.272.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.272.0.tgz", + "integrity": "sha512-ljK+R3l+Q1LIHrcR+Knhk0rmcSkfFadZ8V+crEGpABf/QUQRg7NkZMsoe814tfBO5F7tMxo8wwwSdaVNNHtoRA==", + "dependencies": { + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/util-utf8": { + "version": "3.254.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8/-/util-utf8-3.254.0.tgz", + "integrity": "sha512-14Kso/eIt5/qfIBmhEL9L1IfyUqswjSTqO2mY7KOzUZ9SZbwn3rpxmtkhmATkRjD7XIlLKaxBkI7tU9Zjzj8Kw==", + "dependencies": { + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-utf8-browser": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz", + "integrity": "sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==", + "dependencies": { + "tslib": "^2.3.1" + } + }, "node_modules/@babel/code-frame": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", @@ -1336,6 +2330,11 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, + "node_modules/bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -1577,6 +2576,18 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/config": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/config/-/config-3.3.9.tgz", + "integrity": "sha512-G17nfe+cY7kR0wVpc49NCYvNtelm/pPy8czHoFkAgtV1lkmcp7DHtWCdDu+C9Z7gb2WVqa9Tm3uF9aKaPbCfhg==", + "dev": true, + "dependencies": { + "json5": "^2.2.3" + }, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", @@ -2398,6 +3409,21 @@ "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz", "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==" }, + "node_modules/fast-xml-parser": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.11.tgz", + "integrity": "sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA==", + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + }, "node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -5631,6 +6657,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, "node_modules/strtok3": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.3.0.tgz", @@ -5920,6 +6951,11 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + }, "node_modules/type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", @@ -6392,6 +7428,840 @@ "@jridgewell/trace-mapping": "^0.3.9" } }, + "@aws-crypto/ie11-detection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz", + "integrity": "sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==", + "requires": { + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, + "@aws-crypto/sha256-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz", + "integrity": "sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==", + "requires": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/sha256-js": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, + "@aws-crypto/sha256-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-3.0.0.tgz", + "integrity": "sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==", + "requires": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, + "@aws-crypto/supports-web-crypto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-3.0.0.tgz", + "integrity": "sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==", + "requires": { + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, + "@aws-crypto/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz", + "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==", + "requires": { + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, + "@aws-sdk/abort-controller": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/abort-controller/-/abort-controller-3.272.0.tgz", + "integrity": "sha512-s2TV3phapcTwZNr4qLxbfuQuE9ZMP4RoJdkvRRCkKdm6jslsWLJf2Zlcxti/23hOlINUMYv2iXE2pftIgWGdpg==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/client-polly": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-polly/-/client-polly-3.272.0.tgz", + "integrity": "sha512-umu0Ux4Pnwz2ox7SKzqyNxzcFyxSNEdAzhM4saFZtd4souMyA9rCSea+VYOF4ksG5hvTGgQIQv1I44MiK/DWLw==", + "requires": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.272.0", + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/credential-provider-node": "3.272.0", + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/hash-node": "3.272.0", + "@aws-sdk/invalid-dependency": "3.272.0", + "@aws-sdk/middleware-content-length": "3.272.0", + "@aws-sdk/middleware-endpoint": "3.272.0", + "@aws-sdk/middleware-host-header": "3.272.0", + "@aws-sdk/middleware-logger": "3.272.0", + "@aws-sdk/middleware-recursion-detection": "3.272.0", + "@aws-sdk/middleware-retry": "3.272.0", + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/middleware-signing": "3.272.0", + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/middleware-user-agent": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/smithy-client": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.272.0", + "@aws-sdk/util-defaults-mode-node": "3.272.0", + "@aws-sdk/util-endpoints": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "@aws-sdk/util-stream-browser": "3.272.0", + "@aws-sdk/util-stream-node": "3.272.0", + "@aws-sdk/util-user-agent-browser": "3.272.0", + "@aws-sdk/util-user-agent-node": "3.272.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/client-sso": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.272.0.tgz", + "integrity": "sha512-xn9a0IGONwQIARmngThoRhF1lLGjHAD67sUaShgIMaIMc6ipVYN6alWG1VuUpoUQ6iiwMEt0CHdfCyLyUV/fTA==", + "requires": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/hash-node": "3.272.0", + "@aws-sdk/invalid-dependency": "3.272.0", + "@aws-sdk/middleware-content-length": "3.272.0", + "@aws-sdk/middleware-endpoint": "3.272.0", + "@aws-sdk/middleware-host-header": "3.272.0", + "@aws-sdk/middleware-logger": "3.272.0", + "@aws-sdk/middleware-recursion-detection": "3.272.0", + "@aws-sdk/middleware-retry": "3.272.0", + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/middleware-user-agent": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/smithy-client": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.272.0", + "@aws-sdk/util-defaults-mode-node": "3.272.0", + "@aws-sdk/util-endpoints": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "@aws-sdk/util-user-agent-browser": "3.272.0", + "@aws-sdk/util-user-agent-node": "3.272.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/client-sso-oidc": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.272.0.tgz", + "integrity": "sha512-ECcXu3xoa1yggnGKMTh29eWNHiF/wC6r5Uqbla22eOOosyh0+Z6lkJ3JUSLOUKCkBXA4Cs/tJL9UDFBrKbSlvA==", + "requires": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/hash-node": "3.272.0", + "@aws-sdk/invalid-dependency": "3.272.0", + "@aws-sdk/middleware-content-length": "3.272.0", + "@aws-sdk/middleware-endpoint": "3.272.0", + "@aws-sdk/middleware-host-header": "3.272.0", + "@aws-sdk/middleware-logger": "3.272.0", + "@aws-sdk/middleware-recursion-detection": "3.272.0", + "@aws-sdk/middleware-retry": "3.272.0", + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/middleware-user-agent": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/smithy-client": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.272.0", + "@aws-sdk/util-defaults-mode-node": "3.272.0", + "@aws-sdk/util-endpoints": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "@aws-sdk/util-user-agent-browser": "3.272.0", + "@aws-sdk/util-user-agent-node": "3.272.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/client-sts": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.272.0.tgz", + "integrity": "sha512-kigxCxURp3WupufGaL/LABMb7UQfzAQkKcj9royizL3ItJ0vw5kW/JFrPje5IW1mfLgdPF7PI9ShOjE0fCLTqA==", + "requires": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/credential-provider-node": "3.272.0", + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/hash-node": "3.272.0", + "@aws-sdk/invalid-dependency": "3.272.0", + "@aws-sdk/middleware-content-length": "3.272.0", + "@aws-sdk/middleware-endpoint": "3.272.0", + "@aws-sdk/middleware-host-header": "3.272.0", + "@aws-sdk/middleware-logger": "3.272.0", + "@aws-sdk/middleware-recursion-detection": "3.272.0", + "@aws-sdk/middleware-retry": "3.272.0", + "@aws-sdk/middleware-sdk-sts": "3.272.0", + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/middleware-signing": "3.272.0", + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/middleware-user-agent": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/smithy-client": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-body-length-browser": "3.188.0", + "@aws-sdk/util-body-length-node": "3.208.0", + "@aws-sdk/util-defaults-mode-browser": "3.272.0", + "@aws-sdk/util-defaults-mode-node": "3.272.0", + "@aws-sdk/util-endpoints": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "@aws-sdk/util-user-agent-browser": "3.272.0", + "@aws-sdk/util-user-agent-node": "3.272.0", + "@aws-sdk/util-utf8": "3.254.0", + "fast-xml-parser": "4.0.11", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/config-resolver": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/config-resolver/-/config-resolver-3.272.0.tgz", + "integrity": "sha512-Dr4CffRVNsOp3LRNdpvcH6XuSgXOSLblWliCy/5I86cNl567KVMxujVx6uPrdTXYs2h1rt3MNl6jQGnAiJeTbw==", + "requires": { + "@aws-sdk/signature-v4": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-config-provider": "3.208.0", + "@aws-sdk/util-middleware": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-env": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.272.0.tgz", + "integrity": "sha512-QI65NbLnKLYHyTYhXaaUrq6eVsCCrMUb05WDA7+TJkWkjXesovpjc8vUKgFiLSxmgKmb2uOhHNcDyObKMrYQFw==", + "requires": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-imds": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-imds/-/credential-provider-imds-3.272.0.tgz", + "integrity": "sha512-wwAfVY1jTFQEfxVfdYD5r5ieYGl+0g4nhekVxNMqE8E1JeRDd18OqiwAflzpgBIqxfqvCUkf+vl5JYyacMkNAQ==", + "requires": { + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-ini": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.272.0.tgz", + "integrity": "sha512-iE3CDzK5NcupHYjfYjBdY1JCy8NLEoRUsboEjG0i0gy3S3jVpDeVHX1dLVcL/slBFj6GiM7SoNV/UfKnJf3Gaw==", + "requires": { + "@aws-sdk/credential-provider-env": "3.272.0", + "@aws-sdk/credential-provider-imds": "3.272.0", + "@aws-sdk/credential-provider-process": "3.272.0", + "@aws-sdk/credential-provider-sso": "3.272.0", + "@aws-sdk/credential-provider-web-identity": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.272.0.tgz", + "integrity": "sha512-FI8uvwM1IxiRSvbkdKv8DZG5vxU3ezaseTaB1fHWTxEUFb0pWIoHX9oeOKer9Fj31SOZTCNAaYFURbSRuZlm/w==", + "requires": { + "@aws-sdk/credential-provider-env": "3.272.0", + "@aws-sdk/credential-provider-imds": "3.272.0", + "@aws-sdk/credential-provider-ini": "3.272.0", + "@aws-sdk/credential-provider-process": "3.272.0", + "@aws-sdk/credential-provider-sso": "3.272.0", + "@aws-sdk/credential-provider-web-identity": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-process": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.272.0.tgz", + "integrity": "sha512-hiCAjWWm2PeBFp5cjkxqyam/XADjiS+e7GzwC34TbZn3LisS0uoweLojj9tD11NnnUhyhbLteUvu5+rotOLwrg==", + "requires": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-sso": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.272.0.tgz", + "integrity": "sha512-hwYaulyiU/7chKKFecxCeo0ls6Dxs7h+5EtoYcJJGvfpvCncyOZF35t00OAsCd3Wo7HkhhgfpGdb6dmvCNQAZQ==", + "requires": { + "@aws-sdk/client-sso": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/token-providers": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/credential-provider-web-identity": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.272.0.tgz", + "integrity": "sha512-ImrHMkcgneGa/HadHAQXPwOrX26sAKuB8qlMxZF/ZCM2B55u8deY+ZVkVuraeKb7YsahMGehPFOfRAF6mvFI5Q==", + "requires": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/fetch-http-handler": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/fetch-http-handler/-/fetch-http-handler-3.272.0.tgz", + "integrity": "sha512-1Qhm9e0RbS1Xf4CZqUbQyUMkDLd7GrsRXWIvm9b86/vgeV8/WnjO3CMue9D51nYgcyQORhYXv6uVjAYCWbUExA==", + "requires": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/querystring-builder": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/hash-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/hash-node/-/hash-node-3.272.0.tgz", + "integrity": "sha512-40dwND+iAm3VtPHPZu7/+CIdVJFk2s0cWZt1lOiMPMSXycSYJ45wMk7Lly3uoqRx0uWfFK5iT2OCv+fJi5jTng==", + "requires": { + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-buffer-from": "3.208.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/invalid-dependency": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/invalid-dependency/-/invalid-dependency-3.272.0.tgz", + "integrity": "sha512-ysW6wbjl1Y78txHUQ/Tldj2Rg1BI7rpMO9B9xAF6yAX3mQ7t6SUPQG/ewOGvH2208NBIl3qP5e/hDf0Q6r/1iw==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/is-array-buffer": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/is-array-buffer/-/is-array-buffer-3.201.0.tgz", + "integrity": "sha512-UPez5qLh3dNgt0DYnPD/q0mVJY84rA17QE26hVNOW3fAji8W2wrwrxdacWOxyXvlxWsVRcKmr+lay1MDqpAMfg==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-content-length": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-content-length/-/middleware-content-length-3.272.0.tgz", + "integrity": "sha512-sAbDZSTNmLX+UTGwlUHJBWy0QGQkiClpHwVFXACon+aG0ySLNeRKEVYs6NCPYldw4cj6hveLUn50cX44ukHErw==", + "requires": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-endpoint": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-endpoint/-/middleware-endpoint-3.272.0.tgz", + "integrity": "sha512-Dk3JVjj7SxxoUKv3xGiOeBksvPtFhTDrVW75XJ98Ymv8gJH5L1sq4hIeJAHRKogGiRFq2J73mnZSlM9FVXEylg==", + "requires": { + "@aws-sdk/middleware-serde": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/signature-v4": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/url-parser": "3.272.0", + "@aws-sdk/util-config-provider": "3.208.0", + "@aws-sdk/util-middleware": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-host-header": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.272.0.tgz", + "integrity": "sha512-Q8K7bMMFZnioUXpxn57HIt4p+I63XaNAawMLIZ5B4F2piyukbQeM9q2XVKMGwqLvijHR8CyP5nHrtKqVuINogQ==", + "requires": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-logger": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.272.0.tgz", + "integrity": "sha512-u2SQ0hWrFwxbxxYMG5uMEgf01pQY5jauK/LYWgGIvuCmFgiyRQQP3oN7kkmsxnS9MWmNmhbyQguX2NY02s5e9w==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-recursion-detection": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.272.0.tgz", + "integrity": "sha512-Gp/eKWeUWVNiiBdmUM2qLkBv+VLSJKoWAO+aKmyxxwjjmWhE0FrfA1NQ1a3g+NGMhRbAfQdaYswRAKsul70ISg==", + "requires": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-retry": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-retry/-/middleware-retry-3.272.0.tgz", + "integrity": "sha512-pCGvHM7C76VbO/dFerH+Vwf7tGv7j+e+eGrvhQ35mRghCtfIou/WMfTZlD1TNee93crrAQQVZKjtW3dMB3WCzg==", + "requires": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/service-error-classification": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-middleware": "3.272.0", + "@aws-sdk/util-retry": "3.272.0", + "tslib": "^2.3.1", + "uuid": "^8.3.2" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } + }, + "@aws-sdk/middleware-sdk-sts": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.272.0.tgz", + "integrity": "sha512-VvYPg7LrDIjUOWueSzo2wBzcNG7dw+cmzV6zAKaLxf0RC5jeAP4hE0OzDiiZfDrjNghEzgq/V+0NO+LewqYL9Q==", + "requires": { + "@aws-sdk/middleware-signing": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/signature-v4": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-serde": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-serde/-/middleware-serde-3.272.0.tgz", + "integrity": "sha512-kW1uOxgPSwtXPB5rm3QLdWomu42lkYpQL94tM1BjyFOWmBLO2lQhk5a7Dw6HkTozT9a+vxtscLChRa6KZe61Hw==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-signing": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.272.0.tgz", + "integrity": "sha512-4LChFK4VAR91X+dupqM8fQqYhFGE0G4Bf9rQlVTgGSbi2KUOmpqXzH0/WKE228nKuEhmH8+Qd2VPSAE2JcyAUA==", + "requires": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/signature-v4": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-middleware": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-stack": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-stack/-/middleware-stack-3.272.0.tgz", + "integrity": "sha512-jhwhknnPBGhfXAGV5GXUWfEhDFoP/DN8MPCO2yC5OAxyp6oVJ8lTPLkZYMTW5VL0c0eG44dXpF4Ib01V+PlDrQ==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/middleware-user-agent": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.272.0.tgz", + "integrity": "sha512-Qy7/0fsDJxY5l0bEk7WKDfqb4Os/sCAgFR2zEvrhDtbkhYPf72ysvg/nRUTncmCbo8tOok4SJii2myk8KMfjjw==", + "requires": { + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/node-config-provider": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-config-provider/-/node-config-provider-3.272.0.tgz", + "integrity": "sha512-YYCIBh9g1EQo7hm2l22HX5Yr9RoPQ2RCvhzKvF1n1e8t1QH4iObQrYUtqHG4khcm64Cft8C5MwZmgzHbya5Z6Q==", + "requires": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/node-http-handler": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.272.0.tgz", + "integrity": "sha512-VrW9PjhhngeyYp4yGYPe5S0vgZH6NwU3Po9xAgayUeE37Inr7LS1YteFMHdpgsUUeNXnh7d06CXqHo1XjtqOKA==", + "requires": { + "@aws-sdk/abort-controller": "3.272.0", + "@aws-sdk/protocol-http": "3.272.0", + "@aws-sdk/querystring-builder": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/property-provider": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/property-provider/-/property-provider-3.272.0.tgz", + "integrity": "sha512-V1pZTaH5eqpAt8O8CzbItHhOtzIfFuWymvwZFkAtwKuaHpnl7jjrTouV482zoq8AD/fF+VVSshwBKYA7bhidIw==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/protocol-http": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/protocol-http/-/protocol-http-3.272.0.tgz", + "integrity": "sha512-4JQ54v5Yn08jspNDeHo45CaSn1CvTJqS1Ywgr79eU6jBExtguOWv6LNtwVSBD9X37v88iqaxt8iu1Z3pZZAJeg==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/querystring-builder": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-builder/-/querystring-builder-3.272.0.tgz", + "integrity": "sha512-ndo++7GkdCj5tBXE6rGcITpSpZS4PfyV38wntGYAlj9liL1omk3bLZRY6uzqqkJpVHqbg2fD7O2qHNItzZgqhw==", + "requires": { + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/querystring-parser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/querystring-parser/-/querystring-parser-3.272.0.tgz", + "integrity": "sha512-5oS4/9n6N1LZW9tI3qq/0GnCuWoOXRgcHVB+AJLRBvDbEe+GI+C/xK1tKLsfpDNgsQJHc4IPQoIt4megyZ/1+A==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/service-error-classification": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/service-error-classification/-/service-error-classification-3.272.0.tgz", + "integrity": "sha512-REoltM1LK9byyIufLqx9znhSolPcHQgVHIA2S0zu5sdt5qER4OubkLAXuo4MBbisUTmh8VOOvIyUb5ijZCXq1w==" + }, + "@aws-sdk/shared-ini-file-loader": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/shared-ini-file-loader/-/shared-ini-file-loader-3.272.0.tgz", + "integrity": "sha512-lzFPohp5sy2XvwFjZIzLVCRpC0i5cwBiaXmFzXYQZJm6FSCszHO4ax+m9yrtlyVFF/2YPWl+/bzNthy4aJtseA==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/signature-v4": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4/-/signature-v4-3.272.0.tgz", + "integrity": "sha512-pWxnHG1NqJWMwlhJ6NHNiUikOL00DHROmxah6krJPMPq4I3am2KY2Rs/8ouWhnEXKaHAv4EQhSALJ+7Mq5S4/A==", + "requires": { + "@aws-sdk/is-array-buffer": "3.201.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-hex-encoding": "3.201.0", + "@aws-sdk/util-middleware": "3.272.0", + "@aws-sdk/util-uri-escape": "3.201.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/smithy-client": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/smithy-client/-/smithy-client-3.272.0.tgz", + "integrity": "sha512-pvdleJ3kaRvyRw2pIZnqL85ZlWBOZrPKmR9I69GCvlyrfdjRBhbSjIEZ+sdhZudw0vdHxq25AGoLUXhofVLf5Q==", + "requires": { + "@aws-sdk/middleware-stack": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/token-providers": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.272.0.tgz", + "integrity": "sha512-0GISJ4IKN2rXvbSddB775VjBGSKhYIGQnAdMqbvxi9LB6pSvVxcH9aIL28G0spiuL+dy3yGQZ8RlJPAyP9JW9A==", + "requires": { + "@aws-sdk/client-sso-oidc": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/shared-ini-file-loader": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/types": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.272.0.tgz", + "integrity": "sha512-MmmL6vxMGP5Bsi+4wRx4mxYlU/LX6M0noOXrDh/x5FfG7/4ZOar/nDxqDadhJtNM88cuWVHZWY59P54JzkGWmA==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/url-parser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/url-parser/-/url-parser-3.272.0.tgz", + "integrity": "sha512-vX/Tx02PlnQ/Kgtf5TnrNDHPNbY+amLZjW0Z1d9vzAvSZhQ4i9Y18yxoRDIaDTCNVRDjdhV8iuctW+05PB5JtQ==", + "requires": { + "@aws-sdk/querystring-parser": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-base64": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-base64/-/util-base64-3.208.0.tgz", + "integrity": "sha512-PQniZph5A6N7uuEOQi+1hnMz/FSOK/8kMFyFO+4DgA1dZ5pcKcn5wiFwHkcTb/BsgVqQa3Jx0VHNnvhlS8JyTg==", + "requires": { + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-body-length-browser": { + "version": "3.188.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-browser/-/util-body-length-browser-3.188.0.tgz", + "integrity": "sha512-8VpnwFWXhnZ/iRSl9mTf+VKOX9wDE8QtN4bj9pBfxwf90H1X7E8T6NkiZD3k+HubYf2J94e7DbeHs7fuCPW5Qg==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-body-length-node": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-body-length-node/-/util-body-length-node-3.208.0.tgz", + "integrity": "sha512-3zj50e5g7t/MQf53SsuuSf0hEELzMtD8RX8C76f12OSRo2Bca4FLLYHe0TZbxcfQHom8/hOaeZEyTyMogMglqg==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-buffer-from": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-buffer-from/-/util-buffer-from-3.208.0.tgz", + "integrity": "sha512-7L0XUixNEFcLUGPeBF35enCvB9Xl+K6SQsmbrPk1P3mlV9mguWSDQqbOBwY1Ir0OVbD6H/ZOQU7hI/9RtRI0Zw==", + "requires": { + "@aws-sdk/is-array-buffer": "3.201.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-config-provider": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-config-provider/-/util-config-provider-3.208.0.tgz", + "integrity": "sha512-DSRqwrERUsT34ug+anlMBIFooBEGwM8GejC7q00Y/9IPrQy50KnG5PW2NiTjuLKNi7pdEOlwTSEocJE15eDZIg==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-defaults-mode-browser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-browser/-/util-defaults-mode-browser-3.272.0.tgz", + "integrity": "sha512-W8ZVJSZRuUBg8l0JEZzUc+9fKlthVp/cdE+pFeF8ArhZelOLCiaeCrMaZAeJusaFzIpa6cmOYQAjtSMVyrwRtg==", + "requires": { + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-defaults-mode-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-defaults-mode-node/-/util-defaults-mode-node-3.272.0.tgz", + "integrity": "sha512-U0NTcbMw6KFk7uz/avBmfxQSTREEiX6JDMH68oN/3ux4AICd2I4jHyxnloSWGuiER1FxZf1dEJ8ZTwy8Ibl21Q==", + "requires": { + "@aws-sdk/config-resolver": "3.272.0", + "@aws-sdk/credential-provider-imds": "3.272.0", + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/property-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-endpoints": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.272.0.tgz", + "integrity": "sha512-c4MPUaJt2G6gGpoiwIOqDfUa98c1J63RpYvf/spQEKOtC/tF5Gfqlxuq8FnAl5lHnrqj1B9ZXLLxFhHtDR0IiQ==", + "requires": { + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-hex-encoding": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-hex-encoding/-/util-hex-encoding-3.201.0.tgz", + "integrity": "sha512-7t1vR1pVxKx0motd3X9rI3m/xNp78p3sHtP5yo4NP4ARpxyJ0fokBomY8ScaH2D/B+U5o9ARxldJUdMqyBlJcA==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-locate-window": { + "version": "3.208.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.208.0.tgz", + "integrity": "sha512-iua1A2+P7JJEDHVgvXrRJSvsnzG7stYSGQnBVphIUlemwl6nN5D+QrgbjECtrbxRz8asYFHSzhdhECqN+tFiBg==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-middleware": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-middleware/-/util-middleware-3.272.0.tgz", + "integrity": "sha512-Abw8m30arbwxqmeMMha5J11ESpHUNmCeSqSzE8/C4B8jZQtHY4kq7f+upzcNIQ11lsd+uzBEzNG3+dDRi0XOJQ==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-retry": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-retry/-/util-retry-3.272.0.tgz", + "integrity": "sha512-Ngha5414LR4gRHURVKC9ZYXsEJhMkm+SJ+44wlzOhavglfdcKKPUsibz5cKY1jpUV7oKECwaxHWpBB8r6h+hOg==", + "requires": { + "@aws-sdk/service-error-classification": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-stream-browser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-stream-browser/-/util-stream-browser-3.272.0.tgz", + "integrity": "sha512-vD514YffKxBjV/erjUNgkXcb/mzXAz3uk/KUFMXsodo3cA4Z8WxL4P0p1O09FVuJlNa0gZ8mhFPNzNOekh31GA==", + "requires": { + "@aws-sdk/fetch-http-handler": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-base64": "3.208.0", + "@aws-sdk/util-hex-encoding": "3.201.0", + "@aws-sdk/util-utf8": "3.254.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-stream-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-stream-node/-/util-stream-node-3.272.0.tgz", + "integrity": "sha512-s7dGeM1ImzihqBKgrpaeZokLnPUk3H4Et5oiM+t+TpRxotXTecJPyuD0p76HRgO8KSXfVT5Nxw/FoHXqj1fiMg==", + "requires": { + "@aws-sdk/node-http-handler": "3.272.0", + "@aws-sdk/types": "3.272.0", + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-uri-escape": { + "version": "3.201.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-uri-escape/-/util-uri-escape-3.201.0.tgz", + "integrity": "sha512-TeTWbGx4LU2c5rx0obHeDFeO9HvwYwQtMh1yniBz00pQb6Qt6YVOETVQikRZ+XRQwEyCg/dA375UplIpiy54mA==", + "requires": { + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-user-agent-browser": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.272.0.tgz", + "integrity": "sha512-Lp5QX5bH6uuwBlIdr7w7OAcAI50ttyskb++yUr9i+SPvj6RI2dsfIBaK4mDg1qUdM5LeUdvIyqwj3XHjFKAAvA==", + "requires": { + "@aws-sdk/types": "3.272.0", + "bowser": "^2.11.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-user-agent-node": { + "version": "3.272.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.272.0.tgz", + "integrity": "sha512-ljK+R3l+Q1LIHrcR+Knhk0rmcSkfFadZ8V+crEGpABf/QUQRg7NkZMsoe814tfBO5F7tMxo8wwwSdaVNNHtoRA==", + "requires": { + "@aws-sdk/node-config-provider": "3.272.0", + "@aws-sdk/types": "3.272.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-utf8": { + "version": "3.254.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8/-/util-utf8-3.254.0.tgz", + "integrity": "sha512-14Kso/eIt5/qfIBmhEL9L1IfyUqswjSTqO2mY7KOzUZ9SZbwn3rpxmtkhmATkRjD7XIlLKaxBkI7tU9Zjzj8Kw==", + "requires": { + "@aws-sdk/util-buffer-from": "3.208.0", + "tslib": "^2.3.1" + } + }, + "@aws-sdk/util-utf8-browser": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz", + "integrity": "sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==", + "requires": { + "tslib": "^2.3.1" + } + }, "@babel/code-frame": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", @@ -7425,6 +9295,11 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, + "bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" + }, "brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -7597,6 +9472,15 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "config": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/config/-/config-3.3.9.tgz", + "integrity": "sha512-G17nfe+cY7kR0wVpc49NCYvNtelm/pPy8czHoFkAgtV1lkmcp7DHtWCdDu+C9Z7gb2WVqa9Tm3uF9aKaPbCfhg==", + "dev": true, + "requires": { + "json5": "^2.2.3" + } + }, "convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", @@ -8234,6 +10118,14 @@ "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz", "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==" }, + "fast-xml-parser": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.11.tgz", + "integrity": "sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA==", + "requires": { + "strnum": "^1.0.5" + } + }, "fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -10609,6 +12501,11 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, + "strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, "strtok3": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.3.0.tgz", @@ -10822,6 +12719,11 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + }, "type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", diff --git a/package.json b/package.json index 0f74ddb..cb160a0 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ }, "homepage": "https://github.com/jambonz/speech-utils#readme", "dependencies": { + "@aws-sdk/client-polly": "^3.269.0", "@google-cloud/text-to-speech": "^4.2.0", "@grpc/grpc-js": "^1.8.7", "@jambonz/realtimedb-helpers": "^0.6.3", @@ -36,6 +37,7 @@ "undici": "^5.18.0" }, "devDependencies": { + "config": "^3.3.9", "eslint": "^8.33.0", "eslint-plugin-promise": "^6.1.1", "nyc": "^15.1.0", diff --git a/protos/riva/proto/riva_audio.proto b/protos/riva/proto/riva_audio.proto new file mode 100644 index 0000000..756a3ed --- /dev/null +++ b/protos/riva/proto/riva_audio.proto @@ -0,0 +1,36 @@ +// SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: MIT + +syntax = "proto3"; + +package nvidia.riva; + +option cc_enable_arenas = true; +option go_package = "nvidia.com/riva_speech"; + +/* + * AudioEncoding specifies the encoding of the audio bytes in the encapsulating message. + */ +enum AudioEncoding { + // Not specified. + ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR_PCM = 1; + + // `FLAC` (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3; + + OGGOPUS = 4; + + // 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + ALAW = 20; +} diff --git a/protos/riva/proto/riva_tts.proto b/protos/riva/proto/riva_tts.proto new file mode 100644 index 0000000..b190dbf --- /dev/null +++ b/protos/riva/proto/riva_tts.proto @@ -0,0 +1,77 @@ +// SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: MIT + +syntax = "proto3"; + +package nvidia.riva.tts; + +option cc_enable_arenas = true; +option go_package = "nvidia.com/riva_speech"; + +import "riva/proto/riva_audio.proto"; + +service RivaSpeechSynthesis { + // Used to request text-to-speech from the service. Submit a request containing the + // desired text and configuration, and receive audio bytes in the requested format. + rpc Synthesize(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) {} + + // Used to request text-to-speech returned via stream as it becomes available. + // Submit a SynthesizeSpeechRequest with desired text and configuration, + // and receive stream of bytes in the requested format. + rpc SynthesizeOnline(SynthesizeSpeechRequest) returns (stream SynthesizeSpeechResponse) {} + + //Enables clients to request the configuration of the current Synthesize service, or a specific model within the service. + rpc GetRivaSynthesisConfig(RivaSynthesisConfigRequest) returns (RivaSynthesisConfigResponse) {} +} + +message RivaSynthesisConfigRequest { + //If model is specified only return config for model, otherwise return all configs. + string model_name = 1; +} + +message RivaSynthesisConfigResponse { + message Config { + string model_name = 1; + map parameters = 2; + } + + repeated Config model_config = 1; +} + +message SynthesizeSpeechRequest { + string text = 1; + string language_code = 2; + // audio encoding params + AudioEncoding encoding = 3; + + // The sample rate in hertz (Hz) of the audio output requested through `SynthesizeSpeechRequest` messages. + // Models produce an output at a fixed rate. The sample rate enables you to resample the generated audio output if required. + // You use the sample rate to up-sample or down-sample the audio for various scenarios. For example, the sample rate can be set to 8kHz (kilohertz) if the output + // audio is desired for a low bandwidth application. + // The sample rate values below 8kHz will not produce any meaningful output. Also, up-sampling too much will increase the + // size of the output without improving the output audio quality. + + int32 sample_rate_hz = 4; + // voice params + string voice_name = 5; +} + +message SynthesizeSpeechResponseMetadata { + // Currently experimental API addition that returns the input text + // after preprocessing has been completed as well as the predicted + // duration for each token. + // Note: this message is subject to future breaking changes, and potential + // removal. + string text = 1; + string processed_text = 2; + repeated float predicted_durations = 8; +} + +message SynthesizeSpeechResponse { + bytes audio = 1; + SynthesizeSpeechResponseMetadata meta = 2; +} + +/* + * + */ diff --git a/stubs/riva/proto/riva_audio_grpc_pb.js b/stubs/riva/proto/riva_audio_grpc_pb.js new file mode 100644 index 0000000..97b3a24 --- /dev/null +++ b/stubs/riva/proto/riva_audio_grpc_pb.js @@ -0,0 +1 @@ +// GENERATED CODE -- NO SERVICES IN PROTO \ No newline at end of file diff --git a/stubs/riva/proto/riva_audio_pb.js b/stubs/riva/proto/riva_audio_pb.js new file mode 100644 index 0000000..1f0dbd5 --- /dev/null +++ b/stubs/riva/proto/riva_audio_pb.js @@ -0,0 +1,31 @@ +// source: riva/proto/riva_audio.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.nvidia.riva.AudioEncoding', null, global); +/** + * @enum {number} + */ +proto.nvidia.riva.AudioEncoding = { + ENCODING_UNSPECIFIED: 0, + LINEAR_PCM: 1, + FLAC: 2, + MULAW: 3, + OGGOPUS: 4, + ALAW: 20 +}; + +goog.object.extend(exports, proto.nvidia.riva); diff --git a/stubs/riva/proto/riva_tts_grpc_pb.js b/stubs/riva/proto/riva_tts_grpc_pb.js new file mode 100644 index 0000000..85b20d4 --- /dev/null +++ b/stubs/riva/proto/riva_tts_grpc_pb.js @@ -0,0 +1,99 @@ +// GENERATED CODE -- DO NOT EDIT! + +// Original file comments: +// SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: MIT +// +'use strict'; +var grpc = require('@grpc/grpc-js'); +var riva_proto_riva_tts_pb = require('../../riva/proto/riva_tts_pb.js'); +var riva_proto_riva_audio_pb = require('../../riva/proto/riva_audio_pb.js'); + +function serialize_nvidia_riva_tts_RivaSynthesisConfigRequest(arg) { + if (!(arg instanceof riva_proto_riva_tts_pb.RivaSynthesisConfigRequest)) { + throw new Error('Expected argument of type nvidia.riva.tts.RivaSynthesisConfigRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nvidia_riva_tts_RivaSynthesisConfigRequest(buffer_arg) { + return riva_proto_riva_tts_pb.RivaSynthesisConfigRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nvidia_riva_tts_RivaSynthesisConfigResponse(arg) { + if (!(arg instanceof riva_proto_riva_tts_pb.RivaSynthesisConfigResponse)) { + throw new Error('Expected argument of type nvidia.riva.tts.RivaSynthesisConfigResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nvidia_riva_tts_RivaSynthesisConfigResponse(buffer_arg) { + return riva_proto_riva_tts_pb.RivaSynthesisConfigResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nvidia_riva_tts_SynthesizeSpeechRequest(arg) { + if (!(arg instanceof riva_proto_riva_tts_pb.SynthesizeSpeechRequest)) { + throw new Error('Expected argument of type nvidia.riva.tts.SynthesizeSpeechRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nvidia_riva_tts_SynthesizeSpeechRequest(buffer_arg) { + return riva_proto_riva_tts_pb.SynthesizeSpeechRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nvidia_riva_tts_SynthesizeSpeechResponse(arg) { + if (!(arg instanceof riva_proto_riva_tts_pb.SynthesizeSpeechResponse)) { + throw new Error('Expected argument of type nvidia.riva.tts.SynthesizeSpeechResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nvidia_riva_tts_SynthesizeSpeechResponse(buffer_arg) { + return riva_proto_riva_tts_pb.SynthesizeSpeechResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +var RivaSpeechSynthesisService = exports.RivaSpeechSynthesisService = { + // Used to request text-to-speech from the service. Submit a request containing the +// desired text and configuration, and receive audio bytes in the requested format. +synthesize: { + path: '/nvidia.riva.tts.RivaSpeechSynthesis/Synthesize', + requestStream: false, + responseStream: false, + requestType: riva_proto_riva_tts_pb.SynthesizeSpeechRequest, + responseType: riva_proto_riva_tts_pb.SynthesizeSpeechResponse, + requestSerialize: serialize_nvidia_riva_tts_SynthesizeSpeechRequest, + requestDeserialize: deserialize_nvidia_riva_tts_SynthesizeSpeechRequest, + responseSerialize: serialize_nvidia_riva_tts_SynthesizeSpeechResponse, + responseDeserialize: deserialize_nvidia_riva_tts_SynthesizeSpeechResponse, + }, + // Used to request text-to-speech returned via stream as it becomes available. +// Submit a SynthesizeSpeechRequest with desired text and configuration, +// and receive stream of bytes in the requested format. +synthesizeOnline: { + path: '/nvidia.riva.tts.RivaSpeechSynthesis/SynthesizeOnline', + requestStream: false, + responseStream: true, + requestType: riva_proto_riva_tts_pb.SynthesizeSpeechRequest, + responseType: riva_proto_riva_tts_pb.SynthesizeSpeechResponse, + requestSerialize: serialize_nvidia_riva_tts_SynthesizeSpeechRequest, + requestDeserialize: deserialize_nvidia_riva_tts_SynthesizeSpeechRequest, + responseSerialize: serialize_nvidia_riva_tts_SynthesizeSpeechResponse, + responseDeserialize: deserialize_nvidia_riva_tts_SynthesizeSpeechResponse, + }, + // Enables clients to request the configuration of the current Synthesize service, or a specific model within the service. +getRivaSynthesisConfig: { + path: '/nvidia.riva.tts.RivaSpeechSynthesis/GetRivaSynthesisConfig', + requestStream: false, + responseStream: false, + requestType: riva_proto_riva_tts_pb.RivaSynthesisConfigRequest, + responseType: riva_proto_riva_tts_pb.RivaSynthesisConfigResponse, + requestSerialize: serialize_nvidia_riva_tts_RivaSynthesisConfigRequest, + requestDeserialize: deserialize_nvidia_riva_tts_RivaSynthesisConfigRequest, + responseSerialize: serialize_nvidia_riva_tts_RivaSynthesisConfigResponse, + responseDeserialize: deserialize_nvidia_riva_tts_RivaSynthesisConfigResponse, + }, +}; + +exports.RivaSpeechSynthesisClient = grpc.makeGenericClientConstructor(RivaSpeechSynthesisService); diff --git a/stubs/riva/proto/riva_tts_pb.js b/stubs/riva/proto/riva_tts_pb.js new file mode 100644 index 0000000..94776c5 --- /dev/null +++ b/stubs/riva/proto/riva_tts_pb.js @@ -0,0 +1,1278 @@ +// source: riva/proto/riva_tts.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var riva_proto_riva_audio_pb = require('../../riva/proto/riva_audio_pb.js'); +goog.object.extend(proto, riva_proto_riva_audio_pb); +goog.exportSymbol('proto.nvidia.riva.tts.RivaSynthesisConfigRequest', null, global); +goog.exportSymbol('proto.nvidia.riva.tts.RivaSynthesisConfigResponse', null, global); +goog.exportSymbol('proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config', null, global); +goog.exportSymbol('proto.nvidia.riva.tts.SynthesizeSpeechRequest', null, global); +goog.exportSymbol('proto.nvidia.riva.tts.SynthesizeSpeechResponse', null, global); +goog.exportSymbol('proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nvidia.riva.tts.RivaSynthesisConfigRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nvidia.riva.tts.RivaSynthesisConfigRequest.displayName = 'proto.nvidia.riva.tts.RivaSynthesisConfigRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nvidia.riva.tts.RivaSynthesisConfigResponse.repeatedFields_, null); +}; +goog.inherits(proto.nvidia.riva.tts.RivaSynthesisConfigResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nvidia.riva.tts.RivaSynthesisConfigResponse.displayName = 'proto.nvidia.riva.tts.RivaSynthesisConfigResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.displayName = 'proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nvidia.riva.tts.SynthesizeSpeechRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nvidia.riva.tts.SynthesizeSpeechRequest.displayName = 'proto.nvidia.riva.tts.SynthesizeSpeechRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.repeatedFields_, null); +}; +goog.inherits(proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.displayName = 'proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nvidia.riva.tts.SynthesizeSpeechResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nvidia.riva.tts.SynthesizeSpeechResponse.displayName = 'proto.nvidia.riva.tts.SynthesizeSpeechResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nvidia.riva.tts.RivaSynthesisConfigRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest.toObject = function(includeInstance, msg) { + var f, obj = { + modelName: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nvidia.riva.tts.RivaSynthesisConfigRequest; + return proto.nvidia.riva.tts.RivaSynthesisConfigRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setModelName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nvidia.riva.tts.RivaSynthesisConfigRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getModelName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string model_name = 1; + * @return {string} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest.prototype.getModelName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigRequest} returns this + */ +proto.nvidia.riva.tts.RivaSynthesisConfigRequest.prototype.setModelName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nvidia.riva.tts.RivaSynthesisConfigResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.toObject = function(includeInstance, msg) { + var f, obj = { + modelConfigList: jspb.Message.toObjectList(msg.getModelConfigList(), + proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nvidia.riva.tts.RivaSynthesisConfigResponse; + return proto.nvidia.riva.tts.RivaSynthesisConfigResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config; + reader.readMessage(value,proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.deserializeBinaryFromReader); + msg.addModelConfig(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nvidia.riva.tts.RivaSynthesisConfigResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getModelConfigList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.toObject = function(opt_includeInstance) { + return proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.toObject = function(includeInstance, msg) { + var f, obj = { + modelName: jspb.Message.getFieldWithDefault(msg, 1, ""), + parametersMap: (f = msg.getParametersMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config; + return proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setModelName(value); + break; + case 2: + var value = msg.getParametersMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getModelName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getParametersMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional string model_name = 1; + * @return {string} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.getModelName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} returns this + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.setModelName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * map parameters = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.getParametersMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} returns this + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config.prototype.clearParametersMap = function() { + this.getParametersMap().clear(); + return this;}; + + +/** + * repeated Config model_config = 1; + * @return {!Array} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.getModelConfigList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} returns this +*/ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.setModelConfigList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config=} opt_value + * @param {number=} opt_index + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config} + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.addModelConfig = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.nvidia.riva.tts.RivaSynthesisConfigResponse.Config, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nvidia.riva.tts.RivaSynthesisConfigResponse} returns this + */ +proto.nvidia.riva.tts.RivaSynthesisConfigResponse.prototype.clearModelConfigList = function() { + return this.setModelConfigList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nvidia.riva.tts.SynthesizeSpeechRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.toObject = function(includeInstance, msg) { + var f, obj = { + text: jspb.Message.getFieldWithDefault(msg, 1, ""), + languageCode: jspb.Message.getFieldWithDefault(msg, 2, ""), + encoding: jspb.Message.getFieldWithDefault(msg, 3, 0), + sampleRateHz: jspb.Message.getFieldWithDefault(msg, 4, 0), + voiceName: jspb.Message.getFieldWithDefault(msg, 5, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nvidia.riva.tts.SynthesizeSpeechRequest; + return proto.nvidia.riva.tts.SynthesizeSpeechRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setText(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setLanguageCode(value); + break; + case 3: + var value = /** @type {!proto.nvidia.riva.AudioEncoding} */ (reader.readEnum()); + msg.setEncoding(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt32()); + msg.setSampleRateHz(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setVoiceName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nvidia.riva.tts.SynthesizeSpeechRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getText(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getLanguageCode(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getEncoding(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getSampleRateHz(); + if (f !== 0) { + writer.writeInt32( + 4, + f + ); + } + f = message.getVoiceName(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } +}; + + +/** + * optional string text = 1; + * @return {string} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getText = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setText = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string language_code = 2; + * @return {string} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getLanguageCode = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setLanguageCode = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional nvidia.riva.AudioEncoding encoding = 3; + * @return {!proto.nvidia.riva.AudioEncoding} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getEncoding = function() { + return /** @type {!proto.nvidia.riva.AudioEncoding} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {!proto.nvidia.riva.AudioEncoding} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setEncoding = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); +}; + + +/** + * optional int32 sample_rate_hz = 4; + * @return {number} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getSampleRateHz = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setSampleRateHz = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional string voice_name = 5; + * @return {string} + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.getVoiceName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechRequest} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechRequest.prototype.setVoiceName = function(value) { + return jspb.Message.setProto3StringField(this, 5, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.repeatedFields_ = [8]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.toObject = function(opt_includeInstance) { + return proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.toObject = function(includeInstance, msg) { + var f, obj = { + text: jspb.Message.getFieldWithDefault(msg, 1, ""), + processedText: jspb.Message.getFieldWithDefault(msg, 2, ""), + predictedDurationsList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 8)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata; + return proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setText(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setProcessedText(value); + break; + case 8: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedFloat() : [reader.readFloat()]); + for (var i = 0; i < values.length; i++) { + msg.addPredictedDurations(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getText(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getProcessedText(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getPredictedDurationsList(); + if (f.length > 0) { + writer.writePackedFloat( + 8, + f + ); + } +}; + + +/** + * optional string text = 1; + * @return {string} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.getText = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.setText = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string processed_text = 2; + * @return {string} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.getProcessedText = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.setProcessedText = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated float predicted_durations = 8; + * @return {!Array} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.getPredictedDurationsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 8)); +}; + + +/** + * @param {!Array} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.setPredictedDurationsList = function(value) { + return jspb.Message.setField(this, 8, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.addPredictedDurations = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 8, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.prototype.clearPredictedDurationsList = function() { + return this.setPredictedDurationsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nvidia.riva.tts.SynthesizeSpeechResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.toObject = function(includeInstance, msg) { + var f, obj = { + audio: msg.getAudio_asB64(), + meta: (f = msg.getMeta()) && proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nvidia.riva.tts.SynthesizeSpeechResponse; + return proto.nvidia.riva.tts.SynthesizeSpeechResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setAudio(value); + break; + case 2: + var value = new proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata; + reader.readMessage(value,proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.deserializeBinaryFromReader); + msg.setMeta(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nvidia.riva.tts.SynthesizeSpeechResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAudio_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getMeta(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes audio = 1; + * @return {!(string|Uint8Array)} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.getAudio = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes audio = 1; + * This is a type-conversion wrapper around `getAudio()` + * @return {string} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.getAudio_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAudio())); +}; + + +/** + * optional bytes audio = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAudio()` + * @return {!Uint8Array} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.getAudio_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAudio())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.setAudio = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional SynthesizeSpeechResponseMetadata meta = 2; + * @return {?proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.getMeta = function() { + return /** @type{?proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata, 2)); +}; + + +/** + * @param {?proto.nvidia.riva.tts.SynthesizeSpeechResponseMetadata|undefined} value + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} returns this +*/ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.setMeta = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nvidia.riva.tts.SynthesizeSpeechResponse} returns this + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.clearMeta = function() { + return this.setMeta(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nvidia.riva.tts.SynthesizeSpeechResponse.prototype.hasMeta = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +goog.object.extend(exports, proto.nvidia.riva.tts); diff --git a/test/docker_start.js b/test/docker_start.js new file mode 100644 index 0000000..0ca5354 --- /dev/null +++ b/test/docker_start.js @@ -0,0 +1,12 @@ +const test = require('tape').test ; +const exec = require('child_process').exec ; + +test('starting docker network..', (t) => { + exec(`docker-compose -f ${__dirname}/docker-compose-testbed.yaml up -d`, (err, stdout, stderr) => { + setTimeout(() => { + t.end(err); + }, 2000); + }); +}); + + diff --git a/test/docker_stop.js b/test/docker_stop.js new file mode 100644 index 0000000..dd7a249 --- /dev/null +++ b/test/docker_stop.js @@ -0,0 +1,12 @@ +const test = require('tape').test ; +const exec = require('child_process').exec ; + +test('stopping docker network..', (t) => { + t.timeoutAfter(10000); + exec(`docker-compose -f ${__dirname}/docker-compose-testbed.yaml down`, (err, stdout, stderr) => { + //console.log(`stderr: ${stderr}`); + process.exit(0); + }); + t.end() ; +}); + diff --git a/test/ibm.js b/test/ibm.js new file mode 100644 index 0000000..a3a1218 --- /dev/null +++ b/test/ibm.js @@ -0,0 +1,78 @@ +const test = require('tape').test ; +const config = require('config'); +const opts = config.get('redis'); +const fs = require('fs'); +const logger = require('pino')({level: 'error'}); +process.on('unhandledRejection', (reason, p) => { + console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); +}); + +const stats = { + increment: () => {}, + histogram: () => {} +}; + +test('IBM - create access key', async(t) => { + const fn = require('..'); + const {client, getIbmAccessToken} = fn(opts, logger); + + if (!process.env.IBM_API_KEY ) { + t.pass('skipping IBM test since no IBM api_key provided'); + t.end(); + client.quit(); + return; + } + try { + let obj = await getIbmAccessToken(process.env.IBM_API_KEY); + //console.log({obj}, 'received access token from IBM'); + t.ok(obj.access_token && !obj.servedFromCache, 'successfull received access token from IBM'); + + obj = await getIbmAccessToken(process.env.IBM_API_KEY); + //console.log({obj}, 'received access token from IBM - second request'); + t.ok(obj.access_token && obj.servedFromCache, 'successfully received access token from cache'); + + await client.flushallAsync(); + t.end(); + } + catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); + +test('IBM - retrieve tts voices test', async(t) => { + const fn = require('..'); + const {client, getTtsVoices} = fn(opts, logger); + + if (!process.env.IBM_TTS_API_KEY || !process.env.IBM_TTS_REGION) { + t.pass('skipping IBM test since no IBM api_key and/or region provided'); + t.end(); + client.quit(); + return; + } + try { + const opts = { + vendor: 'ibm', + credentials: { + tts_api_key: process.env.IBM_TTS_API_KEY, + tts_region: process.env.IBM_TTS_REGION + } + }; + const obj = await getTtsVoices(opts); + const {voices} = obj.result; + //console.log(JSON.stringify(voices)); + t.ok(voices.length > 0 && voices[0].language, + `GetVoices: successfully retrieved ${voices.length} voices from IBM`); + + await client.flushallAsync(); + + t.end(); + + } + catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); diff --git a/test/index.js b/test/index.js new file mode 100644 index 0000000..23d57a3 --- /dev/null +++ b/test/index.js @@ -0,0 +1,5 @@ +require('./docker_start'); +require('./synth'); +require('./nuance'); +require('./ibm'); +require('./docker_stop'); diff --git a/test/nuance.js b/test/nuance.js new file mode 100644 index 0000000..f30c8f6 --- /dev/null +++ b/test/nuance.js @@ -0,0 +1,50 @@ +const test = require('tape').test ; +const config = require('config'); +const opts = config.get('redis'); +const fs = require('fs'); +const logger = require('pino')({level: 'error'}); +process.on('unhandledRejection', (reason, p) => { + console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); +}); + +const stats = { + increment: () => {}, + histogram: () => {} +}; + +test('Nuance tests', async(t) => { + const fn = require('..'); + const {client, getTtsVoices} = fn(opts, logger); + + if (!process.env.NUANCE_CLIENT_ID || !process.env.NUANCE_SECRET ) { + t.pass('skipping Nuance test since no Nuance client_id and secret provided'); + t.end(); + client.quit(); + return; + } + try { + const opts = { + vendor: 'nuance', + credentials: { + client_id: process.env.NUANCE_CLIENT_ID, + secret: process.env.NUANCE_SECRET + } + }; + let voices = await getTtsVoices(opts); + //console.log(`received ${voices.length} voices from Nuance`); + //console.log(JSON.stringify(voices)); + t.ok(voices.length > 0 && voices[0].language, + `GetVoices: successfully retrieved ${voices.length} voices from Nuance`); + + await client.flushallAsync(); + + t.end(); + + } + catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); + diff --git a/test/synth.js b/test/synth.js new file mode 100644 index 0000000..3e9e35e --- /dev/null +++ b/test/synth.js @@ -0,0 +1,382 @@ +const test = require('tape').test; +const config = require('config'); +const opts = config.get('redis'); +const fs = require('fs'); +const {makeSynthKey} = require('../lib/utils'); +const logger = require('pino')(); + +process.on('unhandledRejection', (reason, p) => { + console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); +}); + +const stats = { + increment: () => { + }, + histogram: () => { + }, +}; + +test('Google speech synth tests', async(t) => { + const fn = require('..'); + const {synthAudio, client} = fn(opts, logger); + + if (!process.env.GCP_FILE && !process.env.GCP_JSON_KEY) { + t.pass('skipping google speech synth tests since neither GCP_FILE nor GCP_JSON_KEY provided'); + return t.end(); + } + try { + const str = process.env.GCP_JSON_KEY || fs.readFileSync(process.env.GCP_FILE); + const creds = JSON.parse(str); + let opts = await synthAudio(stats, { + vendor: 'google', + credentials: { + credentials: { + client_email: creds.client_email, + private_key: creds.private_key, + }, + }, + language: 'en-GB', + gender: 'MALE', + text: 'This is a test. This is only a test', + salt: 'foo.bar', + }); + t.ok(!opts.servedFromCache, `successfully synthesized google audio to ${opts.filePath}`); + + opts = await synthAudio(stats, { + vendor: 'google', + credentials: { + credentials: { + client_email: creds.client_email, + private_key: creds.private_key, + }, + }, + language: 'en-GB', + gender: 'MALE', + text: 'This is a test. This is only a test', + }); + t.ok(opts.servedFromCache, `successfully retrieved cached google audio from ${opts.filePath}`); + + opts = await synthAudio(stats, { + vendor: 'google', + credentials: { + credentials: { + client_email: creds.client_email, + private_key: creds.private_key, + }, + }, + disableTtsCache: true, + language: 'en-GB', + gender: 'MALE', + text: 'This is a test. This is only a test', + }); + t.ok(!opts.servedFromCache, `successfully synthesized google audio regardless of current cache to ${opts.filePath}`); + } catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); + +test('AWS speech synth tests', async(t) => { + const fn = require('..'); + const {synthAudio, client} = fn(opts, logger); + + if (!process.env.AWS_ACCESS_KEY_ID || !process.env.AWS_SECRET_ACCESS_KEY || !process.env.AWS_REGION) { + t.pass('skipping AWS speech synth tests since AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, or AWS_REGION not provided'); + return t.end(); + } + try { + let opts = await synthAudio(stats, { + vendor: 'aws', + credentials: { + accessKeyId: process.env.AWS_ACCESS_KEY_ID, + secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, + region: process.env.AWS_REGION, + }, + language: 'en-US', + voice: 'Joey', + text: 'This is a test. This is only a test', + }); + t.ok(!opts.servedFromCache, `successfully synthesized aws audio to ${opts.filePath}`); + + opts = await synthAudio(stats, { + vendor: 'aws', + credentials: { + accessKeyId: process.env.AWS_ACCESS_KEY_ID, + secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, + region: process.env.AWS_REGION, + }, + language: 'en-US', + voice: 'Joey', + text: 'This is a test. This is only a test', + }); + t.ok(opts.servedFromCache, `successfully retrieved aws audio from cache ${opts.filePath}`); + } catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); + +test('Azure speech synth tests', async(t) => { + const fn = require('..'); + const {synthAudio, client} = fn(opts, logger); + + if (!process.env.MICROSOFT_API_KEY || !process.env.MICROSOFT_REGION) { + t.pass('skipping Microsoft speech synth tests since MICROSOFT_API_KEY or MICROSOFT_REGION not provided'); + return t.end(); + } + try { + const longText = `Henry is best known for his six marriages, including his efforts to have his first marriage + (to Catherine of Aragon) annulled. His disagreement with Pope Clement VII about such an + annulment led Henry to initiate the English Reformation, + separating the Church of England from papal authority. He appointed himself Supreme Head of the Church of England + and dissolved convents and monasteries, for which he was excommunicated. + Henry is also known as "the father of the Royal Navy," as he invested heavily in the navy, + increasing its size from a few to more than 50 ships, and established the Navy Board.`; + + let opts = await synthAudio(stats, { + vendor: 'microsoft', + credentials: { + api_key: process.env.MICROSOFT_API_KEY, + region: process.env.MICROSOFT_REGION, + }, + language: 'en-US', + voice: 'en-US-ChristopherNeural', + text: longText, + }); + t.ok(!opts.servedFromCache, `successfully synthesized microsoft audio to ${opts.filePath}`); + + + opts = await synthAudio(stats, { + vendor: 'microsoft', + credentials: { + api_key: process.env.MICROSOFT_API_KEY, + region: process.env.MICROSOFT_REGION, + }, + language: 'en-US', + voice: 'en-US-ChristopherNeural', + text: longText, + }); + t.ok(opts.servedFromCache, `successfully retrieved microsoft audio from cache ${opts.filePath}`); + } catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); + +test('Azure custom voice speech synth tests', async(t) => { + const fn = require('..'); + const {synthAudio, client} = fn(opts, logger); + + if (!process.env.MICROSOFT_CUSTOM_API_KEY || !process.env.MICROSOFT_DEPLOYMENT_ID || !process.env.MICROSOFT_CUSTOM_REGION) { + t.pass('skipping Microsoft speech synth custom voice tests since MICROSOFT_CUSTOM_API_KEY or MICROSOFT_DEPLOYMENT_ID or MICROSOFT_CUSTOM_REGION not provided'); + return t.end(); + } + try { + const text = 'Hi, this is my custom voice. How does it sound to you? Do I have a future as a virtual bot?'; + let opts = await synthAudio(stats, { + vendor: 'microsoft', + credentials: { + api_key: process.env.MICROSOFT_CUSTOM_API_KEY, + region: process.env.MICROSOFT_CUSTOM_REGION, + use_custom_tts: true, + custom_tts_endpoint: process.env.MICROSOFT_DEPLOYMENT_ID, + }, + language: 'en-US', + voice: process.env.MICROSOFT_CUSTOM_VOICE, + text, + }); + t.ok(!opts.servedFromCache, `successfully synthesized microsoft audio to ${opts.filePath}`); + + opts = await synthAudio(stats, { + vendor: 'microsoft', + credentials: { + api_key: process.env.MICROSOFT_CUSTOM_API_KEY, + region: process.env.MICROSOFT_CUSTOM_REGION, + use_custom_tts: true, + custom_tts_endpoint: process.env.MICROSOFT_DEPLOYMENT_ID, + }, + language: 'en-US', + voice: process.env.MICROSOFT_CUSTOM_VOICE, + text, + }); + t.ok(opts.servedFromCache, `successfully retrieved microsoft custom voice audio from cache ${opts.filePath}`); + } catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); + +test('Nuance speech synth tests', async(t) => { + const fn = require('..'); + const {synthAudio, client} = fn(opts, logger); + + if (!process.env.NUANCE_CLIENT_ID || !process.env.NUANCE_SECRET) { + t.pass('skipping Nuance speech synth tests since NUANCE_CLIENT_ID or NUANCE_SECRET not provided'); + return t.end(); + } + try { + let opts = await synthAudio(stats, { + vendor: 'nuance', + credentials: { + client_id: process.env.NUANCE_CLIENT_ID, + secret: process.env.NUANCE_SECRET, + }, + language: 'en-US', + voice: 'Evan', + text: 'This is a test. This is only a test', + }); + t.ok(!opts.servedFromCache, `successfully synthesized nuance audio to ${opts.filePath}`); + + opts = await synthAudio(stats, { + vendor: 'nuance', + credentials: { + client_id: process.env.NUANCE_CLIENT_ID, + secret: process.env.NUANCE_SECRET, + }, + language: 'en-US', + voice: 'Evan', + text: 'This is a test. This is only a test', + }); + t.ok(opts.servedFromCache, `successfully retrieved nuance audio from cache ${opts.filePath}`); + } catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); + +test('Nvidia speech synth tests', async(t) => { + const fn = require('..'); + const {synthAudio, client} = fn(opts, logger); + + if (!process.env.RIVA_URI) { + t.pass('skipping Nvidia speech synth tests since RIVA_URI not provided'); + return t.end(); + } + try { + let opts = await synthAudio(stats, { + vendor: 'nvidia', + credentials: { + riva_uri: process.env.RIVA_URI, + }, + language: 'en-US', + voice: 'English-US.Female-1', + text: 'This is a test. This is only a test', + }); + t.ok(!opts.servedFromCache, `successfully synthesized nuance audio to ${opts.filePath}`); + + opts = await synthAudio(stats, { + vendor: 'nvidia', + credentials: { + riva_uri: process.env.RIVA_URI, + }, + language: 'en-US', + voice: 'English-US.Female-1', + text: 'This is a test. This is only a test', + }); + t.ok(opts.servedFromCache, `successfully retrieved nuance audio from cache ${opts.filePath}`); + } catch (err) { + console.error(err); + t.end(err); + } + client.quit(); +}); + +test('IBM watson speech synth tests', async(t) => { + const fn = require('..'); + const {synthAudio, client} = fn(opts, logger); + + if (!process.env.IBM_TTS_API_KEY || !process.env.IBM_TTS_REGION) { + t.pass('skipping IBM Watson speech synth tests since IBM_TTS_API_KEY or IBM_TTS_API_KEY not provided'); + return t.end(); + } + const text = ` Hi there and welcome to jambones! jambones is the CPaaS designed with the needs of communication service providers in mind. This is an example of simple text-to-speech, but there is so much more you can do. Try us out!`; + try { + let opts = await synthAudio(stats, { + vendor: 'ibm', + credentials: { + tts_api_key: process.env.IBM_TTS_API_KEY, + tts_region: process.env.IBM_TTS_REGION, + }, + language: 'en-US', + voice: 'en-US_AllisonV2Voice', + text, + }); + t.ok(!opts.servedFromCache, `successfully synthesized ibm audio to ${opts.filePath}`); + + opts = await synthAudio(stats, { + vendor: 'ibm', + credentials: { + tts_api_key: process.env.IBM_TTS_API_KEY, + tts_region: process.env.IBM_TTS_REGION, + }, + language: 'en-US', + voice: 'en-US_AllisonV2Voice', + text, + }); + t.ok(opts.servedFromCache, `successfully retrieved ibm audio from cache ${opts.filePath}`); + } catch (err) { + console.error(JSON.stringify(err)); + t.end(err); + } + client.quit(); +}); + +test('TTS Cache tests', async(t) => { + const fn = require('..'); + const {purgeTtsCache, client} = fn(opts, logger); + + try { + // save some random tts keys to cache + const minRecords = 8; + for (const i in Array(minRecords).fill(0)) { + await client.setAsync(makeSynthKey({vendor: i, language: i, voice: i, engine: i, text: i}), i); + } + const {purgedCount} = await purgeTtsCache(); + t.ok(purgedCount >= minRecords, `successfully purged at least ${minRecords} tts records from cache`); + + const cached = (await client.keysAsync('tts:*')).length; + t.equal(cached, 0, `successfully purged all tts records from cache`); + + } catch (err) { + console.error(JSON.stringify(err)); + t.end(err); + } + + try { + // save some random tts keys to cache + for (const i in Array(10).fill(0)) { + await client.setAsync(makeSynthKey({vendor: i, language: i, voice: i, engine: i, text: i}), i); + } + // save a specific key to tts cache + const opts = {vendor: 'aws', language: 'en-US', voice: 'MALE', engine: 'Engine', text: 'Hello World!'}; + await client.setAsync(makeSynthKey(opts), opts.text); + + const {purgedCount} = await purgeTtsCache({all: false, ...opts}); + t.ok(purgedCount === 1, `successfully purged one specific tts record from cache`); + + // returns error for unknown key + const {purgedCount: purgedCountWhenErrored, error} = await purgeTtsCache({ + all: false, + vendor: 'non-existing', + language: 'non-existing', + voice: 'non-existing', + }); + t.ok(purgedCountWhenErrored === 0, `purged no records when specified key was not found`); + t.ok(error, `error returned when specified key was not found`); + + // make sure other tts keys are still there + const cached = (await client.keysAsync('tts:*')).length; + t.ok(cached >= 1, `successfully kept all non-specified tts records in cache`); + + } catch (err) { + console.error(JSON.stringify(err)); + t.end(err); + } + + client.quit(); +}); diff --git a/test/tmp/redis.conf b/test/tmp/redis.conf new file mode 100644 index 0000000..91b92fd --- /dev/null +++ b/test/tmp/redis.conf @@ -0,0 +1,2054 @@ +# Redis configuration file example. +# +# Note that in order to read the configuration file, Redis must be +# started with the file path as first argument: +# +# ./redis-server /path/to/redis.conf + +# Note on units: when memory size is needed, it is possible to specify +# it in the usual form of 1k 5GB 4M and so forth: +# +# 1k => 1000 bytes +# 1kb => 1024 bytes +# 1m => 1000000 bytes +# 1mb => 1024*1024 bytes +# 1g => 1000000000 bytes +# 1gb => 1024*1024*1024 bytes +# +# units are case insensitive so 1GB 1Gb 1gB are all the same. + +################################## INCLUDES ################################### + +# Include one or more other config files here. This is useful if you +# have a standard template that goes to all Redis servers but also need +# to customize a few per-server settings. Include files can include +# other files, so use this wisely. +# +# Note that option "include" won't be rewritten by command "CONFIG REWRITE" +# from admin or Redis Sentinel. Since Redis always uses the last processed +# line as value of a configuration directive, you'd better put includes +# at the beginning of this file to avoid overwriting config change at runtime. +# +# If instead you are interested in using includes to override configuration +# options, it is better to use include as the last line. +# +# include /path/to/local.conf +# include /path/to/other.conf + +################################## MODULES ##################################### + +# Load modules at startup. If the server is not able to load modules +# it will abort. It is possible to use multiple loadmodule directives. +# +# loadmodule /path/to/my_module.so +# loadmodule /path/to/other_module.so + +################################## NETWORK ##################################### + +# By default, if no "bind" configuration directive is specified, Redis listens +# for connections from all available network interfaces on the host machine. +# It is possible to listen to just one or multiple selected interfaces using +# the "bind" configuration directive, followed by one or more IP addresses. +# Each address can be prefixed by "-", which means that redis will not fail to +# start if the address is not available. Being not available only refers to +# addresses that does not correspond to any network interfece. Addresses that +# are already in use will always fail, and unsupported protocols will always BE +# silently skipped. +# +# Examples: +# +# bind 192.168.1.100 10.0.0.1 # listens on two specific IPv4 addresses +# bind 127.0.0.1 ::1 # listens on loopback IPv4 and IPv6 +# bind * -::* # like the default, all available interfaces +# +# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the +# internet, binding to all the interfaces is dangerous and will expose the +# instance to everybody on the internet. So by default we uncomment the +# following bind directive, that will force Redis to listen only on the +# IPv4 and IPv6 (if available) loopback interface addresses (this means Redis +# will only be able to accept client connections from the same host that it is +# running on). +# +# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES +# JUST COMMENT OUT THE FOLLOWING LINE. +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +bind * -::* + +# Protected mode is a layer of security protection, in order to avoid that +# Redis instances left open on the internet are accessed and exploited. +# +# When protected mode is on and if: +# +# 1) The server is not binding explicitly to a set of addresses using the +# "bind" directive. +# 2) No password is configured. +# +# The server only accepts connections from clients connecting from the +# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain +# sockets. +# +# By default protected mode is enabled. You should disable it only if +# you are sure you want clients from other hosts to connect to Redis +# even if no authentication is configured, nor a specific set of interfaces +# are explicitly listed using the "bind" directive. +protected-mode yes + +# Accept connections on the specified port, default is 6379 (IANA #815344). +# If port 0 is specified Redis will not listen on a TCP socket. +port 6379 + +# TCP listen() backlog. +# +# In high requests-per-second environments you need a high backlog in order +# to avoid slow clients connection issues. Note that the Linux kernel +# will silently truncate it to the value of /proc/sys/net/core/somaxconn so +# make sure to raise both the value of somaxconn and tcp_max_syn_backlog +# in order to get the desired effect. +tcp-backlog 511 + +# Unix socket. +# +# Specify the path for the Unix socket that will be used to listen for +# incoming connections. There is no default, so Redis will not listen +# on a unix socket when not specified. +# +# unixsocket /run/redis.sock +# unixsocketperm 700 + +# Close the connection after a client is idle for N seconds (0 to disable) +timeout 0 + +# TCP keepalive. +# +# If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence +# of communication. This is useful for two reasons: +# +# 1) Detect dead peers. +# 2) Force network equipment in the middle to consider the connection to be +# alive. +# +# On Linux, the specified value (in seconds) is the period used to send ACKs. +# Note that to close the connection the double of the time is needed. +# On other kernels the period depends on the kernel configuration. +# +# A reasonable value for this option is 300 seconds, which is the new +# Redis default starting with Redis 3.2.1. +tcp-keepalive 300 + +################################# TLS/SSL ##################################### + +# By default, TLS/SSL is disabled. To enable it, the "tls-port" configuration +# directive can be used to define TLS-listening ports. To enable TLS on the +# default port, use: +# +# port 0 +# tls-port 6379 + +# Configure a X.509 certificate and private key to use for authenticating the +# server to connected clients, masters or cluster peers. These files should be +# PEM formatted. +# +# tls-cert-file redis.crt +# tls-key-file redis.key +# +# If the key file is encrypted using a passphrase, it can be included here +# as well. +# +# tls-key-file-pass secret + +# Normally Redis uses the same certificate for both server functions (accepting +# connections) and client functions (replicating from a master, establishing +# cluster bus connections, etc.). +# +# Sometimes certificates are issued with attributes that designate them as +# client-only or server-only certificates. In that case it may be desired to use +# different certificates for incoming (server) and outgoing (client) +# connections. To do that, use the following directives: +# +# tls-client-cert-file client.crt +# tls-client-key-file client.key +# +# If the key file is encrypted using a passphrase, it can be included here +# as well. +# +# tls-client-key-file-pass secret + +# Configure a DH parameters file to enable Diffie-Hellman (DH) key exchange: +# +# tls-dh-params-file redis.dh + +# Configure a CA certificate(s) bundle or directory to authenticate TLS/SSL +# clients and peers. Redis requires an explicit configuration of at least one +# of these, and will not implicitly use the system wide configuration. +# +# tls-ca-cert-file ca.crt +# tls-ca-cert-dir /etc/ssl/certs + +# By default, clients (including replica servers) on a TLS port are required +# to authenticate using valid client side certificates. +# +# If "no" is specified, client certificates are not required and not accepted. +# If "optional" is specified, client certificates are accepted and must be +# valid if provided, but are not required. +# +# tls-auth-clients no +# tls-auth-clients optional + +# By default, a Redis replica does not attempt to establish a TLS connection +# with its master. +# +# Use the following directive to enable TLS on replication links. +# +# tls-replication yes + +# By default, the Redis Cluster bus uses a plain TCP connection. To enable +# TLS for the bus protocol, use the following directive: +# +# tls-cluster yes + +# By default, only TLSv1.2 and TLSv1.3 are enabled and it is highly recommended +# that older formally deprecated versions are kept disabled to reduce the attack surface. +# You can explicitly specify TLS versions to support. +# Allowed values are case insensitive and include "TLSv1", "TLSv1.1", "TLSv1.2", +# "TLSv1.3" (OpenSSL >= 1.1.1) or any combination. +# To enable only TLSv1.2 and TLSv1.3, use: +# +# tls-protocols "TLSv1.2 TLSv1.3" + +# Configure allowed ciphers. See the ciphers(1ssl) manpage for more information +# about the syntax of this string. +# +# Note: this configuration applies only to <= TLSv1.2. +# +# tls-ciphers DEFAULT:!MEDIUM + +# Configure allowed TLSv1.3 ciphersuites. See the ciphers(1ssl) manpage for more +# information about the syntax of this string, and specifically for TLSv1.3 +# ciphersuites. +# +# tls-ciphersuites TLS_CHACHA20_POLY1305_SHA256 + +# When choosing a cipher, use the server's preference instead of the client +# preference. By default, the server follows the client's preference. +# +# tls-prefer-server-ciphers yes + +# By default, TLS session caching is enabled to allow faster and less expensive +# reconnections by clients that support it. Use the following directive to disable +# caching. +# +# tls-session-caching no + +# Change the default number of TLS sessions cached. A zero value sets the cache +# to unlimited size. The default size is 20480. +# +# tls-session-cache-size 5000 + +# Change the default timeout of cached TLS sessions. The default timeout is 300 +# seconds. +# +# tls-session-cache-timeout 60 + +################################# GENERAL ##################################### + +# By default Redis does not run as a daemon. Use 'yes' if you need it. +# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. +# When Redis is supervised by upstart or systemd, this parameter has no impact. +daemonize no + +# If you run Redis from upstart or systemd, Redis can interact with your +# supervision tree. Options: +# supervised no - no supervision interaction +# supervised upstart - signal upstart by putting Redis into SIGSTOP mode +# requires "expect stop" in your upstart job config +# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET +# on startup, and updating Redis status on a regular +# basis. +# supervised auto - detect upstart or systemd method based on +# UPSTART_JOB or NOTIFY_SOCKET environment variables +# Note: these supervision methods only signal "process is ready." +# They do not enable continuous pings back to your supervisor. +# +# The default is "no". To run under upstart/systemd, you can simply uncomment +# the line below: +# +# supervised auto + +# If a pid file is specified, Redis writes it where specified at startup +# and removes it at exit. +# +# When the server runs non daemonized, no pid file is created if none is +# specified in the configuration. When the server is daemonized, the pid file +# is used even if not specified, defaulting to "/var/run/redis.pid". +# +# Creating a pid file is best effort: if Redis is not able to create it +# nothing bad happens, the server will start and run normally. +# +# Note that on modern Linux systems "/run/redis.pid" is more conforming +# and should be used instead. +pidfile /var/run/redis_6379.pid + +# Specify the server verbosity level. +# This can be one of: +# debug (a lot of information, useful for development/testing) +# verbose (many rarely useful info, but not a mess like the debug level) +# notice (moderately verbose, what you want in production probably) +# warning (only very important / critical messages are logged) +loglevel debug + +# Specify the log file name. Also the empty string can be used to force +# Redis to log on the standard output. Note that if you use standard +# output for logging but daemonize, logs will be sent to /dev/null +logfile "" + +# To enable logging to the system logger, just set 'syslog-enabled' to yes, +# and optionally update the other syslog parameters to suit your needs. +# syslog-enabled no + +# Specify the syslog identity. +# syslog-ident redis + +# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. +# syslog-facility local0 + +# To disable the built in crash log, which will possibly produce cleaner core +# dumps when they are needed, uncomment the following: +# +# crash-log-enabled no + +# To disable the fast memory check that's run as part of the crash log, which +# will possibly let redis terminate sooner, uncomment the following: +# +# crash-memcheck-enabled no + +# Set the number of databases. The default database is DB 0, you can select +# a different one on a per-connection basis using SELECT where +# dbid is a number between 0 and 'databases'-1 +databases 16 + +# By default Redis shows an ASCII art logo only when started to log to the +# standard output and if the standard output is a TTY and syslog logging is +# disabled. Basically this means that normally a logo is displayed only in +# interactive sessions. +# +# However it is possible to force the pre-4.0 behavior and always show a +# ASCII art logo in startup logs by setting the following option to yes. +always-show-logo no + +# By default, Redis modifies the process title (as seen in 'top' and 'ps') to +# provide some runtime information. It is possible to disable this and leave +# the process name as executed by setting the following to no. +set-proc-title yes + +# When changing the process title, Redis uses the following template to construct +# the modified title. +# +# Template variables are specified in curly brackets. The following variables are +# supported: +# +# {title} Name of process as executed if parent, or type of child process. +# {listen-addr} Bind address or '*' followed by TCP or TLS port listening on, or +# Unix socket if only that's available. +# {server-mode} Special mode, i.e. "[sentinel]" or "[cluster]". +# {port} TCP port listening on, or 0. +# {tls-port} TLS port listening on, or 0. +# {unixsocket} Unix domain socket listening on, or "". +# {config-file} Name of configuration file used. +# +proc-title-template "{title} {listen-addr} {server-mode}" + +################################ SNAPSHOTTING ################################ + +# Save the DB to disk. +# +# save +# +# Redis will save the DB if both the given number of seconds and the given +# number of write operations against the DB occurred. +# +# Snapshotting can be completely disabled with a single empty string argument +# as in following example: +# +# save "" +# +# Unless specified otherwise, by default Redis will save the DB: +# * After 3600 seconds (an hour) if at least 1 key changed +# * After 300 seconds (5 minutes) if at least 100 keys changed +# * After 60 seconds if at least 10000 keys changed +# +# You can set these explicitly by uncommenting the three following lines. +# +# save 3600 1 +# save 300 100 +# save 60 10000 + +# By default Redis will stop accepting writes if RDB snapshots are enabled +# (at least one save point) and the latest background save failed. +# This will make the user aware (in a hard way) that data is not persisting +# on disk properly, otherwise chances are that no one will notice and some +# disaster will happen. +# +# If the background saving process will start working again Redis will +# automatically allow writes again. +# +# However if you have setup your proper monitoring of the Redis server +# and persistence, you may want to disable this feature so that Redis will +# continue to work as usual even if there are problems with disk, +# permissions, and so forth. +stop-writes-on-bgsave-error yes + +# Compress string objects using LZF when dump .rdb databases? +# By default compression is enabled as it's almost always a win. +# If you want to save some CPU in the saving child set it to 'no' but +# the dataset will likely be bigger if you have compressible values or keys. +rdbcompression yes + +# Since version 5 of RDB a CRC64 checksum is placed at the end of the file. +# This makes the format more resistant to corruption but there is a performance +# hit to pay (around 10%) when saving and loading RDB files, so you can disable it +# for maximum performances. +# +# RDB files created with checksum disabled have a checksum of zero that will +# tell the loading code to skip the check. +rdbchecksum yes + +# Enables or disables full sanitation checks for ziplist and listpack etc when +# loading an RDB or RESTORE payload. This reduces the chances of a assertion or +# crash later on while processing commands. +# Options: +# no - Never perform full sanitation +# yes - Always perform full sanitation +# clients - Perform full sanitation only for user connections. +# Excludes: RDB files, RESTORE commands received from the master +# connection, and client connections which have the +# skip-sanitize-payload ACL flag. +# The default should be 'clients' but since it currently affects cluster +# resharding via MIGRATE, it is temporarily set to 'no' by default. +# +# sanitize-dump-payload no + +# The filename where to dump the DB +dbfilename dump.rdb + +# Remove RDB files used by replication in instances without persistence +# enabled. By default this option is disabled, however there are environments +# where for regulations or other security concerns, RDB files persisted on +# disk by masters in order to feed replicas, or stored on disk by replicas +# in order to load them for the initial synchronization, should be deleted +# ASAP. Note that this option ONLY WORKS in instances that have both AOF +# and RDB persistence disabled, otherwise is completely ignored. +# +# An alternative (and sometimes better) way to obtain the same effect is +# to use diskless replication on both master and replicas instances. However +# in the case of replicas, diskless is not always an option. +rdb-del-sync-files no + +# The working directory. +# +# The DB will be written inside this directory, with the filename specified +# above using the 'dbfilename' configuration directive. +# +# The Append Only File will also be created inside this directory. +# +# Note that you must specify a directory here, not a file name. +dir ./ + +################################# REPLICATION ################################# + +# Master-Replica replication. Use replicaof to make a Redis instance a copy of +# another Redis server. A few things to understand ASAP about Redis replication. +# +# +------------------+ +---------------+ +# | Master | ---> | Replica | +# | (receive writes) | | (exact copy) | +# +------------------+ +---------------+ +# +# 1) Redis replication is asynchronous, but you can configure a master to +# stop accepting writes if it appears to be not connected with at least +# a given number of replicas. +# 2) Redis replicas are able to perform a partial resynchronization with the +# master if the replication link is lost for a relatively small amount of +# time. You may want to configure the replication backlog size (see the next +# sections of this file) with a sensible value depending on your needs. +# 3) Replication is automatic and does not need user intervention. After a +# network partition replicas automatically try to reconnect to masters +# and resynchronize with them. +# +# replicaof + +# If the master is password protected (using the "requirepass" configuration +# directive below) it is possible to tell the replica to authenticate before +# starting the replication synchronization process, otherwise the master will +# refuse the replica request. +# +# masterauth +# +# However this is not enough if you are using Redis ACLs (for Redis version +# 6 or greater), and the default user is not capable of running the PSYNC +# command and/or other commands needed for replication. In this case it's +# better to configure a special user to use with replication, and specify the +# masteruser configuration as such: +# +# masteruser +# +# When masteruser is specified, the replica will authenticate against its +# master using the new AUTH form: AUTH . + +# When a replica loses its connection with the master, or when the replication +# is still in progress, the replica can act in two different ways: +# +# 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will +# still reply to client requests, possibly with out of date data, or the +# data set may just be empty if this is the first synchronization. +# +# 2) If replica-serve-stale-data is set to 'no' the replica will reply with +# an error "SYNC with master in progress" to all commands except: +# INFO, REPLICAOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG, SUBSCRIBE, +# UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, COMMAND, POST, +# HOST and LATENCY. +# +replica-serve-stale-data yes + +# You can configure a replica instance to accept writes or not. Writing against +# a replica instance may be useful to store some ephemeral data (because data +# written on a replica will be easily deleted after resync with the master) but +# may also cause problems if clients are writing to it because of a +# misconfiguration. +# +# Since Redis 2.6 by default replicas are read-only. +# +# Note: read only replicas are not designed to be exposed to untrusted clients +# on the internet. It's just a protection layer against misuse of the instance. +# Still a read only replica exports by default all the administrative commands +# such as CONFIG, DEBUG, and so forth. To a limited extent you can improve +# security of read only replicas using 'rename-command' to shadow all the +# administrative / dangerous commands. +replica-read-only yes + +# Replication SYNC strategy: disk or socket. +# +# New replicas and reconnecting replicas that are not able to continue the +# replication process just receiving differences, need to do what is called a +# "full synchronization". An RDB file is transmitted from the master to the +# replicas. +# +# The transmission can happen in two different ways: +# +# 1) Disk-backed: The Redis master creates a new process that writes the RDB +# file on disk. Later the file is transferred by the parent +# process to the replicas incrementally. +# 2) Diskless: The Redis master creates a new process that directly writes the +# RDB file to replica sockets, without touching the disk at all. +# +# With disk-backed replication, while the RDB file is generated, more replicas +# can be queued and served with the RDB file as soon as the current child +# producing the RDB file finishes its work. With diskless replication instead +# once the transfer starts, new replicas arriving will be queued and a new +# transfer will start when the current one terminates. +# +# When diskless replication is used, the master waits a configurable amount of +# time (in seconds) before starting the transfer in the hope that multiple +# replicas will arrive and the transfer can be parallelized. +# +# With slow disks and fast (large bandwidth) networks, diskless replication +# works better. +repl-diskless-sync no + +# When diskless replication is enabled, it is possible to configure the delay +# the server waits in order to spawn the child that transfers the RDB via socket +# to the replicas. +# +# This is important since once the transfer starts, it is not possible to serve +# new replicas arriving, that will be queued for the next RDB transfer, so the +# server waits a delay in order to let more replicas arrive. +# +# The delay is specified in seconds, and by default is 5 seconds. To disable +# it entirely just set it to 0 seconds and the transfer will start ASAP. +repl-diskless-sync-delay 5 + +# ----------------------------------------------------------------------------- +# WARNING: RDB diskless load is experimental. Since in this setup the replica +# does not immediately store an RDB on disk, it may cause data loss during +# failovers. RDB diskless load + Redis modules not handling I/O reads may also +# cause Redis to abort in case of I/O errors during the initial synchronization +# stage with the master. Use only if you know what you are doing. +# ----------------------------------------------------------------------------- +# +# Replica can load the RDB it reads from the replication link directly from the +# socket, or store the RDB to a file and read that file after it was completely +# received from the master. +# +# In many cases the disk is slower than the network, and storing and loading +# the RDB file may increase replication time (and even increase the master's +# Copy on Write memory and salve buffers). +# However, parsing the RDB file directly from the socket may mean that we have +# to flush the contents of the current database before the full rdb was +# received. For this reason we have the following options: +# +# "disabled" - Don't use diskless load (store the rdb file to the disk first) +# "on-empty-db" - Use diskless load only when it is completely safe. +# "swapdb" - Keep a copy of the current db contents in RAM while parsing +# the data directly from the socket. note that this requires +# sufficient memory, if you don't have it, you risk an OOM kill. +repl-diskless-load disabled + +# Replicas send PINGs to server in a predefined interval. It's possible to +# change this interval with the repl_ping_replica_period option. The default +# value is 10 seconds. +# +# repl-ping-replica-period 10 + +# The following option sets the replication timeout for: +# +# 1) Bulk transfer I/O during SYNC, from the point of view of replica. +# 2) Master timeout from the point of view of replicas (data, pings). +# 3) Replica timeout from the point of view of masters (REPLCONF ACK pings). +# +# It is important to make sure that this value is greater than the value +# specified for repl-ping-replica-period otherwise a timeout will be detected +# every time there is low traffic between the master and the replica. The default +# value is 60 seconds. +# +# repl-timeout 60 + +# Disable TCP_NODELAY on the replica socket after SYNC? +# +# If you select "yes" Redis will use a smaller number of TCP packets and +# less bandwidth to send data to replicas. But this can add a delay for +# the data to appear on the replica side, up to 40 milliseconds with +# Linux kernels using a default configuration. +# +# If you select "no" the delay for data to appear on the replica side will +# be reduced but more bandwidth will be used for replication. +# +# By default we optimize for low latency, but in very high traffic conditions +# or when the master and replicas are many hops away, turning this to "yes" may +# be a good idea. +repl-disable-tcp-nodelay no + +# Set the replication backlog size. The backlog is a buffer that accumulates +# replica data when replicas are disconnected for some time, so that when a +# replica wants to reconnect again, often a full resync is not needed, but a +# partial resync is enough, just passing the portion of data the replica +# missed while disconnected. +# +# The bigger the replication backlog, the longer the replica can endure the +# disconnect and later be able to perform a partial resynchronization. +# +# The backlog is only allocated if there is at least one replica connected. +# +# repl-backlog-size 1mb + +# After a master has no connected replicas for some time, the backlog will be +# freed. The following option configures the amount of seconds that need to +# elapse, starting from the time the last replica disconnected, for the backlog +# buffer to be freed. +# +# Note that replicas never free the backlog for timeout, since they may be +# promoted to masters later, and should be able to correctly "partially +# resynchronize" with other replicas: hence they should always accumulate backlog. +# +# A value of 0 means to never release the backlog. +# +# repl-backlog-ttl 3600 + +# The replica priority is an integer number published by Redis in the INFO +# output. It is used by Redis Sentinel in order to select a replica to promote +# into a master if the master is no longer working correctly. +# +# A replica with a low priority number is considered better for promotion, so +# for instance if there are three replicas with priority 10, 100, 25 Sentinel +# will pick the one with priority 10, that is the lowest. +# +# However a special priority of 0 marks the replica as not able to perform the +# role of master, so a replica with priority of 0 will never be selected by +# Redis Sentinel for promotion. +# +# By default the priority is 100. +replica-priority 100 + +# ----------------------------------------------------------------------------- +# By default, Redis Sentinel includes all replicas in its reports. A replica +# can be excluded from Redis Sentinel's announcements. An unannounced replica +# will be ignored by the 'sentinel replicas ' command and won't be +# exposed to Redis Sentinel's clients. +# +# This option does not change the behavior of replica-priority. Even with +# replica-announced set to 'no', the replica can be promoted to master. To +# prevent this behavior, set replica-priority to 0. +# +# replica-announced yes + +# It is possible for a master to stop accepting writes if there are less than +# N replicas connected, having a lag less or equal than M seconds. +# +# The N replicas need to be in "online" state. +# +# The lag in seconds, that must be <= the specified value, is calculated from +# the last ping received from the replica, that is usually sent every second. +# +# This option does not GUARANTEE that N replicas will accept the write, but +# will limit the window of exposure for lost writes in case not enough replicas +# are available, to the specified number of seconds. +# +# For example to require at least 3 replicas with a lag <= 10 seconds use: +# +# min-replicas-to-write 3 +# min-replicas-max-lag 10 +# +# Setting one or the other to 0 disables the feature. +# +# By default min-replicas-to-write is set to 0 (feature disabled) and +# min-replicas-max-lag is set to 10. + +# A Redis master is able to list the address and port of the attached +# replicas in different ways. For example the "INFO replication" section +# offers this information, which is used, among other tools, by +# Redis Sentinel in order to discover replica instances. +# Another place where this info is available is in the output of the +# "ROLE" command of a master. +# +# The listed IP address and port normally reported by a replica is +# obtained in the following way: +# +# IP: The address is auto detected by checking the peer address +# of the socket used by the replica to connect with the master. +# +# Port: The port is communicated by the replica during the replication +# handshake, and is normally the port that the replica is using to +# listen for connections. +# +# However when port forwarding or Network Address Translation (NAT) is +# used, the replica may actually be reachable via different IP and port +# pairs. The following two options can be used by a replica in order to +# report to its master a specific set of IP and port, so that both INFO +# and ROLE will report those values. +# +# There is no need to use both the options if you need to override just +# the port or the IP address. +# +# replica-announce-ip 5.5.5.5 +# replica-announce-port 1234 + +############################### KEYS TRACKING ################################# + +# Redis implements server assisted support for client side caching of values. +# This is implemented using an invalidation table that remembers, using +# a radix key indexed by key name, what clients have which keys. In turn +# this is used in order to send invalidation messages to clients. Please +# check this page to understand more about the feature: +# +# https://redis.io/topics/client-side-caching +# +# When tracking is enabled for a client, all the read only queries are assumed +# to be cached: this will force Redis to store information in the invalidation +# table. When keys are modified, such information is flushed away, and +# invalidation messages are sent to the clients. However if the workload is +# heavily dominated by reads, Redis could use more and more memory in order +# to track the keys fetched by many clients. +# +# For this reason it is possible to configure a maximum fill value for the +# invalidation table. By default it is set to 1M of keys, and once this limit +# is reached, Redis will start to evict keys in the invalidation table +# even if they were not modified, just to reclaim memory: this will in turn +# force the clients to invalidate the cached values. Basically the table +# maximum size is a trade off between the memory you want to spend server +# side to track information about who cached what, and the ability of clients +# to retain cached objects in memory. +# +# If you set the value to 0, it means there are no limits, and Redis will +# retain as many keys as needed in the invalidation table. +# In the "stats" INFO section, you can find information about the number of +# keys in the invalidation table at every given moment. +# +# Note: when key tracking is used in broadcasting mode, no memory is used +# in the server side so this setting is useless. +# +# tracking-table-max-keys 1000000 + +################################## SECURITY ################################### + +# Warning: since Redis is pretty fast, an outside user can try up to +# 1 million passwords per second against a modern box. This means that you +# should use very strong passwords, otherwise they will be very easy to break. +# Note that because the password is really a shared secret between the client +# and the server, and should not be memorized by any human, the password +# can be easily a long string from /dev/urandom or whatever, so by using a +# long and unguessable password no brute force attack will be possible. + +# Redis ACL users are defined in the following format: +# +# user ... acl rules ... +# +# For example: +# +# user worker +@list +@connection ~jobs:* on >ffa9203c493aa99 +# +# The special username "default" is used for new connections. If this user +# has the "nopass" rule, then new connections will be immediately authenticated +# as the "default" user without the need of any password provided via the +# AUTH command. Otherwise if the "default" user is not flagged with "nopass" +# the connections will start in not authenticated state, and will require +# AUTH (or the HELLO command AUTH option) in order to be authenticated and +# start to work. +# +# The ACL rules that describe what a user can do are the following: +# +# on Enable the user: it is possible to authenticate as this user. +# off Disable the user: it's no longer possible to authenticate +# with this user, however the already authenticated connections +# will still work. +# skip-sanitize-payload RESTORE dump-payload sanitation is skipped. +# sanitize-payload RESTORE dump-payload is sanitized (default). +# + Allow the execution of that command +# - Disallow the execution of that command +# +@ Allow the execution of all the commands in such category +# with valid categories are like @admin, @set, @sortedset, ... +# and so forth, see the full list in the server.c file where +# the Redis command table is described and defined. +# The special category @all means all the commands, but currently +# present in the server, and that will be loaded in the future +# via modules. +# +|subcommand Allow a specific subcommand of an otherwise +# disabled command. Note that this form is not +# allowed as negative like -DEBUG|SEGFAULT, but +# only additive starting with "+". +# allcommands Alias for +@all. Note that it implies the ability to execute +# all the future commands loaded via the modules system. +# nocommands Alias for -@all. +# ~ Add a pattern of keys that can be mentioned as part of +# commands. For instance ~* allows all the keys. The pattern +# is a glob-style pattern like the one of KEYS. +# It is possible to specify multiple patterns. +# allkeys Alias for ~* +# resetkeys Flush the list of allowed keys patterns. +# & Add a glob-style pattern of Pub/Sub channels that can be +# accessed by the user. It is possible to specify multiple channel +# patterns. +# allchannels Alias for &* +# resetchannels Flush the list of allowed channel patterns. +# > Add this password to the list of valid password for the user. +# For example >mypass will add "mypass" to the list. +# This directive clears the "nopass" flag (see later). +# < Remove this password from the list of valid passwords. +# nopass All the set passwords of the user are removed, and the user +# is flagged as requiring no password: it means that every +# password will work against this user. If this directive is +# used for the default user, every new connection will be +# immediately authenticated with the default user without +# any explicit AUTH command required. Note that the "resetpass" +# directive will clear this condition. +# resetpass Flush the list of allowed passwords. Moreover removes the +# "nopass" status. After "resetpass" the user has no associated +# passwords and there is no way to authenticate without adding +# some password (or setting it as "nopass" later). +# reset Performs the following actions: resetpass, resetkeys, off, +# -@all. The user returns to the same state it has immediately +# after its creation. +# +# ACL rules can be specified in any order: for instance you can start with +# passwords, then flags, or key patterns. However note that the additive +# and subtractive rules will CHANGE MEANING depending on the ordering. +# For instance see the following example: +# +user daveh on on +@all ~* >foobarbazzle +user default off + +# user alice on +@all -DEBUG ~* >somepassword +# +# This will allow "alice" to use all the commands with the exception of the +# DEBUG command, since +@all added all the commands to the set of the commands +# alice can use, and later DEBUG was removed. However if we invert the order +# of two ACL rules the result will be different: +# +# user alice on -DEBUG +@all ~* >somepassword +# +# Now DEBUG was removed when alice had yet no commands in the set of allowed +# commands, later all the commands are added, so the user will be able to +# execute everything. +# +# Basically ACL rules are processed left-to-right. +# +# For more information about ACL configuration please refer to +# the Redis web site at https://redis.io/topics/acl + +# ACL LOG +# +# The ACL Log tracks failed commands and authentication events associated +# with ACLs. The ACL Log is useful to troubleshoot failed commands blocked +# by ACLs. The ACL Log is stored in memory. You can reclaim memory with +# ACL LOG RESET. Define the maximum entry length of the ACL Log below. +acllog-max-len 128 + +# Using an external ACL file +# +# Instead of configuring users here in this file, it is possible to use +# a stand-alone file just listing users. The two methods cannot be mixed: +# if you configure users here and at the same time you activate the external +# ACL file, the server will refuse to start. +# +# The format of the external ACL user file is exactly the same as the +# format that is used inside redis.conf to describe users. +# +# aclfile /etc/redis/users.acl + +# IMPORTANT NOTE: starting with Redis 6 "requirepass" is just a compatibility +# layer on top of the new ACL system. The option effect will be just setting +# the password for the default user. Clients will still authenticate using +# AUTH as usually, or more explicitly with AUTH default +# if they follow the new protocol: both will work. +# +# The requirepass is not compatable with aclfile option and the ACL LOAD +# command, these will cause requirepass to be ignored. +# +# requirepass foobared + +# New users are initialized with restrictive permissions by default, via the +# equivalent of this ACL rule 'off resetkeys -@all'. Starting with Redis 6.2, it +# is possible to manage access to Pub/Sub channels with ACL rules as well. The +# default Pub/Sub channels permission if new users is controlled by the +# acl-pubsub-default configuration directive, which accepts one of these values: +# +# allchannels: grants access to all Pub/Sub channels +# resetchannels: revokes access to all Pub/Sub channels +# +# To ensure backward compatibility while upgrading Redis 6.0, acl-pubsub-default +# defaults to the 'allchannels' permission. +# +# Future compatibility note: it is very likely that in a future version of Redis +# the directive's default of 'allchannels' will be changed to 'resetchannels' in +# order to provide better out-of-the-box Pub/Sub security. Therefore, it is +# recommended that you explicitly define Pub/Sub permissions for all users +# rather then rely on implicit default values. Once you've set explicit +# Pub/Sub for all existing users, you should uncomment the following line. +# +# acl-pubsub-default resetchannels + +# Command renaming (DEPRECATED). +# +# ------------------------------------------------------------------------ +# WARNING: avoid using this option if possible. Instead use ACLs to remove +# commands from the default user, and put them only in some admin user you +# create for administrative purposes. +# ------------------------------------------------------------------------ +# +# It is possible to change the name of dangerous commands in a shared +# environment. For instance the CONFIG command may be renamed into something +# hard to guess so that it will still be available for internal-use tools +# but not available for general clients. +# +# Example: +# +# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 +# +# It is also possible to completely kill a command by renaming it into +# an empty string: +# +# rename-command CONFIG "" +# +# Please note that changing the name of commands that are logged into the +# AOF file or transmitted to replicas may cause problems. + +################################### CLIENTS #################################### + +# Set the max number of connected clients at the same time. By default +# this limit is set to 10000 clients, however if the Redis server is not +# able to configure the process file limit to allow for the specified limit +# the max number of allowed clients is set to the current file limit +# minus 32 (as Redis reserves a few file descriptors for internal uses). +# +# Once the limit is reached Redis will close all the new connections sending +# an error 'max number of clients reached'. +# +# IMPORTANT: When Redis Cluster is used, the max number of connections is also +# shared with the cluster bus: every node in the cluster will use two +# connections, one incoming and another outgoing. It is important to size the +# limit accordingly in case of very large clusters. +# +# maxclients 10000 + +############################## MEMORY MANAGEMENT ################################ + +# Set a memory usage limit to the specified amount of bytes. +# When the memory limit is reached Redis will try to remove keys +# according to the eviction policy selected (see maxmemory-policy). +# +# If Redis can't remove keys according to the policy, or if the policy is +# set to 'noeviction', Redis will start to reply with errors to commands +# that would use more memory, like SET, LPUSH, and so on, and will continue +# to reply to read-only commands like GET. +# +# This option is usually useful when using Redis as an LRU or LFU cache, or to +# set a hard memory limit for an instance (using the 'noeviction' policy). +# +# WARNING: If you have replicas attached to an instance with maxmemory on, +# the size of the output buffers needed to feed the replicas are subtracted +# from the used memory count, so that network problems / resyncs will +# not trigger a loop where keys are evicted, and in turn the output +# buffer of replicas is full with DELs of keys evicted triggering the deletion +# of more keys, and so forth until the database is completely emptied. +# +# In short... if you have replicas attached it is suggested that you set a lower +# limit for maxmemory so that there is some free RAM on the system for replica +# output buffers (but this is not needed if the policy is 'noeviction'). +# +# maxmemory + +# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory +# is reached. You can select one from the following behaviors: +# +# volatile-lru -> Evict using approximated LRU, only keys with an expire set. +# allkeys-lru -> Evict any key using approximated LRU. +# volatile-lfu -> Evict using approximated LFU, only keys with an expire set. +# allkeys-lfu -> Evict any key using approximated LFU. +# volatile-random -> Remove a random key having an expire set. +# allkeys-random -> Remove a random key, any key. +# volatile-ttl -> Remove the key with the nearest expire time (minor TTL) +# noeviction -> Don't evict anything, just return an error on write operations. +# +# LRU means Least Recently Used +# LFU means Least Frequently Used +# +# Both LRU, LFU and volatile-ttl are implemented using approximated +# randomized algorithms. +# +# Note: with any of the above policies, when there are no suitable keys for +# eviction, Redis will return an error on write operations that require +# more memory. These are usually commands that create new keys, add data or +# modify existing keys. A few examples are: SET, INCR, HSET, LPUSH, SUNIONSTORE, +# SORT (due to the STORE argument), and EXEC (if the transaction includes any +# command that requires memory). +# +# The default is: +# +# maxmemory-policy noeviction + +# LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated +# algorithms (in order to save memory), so you can tune it for speed or +# accuracy. By default Redis will check five keys and pick the one that was +# used least recently, you can change the sample size using the following +# configuration directive. +# +# The default of 5 produces good enough results. 10 Approximates very closely +# true LRU but costs more CPU. 3 is faster but not very accurate. +# +# maxmemory-samples 5 + +# Eviction processing is designed to function well with the default setting. +# If there is an unusually large amount of write traffic, this value may need to +# be increased. Decreasing this value may reduce latency at the risk of +# eviction processing effectiveness +# 0 = minimum latency, 10 = default, 100 = process without regard to latency +# +# maxmemory-eviction-tenacity 10 + +# Starting from Redis 5, by default a replica will ignore its maxmemory setting +# (unless it is promoted to master after a failover or manually). It means +# that the eviction of keys will be just handled by the master, sending the +# DEL commands to the replica as keys evict in the master side. +# +# This behavior ensures that masters and replicas stay consistent, and is usually +# what you want, however if your replica is writable, or you want the replica +# to have a different memory setting, and you are sure all the writes performed +# to the replica are idempotent, then you may change this default (but be sure +# to understand what you are doing). +# +# Note that since the replica by default does not evict, it may end using more +# memory than the one set via maxmemory (there are certain buffers that may +# be larger on the replica, or data structures may sometimes take more memory +# and so forth). So make sure you monitor your replicas and make sure they +# have enough memory to never hit a real out-of-memory condition before the +# master hits the configured maxmemory setting. +# +# replica-ignore-maxmemory yes + +# Redis reclaims expired keys in two ways: upon access when those keys are +# found to be expired, and also in background, in what is called the +# "active expire key". The key space is slowly and interactively scanned +# looking for expired keys to reclaim, so that it is possible to free memory +# of keys that are expired and will never be accessed again in a short time. +# +# The default effort of the expire cycle will try to avoid having more than +# ten percent of expired keys still in memory, and will try to avoid consuming +# more than 25% of total memory and to add latency to the system. However +# it is possible to increase the expire "effort" that is normally set to +# "1", to a greater value, up to the value "10". At its maximum value the +# system will use more CPU, longer cycles (and technically may introduce +# more latency), and will tolerate less already expired keys still present +# in the system. It's a tradeoff between memory, CPU and latency. +# +# active-expire-effort 1 + +############################# LAZY FREEING #################################### + +# Redis has two primitives to delete keys. One is called DEL and is a blocking +# deletion of the object. It means that the server stops processing new commands +# in order to reclaim all the memory associated with an object in a synchronous +# way. If the key deleted is associated with a small object, the time needed +# in order to execute the DEL command is very small and comparable to most other +# O(1) or O(log_N) commands in Redis. However if the key is associated with an +# aggregated value containing millions of elements, the server can block for +# a long time (even seconds) in order to complete the operation. +# +# For the above reasons Redis also offers non blocking deletion primitives +# such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and +# FLUSHDB commands, in order to reclaim memory in background. Those commands +# are executed in constant time. Another thread will incrementally free the +# object in the background as fast as possible. +# +# DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled. +# It's up to the design of the application to understand when it is a good +# idea to use one or the other. However the Redis server sometimes has to +# delete keys or flush the whole database as a side effect of other operations. +# Specifically Redis deletes objects independently of a user call in the +# following scenarios: +# +# 1) On eviction, because of the maxmemory and maxmemory policy configurations, +# in order to make room for new data, without going over the specified +# memory limit. +# 2) Because of expire: when a key with an associated time to live (see the +# EXPIRE command) must be deleted from memory. +# 3) Because of a side effect of a command that stores data on a key that may +# already exist. For example the RENAME command may delete the old key +# content when it is replaced with another one. Similarly SUNIONSTORE +# or SORT with STORE option may delete existing keys. The SET command +# itself removes any old content of the specified key in order to replace +# it with the specified string. +# 4) During replication, when a replica performs a full resynchronization with +# its master, the content of the whole database is removed in order to +# load the RDB file just transferred. +# +# In all the above cases the default is to delete objects in a blocking way, +# like if DEL was called. However you can configure each case specifically +# in order to instead release memory in a non-blocking way like if UNLINK +# was called, using the following configuration directives. + +lazyfree-lazy-eviction no +lazyfree-lazy-expire no +lazyfree-lazy-server-del no +replica-lazy-flush no + +# It is also possible, for the case when to replace the user code DEL calls +# with UNLINK calls is not easy, to modify the default behavior of the DEL +# command to act exactly like UNLINK, using the following configuration +# directive: + +lazyfree-lazy-user-del no + +# FLUSHDB, FLUSHALL, and SCRIPT FLUSH support both asynchronous and synchronous +# deletion, which can be controlled by passing the [SYNC|ASYNC] flags into the +# commands. When neither flag is passed, this directive will be used to determine +# if the data should be deleted asynchronously. + +lazyfree-lazy-user-flush no + +################################ THREADED I/O ################################# + +# Redis is mostly single threaded, however there are certain threaded +# operations such as UNLINK, slow I/O accesses and other things that are +# performed on side threads. +# +# Now it is also possible to handle Redis clients socket reads and writes +# in different I/O threads. Since especially writing is so slow, normally +# Redis users use pipelining in order to speed up the Redis performances per +# core, and spawn multiple instances in order to scale more. Using I/O +# threads it is possible to easily speedup two times Redis without resorting +# to pipelining nor sharding of the instance. +# +# By default threading is disabled, we suggest enabling it only in machines +# that have at least 4 or more cores, leaving at least one spare core. +# Using more than 8 threads is unlikely to help much. We also recommend using +# threaded I/O only if you actually have performance problems, with Redis +# instances being able to use a quite big percentage of CPU time, otherwise +# there is no point in using this feature. +# +# So for instance if you have a four cores boxes, try to use 2 or 3 I/O +# threads, if you have a 8 cores, try to use 6 threads. In order to +# enable I/O threads use the following configuration directive: +# +# io-threads 4 +# +# Setting io-threads to 1 will just use the main thread as usual. +# When I/O threads are enabled, we only use threads for writes, that is +# to thread the write(2) syscall and transfer the client buffers to the +# socket. However it is also possible to enable threading of reads and +# protocol parsing using the following configuration directive, by setting +# it to yes: +# +# io-threads-do-reads no +# +# Usually threading reads doesn't help much. +# +# NOTE 1: This configuration directive cannot be changed at runtime via +# CONFIG SET. Aso this feature currently does not work when SSL is +# enabled. +# +# NOTE 2: If you want to test the Redis speedup using redis-benchmark, make +# sure you also run the benchmark itself in threaded mode, using the +# --threads option to match the number of Redis threads, otherwise you'll not +# be able to notice the improvements. + +############################ KERNEL OOM CONTROL ############################## + +# On Linux, it is possible to hint the kernel OOM killer on what processes +# should be killed first when out of memory. +# +# Enabling this feature makes Redis actively control the oom_score_adj value +# for all its processes, depending on their role. The default scores will +# attempt to have background child processes killed before all others, and +# replicas killed before masters. +# +# Redis supports three options: +# +# no: Don't make changes to oom-score-adj (default). +# yes: Alias to "relative" see below. +# absolute: Values in oom-score-adj-values are written as is to the kernel. +# relative: Values are used relative to the initial value of oom_score_adj when +# the server starts and are then clamped to a range of -1000 to 1000. +# Because typically the initial value is 0, they will often match the +# absolute values. +oom-score-adj no + +# When oom-score-adj is used, this directive controls the specific values used +# for master, replica and background child processes. Values range -2000 to +# 2000 (higher means more likely to be killed). +# +# Unprivileged processes (not root, and without CAP_SYS_RESOURCE capabilities) +# can freely increase their value, but not decrease it below its initial +# settings. This means that setting oom-score-adj to "relative" and setting the +# oom-score-adj-values to positive values will always succeed. +oom-score-adj-values 0 200 800 + + +#################### KERNEL transparent hugepage CONTROL ###################### + +# Usually the kernel Transparent Huge Pages control is set to "madvise" or +# or "never" by default (/sys/kernel/mm/transparent_hugepage/enabled), in which +# case this config has no effect. On systems in which it is set to "always", +# redis will attempt to disable it specifically for the redis process in order +# to avoid latency problems specifically with fork(2) and CoW. +# If for some reason you prefer to keep it enabled, you can set this config to +# "no" and the kernel global to "always". + +disable-thp yes + +############################## APPEND ONLY MODE ############################### + +# By default Redis asynchronously dumps the dataset on disk. This mode is +# good enough in many applications, but an issue with the Redis process or +# a power outage may result into a few minutes of writes lost (depending on +# the configured save points). +# +# The Append Only File is an alternative persistence mode that provides +# much better durability. For instance using the default data fsync policy +# (see later in the config file) Redis can lose just one second of writes in a +# dramatic event like a server power outage, or a single write if something +# wrong with the Redis process itself happens, but the operating system is +# still running correctly. +# +# AOF and RDB persistence can be enabled at the same time without problems. +# If the AOF is enabled on startup Redis will load the AOF, that is the file +# with the better durability guarantees. +# +# Please check https://redis.io/topics/persistence for more information. + +appendonly no + +# The name of the append only file (default: "appendonly.aof") + +appendfilename "appendonly.aof" + +# The fsync() call tells the Operating System to actually write data on disk +# instead of waiting for more data in the output buffer. Some OS will really flush +# data on disk, some other OS will just try to do it ASAP. +# +# Redis supports three different modes: +# +# no: don't fsync, just let the OS flush the data when it wants. Faster. +# always: fsync after every write to the append only log. Slow, Safest. +# everysec: fsync only one time every second. Compromise. +# +# The default is "everysec", as that's usually the right compromise between +# speed and data safety. It's up to you to understand if you can relax this to +# "no" that will let the operating system flush the output buffer when +# it wants, for better performances (but if you can live with the idea of +# some data loss consider the default persistence mode that's snapshotting), +# or on the contrary, use "always" that's very slow but a bit safer than +# everysec. +# +# More details please check the following article: +# http://antirez.com/post/redis-persistence-demystified.html +# +# If unsure, use "everysec". + +# appendfsync always +appendfsync everysec +# appendfsync no + +# When the AOF fsync policy is set to always or everysec, and a background +# saving process (a background save or AOF log background rewriting) is +# performing a lot of I/O against the disk, in some Linux configurations +# Redis may block too long on the fsync() call. Note that there is no fix for +# this currently, as even performing fsync in a different thread will block +# our synchronous write(2) call. +# +# In order to mitigate this problem it's possible to use the following option +# that will prevent fsync() from being called in the main process while a +# BGSAVE or BGREWRITEAOF is in progress. +# +# This means that while another child is saving, the durability of Redis is +# the same as "appendfsync none". In practical terms, this means that it is +# possible to lose up to 30 seconds of log in the worst scenario (with the +# default Linux settings). +# +# If you have latency problems turn this to "yes". Otherwise leave it as +# "no" that is the safest pick from the point of view of durability. + +no-appendfsync-on-rewrite no + +# Automatic rewrite of the append only file. +# Redis is able to automatically rewrite the log file implicitly calling +# BGREWRITEAOF when the AOF log size grows by the specified percentage. +# +# This is how it works: Redis remembers the size of the AOF file after the +# latest rewrite (if no rewrite has happened since the restart, the size of +# the AOF at startup is used). +# +# This base size is compared to the current size. If the current size is +# bigger than the specified percentage, the rewrite is triggered. Also +# you need to specify a minimal size for the AOF file to be rewritten, this +# is useful to avoid rewriting the AOF file even if the percentage increase +# is reached but it is still pretty small. +# +# Specify a percentage of zero in order to disable the automatic AOF +# rewrite feature. + +auto-aof-rewrite-percentage 100 +auto-aof-rewrite-min-size 64mb + +# An AOF file may be found to be truncated at the end during the Redis +# startup process, when the AOF data gets loaded back into memory. +# This may happen when the system where Redis is running +# crashes, especially when an ext4 filesystem is mounted without the +# data=ordered option (however this can't happen when Redis itself +# crashes or aborts but the operating system still works correctly). +# +# Redis can either exit with an error when this happens, or load as much +# data as possible (the default now) and start if the AOF file is found +# to be truncated at the end. The following option controls this behavior. +# +# If aof-load-truncated is set to yes, a truncated AOF file is loaded and +# the Redis server starts emitting a log to inform the user of the event. +# Otherwise if the option is set to no, the server aborts with an error +# and refuses to start. When the option is set to no, the user requires +# to fix the AOF file using the "redis-check-aof" utility before to restart +# the server. +# +# Note that if the AOF file will be found to be corrupted in the middle +# the server will still exit with an error. This option only applies when +# Redis will try to read more data from the AOF file but not enough bytes +# will be found. +aof-load-truncated yes + +# When rewriting the AOF file, Redis is able to use an RDB preamble in the +# AOF file for faster rewrites and recoveries. When this option is turned +# on the rewritten AOF file is composed of two different stanzas: +# +# [RDB file][AOF tail] +# +# When loading, Redis recognizes that the AOF file starts with the "REDIS" +# string and loads the prefixed RDB file, then continues loading the AOF +# tail. +aof-use-rdb-preamble yes + +################################ LUA SCRIPTING ############################### + +# Max execution time of a Lua script in milliseconds. +# +# If the maximum execution time is reached Redis will log that a script is +# still in execution after the maximum allowed time and will start to +# reply to queries with an error. +# +# When a long running script exceeds the maximum execution time only the +# SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be +# used to stop a script that did not yet call any write commands. The second +# is the only way to shut down the server in the case a write command was +# already issued by the script but the user doesn't want to wait for the natural +# termination of the script. +# +# Set it to 0 or a negative value for unlimited execution without warnings. +lua-time-limit 5000 + +################################ REDIS CLUSTER ############################### + +# Normal Redis instances can't be part of a Redis Cluster; only nodes that are +# started as cluster nodes can. In order to start a Redis instance as a +# cluster node enable the cluster support uncommenting the following: +# +# cluster-enabled yes + +# Every cluster node has a cluster configuration file. This file is not +# intended to be edited by hand. It is created and updated by Redis nodes. +# Every Redis Cluster node requires a different cluster configuration file. +# Make sure that instances running in the same system do not have +# overlapping cluster configuration file names. +# +# cluster-config-file nodes-6379.conf + +# Cluster node timeout is the amount of milliseconds a node must be unreachable +# for it to be considered in failure state. +# Most other internal time limits are a multiple of the node timeout. +# +# cluster-node-timeout 15000 + +# A replica of a failing master will avoid to start a failover if its data +# looks too old. +# +# There is no simple way for a replica to actually have an exact measure of +# its "data age", so the following two checks are performed: +# +# 1) If there are multiple replicas able to failover, they exchange messages +# in order to try to give an advantage to the replica with the best +# replication offset (more data from the master processed). +# Replicas will try to get their rank by offset, and apply to the start +# of the failover a delay proportional to their rank. +# +# 2) Every single replica computes the time of the last interaction with +# its master. This can be the last ping or command received (if the master +# is still in the "connected" state), or the time that elapsed since the +# disconnection with the master (if the replication link is currently down). +# If the last interaction is too old, the replica will not try to failover +# at all. +# +# The point "2" can be tuned by user. Specifically a replica will not perform +# the failover if, since the last interaction with the master, the time +# elapsed is greater than: +# +# (node-timeout * cluster-replica-validity-factor) + repl-ping-replica-period +# +# So for example if node-timeout is 30 seconds, and the cluster-replica-validity-factor +# is 10, and assuming a default repl-ping-replica-period of 10 seconds, the +# replica will not try to failover if it was not able to talk with the master +# for longer than 310 seconds. +# +# A large cluster-replica-validity-factor may allow replicas with too old data to failover +# a master, while a too small value may prevent the cluster from being able to +# elect a replica at all. +# +# For maximum availability, it is possible to set the cluster-replica-validity-factor +# to a value of 0, which means, that replicas will always try to failover the +# master regardless of the last time they interacted with the master. +# (However they'll always try to apply a delay proportional to their +# offset rank). +# +# Zero is the only value able to guarantee that when all the partitions heal +# the cluster will always be able to continue. +# +# cluster-replica-validity-factor 10 + +# Cluster replicas are able to migrate to orphaned masters, that are masters +# that are left without working replicas. This improves the cluster ability +# to resist to failures as otherwise an orphaned master can't be failed over +# in case of failure if it has no working replicas. +# +# Replicas migrate to orphaned masters only if there are still at least a +# given number of other working replicas for their old master. This number +# is the "migration barrier". A migration barrier of 1 means that a replica +# will migrate only if there is at least 1 other working replica for its master +# and so forth. It usually reflects the number of replicas you want for every +# master in your cluster. +# +# Default is 1 (replicas migrate only if their masters remain with at least +# one replica). To disable migration just set it to a very large value or +# set cluster-allow-replica-migration to 'no'. +# A value of 0 can be set but is useful only for debugging and dangerous +# in production. +# +# cluster-migration-barrier 1 + +# Turning off this option allows to use less automatic cluster configuration. +# It both disables migration to orphaned masters and migration from masters +# that became empty. +# +# Default is 'yes' (allow automatic migrations). +# +# cluster-allow-replica-migration yes + +# By default Redis Cluster nodes stop accepting queries if they detect there +# is at least a hash slot uncovered (no available node is serving it). +# This way if the cluster is partially down (for example a range of hash slots +# are no longer covered) all the cluster becomes, eventually, unavailable. +# It automatically returns available as soon as all the slots are covered again. +# +# However sometimes you want the subset of the cluster which is working, +# to continue to accept queries for the part of the key space that is still +# covered. In order to do so, just set the cluster-require-full-coverage +# option to no. +# +# cluster-require-full-coverage yes + +# This option, when set to yes, prevents replicas from trying to failover its +# master during master failures. However the replica can still perform a +# manual failover, if forced to do so. +# +# This is useful in different scenarios, especially in the case of multiple +# data center operations, where we want one side to never be promoted if not +# in the case of a total DC failure. +# +# cluster-replica-no-failover no + +# This option, when set to yes, allows nodes to serve read traffic while the +# the cluster is in a down state, as long as it believes it owns the slots. +# +# This is useful for two cases. The first case is for when an application +# doesn't require consistency of data during node failures or network partitions. +# One example of this is a cache, where as long as the node has the data it +# should be able to serve it. +# +# The second use case is for configurations that don't meet the recommended +# three shards but want to enable cluster mode and scale later. A +# master outage in a 1 or 2 shard configuration causes a read/write outage to the +# entire cluster without this option set, with it set there is only a write outage. +# Without a quorum of masters, slot ownership will not change automatically. +# +# cluster-allow-reads-when-down no + +# In order to setup your cluster make sure to read the documentation +# available at https://redis.io web site. + +########################## CLUSTER DOCKER/NAT support ######################## + +# In certain deployments, Redis Cluster nodes address discovery fails, because +# addresses are NAT-ted or because ports are forwarded (the typical case is +# Docker and other containers). +# +# In order to make Redis Cluster working in such environments, a static +# configuration where each node knows its public address is needed. The +# following four options are used for this scope, and are: +# +# * cluster-announce-ip +# * cluster-announce-port +# * cluster-announce-tls-port +# * cluster-announce-bus-port +# +# Each instructs the node about its address, client ports (for connections +# without and with TLS) and cluster message bus port. The information is then +# published in the header of the bus packets so that other nodes will be able to +# correctly map the address of the node publishing the information. +# +# If cluster-tls is set to yes and cluster-announce-tls-port is omitted or set +# to zero, then cluster-announce-port refers to the TLS port. Note also that +# cluster-announce-tls-port has no effect if cluster-tls is set to no. +# +# If the above options are not used, the normal Redis Cluster auto-detection +# will be used instead. +# +# Note that when remapped, the bus port may not be at the fixed offset of +# clients port + 10000, so you can specify any port and bus-port depending +# on how they get remapped. If the bus-port is not set, a fixed offset of +# 10000 will be used as usual. +# +# Example: +# +# cluster-announce-ip 10.1.1.5 +# cluster-announce-tls-port 6379 +# cluster-announce-port 0 +# cluster-announce-bus-port 6380 + +################################## SLOW LOG ################################### + +# The Redis Slow Log is a system to log queries that exceeded a specified +# execution time. The execution time does not include the I/O operations +# like talking with the client, sending the reply and so forth, +# but just the time needed to actually execute the command (this is the only +# stage of command execution where the thread is blocked and can not serve +# other requests in the meantime). +# +# You can configure the slow log with two parameters: one tells Redis +# what is the execution time, in microseconds, to exceed in order for the +# command to get logged, and the other parameter is the length of the +# slow log. When a new command is logged the oldest one is removed from the +# queue of logged commands. + +# The following time is expressed in microseconds, so 1000000 is equivalent +# to one second. Note that a negative number disables the slow log, while +# a value of zero forces the logging of every command. +slowlog-log-slower-than 10000 + +# There is no limit to this length. Just be aware that it will consume memory. +# You can reclaim memory used by the slow log with SLOWLOG RESET. +slowlog-max-len 128 + +################################ LATENCY MONITOR ############################## + +# The Redis latency monitoring subsystem samples different operations +# at runtime in order to collect data related to possible sources of +# latency of a Redis instance. +# +# Via the LATENCY command this information is available to the user that can +# print graphs and obtain reports. +# +# The system only logs operations that were performed in a time equal or +# greater than the amount of milliseconds specified via the +# latency-monitor-threshold configuration directive. When its value is set +# to zero, the latency monitor is turned off. +# +# By default latency monitoring is disabled since it is mostly not needed +# if you don't have latency issues, and collecting data has a performance +# impact, that while very small, can be measured under big load. Latency +# monitoring can easily be enabled at runtime using the command +# "CONFIG SET latency-monitor-threshold " if needed. +latency-monitor-threshold 0 + +############################# EVENT NOTIFICATION ############################## + +# Redis can notify Pub/Sub clients about events happening in the key space. +# This feature is documented at https://redis.io/topics/notifications +# +# For instance if keyspace events notification is enabled, and a client +# performs a DEL operation on key "foo" stored in the Database 0, two +# messages will be published via Pub/Sub: +# +# PUBLISH __keyspace@0__:foo del +# PUBLISH __keyevent@0__:del foo +# +# It is possible to select the events that Redis will notify among a set +# of classes. Every class is identified by a single character: +# +# K Keyspace events, published with __keyspace@__ prefix. +# E Keyevent events, published with __keyevent@__ prefix. +# g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... +# $ String commands +# l List commands +# s Set commands +# h Hash commands +# z Sorted set commands +# x Expired events (events generated every time a key expires) +# e Evicted events (events generated when a key is evicted for maxmemory) +# t Stream commands +# d Module key type events +# m Key-miss events (Note: It is not included in the 'A' class) +# A Alias for g$lshzxetd, so that the "AKE" string means all the events +# (Except key-miss events which are excluded from 'A' due to their +# unique nature). +# +# The "notify-keyspace-events" takes as argument a string that is composed +# of zero or multiple characters. The empty string means that notifications +# are disabled. +# +# Example: to enable list and generic events, from the point of view of the +# event name, use: +# +# notify-keyspace-events Elg +# +# Example 2: to get the stream of the expired keys subscribing to channel +# name __keyevent@0__:expired use: +# +# notify-keyspace-events Ex +# +# By default all notifications are disabled because most users don't need +# this feature and the feature has some overhead. Note that if you don't +# specify at least one of K or E, no events will be delivered. +notify-keyspace-events "" + +############################### GOPHER SERVER ################################# + +# Redis contains an implementation of the Gopher protocol, as specified in +# the RFC 1436 (https://www.ietf.org/rfc/rfc1436.txt). +# +# The Gopher protocol was very popular in the late '90s. It is an alternative +# to the web, and the implementation both server and client side is so simple +# that the Redis server has just 100 lines of code in order to implement this +# support. +# +# What do you do with Gopher nowadays? Well Gopher never *really* died, and +# lately there is a movement in order for the Gopher more hierarchical content +# composed of just plain text documents to be resurrected. Some want a simpler +# internet, others believe that the mainstream internet became too much +# controlled, and it's cool to create an alternative space for people that +# want a bit of fresh air. +# +# Anyway for the 10nth birthday of the Redis, we gave it the Gopher protocol +# as a gift. +# +# --- HOW IT WORKS? --- +# +# The Redis Gopher support uses the inline protocol of Redis, and specifically +# two kind of inline requests that were anyway illegal: an empty request +# or any request that starts with "/" (there are no Redis commands starting +# with such a slash). Normal RESP2/RESP3 requests are completely out of the +# path of the Gopher protocol implementation and are served as usual as well. +# +# If you open a connection to Redis when Gopher is enabled and send it +# a string like "/foo", if there is a key named "/foo" it is served via the +# Gopher protocol. +# +# In order to create a real Gopher "hole" (the name of a Gopher site in Gopher +# talking), you likely need a script like the following: +# +# https://github.com/antirez/gopher2redis +# +# --- SECURITY WARNING --- +# +# If you plan to put Redis on the internet in a publicly accessible address +# to server Gopher pages MAKE SURE TO SET A PASSWORD to the instance. +# Once a password is set: +# +# 1. The Gopher server (when enabled, not by default) will still serve +# content via Gopher. +# 2. However other commands cannot be called before the client will +# authenticate. +# +# So use the 'requirepass' option to protect your instance. +# +# Note that Gopher is not currently supported when 'io-threads-do-reads' +# is enabled. +# +# To enable Gopher support, uncomment the following line and set the option +# from no (the default) to yes. +# +# gopher-enabled no + +############################### ADVANCED CONFIG ############################### + +# Hashes are encoded using a memory efficient data structure when they have a +# small number of entries, and the biggest entry does not exceed a given +# threshold. These thresholds can be configured using the following directives. +hash-max-ziplist-entries 512 +hash-max-ziplist-value 64 + +# Lists are also encoded in a special way to save a lot of space. +# The number of entries allowed per internal list node can be specified +# as a fixed maximum size or a maximum number of elements. +# For a fixed maximum size, use -5 through -1, meaning: +# -5: max size: 64 Kb <-- not recommended for normal workloads +# -4: max size: 32 Kb <-- not recommended +# -3: max size: 16 Kb <-- probably not recommended +# -2: max size: 8 Kb <-- good +# -1: max size: 4 Kb <-- good +# Positive numbers mean store up to _exactly_ that number of elements +# per list node. +# The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size), +# but if your use case is unique, adjust the settings as necessary. +list-max-ziplist-size -2 + +# Lists may also be compressed. +# Compress depth is the number of quicklist ziplist nodes from *each* side of +# the list to *exclude* from compression. The head and tail of the list +# are always uncompressed for fast push/pop operations. Settings are: +# 0: disable all list compression +# 1: depth 1 means "don't start compressing until after 1 node into the list, +# going from either the head or tail" +# So: [head]->node->node->...->node->[tail] +# [head], [tail] will always be uncompressed; inner nodes will compress. +# 2: [head]->[next]->node->node->...->node->[prev]->[tail] +# 2 here means: don't compress head or head->next or tail->prev or tail, +# but compress all nodes between them. +# 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail] +# etc. +list-compress-depth 0 + +# Sets have a special encoding in just one case: when a set is composed +# of just strings that happen to be integers in radix 10 in the range +# of 64 bit signed integers. +# The following configuration setting sets the limit in the size of the +# set in order to use this special memory saving encoding. +set-max-intset-entries 512 + +# Similarly to hashes and lists, sorted sets are also specially encoded in +# order to save a lot of space. This encoding is only used when the length and +# elements of a sorted set are below the following limits: +zset-max-ziplist-entries 128 +zset-max-ziplist-value 64 + +# HyperLogLog sparse representation bytes limit. The limit includes the +# 16 bytes header. When an HyperLogLog using the sparse representation crosses +# this limit, it is converted into the dense representation. +# +# A value greater than 16000 is totally useless, since at that point the +# dense representation is more memory efficient. +# +# The suggested value is ~ 3000 in order to have the benefits of +# the space efficient encoding without slowing down too much PFADD, +# which is O(N) with the sparse encoding. The value can be raised to +# ~ 10000 when CPU is not a concern, but space is, and the data set is +# composed of many HyperLogLogs with cardinality in the 0 - 15000 range. +hll-sparse-max-bytes 3000 + +# Streams macro node max size / items. The stream data structure is a radix +# tree of big nodes that encode multiple items inside. Using this configuration +# it is possible to configure how big a single node can be in bytes, and the +# maximum number of items it may contain before switching to a new node when +# appending new stream entries. If any of the following settings are set to +# zero, the limit is ignored, so for instance it is possible to set just a +# max entries limit by setting max-bytes to 0 and max-entries to the desired +# value. +stream-node-max-bytes 4096 +stream-node-max-entries 100 + +# Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in +# order to help rehashing the main Redis hash table (the one mapping top-level +# keys to values). The hash table implementation Redis uses (see dict.c) +# performs a lazy rehashing: the more operation you run into a hash table +# that is rehashing, the more rehashing "steps" are performed, so if the +# server is idle the rehashing is never complete and some more memory is used +# by the hash table. +# +# The default is to use this millisecond 10 times every second in order to +# actively rehash the main dictionaries, freeing memory when possible. +# +# If unsure: +# use "activerehashing no" if you have hard latency requirements and it is +# not a good thing in your environment that Redis can reply from time to time +# to queries with 2 milliseconds delay. +# +# use "activerehashing yes" if you don't have such hard requirements but +# want to free memory asap when possible. +activerehashing yes + +# The client output buffer limits can be used to force disconnection of clients +# that are not reading data from the server fast enough for some reason (a +# common reason is that a Pub/Sub client can't consume messages as fast as the +# publisher can produce them). +# +# The limit can be set differently for the three different classes of clients: +# +# normal -> normal clients including MONITOR clients +# replica -> replica clients +# pubsub -> clients subscribed to at least one pubsub channel or pattern +# +# The syntax of every client-output-buffer-limit directive is the following: +# +# client-output-buffer-limit +# +# A client is immediately disconnected once the hard limit is reached, or if +# the soft limit is reached and remains reached for the specified number of +# seconds (continuously). +# So for instance if the hard limit is 32 megabytes and the soft limit is +# 16 megabytes / 10 seconds, the client will get disconnected immediately +# if the size of the output buffers reach 32 megabytes, but will also get +# disconnected if the client reaches 16 megabytes and continuously overcomes +# the limit for 10 seconds. +# +# By default normal clients are not limited because they don't receive data +# without asking (in a push way), but just after a request, so only +# asynchronous clients may create a scenario where data is requested faster +# than it can read. +# +# Instead there is a default limit for pubsub and replica clients, since +# subscribers and replicas receive data in a push fashion. +# +# Both the hard or the soft limit can be disabled by setting them to zero. +client-output-buffer-limit normal 0 0 0 +client-output-buffer-limit replica 256mb 64mb 60 +client-output-buffer-limit pubsub 32mb 8mb 60 + +# Client query buffers accumulate new commands. They are limited to a fixed +# amount by default in order to avoid that a protocol desynchronization (for +# instance due to a bug in the client) will lead to unbound memory usage in +# the query buffer. However you can configure it here if you have very special +# needs, such us huge multi/exec requests or alike. +# +# client-query-buffer-limit 1gb + +# In the Redis protocol, bulk requests, that are, elements representing single +# strings, are normally limited to 512 mb. However you can change this limit +# here, but must be 1mb or greater +# +# proto-max-bulk-len 512mb + +# Redis calls an internal function to perform many background tasks, like +# closing connections of clients in timeout, purging expired keys that are +# never requested, and so forth. +# +# Not all tasks are performed with the same frequency, but Redis checks for +# tasks to perform according to the specified "hz" value. +# +# By default "hz" is set to 10. Raising the value will use more CPU when +# Redis is idle, but at the same time will make Redis more responsive when +# there are many keys expiring at the same time, and timeouts may be +# handled with more precision. +# +# The range is between 1 and 500, however a value over 100 is usually not +# a good idea. Most users should use the default of 10 and raise this up to +# 100 only in environments where very low latency is required. +hz 10 + +# Normally it is useful to have an HZ value which is proportional to the +# number of clients connected. This is useful in order, for instance, to +# avoid too many clients are processed for each background task invocation +# in order to avoid latency spikes. +# +# Since the default HZ value by default is conservatively set to 10, Redis +# offers, and enables by default, the ability to use an adaptive HZ value +# which will temporarily raise when there are many connected clients. +# +# When dynamic HZ is enabled, the actual configured HZ will be used +# as a baseline, but multiples of the configured HZ value will be actually +# used as needed once more clients are connected. In this way an idle +# instance will use very little CPU time while a busy instance will be +# more responsive. +dynamic-hz yes + +# When a child rewrites the AOF file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +aof-rewrite-incremental-fsync yes + +# When redis saves RDB file, if the following option is enabled +# the file will be fsync-ed every 32 MB of data generated. This is useful +# in order to commit the file to the disk more incrementally and avoid +# big latency spikes. +rdb-save-incremental-fsync yes + +# Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good +# idea to start with the default settings and only change them after investigating +# how to improve the performances and how the keys LFU change over time, which +# is possible to inspect via the OBJECT FREQ command. +# +# There are two tunable parameters in the Redis LFU implementation: the +# counter logarithm factor and the counter decay time. It is important to +# understand what the two parameters mean before changing them. +# +# The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis +# uses a probabilistic increment with logarithmic behavior. Given the value +# of the old counter, when a key is accessed, the counter is incremented in +# this way: +# +# 1. A random number R between 0 and 1 is extracted. +# 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1). +# 3. The counter is incremented only if R < P. +# +# The default lfu-log-factor is 10. This is a table of how the frequency +# counter changes with a different number of accesses with different +# logarithmic factors: +# +# +--------+------------+------------+------------+------------+------------+ +# | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits | +# +--------+------------+------------+------------+------------+------------+ +# | 0 | 104 | 255 | 255 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 1 | 18 | 49 | 255 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 10 | 10 | 18 | 142 | 255 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# | 100 | 8 | 11 | 49 | 143 | 255 | +# +--------+------------+------------+------------+------------+------------+ +# +# NOTE: The above table was obtained by running the following commands: +# +# redis-benchmark -n 1000000 incr foo +# redis-cli object freq foo +# +# NOTE 2: The counter initial value is 5 in order to give new objects a chance +# to accumulate hits. +# +# The counter decay time is the time, in minutes, that must elapse in order +# for the key counter to be divided by two (or decremented if it has a value +# less <= 10). +# +# The default value for the lfu-decay-time is 1. A special value of 0 means to +# decay the counter every time it happens to be scanned. +# +# lfu-log-factor 10 +# lfu-decay-time 1 + +########################### ACTIVE DEFRAGMENTATION ####################### +# +# What is active defragmentation? +# ------------------------------- +# +# Active (online) defragmentation allows a Redis server to compact the +# spaces left between small allocations and deallocations of data in memory, +# thus allowing to reclaim back memory. +# +# Fragmentation is a natural process that happens with every allocator (but +# less so with Jemalloc, fortunately) and certain workloads. Normally a server +# restart is needed in order to lower the fragmentation, or at least to flush +# away all the data and create it again. However thanks to this feature +# implemented by Oran Agra for Redis 4.0 this process can happen at runtime +# in a "hot" way, while the server is running. +# +# Basically when the fragmentation is over a certain level (see the +# configuration options below) Redis will start to create new copies of the +# values in contiguous memory regions by exploiting certain specific Jemalloc +# features (in order to understand if an allocation is causing fragmentation +# and to allocate it in a better place), and at the same time, will release the +# old copies of the data. This process, repeated incrementally for all the keys +# will cause the fragmentation to drop back to normal values. +# +# Important things to understand: +# +# 1. This feature is disabled by default, and only works if you compiled Redis +# to use the copy of Jemalloc we ship with the source code of Redis. +# This is the default with Linux builds. +# +# 2. You never need to enable this feature if you don't have fragmentation +# issues. +# +# 3. Once you experience fragmentation, you can enable this feature when +# needed with the command "CONFIG SET activedefrag yes". +# +# The configuration parameters are able to fine tune the behavior of the +# defragmentation process. If you are not sure about what they mean it is +# a good idea to leave the defaults untouched. + +# Enabled active defragmentation +# activedefrag no + +# Minimum amount of fragmentation waste to start active defrag +# active-defrag-ignore-bytes 100mb + +# Minimum percentage of fragmentation to start active defrag +# active-defrag-threshold-lower 10 + +# Maximum percentage of fragmentation at which we use maximum effort +# active-defrag-threshold-upper 100 + +# Minimal effort for defrag in CPU percentage, to be used when the lower +# threshold is reached +# active-defrag-cycle-min 1 + +# Maximal effort for defrag in CPU percentage, to be used when the upper +# threshold is reached +# active-defrag-cycle-max 25 + +# Maximum number of set/hash/zset/list fields that will be processed from +# the main dictionary scan +# active-defrag-max-scan-fields 1000 + +# Jemalloc background thread for purging will be enabled by default +jemalloc-bg-thread yes + +# It is possible to pin different threads and processes of Redis to specific +# CPUs in your system, in order to maximize the performances of the server. +# This is useful both in order to pin different Redis threads in different +# CPUs, but also in order to make sure that multiple Redis instances running +# in the same host will be pinned to different CPUs. +# +# Normally you can do this using the "taskset" command, however it is also +# possible to this via Redis configuration directly, both in Linux and FreeBSD. +# +# You can pin the server/IO threads, bio threads, aof rewrite child process, and +# the bgsave child process. The syntax to specify the cpu list is the same as +# the taskset command: +# +# Set redis server/io threads to cpu affinity 0,2,4,6: +# server_cpulist 0-7:2 +# +# Set bio threads to cpu affinity 1,3: +# bio_cpulist 1,3 +# +# Set aof rewrite child process to cpu affinity 8,9,10,11: +# aof_rewrite_cpulist 8-11 +# +# Set bgsave child process to cpu affinity 1,10,11 +# bgsave_cpulist 1,10-11 + +# In some cases redis will emit warnings and even refuse to start if it detects +# that the system is in bad state, it is possible to suppress these warnings +# by setting the following config which takes a space delimited list of warnings +# to suppress +# +# ignore-warnings ARM64-COW-BUG \ No newline at end of file