@aws-sdk/client-transcribe-streaming 3.28.0 → 3.32.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/TranscribeStreaming.ts +3 -2
  3. package/commands/StartStreamTranscriptionCommand.ts +3 -2
  4. package/dist/cjs/TranscribeStreaming.js.map +1 -1
  5. package/dist/cjs/commands/StartStreamTranscriptionCommand.js +3 -2
  6. package/dist/cjs/commands/StartStreamTranscriptionCommand.js.map +1 -1
  7. package/dist/cjs/endpoints.js +22 -1
  8. package/dist/cjs/endpoints.js.map +1 -1
  9. package/dist/cjs/models/models_0.js +18 -1
  10. package/dist/cjs/models/models_0.js.map +1 -1
  11. package/dist/cjs/package.json +37 -37
  12. package/dist/cjs/protocols/Aws_restJson1.js +61 -17
  13. package/dist/cjs/protocols/Aws_restJson1.js.map +1 -1
  14. package/dist/es/TranscribeStreaming.js.map +1 -1
  15. package/dist/es/commands/StartStreamTranscriptionCommand.js +3 -2
  16. package/dist/es/commands/StartStreamTranscriptionCommand.js.map +1 -1
  17. package/dist/es/endpoints.js +23 -3
  18. package/dist/es/endpoints.js.map +1 -1
  19. package/dist/es/models/models_0.js +15 -0
  20. package/dist/es/models/models_0.js.map +1 -1
  21. package/dist/es/package.json +37 -37
  22. package/dist/es/protocols/Aws_restJson1.js +60 -19
  23. package/dist/es/protocols/Aws_restJson1.js.map +1 -1
  24. package/dist/types/TranscribeStreaming.d.ts +3 -2
  25. package/dist/types/commands/StartStreamTranscriptionCommand.d.ts +3 -2
  26. package/dist/types/models/models_0.d.ts +98 -17
  27. package/dist/types/ts3.4/TranscribeStreaming.d.ts +3 -2
  28. package/dist/types/ts3.4/commands/StartStreamTranscriptionCommand.d.ts +3 -2
  29. package/dist/types/ts3.4/models/models_0.d.ts +98 -17
  30. package/endpoints.ts +22 -1
  31. package/models/models_0.ts +116 -17
  32. package/package.json +37 -37
  33. package/protocols/Aws_restJson1.ts +67 -19
@@ -12,6 +12,7 @@ import {
12
12
  AudioStream,
13
13
  BadRequestException,
14
14
  ConflictException,
15
+ Entity,
15
16
  InternalFailureException,
16
17
  Item,
17
18
  LimitExceededException,
@@ -32,9 +33,9 @@ import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@a
32
33
  import {
33
34
  expectBoolean as __expectBoolean,
34
35
  expectString as __expectString,
35
- limitedParseFloat as __limitedParseFloat,
36
+ limitedParseDouble as __limitedParseDouble,
36
37
  parseBoolean as __parseBoolean,
37
- strictParseInt as __strictParseInt,
38
+ strictParseInt32 as __strictParseInt32,
38
39
  } from "@aws-sdk/smithy-client";
39
40
  import {
40
41
  Endpoint as __Endpoint,
@@ -131,6 +132,15 @@ export const serializeAws_restJson1StartStreamTranscriptionCommand = async (
131
132
  ...(isSerializableHeaderValue(input.PartialResultsStability) && {
132
133
  "x-amzn-transcribe-partial-results-stability": input.PartialResultsStability!,
133
134
  }),
135
+ ...(isSerializableHeaderValue(input.ContentIdentificationType) && {
136
+ "x-amzn-transcribe-content-identification-type": input.ContentIdentificationType!,
137
+ }),
138
+ ...(isSerializableHeaderValue(input.ContentRedactionType) && {
139
+ "x-amzn-transcribe-content-redaction-type": input.ContentRedactionType!,
140
+ }),
141
+ ...(isSerializableHeaderValue(input.PiiEntityTypes) && {
142
+ "x-amzn-transcribe-pii-entity-types": input.PiiEntityTypes!,
143
+ }),
134
144
  };
135
145
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/stream-transcription";
136
146
  let body: any;
@@ -180,7 +190,7 @@ export const deserializeAws_restJson1StartMedicalStreamTranscriptionCommand = as
180
190
  contents.LanguageCode = output.headers["x-amzn-transcribe-language-code"];
181
191
  }
182
192
  if (output.headers["x-amzn-transcribe-sample-rate"] !== undefined) {
183
- contents.MediaSampleRateHertz = __strictParseInt(output.headers["x-amzn-transcribe-sample-rate"]);
193
+ contents.MediaSampleRateHertz = __strictParseInt32(output.headers["x-amzn-transcribe-sample-rate"]);
184
194
  }
185
195
  if (output.headers["x-amzn-transcribe-media-encoding"] !== undefined) {
186
196
  contents.MediaEncoding = output.headers["x-amzn-transcribe-media-encoding"];
@@ -206,7 +216,7 @@ export const deserializeAws_restJson1StartMedicalStreamTranscriptionCommand = as
206
216
  );
207
217
  }
208
218
  if (output.headers["x-amzn-transcribe-number-of-channels"] !== undefined) {
209
- contents.NumberOfChannels = __strictParseInt(output.headers["x-amzn-transcribe-number-of-channels"]);
219
+ contents.NumberOfChannels = __strictParseInt32(output.headers["x-amzn-transcribe-number-of-channels"]);
210
220
  }
211
221
  if (output.headers["x-amzn-transcribe-content-identification-type"] !== undefined) {
212
222
  contents.ContentIdentificationType = output.headers["x-amzn-transcribe-content-identification-type"];
@@ -308,6 +318,8 @@ export const deserializeAws_restJson1StartStreamTranscriptionCommand = async (
308
318
  }
309
319
  const contents: StartStreamTranscriptionCommandOutput = {
310
320
  $metadata: deserializeMetadata(output),
321
+ ContentIdentificationType: undefined,
322
+ ContentRedactionType: undefined,
311
323
  EnableChannelIdentification: undefined,
312
324
  EnablePartialResultsStabilization: undefined,
313
325
  LanguageCode: undefined,
@@ -315,6 +327,7 @@ export const deserializeAws_restJson1StartStreamTranscriptionCommand = async (
315
327
  MediaSampleRateHertz: undefined,
316
328
  NumberOfChannels: undefined,
317
329
  PartialResultsStability: undefined,
330
+ PiiEntityTypes: undefined,
318
331
  RequestId: undefined,
319
332
  SessionId: undefined,
320
333
  ShowSpeakerLabel: undefined,
@@ -330,7 +343,7 @@ export const deserializeAws_restJson1StartStreamTranscriptionCommand = async (
330
343
  contents.LanguageCode = output.headers["x-amzn-transcribe-language-code"];
331
344
  }
332
345
  if (output.headers["x-amzn-transcribe-sample-rate"] !== undefined) {
333
- contents.MediaSampleRateHertz = __strictParseInt(output.headers["x-amzn-transcribe-sample-rate"]);
346
+ contents.MediaSampleRateHertz = __strictParseInt32(output.headers["x-amzn-transcribe-sample-rate"]);
334
347
  }
335
348
  if (output.headers["x-amzn-transcribe-media-encoding"] !== undefined) {
336
349
  contents.MediaEncoding = output.headers["x-amzn-transcribe-media-encoding"];
@@ -356,7 +369,7 @@ export const deserializeAws_restJson1StartStreamTranscriptionCommand = async (
356
369
  );
357
370
  }
358
371
  if (output.headers["x-amzn-transcribe-number-of-channels"] !== undefined) {
359
- contents.NumberOfChannels = __strictParseInt(output.headers["x-amzn-transcribe-number-of-channels"]);
372
+ contents.NumberOfChannels = __strictParseInt32(output.headers["x-amzn-transcribe-number-of-channels"]);
360
373
  }
361
374
  if (output.headers["x-amzn-transcribe-enable-partial-results-stabilization"] !== undefined) {
362
375
  contents.EnablePartialResultsStabilization = __parseBoolean(
@@ -366,6 +379,15 @@ export const deserializeAws_restJson1StartStreamTranscriptionCommand = async (
366
379
  if (output.headers["x-amzn-transcribe-partial-results-stability"] !== undefined) {
367
380
  contents.PartialResultsStability = output.headers["x-amzn-transcribe-partial-results-stability"];
368
381
  }
382
+ if (output.headers["x-amzn-transcribe-content-identification-type"] !== undefined) {
383
+ contents.ContentIdentificationType = output.headers["x-amzn-transcribe-content-identification-type"];
384
+ }
385
+ if (output.headers["x-amzn-transcribe-content-redaction-type"] !== undefined) {
386
+ contents.ContentRedactionType = output.headers["x-amzn-transcribe-content-redaction-type"];
387
+ }
388
+ if (output.headers["x-amzn-transcribe-pii-entity-types"] !== undefined) {
389
+ contents.PiiEntityTypes = output.headers["x-amzn-transcribe-pii-entity-types"];
390
+ }
369
391
  const data: any = context.eventStreamMarshaller.deserialize(output.body, async (event) => {
370
392
  const eventName = Object.keys(event)[0];
371
393
  const eventHeaders = Object.entries(event[eventName].headers).reduce((accummulator, curr) => {
@@ -742,6 +764,10 @@ const serializeAws_restJson1AudioStream = (input: AudioStream, context: __SerdeC
742
764
 
743
765
  const deserializeAws_restJson1Alternative = (output: any, context: __SerdeContext): Alternative => {
744
766
  return {
767
+ Entities:
768
+ output.Entities !== undefined && output.Entities !== null
769
+ ? deserializeAws_restJson1EntityList(output.Entities, context)
770
+ : undefined,
745
771
  Items:
746
772
  output.Items !== undefined && output.Items !== null
747
773
  ? deserializeAws_restJson1ItemList(output.Items, context)
@@ -773,6 +799,28 @@ const deserializeAws_restJson1ConflictException = (output: any, context: __Serde
773
799
  } as any;
774
800
  };
775
801
 
802
+ const deserializeAws_restJson1Entity = (output: any, context: __SerdeContext): Entity => {
803
+ return {
804
+ Category: __expectString(output.Category),
805
+ Confidence: __limitedParseDouble(output.Confidence),
806
+ Content: __expectString(output.Content),
807
+ EndTime: __limitedParseDouble(output.EndTime),
808
+ StartTime: __limitedParseDouble(output.StartTime),
809
+ Type: __expectString(output.Type),
810
+ } as any;
811
+ };
812
+
813
+ const deserializeAws_restJson1EntityList = (output: any, context: __SerdeContext): Entity[] => {
814
+ return (output || [])
815
+ .filter((e: any) => e != null)
816
+ .map((entry: any) => {
817
+ if (entry === null) {
818
+ return null as any;
819
+ }
820
+ return deserializeAws_restJson1Entity(entry, context);
821
+ });
822
+ };
823
+
776
824
  const deserializeAws_restJson1InternalFailureException = (
777
825
  output: any,
778
826
  context: __SerdeContext
@@ -784,12 +832,12 @@ const deserializeAws_restJson1InternalFailureException = (
784
832
 
785
833
  const deserializeAws_restJson1Item = (output: any, context: __SerdeContext): Item => {
786
834
  return {
787
- Confidence: __limitedParseFloat(output.Confidence),
835
+ Confidence: __limitedParseDouble(output.Confidence),
788
836
  Content: __expectString(output.Content),
789
- EndTime: __limitedParseFloat(output.EndTime),
837
+ EndTime: __limitedParseDouble(output.EndTime),
790
838
  Speaker: __expectString(output.Speaker),
791
839
  Stable: __expectBoolean(output.Stable),
792
- StartTime: __limitedParseFloat(output.StartTime),
840
+ StartTime: __limitedParseDouble(output.StartTime),
793
841
  Type: __expectString(output.Type),
794
842
  VocabularyFilterMatch: __expectBoolean(output.VocabularyFilterMatch),
795
843
  } as any;
@@ -843,10 +891,10 @@ const deserializeAws_restJson1MedicalAlternativeList = (output: any, context: __
843
891
  const deserializeAws_restJson1MedicalEntity = (output: any, context: __SerdeContext): MedicalEntity => {
844
892
  return {
845
893
  Category: __expectString(output.Category),
846
- Confidence: __limitedParseFloat(output.Confidence),
894
+ Confidence: __limitedParseDouble(output.Confidence),
847
895
  Content: __expectString(output.Content),
848
- EndTime: __limitedParseFloat(output.EndTime),
849
- StartTime: __limitedParseFloat(output.StartTime),
896
+ EndTime: __limitedParseDouble(output.EndTime),
897
+ StartTime: __limitedParseDouble(output.StartTime),
850
898
  } as any;
851
899
  };
852
900
 
@@ -863,11 +911,11 @@ const deserializeAws_restJson1MedicalEntityList = (output: any, context: __Serde
863
911
 
864
912
  const deserializeAws_restJson1MedicalItem = (output: any, context: __SerdeContext): MedicalItem => {
865
913
  return {
866
- Confidence: __limitedParseFloat(output.Confidence),
914
+ Confidence: __limitedParseDouble(output.Confidence),
867
915
  Content: __expectString(output.Content),
868
- EndTime: __limitedParseFloat(output.EndTime),
916
+ EndTime: __limitedParseDouble(output.EndTime),
869
917
  Speaker: __expectString(output.Speaker),
870
- StartTime: __limitedParseFloat(output.StartTime),
918
+ StartTime: __limitedParseDouble(output.StartTime),
871
919
  Type: __expectString(output.Type),
872
920
  } as any;
873
921
  };
@@ -890,10 +938,10 @@ const deserializeAws_restJson1MedicalResult = (output: any, context: __SerdeCont
890
938
  ? deserializeAws_restJson1MedicalAlternativeList(output.Alternatives, context)
891
939
  : undefined,
892
940
  ChannelId: __expectString(output.ChannelId),
893
- EndTime: __limitedParseFloat(output.EndTime),
941
+ EndTime: __limitedParseDouble(output.EndTime),
894
942
  IsPartial: __expectBoolean(output.IsPartial),
895
943
  ResultId: __expectString(output.ResultId),
896
- StartTime: __limitedParseFloat(output.StartTime),
944
+ StartTime: __limitedParseDouble(output.StartTime),
897
945
  } as any;
898
946
  };
899
947
 
@@ -979,10 +1027,10 @@ const deserializeAws_restJson1Result = (output: any, context: __SerdeContext): R
979
1027
  ? deserializeAws_restJson1AlternativeList(output.Alternatives, context)
980
1028
  : undefined,
981
1029
  ChannelId: __expectString(output.ChannelId),
982
- EndTime: __limitedParseFloat(output.EndTime),
1030
+ EndTime: __limitedParseDouble(output.EndTime),
983
1031
  IsPartial: __expectBoolean(output.IsPartial),
984
1032
  ResultId: __expectString(output.ResultId),
985
- StartTime: __limitedParseFloat(output.StartTime),
1033
+ StartTime: __limitedParseDouble(output.StartTime),
986
1034
  } as any;
987
1035
  };
988
1036