Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ces-speech-sdk-js into release/1.33
  • Loading branch information
BrianMouncer committed Nov 7, 2023
2 parents a3d4e63 + ddd6e0b commit 1d9f0e7
Show file tree
Hide file tree
Showing 207 changed files with 895 additions and 884 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LICENSE text

*.cmd text
*.js text
*.cjs text
*.json text
*.md text
*.ts text
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ module.exports = {
projects: [
{
displayName: "jsdom",
moduleNameMapper: {
"(.+)\\.js": "$1"
},
transform: {
"^.+\\.ts$": "ts-jest",
},
Expand All @@ -17,6 +20,9 @@ module.exports = {
},
{
displayName: "node",
moduleNameMapper: {
"(.+)\\.js": "$1"
},
transform: {
"^.+\\.ts$": "ts-jest",
},
Expand Down
12 changes: 6 additions & 6 deletions microsoft.cognitiveservices.speech.sdk.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
import { ConsoleLoggingListener } from "./src/common.browser/Exports";
import { Events } from "./src/common/Exports";
import { AgentConfig } from "./src/common.speech/Exports.js";

// Common.Storage.SetLocalStorage(new Common.Browser.LocalStorage());
// Common.Storage.SetSessionStorage(new Common.Browser.SessionStorage());
Events.instance.attachConsoleListener(new ConsoleLoggingListener());
// Note: this instantiation ensures the above import isn't
// removed on compile. The import being absent causes an error on running
void new AgentConfig();

// Speech SDK API
export * from "./src/sdk/Exports";
export * from "./src/sdk/Exports.js";
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"version": "1.33.0",
"license": "MIT",
"description": "Microsoft Cognitive Services Speech SDK for JavaScript",
"type": "module",
"keywords": [
"microsoft",
"cognitiveservices",
Expand Down Expand Up @@ -82,11 +83,11 @@
"webpack-stream": "^7.0.0"
},
"scripts": {
"build": "gulp compress && gulp build",
"build": "gulp compress --gulpfile gulpfile.cjs && gulp build --gulpfile gulpfile.cjs",
"test": "npm run lint && npm run jest --coverage",
"jest": "jest",
"lint": "eslint -c .eslintrc.js --ext .ts src",
"civersion": "node ci/version.js",
"lint": "eslint -c .eslintrc.cjs --ext .ts src",
"civersion": "node ci/version.cjs",
"prepare": "npm run build",
"setup": "npm install --package-lock-only --ignore-scripts --no-audit"
},
Expand Down
6 changes: 3 additions & 3 deletions src/common.browser/ConsoleLoggingListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// Licensed under the MIT license.

import * as fs from "fs";
import { LogLevel } from "../sdk/LogLevel";
import { IEventListener, PlatformEvent } from "../common/Exports";
import { Contracts } from "../sdk/Contracts";
import { LogLevel } from "../sdk/LogLevel.js";
import { IEventListener, PlatformEvent } from "../common/Exports.js";
import { Contracts } from "../sdk/Contracts.js";

export class ConsoleLoggingListener implements IEventListener<PlatformEvent> {
private privLogLevelFilter: LogLevel;
Expand Down
22 changes: 11 additions & 11 deletions src/common.browser/Exports.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

export * from "./ConsoleLoggingListener";
export * from "./IRecorder";
export * from "./MicAudioSource";
export * from "./FileAudioSource";
export * from "./PCMRecorder";
export * from "./WebsocketConnection";
export * from "./WebsocketMessageAdapter";
export * from "./ReplayableAudioNode";
export * from "./ProxyInfo";
export * from "./RestMessageAdapter";
export * from "./RestConfigBase";
export * from "./ConsoleLoggingListener.js";
export * from "./IRecorder.js";
export * from "./MicAudioSource.js";
export * from "./FileAudioSource.js";
export * from "./PCMRecorder.js";
export * from "./WebsocketConnection.js";
export * from "./WebsocketMessageAdapter.js";
export * from "./ReplayableAudioNode.js";
export * from "./ProxyInfo.js";
export * from "./RestMessageAdapter.js";
export * from "./RestConfigBase.js";
6 changes: 3 additions & 3 deletions src/common.browser/FileAudioSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
connectivity,
ISpeechConfigAudioDevice,
type,
} from "../common.speech/Exports";
} from "../common.speech/Exports.js";
import {
AudioSourceErrorEvent,
AudioSourceEvent,
Expand All @@ -26,8 +26,8 @@ import {
IStreamChunk,
IStringDictionary,
Stream,
} from "../common/Exports";
import { AudioStreamFormat, AudioStreamFormatImpl } from "../sdk/Audio/AudioStreamFormat";
} from "../common/Exports.js";
import { AudioStreamFormat, AudioStreamFormatImpl } from "../sdk/Audio/AudioStreamFormat.js";

export class FileAudioSource implements IAudioSource {

Expand Down
2 changes: 1 addition & 1 deletion src/common.browser/IRecorder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { Stream } from "../common/Exports";
import { Stream } from "../common/Exports.js";

export interface IRecorder {
record(context: AudioContext, mediaStream: MediaStream, outputStream: Stream<ArrayBuffer>): void;
Expand Down
10 changes: 5 additions & 5 deletions src/common.browser/MicAudioSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
connectivity,
ISpeechConfigAudioDevice,
type
} from "../common.speech/Exports";
} from "../common.speech/Exports.js";
import {
AudioSourceErrorEvent,
AudioSourceEvent,
Expand All @@ -25,13 +25,13 @@ import {
IAudioStreamNode,
IStringDictionary,
Stream,
} from "../common/Exports";
import { IStreamChunk } from "../common/Stream";
} from "../common/Exports.js";
import { IStreamChunk } from "../common/Stream.js";
import {
AudioStreamFormat,
AudioStreamFormatImpl,
} from "../sdk/Audio/AudioStreamFormat";
import { IRecorder } from "./IRecorder";
} from "../sdk/Audio/AudioStreamFormat.js";
import { IRecorder } from "./IRecorder.js";

// Extending the default definition with browser specific definitions for backward compatibility
interface INavigator extends Navigator {
Expand Down
4 changes: 2 additions & 2 deletions src/common.browser/PCMRecorder.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { RiffPcmEncoder, Stream } from "../common/Exports";
import { IRecorder } from "./IRecorder";
import { RiffPcmEncoder, Stream } from "../common/Exports.js";
import { IRecorder } from "./IRecorder.js";

export class PcmRecorder implements IRecorder {
private privMediaResources: IMediaResources;
Expand Down
4 changes: 2 additions & 2 deletions src/common.browser/ProxyInfo.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { RecognizerConfig } from "../common.speech/Exports";
import { PropertyCollection, PropertyId } from "../sdk/Exports";
import { RecognizerConfig } from "../common.speech/Exports.js";
import { PropertyCollection, PropertyId } from "../sdk/Exports.js";

export class ProxyInfo {
private privProxyHostName: string;
Expand Down
2 changes: 1 addition & 1 deletion src/common.browser/ReplayableAudioNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {
IAudioStreamNode,
IStreamChunk,
} from "../common/Exports";
} from "../common/Exports.js";

export class ReplayableAudioNode implements IAudioStreamNode {
private privAudioNode: IAudioStreamNode;
Expand Down
2 changes: 1 addition & 1 deletion src/common.browser/RestConfigBase.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { IErrorMessages } from "../common/Exports";
import { IErrorMessages } from "../common/Exports.js";
/**
* HTTP request helper
*/
Expand Down
4 changes: 2 additions & 2 deletions src/common.browser/RestMessageAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import bent, { BentResponse, RequestBody } from "bent";
import {
ArgumentNullError,
Deferred
} from "../common/Exports";
import { IRequestOptions } from "./Exports";
} from "../common/Exports.js";
import { IRequestOptions } from "./Exports.js";

export enum RestRequestType {
Get = "GET",
Expand Down
6 changes: 3 additions & 3 deletions src/common.browser/WebsocketConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
IConnection,
IStringDictionary,
IWebsocketMessageFormatter,
} from "../common/Exports";
import { ProxyInfo } from "./ProxyInfo";
import { WebsocketMessageAdapter } from "./WebsocketMessageAdapter";
} from "../common/Exports.js";
import { ProxyInfo } from "./ProxyInfo.js";
import { WebsocketMessageAdapter } from "./WebsocketMessageAdapter.js";

export class WebsocketConnection implements IConnection {

Expand Down
6 changes: 3 additions & 3 deletions src/common.browser/WebsocketMessageAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Agent from "agent-base";
import HttpsProxyAgent from "https-proxy-agent";

import ws from "ws";
import { HeaderNames } from "../common.speech/HeaderNames";
import { HeaderNames } from "../common.speech/HeaderNames.js";
import {
ArgumentNullError,
BackgroundEvent,
Expand All @@ -31,8 +31,8 @@ import {
MessageType,
Queue,
RawWebsocketMessage,
} from "../common/Exports";
import { ProxyInfo } from "./ProxyInfo";
} from "../common/Exports.js";
import { ProxyInfo } from "./ProxyInfo.js";

interface ISendItem {
Message: ConnectionMessage;
Expand Down
2 changes: 1 addition & 1 deletion src/common.speech/AddedLmIntent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { LanguageUnderstandingModelImpl } from "../sdk/LanguageUnderstandingModel";
import { LanguageUnderstandingModelImpl } from "../sdk/LanguageUnderstandingModel.js";

/**
* @class AddedLmIntent
Expand Down
6 changes: 3 additions & 3 deletions src/common.speech/AvatarSynthesisAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import {
AvatarSynthesizer,
PropertyId,
Synthesizer,
} from "../sdk/Exports";
} from "../sdk/Exports.js";
import {
ISynthesisConnectionFactory,
ISynthesisMetadata,
ISynthesisSectionVideo,
SynthesisAdapterBase,
SynthesizerConfig
} from "./Exports";
import { IAuthentication } from "./IAuthentication";
} from "./Exports.js";
import { IAuthentication } from "./IAuthentication.js";

export class AvatarSynthesisAdapter extends SynthesisAdapterBase {
private readonly privAvatarSynthesizer: AvatarSynthesizer;
Expand Down
6 changes: 3 additions & 3 deletions src/common.speech/CognitiveSubscriptionKeyAuthentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import {
ArgumentNullError,
} from "../common/Exports";
import { HeaderNames } from "./HeaderNames";
} from "../common/Exports.js";
import { HeaderNames } from "./HeaderNames.js";
import {
AuthInfo,
IAuthentication
} from "./IAuthentication";
} from "./IAuthentication.js";

/**
* @class
Expand Down
6 changes: 3 additions & 3 deletions src/common.speech/CognitiveTokenAuthentication.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { ArgumentNullError } from "../common/Exports";
import { AuthInfo, IAuthentication } from "./IAuthentication";
import { HeaderNames } from "./HeaderNames";
import { ArgumentNullError } from "../common/Exports.js";
import { AuthInfo, IAuthentication } from "./IAuthentication.js";
import { HeaderNames } from "./HeaderNames.js";

export class CognitiveTokenAuthentication implements IAuthentication {
private static privTokenPrefix: string = "Bearer ";
Expand Down
10 changes: 5 additions & 5 deletions src/common.speech/ConnectionFactoryBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

import {
ServicePropertiesPropertyName,
} from "../common.speech/Exports";
import { IConnection, IStringDictionary } from "../common/Exports";
import { PropertyId } from "../sdk/Exports";
import { AuthInfo, IConnectionFactory, RecognizerConfig } from "./Exports";
import { QueryParameterNames } from "./QueryParameterNames";
} from "../common.speech/Exports.js";
import { IConnection, IStringDictionary } from "../common/Exports.js";
import { PropertyId } from "../sdk/Exports.js";
import { AuthInfo, IConnectionFactory, RecognizerConfig } from "./Exports.js";
import { QueryParameterNames } from "./QueryParameterNames.js";

export abstract class ConnectionFactoryBase implements IConnectionFactory {

Expand Down
8 changes: 4 additions & 4 deletions src/common.speech/ConversationServiceRecognizer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IAudioSource } from "../common/Exports";
import { IAudioSource } from "../common/Exports.js";
import {
CancellationErrorCode,
CancellationReason,
Expand All @@ -8,7 +8,7 @@ import {
Recognizer,
ResultReason,
SpeechRecognitionResult
} from "../sdk/Exports";
} from "../sdk/Exports.js";
import {
DetailedSpeechPhrase,
EnumTranslation,
Expand All @@ -20,8 +20,8 @@ import {
ServiceRecognizerBase,
SimpleSpeechPhrase,
SpeechHypothesis
} from "./Exports";
import { SpeechConnectionMessage } from "./SpeechConnectionMessage.Internal";
} from "./Exports.js";
import { SpeechConnectionMessage } from "./SpeechConnectionMessage.Internal.js";

export class ConversationServiceRecognizer extends ServiceRecognizerBase {

Expand Down
16 changes: 8 additions & 8 deletions src/common.speech/ConversationTranscriberConnectionFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
import {
ProxyInfo,
WebsocketConnection,
} from "../common.browser/Exports";
} from "../common.browser/Exports.js";
import {
IConnection,
IStringDictionary
} from "../common/Exports";
} from "../common/Exports.js";
import {
PropertyId
} from "../sdk/Exports";
} from "../sdk/Exports.js";
import {
ServicePropertiesPropertyName
} from "../common.speech/Exports";
} from "../common.speech/Exports.js";
import {
ConnectionFactoryBase
} from "./ConnectionFactoryBase";
} from "./ConnectionFactoryBase.js";
import {
AuthInfo,
RecognizerConfig,
WebsocketMessageFormatter
} from "./Exports";
import { HeaderNames } from "./HeaderNames";
} from "./Exports.js";
import { HeaderNames } from "./HeaderNames.js";
import {
QueryParameterNames
} from "./QueryParameterNames";
} from "./QueryParameterNames.js";

export class ConversationTranscriberConnectionFactory extends ConnectionFactoryBase {
private readonly universalUri: string = "/speech/universal/v2";
Expand Down
Loading

0 comments on commit 1d9f0e7

Please sign in to comment.