dba4321b97a7fffa7833c343f8c69734b0924d4950fde053145dfd15ee5978b9.json 8.6 KB

1
  1. {"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ConversationTranslatorCommandTypes = exports.ConversationTranslatorMessageTypes = exports.InternalParticipants = void 0;\n/** Users participating in the conversation */\nclass InternalParticipants {\n constructor(participants = [], meId) {\n this.participants = participants;\n this.meId = meId;\n }\n /**\n * Add or update a participant\n * @param value\n */\n addOrUpdateParticipant(value) {\n if (value === undefined) {\n return;\n }\n const exists = this.getParticipantIndex(value.id);\n if (exists > -1) {\n this.participants.splice(exists, 1, value);\n } else {\n this.participants.push(value);\n }\n // ensure it was added ok\n return this.getParticipant(value.id);\n }\n /**\n * Find the participant's position in the participants list.\n * @param id\n */\n getParticipantIndex(id) {\n return this.participants.findIndex(p => p.id === id);\n }\n /**\n * Find the participant by id.\n * @param id\n */\n getParticipant(id) {\n return this.participants.find(p => p.id === id);\n }\n /**\n * Remove a participant from the participants list.\n */\n deleteParticipant(id) {\n this.participants = this.participants.filter(p => p.id !== id);\n }\n /**\n * Helper to return the conversation host.\n */\n get host() {\n return this.participants.find(p => p.isHost === true);\n }\n /**\n * Helper to return the current user.\n */\n get me() {\n return this.getParticipant(this.meId);\n }\n}\nexports.InternalParticipants = InternalParticipants;\n/**\n * List of command message types\n */\nexports.ConversationTranslatorMessageTypes = {\n command: \"command\",\n final: \"final\",\n info: \"info\",\n instantMessage: \"instant_message\",\n keepAlive: \"keep_alive\",\n partial: \"partial\",\n participantCommand: \"participant_command\",\n translatedMessage: \"translated_message\"\n};\n/**\n * List of command types\n */\nexports.ConversationTranslatorCommandTypes = {\n changeNickname: \"ChangeNickname\",\n disconnectSession: \"DisconnectSession\",\n ejectParticipant: \"EjectParticipant\",\n instant_message: \"instant_message\",\n joinSession: \"JoinSession\",\n leaveSession: \"LeaveSession\",\n participantList: \"ParticipantList\",\n roomExpirationWarning: \"RoomExpirationWarning\",\n setLockState: \"SetLockState\",\n setMute: \"SetMute\",\n setMuteAll: \"SetMuteAll\",\n setProfanityFiltering: \"SetProfanityFiltering\",\n setTranslateToLanguages: \"SetTranslateToLanguages\",\n setUseTTS: \"SetUseTTS\"\n};","map":{"version":3,"names":["Object","defineProperty","exports","value","ConversationTranslatorCommandTypes","ConversationTranslatorMessageTypes","InternalParticipants","constructor","participants","meId","addOrUpdateParticipant","undefined","exists","getParticipantIndex","id","splice","push","getParticipant","findIndex","p","find","deleteParticipant","filter","host","isHost","me","command","final","info","instantMessage","keepAlive","partial","participantCommand","translatedMessage","changeNickname","disconnectSession","ejectParticipant","instant_message","joinSession","leaveSession","participantList","roomExpirationWarning","setLockState","setMute","setMuteAll","setProfanityFiltering","setTranslateToLanguages","setUseTTS"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/Transcription/ConversationTranslatorInterfaces.js"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConversationTranslatorCommandTypes = exports.ConversationTranslatorMessageTypes = exports.InternalParticipants = void 0;\n/** Users participating in the conversation */\nclass InternalParticipants {\n constructor(participants = [], meId) {\n this.participants = participants;\n this.meId = meId;\n }\n /**\n * Add or update a participant\n * @param value\n */\n addOrUpdateParticipant(value) {\n if (value === undefined) {\n return;\n }\n const exists = this.getParticipantIndex(value.id);\n if (exists > -1) {\n this.participants.splice(exists, 1, value);\n }\n else {\n this.participants.push(value);\n }\n // ensure it was added ok\n return this.getParticipant(value.id);\n }\n /**\n * Find the participant's position in the participants list.\n * @param id\n */\n getParticipantIndex(id) {\n return this.participants.findIndex((p) => p.id === id);\n }\n /**\n * Find the participant by id.\n * @param id\n */\n getParticipant(id) {\n return this.participants.find((p) => p.id === id);\n }\n /**\n * Remove a participant from the participants list.\n */\n deleteParticipant(id) {\n this.participants = this.participants.filter((p) => p.id !== id);\n }\n /**\n * Helper to return the conversation host.\n */\n get host() {\n return this.participants.find((p) => p.isHost === true);\n }\n /**\n * Helper to return the current user.\n */\n get me() {\n return this.getParticipant(this.meId);\n }\n}\nexports.InternalParticipants = InternalParticipants;\n/**\n * List of command message types\n */\nexports.ConversationTranslatorMessageTypes = {\n command: \"command\",\n final: \"final\",\n info: \"info\",\n instantMessage: \"instant_message\",\n keepAlive: \"keep_alive\",\n partial: \"partial\",\n participantCommand: \"participant_command\",\n translatedMessage: \"translated_message\"\n};\n/**\n * List of command types\n */\nexports.ConversationTranslatorCommandTypes = {\n changeNickname: \"ChangeNickname\",\n disconnectSession: \"DisconnectSession\",\n ejectParticipant: \"EjectParticipant\",\n instant_message: \"instant_message\",\n joinSession: \"JoinSession\",\n leaveSession: \"LeaveSession\",\n participantList: \"ParticipantList\",\n roomExpirationWarning: \"RoomExpirationWarning\",\n setLockState: \"SetLockState\",\n setMute: \"SetMute\",\n setMuteAll: \"SetMuteAll\",\n setProfanityFiltering: \"SetProfanityFiltering\",\n setTranslateToLanguages: \"SetTranslateToLanguages\",\n setUseTTS: \"SetUseTTS\"\n};\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,kCAAkC,GAAGF,OAAO,CAACG,kCAAkC,GAAGH,OAAO,CAACI,oBAAoB,GAAG,KAAK,CAAC;AAC/H;AACA,MAAMA,oBAAoB,CAAC;EACvBC,WAAWA,CAACC,YAAY,GAAG,EAAE,EAAEC,IAAI,EAAE;IACjC,IAAI,CAACD,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,IAAI,GAAGA,IAAI;EACpB;EACA;AACJ;AACA;AACA;EACIC,sBAAsBA,CAACP,KAAK,EAAE;IAC1B,IAAIA,KAAK,KA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