diff --git a/.env b/.env index bdeb0f9..649be8b 100644 --- a/.env +++ b/.env @@ -1,2 +1,4 @@ -SPEECH_KEY=paste-your-speech-key-here -SPEECH_REGION=paste-your-speech-region-here +SPEECH_KEY=YOUR_SPEECH_KEY_HERE +SPEECH_REGION=YOUR_REGION_HERE +TEXT_KEY=YOUR_TEXT_ANALYSIS_KEY_HERE +TEXT_ENDPOINT=YOUR_CORRESPONDING_ENDPOINT_HERE diff --git a/.eslintcache b/.eslintcache new file mode 100644 index 0000000..74b642b --- /dev/null +++ b/.eslintcache @@ -0,0 +1 @@ +[{"C:\\Users\\s153848\\co-n-versualize\\AzureSpeechReactSample-main\\src\\index.js":"1","C:\\Users\\s153848\\co-n-versualize\\AzureSpeechReactSample-main\\src\\App.js":"2","C:\\Users\\s153848\\co-n-versualize\\AzureSpeechReactSample-main\\src\\token_util.js":"3","C:\\Users\\s153848\\co-n-versualize\\AzureSpeechReactSample-main\\src\\textclient.js":"4"},{"size":239,"mtime":1633533139810,"results":"5","hashOfConfig":"6"},{"size":17418,"mtime":1641046167333,"results":"7","hashOfConfig":"6"},{"size":981,"mtime":1633531369355,"results":"8","hashOfConfig":"6"},{"size":808,"mtime":1633536481972,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},"w0zloz",{"filePath":"13","messages":"14","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":"15","usedDeprecatedRules":"12"},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"18"},{"filePath":"19","messages":"20","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":1,"source":null},"C:\\Users\\s153848\\co-n-versualize\\AzureSpeechReactSample-main\\src\\index.js",[],["21","22"],"C:\\Users\\s153848\\co-n-versualize\\AzureSpeechReactSample-main\\src\\App.js",["23","24","25","26","27"],"import React, { Component } from 'react';\nimport { Container } from 'reactstrap';\nimport { getTokenOrRefresh } from './token_util';\nimport './custom.css'\nimport { ResultReason } from 'microsoft-cognitiveservices-speech-sdk';\nimport axios from 'axios';\n\nrequire('dotenv').config();\n\n//cognitive services\nconst speechsdk = require('microsoft-cognitiveservices-speech-sdk')\n\nconst { TextAnalyticsClient, AzureKeyCredential } = require(\"@azure/ai-text-analytics\");\n\nconst key = '7889a8e1c4084f5daf69c71673b8c6fa';\nconst endpoint = 'https://textingthings.cognitiveservices.azure.com/';\nconst textAnalyticsClient = new TextAnalyticsClient(endpoint, new AzureKeyCredential(key));\n\nexport default class App extends Component {\n constructor(props) {\n super(props);\n \n this.state = {\n displayText: null,\n entitiescomp: null,\n keyphrases: null,\n recognizerboy: null,\n ctr: 0,\n }\n }\n \n async componentDidMount() {\n // check for valid speech key/region\n const tokenRes = await getTokenOrRefresh();\n if (tokenRes.authToken === null) {\n this.setState({\n displayText: 'FATAL_ERROR: ' + tokenRes.error\n });\n }\n }\n \n //get keyphrases -----------> TODO: get whole analyzed object bc more info jwz, wellicht gwn alleen die 2nd ding die je wilt (entities)\n async keyPhraseExtraction(recognizedtext){\n let displayText;\n\n const client = textAnalyticsClient;\n const text = recognizedtext;\n const keyPhrasesInput = [\n text,\n ];\n\n const keyPhraseResult = await client.extractKeyPhrases(keyPhrasesInput);\n \n keyPhraseResult.forEach(document => {\n // console.log(`ID: ${document.id}`);\n displayText = `${document.keyPhrases}`;\n });\n\n this.setState({\n keyphrases: displayText,\n });\n console.log(\"keyphraseresult: \" + keyPhraseResult);\n \n }\n\n async entityRecognition(recognizedtext){\n //let displayText;\n const client = textAnalyticsClient;\n const text = recognizedtext;\n\n const entityInputs = [\n text,\n // \"Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975, to develop and sell BASIC interpreters for the Altair 8800\",\n // \"La sede principal de Microsoft se encuentra en la ciudad de Redmond, a 21 kilómetros de Seattle.\"\n ];\n\n const entityResults = await client.recognizeEntities(entityInputs);\n \n entityResults.forEach(document => {\n console.log(`Document ID: ${document.id}`);\n if (document.entities != null){\n document.entities.forEach(entity => {\n console.log(`\\tName: ${entity.text} \\tCategory: ${entity.category} \\tSubcategory: ${entity.subCategory ? entity.subCategory : \"N/A\"}`);\n console.log(`\\tScore: ${entity.confidenceScore}`);\n });\n }\n });\n\n this.setState({\n entitiescomp: entityResults,\n });\n console.log(\"entityresults\" + entityResults[0].entities);\n }\n // entityRecognition(textAnalyticsClient);\n\n //check if state (i.e. first displayText, then keyphrase&entity) updated, send to api\n async componentDidUpdate(prevState) {\n // Typical usage (don't forget to compare props):\n if (this.state.displayText !== prevState.displayText) {\n if(this.state.entitiescomp !== null){\n if (this.state.entitiescomp !== prevState.entitiescomp && this.state.keyphrases !== prevState.keyphrases){\n //copy state & remove client info\n console.log(this.state);\n const sentence = this.state.displayText;\n const keyphrases = this.state.keyphrases;\n const entities = this.state.entitiescomp[0].entities;\n try{\n await axios.post('http://localhost:3002/processing/poster', {sentence,keyphrases,entities}, {\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(\n console.log('it was updated, so we updating and doing the networkthing')\n );\n } catch(err) {\n if(err.response === 500) {\n console.log('it fucked up in the server');\n } else {\n console.log(\"error:\" + err.response);\n }\n };\n }\n }\n }\n }\n \n async sttFromMic(){\n let displayText;\n var Ctr = this.state.ctr;\n let utterances = [\n // \"Deliberating how online social interaction can't compare to the quality of face to face conversations, Erickson and Kellogg stated It is through conversation that we create, develop, validate, and share knowledge. Based their arguments. Coconut was developed in a research-through-design process with the aim to enhance and foster the quality of such conversations \",\n // \"Correspondingly, in its approach to Natural Language Understanding, rather than identifying topics from large datasets of documents such as news articles and social media content, its algorithm defines an utterance during a conversation as a document.\",\n // \"Natural Language Processing to transcribe spoken language to text, as well as initial text analysis, is performed through Microsoft Azure Cognitive Services. As a result, keyphrases and predefined named entities are identified for each utterance, which are then processed and stored to facilitate correlated topic modeling.\",\n // \"As such, the interface contributes to Natural Language Understanding by visualizing how topical knowledge is carried through a conversation in real time.\",\n\n // \"Deliberating how online social interaction cannot compare to the quality of face-to-face conversations, Erickson and Kellogg stated It is through conversation that we create, develop, validate, and share knowledge. Based their arguments, Coconut was developed in a research-through-design process with the aim to enhance and foster the quality of such conversations.\",\n // \"In its core, it makes use of natural language processing by Microsoft to transcribe an utterance to text and identify its key phrases and entities, after which Coconut processes these to keep track of their relation to each other.\",\n // \"In its approach to Natural Language Understanding, rather than identifying topics from a large dataset of written documents, Coconut identifies topics from a conversation through utterances to create, develop, validate, and share its topical knowledge with those conversing.\",\n // \"In a nutshell, through correlated topic modeling in real time, Coconut visualizes how topical knowledge unfolds in conversations.\",\n \"Deliberating how online social interaction can't compare to the quality of face to face conversations, Erickson and Kellogg stated It is through conversation that we create, develop, validate, and share knowledge. Based their arguments. Coconut was developed in a research-through-design process with the aim to enhance and foster the quality of such conversations.\",\n \"Correspondingly, in its approach to Natural Language Understanding, rather than identifying topics from large datasets of documents such as news articles and social media content, its algorithm defines an utterance during a conversation as a document.\",\n \"Natural Language Processing to transcribe spoken language to text, as well as initial text analysis, is facilitated by Microsoft Azure Cognitive Services. As a result, keyphrases and predefined named entities are identified for each utterance, which are then processed and stored to facilitate correlated topic modeling.\",\n \"As such, the interface contributes to Natural Language Understanding by visualizing how topical knowledge is carried through a conversation in real time.\",\n \"Admittedly, the current prototype is rather limited in terms of interaction. However, it demonstrates how utterance based topic modeling presents a variety of design and design research opportunities. For example, it could be used to automatically generate mindmaps, visualize arguments made during political debates or even uncover novel approaches in qualitative data analysis.\",\n \"Fun fact by the way, to automatically generate mindmaps was actually why Coconut was developed in the first place! That being said, it should be noted that the current prototype is merely a component of what it envisions. As the upcoming iterations is where things actually get interesting.\",\n \"Considering the quality of face to face conversations encompasses much more than spoken language, it should be noted that the current model does not incorporate vital information such as facial expressions, body language and the situated context of a conversation. Moreover, it is still subjected to a two dimensional interface.\",\n \"So how do we capture such vital information? How may Coconut take into consideration the natural language components of body language and situated context?\",\n \"In order to move from a two to a three dimensional interface, the next iteration entails integration of the Azure Kinect DK sensor, which will not only allow for body language to be coupled to utterances, but bridge the digital and the physical by enabling full bodied interaction in a three-dimensional tangible interface.\"\n \n\n\n // \"Admittedly, the current prototype is rather limited in terms of interaction. However, it demonstrates how utterance based topic modeling presents a variety of design and design research opportunities. For example, it could be used to automatically generate mindmaps, visualize arguments made during political debates or even uncover novel approaches in qualitative data analysis.\",\n // \"Fun fact by the way, to automatically generate mindmaps was actually why Coconut was developed in the first place! That being said, it should be noted that the current prototype is merely a component of what it envisions. As the upcoming iterations is where things actually get interesting.\",\n // \"Considering the quality of face to face conversations encompasses much more than spoken language, it should be noted that the current model does not incorporate vital information such as facial expressions, body language and the situated context of a conversation. Moreover, it is still subjected to a two dimensional interface.\",\n // \"So how do we capture such vital information? How may Coconut take into consideration the natural language components of body language and situated context?\",\n // \"In order to move from a two to a three dimensional interface, the next iteration entails integration of the Azure Kinect DK sensor, which will not only allow for body language to be coupled to utterances, but bridge the digital and the physical by enabling full bodied interaction in a three-dimensional tangible interface\"\n // \"Erickson and Kellogg stated it is through conversation that we create, develop, validate and share knowledge. Building on their argument of how online social interaction can't compare to the quality or face to face conversations, this interface was designed with the aim to facilitate live feedback during a conversation.\",\n // \"In its approach to natural language understanding, rather than identifying topics from large data sets of documents such as news articles and social media content, the algorithm defines a single utterance of spoken language as a document.\",\n // \"Under the hood, Microsoft Azure Cognitive Services facilitates natural language processing to transcribe spoken language to text and perform initial text analysis, for which the latter identifies key phrases and predefined named entities for each utterance\",\n // \"These are then processed and stored to facilitate correlated topic modelling. As such, the interface visualizes how topical knowledge is carried through a conversation in real time\",\n // \".\"\n ]\n\n \n displayText = utterances[Ctr];\n Ctr = Ctr + 1;\n if(Ctr == utterances.length){\n Ctr = 0;\n }\n\n this.keyPhraseExtraction(displayText);\n this.entityRecognition(displayText);\n\n this.setState({\n displayText: displayText,\n ctr: Ctr\n });\n }\n\n //React example single utterance (15s max.)\n // async sttFromMic() {\n // const tokenObj = await getTokenOrRefresh();\n // const speechConfig = speechsdk.SpeechConfig.fromAuthorizationToken(tokenObj.authToken, tokenObj.region);\n // speechConfig.speechRecognitionLanguage = 'en-US';\n \n // const audioConfig = speechsdk.AudioConfig.fromDefaultMicrophoneInput();\n // const recognizer = new speechsdk.SpeechRecognizer(speechConfig, audioConfig);\n\n // this.setState({\n // displayText: 'speak into your microphone...'\n // });\n\n // recognizer.recognizeOnceAsync(result => {\n // let displayText;\n \n\n // if (result.reason === ResultReason.RecognizedSpeech) {\n // displayText = `${result.text}`;\n \n // } else {\n // displayText = 'ERROR: Speech was cancelled or could not be recognized. Ensure your microphone is working properly.';\n // }\n // // this.keyPhraseExtraction(displayText);\n // });\n // }\n\n //Awesome Olaf doing continious jwz\n async sttFromMicCont(){\n const tokenObj = await getTokenOrRefresh();\n const speechConfig = speechsdk.SpeechConfig.fromAuthorizationToken(tokenObj.authToken, tokenObj.region);\n speechConfig.speechRecognitionLanguage = 'en-US';\n \n const audioConfig = speechsdk.AudioConfig.fromDefaultMicrophoneInput();\n const recognizer = new speechsdk.SpeechRecognizer(speechConfig, audioConfig);\n\n this.setState({recognizerboy: recognizer})\n\n let displayText;\n\n recognizer.recognizing = (s, e) => {\n //console.log(`RECOGNIZING: Text=${e.result.text}`);\n //displayText = `${e.result.text}`;\n };\n \n \n recognizer.recognized = (s, e) => {\n if (e.result.reason == speechsdk.ResultReason.RecognizedSpeech) {\n console.log(`RECOGNIZED: Text=${e.result.text}`);\n displayText = `${e.result.text}`;\n this.keyPhraseExtraction(displayText);\n this.entityRecognition(displayText);\n this.setState({displayText: displayText});\n }\n else if (e.result.reason == speechsdk.ResultReason.NoMatch) {\n console.log(\"NOMATCH: Speech could not be recognized.\");\n }\n };\n \n recognizer.canceled = (s, e) => {\n console.log(`CANCELED: Reason=${e.reason}`);\n \n if (e.reason == speechsdk.CancellationReason.Error) {\n console.log(`\"CANCELED: ErrorCode=${e.errorCode}`);\n console.log(`\"CANCELED: ErrorDetails=${e.errorDetails}`);\n console.log(\"CANCELED: Did you update the key and location/region info?\");\n }\n \n recognizer.stopContinuousRecognitionAsync();\n };\n \n recognizer.sessionStopped = (s, e) => {\n console.log(\"\\n Session stopped event.\");\n recognizer.stopContinuousRecognitionAsync();\n };\n\n recognizer.startContinuousRecognitionAsync();\n }\n\n //button to stop the recogniiton process\n async sttFromMicContStop() {\n const recognizer = this.state.recognizerboy;\n recognizer.stopContinuousRecognitionAsync();\n }\n\n render() {\n return (\n \n

Speech sample app

\n\n
\n
\n this.sttFromMic()}>\n Convert speech to text from your mic once.\n \n\n
\n this.sttFromMicCont() } >\n Convert speech to text continuously\n
\n\n
\n this.sttFromMicContStop() } >\n Stop converting speech to text continuously\n
\n\n
\n
\n {this.state.displayText}\n
\n
\n
\n );\n }\n}","C:\\Users\\s153848\\co-n-versualize\\AzureSpeechReactSample-main\\src\\token_util.js",[],["28","29"],"C:\\Users\\s153848\\co-n-versualize\\AzureSpeechReactSample-main\\src\\textclient.js",["30"],{"ruleId":"31","replacedBy":"32"},{"ruleId":"33","replacedBy":"34"},{"ruleId":"35","severity":1,"message":"36","line":5,"column":10,"nodeType":"37","messageId":"38","endLine":5,"endColumn":22},{"ruleId":"39","severity":1,"message":"40","line":167,"column":16,"nodeType":"41","messageId":"42","endLine":167,"endColumn":18},{"ruleId":"39","severity":1,"message":"40","line":227,"column":33,"nodeType":"41","messageId":"42","endLine":227,"endColumn":35},{"ruleId":"39","severity":1,"message":"40","line":234,"column":38,"nodeType":"41","messageId":"42","endLine":234,"endColumn":40},{"ruleId":"39","severity":1,"message":"40","line":242,"column":26,"nodeType":"41","messageId":"42","endLine":242,"endColumn":28},{"ruleId":"31","replacedBy":"43"},{"ruleId":"33","replacedBy":"44"},{"ruleId":"45","severity":1,"message":"46","line":1,"column":1,"nodeType":"47","messageId":"48","endLine":1,"endColumn":14,"fix":"49"},"no-native-reassign",["50"],"no-negated-in-lhs",["51"],"no-unused-vars","'ResultReason' is defined but never used.","Identifier","unusedVar","eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected",["50"],["51"],"strict","'use strict' is unnecessary inside of modules.","ExpressionStatement","module",{"range":"52","text":"53"},"no-global-assign","no-unsafe-negation",[0,13],""] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e33766b..d5fc677 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,220 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@azure/abort-controller": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz", + "integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==", + "requires": { + "tslib": "^2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, + "@azure/ai-text-analytics": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@azure/ai-text-analytics/-/ai-text-analytics-5.1.0.tgz", + "integrity": "sha512-vkAFCxj0dn7kjTDuzpqM4EgQJkn3V0N/KJ0/n+UwralpeCESWll3DLuf8h2kL94vT9pyHWq7xWiNMBrzXxF1yA==", + "requires": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-asynciterator-polyfill": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-client": "^1.0.0", + "@azure/core-lro": "^2.0.0", + "@azure/core-paging": "^1.1.1", + "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-tracing": "1.0.0-preview.12", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, + "@azure/core-asynciterator-polyfill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", + "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" + }, + "@azure/core-auth": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.3.2.tgz", + "integrity": "sha512-7CU6DmCHIZp5ZPiZ9r3J17lTKMmYsm/zGvNkjArQwPkrLlZ1TZ+EUYfGgh2X31OLMVAQCTJZW4cXHJi02EbJnA==", + "requires": { + "@azure/abort-controller": "^1.0.0", + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, + "@azure/core-client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.3.1.tgz", + "integrity": "sha512-7IHm2DGg2u7dJYtCW84Ik7uENHfE8VsM/sWloZezPKYDoWZrg7JzwjvdGAfsaELKi2p0GE+JBaAbDYnNpr5V1w==", + "requires": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-asynciterator-polyfill": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-tracing": "1.0.0-preview.13", + "tslib": "^2.2.0" + }, + "dependencies": { + "@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "requires": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + } + }, + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, + "@azure/core-lro": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.1.tgz", + "integrity": "sha512-HE6PBl+mlKa0eBsLwusHqAqjLc5n9ByxeDo3Hz4kF3B1hqHvRkBr4oMgoT6tX7Hc3q97KfDctDUon7EhvoeHPA==", + "requires": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + }, + "dependencies": { + "@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "requires": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + } + }, + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, + "@azure/core-paging": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.0.tgz", + "integrity": "sha512-ZX1bCjm/MjKPCN6kQD/9GJErYSoKA8YWp6YWoo5EIzcTWlSBLXu3gNaBTUl8usGl+UShiKo7b4Gdy1NSTIlpZg==", + "requires": { + "@azure/core-asynciterator-polyfill": "^1.0.0", + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, + "@azure/core-rest-pipeline": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.3.1.tgz", + "integrity": "sha512-xTQiv47O5cWzJFkwiDrUTT4K4IYbUIts0gaou5TZxAAuhQi9kAKWHEmFTjHVMOeAmyDhlMM5cb21M2n4WDto1A==", + "requires": { + "@azure/abort-controller": "^1.0.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-tracing": "1.0.0-preview.13", + "@azure/logger": "^1.0.0", + "form-data": "^4.0.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "tslib": "^2.2.0", + "uuid": "^8.3.0" + }, + "dependencies": { + "@azure/core-tracing": { + "version": "1.0.0-preview.13", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", + "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", + "requires": { + "@opentelemetry/api": "^1.0.1", + "tslib": "^2.2.0" + } + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, + "@azure/core-tracing": { + "version": "1.0.0-preview.12", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.12.tgz", + "integrity": "sha512-nvo2Wc4EKZGN6eFu9n3U7OXmASmL8VxoPIH7xaD6OlQqi44bouF0YIi9ID5rEsKLiAU59IYx6M297nqWVMWPDg==", + "requires": { + "@opentelemetry/api": "^1.0.0", + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, + "@azure/logger": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.3.tgz", + "integrity": "sha512-aK4s3Xxjrx3daZr3VylxejK3vG5ExXck5WOHDJ8in/k9AqlfIyFMMT1uG7u8mNjX+QRILTIn0/Xgschfh/dQ9g==", + "requires": { + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + } + } + }, "@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -1778,6 +1992,11 @@ } } }, + "@opentelemetry/api": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.3.tgz", + "integrity": "sha512-puWxACExDe9nxbBB3lOymQFrLYml2dVOrd7USiVRnSbgXE+KwBu+HxFvxrzfqsiSda9IWsXJG1ef7C1O2/GmKQ==" + }, "@pmmmwh/react-refresh-webpack-plugin": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.4.2.tgz", @@ -2146,6 +2365,11 @@ "@babel/runtime": "^7.12.5" } }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" + }, "@types/anymatch": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz", @@ -3070,11 +3294,6 @@ "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -3607,6 +3826,23 @@ "tweetnacl": "^0.14.3" } }, + "bent": { + "version": "7.3.12", + "resolved": "https://registry.npmjs.org/bent/-/bent-7.3.12.tgz", + "integrity": "sha512-T3yrKnVGB63zRuoco/7Ybl7BwwGZR0lceoVG5XmQyMIH9s19SV5m+a8qam4if0zQuAmOQTyPTPmsQBdAorGK3w==", + "requires": { + "bytesish": "^0.4.1", + "caseless": "~0.12.0", + "is-stream": "^2.0.0" + }, + "dependencies": { + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + } + } + }, "bfj": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.0.2.tgz", @@ -3883,15 +4119,22 @@ } }, "browserslist": { - "version": "4.16.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.1.tgz", - "integrity": "sha512-UXhDrwqsNcpTYJBTZsbGATDxZbiVDsx6UjpmRUmtnP10pr8wAYr5LgFoEFw9ixriQH2mv/NX2SfGzE/o8GndLA==", + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.3.tgz", + "integrity": "sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ==", "requires": { - "caniuse-lite": "^1.0.30001173", - "colorette": "^1.2.1", - "electron-to-chromium": "^1.3.634", + "caniuse-lite": "^1.0.30001264", + "electron-to-chromium": "^1.3.857", "escalade": "^3.1.1", - "node-releases": "^1.1.69" + "node-releases": "^1.1.77", + "picocolors": "^0.2.1" + }, + "dependencies": { + "caniuse-lite": { + "version": "1.0.30001265", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz", + "integrity": "sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw==" + } } }, "bser": { @@ -3942,6 +4185,11 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, + "bytesish": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/bytesish/-/bytesish-0.4.4.tgz", + "integrity": "sha512-i4uu6M4zuMUiyfZN4RU2+i9+peJh//pXhd9x1oSe1LBkZ3LEbCoygu8W0bXTukU1Jme2txKuotpCZRaC3FLxcQ==" + }, "cacache": { "version": "15.0.5", "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.0.5.tgz", @@ -4020,9 +4268,9 @@ "dev": true }, "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true } } @@ -5324,9 +5572,9 @@ "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=" }, "dns-packet": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz", - "integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", "requires": { "ip": "^1.1.0", "safe-buffer": "^5.0.1" @@ -5543,28 +5791,28 @@ "integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==" }, "electron-to-chromium": { - "version": "1.3.634", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.634.tgz", - "integrity": "sha512-QPrWNYeE/A0xRvl/QP3E0nkaEvYUvH3gM04ZWYtIa6QlSpEetRlRI1xvQ7hiMIySHHEV+mwDSX8Kj4YZY6ZQAw==" + "version": "1.3.860", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.860.tgz", + "integrity": "sha512-gWwGZ+Wv4Mou2SJRH6JQzhTPjL5f95SX7n6VkLTQ/Q/INsZLZNQ1vH2GlZjozKyvT0kkFuCmWTwIoCj+/hUDPw==" }, "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "bn.js": "^4.11.9", + "brorand": "^1.1.0", "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" }, "dependencies": { "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" } } }, @@ -5730,19 +5978,6 @@ "es6-symbol": "^3.1.1" } }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "requires": { - "es6-promise": "^4.0.3" - } - }, "es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -6581,17 +6816,17 @@ } }, "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", "requires": { - "type": "^2.0.0" + "type": "^2.5.0" }, "dependencies": { "type": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", - "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==" } } }, @@ -7255,9 +7490,9 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "requires": { "is-glob": "^4.0.1" } @@ -7521,9 +7756,9 @@ "integrity": "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==" }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, "hpack.js": { "version": "2.1.6", @@ -7712,6 +7947,16 @@ "requires-port": "^1.0.0" } }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, "http-proxy-middleware": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", @@ -7836,29 +8081,18 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" }, "https-proxy-agent": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", - "integrity": "sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", + "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" + "agent-base": "5", + "debug": "4" }, "dependencies": { "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "requires": { - "ms": "^2.1.1" - } + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==" } } }, @@ -7913,9 +8147,9 @@ "dev": true }, "immer": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/immer/-/immer-7.0.9.tgz", - "integrity": "sha512-Vs/gxoM4DqNAYR7pugIxi0Xc8XAun/uy7AQu4fLLqaTBHxjOP9pJ266Q9MWA/ly4z6rAFZbvViOtihxUZ7O28A==" + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/immer/-/immer-8.0.1.tgz", + "integrity": "sha512-aqXhGP7//Gui2+UrEtvxZxSquQVXTpZ7KDxfCcKAF3Vysvw0CViVaW9RZ1j1xlIYqaaaipBoqdqeibkc18PNvA==" }, "import-cwd": { "version": "2.1.0", @@ -10221,9 +10455,9 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash._reinterpolate": { "version": "3.0.0", @@ -10448,19 +10682,27 @@ } }, "microsoft-cognitiveservices-speech-sdk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/microsoft-cognitiveservices-speech-sdk/-/microsoft-cognitiveservices-speech-sdk-1.14.1.tgz", - "integrity": "sha512-+bltlfn5sc0WBhWPiC2Iq503LadmDmCSfF7OH+gTBe5xFeeHuaIMPF1y+Q5B9c/kjZUhLWgxRYahTCMfcyLJZg==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/microsoft-cognitiveservices-speech-sdk/-/microsoft-cognitiveservices-speech-sdk-1.18.1.tgz", + "integrity": "sha512-Md0Iq3SZyj9LIPoidQpVn6qJZp5lJPnmU7PhxR+Ibrtl9xaC7FFK9/eQw67wM6ZylgpFS5xs47F6Cs08h1p8Gg==", "requires": { - "agent-base": "^6.0.0", - "asn1.js-rfc2560": "^5.0.0", + "agent-base": "^6.0.1", + "asn1.js-rfc2560": "^5.0.1", "asn1.js-rfc5280": "^3.0.0", "async-disk-cache": "^2.1.0", - "https-proxy-agent": "^3.0.1", + "bent": "^7.3.12", + "https-proxy-agent": "^4.0.0", "simple-lru-cache": "0.0.2", - "uuid": "^8.3.1", - "ws": "^7.2.0", - "xmlhttprequest-ts": "^1.0.1" + "url-parse": "^1.4.7", + "uuid": "^3.3.3", + "ws": "^7.3.1" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + } } }, "miller-rabin": { @@ -10704,11 +10946,6 @@ "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" }, - "nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==" - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -10946,9 +11183,9 @@ } }, "node-releases": { - "version": "1.1.69", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.69.tgz", - "integrity": "sha512-DGIjo79VDEyAnRlfSqYTsy+yoHd2IOjJiKUozD2MV2D85Vso6Bug56mb9tT/fY5Urt0iqk01H7x+llAruDR2zA==" + "version": "1.1.77", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.77.tgz", + "integrity": "sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ==" }, "nodemon": { "version": "2.0.7", @@ -11288,9 +11525,9 @@ } }, "open": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/open/-/open-7.3.1.tgz", - "integrity": "sha512-f2wt9DCBKKjlFbjzGb8MOAW8LH8F0mrs1zc7KTjAJ9PZNQbfenzWbNP1VZJvw6ICMG9r14Ah6yfwPn7T7i646A==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", "requires": { "is-docker": "^2.0.0", "is-wsl": "^2.1.1" @@ -11591,9 +11828,9 @@ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-to-regexp": { "version": "0.1.7", @@ -11622,6 +11859,11 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "picocolors": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", + "integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==" + }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -11881,27 +12123,18 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz", + "integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==", "requires": { - "chalk": "^2.4.2", - "source-map": "^0.6.1", - "supports-color": "^6.1.0" + "picocolors": "^0.2.1", + "source-map": "^0.6.1" }, "dependencies": { "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "requires": { - "has-flag": "^3.0.0" - } } } }, @@ -12789,19 +13022,21 @@ }, "dependencies": { "postcss": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.3.tgz", - "integrity": "sha512-tdmNCCmxJEsLZNj810qlj8QbvnUNKFL9A5doV+uHrGGK/YNKWEslrytnHDWr9M/GgGjfUFwXCRbxd/b6IoRBXQ==", + "version": "8.3.9", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.9.tgz", + "integrity": "sha512-f/ZFyAKh9Dnqytx5X62jgjhhzttjZS7hMsohcI7HEI5tjELX/HxCy3EFhsRxyzGvrzFF+82XPvCS8T9TFleVJw==", "requires": { - "colorette": "^1.2.1", - "nanoid": "^3.1.20", - "source-map": "^0.6.1" + "nanoid": "^3.1.28", + "picocolors": "^0.2.1", + "source-map-js": "^0.6.2" + }, + "dependencies": { + "nanoid": { + "version": "3.1.29", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.29.tgz", + "integrity": "sha512-dW2pUSGZ8ZnCFIlBIA31SV8huOGCHb6OwzVCc7A69rb/a+SgPBwfmLvK5TKQ3INPbRkcI8a/Owo0XbiTNH19wg==" + } } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" } } }, @@ -13222,9 +13457,9 @@ } }, "react-dev-utils": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.1.tgz", - "integrity": "sha512-rlgpCupaW6qQqvu0hvv2FDv40QG427fjghV56XyPcP5aKtOAPzNAhQ7bHqk1YdS2vpW1W7aSV3JobedxuPlBAA==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.4.tgz", + "integrity": "sha512-dx0LvIGHcOPtKbeiSUM4jqpBl3TcY7CDjZdfOIcKeznE7BWr9dg0iPG90G5yfVQ+p/rGNMXdbfStvzQZEVEi4A==", "requires": { "@babel/code-frame": "7.10.4", "address": "1.1.2", @@ -13239,13 +13474,13 @@ "global-modules": "2.0.0", "globby": "11.0.1", "gzip-size": "5.1.1", - "immer": "7.0.9", + "immer": "8.0.1", "is-root": "2.1.0", "loader-utils": "2.0.0", "open": "^7.0.2", "pkg-up": "3.1.0", "prompts": "2.4.0", - "react-error-overlay": "^6.0.8", + "react-error-overlay": "^6.0.9", "recursive-readdir": "2.2.2", "shell-quote": "1.7.2", "strip-ansi": "6.0.0", @@ -13338,9 +13573,9 @@ } }, "react-error-overlay": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.8.tgz", - "integrity": "sha512-HvPuUQnLp5H7TouGq3kzBeioJmXms1wHy9EGjz2OURWBp4qZO6AfGEcnxts1D/CbwPLRAgTMPCEgYhA3sEM4vw==" + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz", + "integrity": "sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew==" }, "react-is": { "version": "16.13.1", @@ -13873,9 +14108,9 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" }, "resolve-url-loader": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-3.1.2.tgz", - "integrity": "sha512-QEb4A76c8Mi7I3xNKXlRKQSlLBwjUV/ULFMP+G7n3/7tJZ8MG5wsZ3ucxP1Jz8Vevn6fnJsxDx9cIls+utGzPQ==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/resolve-url-loader/-/resolve-url-loader-3.1.4.tgz", + "integrity": "sha512-D3sQ04o0eeQEySLrcz4DsX3saHfsr8/N6tfhblxgZKXxMT2Louargg12oGNfoTRLV09GXhVUe5/qgA5vdgNigg==", "requires": { "adjust-sourcemap-loader": "3.0.0", "camelcase": "5.3.1", @@ -13883,7 +14118,7 @@ "convert-source-map": "1.7.0", "es6-iterator": "2.0.3", "loader-utils": "1.2.3", - "postcss": "7.0.21", + "postcss": "7.0.36", "rework": "1.0.1", "rework-visit": "1.0.0", "source-map": "0.6.1" @@ -13918,9 +14153,9 @@ } }, "postcss": { - "version": "7.0.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.21.tgz", - "integrity": "sha512-uIFtJElxJo29QC753JzhidoAhvp/e/Exezkdhfmt8AymWT6/5B7W1WmponYWkHk2eg6sONyTch0A3nkMPun3SQ==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -14814,6 +15049,11 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, + "source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==" + }, "source-map-resolve": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", @@ -14944,9 +15184,9 @@ } }, "ssri": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz", - "integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", "requires": { "minipass": "^3.1.1" } @@ -15365,9 +15605,9 @@ "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==" }, "tar": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz", - "integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==", + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -16099,9 +16339,9 @@ } }, "url-parse": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", - "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz", + "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==", "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -16130,9 +16370,9 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" }, "username-sync": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/username-sync/-/username-sync-1.0.2.tgz", - "integrity": "sha512-ayNkOJdoNSGNDBE46Nkc+l6IXmeugbzahZLSMkwvgRWv5y5ZqNY2IrzcgmkR4z32sj1W3tM3TuTUMqkqBzO+RA==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/username-sync/-/username-sync-1.0.3.tgz", + "integrity": "sha512-m/7/FSqjJNAzF2La448c/aEom0gJy7HY7Y509h6l0ePvEkFictAGptwWaj1msWJ38JbfEDOUoE8kqFee9EHKdA==" }, "util": { "version": "0.11.1", @@ -16770,8 +17010,7 @@ }, "ssri": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "resolved": "", "requires": { "figgy-pudding": "^3.5.1" } @@ -17254,11 +17493,18 @@ } }, "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", "requires": { "async-limiter": "~1.0.0" + }, + "dependencies": { + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" + } } }, "yargs": { @@ -17693,9 +17939,9 @@ } }, "ws": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", - "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==" + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==" }, "xdg-basedir": { "version": "4.0.0", @@ -17713,14 +17959,6 @@ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, - "xmlhttprequest-ts": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ts/-/xmlhttprequest-ts-1.0.1.tgz", - "integrity": "sha1-ezy0oZeu44zy1PndYYnR0h8INbI=", - "requires": { - "tslib": "^1.9.2" - } - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index cf4b25f..f2b71fb 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { + "@azure/ai-text-analytics": "^5.1.0", "@testing-library/jest-dom": "^5.11.8", "@testing-library/react": "^11.2.3", "@testing-library/user-event": "^12.6.0", diff --git a/server/index.js b/server/index.js index a2b4d9d..05966b1 100644 --- a/server/index.js +++ b/server/index.js @@ -5,6 +5,8 @@ const bodyParser = require('body-parser'); const pino = require('express-pino-logger')(); const app = express(); +const japp = express(); + app.use(bodyParser.urlencoded({ extended: false })); app.use(pino); @@ -32,6 +34,46 @@ app.get('/api/get-speech-token', async (req, res, next) => { } }); +//custom middlewate for japp-server +const logger2 = (req,res,next) => { + console.log(`${req.protocol}://${req.get('host')}${req.originalUrl}`); + res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With, content-type'); + res.setHeader('Access-Control-Allow-Origin', 'http://localhost:3000'); + res.setHeader('Access-Control-Allow-Methods', 'POST,PUT,GET'); + // ------4GOauth---> const TrCode = `${req.query.code}`; + console.log(`${req.body}`); + console.log('Logger operations done'); + next(); +}; + +// Middleware thingies +japp.use(express.urlencoded({ extended: false})); +japp.use(express.json()); +japp.use(logger2); + +// thing to be updated with keywords object +let thething; + +// place where the front is send to the back +japp.post('/processing/poster', async (req, res, next) => { + const whatsend = req.body; + res.json({whatsend}); + console.log("this is the backend: " + whatsend); + thething = whatsend; + next(); +}); + +// gateway for processing to call continously +japp.get('/processing/entities', async (req, res, next) => { + res.json(thething); + next(); +}); + + app.listen(3001, () => console.log('Express server is running on localhost:3001') +); + +japp.listen(3002, () => + console.log('Express server is running on localhost:3002') ); \ No newline at end of file diff --git a/src/App.js b/src/App.js index 71c5659..8118f31 100644 --- a/src/App.js +++ b/src/App.js @@ -3,16 +3,29 @@ import { Container } from 'reactstrap'; import { getTokenOrRefresh } from './token_util'; import './custom.css' import { ResultReason } from 'microsoft-cognitiveservices-speech-sdk'; +import axios from 'axios'; +require('dotenv').config(); + +//cognitive services const speechsdk = require('microsoft-cognitiveservices-speech-sdk') +const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); + +const key = 'YOUR_TEXT_ANALYSIS_KEY_HERE'; +const endpoint = 'YOUR_CORRESPONDING_ENDPOINT_HERE'; //--> example: https://YOURNAMEOFSUB.cognitiveservices.azure.com/ +const textAnalyticsClient = new TextAnalyticsClient(endpoint, new AzureKeyCredential(key)); export default class App extends Component { constructor(props) { super(props); - + this.state = { - displayText: 'INITIALIZED: ready to test speech...' + displayText: null, + entitiescomp: null, + keyphrases: null, + recognizerboy: null, + ctr: 0, } } @@ -25,61 +38,198 @@ export default class App extends Component { }); } } + + //get keyphrases + async keyPhraseExtraction(recognizedtext){ + let displayText; - async sttFromMic() { - const tokenObj = await getTokenOrRefresh(); - const speechConfig = speechsdk.SpeechConfig.fromAuthorizationToken(tokenObj.authToken, tokenObj.region); - speechConfig.speechRecognitionLanguage = 'en-US'; + const client = textAnalyticsClient; + const text = recognizedtext; + const keyPhrasesInput = [ + text, + ]; + + const keyPhraseResult = await client.extractKeyPhrases(keyPhrasesInput); - const audioConfig = speechsdk.AudioConfig.fromDefaultMicrophoneInput(); - const recognizer = new speechsdk.SpeechRecognizer(speechConfig, audioConfig); + keyPhraseResult.forEach(document => { + // console.log(`ID: ${document.id}`); + displayText = `${document.keyPhrases}`; + }); this.setState({ - displayText: 'speak into your microphone...' + keyphrases: displayText, }); + console.log("keyphraseresult: " + keyPhraseResult); + + } - recognizer.recognizeOnceAsync(result => { - let displayText; - if (result.reason === ResultReason.RecognizedSpeech) { - displayText = `RECOGNIZED: Text=${result.text}` - } else { - displayText = 'ERROR: Speech was cancelled or could not be recognized. Ensure your microphone is working properly.'; + async entityRecognition(recognizedtext){ + //let displayText; + const client = textAnalyticsClient; + const text = recognizedtext; + + const entityInputs = [ + text, + // "Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975, to develop and sell BASIC interpreters for the Altair 8800", + // "La sede principal de Microsoft se encuentra en la ciudad de Redmond, a 21 kilómetros de Seattle." + ]; + + const entityResults = await client.recognizeEntities(entityInputs); + + entityResults.forEach(document => { + console.log(`Document ID: ${document.id}`); + if (document.entities != null){ + document.entities.forEach(entity => { + console.log(`\tName: ${entity.text} \tCategory: ${entity.category} \tSubcategory: ${entity.subCategory ? entity.subCategory : "N/A"}`); + console.log(`\tScore: ${entity.confidenceScore}`); + }); } + }); - this.setState({ - displayText: displayText - }); + this.setState({ + entitiescomp: entityResults, }); + console.log("entityresults" + entityResults[0].entities); } + // entityRecognition(textAnalyticsClient); + + //check if state (i.e. first displayText, then keyphrase&entity) updated, send to api + async componentDidUpdate(prevState) { + // Typical usage (don't forget to compare props): + if (this.state.displayText !== prevState.displayText) { + if(this.state.entitiescomp !== null){ + if (this.state.entitiescomp !== prevState.entitiescomp && this.state.keyphrases !== prevState.keyphrases){ + //copy state & remove client info + console.log(this.state); + const sentence = this.state.displayText; + const keyphrases = this.state.keyphrases; + const entities = this.state.entitiescomp[0].entities; + try{ + await axios.post('http://localhost:3002/processing/poster', {sentence,keyphrases,entities}, { + headers: { + 'Content-Type': 'application/json' + } + }).then( + console.log('it was updated, so we updating and doing the networkthing') + ); + } catch(err) { + if(err.response === 500) { + console.log('it fucked up in the server'); + } else { + console.log("error:" + err.response); + } + }; + } + } + } + } + + async sttFromMic(){ + let displayText; + var Ctr = this.state.ctr; + let utterances = [ + //place text where you can test a series of utterances without the need to speak every time + ] + + + displayText = utterances[Ctr]; + Ctr = Ctr + 1; + if(Ctr == utterances.length){ + Ctr = 0; + } - async fileChange(event) { - const audioFile = event.target.files[0]; - console.log(audioFile); - const fileInfo = audioFile.name + ` size=${audioFile.size} bytes `; + this.keyPhraseExtraction(displayText); + this.entityRecognition(displayText); this.setState({ - displayText: fileInfo + displayText: displayText, + ctr: Ctr }); + } + + //React example single utterance (15s max.) + // async sttFromMic() { + // const tokenObj = await getTokenOrRefresh(); + // const speechConfig = speechsdk.SpeechConfig.fromAuthorizationToken(tokenObj.authToken, tokenObj.region); + // speechConfig.speechRecognitionLanguage = 'en-US'; + + // const audioConfig = speechsdk.AudioConfig.fromDefaultMicrophoneInput(); + // const recognizer = new speechsdk.SpeechRecognizer(speechConfig, audioConfig); + + // this.setState({ + // displayText: 'speak into your microphone...' + // }); + // recognizer.recognizeOnceAsync(result => { + // let displayText; + + + // if (result.reason === ResultReason.RecognizedSpeech) { + // displayText = `${result.text}`; + + // } else { + // displayText = 'ERROR: Speech was cancelled or could not be recognized. Ensure your microphone is working properly.'; + // } + // // this.keyPhraseExtraction(displayText); + // }); + // } + + //Awesome Olaf doing continious jwz + async sttFromMicCont(){ const tokenObj = await getTokenOrRefresh(); const speechConfig = speechsdk.SpeechConfig.fromAuthorizationToken(tokenObj.authToken, tokenObj.region); speechConfig.speechRecognitionLanguage = 'en-US'; - - const audioConfig = speechsdk.AudioConfig.fromWavFileInput(audioFile); + + const audioConfig = speechsdk.AudioConfig.fromDefaultMicrophoneInput(); const recognizer = new speechsdk.SpeechRecognizer(speechConfig, audioConfig); - recognizer.recognizeOnceAsync(result => { - let displayText; - if (result.reason === ResultReason.RecognizedSpeech) { - displayText = `RECOGNIZED: Text=${result.text}` - } else { - displayText = 'ERROR: Speech was cancelled or could not be recognized. Ensure your microphone is working properly.'; + this.setState({recognizerboy: recognizer}) + + let displayText; + + recognizer.recognizing = (s, e) => { + //console.log(`RECOGNIZING: Text=${e.result.text}`); + //displayText = `${e.result.text}`; + }; + + + recognizer.recognized = (s, e) => { + if (e.result.reason == speechsdk.ResultReason.RecognizedSpeech) { + console.log(`RECOGNIZED: Text=${e.result.text}`); + displayText = `${e.result.text}`; + this.keyPhraseExtraction(displayText); + this.entityRecognition(displayText); + this.setState({displayText: displayText}); + } + else if (e.result.reason == speechsdk.ResultReason.NoMatch) { + console.log("NOMATCH: Speech could not be recognized."); } + }; + + recognizer.canceled = (s, e) => { + console.log(`CANCELED: Reason=${e.reason}`); + + if (e.reason == speechsdk.CancellationReason.Error) { + console.log(`"CANCELED: ErrorCode=${e.errorCode}`); + console.log(`"CANCELED: ErrorDetails=${e.errorDetails}`); + console.log("CANCELED: Did you update the key and location/region info?"); + } + + recognizer.stopContinuousRecognitionAsync(); + }; + + recognizer.sessionStopped = (s, e) => { + console.log("\n Session stopped event."); + recognizer.stopContinuousRecognitionAsync(); + }; - this.setState({ - displayText: fileInfo + displayText - }); - }); + recognizer.startContinuousRecognitionAsync(); + } + + //button to stop the recogniiton process + async sttFromMicContStop() { + const recognizer = this.state.recognizerboy; + recognizer.stopContinuousRecognitionAsync(); } render() { @@ -90,18 +240,19 @@ export default class App extends Component {
this.sttFromMic()}> - Convert speech to text from your mic. + Convert speech to text from your mic once. +
- - this.fileChange(e)} - style={{display: "none"}} - /> - Convert speech to text from an audio file. + this.sttFromMicCont() } > + Convert speech to text continuously
+ +
+ this.sttFromMicContStop() } > + Stop converting speech to text continuously +
+
{this.state.displayText} diff --git a/src/textclient.js b/src/textclient.js new file mode 100644 index 0000000..e0e4c27 --- /dev/null +++ b/src/textclient.js @@ -0,0 +1,24 @@ +"use strict"; +require('dotenv').config(); +const { TextAnalyticsClient, AzureKeyCredential } = require("@azure/ai-text-analytics"); + +const key = 'REDACTED'; +const endpoint = 'REDACTED'; +const textAnalyticsClient = new TextAnalyticsClient(endpoint, new AzureKeyCredential(key)); + +async function keyPhraseExtraction(client){ + + const keyPhrasesInput = [ + "My cat might need to see a veterinarian.", + ]; + const keyPhraseResult = await client.extractKeyPhrases(keyPhrasesInput); + + keyPhraseResult.forEach(document => { + console.log(`ID: ${document.id}`); + console.log(` ${document.keyPhrases}`); + }); +} + +keyPhraseExtraction(textAnalyticsClient); + +module.exports = textAnalyticsClient; \ No newline at end of file