@aws-sdk/client-rekognitionstreaming 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 +9 -50
- package/dist-es/protocols/Aws_restJson1.js +1 -41
- package/package.json +4 -4
package/dist-cjs/index.js
CHANGED
|
@@ -416,9 +416,9 @@ var de_StartFaceLivenessSessionCommand = /* @__PURE__ */ __name(async (output, c
|
|
|
416
416
|
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
417
417
|
const parsedOutput = {
|
|
418
418
|
...output,
|
|
419
|
-
body: await
|
|
419
|
+
body: await (0, import_core.parseJsonErrorBody)(output.body, context)
|
|
420
420
|
};
|
|
421
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
421
|
+
const errorCode = (0, import_core.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
422
422
|
switch (errorCode) {
|
|
423
423
|
case "AccessDeniedException":
|
|
424
424
|
case "com.amazonaws.rekognitionstreaming#AccessDeniedException":
|
|
@@ -630,48 +630,48 @@ var de_LivenessResponseStream = /* @__PURE__ */ __name((output, context) => {
|
|
|
630
630
|
}, "de_LivenessResponseStream");
|
|
631
631
|
var de_DisconnectionEvent_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
632
632
|
const contents = {};
|
|
633
|
-
const data = await
|
|
633
|
+
const data = await (0, import_core.parseJsonBody)(output.body, context);
|
|
634
634
|
Object.assign(contents, (0, import_smithy_client._json)(data));
|
|
635
635
|
return contents;
|
|
636
636
|
}, "de_DisconnectionEvent_event");
|
|
637
637
|
var de_InternalServerException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
638
638
|
const parsedOutput = {
|
|
639
639
|
...output,
|
|
640
|
-
body: await
|
|
640
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
641
641
|
};
|
|
642
642
|
return de_InternalServerExceptionRes(parsedOutput, context);
|
|
643
643
|
}, "de_InternalServerException_event");
|
|
644
644
|
var de_ServerSessionInformationEvent_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
645
645
|
const contents = {};
|
|
646
|
-
const data = await
|
|
646
|
+
const data = await (0, import_core.parseJsonBody)(output.body, context);
|
|
647
647
|
Object.assign(contents, de_ServerSessionInformationEvent(data, context));
|
|
648
648
|
return contents;
|
|
649
649
|
}, "de_ServerSessionInformationEvent_event");
|
|
650
650
|
var de_ServiceQuotaExceededException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
651
651
|
const parsedOutput = {
|
|
652
652
|
...output,
|
|
653
|
-
body: await
|
|
653
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
654
654
|
};
|
|
655
655
|
return de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
656
656
|
}, "de_ServiceQuotaExceededException_event");
|
|
657
657
|
var de_ServiceUnavailableException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
658
658
|
const parsedOutput = {
|
|
659
659
|
...output,
|
|
660
|
-
body: await
|
|
660
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
661
661
|
};
|
|
662
662
|
return de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
663
663
|
}, "de_ServiceUnavailableException_event");
|
|
664
664
|
var de_ThrottlingException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
665
665
|
const parsedOutput = {
|
|
666
666
|
...output,
|
|
667
|
-
body: await
|
|
667
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
668
668
|
};
|
|
669
669
|
return de_ThrottlingExceptionRes(parsedOutput, context);
|
|
670
670
|
}, "de_ThrottlingException_event");
|
|
671
671
|
var de_ValidationException_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
672
672
|
const parsedOutput = {
|
|
673
673
|
...output,
|
|
674
|
-
body: await
|
|
674
|
+
body: await (0, import_core.parseJsonBody)(output.body, context)
|
|
675
675
|
};
|
|
676
676
|
return de_ValidationExceptionRes(parsedOutput, context);
|
|
677
677
|
}, "de_ValidationException_event");
|
|
@@ -796,7 +796,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
|
796
796
|
extendedRequestId: output.headers["x-amz-id-2"],
|
|
797
797
|
cfId: output.headers["x-amz-cf-id"]
|
|
798
798
|
}), "deserializeMetadata");
|
|
799
|
-
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
800
799
|
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");
|
|
801
800
|
var _CV = "ChallengeVersions";
|
|
802
801
|
var _SI = "SessionId";
|
|
@@ -806,46 +805,6 @@ var _xarslcv = "x-amz-rekognition-streaming-liveness-challenge-versions";
|
|
|
806
805
|
var _xarslsi = "x-amz-rekognition-streaming-liveness-session-id";
|
|
807
806
|
var _xarslvh = "x-amz-rekognition-streaming-liveness-video-height";
|
|
808
807
|
var _xarslvw = "x-amz-rekognition-streaming-liveness-video-width";
|
|
809
|
-
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
810
|
-
if (encoded.length) {
|
|
811
|
-
return JSON.parse(encoded);
|
|
812
|
-
}
|
|
813
|
-
return {};
|
|
814
|
-
}), "parseBody");
|
|
815
|
-
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
816
|
-
const value = await parseBody(errorBody, context);
|
|
817
|
-
value.message = value.message ?? value.Message;
|
|
818
|
-
return value;
|
|
819
|
-
}, "parseErrorBody");
|
|
820
|
-
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
821
|
-
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
822
|
-
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
823
|
-
let cleanValue = rawValue;
|
|
824
|
-
if (typeof cleanValue === "number") {
|
|
825
|
-
cleanValue = cleanValue.toString();
|
|
826
|
-
}
|
|
827
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
828
|
-
cleanValue = cleanValue.split(",")[0];
|
|
829
|
-
}
|
|
830
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
831
|
-
cleanValue = cleanValue.split(":")[0];
|
|
832
|
-
}
|
|
833
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
834
|
-
cleanValue = cleanValue.split("#")[1];
|
|
835
|
-
}
|
|
836
|
-
return cleanValue;
|
|
837
|
-
}, "sanitizeErrorCode");
|
|
838
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
839
|
-
if (headerKey !== void 0) {
|
|
840
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
841
|
-
}
|
|
842
|
-
if (data.code !== void 0) {
|
|
843
|
-
return sanitizeErrorCode(data.code);
|
|
844
|
-
}
|
|
845
|
-
if (data["__type"] !== void 0) {
|
|
846
|
-
return sanitizeErrorCode(data["__type"]);
|
|
847
|
-
}
|
|
848
|
-
}, "loadRestJsonErrorCode");
|
|
849
808
|
|
|
850
809
|
// src/commands/StartFaceLivenessSessionCommand.ts
|
|
851
810
|
var _StartFaceLivenessSessionCommand = class _StartFaceLivenessSessionCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
|
|
1
|
+
import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
2
2
|
import { requestBuilder as rb } from "@smithy/core";
|
|
3
3
|
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
4
|
import { AccessDeniedException, ClientChallenge, InternalServerException, LivenessRequestStream, ServiceQuotaExceededException, ServiceUnavailableException, SessionNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
@@ -418,43 +418,3 @@ const _xarslcv = "x-amz-rekognition-streaming-liveness-challenge-versions";
|
|
|
418
418
|
const _xarslsi = "x-amz-rekognition-streaming-liveness-session-id";
|
|
419
419
|
const _xarslvh = "x-amz-rekognition-streaming-liveness-video-height";
|
|
420
420
|
const _xarslvw = "x-amz-rekognition-streaming-liveness-video-width";
|
|
421
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
422
|
-
if (encoded.length) {
|
|
423
|
-
return JSON.parse(encoded);
|
|
424
|
-
}
|
|
425
|
-
return {};
|
|
426
|
-
});
|
|
427
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
428
|
-
const value = await parseBody(errorBody, context);
|
|
429
|
-
value.message = value.message ?? value.Message;
|
|
430
|
-
return value;
|
|
431
|
-
};
|
|
432
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
433
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
434
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
435
|
-
let cleanValue = rawValue;
|
|
436
|
-
if (typeof cleanValue === "number") {
|
|
437
|
-
cleanValue = cleanValue.toString();
|
|
438
|
-
}
|
|
439
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
440
|
-
cleanValue = cleanValue.split(",")[0];
|
|
441
|
-
}
|
|
442
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
443
|
-
cleanValue = cleanValue.split(":")[0];
|
|
444
|
-
}
|
|
445
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
446
|
-
cleanValue = cleanValue.split("#")[1];
|
|
447
|
-
}
|
|
448
|
-
return cleanValue;
|
|
449
|
-
};
|
|
450
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
451
|
-
if (headerKey !== undefined) {
|
|
452
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
453
|
-
}
|
|
454
|
-
if (data.code !== undefined) {
|
|
455
|
-
return sanitizeErrorCode(data.code);
|
|
456
|
-
}
|
|
457
|
-
if (data["__type"] !== undefined) {
|
|
458
|
-
return sanitizeErrorCode(data["__type"]);
|
|
459
|
-
}
|
|
460
|
-
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-rekognitionstreaming",
|
|
3
3
|
"description": "AWS SDK for JavaScript Rekognitionstreaming 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-rekognitionstreaming",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
22
22
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
23
|
-
"@aws-sdk/client-sts": "3.
|
|
24
|
-
"@aws-sdk/core": "3.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
23
|
+
"@aws-sdk/client-sts": "3.529.0",
|
|
24
|
+
"@aws-sdk/core": "3.529.0",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "3.529.0",
|
|
26
26
|
"@aws-sdk/eventstream-handler-node": "3.523.0",
|
|
27
27
|
"@aws-sdk/middleware-eventstream": "3.523.0",
|
|
28
28
|
"@aws-sdk/middleware-host-header": "3.523.0",
|