Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6478fd8
commit 384e49a
Showing
142 changed files
with
28,172 additions
and
18 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ignore the npm packages | ||
/**/node_modules/ | ||
# ignore auto-generated (transpiled) js files | ||
src/**/*.js | ||
tests/**/*.js | ||
distrib/* | ||
secrets/* | ||
/**/speech.key | ||
.idea/ | ||
test-javascript-junit.xml | ||
coverage/* | ||
*.tgz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/.vscode/* | ||
/node_modules/* | ||
/.gitattributes | ||
/.gitignore | ||
/.npmignore | ||
/.npmrc | ||
/.vscode | ||
/web.config |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
@REM Copyright (c) Microsoft Corporation. All rights reserved. | ||
@REM Licensed under the MIT license. | ||
@echo off | ||
setlocal | ||
if "%~1" equ "/?" goto :Usage | ||
if "%~1" equ "-?" goto :Usage | ||
if "%~1" equ "?" goto :Usage | ||
if "%~1" equ "/h" goto :Usage | ||
if "%~1" equ "-h" goto :Usage | ||
|
||
set TEST_SETTING_FILE_DIR=%~dp0\secrets | ||
if NOT EXIST "%TEST_SETTING_FILE_DIR%" ( | ||
md "%TEST_SETTING_FILE_DIR%" || ( | ||
echo Error creating directory %TEST_SETTING_FILE_DIR% | ||
exit /b 1 | ||
) | ||
) | ||
|
||
set TEST_SETTING_FILE_NAME=%TEST_SETTING_FILE_DIR%\TestConfiguration.ts | ||
|
||
if EXIST "%TEST_SETTING_FILE_NAME%" ( | ||
echo Clearing values from settings file. | ||
echo. > "%TEST_SETTING_FILE_NAME%" || ( | ||
echo Error creating file %TEST_SETTING_FILE_NAME% | ||
exit /b 1 | ||
) | ||
) | ||
|
||
@echo import { Settings } from "../tests/Settings" > "%TEST_SETTING_FILE_NAME%" | ||
|
||
:NextArg | ||
if "%~1" == "" ( | ||
goto :eof | ||
) | ||
|
||
for /f "tokens=1,2 delims=:" %%I in ("%~1") do ( | ||
echo Setting Settings.%%I = "%%J" | ||
echo Settings.%%I = "%%J"; >> "%TEST_SETTING_FILE_NAME%" | ||
) | ||
|
||
shift | ||
goto :NextArg | ||
|
||
exit /b 0 | ||
|
||
:Usage | ||
@echo off | ||
echo. | ||
echo Usage: %~n0 ^<ParamName^>:^<Value^> | ||
echo. | ||
echo Writes any ^<ParamName^>:^<Value^> pair to the test settings file for JavaScript bindings tests. | ||
echo. | ||
echo The file will be erased before new values are added. | ||
echo. | ||
echo Current settings available are: [SpeechSubscriptionKey:^<key^>] [SpeechRegion:^<region^>] [LuisSubscriptionKey:^<LuisKey^>] [LuisRegion:^<region^>] [LuisAppId:^<LuisAppId^>] | ||
echo. | ||
exit /b 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
MIT License | ||
------------------------------------------- START OF LICENSE ----------------------------------------- | ||
Microsoft Azure Cognitive Services Speech SDK Javascript | ||
Copyright (c) Microsoft Corporation | ||
All rights reserved. | ||
|
||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE | ||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
----------------------------------------------- END OF LICENSE ------------------------------------------ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The following libraries can be redistributed if you are using the Cognitive | ||
Services Speech SDK for JavaScript, subject to its license: | ||
|
||
microsoft.cognitiveservices.speech.sdk.bundle.js | ||
microsoft-cognitiveservices-speech-sdk NPM library | ||
|
||
Depending on your usage, you only need to redistribute a subset of the above. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@REM Copyright (c) Microsoft Corporation. All rights reserved. | ||
@REM Licensed under the MIT license. | ||
@echo off | ||
setlocal | ||
if "%~1" equ "/?" goto :Usage | ||
if "%~1" equ "-?" goto :Usage | ||
if "%~1" equ "?" goto :Usage | ||
if "%~1" equ "/h" goto :Usage | ||
if "%~1" equ "-h" goto :Usage | ||
|
||
set TEST_SETTING_FILE_NAME=%~dp0\secrets\TestConfiguration.ts | ||
|
||
set TEST_SETTING_FILE_EXISTED=0 | ||
if EXIST "%TEST_SETTING_FILE_NAME%" set TEST_SETTING_FILE_EXISTED=1 | ||
|
||
if "%~1" NEQ "" ( | ||
call "%~dp0BuildTestConfig.cmd" %* || ( | ||
echo Error creating test config. | ||
exit /b 1 | ||
) | ||
) else if %TEST_SETTING_FILE_EXISTED% EQU 0 ( | ||
echo Warning: No test config and no parameters specified. This will probably fail. 1>&2 | ||
) | ||
|
||
pushd "%~dp0" | ||
call npm run test | ||
|
||
set NPM_ERROR=%ERRORLEVEL% | ||
|
||
if %TEST_SETTING_FILE_EXISTED% EQU 0 ( | ||
del "%TEST_SETTING_FILE_NAME%" | ||
) | ||
|
||
popd | ||
|
||
exit /b %NPM_ERROR% | ||
|
||
@REM TODO fix usage | ||
:Usage | ||
@echo off | ||
echo. | ||
echo Usage: %~n0 [^<ParamName^>:^<Value^>] | ||
echo. | ||
echo Writes any ^<ParamName^>:^<Value^> pair to the test settings file for JavaScript bindings tests. | ||
echo. | ||
echo The file will be erased before new values are added. | ||
echo. | ||
echo If no values are specified, the existing file will not be modified. | ||
echo. | ||
echo Current settings available are: [SpeechSubscriptionKey:^<key^>] [SpeechRegion:^<region^>] [LuisSubscriptionKey:^<LuisKey^>] [LuisRegion:^<region^>] [LuidAppId:^<LuisAppId^>] | ||
echo. | ||
echo Once settings are written, executes the JS unit tests and if the settings file was created, it will be deleted. | ||
exit /b 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theme: jekyll-theme-minimal |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
window.SpeechSDK = require('./distrib/lib/microsoft.cognitiveservices.speech.sdk.js'); | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT license. | ||
# | ||
|
||
parameters: | ||
dependsOn: '' | ||
condition: succeeded() | ||
|
||
jobs: | ||
|
||
- job: JsBuild | ||
dependsOn: ${{ parameters.dependsOn }} | ||
condition: ${{ parameters.condition }} | ||
pool: | ||
name: Hosted VS2017 | ||
demands: npm | ||
timeoutInMinutes: 60 | ||
steps: | ||
- bash: npm ci && npm run civersion | ||
displayName: Set version | ||
workingDirectory: $(SPEECHSDK_JS_ROOT) | ||
- bash: | | ||
F=$(SPEECHSDK_JS_ROOT)/src/common.speech/RecognizerConfig.ts | ||
[[ -f $F ]] || exit 1 | ||
perl -i.bak -p -e 'BEGIN { $c = 0 } $c += s/(?<=const SPEECHSDK_CLIENTSDK_VERSION = ")[^"]*/$(SPEECHSDK_SEMVER2NOMETA)/g; END { die "Patched SPEECHSDK_CLIENTSDK_VERSION $c time(s), expected 1.\n" if $c != 1 }' "$F" | ||
E=$? | ||
rm -f "$F.bak" | ||
git diff | ||
exit $E | ||
displayName: Stamp SPEECHSDK_CLIENTSDK_VERSION | ||
- bash: npm run build && npm pack | ||
displayName: Build and pack SDK | ||
workingDirectory: $(SPEECHSDK_JS_ROOT) | ||
- script: | | ||
RunTests.cmd ^ | ||
SpeechSubscriptionKey:$(speech-ne-s0-key1) ^ | ||
SpeechRegion:northeurope ^ | ||
LuisSubscriptionKey:$(luis-westus-s0-201809-key1) ^ | ||
LuisRegion:westus ^ | ||
SpeechTestEndpointId:ec3432b2-8584-4736-865a-556213b9f6fd | ||
displayName: Run tests | ||
workingDirectory: $(SPEECHSDK_JS_ROOT) | ||
- task: PublishTestResults@2 | ||
displayName: Publish test results | ||
- bash: | | ||
set -u -e -o pipefail -x | ||
PACKAGE_BASE=microsoft-cognitiveservices-speech-sdk | ||
PACKAGE_NAME=$PACKAGE_BASE-$SPEECHSDK_SEMVER2NOMETA.tgz | ||
PACKAGE_IN=$(SPEECHSDK_JS_ROOT)/$PACKAGE_NAME | ||
PACKAGE_OUT="$(Build.ArtifactStagingDirectory)/Out/JavaScript/npm" | ||
ZIP_OUT="$(Build.ArtifactStagingDirectory)/Out/JavaScript/SpeechSDK-JavaScript-$SPEECHSDK_SEMVER2NOMETA" | ||
mkdir -p "$PACKAGE_OUT" "$ZIP_OUT" | ||
cp --preserve "$PACKAGE_IN" "$PACKAGE_OUT" | ||
echo SRI hash for microsoft.cognitiveservices.speech.sdk.bundle.js: sha512-"$(openssl dgst -sha512 -binary $(SPEECHSDK_JS_ROOT)/distrib/browser/microsoft.cognitiveservices.speech.sdk.bundle.js | openssl base64 -A)" | ||
cp --preserve $(SPEECHSDK_JS_ROOT)/LICENSE $(SPEECHSDK_JS_ROOT)/REDIST.txt $(SPEECHSDK_JS_ROOT)/distrib/browser/microsoft.cognitiveservices.speech.sdk.bundle.* $(SPEECHSDK_JS_ROOT)/distrib/browser/microsoft.cognitiveservices.speech.sdk.bundle-min.* "$ZIP_OUT" | ||
displayName: Create drop | ||
- task: ArchiveFiles@2 | ||
inputs: | ||
rootFolderOrFile: $(Build.ArtifactStagingDirectory)/Out/JavaScript/SpeechSDK-JavaScript-$(SPEECHSDK_SEMVER2NOMETA) | ||
includeRootFolder: true | ||
archiveType: zip | ||
archiveFile: $(Build.ArtifactStagingDirectory)/Out/JavaScript/SpeechSDK-JavaScript-$(SPEECHSDK_SEMVER2NOMETA).zip | ||
displayName: Create .zip | ||
- bash: rm -rf "$(Build.ArtifactStagingDirectory)/Out/JavaScript/SpeechSDK-JavaScript-$(SPEECHSDK_SEMVER2NOMETA)" | ||
displayName: Remove temporary directory | ||
- task: PublishBuildArtifacts@1 | ||
displayName: Publish drop | ||
inputs: | ||
PathtoPublish: '$(Build.ArtifactStagingDirectory)/Out/JavaScript' | ||
ArtifactName: JavaScript | ||
publishLocation: Container |
Oops, something went wrong.