@aws-sdk/client-rekognitionstreaming 3.490.0 → 3.496.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/RekognitionStreaming.js +1 -13
- package/dist-cjs/RekognitionStreamingClient.js +1 -49
- package/dist-cjs/commands/StartFaceLivenessSessionCommand.js +1 -38
- package/dist-cjs/commands/index.js +1 -4
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +911 -10
- package/dist-cjs/models/RekognitionStreamingServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -196
- package/dist-cjs/protocols/Aws_restJson1.js +1 -465
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/package.json +46 -46
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RekognitionStreamingServiceException = exports.__ServiceException = void 0;
|
|
4
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
-
Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
|
|
6
|
-
class RekognitionStreamingServiceException extends smithy_client_1.ServiceException {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
super(options);
|
|
9
|
-
Object.setPrototypeOf(this, RekognitionStreamingServiceException.prototype);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.RekognitionStreamingServiceException = RekognitionStreamingServiceException;
|
|
1
|
+
module.exports = require("../index.js");
|
package/dist-cjs/models/index.js
CHANGED
|
@@ -1,196 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StartFaceLivenessSessionResponseFilterSensitiveLog = exports.StartFaceLivenessSessionRequestFilterSensitiveLog = exports.LivenessResponseStreamFilterSensitiveLog = exports.LivenessRequestStreamFilterSensitiveLog = exports.SessionNotFoundException = exports.LivenessResponseStream = exports.ValidationException = exports.ThrottlingException = exports.ServiceUnavailableException = exports.ServiceQuotaExceededException = exports.ServerChallenge = exports.LivenessRequestStream = exports.InternalServerException = exports.LightChallengeType = exports.ClientChallenge = exports.AccessDeniedException = void 0;
|
|
4
|
-
const RekognitionStreamingServiceException_1 = require("./RekognitionStreamingServiceException");
|
|
5
|
-
class AccessDeniedException extends RekognitionStreamingServiceException_1.RekognitionStreamingServiceException {
|
|
6
|
-
constructor(opts) {
|
|
7
|
-
super({
|
|
8
|
-
name: "AccessDeniedException",
|
|
9
|
-
$fault: "client",
|
|
10
|
-
...opts,
|
|
11
|
-
});
|
|
12
|
-
this.name = "AccessDeniedException";
|
|
13
|
-
this.$fault = "client";
|
|
14
|
-
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
15
|
-
this.Message = opts.Message;
|
|
16
|
-
this.Code = opts.Code;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.AccessDeniedException = AccessDeniedException;
|
|
20
|
-
var ClientChallenge;
|
|
21
|
-
(function (ClientChallenge) {
|
|
22
|
-
ClientChallenge.visit = (value, visitor) => {
|
|
23
|
-
if (value.FaceMovementAndLightChallenge !== undefined)
|
|
24
|
-
return visitor.FaceMovementAndLightChallenge(value.FaceMovementAndLightChallenge);
|
|
25
|
-
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
26
|
-
};
|
|
27
|
-
})(ClientChallenge = exports.ClientChallenge || (exports.ClientChallenge = {}));
|
|
28
|
-
exports.LightChallengeType = {
|
|
29
|
-
SEQUENTIAL: "SEQUENTIAL",
|
|
30
|
-
};
|
|
31
|
-
class InternalServerException extends RekognitionStreamingServiceException_1.RekognitionStreamingServiceException {
|
|
32
|
-
constructor(opts) {
|
|
33
|
-
super({
|
|
34
|
-
name: "InternalServerException",
|
|
35
|
-
$fault: "server",
|
|
36
|
-
...opts,
|
|
37
|
-
});
|
|
38
|
-
this.name = "InternalServerException";
|
|
39
|
-
this.$fault = "server";
|
|
40
|
-
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
41
|
-
this.Message = opts.Message;
|
|
42
|
-
this.Code = opts.Code;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.InternalServerException = InternalServerException;
|
|
46
|
-
var LivenessRequestStream;
|
|
47
|
-
(function (LivenessRequestStream) {
|
|
48
|
-
LivenessRequestStream.visit = (value, visitor) => {
|
|
49
|
-
if (value.VideoEvent !== undefined)
|
|
50
|
-
return visitor.VideoEvent(value.VideoEvent);
|
|
51
|
-
if (value.ClientSessionInformationEvent !== undefined)
|
|
52
|
-
return visitor.ClientSessionInformationEvent(value.ClientSessionInformationEvent);
|
|
53
|
-
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
54
|
-
};
|
|
55
|
-
})(LivenessRequestStream = exports.LivenessRequestStream || (exports.LivenessRequestStream = {}));
|
|
56
|
-
var ServerChallenge;
|
|
57
|
-
(function (ServerChallenge) {
|
|
58
|
-
ServerChallenge.visit = (value, visitor) => {
|
|
59
|
-
if (value.FaceMovementAndLightChallenge !== undefined)
|
|
60
|
-
return visitor.FaceMovementAndLightChallenge(value.FaceMovementAndLightChallenge);
|
|
61
|
-
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
62
|
-
};
|
|
63
|
-
})(ServerChallenge = exports.ServerChallenge || (exports.ServerChallenge = {}));
|
|
64
|
-
class ServiceQuotaExceededException extends RekognitionStreamingServiceException_1.RekognitionStreamingServiceException {
|
|
65
|
-
constructor(opts) {
|
|
66
|
-
super({
|
|
67
|
-
name: "ServiceQuotaExceededException",
|
|
68
|
-
$fault: "client",
|
|
69
|
-
...opts,
|
|
70
|
-
});
|
|
71
|
-
this.name = "ServiceQuotaExceededException";
|
|
72
|
-
this.$fault = "client";
|
|
73
|
-
Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
|
|
74
|
-
this.Message = opts.Message;
|
|
75
|
-
this.Code = opts.Code;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.ServiceQuotaExceededException = ServiceQuotaExceededException;
|
|
79
|
-
class ServiceUnavailableException extends RekognitionStreamingServiceException_1.RekognitionStreamingServiceException {
|
|
80
|
-
constructor(opts) {
|
|
81
|
-
super({
|
|
82
|
-
name: "ServiceUnavailableException",
|
|
83
|
-
$fault: "server",
|
|
84
|
-
...opts,
|
|
85
|
-
});
|
|
86
|
-
this.name = "ServiceUnavailableException";
|
|
87
|
-
this.$fault = "server";
|
|
88
|
-
Object.setPrototypeOf(this, ServiceUnavailableException.prototype);
|
|
89
|
-
this.Message = opts.Message;
|
|
90
|
-
this.Code = opts.Code;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.ServiceUnavailableException = ServiceUnavailableException;
|
|
94
|
-
class ThrottlingException extends RekognitionStreamingServiceException_1.RekognitionStreamingServiceException {
|
|
95
|
-
constructor(opts) {
|
|
96
|
-
super({
|
|
97
|
-
name: "ThrottlingException",
|
|
98
|
-
$fault: "client",
|
|
99
|
-
...opts,
|
|
100
|
-
});
|
|
101
|
-
this.name = "ThrottlingException";
|
|
102
|
-
this.$fault = "client";
|
|
103
|
-
Object.setPrototypeOf(this, ThrottlingException.prototype);
|
|
104
|
-
this.Message = opts.Message;
|
|
105
|
-
this.Code = opts.Code;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
exports.ThrottlingException = ThrottlingException;
|
|
109
|
-
class ValidationException extends RekognitionStreamingServiceException_1.RekognitionStreamingServiceException {
|
|
110
|
-
constructor(opts) {
|
|
111
|
-
super({
|
|
112
|
-
name: "ValidationException",
|
|
113
|
-
$fault: "client",
|
|
114
|
-
...opts,
|
|
115
|
-
});
|
|
116
|
-
this.name = "ValidationException";
|
|
117
|
-
this.$fault = "client";
|
|
118
|
-
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
119
|
-
this.Message = opts.Message;
|
|
120
|
-
this.Code = opts.Code;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
exports.ValidationException = ValidationException;
|
|
124
|
-
var LivenessResponseStream;
|
|
125
|
-
(function (LivenessResponseStream) {
|
|
126
|
-
LivenessResponseStream.visit = (value, visitor) => {
|
|
127
|
-
if (value.ServerSessionInformationEvent !== undefined)
|
|
128
|
-
return visitor.ServerSessionInformationEvent(value.ServerSessionInformationEvent);
|
|
129
|
-
if (value.DisconnectionEvent !== undefined)
|
|
130
|
-
return visitor.DisconnectionEvent(value.DisconnectionEvent);
|
|
131
|
-
if (value.ValidationException !== undefined)
|
|
132
|
-
return visitor.ValidationException(value.ValidationException);
|
|
133
|
-
if (value.InternalServerException !== undefined)
|
|
134
|
-
return visitor.InternalServerException(value.InternalServerException);
|
|
135
|
-
if (value.ThrottlingException !== undefined)
|
|
136
|
-
return visitor.ThrottlingException(value.ThrottlingException);
|
|
137
|
-
if (value.ServiceQuotaExceededException !== undefined)
|
|
138
|
-
return visitor.ServiceQuotaExceededException(value.ServiceQuotaExceededException);
|
|
139
|
-
if (value.ServiceUnavailableException !== undefined)
|
|
140
|
-
return visitor.ServiceUnavailableException(value.ServiceUnavailableException);
|
|
141
|
-
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
142
|
-
};
|
|
143
|
-
})(LivenessResponseStream = exports.LivenessResponseStream || (exports.LivenessResponseStream = {}));
|
|
144
|
-
class SessionNotFoundException extends RekognitionStreamingServiceException_1.RekognitionStreamingServiceException {
|
|
145
|
-
constructor(opts) {
|
|
146
|
-
super({
|
|
147
|
-
name: "SessionNotFoundException",
|
|
148
|
-
$fault: "client",
|
|
149
|
-
...opts,
|
|
150
|
-
});
|
|
151
|
-
this.name = "SessionNotFoundException";
|
|
152
|
-
this.$fault = "client";
|
|
153
|
-
Object.setPrototypeOf(this, SessionNotFoundException.prototype);
|
|
154
|
-
this.Message = opts.Message;
|
|
155
|
-
this.Code = opts.Code;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
exports.SessionNotFoundException = SessionNotFoundException;
|
|
159
|
-
const LivenessRequestStreamFilterSensitiveLog = (obj) => {
|
|
160
|
-
if (obj.VideoEvent !== undefined)
|
|
161
|
-
return { VideoEvent: obj.VideoEvent };
|
|
162
|
-
if (obj.ClientSessionInformationEvent !== undefined)
|
|
163
|
-
return { ClientSessionInformationEvent: obj.ClientSessionInformationEvent };
|
|
164
|
-
if (obj.$unknown !== undefined)
|
|
165
|
-
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
166
|
-
};
|
|
167
|
-
exports.LivenessRequestStreamFilterSensitiveLog = LivenessRequestStreamFilterSensitiveLog;
|
|
168
|
-
const LivenessResponseStreamFilterSensitiveLog = (obj) => {
|
|
169
|
-
if (obj.ServerSessionInformationEvent !== undefined)
|
|
170
|
-
return { ServerSessionInformationEvent: obj.ServerSessionInformationEvent };
|
|
171
|
-
if (obj.DisconnectionEvent !== undefined)
|
|
172
|
-
return { DisconnectionEvent: obj.DisconnectionEvent };
|
|
173
|
-
if (obj.ValidationException !== undefined)
|
|
174
|
-
return { ValidationException: obj.ValidationException };
|
|
175
|
-
if (obj.InternalServerException !== undefined)
|
|
176
|
-
return { InternalServerException: obj.InternalServerException };
|
|
177
|
-
if (obj.ThrottlingException !== undefined)
|
|
178
|
-
return { ThrottlingException: obj.ThrottlingException };
|
|
179
|
-
if (obj.ServiceQuotaExceededException !== undefined)
|
|
180
|
-
return { ServiceQuotaExceededException: obj.ServiceQuotaExceededException };
|
|
181
|
-
if (obj.ServiceUnavailableException !== undefined)
|
|
182
|
-
return { ServiceUnavailableException: obj.ServiceUnavailableException };
|
|
183
|
-
if (obj.$unknown !== undefined)
|
|
184
|
-
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
185
|
-
};
|
|
186
|
-
exports.LivenessResponseStreamFilterSensitiveLog = LivenessResponseStreamFilterSensitiveLog;
|
|
187
|
-
const StartFaceLivenessSessionRequestFilterSensitiveLog = (obj) => ({
|
|
188
|
-
...obj,
|
|
189
|
-
...(obj.LivenessRequestStream && { LivenessRequestStream: "STREAMING_CONTENT" }),
|
|
190
|
-
});
|
|
191
|
-
exports.StartFaceLivenessSessionRequestFilterSensitiveLog = StartFaceLivenessSessionRequestFilterSensitiveLog;
|
|
192
|
-
const StartFaceLivenessSessionResponseFilterSensitiveLog = (obj) => ({
|
|
193
|
-
...obj,
|
|
194
|
-
...(obj.LivenessResponseStream && { LivenessResponseStream: "STREAMING_CONTENT" }),
|
|
195
|
-
});
|
|
196
|
-
exports.StartFaceLivenessSessionResponseFilterSensitiveLog = StartFaceLivenessSessionResponseFilterSensitiveLog;
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,465 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_StartFaceLivenessSessionCommand = exports.se_StartFaceLivenessSessionCommand = void 0;
|
|
4
|
-
const core_1 = require("@aws-sdk/core");
|
|
5
|
-
const core_2 = require("@smithy/core");
|
|
6
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
-
const models_0_1 = require("../models/models_0");
|
|
8
|
-
const RekognitionStreamingServiceException_1 = require("../models/RekognitionStreamingServiceException");
|
|
9
|
-
const se_StartFaceLivenessSessionCommand = async (input, context) => {
|
|
10
|
-
const b = (0, core_2.requestBuilder)(input, context);
|
|
11
|
-
const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
|
|
12
|
-
[_xarslsi]: input[_SI],
|
|
13
|
-
[_xarslvw]: input[_VW],
|
|
14
|
-
[_xarslvh]: input[_VH],
|
|
15
|
-
[_xarslcv]: input[_CV],
|
|
16
|
-
});
|
|
17
|
-
b.bp("/start-face-liveness-session");
|
|
18
|
-
let body;
|
|
19
|
-
if (input.LivenessRequestStream !== undefined) {
|
|
20
|
-
body = se_LivenessRequestStream(input.LivenessRequestStream, context);
|
|
21
|
-
}
|
|
22
|
-
b.m("POST").h(headers).b(body);
|
|
23
|
-
return b.build();
|
|
24
|
-
};
|
|
25
|
-
exports.se_StartFaceLivenessSessionCommand = se_StartFaceLivenessSessionCommand;
|
|
26
|
-
const de_StartFaceLivenessSessionCommand = async (output, context) => {
|
|
27
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
28
|
-
return de_StartFaceLivenessSessionCommandError(output, context);
|
|
29
|
-
}
|
|
30
|
-
const contents = (0, smithy_client_1.map)({
|
|
31
|
-
$metadata: deserializeMetadata(output),
|
|
32
|
-
[_SI]: [, output.headers[_xarslsi]],
|
|
33
|
-
});
|
|
34
|
-
const data = output.body;
|
|
35
|
-
contents.LivenessResponseStream = de_LivenessResponseStream(data, context);
|
|
36
|
-
return contents;
|
|
37
|
-
};
|
|
38
|
-
exports.de_StartFaceLivenessSessionCommand = de_StartFaceLivenessSessionCommand;
|
|
39
|
-
const de_StartFaceLivenessSessionCommandError = async (output, context) => {
|
|
40
|
-
const parsedOutput = {
|
|
41
|
-
...output,
|
|
42
|
-
body: await parseErrorBody(output.body, context),
|
|
43
|
-
};
|
|
44
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
45
|
-
switch (errorCode) {
|
|
46
|
-
case "AccessDeniedException":
|
|
47
|
-
case "com.amazonaws.rekognitionstreaming#AccessDeniedException":
|
|
48
|
-
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
49
|
-
case "InternalServerException":
|
|
50
|
-
case "com.amazonaws.rekognitionstreaming#InternalServerException":
|
|
51
|
-
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
52
|
-
case "ServiceQuotaExceededException":
|
|
53
|
-
case "com.amazonaws.rekognitionstreaming#ServiceQuotaExceededException":
|
|
54
|
-
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
55
|
-
case "ServiceUnavailableException":
|
|
56
|
-
case "com.amazonaws.rekognitionstreaming#ServiceUnavailableException":
|
|
57
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
58
|
-
case "SessionNotFoundException":
|
|
59
|
-
case "com.amazonaws.rekognitionstreaming#SessionNotFoundException":
|
|
60
|
-
throw await de_SessionNotFoundExceptionRes(parsedOutput, context);
|
|
61
|
-
case "ThrottlingException":
|
|
62
|
-
case "com.amazonaws.rekognitionstreaming#ThrottlingException":
|
|
63
|
-
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
64
|
-
case "ValidationException":
|
|
65
|
-
case "com.amazonaws.rekognitionstreaming#ValidationException":
|
|
66
|
-
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
67
|
-
default:
|
|
68
|
-
const parsedBody = parsedOutput.body;
|
|
69
|
-
return throwDefaultError({
|
|
70
|
-
output,
|
|
71
|
-
parsedBody,
|
|
72
|
-
errorCode,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const throwDefaultError = (0, smithy_client_1.withBaseException)(RekognitionStreamingServiceException_1.RekognitionStreamingServiceException);
|
|
77
|
-
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
78
|
-
const contents = (0, smithy_client_1.map)({});
|
|
79
|
-
const data = parsedOutput.body;
|
|
80
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
81
|
-
Code: smithy_client_1.expectString,
|
|
82
|
-
Message: smithy_client_1.expectString,
|
|
83
|
-
});
|
|
84
|
-
Object.assign(contents, doc);
|
|
85
|
-
const exception = new models_0_1.AccessDeniedException({
|
|
86
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
87
|
-
...contents,
|
|
88
|
-
});
|
|
89
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
90
|
-
};
|
|
91
|
-
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
92
|
-
const contents = (0, smithy_client_1.map)({});
|
|
93
|
-
const data = parsedOutput.body;
|
|
94
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
95
|
-
Code: smithy_client_1.expectString,
|
|
96
|
-
Message: smithy_client_1.expectString,
|
|
97
|
-
});
|
|
98
|
-
Object.assign(contents, doc);
|
|
99
|
-
const exception = new models_0_1.InternalServerException({
|
|
100
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
101
|
-
...contents,
|
|
102
|
-
});
|
|
103
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
104
|
-
};
|
|
105
|
-
const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
106
|
-
const contents = (0, smithy_client_1.map)({});
|
|
107
|
-
const data = parsedOutput.body;
|
|
108
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
109
|
-
Code: smithy_client_1.expectString,
|
|
110
|
-
Message: smithy_client_1.expectString,
|
|
111
|
-
});
|
|
112
|
-
Object.assign(contents, doc);
|
|
113
|
-
const exception = new models_0_1.ServiceQuotaExceededException({
|
|
114
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
115
|
-
...contents,
|
|
116
|
-
});
|
|
117
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
118
|
-
};
|
|
119
|
-
const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
|
|
120
|
-
const contents = (0, smithy_client_1.map)({});
|
|
121
|
-
const data = parsedOutput.body;
|
|
122
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
123
|
-
Code: smithy_client_1.expectString,
|
|
124
|
-
Message: smithy_client_1.expectString,
|
|
125
|
-
});
|
|
126
|
-
Object.assign(contents, doc);
|
|
127
|
-
const exception = new models_0_1.ServiceUnavailableException({
|
|
128
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
129
|
-
...contents,
|
|
130
|
-
});
|
|
131
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
132
|
-
};
|
|
133
|
-
const de_SessionNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
134
|
-
const contents = (0, smithy_client_1.map)({});
|
|
135
|
-
const data = parsedOutput.body;
|
|
136
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
137
|
-
Code: smithy_client_1.expectString,
|
|
138
|
-
Message: smithy_client_1.expectString,
|
|
139
|
-
});
|
|
140
|
-
Object.assign(contents, doc);
|
|
141
|
-
const exception = new models_0_1.SessionNotFoundException({
|
|
142
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
143
|
-
...contents,
|
|
144
|
-
});
|
|
145
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
146
|
-
};
|
|
147
|
-
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
148
|
-
const contents = (0, smithy_client_1.map)({});
|
|
149
|
-
const data = parsedOutput.body;
|
|
150
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
151
|
-
Code: smithy_client_1.expectString,
|
|
152
|
-
Message: smithy_client_1.expectString,
|
|
153
|
-
});
|
|
154
|
-
Object.assign(contents, doc);
|
|
155
|
-
const exception = new models_0_1.ThrottlingException({
|
|
156
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
157
|
-
...contents,
|
|
158
|
-
});
|
|
159
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
160
|
-
};
|
|
161
|
-
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
162
|
-
const contents = (0, smithy_client_1.map)({});
|
|
163
|
-
const data = parsedOutput.body;
|
|
164
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
165
|
-
Code: smithy_client_1.expectString,
|
|
166
|
-
Message: smithy_client_1.expectString,
|
|
167
|
-
});
|
|
168
|
-
Object.assign(contents, doc);
|
|
169
|
-
const exception = new models_0_1.ValidationException({
|
|
170
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
171
|
-
...contents,
|
|
172
|
-
});
|
|
173
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
174
|
-
};
|
|
175
|
-
const se_LivenessRequestStream = (input, context) => {
|
|
176
|
-
const eventMarshallingVisitor = (event) => models_0_1.LivenessRequestStream.visit(event, {
|
|
177
|
-
VideoEvent: (value) => se_VideoEvent_event(value, context),
|
|
178
|
-
ClientSessionInformationEvent: (value) => se_ClientSessionInformationEvent_event(value, context),
|
|
179
|
-
_: (value) => value,
|
|
180
|
-
});
|
|
181
|
-
return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
|
|
182
|
-
};
|
|
183
|
-
const se_ClientSessionInformationEvent_event = (input, context) => {
|
|
184
|
-
const headers = {
|
|
185
|
-
":event-type": { type: "string", value: "ClientSessionInformationEvent" },
|
|
186
|
-
":message-type": { type: "string", value: "event" },
|
|
187
|
-
":content-type": { type: "string", value: "application/json" },
|
|
188
|
-
};
|
|
189
|
-
let body = new Uint8Array();
|
|
190
|
-
body = se_ClientSessionInformationEvent(input, context);
|
|
191
|
-
body = context.utf8Decoder(JSON.stringify(body));
|
|
192
|
-
return { headers, body };
|
|
193
|
-
};
|
|
194
|
-
const se_VideoEvent_event = (input, context) => {
|
|
195
|
-
const headers = {
|
|
196
|
-
":event-type": { type: "string", value: "VideoEvent" },
|
|
197
|
-
":message-type": { type: "string", value: "event" },
|
|
198
|
-
":content-type": { type: "string", value: "application/json" },
|
|
199
|
-
};
|
|
200
|
-
let body = new Uint8Array();
|
|
201
|
-
body = se_VideoEvent(input, context);
|
|
202
|
-
body = context.utf8Decoder(JSON.stringify(body));
|
|
203
|
-
return { headers, body };
|
|
204
|
-
};
|
|
205
|
-
const de_LivenessResponseStream = (output, context) => {
|
|
206
|
-
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
207
|
-
if (event["ServerSessionInformationEvent"] != null) {
|
|
208
|
-
return {
|
|
209
|
-
ServerSessionInformationEvent: await de_ServerSessionInformationEvent_event(event["ServerSessionInformationEvent"], context),
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
if (event["DisconnectionEvent"] != null) {
|
|
213
|
-
return {
|
|
214
|
-
DisconnectionEvent: await de_DisconnectionEvent_event(event["DisconnectionEvent"], context),
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
if (event["ValidationException"] != null) {
|
|
218
|
-
return {
|
|
219
|
-
ValidationException: await de_ValidationException_event(event["ValidationException"], context),
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
if (event["InternalServerException"] != null) {
|
|
223
|
-
return {
|
|
224
|
-
InternalServerException: await de_InternalServerException_event(event["InternalServerException"], context),
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
if (event["ThrottlingException"] != null) {
|
|
228
|
-
return {
|
|
229
|
-
ThrottlingException: await de_ThrottlingException_event(event["ThrottlingException"], context),
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
if (event["ServiceQuotaExceededException"] != null) {
|
|
233
|
-
return {
|
|
234
|
-
ServiceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["ServiceQuotaExceededException"], context),
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
if (event["ServiceUnavailableException"] != null) {
|
|
238
|
-
return {
|
|
239
|
-
ServiceUnavailableException: await de_ServiceUnavailableException_event(event["ServiceUnavailableException"], context),
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
return { $unknown: output };
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
const de_DisconnectionEvent_event = async (output, context) => {
|
|
246
|
-
const contents = {};
|
|
247
|
-
const data = await parseBody(output.body, context);
|
|
248
|
-
Object.assign(contents, (0, smithy_client_1._json)(data));
|
|
249
|
-
return contents;
|
|
250
|
-
};
|
|
251
|
-
const de_InternalServerException_event = async (output, context) => {
|
|
252
|
-
const parsedOutput = {
|
|
253
|
-
...output,
|
|
254
|
-
body: await parseBody(output.body, context),
|
|
255
|
-
};
|
|
256
|
-
return de_InternalServerExceptionRes(parsedOutput, context);
|
|
257
|
-
};
|
|
258
|
-
const de_ServerSessionInformationEvent_event = async (output, context) => {
|
|
259
|
-
const contents = {};
|
|
260
|
-
const data = await parseBody(output.body, context);
|
|
261
|
-
Object.assign(contents, de_ServerSessionInformationEvent(data, context));
|
|
262
|
-
return contents;
|
|
263
|
-
};
|
|
264
|
-
const de_ServiceQuotaExceededException_event = async (output, context) => {
|
|
265
|
-
const parsedOutput = {
|
|
266
|
-
...output,
|
|
267
|
-
body: await parseBody(output.body, context),
|
|
268
|
-
};
|
|
269
|
-
return de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
270
|
-
};
|
|
271
|
-
const de_ServiceUnavailableException_event = async (output, context) => {
|
|
272
|
-
const parsedOutput = {
|
|
273
|
-
...output,
|
|
274
|
-
body: await parseBody(output.body, context),
|
|
275
|
-
};
|
|
276
|
-
return de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
277
|
-
};
|
|
278
|
-
const de_ThrottlingException_event = async (output, context) => {
|
|
279
|
-
const parsedOutput = {
|
|
280
|
-
...output,
|
|
281
|
-
body: await parseBody(output.body, context),
|
|
282
|
-
};
|
|
283
|
-
return de_ThrottlingExceptionRes(parsedOutput, context);
|
|
284
|
-
};
|
|
285
|
-
const de_ValidationException_event = async (output, context) => {
|
|
286
|
-
const parsedOutput = {
|
|
287
|
-
...output,
|
|
288
|
-
body: await parseBody(output.body, context),
|
|
289
|
-
};
|
|
290
|
-
return de_ValidationExceptionRes(parsedOutput, context);
|
|
291
|
-
};
|
|
292
|
-
const se_BoundingBox = (input, context) => {
|
|
293
|
-
return (0, smithy_client_1.take)(input, {
|
|
294
|
-
Height: smithy_client_1.serializeFloat,
|
|
295
|
-
Left: smithy_client_1.serializeFloat,
|
|
296
|
-
Top: smithy_client_1.serializeFloat,
|
|
297
|
-
Width: smithy_client_1.serializeFloat,
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
|
-
const se_ClientChallenge = (input, context) => {
|
|
301
|
-
return models_0_1.ClientChallenge.visit(input, {
|
|
302
|
-
FaceMovementAndLightChallenge: (value) => ({
|
|
303
|
-
FaceMovementAndLightChallenge: se_FaceMovementAndLightClientChallenge(value, context),
|
|
304
|
-
}),
|
|
305
|
-
_: (name, value) => ({ name: value }),
|
|
306
|
-
});
|
|
307
|
-
};
|
|
308
|
-
const se_ClientSessionInformationEvent = (input, context) => {
|
|
309
|
-
return (0, smithy_client_1.take)(input, {
|
|
310
|
-
Challenge: (_) => se_ClientChallenge(_, context),
|
|
311
|
-
});
|
|
312
|
-
};
|
|
313
|
-
const se_FaceMovementAndLightClientChallenge = (input, context) => {
|
|
314
|
-
return (0, smithy_client_1.take)(input, {
|
|
315
|
-
ChallengeId: [],
|
|
316
|
-
ColorDisplayed: smithy_client_1._json,
|
|
317
|
-
InitialFace: (_) => se_InitialFace(_, context),
|
|
318
|
-
TargetFace: (_) => se_TargetFace(_, context),
|
|
319
|
-
VideoEndTimestamp: [],
|
|
320
|
-
VideoStartTimestamp: [],
|
|
321
|
-
});
|
|
322
|
-
};
|
|
323
|
-
const se_InitialFace = (input, context) => {
|
|
324
|
-
return (0, smithy_client_1.take)(input, {
|
|
325
|
-
BoundingBox: (_) => se_BoundingBox(_, context),
|
|
326
|
-
InitialFaceDetectedTimestamp: [],
|
|
327
|
-
});
|
|
328
|
-
};
|
|
329
|
-
const se_TargetFace = (input, context) => {
|
|
330
|
-
return (0, smithy_client_1.take)(input, {
|
|
331
|
-
BoundingBox: (_) => se_BoundingBox(_, context),
|
|
332
|
-
FaceDetectedInTargetPositionEndTimestamp: [],
|
|
333
|
-
FaceDetectedInTargetPositionStartTimestamp: [],
|
|
334
|
-
});
|
|
335
|
-
};
|
|
336
|
-
const se_VideoEvent = (input, context) => {
|
|
337
|
-
return (0, smithy_client_1.take)(input, {
|
|
338
|
-
TimestampMillis: [],
|
|
339
|
-
VideoChunk: context.base64Encoder,
|
|
340
|
-
});
|
|
341
|
-
};
|
|
342
|
-
const de_ChallengeConfig = (output, context) => {
|
|
343
|
-
return (0, smithy_client_1.take)(output, {
|
|
344
|
-
BlazeFaceDetectionThreshold: smithy_client_1.limitedParseFloat32,
|
|
345
|
-
FaceDistanceThreshold: smithy_client_1.limitedParseFloat32,
|
|
346
|
-
FaceDistanceThresholdMax: smithy_client_1.limitedParseFloat32,
|
|
347
|
-
FaceDistanceThresholdMin: smithy_client_1.limitedParseFloat32,
|
|
348
|
-
FaceIouHeightThreshold: smithy_client_1.limitedParseFloat32,
|
|
349
|
-
FaceIouWidthThreshold: smithy_client_1.limitedParseFloat32,
|
|
350
|
-
OvalFitTimeout: smithy_client_1.expectInt32,
|
|
351
|
-
OvalHeightWidthRatio: smithy_client_1.limitedParseFloat32,
|
|
352
|
-
OvalIouHeightThreshold: smithy_client_1.limitedParseFloat32,
|
|
353
|
-
OvalIouThreshold: smithy_client_1.limitedParseFloat32,
|
|
354
|
-
OvalIouWidthThreshold: smithy_client_1.limitedParseFloat32,
|
|
355
|
-
});
|
|
356
|
-
};
|
|
357
|
-
const de_ColorSequence = (output, context) => {
|
|
358
|
-
return (0, smithy_client_1.take)(output, {
|
|
359
|
-
DownscrollDuration: smithy_client_1.limitedParseFloat32,
|
|
360
|
-
FlatDisplayDuration: smithy_client_1.limitedParseFloat32,
|
|
361
|
-
FreshnessColor: smithy_client_1._json,
|
|
362
|
-
});
|
|
363
|
-
};
|
|
364
|
-
const de_ColorSequences = (output, context) => {
|
|
365
|
-
const retVal = (output || [])
|
|
366
|
-
.filter((e) => e != null)
|
|
367
|
-
.map((entry) => {
|
|
368
|
-
return de_ColorSequence(entry, context);
|
|
369
|
-
});
|
|
370
|
-
return retVal;
|
|
371
|
-
};
|
|
372
|
-
const de_FaceMovementAndLightServerChallenge = (output, context) => {
|
|
373
|
-
return (0, smithy_client_1.take)(output, {
|
|
374
|
-
ChallengeConfig: (_) => de_ChallengeConfig(_, context),
|
|
375
|
-
ColorSequences: (_) => de_ColorSequences(_, context),
|
|
376
|
-
LightChallengeType: smithy_client_1.expectString,
|
|
377
|
-
OvalParameters: (_) => de_OvalParameters(_, context),
|
|
378
|
-
});
|
|
379
|
-
};
|
|
380
|
-
const de_OvalParameters = (output, context) => {
|
|
381
|
-
return (0, smithy_client_1.take)(output, {
|
|
382
|
-
CenterX: smithy_client_1.limitedParseFloat32,
|
|
383
|
-
CenterY: smithy_client_1.limitedParseFloat32,
|
|
384
|
-
Height: smithy_client_1.limitedParseFloat32,
|
|
385
|
-
Width: smithy_client_1.limitedParseFloat32,
|
|
386
|
-
});
|
|
387
|
-
};
|
|
388
|
-
const de_ServerChallenge = (output, context) => {
|
|
389
|
-
if (output.FaceMovementAndLightChallenge != null) {
|
|
390
|
-
return {
|
|
391
|
-
FaceMovementAndLightChallenge: de_FaceMovementAndLightServerChallenge(output.FaceMovementAndLightChallenge, context),
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
return { $unknown: Object.entries(output)[0] };
|
|
395
|
-
};
|
|
396
|
-
const de_ServerSessionInformationEvent = (output, context) => {
|
|
397
|
-
return (0, smithy_client_1.take)(output, {
|
|
398
|
-
SessionInformation: (_) => de_SessionInformation(_, context),
|
|
399
|
-
});
|
|
400
|
-
};
|
|
401
|
-
const de_SessionInformation = (output, context) => {
|
|
402
|
-
return (0, smithy_client_1.take)(output, {
|
|
403
|
-
Challenge: (_) => de_ServerChallenge((0, core_1.awsExpectUnion)(_), context),
|
|
404
|
-
});
|
|
405
|
-
};
|
|
406
|
-
const deserializeMetadata = (output) => ({
|
|
407
|
-
httpStatusCode: output.statusCode,
|
|
408
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
409
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
410
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
411
|
-
});
|
|
412
|
-
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
413
|
-
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
414
|
-
value !== null &&
|
|
415
|
-
value !== "" &&
|
|
416
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
417
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
418
|
-
const _CV = "ChallengeVersions";
|
|
419
|
-
const _SI = "SessionId";
|
|
420
|
-
const _VH = "VideoHeight";
|
|
421
|
-
const _VW = "VideoWidth";
|
|
422
|
-
const _xarslcv = "x-amz-rekognition-streaming-liveness-challenge-versions";
|
|
423
|
-
const _xarslsi = "x-amz-rekognition-streaming-liveness-session-id";
|
|
424
|
-
const _xarslvh = "x-amz-rekognition-streaming-liveness-video-height";
|
|
425
|
-
const _xarslvw = "x-amz-rekognition-streaming-liveness-video-width";
|
|
426
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
427
|
-
if (encoded.length) {
|
|
428
|
-
return JSON.parse(encoded);
|
|
429
|
-
}
|
|
430
|
-
return {};
|
|
431
|
-
});
|
|
432
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
433
|
-
const value = await parseBody(errorBody, context);
|
|
434
|
-
value.message = value.message ?? value.Message;
|
|
435
|
-
return value;
|
|
436
|
-
};
|
|
437
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
438
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
439
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
440
|
-
let cleanValue = rawValue;
|
|
441
|
-
if (typeof cleanValue === "number") {
|
|
442
|
-
cleanValue = cleanValue.toString();
|
|
443
|
-
}
|
|
444
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
445
|
-
cleanValue = cleanValue.split(",")[0];
|
|
446
|
-
}
|
|
447
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
448
|
-
cleanValue = cleanValue.split(":")[0];
|
|
449
|
-
}
|
|
450
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
451
|
-
cleanValue = cleanValue.split("#")[1];
|
|
452
|
-
}
|
|
453
|
-
return cleanValue;
|
|
454
|
-
};
|
|
455
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
456
|
-
if (headerKey !== undefined) {
|
|
457
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
458
|
-
}
|
|
459
|
-
if (data.code !== undefined) {
|
|
460
|
-
return sanitizeErrorCode(data.code);
|
|
461
|
-
}
|
|
462
|
-
if (data["__type"] !== undefined) {
|
|
463
|
-
return sanitizeErrorCode(data["__type"]);
|
|
464
|
-
}
|
|
465
|
-
};
|
|
1
|
+
module.exports = require("../index.js");
|