This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Readme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleCloseGenerateCodeDialog = () => { | |
onClose(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global exports, require*/ | |
var convert = require("./convert"); | |
exports.handler = async function (event, context) { | |
"use strict"; | |
let body; | |
let statusCode = 200; | |
const headers = { | |
"Content-Type": "application/json", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global require, module, console */ | |
var path = require("path"), | |
fs = require("fs"), | |
os = require("os"), | |
uuid = require("uuid"), | |
s3 = require("./s3-util"); | |
var synthesizeText = require("./synthesize-text"); | |
const { env } = require("process"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global module, require, Promise, console */ | |
var aws = require("aws-sdk"), | |
path = require("path"), | |
fs = require("fs"), | |
os = require("os"), | |
uuid = require("uuid"), | |
s3 = new aws.S3(), | |
downloadFromS3 = function (bucket, fileKey) { | |
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require("aws-sdk"); | |
var languageConfiguration = require("./language-configuration"); | |
const polly = new AWS.Polly({ | |
signatureVersion: "v4", | |
region: process.env.AWS_REGION, | |
}); | |
const readTextFile = (filePath) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const iso2LangToPollyParams = { | |
fr: { | |
engine: "neural", | |
voiceId: "Lea", | |
langCode: "fr-FR", | |
}, | |
en: { | |
engine: "neural", | |
voiceId: "Joanna", | |
langCode: "en-US", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "name": "tts-s3-converter", "dependencies": { "uuid": "^2.0.2" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import NextAuth from "next-auth" | |
import CognitoProvider from "next-auth/providers/cognito"; | |
export const authOptions = { | |
providers: [ | |
CognitoProvider({ | |
clientId: process.env.COGNITO_CLIENT_ID, | |
clientSecret: process.env.COGNITO_CLIENT_SECRET, | |
issuer: process.env.COGNITO_DOMAIN, | |
idToken: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async jwt({ token, user, account }) { | |
if (account && user) { | |
if (account['provider'] === 'cognito') { | |
token.accessToken = account?.access_token; | |
var tokenParsed = JSON.parse(Buffer.from(account.id_token.split('.')[1], 'base64').toString()); | |
token.username = tokenParsed['cognito:username']; | |
token.refreshToken = account?.refresh_token; | |
token.accessTokenExpires = account.expires_at * 1000; | |
} | |
} |