@aws-sdk/client-rekognitionstreaming 3.928.0 → 3.930.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 CHANGED
@@ -8,6 +8,7 @@ var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
8
8
  var middlewareWebsocket = require('@aws-sdk/middleware-websocket');
9
9
  var configResolver = require('@smithy/config-resolver');
10
10
  var core = require('@smithy/core');
11
+ var schema = require('@smithy/core/schema');
11
12
  var eventstreamSerdeConfigResolver = require('@smithy/eventstream-serde-config-resolver');
12
13
  var middlewareContentLength = require('@smithy/middleware-content-length');
13
14
  var middlewareEndpoint = require('@smithy/middleware-endpoint');
@@ -17,8 +18,6 @@ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
17
18
  var runtimeConfig = require('./runtimeConfig');
18
19
  var regionConfigResolver = require('@aws-sdk/region-config-resolver');
19
20
  var protocolHttp = require('@smithy/protocol-http');
20
- var middlewareSerde = require('@smithy/middleware-serde');
21
- var core$1 = require('@aws-sdk/core');
22
21
 
23
22
  const resolveClientEndpointParameters = (options) => {
24
23
  return Object.assign(options, {
@@ -97,6 +96,7 @@ class RekognitionStreamingClient extends smithyClient.Client {
97
96
  const _config_10 = middlewareWebsocket.resolveWebSocketConfig(_config_9);
98
97
  const _config_11 = resolveRuntimeExtensions(_config_10, configuration?.extensions || []);
99
98
  this.config = _config_11;
99
+ this.middlewareStack.use(schema.getSchemaSerdePlugin(this.config));
100
100
  this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
101
101
  this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
102
102
  this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
@@ -116,14 +116,14 @@ class RekognitionStreamingClient extends smithyClient.Client {
116
116
  }
117
117
  }
118
118
 
119
- class RekognitionStreamingServiceException extends smithyClient.ServiceException {
119
+ let RekognitionStreamingServiceException$1 = class RekognitionStreamingServiceException extends smithyClient.ServiceException {
120
120
  constructor(options) {
121
121
  super(options);
122
122
  Object.setPrototypeOf(this, RekognitionStreamingServiceException.prototype);
123
123
  }
124
- }
124
+ };
125
125
 
126
- class AccessDeniedException extends RekognitionStreamingServiceException {
126
+ let AccessDeniedException$1 = class AccessDeniedException extends RekognitionStreamingServiceException$1 {
127
127
  name = "AccessDeniedException";
128
128
  $fault = "client";
129
129
  Message;
@@ -138,25 +138,15 @@ class AccessDeniedException extends RekognitionStreamingServiceException {
138
138
  this.Message = opts.Message;
139
139
  this.Code = opts.Code;
140
140
  }
141
- }
141
+ };
142
142
  const ChallengeType = {
143
143
  FACE_MOVEMENT_AND_LIGHT_CHALLENGE: "FaceMovementAndLightChallenge",
144
144
  FACE_MOVEMENT_CHALLENGE: "FaceMovementChallenge",
145
145
  };
146
- exports.ClientChallenge = void 0;
147
- (function (ClientChallenge) {
148
- ClientChallenge.visit = (value, visitor) => {
149
- if (value.FaceMovementAndLightChallenge !== undefined)
150
- return visitor.FaceMovementAndLightChallenge(value.FaceMovementAndLightChallenge);
151
- if (value.FaceMovementChallenge !== undefined)
152
- return visitor.FaceMovementChallenge(value.FaceMovementChallenge);
153
- return visitor._(value.$unknown[0], value.$unknown[1]);
154
- };
155
- })(exports.ClientChallenge || (exports.ClientChallenge = {}));
156
146
  const LightChallengeType = {
157
147
  SEQUENTIAL: "SEQUENTIAL",
158
148
  };
159
- class InternalServerException extends RekognitionStreamingServiceException {
149
+ let InternalServerException$1 = class InternalServerException extends RekognitionStreamingServiceException$1 {
160
150
  name = "InternalServerException";
161
151
  $fault = "server";
162
152
  Message;
@@ -171,28 +161,8 @@ class InternalServerException extends RekognitionStreamingServiceException {
171
161
  this.Message = opts.Message;
172
162
  this.Code = opts.Code;
173
163
  }
174
- }
175
- exports.LivenessRequestStream = void 0;
176
- (function (LivenessRequestStream) {
177
- LivenessRequestStream.visit = (value, visitor) => {
178
- if (value.VideoEvent !== undefined)
179
- return visitor.VideoEvent(value.VideoEvent);
180
- if (value.ClientSessionInformationEvent !== undefined)
181
- return visitor.ClientSessionInformationEvent(value.ClientSessionInformationEvent);
182
- return visitor._(value.$unknown[0], value.$unknown[1]);
183
- };
184
- })(exports.LivenessRequestStream || (exports.LivenessRequestStream = {}));
185
- exports.ServerChallenge = void 0;
186
- (function (ServerChallenge) {
187
- ServerChallenge.visit = (value, visitor) => {
188
- if (value.FaceMovementAndLightChallenge !== undefined)
189
- return visitor.FaceMovementAndLightChallenge(value.FaceMovementAndLightChallenge);
190
- if (value.FaceMovementChallenge !== undefined)
191
- return visitor.FaceMovementChallenge(value.FaceMovementChallenge);
192
- return visitor._(value.$unknown[0], value.$unknown[1]);
193
- };
194
- })(exports.ServerChallenge || (exports.ServerChallenge = {}));
195
- class ServiceQuotaExceededException extends RekognitionStreamingServiceException {
164
+ };
165
+ let ServiceQuotaExceededException$1 = class ServiceQuotaExceededException extends RekognitionStreamingServiceException$1 {
196
166
  name = "ServiceQuotaExceededException";
197
167
  $fault = "client";
198
168
  Message;
@@ -207,8 +177,8 @@ class ServiceQuotaExceededException extends RekognitionStreamingServiceException
207
177
  this.Message = opts.Message;
208
178
  this.Code = opts.Code;
209
179
  }
210
- }
211
- class ServiceUnavailableException extends RekognitionStreamingServiceException {
180
+ };
181
+ let ServiceUnavailableException$1 = class ServiceUnavailableException extends RekognitionStreamingServiceException$1 {
212
182
  name = "ServiceUnavailableException";
213
183
  $fault = "server";
214
184
  Message;
@@ -223,8 +193,8 @@ class ServiceUnavailableException extends RekognitionStreamingServiceException {
223
193
  this.Message = opts.Message;
224
194
  this.Code = opts.Code;
225
195
  }
226
- }
227
- class ThrottlingException extends RekognitionStreamingServiceException {
196
+ };
197
+ let ThrottlingException$1 = class ThrottlingException extends RekognitionStreamingServiceException$1 {
228
198
  name = "ThrottlingException";
229
199
  $fault = "client";
230
200
  Message;
@@ -239,8 +209,8 @@ class ThrottlingException extends RekognitionStreamingServiceException {
239
209
  this.Message = opts.Message;
240
210
  this.Code = opts.Code;
241
211
  }
242
- }
243
- class ValidationException extends RekognitionStreamingServiceException {
212
+ };
213
+ let ValidationException$1 = class ValidationException extends RekognitionStreamingServiceException$1 {
244
214
  name = "ValidationException";
245
215
  $fault = "client";
246
216
  Message;
@@ -255,30 +225,8 @@ class ValidationException extends RekognitionStreamingServiceException {
255
225
  this.Message = opts.Message;
256
226
  this.Code = opts.Code;
257
227
  }
258
- }
259
- exports.LivenessResponseStream = void 0;
260
- (function (LivenessResponseStream) {
261
- LivenessResponseStream.visit = (value, visitor) => {
262
- if (value.ServerSessionInformationEvent !== undefined)
263
- return visitor.ServerSessionInformationEvent(value.ServerSessionInformationEvent);
264
- if (value.DisconnectionEvent !== undefined)
265
- return visitor.DisconnectionEvent(value.DisconnectionEvent);
266
- if (value.ChallengeEvent !== undefined)
267
- return visitor.ChallengeEvent(value.ChallengeEvent);
268
- if (value.ValidationException !== undefined)
269
- return visitor.ValidationException(value.ValidationException);
270
- if (value.InternalServerException !== undefined)
271
- return visitor.InternalServerException(value.InternalServerException);
272
- if (value.ThrottlingException !== undefined)
273
- return visitor.ThrottlingException(value.ThrottlingException);
274
- if (value.ServiceQuotaExceededException !== undefined)
275
- return visitor.ServiceQuotaExceededException(value.ServiceQuotaExceededException);
276
- if (value.ServiceUnavailableException !== undefined)
277
- return visitor.ServiceUnavailableException(value.ServiceUnavailableException);
278
- return visitor._(value.$unknown[0], value.$unknown[1]);
279
- };
280
- })(exports.LivenessResponseStream || (exports.LivenessResponseStream = {}));
281
- class SessionNotFoundException extends RekognitionStreamingServiceException {
228
+ };
229
+ let SessionNotFoundException$1 = class SessionNotFoundException extends RekognitionStreamingServiceException$1 {
282
230
  name = "SessionNotFoundException";
283
231
  $fault = "client";
284
232
  Message;
@@ -293,493 +241,363 @@ class SessionNotFoundException extends RekognitionStreamingServiceException {
293
241
  this.Message = opts.Message;
294
242
  this.Code = opts.Code;
295
243
  }
296
- }
297
- const LivenessRequestStreamFilterSensitiveLog = (obj) => {
298
- if (obj.VideoEvent !== undefined)
299
- return { VideoEvent: obj.VideoEvent };
300
- if (obj.ClientSessionInformationEvent !== undefined)
301
- return { ClientSessionInformationEvent: obj.ClientSessionInformationEvent };
302
- if (obj.$unknown !== undefined)
303
- return { [obj.$unknown[0]]: "UNKNOWN" };
304
244
  };
305
- const LivenessResponseStreamFilterSensitiveLog = (obj) => {
306
- if (obj.ServerSessionInformationEvent !== undefined)
307
- return { ServerSessionInformationEvent: obj.ServerSessionInformationEvent };
308
- if (obj.DisconnectionEvent !== undefined)
309
- return { DisconnectionEvent: obj.DisconnectionEvent };
310
- if (obj.ChallengeEvent !== undefined)
311
- return { ChallengeEvent: obj.ChallengeEvent };
312
- if (obj.ValidationException !== undefined)
313
- return { ValidationException: obj.ValidationException };
314
- if (obj.InternalServerException !== undefined)
315
- return { InternalServerException: obj.InternalServerException };
316
- if (obj.ThrottlingException !== undefined)
317
- return { ThrottlingException: obj.ThrottlingException };
318
- if (obj.ServiceQuotaExceededException !== undefined)
319
- return { ServiceQuotaExceededException: obj.ServiceQuotaExceededException };
320
- if (obj.ServiceUnavailableException !== undefined)
321
- return { ServiceUnavailableException: obj.ServiceUnavailableException };
322
- if (obj.$unknown !== undefined)
323
- return { [obj.$unknown[0]]: "UNKNOWN" };
324
- };
325
- const StartFaceLivenessSessionRequestFilterSensitiveLog = (obj) => ({
326
- ...obj,
327
- ...(obj.LivenessRequestStream && { LivenessRequestStream: "STREAMING_CONTENT" }),
328
- });
329
- const StartFaceLivenessSessionResponseFilterSensitiveLog = (obj) => ({
330
- ...obj,
331
- ...(obj.LivenessResponseStream && { LivenessResponseStream: "STREAMING_CONTENT" }),
332
- });
333
245
 
334
- const se_StartFaceLivenessSessionCommand = async (input, context) => {
335
- const b = core.requestBuilder(input, context);
336
- const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
337
- "content-type": "application/json",
338
- [_xarslsi]: input[_SI],
339
- [_xarslvw]: input[_VW],
340
- [_xarslvh]: input[_VH],
341
- [_xarslcv]: input[_CV],
342
- });
343
- b.bp("/start-face-liveness-session");
344
- let body;
345
- if (input.LivenessRequestStream !== undefined) {
346
- body = se_LivenessRequestStream(input.LivenessRequestStream, context);
347
- }
348
- b.m("POST").h(headers).b(body);
349
- return b.build();
350
- };
351
- const de_StartFaceLivenessSessionCommand = async (output, context) => {
352
- if (output.statusCode !== 200 && output.statusCode >= 300) {
353
- return de_CommandError(output, context);
354
- }
355
- const contents = smithyClient.map({
356
- $metadata: deserializeMetadata(output),
357
- [_SI]: [, output.headers[_xarslsi]],
358
- });
359
- const data = output.body;
360
- contents.LivenessResponseStream = de_LivenessResponseStream(data, context);
361
- return contents;
362
- };
363
- const de_CommandError = async (output, context) => {
364
- const parsedOutput = {
365
- ...output,
366
- body: await core$1.parseJsonErrorBody(output.body, context),
367
- };
368
- const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
369
- switch (errorCode) {
370
- case "AccessDeniedException":
371
- case "com.amazonaws.rekognitionstreaming#AccessDeniedException":
372
- throw await de_AccessDeniedExceptionRes(parsedOutput);
373
- case "InternalServerException":
374
- case "com.amazonaws.rekognitionstreaming#InternalServerException":
375
- throw await de_InternalServerExceptionRes(parsedOutput);
376
- case "ServiceQuotaExceededException":
377
- case "com.amazonaws.rekognitionstreaming#ServiceQuotaExceededException":
378
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput);
379
- case "ServiceUnavailableException":
380
- case "com.amazonaws.rekognitionstreaming#ServiceUnavailableException":
381
- throw await de_ServiceUnavailableExceptionRes(parsedOutput);
382
- case "SessionNotFoundException":
383
- case "com.amazonaws.rekognitionstreaming#SessionNotFoundException":
384
- throw await de_SessionNotFoundExceptionRes(parsedOutput);
385
- case "ThrottlingException":
386
- case "com.amazonaws.rekognitionstreaming#ThrottlingException":
387
- throw await de_ThrottlingExceptionRes(parsedOutput);
388
- case "ValidationException":
389
- case "com.amazonaws.rekognitionstreaming#ValidationException":
390
- throw await de_ValidationExceptionRes(parsedOutput);
391
- default:
392
- const parsedBody = parsedOutput.body;
393
- return throwDefaultError({
394
- output,
395
- parsedBody,
396
- errorCode,
397
- });
398
- }
399
- };
400
- const throwDefaultError = smithyClient.withBaseException(RekognitionStreamingServiceException);
401
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
402
- const contents = smithyClient.map({});
403
- const data = parsedOutput.body;
404
- const doc = smithyClient.take(data, {
405
- Code: smithyClient.expectString,
406
- Message: smithyClient.expectString,
407
- });
408
- Object.assign(contents, doc);
409
- const exception = new AccessDeniedException({
410
- $metadata: deserializeMetadata(parsedOutput),
411
- ...contents,
412
- });
413
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
414
- };
415
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
416
- const contents = smithyClient.map({});
417
- const data = parsedOutput.body;
418
- const doc = smithyClient.take(data, {
419
- Code: smithyClient.expectString,
420
- Message: smithyClient.expectString,
421
- });
422
- Object.assign(contents, doc);
423
- const exception = new InternalServerException({
424
- $metadata: deserializeMetadata(parsedOutput),
425
- ...contents,
426
- });
427
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
428
- };
429
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
430
- const contents = smithyClient.map({});
431
- const data = parsedOutput.body;
432
- const doc = smithyClient.take(data, {
433
- Code: smithyClient.expectString,
434
- Message: smithyClient.expectString,
435
- });
436
- Object.assign(contents, doc);
437
- const exception = new ServiceQuotaExceededException({
438
- $metadata: deserializeMetadata(parsedOutput),
439
- ...contents,
440
- });
441
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
442
- };
443
- const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
444
- const contents = smithyClient.map({});
445
- const data = parsedOutput.body;
446
- const doc = smithyClient.take(data, {
447
- Code: smithyClient.expectString,
448
- Message: smithyClient.expectString,
449
- });
450
- Object.assign(contents, doc);
451
- const exception = new ServiceUnavailableException({
452
- $metadata: deserializeMetadata(parsedOutput),
453
- ...contents,
454
- });
455
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
456
- };
457
- const de_SessionNotFoundExceptionRes = async (parsedOutput, context) => {
458
- const contents = smithyClient.map({});
459
- const data = parsedOutput.body;
460
- const doc = smithyClient.take(data, {
461
- Code: smithyClient.expectString,
462
- Message: smithyClient.expectString,
463
- });
464
- Object.assign(contents, doc);
465
- const exception = new SessionNotFoundException({
466
- $metadata: deserializeMetadata(parsedOutput),
467
- ...contents,
468
- });
469
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
470
- };
471
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
472
- const contents = smithyClient.map({});
473
- const data = parsedOutput.body;
474
- const doc = smithyClient.take(data, {
475
- Code: smithyClient.expectString,
476
- Message: smithyClient.expectString,
477
- });
478
- Object.assign(contents, doc);
479
- const exception = new ThrottlingException({
480
- $metadata: deserializeMetadata(parsedOutput),
481
- ...contents,
482
- });
483
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
484
- };
485
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
486
- const contents = smithyClient.map({});
487
- const data = parsedOutput.body;
488
- const doc = smithyClient.take(data, {
489
- Code: smithyClient.expectString,
490
- Message: smithyClient.expectString,
491
- });
492
- Object.assign(contents, doc);
493
- const exception = new ValidationException({
494
- $metadata: deserializeMetadata(parsedOutput),
495
- ...contents,
496
- });
497
- return smithyClient.decorateServiceException(exception, parsedOutput.body);
498
- };
499
- const se_LivenessRequestStream = (input, context) => {
500
- const eventMarshallingVisitor = (event) => exports.LivenessRequestStream.visit(event, {
501
- VideoEvent: (value) => se_VideoEvent_event(value, context),
502
- ClientSessionInformationEvent: (value) => se_ClientSessionInformationEvent_event(value, context),
503
- _: (value) => value,
504
- });
505
- return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
506
- };
507
- const se_ClientSessionInformationEvent_event = (input, context) => {
508
- const headers = {
509
- ":event-type": { type: "string", value: "ClientSessionInformationEvent" },
510
- ":message-type": { type: "string", value: "event" },
511
- ":content-type": { type: "string", value: "application/json" },
512
- };
513
- let body = new Uint8Array();
514
- body = se_ClientSessionInformationEvent(input);
515
- body = context.utf8Decoder(JSON.stringify(body));
516
- return { headers, body };
517
- };
518
- const se_VideoEvent_event = (input, context) => {
519
- const headers = {
520
- ":event-type": { type: "string", value: "VideoEvent" },
521
- ":message-type": { type: "string", value: "event" },
522
- ":content-type": { type: "string", value: "application/json" },
523
- };
524
- let body = new Uint8Array();
525
- body = se_VideoEvent(input, context);
526
- body = context.utf8Decoder(JSON.stringify(body));
527
- return { headers, body };
528
- };
529
- const de_LivenessResponseStream = (output, context) => {
530
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
531
- if (event["ServerSessionInformationEvent"] != null) {
532
- return {
533
- ServerSessionInformationEvent: await de_ServerSessionInformationEvent_event(event["ServerSessionInformationEvent"], context),
534
- };
535
- }
536
- if (event["DisconnectionEvent"] != null) {
537
- return {
538
- DisconnectionEvent: await de_DisconnectionEvent_event(event["DisconnectionEvent"], context),
539
- };
540
- }
541
- if (event["ChallengeEvent"] != null) {
542
- return {
543
- ChallengeEvent: await de_ChallengeEvent_event(event["ChallengeEvent"], context),
544
- };
545
- }
546
- if (event["ValidationException"] != null) {
547
- return {
548
- ValidationException: await de_ValidationException_event(event["ValidationException"], context),
549
- };
550
- }
551
- if (event["InternalServerException"] != null) {
552
- return {
553
- InternalServerException: await de_InternalServerException_event(event["InternalServerException"], context),
554
- };
555
- }
556
- if (event["ThrottlingException"] != null) {
557
- return {
558
- ThrottlingException: await de_ThrottlingException_event(event["ThrottlingException"], context),
559
- };
560
- }
561
- if (event["ServiceQuotaExceededException"] != null) {
562
- return {
563
- ServiceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["ServiceQuotaExceededException"], context),
564
- };
565
- }
566
- if (event["ServiceUnavailableException"] != null) {
567
- return {
568
- ServiceUnavailableException: await de_ServiceUnavailableException_event(event["ServiceUnavailableException"], context),
569
- };
570
- }
571
- return { $unknown: event };
572
- });
573
- };
574
- const de_ChallengeEvent_event = async (output, context) => {
575
- const contents = {};
576
- const data = await core$1.parseJsonBody(output.body, context);
577
- Object.assign(contents, smithyClient._json(data));
578
- return contents;
579
- };
580
- const de_DisconnectionEvent_event = async (output, context) => {
581
- const contents = {};
582
- const data = await core$1.parseJsonBody(output.body, context);
583
- Object.assign(contents, smithyClient._json(data));
584
- return contents;
585
- };
586
- const de_InternalServerException_event = async (output, context) => {
587
- const parsedOutput = {
588
- ...output,
589
- body: await core$1.parseJsonBody(output.body, context),
590
- };
591
- return de_InternalServerExceptionRes(parsedOutput);
592
- };
593
- const de_ServerSessionInformationEvent_event = async (output, context) => {
594
- const contents = {};
595
- const data = await core$1.parseJsonBody(output.body, context);
596
- Object.assign(contents, de_ServerSessionInformationEvent(data));
597
- return contents;
598
- };
599
- const de_ServiceQuotaExceededException_event = async (output, context) => {
600
- const parsedOutput = {
601
- ...output,
602
- body: await core$1.parseJsonBody(output.body, context),
603
- };
604
- return de_ServiceQuotaExceededExceptionRes(parsedOutput);
605
- };
606
- const de_ServiceUnavailableException_event = async (output, context) => {
607
- const parsedOutput = {
608
- ...output,
609
- body: await core$1.parseJsonBody(output.body, context),
610
- };
611
- return de_ServiceUnavailableExceptionRes(parsedOutput);
612
- };
613
- const de_ThrottlingException_event = async (output, context) => {
614
- const parsedOutput = {
615
- ...output,
616
- body: await core$1.parseJsonBody(output.body, context),
617
- };
618
- return de_ThrottlingExceptionRes(parsedOutput);
619
- };
620
- const de_ValidationException_event = async (output, context) => {
621
- const parsedOutput = {
622
- ...output,
623
- body: await core$1.parseJsonBody(output.body, context),
624
- };
625
- return de_ValidationExceptionRes(parsedOutput);
626
- };
627
- const se_BoundingBox = (input, context) => {
628
- return smithyClient.take(input, {
629
- Height: smithyClient.serializeFloat,
630
- Left: smithyClient.serializeFloat,
631
- Top: smithyClient.serializeFloat,
632
- Width: smithyClient.serializeFloat,
633
- });
634
- };
635
- const se_ClientChallenge = (input, context) => {
636
- return exports.ClientChallenge.visit(input, {
637
- FaceMovementAndLightChallenge: (value) => ({
638
- FaceMovementAndLightChallenge: se_FaceMovementAndLightClientChallenge(value),
639
- }),
640
- FaceMovementChallenge: (value) => ({ FaceMovementChallenge: se_FaceMovementClientChallenge(value) }),
641
- _: (name, value) => ({ [name]: value }),
642
- });
643
- };
644
- const se_ClientSessionInformationEvent = (input, context) => {
645
- return smithyClient.take(input, {
646
- Challenge: (_) => se_ClientChallenge(_),
647
- });
648
- };
649
- const se_FaceMovementAndLightClientChallenge = (input, context) => {
650
- return smithyClient.take(input, {
651
- ChallengeId: [],
652
- ColorDisplayed: smithyClient._json,
653
- InitialFace: (_) => se_InitialFace(_),
654
- TargetFace: (_) => se_TargetFace(_),
655
- VideoEndTimestamp: [],
656
- VideoStartTimestamp: [],
657
- });
658
- };
659
- const se_FaceMovementClientChallenge = (input, context) => {
660
- return smithyClient.take(input, {
661
- ChallengeId: [],
662
- InitialFace: (_) => se_InitialFace(_),
663
- TargetFace: (_) => se_TargetFace(_),
664
- VideoEndTimestamp: [],
665
- VideoStartTimestamp: [],
666
- });
667
- };
668
- const se_InitialFace = (input, context) => {
669
- return smithyClient.take(input, {
670
- BoundingBox: (_) => se_BoundingBox(_),
671
- InitialFaceDetectedTimestamp: [],
672
- });
673
- };
674
- const se_TargetFace = (input, context) => {
675
- return smithyClient.take(input, {
676
- BoundingBox: (_) => se_BoundingBox(_),
677
- FaceDetectedInTargetPositionEndTimestamp: [],
678
- FaceDetectedInTargetPositionStartTimestamp: [],
679
- });
680
- };
681
- const se_VideoEvent = (input, context) => {
682
- return smithyClient.take(input, {
683
- TimestampMillis: [],
684
- VideoChunk: context.base64Encoder,
685
- });
686
- };
687
- const de_ChallengeConfig = (output, context) => {
688
- return smithyClient.take(output, {
689
- BlazeFaceDetectionThreshold: smithyClient.limitedParseFloat32,
690
- FaceDistanceThreshold: smithyClient.limitedParseFloat32,
691
- FaceDistanceThresholdMax: smithyClient.limitedParseFloat32,
692
- FaceDistanceThresholdMin: smithyClient.limitedParseFloat32,
693
- FaceIouHeightThreshold: smithyClient.limitedParseFloat32,
694
- FaceIouWidthThreshold: smithyClient.limitedParseFloat32,
695
- OvalFitTimeout: smithyClient.expectInt32,
696
- OvalHeightWidthRatio: smithyClient.limitedParseFloat32,
697
- OvalIouHeightThreshold: smithyClient.limitedParseFloat32,
698
- OvalIouThreshold: smithyClient.limitedParseFloat32,
699
- OvalIouWidthThreshold: smithyClient.limitedParseFloat32,
700
- });
701
- };
702
- const de_ColorSequence = (output, context) => {
703
- return smithyClient.take(output, {
704
- DownscrollDuration: smithyClient.limitedParseFloat32,
705
- FlatDisplayDuration: smithyClient.limitedParseFloat32,
706
- FreshnessColor: smithyClient._json,
707
- });
708
- };
709
- const de_ColorSequences = (output, context) => {
710
- const retVal = (output || [])
711
- .filter((e) => e != null)
712
- .map((entry) => {
713
- return de_ColorSequence(entry);
714
- });
715
- return retVal;
716
- };
717
- const de_FaceMovementAndLightServerChallenge = (output, context) => {
718
- return smithyClient.take(output, {
719
- ChallengeConfig: (_) => de_ChallengeConfig(_),
720
- ColorSequences: (_) => de_ColorSequences(_),
721
- LightChallengeType: smithyClient.expectString,
722
- OvalParameters: (_) => de_OvalParameters(_),
723
- });
724
- };
725
- const de_FaceMovementServerChallenge = (output, context) => {
726
- return smithyClient.take(output, {
727
- ChallengeConfig: (_) => de_ChallengeConfig(_),
728
- OvalParameters: (_) => de_OvalParameters(_),
729
- });
730
- };
731
- const de_OvalParameters = (output, context) => {
732
- return smithyClient.take(output, {
733
- CenterX: smithyClient.limitedParseFloat32,
734
- CenterY: smithyClient.limitedParseFloat32,
735
- Height: smithyClient.limitedParseFloat32,
736
- Width: smithyClient.limitedParseFloat32,
737
- });
738
- };
739
- const de_ServerChallenge = (output, context) => {
740
- if (output.FaceMovementAndLightChallenge != null) {
741
- return {
742
- FaceMovementAndLightChallenge: de_FaceMovementAndLightServerChallenge(output.FaceMovementAndLightChallenge),
743
- };
744
- }
745
- if (output.FaceMovementChallenge != null) {
746
- return {
747
- FaceMovementChallenge: de_FaceMovementServerChallenge(output.FaceMovementChallenge),
748
- };
749
- }
750
- return { $unknown: Object.entries(output)[0] };
751
- };
752
- const de_ServerSessionInformationEvent = (output, context) => {
753
- return smithyClient.take(output, {
754
- SessionInformation: (_) => de_SessionInformation(_),
755
- });
756
- };
757
- const de_SessionInformation = (output, context) => {
758
- return smithyClient.take(output, {
759
- Challenge: (_) => de_ServerChallenge(core$1.awsExpectUnion(_)),
760
- });
761
- };
762
- const deserializeMetadata = (output) => ({
763
- httpStatusCode: output.statusCode,
764
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
765
- extendedRequestId: output.headers["x-amz-id-2"],
766
- cfId: output.headers["x-amz-cf-id"],
767
- });
246
+ const _ADE = "AccessDeniedException";
247
+ const _BB = "BoundingBox";
248
+ const _BFDT = "BlazeFaceDetectionThreshold";
249
+ const _C = "Code";
250
+ const _CC = "ChallengeConfig";
251
+ const _CCST = "CurrentColorStartTimestamp";
252
+ const _CCl = "ClientChallenge";
253
+ const _CCu = "CurrentColor";
254
+ const _CD = "ColorDisplayed";
255
+ const _CE = "ChallengeEvent";
256
+ const _CI = "ChallengeId";
257
+ const _CS = "ColorSequence";
258
+ const _CSIE = "ClientSessionInformationEvent";
259
+ const _CSo = "ColorSequences";
768
260
  const _CV = "ChallengeVersions";
769
- const _SI = "SessionId";
261
+ const _CX = "CenterX";
262
+ const _CY = "CenterY";
263
+ const _Ch = "Challenge";
264
+ const _DD = "DownscrollDuration";
265
+ const _DE = "DisconnectionEvent";
266
+ const _FC = "FreshnessColor";
267
+ const _FDD = "FlatDisplayDuration";
268
+ const _FDITPET = "FaceDetectedInTargetPositionEndTimestamp";
269
+ const _FDITPST = "FaceDetectedInTargetPositionStartTimestamp";
270
+ const _FDT = "FaceDistanceThreshold";
271
+ const _FDTM = "FaceDistanceThresholdMin";
272
+ const _FDTMa = "FaceDistanceThresholdMax";
273
+ const _FIHT = "FaceIouHeightThreshold";
274
+ const _FIWT = "FaceIouWidthThreshold";
275
+ const _FMALC = "FaceMovementAndLightChallenge";
276
+ const _FMALCC = "FaceMovementAndLightClientChallenge";
277
+ const _FMALSC = "FaceMovementAndLightServerChallenge";
278
+ const _FMC = "FaceMovementChallenge";
279
+ const _FMCC = "FaceMovementClientChallenge";
280
+ const _FMSC = "FaceMovementServerChallenge";
281
+ const _H = "Height";
282
+ const _IF = "InitialFace";
283
+ const _IFDT = "InitialFaceDetectedTimestamp";
284
+ const _ISE = "InternalServerException";
285
+ const _L = "Left";
286
+ const _LCT = "LightChallengeType";
287
+ const _LRS = "LivenessRequestStream";
288
+ const _LRSi = "LivenessResponseStream";
289
+ const _M = "Message";
290
+ const _OFT = "OvalFitTimeout";
291
+ const _OHWR = "OvalHeightWidthRatio";
292
+ const _OIHT = "OvalIouHeightThreshold";
293
+ const _OIT = "OvalIouThreshold";
294
+ const _OIWT = "OvalIouWidthThreshold";
295
+ const _OP = "OvalParameters";
296
+ const _PC = "PreviousColor";
297
+ const _RGB = "RGB";
298
+ const _SC = "ServerChallenge";
299
+ const _SFLS = "StartFaceLivenessSession";
300
+ const _SFLSR = "StartFaceLivenessSessionRequest";
301
+ const _SFLSRt = "StartFaceLivenessSessionResponse";
302
+ const _SI = "SessionInformation";
303
+ const _SIe = "SessionId";
304
+ const _SN = "SequenceNumber";
305
+ const _SNFE = "SessionNotFoundException";
306
+ const _SQEE = "ServiceQuotaExceededException";
307
+ const _SSIE = "ServerSessionInformationEvent";
308
+ const _SUE = "ServiceUnavailableException";
309
+ const _T = "Top";
310
+ const _TE = "ThrottlingException";
311
+ const _TF = "TargetFace";
312
+ const _TM = "TimestampMillis";
313
+ const _Ty = "Type";
314
+ const _V = "Version";
315
+ const _VC = "VideoChunk";
316
+ const _VE = "ValidationException";
317
+ const _VET = "VideoEndTimestamp";
318
+ const _VEi = "VideoEvent";
770
319
  const _VH = "VideoHeight";
320
+ const _VST = "VideoStartTimestamp";
771
321
  const _VW = "VideoWidth";
322
+ const _W = "Width";
323
+ const _c = "client";
324
+ const _e = "error";
325
+ const _h = "http";
326
+ const _hE = "httpError";
327
+ const _hH = "httpHeader";
328
+ const _s = "server";
329
+ const _sm = "smithy.ts.sdk.synthetic.com.amazonaws.rekognitionstreaming";
330
+ const _st = "streaming";
772
331
  const _xarslcv = "x-amz-rekognition-streaming-liveness-challenge-versions";
773
332
  const _xarslsi = "x-amz-rekognition-streaming-liveness-session-id";
774
333
  const _xarslvh = "x-amz-rekognition-streaming-liveness-video-height";
775
334
  const _xarslvw = "x-amz-rekognition-streaming-liveness-video-width";
335
+ const n0 = "com.amazonaws.rekognitionstreaming";
336
+ var AccessDeniedException = [
337
+ -3,
338
+ n0,
339
+ _ADE,
340
+ {
341
+ [_e]: _c,
342
+ [_hE]: 403,
343
+ },
344
+ [_M, _C],
345
+ [0, 0],
346
+ ];
347
+ schema.TypeRegistry.for(n0).registerError(AccessDeniedException, AccessDeniedException$1);
348
+ var BoundingBox = [3, n0, _BB, 0, [_W, _H, _L, _T], [1, 1, 1, 1]];
349
+ var ChallengeConfig = [
350
+ 3,
351
+ n0,
352
+ _CC,
353
+ 0,
354
+ [_BFDT, _FDTM, _FDT, _FDTMa, _OIT, _OHWR, _OIWT, _OIHT, _FIWT, _FIHT, _OFT],
355
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
356
+ ];
357
+ var ChallengeEvent = [3, n0, _CE, 0, [_V, _Ty], [0, 0]];
358
+ var ClientSessionInformationEvent = [3, n0, _CSIE, 0, [_Ch], [() => ClientChallenge]];
359
+ var ColorDisplayed = [
360
+ 3,
361
+ n0,
362
+ _CD,
363
+ 0,
364
+ [_CCu, _PC, _SN, _CCST],
365
+ [() => FreshnessColor, () => FreshnessColor, 1, 1],
366
+ ];
367
+ var ColorSequence = [3, n0, _CS, 0, [_FC, _DD, _FDD], [() => FreshnessColor, 1, 1]];
368
+ var DisconnectionEvent = [3, n0, _DE, 0, [_TM], [1]];
369
+ var FaceMovementAndLightClientChallenge = [
370
+ 3,
371
+ n0,
372
+ _FMALCC,
373
+ 0,
374
+ [_CI, _VST, _VET, _IF, _TF, _CD],
375
+ [0, 1, 1, () => InitialFace, () => TargetFace, () => ColorDisplayed],
376
+ ];
377
+ var FaceMovementAndLightServerChallenge = [
378
+ 3,
379
+ n0,
380
+ _FMALSC,
381
+ 0,
382
+ [_OP, _LCT, _CC, _CSo],
383
+ [() => OvalParameters, 0, () => ChallengeConfig, () => ColorSequences],
384
+ ];
385
+ var FaceMovementClientChallenge = [
386
+ 3,
387
+ n0,
388
+ _FMCC,
389
+ 0,
390
+ [_CI, _VST, _VET, _IF, _TF],
391
+ [0, 1, 1, () => InitialFace, () => TargetFace],
392
+ ];
393
+ var FaceMovementServerChallenge = [
394
+ 3,
395
+ n0,
396
+ _FMSC,
397
+ 0,
398
+ [_OP, _CC],
399
+ [() => OvalParameters, () => ChallengeConfig],
400
+ ];
401
+ var FreshnessColor = [3, n0, _FC, 0, [_RGB], [64 | 1]];
402
+ var InitialFace = [3, n0, _IF, 0, [_BB, _IFDT], [() => BoundingBox, 1]];
403
+ var InternalServerException = [
404
+ -3,
405
+ n0,
406
+ _ISE,
407
+ {
408
+ [_e]: _s,
409
+ [_hE]: 500,
410
+ },
411
+ [_M, _C],
412
+ [0, 0],
413
+ ];
414
+ schema.TypeRegistry.for(n0).registerError(InternalServerException, InternalServerException$1);
415
+ var OvalParameters = [3, n0, _OP, 0, [_W, _H, _CX, _CY], [1, 1, 1, 1]];
416
+ var ServerSessionInformationEvent = [3, n0, _SSIE, 0, [_SI], [() => SessionInformation]];
417
+ var ServiceQuotaExceededException = [
418
+ -3,
419
+ n0,
420
+ _SQEE,
421
+ {
422
+ [_e]: _c,
423
+ [_hE]: 429,
424
+ },
425
+ [_M, _C],
426
+ [0, 0],
427
+ ];
428
+ schema.TypeRegistry.for(n0).registerError(ServiceQuotaExceededException, ServiceQuotaExceededException$1);
429
+ var ServiceUnavailableException = [
430
+ -3,
431
+ n0,
432
+ _SUE,
433
+ {
434
+ [_e]: _s,
435
+ [_hE]: 503,
436
+ },
437
+ [_M, _C],
438
+ [0, 0],
439
+ ];
440
+ schema.TypeRegistry.for(n0).registerError(ServiceUnavailableException, ServiceUnavailableException$1);
441
+ var SessionInformation = [3, n0, _SI, 0, [_Ch], [() => ServerChallenge]];
442
+ var SessionNotFoundException = [
443
+ -3,
444
+ n0,
445
+ _SNFE,
446
+ {
447
+ [_e]: _c,
448
+ [_hE]: 400,
449
+ },
450
+ [_M, _C],
451
+ [0, 0],
452
+ ];
453
+ schema.TypeRegistry.for(n0).registerError(SessionNotFoundException, SessionNotFoundException$1);
454
+ var StartFaceLivenessSessionRequest = [
455
+ 3,
456
+ n0,
457
+ _SFLSR,
458
+ 0,
459
+ [_SIe, _VW, _VH, _CV, _LRS],
460
+ [
461
+ [
462
+ 0,
463
+ {
464
+ [_hH]: _xarslsi,
465
+ },
466
+ ],
467
+ [
468
+ 0,
469
+ {
470
+ [_hH]: _xarslvw,
471
+ },
472
+ ],
473
+ [
474
+ 0,
475
+ {
476
+ [_hH]: _xarslvh,
477
+ },
478
+ ],
479
+ [
480
+ 0,
481
+ {
482
+ [_hH]: _xarslcv,
483
+ },
484
+ ],
485
+ [() => LivenessRequestStream, 16],
486
+ ],
487
+ ];
488
+ var StartFaceLivenessSessionResponse = [
489
+ 3,
490
+ n0,
491
+ _SFLSRt,
492
+ 0,
493
+ [_SIe, _LRSi],
494
+ [
495
+ [
496
+ 0,
497
+ {
498
+ [_hH]: _xarslsi,
499
+ },
500
+ ],
501
+ [() => LivenessResponseStream, 16],
502
+ ],
503
+ ];
504
+ var TargetFace = [3, n0, _TF, 0, [_BB, _FDITPST, _FDITPET], [() => BoundingBox, 1, 1]];
505
+ var ThrottlingException = [
506
+ -3,
507
+ n0,
508
+ _TE,
509
+ {
510
+ [_e]: _c,
511
+ [_hE]: 429,
512
+ },
513
+ [_M, _C],
514
+ [0, 0],
515
+ ];
516
+ schema.TypeRegistry.for(n0).registerError(ThrottlingException, ThrottlingException$1);
517
+ var ValidationException = [
518
+ -3,
519
+ n0,
520
+ _VE,
521
+ {
522
+ [_e]: _c,
523
+ [_hE]: 400,
524
+ },
525
+ [_M, _C],
526
+ [0, 0],
527
+ ];
528
+ schema.TypeRegistry.for(n0).registerError(ValidationException, ValidationException$1);
529
+ var VideoEvent = [3, n0, _VEi, 0, [_VC, _TM], [21, 1]];
530
+ var RekognitionStreamingServiceException = [
531
+ -3,
532
+ _sm,
533
+ "RekognitionStreamingServiceException",
534
+ 0,
535
+ [],
536
+ [],
537
+ ];
538
+ schema.TypeRegistry.for(_sm).registerError(RekognitionStreamingServiceException, RekognitionStreamingServiceException$1);
539
+ var ColorSequences = [1, n0, _CSo, 0, () => ColorSequence];
540
+ var ClientChallenge = [
541
+ 3,
542
+ n0,
543
+ _CCl,
544
+ 0,
545
+ [_FMALC, _FMC],
546
+ [() => FaceMovementAndLightClientChallenge, () => FaceMovementClientChallenge],
547
+ ];
548
+ var LivenessRequestStream = [
549
+ 3,
550
+ n0,
551
+ _LRS,
552
+ {
553
+ [_st]: 1,
554
+ },
555
+ [_VEi, _CSIE],
556
+ [() => VideoEvent, () => ClientSessionInformationEvent],
557
+ ];
558
+ var LivenessResponseStream = [
559
+ 3,
560
+ n0,
561
+ _LRSi,
562
+ {
563
+ [_st]: 1,
564
+ },
565
+ [_SSIE, _DE, _CE, _VE, _ISE, _TE, _SQEE, _SUE],
566
+ [
567
+ () => ServerSessionInformationEvent,
568
+ () => DisconnectionEvent,
569
+ () => ChallengeEvent,
570
+ [() => ValidationException, 0],
571
+ [() => InternalServerException, 0],
572
+ [() => ThrottlingException, 0],
573
+ [() => ServiceQuotaExceededException, 0],
574
+ [() => ServiceUnavailableException, 0],
575
+ ],
576
+ ];
577
+ var ServerChallenge = [
578
+ 3,
579
+ n0,
580
+ _SC,
581
+ 0,
582
+ [_FMALC, _FMC],
583
+ [() => FaceMovementAndLightServerChallenge, () => FaceMovementServerChallenge],
584
+ ];
585
+ var StartFaceLivenessSession = [
586
+ 9,
587
+ n0,
588
+ _SFLS,
589
+ {
590
+ [_h]: ["POST", "/start-face-liveness-session", 200],
591
+ },
592
+ () => StartFaceLivenessSessionRequest,
593
+ () => StartFaceLivenessSessionResponse,
594
+ ];
776
595
 
777
596
  class StartFaceLivenessSessionCommand extends smithyClient.Command
778
597
  .classBuilder()
779
598
  .ep(commonParams)
780
599
  .m(function (Command, cs, config, o) {
781
600
  return [
782
- middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
783
601
  middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
784
602
  middlewareEventstream.getEventStreamPlugin(config),
785
603
  middlewareWebsocket.getWebSocketPlugin(config, {
@@ -794,9 +612,7 @@ class StartFaceLivenessSessionCommand extends smithyClient.Command
794
612
  },
795
613
  })
796
614
  .n("RekognitionStreamingClient", "StartFaceLivenessSessionCommand")
797
- .f(StartFaceLivenessSessionRequestFilterSensitiveLog, StartFaceLivenessSessionResponseFilterSensitiveLog)
798
- .ser(se_StartFaceLivenessSessionCommand)
799
- .de(de_StartFaceLivenessSessionCommand)
615
+ .sc(StartFaceLivenessSession)
800
616
  .build() {
801
617
  }
802
618
 
@@ -815,20 +631,16 @@ Object.defineProperty(exports, "__Client", {
815
631
  enumerable: true,
816
632
  get: function () { return smithyClient.Client; }
817
633
  });
818
- exports.AccessDeniedException = AccessDeniedException;
634
+ exports.AccessDeniedException = AccessDeniedException$1;
819
635
  exports.ChallengeType = ChallengeType;
820
- exports.InternalServerException = InternalServerException;
636
+ exports.InternalServerException = InternalServerException$1;
821
637
  exports.LightChallengeType = LightChallengeType;
822
- exports.LivenessRequestStreamFilterSensitiveLog = LivenessRequestStreamFilterSensitiveLog;
823
- exports.LivenessResponseStreamFilterSensitiveLog = LivenessResponseStreamFilterSensitiveLog;
824
638
  exports.RekognitionStreaming = RekognitionStreaming;
825
639
  exports.RekognitionStreamingClient = RekognitionStreamingClient;
826
- exports.RekognitionStreamingServiceException = RekognitionStreamingServiceException;
827
- exports.ServiceQuotaExceededException = ServiceQuotaExceededException;
828
- exports.ServiceUnavailableException = ServiceUnavailableException;
829
- exports.SessionNotFoundException = SessionNotFoundException;
640
+ exports.RekognitionStreamingServiceException = RekognitionStreamingServiceException$1;
641
+ exports.ServiceQuotaExceededException = ServiceQuotaExceededException$1;
642
+ exports.ServiceUnavailableException = ServiceUnavailableException$1;
643
+ exports.SessionNotFoundException = SessionNotFoundException$1;
830
644
  exports.StartFaceLivenessSessionCommand = StartFaceLivenessSessionCommand;
831
- exports.StartFaceLivenessSessionRequestFilterSensitiveLog = StartFaceLivenessSessionRequestFilterSensitiveLog;
832
- exports.StartFaceLivenessSessionResponseFilterSensitiveLog = StartFaceLivenessSessionResponseFilterSensitiveLog;
833
- exports.ThrottlingException = ThrottlingException;
834
- exports.ValidationException = ValidationException;
645
+ exports.ThrottlingException = ThrottlingException$1;
646
+ exports.ValidationException = ValidationException$1;