@aws-sdk/client-transcribe-streaming 3.525.0 → 3.529.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.js +16 -56
- package/dist-es/protocols/Aws_restJson1.js +1 -40
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -504,10 +504,11 @@ var StartStreamTranscriptionResponseFilterSensitiveLog = /* @__PURE__ */ __name(
|
|
|
504
504
|
}), "StartStreamTranscriptionResponseFilterSensitiveLog");
|
|
505
505
|
|
|
506
506
|
// src/protocols/Aws_restJson1.ts
|
|
507
|
-
var import_core = require("@
|
|
507
|
+
var import_core = require("@aws-sdk/core");
|
|
508
|
+
var import_core2 = require("@smithy/core");
|
|
508
509
|
|
|
509
510
|
var se_StartCallAnalyticsStreamTranscriptionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
510
|
-
const b = (0,
|
|
511
|
+
const b = (0, import_core2.requestBuilder)(input, context);
|
|
511
512
|
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
512
513
|
[_xatlc]: input[_LC],
|
|
513
514
|
[_xatsr]: [() => isSerializableHeaderValue(input[_MSRH]), () => input[_MSRH].toString()],
|
|
@@ -532,7 +533,7 @@ var se_StartCallAnalyticsStreamTranscriptionCommand = /* @__PURE__ */ __name(asy
|
|
|
532
533
|
return b.build();
|
|
533
534
|
}, "se_StartCallAnalyticsStreamTranscriptionCommand");
|
|
534
535
|
var se_StartMedicalStreamTranscriptionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
535
|
-
const b = (0,
|
|
536
|
+
const b = (0, import_core2.requestBuilder)(input, context);
|
|
536
537
|
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
537
538
|
[_xatlc]: input[_LC],
|
|
538
539
|
[_xatsr]: [() => isSerializableHeaderValue(input[_MSRH]), () => input[_MSRH].toString()],
|
|
@@ -555,7 +556,7 @@ var se_StartMedicalStreamTranscriptionCommand = /* @__PURE__ */ __name(async (in
|
|
|
555
556
|
return b.build();
|
|
556
557
|
}, "se_StartMedicalStreamTranscriptionCommand");
|
|
557
558
|
var se_StartStreamTranscriptionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
558
|
-
const b = (0,
|
|
559
|
+
const b = (0, import_core2.requestBuilder)(input, context);
|
|
559
560
|
const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
|
|
560
561
|
[_xatlc]: input[_LC],
|
|
561
562
|
[_xatsr]: [() => isSerializableHeaderValue(input[_MSRH]), () => input[_MSRH].toString()],
|
|
@@ -673,9 +674,9 @@ var de_StartStreamTranscriptionCommand = /* @__PURE__ */ __name(async (output, c
|
|
|
673
674
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
674
675
|
const parsedOutput = {
|
|
675
676
|
...output,
|
|
676
|
-
body: await
|
|
677
|
+
body: await (0, import_core.parseJsonErrorBody)(output.body, context)
|
|
677
678
|
};
|
|
678
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
679
|
+
const errorCode = (0, import_core.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
679
680
|
switch (errorCode) {
|
|
680
681
|
case "BadRequestException":
|
|
681
682
|
case "com.amazonaws.transcribestreaming#BadRequestException":
|
|
@@ -920,59 +921,59 @@ var de_TranscriptResultStream = /* @__PURE__ */ __name((output, context) => {
|
|
|
920
921
|
var de_BadRequestException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
921
922
|
const parsedOutput = {
|
|
922
923
|
...output,
|
|
923
|
-
body: await
|
|
924
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
924
925
|
};
|
|
925
926
|
return de_BadRequestExceptionRes(parsedOutput, context);
|
|
926
927
|
}, "de_BadRequestException_event");
|
|
927
928
|
var de_CategoryEvent_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
928
929
|
const contents = {};
|
|
929
|
-
const data = await
|
|
930
|
+
const data = await (0, import_core.parseJsonBody)(output.body, context);
|
|
930
931
|
Object.assign(contents, (0, import_smithy_client._json)(data));
|
|
931
932
|
return contents;
|
|
932
933
|
}, "de_CategoryEvent_event");
|
|
933
934
|
var de_ConflictException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
934
935
|
const parsedOutput = {
|
|
935
936
|
...output,
|
|
936
|
-
body: await
|
|
937
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
937
938
|
};
|
|
938
939
|
return de_ConflictExceptionRes(parsedOutput, context);
|
|
939
940
|
}, "de_ConflictException_event");
|
|
940
941
|
var de_InternalFailureException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
941
942
|
const parsedOutput = {
|
|
942
943
|
...output,
|
|
943
|
-
body: await
|
|
944
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
944
945
|
};
|
|
945
946
|
return de_InternalFailureExceptionRes(parsedOutput, context);
|
|
946
947
|
}, "de_InternalFailureException_event");
|
|
947
948
|
var de_LimitExceededException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
948
949
|
const parsedOutput = {
|
|
949
950
|
...output,
|
|
950
|
-
body: await
|
|
951
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
951
952
|
};
|
|
952
953
|
return de_LimitExceededExceptionRes(parsedOutput, context);
|
|
953
954
|
}, "de_LimitExceededException_event");
|
|
954
955
|
var de_MedicalTranscriptEvent_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
955
956
|
const contents = {};
|
|
956
|
-
const data = await
|
|
957
|
+
const data = await (0, import_core.parseJsonBody)(output.body, context);
|
|
957
958
|
Object.assign(contents, de_MedicalTranscriptEvent(data, context));
|
|
958
959
|
return contents;
|
|
959
960
|
}, "de_MedicalTranscriptEvent_event");
|
|
960
961
|
var de_ServiceUnavailableException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
961
962
|
const parsedOutput = {
|
|
962
963
|
...output,
|
|
963
|
-
body: await
|
|
964
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
964
965
|
};
|
|
965
966
|
return de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
966
967
|
}, "de_ServiceUnavailableException_event");
|
|
967
968
|
var de_TranscriptEvent_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
968
969
|
const contents = {};
|
|
969
|
-
const data = await
|
|
970
|
+
const data = await (0, import_core.parseJsonBody)(output.body, context);
|
|
970
971
|
Object.assign(contents, de_TranscriptEvent(data, context));
|
|
971
972
|
return contents;
|
|
972
973
|
}, "de_TranscriptEvent_event");
|
|
973
974
|
var de_UtteranceEvent_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
974
975
|
const contents = {};
|
|
975
|
-
const data = await
|
|
976
|
+
const data = await (0, import_core.parseJsonBody)(output.body, context);
|
|
976
977
|
Object.assign(contents, de_UtteranceEvent(data, context));
|
|
977
978
|
return contents;
|
|
978
979
|
}, "de_UtteranceEvent_event");
|
|
@@ -1186,7 +1187,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
1186
1187
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1187
1188
|
cfId: output.headers["x-amz-cf-id"]
|
|
1188
1189
|
}), "deserializeMetadata");
|
|
1189
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
1190
1190
|
var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
|
|
1191
1191
|
var _CIT = "ContentIdentificationType";
|
|
1192
1192
|
var _CRT = "ContentRedactionType";
|
|
@@ -1238,46 +1238,6 @@ var _xatvfn = "x-amzn-transcribe-vocabulary-filter-name";
|
|
|
1238
1238
|
var _xatvfn_ = "x-amzn-transcribe-vocabulary-filter-names";
|
|
1239
1239
|
var _xatvn = "x-amzn-transcribe-vocabulary-name";
|
|
1240
1240
|
var _xatvn_ = "x-amzn-transcribe-vocabulary-names";
|
|
1241
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1242
|
-
if (encoded.length) {
|
|
1243
|
-
return JSON.parse(encoded);
|
|
1244
|
-
}
|
|
1245
|
-
return {};
|
|
1246
|
-
}), "parseBody");
|
|
1247
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
1248
|
-
const value = await parseBody(errorBody, context);
|
|
1249
|
-
value.message = value.message ?? value.Message;
|
|
1250
|
-
return value;
|
|
1251
|
-
}, "parseErrorBody");
|
|
1252
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
1253
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
1254
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
1255
|
-
let cleanValue = rawValue;
|
|
1256
|
-
if (typeof cleanValue === "number") {
|
|
1257
|
-
cleanValue = cleanValue.toString();
|
|
1258
|
-
}
|
|
1259
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
1260
|
-
cleanValue = cleanValue.split(",")[0];
|
|
1261
|
-
}
|
|
1262
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1263
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1264
|
-
}
|
|
1265
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1266
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1267
|
-
}
|
|
1268
|
-
return cleanValue;
|
|
1269
|
-
}, "sanitizeErrorCode");
|
|
1270
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1271
|
-
if (headerKey !== void 0) {
|
|
1272
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1273
|
-
}
|
|
1274
|
-
if (data.code !== void 0) {
|
|
1275
|
-
return sanitizeErrorCode(data.code);
|
|
1276
|
-
}
|
|
1277
|
-
if (data["__type"] !== void 0) {
|
|
1278
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1279
|
-
}
|
|
1280
|
-
}, "loadRestJsonErrorCode");
|
|
1281
1241
|
|
|
1282
1242
|
// src/commands/StartCallAnalyticsStreamTranscriptionCommand.ts
|
|
1283
1243
|
var _StartCallAnalyticsStreamTranscriptionCommand = class _StartCallAnalyticsStreamTranscriptionCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
1
2
|
import { requestBuilder as rb } from "@smithy/core";
|
|
2
3
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, parseBoolean as __parseBoolean, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
4
|
import { AudioStream, BadRequestException, ConflictException, InternalFailureException, LimitExceededException, ServiceUnavailableException, } from "../models/models_0";
|
|
@@ -751,43 +752,3 @@ const _xatvfn = "x-amzn-transcribe-vocabulary-filter-name";
|
|
|
751
752
|
const _xatvfn_ = "x-amzn-transcribe-vocabulary-filter-names";
|
|
752
753
|
const _xatvn = "x-amzn-transcribe-vocabulary-name";
|
|
753
754
|
const _xatvn_ = "x-amzn-transcribe-vocabulary-names";
|
|
754
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
755
|
-
if (encoded.length) {
|
|
756
|
-
return JSON.parse(encoded);
|
|
757
|
-
}
|
|
758
|
-
return {};
|
|
759
|
-
});
|
|
760
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
761
|
-
const value = await parseBody(errorBody, context);
|
|
762
|
-
value.message = value.message ?? value.Message;
|
|
763
|
-
return value;
|
|
764
|
-
};
|
|
765
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
766
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
767
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
768
|
-
let cleanValue = rawValue;
|
|
769
|
-
if (typeof cleanValue === "number") {
|
|
770
|
-
cleanValue = cleanValue.toString();
|
|
771
|
-
}
|
|
772
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
773
|
-
cleanValue = cleanValue.split(",")[0];
|
|
774
|
-
}
|
|
775
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
776
|
-
cleanValue = cleanValue.split(":")[0];
|
|
777
|
-
}
|
|
778
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
779
|
-
cleanValue = cleanValue.split("#")[1];
|
|
780
|
-
}
|
|
781
|
-
return cleanValue;
|
|
782
|
-
};
|
|
783
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
784
|
-
if (headerKey !== undefined) {
|
|
785
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
786
|
-
}
|
|
787
|
-
if (data.code !== undefined) {
|
|
788
|
-
return sanitizeErrorCode(data.code);
|
|
789
|
-
}
|
|
790
|
-
if (data["__type"] !== undefined) {
|
|
791
|
-
return sanitizeErrorCode(data["__type"]);
|
|
792
|
-
}
|
|
793
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-transcribe-streaming",
|
|
3
3
|
"description": "AWS SDK for JavaScript Transcribe Streaming Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.529.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline client-transcribe-streaming",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
23
23
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
24
|
-
"@aws-sdk/client-sts": "3.
|
|
25
|
-
"@aws-sdk/core": "3.
|
|
26
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
24
|
+
"@aws-sdk/client-sts": "3.529.0",
|
|
25
|
+
"@aws-sdk/core": "3.529.0",
|
|
26
|
+
"@aws-sdk/credential-provider-node": "3.529.0",
|
|
27
27
|
"@aws-sdk/eventstream-handler-node": "3.523.0",
|
|
28
28
|
"@aws-sdk/middleware-eventstream": "3.523.0",
|
|
29
29
|
"@aws-sdk/middleware-host-header": "3.523.0",
|