@aws-sdk/client-rekognitionstreaming 3.306.0 → 3.309.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/README.md +23 -0
- package/dist-cjs/commands/StartFaceLivenessSessionCommand.js +2 -2
- package/dist-cjs/endpoint/ruleset.js +1 -1
- package/dist-cjs/protocols/Aws_restJson1.js +92 -110
- package/dist-es/commands/StartFaceLivenessSessionCommand.js +3 -3
- package/dist-es/endpoint/ruleset.js +1 -1
- package/dist-es/protocols/Aws_restJson1.js +89 -107
- package/dist-types/RekognitionStreaming.d.ts +31 -0
- package/dist-types/RekognitionStreamingClient.d.ts +22 -0
- package/dist-types/commands/StartFaceLivenessSessionCommand.d.ts +109 -0
- package/dist-types/models/models_0.d.ts +254 -1
- package/dist-types/protocols/Aws_restJson1.d.ts +8 -2
- package/dist-types/ts3.4/models/models_0.d.ts +1 -1
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -9,6 +9,29 @@
|
|
|
9
9
|
|
|
10
10
|
AWS SDK for JavaScript RekognitionStreaming Client for Node.js, Browser and React Native.
|
|
11
11
|
|
|
12
|
+
<p>A real-time video processing service based on Rekognition. This section documents the API
|
|
13
|
+
operations for Rekognition Face Liveness.</p>
|
|
14
|
+
<p>
|
|
15
|
+
<b>Amazon Rekognition Face Liveness</b>
|
|
16
|
+
</p>
|
|
17
|
+
<ul>
|
|
18
|
+
<li>
|
|
19
|
+
<p>
|
|
20
|
+
<a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateFaceLivenessSession.html">CreateFaceLivenessSession</a>
|
|
21
|
+
</p>
|
|
22
|
+
</li>
|
|
23
|
+
<li>
|
|
24
|
+
<p>
|
|
25
|
+
<a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetFaceLivenessSessionResults.html">GetFaceLivenessSessionResults</a>
|
|
26
|
+
</p>
|
|
27
|
+
</li>
|
|
28
|
+
<li>
|
|
29
|
+
<p>
|
|
30
|
+
<a href="https://docs.aws.amazon.com/rekognition/latest/APIReference/API_rekognitionstreaming_StartFaceLivenessSession.html">StartFaceLivenessSession</a>
|
|
31
|
+
</p>
|
|
32
|
+
</li>
|
|
33
|
+
</ul>
|
|
34
|
+
|
|
12
35
|
## Installing
|
|
13
36
|
|
|
14
37
|
To install the this package, simply type add or install @aws-sdk/client-rekognitionstreaming
|
|
@@ -41,10 +41,10 @@ class StartFaceLivenessSessionCommand extends smithy_client_1.Command {
|
|
|
41
41
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
42
42
|
}
|
|
43
43
|
serialize(input, context) {
|
|
44
|
-
return (0, Aws_restJson1_1.
|
|
44
|
+
return (0, Aws_restJson1_1.se_StartFaceLivenessSessionCommand)(input, context);
|
|
45
45
|
}
|
|
46
46
|
deserialize(output, context) {
|
|
47
|
-
return (0, Aws_restJson1_1.
|
|
47
|
+
return (0, Aws_restJson1_1.de_StartFaceLivenessSessionCommand)(output, context);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.StartFaceLivenessSessionCommand = StartFaceLivenessSessionCommand;
|
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ruleSet = void 0;
|
|
4
4
|
const q = "required", r = "fn", s = "argv", t = "ref";
|
|
5
5
|
const a = "isSet", b = "tree", c = "error", d = "endpoint", e = "PartitionResult", f = { [q]: false, "type": "String" }, g = { [q]: true, "default": false, "type": "Boolean" }, h = { [t]: "Endpoint" }, i = { [r]: "booleanEquals", [s]: [{ [t]: "UseFIPS" }, true] }, j = { [r]: "booleanEquals", [s]: [{ [t]: "UseDualStack" }, true] }, k = {}, l = { [r]: "booleanEquals", [s]: [true, { [r]: "getAttr", [s]: [{ [t]: e }, "supportsFIPS"] }] }, m = { [r]: "booleanEquals", [s]: [true, { [r]: "getAttr", [s]: [{ [t]: e }, "supportsDualStack"] }] }, n = [i], o = [j], p = [{ [t]: "Region" }];
|
|
6
|
-
const _data = { version: "1.0", parameters: { Region: f, UseDualStack: g, UseFIPS: g, Endpoint: f }, rules: [{ conditions: [{ [r]: a, [s]: [h] }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: h, properties: k, headers: k }, type: d }] }] }, { type: b, rules: [{ conditions: [{ [r]: a, [s]: p }], type: b, rules: [{ conditions: [{ [r]: "aws.partition", [s]: p, assign: e }], type: b, rules: [{ conditions: [i, j], type: b, rules: [{ conditions: [l, m], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://
|
|
6
|
+
const _data = { version: "1.0", parameters: { Region: f, UseDualStack: g, UseFIPS: g, Endpoint: f }, rules: [{ conditions: [{ [r]: a, [s]: [h] }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: h, properties: k, headers: k }, type: d }] }] }, { type: b, rules: [{ conditions: [{ [r]: a, [s]: p }], type: b, rules: [{ conditions: [{ [r]: "aws.partition", [s]: p, assign: e }], type: b, rules: [{ conditions: [i, j], type: b, rules: [{ conditions: [l, m], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://streaming-rekognition-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: k, headers: k }, type: d }] }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [l], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://streaming-rekognition-fips.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [m], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://streaming-rekognition.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: k, headers: k }, type: d }] }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { type: b, rules: [{ endpoint: { url: "https://streaming-rekognition.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] }] };
|
|
7
7
|
exports.ruleSet = _data;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.de_StartFaceLivenessSessionCommand = exports.se_StartFaceLivenessSessionCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
7
7
|
const RekognitionStreamingServiceException_1 = require("../models/RekognitionStreamingServiceException");
|
|
8
|
-
const
|
|
8
|
+
const se_StartFaceLivenessSessionCommand = async (input, context) => {
|
|
9
9
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
10
10
|
const headers = map({}, isSerializableHeaderValue, {
|
|
11
11
|
"x-amz-rekognition-streaming-liveness-session-id": input.SessionId,
|
|
@@ -16,7 +16,7 @@ const serializeAws_restJson1StartFaceLivenessSessionCommand = async (input, cont
|
|
|
16
16
|
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/start-face-liveness-session";
|
|
17
17
|
let body;
|
|
18
18
|
if (input.LivenessRequestStream !== undefined) {
|
|
19
|
-
body =
|
|
19
|
+
body = se_LivenessRequestStream(input.LivenessRequestStream, context);
|
|
20
20
|
}
|
|
21
21
|
return new protocol_http_1.HttpRequest({
|
|
22
22
|
protocol,
|
|
@@ -28,21 +28,21 @@ const serializeAws_restJson1StartFaceLivenessSessionCommand = async (input, cont
|
|
|
28
28
|
body,
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
|
-
exports.
|
|
32
|
-
const
|
|
31
|
+
exports.se_StartFaceLivenessSessionCommand = se_StartFaceLivenessSessionCommand;
|
|
32
|
+
const de_StartFaceLivenessSessionCommand = async (output, context) => {
|
|
33
33
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
34
|
-
return
|
|
34
|
+
return de_StartFaceLivenessSessionCommandError(output, context);
|
|
35
35
|
}
|
|
36
36
|
const contents = map({
|
|
37
37
|
$metadata: deserializeMetadata(output),
|
|
38
38
|
SessionId: [, output.headers["x-amz-rekognition-streaming-liveness-session-id"]],
|
|
39
39
|
});
|
|
40
40
|
const data = output.body;
|
|
41
|
-
contents.LivenessResponseStream =
|
|
41
|
+
contents.LivenessResponseStream = de_LivenessResponseStream(data, context);
|
|
42
42
|
return contents;
|
|
43
43
|
};
|
|
44
|
-
exports.
|
|
45
|
-
const
|
|
44
|
+
exports.de_StartFaceLivenessSessionCommand = de_StartFaceLivenessSessionCommand;
|
|
45
|
+
const de_StartFaceLivenessSessionCommandError = async (output, context) => {
|
|
46
46
|
const parsedOutput = {
|
|
47
47
|
...output,
|
|
48
48
|
body: await parseErrorBody(output.body, context),
|
|
@@ -51,25 +51,25 @@ const deserializeAws_restJson1StartFaceLivenessSessionCommandError = async (outp
|
|
|
51
51
|
switch (errorCode) {
|
|
52
52
|
case "AccessDeniedException":
|
|
53
53
|
case "com.amazonaws.rekognitionstreaming#AccessDeniedException":
|
|
54
|
-
throw await
|
|
54
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
55
55
|
case "InternalServerException":
|
|
56
56
|
case "com.amazonaws.rekognitionstreaming#InternalServerException":
|
|
57
|
-
throw await
|
|
57
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
58
58
|
case "ServiceQuotaExceededException":
|
|
59
59
|
case "com.amazonaws.rekognitionstreaming#ServiceQuotaExceededException":
|
|
60
|
-
throw await
|
|
60
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
61
61
|
case "ServiceUnavailableException":
|
|
62
62
|
case "com.amazonaws.rekognitionstreaming#ServiceUnavailableException":
|
|
63
|
-
throw await
|
|
63
|
+
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
64
64
|
case "SessionNotFoundException":
|
|
65
65
|
case "com.amazonaws.rekognitionstreaming#SessionNotFoundException":
|
|
66
|
-
throw await
|
|
66
|
+
throw await de_SessionNotFoundExceptionRes(parsedOutput, context);
|
|
67
67
|
case "ThrottlingException":
|
|
68
68
|
case "com.amazonaws.rekognitionstreaming#ThrottlingException":
|
|
69
|
-
throw await
|
|
69
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
70
70
|
case "ValidationException":
|
|
71
71
|
case "com.amazonaws.rekognitionstreaming#ValidationException":
|
|
72
|
-
throw await
|
|
72
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
73
73
|
default:
|
|
74
74
|
const parsedBody = parsedOutput.body;
|
|
75
75
|
(0, smithy_client_1.throwDefaultError)({
|
|
@@ -81,7 +81,7 @@ const deserializeAws_restJson1StartFaceLivenessSessionCommandError = async (outp
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
const map = smithy_client_1.map;
|
|
84
|
-
const
|
|
84
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
85
85
|
const contents = map({});
|
|
86
86
|
const data = parsedOutput.body;
|
|
87
87
|
if (data.Code != null) {
|
|
@@ -96,7 +96,7 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
|
|
|
96
96
|
});
|
|
97
97
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
98
98
|
};
|
|
99
|
-
const
|
|
99
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
100
100
|
const contents = map({});
|
|
101
101
|
const data = parsedOutput.body;
|
|
102
102
|
if (data.Code != null) {
|
|
@@ -111,7 +111,7 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
|
|
|
111
111
|
});
|
|
112
112
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
113
113
|
};
|
|
114
|
-
const
|
|
114
|
+
const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
115
115
|
const contents = map({});
|
|
116
116
|
const data = parsedOutput.body;
|
|
117
117
|
if (data.Code != null) {
|
|
@@ -126,7 +126,7 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
|
|
|
126
126
|
});
|
|
127
127
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
128
128
|
};
|
|
129
|
-
const
|
|
129
|
+
const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
|
|
130
130
|
const contents = map({});
|
|
131
131
|
const data = parsedOutput.body;
|
|
132
132
|
if (data.Code != null) {
|
|
@@ -141,7 +141,7 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parse
|
|
|
141
141
|
});
|
|
142
142
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
143
143
|
};
|
|
144
|
-
const
|
|
144
|
+
const de_SessionNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
145
145
|
const contents = map({});
|
|
146
146
|
const data = parsedOutput.body;
|
|
147
147
|
if (data.Code != null) {
|
|
@@ -156,7 +156,7 @@ const deserializeAws_restJson1SessionNotFoundExceptionResponse = async (parsedOu
|
|
|
156
156
|
});
|
|
157
157
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
158
158
|
};
|
|
159
|
-
const
|
|
159
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
160
160
|
const contents = map({});
|
|
161
161
|
const data = parsedOutput.body;
|
|
162
162
|
if (data.Code != null) {
|
|
@@ -171,7 +171,7 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
|
|
|
171
171
|
});
|
|
172
172
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
173
173
|
};
|
|
174
|
-
const
|
|
174
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
175
175
|
const contents = map({});
|
|
176
176
|
const data = parsedOutput.body;
|
|
177
177
|
if (data.Code != null) {
|
|
@@ -186,124 +186,124 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
|
|
|
186
186
|
});
|
|
187
187
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
188
188
|
};
|
|
189
|
-
const
|
|
189
|
+
const se_LivenessRequestStream = (input, context) => {
|
|
190
190
|
const eventMarshallingVisitor = (event) => models_0_1.LivenessRequestStream.visit(event, {
|
|
191
|
-
VideoEvent: (value) =>
|
|
192
|
-
ClientSessionInformationEvent: (value) =>
|
|
191
|
+
VideoEvent: (value) => se_VideoEvent_event(value, context),
|
|
192
|
+
ClientSessionInformationEvent: (value) => se_ClientSessionInformationEvent_event(value, context),
|
|
193
193
|
_: (value) => value,
|
|
194
194
|
});
|
|
195
195
|
return context.eventStreamMarshaller.serialize(input, eventMarshallingVisitor);
|
|
196
196
|
};
|
|
197
|
-
const
|
|
197
|
+
const se_ClientSessionInformationEvent_event = (input, context) => {
|
|
198
198
|
const headers = {
|
|
199
199
|
":event-type": { type: "string", value: "ClientSessionInformationEvent" },
|
|
200
200
|
":message-type": { type: "string", value: "event" },
|
|
201
201
|
":content-type": { type: "string", value: "application/json" },
|
|
202
202
|
};
|
|
203
203
|
let body = new Uint8Array();
|
|
204
|
-
body =
|
|
204
|
+
body = se_ClientSessionInformationEvent(input, context);
|
|
205
205
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
206
206
|
return { headers, body };
|
|
207
207
|
};
|
|
208
|
-
const
|
|
208
|
+
const se_VideoEvent_event = (input, context) => {
|
|
209
209
|
const headers = {
|
|
210
210
|
":event-type": { type: "string", value: "VideoEvent" },
|
|
211
211
|
":message-type": { type: "string", value: "event" },
|
|
212
212
|
":content-type": { type: "string", value: "application/json" },
|
|
213
213
|
};
|
|
214
214
|
let body = new Uint8Array();
|
|
215
|
-
body =
|
|
215
|
+
body = se_VideoEvent(input, context);
|
|
216
216
|
body = context.utf8Decoder(JSON.stringify(body));
|
|
217
217
|
return { headers, body };
|
|
218
218
|
};
|
|
219
|
-
const
|
|
219
|
+
const de_LivenessResponseStream = (output, context) => {
|
|
220
220
|
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
221
221
|
if (event["ServerSessionInformationEvent"] != null) {
|
|
222
222
|
return {
|
|
223
|
-
ServerSessionInformationEvent: await
|
|
223
|
+
ServerSessionInformationEvent: await de_ServerSessionInformationEvent_event(event["ServerSessionInformationEvent"], context),
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
if (event["DisconnectionEvent"] != null) {
|
|
227
227
|
return {
|
|
228
|
-
DisconnectionEvent: await
|
|
228
|
+
DisconnectionEvent: await de_DisconnectionEvent_event(event["DisconnectionEvent"], context),
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
if (event["ValidationException"] != null) {
|
|
232
232
|
return {
|
|
233
|
-
ValidationException: await
|
|
233
|
+
ValidationException: await de_ValidationException_event(event["ValidationException"], context),
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
if (event["InternalServerException"] != null) {
|
|
237
237
|
return {
|
|
238
|
-
InternalServerException: await
|
|
238
|
+
InternalServerException: await de_InternalServerException_event(event["InternalServerException"], context),
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
241
|
if (event["ThrottlingException"] != null) {
|
|
242
242
|
return {
|
|
243
|
-
ThrottlingException: await
|
|
243
|
+
ThrottlingException: await de_ThrottlingException_event(event["ThrottlingException"], context),
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
246
|
if (event["ServiceQuotaExceededException"] != null) {
|
|
247
247
|
return {
|
|
248
|
-
ServiceQuotaExceededException: await
|
|
248
|
+
ServiceQuotaExceededException: await de_ServiceQuotaExceededException_event(event["ServiceQuotaExceededException"], context),
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
251
|
if (event["ServiceUnavailableException"] != null) {
|
|
252
252
|
return {
|
|
253
|
-
ServiceUnavailableException: await
|
|
253
|
+
ServiceUnavailableException: await de_ServiceUnavailableException_event(event["ServiceUnavailableException"], context),
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
256
|
return { $unknown: output };
|
|
257
257
|
});
|
|
258
258
|
};
|
|
259
|
-
const
|
|
259
|
+
const de_DisconnectionEvent_event = async (output, context) => {
|
|
260
260
|
const contents = {};
|
|
261
261
|
const data = await parseBody(output.body, context);
|
|
262
|
-
Object.assign(contents,
|
|
262
|
+
Object.assign(contents, de_DisconnectionEvent(data, context));
|
|
263
263
|
return contents;
|
|
264
264
|
};
|
|
265
|
-
const
|
|
265
|
+
const de_InternalServerException_event = async (output, context) => {
|
|
266
266
|
const parsedOutput = {
|
|
267
267
|
...output,
|
|
268
268
|
body: await parseBody(output.body, context),
|
|
269
269
|
};
|
|
270
|
-
return
|
|
270
|
+
return de_InternalServerExceptionRes(parsedOutput, context);
|
|
271
271
|
};
|
|
272
|
-
const
|
|
272
|
+
const de_ServerSessionInformationEvent_event = async (output, context) => {
|
|
273
273
|
const contents = {};
|
|
274
274
|
const data = await parseBody(output.body, context);
|
|
275
|
-
Object.assign(contents,
|
|
275
|
+
Object.assign(contents, de_ServerSessionInformationEvent(data, context));
|
|
276
276
|
return contents;
|
|
277
277
|
};
|
|
278
|
-
const
|
|
278
|
+
const de_ServiceQuotaExceededException_event = async (output, context) => {
|
|
279
279
|
const parsedOutput = {
|
|
280
280
|
...output,
|
|
281
281
|
body: await parseBody(output.body, context),
|
|
282
282
|
};
|
|
283
|
-
return
|
|
283
|
+
return de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
284
284
|
};
|
|
285
|
-
const
|
|
285
|
+
const de_ServiceUnavailableException_event = async (output, context) => {
|
|
286
286
|
const parsedOutput = {
|
|
287
287
|
...output,
|
|
288
288
|
body: await parseBody(output.body, context),
|
|
289
289
|
};
|
|
290
|
-
return
|
|
290
|
+
return de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
291
291
|
};
|
|
292
|
-
const
|
|
292
|
+
const de_ThrottlingException_event = async (output, context) => {
|
|
293
293
|
const parsedOutput = {
|
|
294
294
|
...output,
|
|
295
295
|
body: await parseBody(output.body, context),
|
|
296
296
|
};
|
|
297
|
-
return
|
|
297
|
+
return de_ThrottlingExceptionRes(parsedOutput, context);
|
|
298
298
|
};
|
|
299
|
-
const
|
|
299
|
+
const de_ValidationException_event = async (output, context) => {
|
|
300
300
|
const parsedOutput = {
|
|
301
301
|
...output,
|
|
302
302
|
body: await parseBody(output.body, context),
|
|
303
303
|
};
|
|
304
|
-
return
|
|
304
|
+
return de_ValidationExceptionRes(parsedOutput, context);
|
|
305
305
|
};
|
|
306
|
-
const
|
|
306
|
+
const se_BoundingBox = (input, context) => {
|
|
307
307
|
return {
|
|
308
308
|
...(input.Height != null && { Height: (0, smithy_client_1.serializeFloat)(input.Height) }),
|
|
309
309
|
...(input.Left != null && { Left: (0, smithy_client_1.serializeFloat)(input.Left) }),
|
|
@@ -311,66 +311,60 @@ const serializeAws_restJson1BoundingBox = (input, context) => {
|
|
|
311
311
|
...(input.Width != null && { Width: (0, smithy_client_1.serializeFloat)(input.Width) }),
|
|
312
312
|
};
|
|
313
313
|
};
|
|
314
|
-
const
|
|
314
|
+
const se_ClientChallenge = (input, context) => {
|
|
315
315
|
return models_0_1.ClientChallenge.visit(input, {
|
|
316
316
|
FaceMovementAndLightChallenge: (value) => ({
|
|
317
|
-
FaceMovementAndLightChallenge:
|
|
317
|
+
FaceMovementAndLightChallenge: se_FaceMovementAndLightClientChallenge(value, context),
|
|
318
318
|
}),
|
|
319
319
|
_: (name, value) => ({ name: value }),
|
|
320
320
|
});
|
|
321
321
|
};
|
|
322
|
-
const
|
|
322
|
+
const se_ClientSessionInformationEvent = (input, context) => {
|
|
323
323
|
return {
|
|
324
|
-
...(input.Challenge != null && { Challenge:
|
|
324
|
+
...(input.Challenge != null && { Challenge: se_ClientChallenge(input.Challenge, context) }),
|
|
325
325
|
};
|
|
326
326
|
};
|
|
327
|
-
const
|
|
327
|
+
const se_ColorComponentList = (input, context) => {
|
|
328
328
|
return input
|
|
329
329
|
.filter((e) => e != null)
|
|
330
330
|
.map((entry) => {
|
|
331
331
|
return entry;
|
|
332
332
|
});
|
|
333
333
|
};
|
|
334
|
-
const
|
|
334
|
+
const se_ColorDisplayed = (input, context) => {
|
|
335
335
|
return {
|
|
336
|
-
...(input.CurrentColor != null && {
|
|
337
|
-
CurrentColor: serializeAws_restJson1FreshnessColor(input.CurrentColor, context),
|
|
338
|
-
}),
|
|
336
|
+
...(input.CurrentColor != null && { CurrentColor: se_FreshnessColor(input.CurrentColor, context) }),
|
|
339
337
|
...(input.CurrentColorStartTimestamp != null && { CurrentColorStartTimestamp: input.CurrentColorStartTimestamp }),
|
|
340
|
-
...(input.PreviousColor != null && {
|
|
341
|
-
PreviousColor: serializeAws_restJson1FreshnessColor(input.PreviousColor, context),
|
|
342
|
-
}),
|
|
338
|
+
...(input.PreviousColor != null && { PreviousColor: se_FreshnessColor(input.PreviousColor, context) }),
|
|
343
339
|
...(input.SequenceNumber != null && { SequenceNumber: input.SequenceNumber }),
|
|
344
340
|
};
|
|
345
341
|
};
|
|
346
|
-
const
|
|
342
|
+
const se_FaceMovementAndLightClientChallenge = (input, context) => {
|
|
347
343
|
return {
|
|
348
344
|
...(input.ChallengeId != null && { ChallengeId: input.ChallengeId }),
|
|
349
|
-
...(input.ColorDisplayed != null && {
|
|
350
|
-
|
|
351
|
-
}),
|
|
352
|
-
...(input.InitialFace != null && { InitialFace: serializeAws_restJson1InitialFace(input.InitialFace, context) }),
|
|
353
|
-
...(input.TargetFace != null && { TargetFace: serializeAws_restJson1TargetFace(input.TargetFace, context) }),
|
|
345
|
+
...(input.ColorDisplayed != null && { ColorDisplayed: se_ColorDisplayed(input.ColorDisplayed, context) }),
|
|
346
|
+
...(input.InitialFace != null && { InitialFace: se_InitialFace(input.InitialFace, context) }),
|
|
347
|
+
...(input.TargetFace != null && { TargetFace: se_TargetFace(input.TargetFace, context) }),
|
|
354
348
|
...(input.VideoEndTimestamp != null && { VideoEndTimestamp: input.VideoEndTimestamp }),
|
|
355
349
|
...(input.VideoStartTimestamp != null && { VideoStartTimestamp: input.VideoStartTimestamp }),
|
|
356
350
|
};
|
|
357
351
|
};
|
|
358
|
-
const
|
|
352
|
+
const se_FreshnessColor = (input, context) => {
|
|
359
353
|
return {
|
|
360
|
-
...(input.RGB != null && { RGB:
|
|
354
|
+
...(input.RGB != null && { RGB: se_ColorComponentList(input.RGB, context) }),
|
|
361
355
|
};
|
|
362
356
|
};
|
|
363
|
-
const
|
|
357
|
+
const se_InitialFace = (input, context) => {
|
|
364
358
|
return {
|
|
365
|
-
...(input.BoundingBox != null && { BoundingBox:
|
|
359
|
+
...(input.BoundingBox != null && { BoundingBox: se_BoundingBox(input.BoundingBox, context) }),
|
|
366
360
|
...(input.InitialFaceDetectedTimestamp != null && {
|
|
367
361
|
InitialFaceDetectedTimestamp: input.InitialFaceDetectedTimestamp,
|
|
368
362
|
}),
|
|
369
363
|
};
|
|
370
364
|
};
|
|
371
|
-
const
|
|
365
|
+
const se_TargetFace = (input, context) => {
|
|
372
366
|
return {
|
|
373
|
-
...(input.BoundingBox != null && { BoundingBox:
|
|
367
|
+
...(input.BoundingBox != null && { BoundingBox: se_BoundingBox(input.BoundingBox, context) }),
|
|
374
368
|
...(input.FaceDetectedInTargetPositionEndTimestamp != null && {
|
|
375
369
|
FaceDetectedInTargetPositionEndTimestamp: input.FaceDetectedInTargetPositionEndTimestamp,
|
|
376
370
|
}),
|
|
@@ -379,13 +373,13 @@ const serializeAws_restJson1TargetFace = (input, context) => {
|
|
|
379
373
|
}),
|
|
380
374
|
};
|
|
381
375
|
};
|
|
382
|
-
const
|
|
376
|
+
const se_VideoEvent = (input, context) => {
|
|
383
377
|
return {
|
|
384
378
|
...(input.TimestampMillis != null && { TimestampMillis: input.TimestampMillis }),
|
|
385
379
|
...(input.VideoChunk != null && { VideoChunk: context.base64Encoder(input.VideoChunk) }),
|
|
386
380
|
};
|
|
387
381
|
};
|
|
388
|
-
const
|
|
382
|
+
const de_ChallengeConfig = (output, context) => {
|
|
389
383
|
return {
|
|
390
384
|
BlazeFaceDetectionThreshold: (0, smithy_client_1.limitedParseFloat32)(output.BlazeFaceDetectionThreshold),
|
|
391
385
|
FaceDistanceThreshold: (0, smithy_client_1.limitedParseFloat32)(output.FaceDistanceThreshold),
|
|
@@ -399,7 +393,7 @@ const deserializeAws_restJson1ChallengeConfig = (output, context) => {
|
|
|
399
393
|
OvalIouWidthThreshold: (0, smithy_client_1.limitedParseFloat32)(output.OvalIouWidthThreshold),
|
|
400
394
|
};
|
|
401
395
|
};
|
|
402
|
-
const
|
|
396
|
+
const de_ColorComponentList = (output, context) => {
|
|
403
397
|
const retVal = (output || [])
|
|
404
398
|
.filter((e) => e != null)
|
|
405
399
|
.map((entry) => {
|
|
@@ -410,51 +404,43 @@ const deserializeAws_restJson1ColorComponentList = (output, context) => {
|
|
|
410
404
|
});
|
|
411
405
|
return retVal;
|
|
412
406
|
};
|
|
413
|
-
const
|
|
407
|
+
const de_ColorSequence = (output, context) => {
|
|
414
408
|
return {
|
|
415
409
|
DownscrollDuration: (0, smithy_client_1.limitedParseFloat32)(output.DownscrollDuration),
|
|
416
410
|
FlatDisplayDuration: (0, smithy_client_1.limitedParseFloat32)(output.FlatDisplayDuration),
|
|
417
|
-
FreshnessColor: output.FreshnessColor != null
|
|
418
|
-
? deserializeAws_restJson1FreshnessColor(output.FreshnessColor, context)
|
|
419
|
-
: undefined,
|
|
411
|
+
FreshnessColor: output.FreshnessColor != null ? de_FreshnessColor(output.FreshnessColor, context) : undefined,
|
|
420
412
|
};
|
|
421
413
|
};
|
|
422
|
-
const
|
|
414
|
+
const de_ColorSequences = (output, context) => {
|
|
423
415
|
const retVal = (output || [])
|
|
424
416
|
.filter((e) => e != null)
|
|
425
417
|
.map((entry) => {
|
|
426
418
|
if (entry === null) {
|
|
427
419
|
return null;
|
|
428
420
|
}
|
|
429
|
-
return
|
|
421
|
+
return de_ColorSequence(entry, context);
|
|
430
422
|
});
|
|
431
423
|
return retVal;
|
|
432
424
|
};
|
|
433
|
-
const
|
|
425
|
+
const de_DisconnectionEvent = (output, context) => {
|
|
434
426
|
return {
|
|
435
427
|
TimestampMillis: (0, smithy_client_1.expectLong)(output.TimestampMillis),
|
|
436
428
|
};
|
|
437
429
|
};
|
|
438
|
-
const
|
|
430
|
+
const de_FaceMovementAndLightServerChallenge = (output, context) => {
|
|
439
431
|
return {
|
|
440
|
-
ChallengeConfig: output.ChallengeConfig != null
|
|
441
|
-
|
|
442
|
-
: undefined,
|
|
443
|
-
ColorSequences: output.ColorSequences != null
|
|
444
|
-
? deserializeAws_restJson1ColorSequences(output.ColorSequences, context)
|
|
445
|
-
: undefined,
|
|
432
|
+
ChallengeConfig: output.ChallengeConfig != null ? de_ChallengeConfig(output.ChallengeConfig, context) : undefined,
|
|
433
|
+
ColorSequences: output.ColorSequences != null ? de_ColorSequences(output.ColorSequences, context) : undefined,
|
|
446
434
|
LightChallengeType: (0, smithy_client_1.expectString)(output.LightChallengeType),
|
|
447
|
-
OvalParameters: output.OvalParameters != null
|
|
448
|
-
? deserializeAws_restJson1OvalParameters(output.OvalParameters, context)
|
|
449
|
-
: undefined,
|
|
435
|
+
OvalParameters: output.OvalParameters != null ? de_OvalParameters(output.OvalParameters, context) : undefined,
|
|
450
436
|
};
|
|
451
437
|
};
|
|
452
|
-
const
|
|
438
|
+
const de_FreshnessColor = (output, context) => {
|
|
453
439
|
return {
|
|
454
|
-
RGB: output.RGB != null ?
|
|
440
|
+
RGB: output.RGB != null ? de_ColorComponentList(output.RGB, context) : undefined,
|
|
455
441
|
};
|
|
456
442
|
};
|
|
457
|
-
const
|
|
443
|
+
const de_OvalParameters = (output, context) => {
|
|
458
444
|
return {
|
|
459
445
|
CenterX: (0, smithy_client_1.limitedParseFloat32)(output.CenterX),
|
|
460
446
|
CenterY: (0, smithy_client_1.limitedParseFloat32)(output.CenterY),
|
|
@@ -462,26 +448,22 @@ const deserializeAws_restJson1OvalParameters = (output, context) => {
|
|
|
462
448
|
Width: (0, smithy_client_1.limitedParseFloat32)(output.Width),
|
|
463
449
|
};
|
|
464
450
|
};
|
|
465
|
-
const
|
|
451
|
+
const de_ServerChallenge = (output, context) => {
|
|
466
452
|
if (output.FaceMovementAndLightChallenge != null) {
|
|
467
453
|
return {
|
|
468
|
-
FaceMovementAndLightChallenge:
|
|
454
|
+
FaceMovementAndLightChallenge: de_FaceMovementAndLightServerChallenge(output.FaceMovementAndLightChallenge, context),
|
|
469
455
|
};
|
|
470
456
|
}
|
|
471
457
|
return { $unknown: Object.entries(output)[0] };
|
|
472
458
|
};
|
|
473
|
-
const
|
|
459
|
+
const de_ServerSessionInformationEvent = (output, context) => {
|
|
474
460
|
return {
|
|
475
|
-
SessionInformation: output.SessionInformation != null
|
|
476
|
-
? deserializeAws_restJson1SessionInformation(output.SessionInformation, context)
|
|
477
|
-
: undefined,
|
|
461
|
+
SessionInformation: output.SessionInformation != null ? de_SessionInformation(output.SessionInformation, context) : undefined,
|
|
478
462
|
};
|
|
479
463
|
};
|
|
480
|
-
const
|
|
464
|
+
const de_SessionInformation = (output, context) => {
|
|
481
465
|
return {
|
|
482
|
-
Challenge: output.Challenge != null
|
|
483
|
-
? deserializeAws_restJson1ServerChallenge((0, smithy_client_1.expectUnion)(output.Challenge), context)
|
|
484
|
-
: undefined,
|
|
466
|
+
Challenge: output.Challenge != null ? de_ServerChallenge((0, smithy_client_1.expectUnion)(output.Challenge), context) : undefined,
|
|
485
467
|
};
|
|
486
468
|
};
|
|
487
469
|
const deserializeMetadata = (output) => ({
|
|
@@ -4,7 +4,7 @@ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
|
4
4
|
import { getWebSocketPlugin } from "@aws-sdk/middleware-websocket";
|
|
5
5
|
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
6
6
|
import { StartFaceLivenessSessionRequestFilterSensitiveLog, StartFaceLivenessSessionResponseFilterSensitiveLog, } from "../models/models_0";
|
|
7
|
-
import {
|
|
7
|
+
import { de_StartFaceLivenessSessionCommand, se_StartFaceLivenessSessionCommand } from "../protocols/Aws_restJson1";
|
|
8
8
|
export class StartFaceLivenessSessionCommand extends $Command {
|
|
9
9
|
static getEndpointParameterInstructions() {
|
|
10
10
|
return {
|
|
@@ -38,9 +38,9 @@ export class StartFaceLivenessSessionCommand extends $Command {
|
|
|
38
38
|
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
39
39
|
}
|
|
40
40
|
serialize(input, context) {
|
|
41
|
-
return
|
|
41
|
+
return se_StartFaceLivenessSessionCommand(input, context);
|
|
42
42
|
}
|
|
43
43
|
deserialize(output, context) {
|
|
44
|
-
return
|
|
44
|
+
return de_StartFaceLivenessSessionCommand(output, context);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const q = "required", r = "fn", s = "argv", t = "ref";
|
|
2
2
|
const a = "isSet", b = "tree", c = "error", d = "endpoint", e = "PartitionResult", f = { [q]: false, "type": "String" }, g = { [q]: true, "default": false, "type": "Boolean" }, h = { [t]: "Endpoint" }, i = { [r]: "booleanEquals", [s]: [{ [t]: "UseFIPS" }, true] }, j = { [r]: "booleanEquals", [s]: [{ [t]: "UseDualStack" }, true] }, k = {}, l = { [r]: "booleanEquals", [s]: [true, { [r]: "getAttr", [s]: [{ [t]: e }, "supportsFIPS"] }] }, m = { [r]: "booleanEquals", [s]: [true, { [r]: "getAttr", [s]: [{ [t]: e }, "supportsDualStack"] }] }, n = [i], o = [j], p = [{ [t]: "Region" }];
|
|
3
|
-
const _data = { version: "1.0", parameters: { Region: f, UseDualStack: g, UseFIPS: g, Endpoint: f }, rules: [{ conditions: [{ [r]: a, [s]: [h] }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: h, properties: k, headers: k }, type: d }] }] }, { type: b, rules: [{ conditions: [{ [r]: a, [s]: p }], type: b, rules: [{ conditions: [{ [r]: "aws.partition", [s]: p, assign: e }], type: b, rules: [{ conditions: [i, j], type: b, rules: [{ conditions: [l, m], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://
|
|
3
|
+
const _data = { version: "1.0", parameters: { Region: f, UseDualStack: g, UseFIPS: g, Endpoint: f }, rules: [{ conditions: [{ [r]: a, [s]: [h] }], type: b, rules: [{ conditions: n, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { type: b, rules: [{ conditions: o, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: h, properties: k, headers: k }, type: d }] }] }, { type: b, rules: [{ conditions: [{ [r]: a, [s]: p }], type: b, rules: [{ conditions: [{ [r]: "aws.partition", [s]: p, assign: e }], type: b, rules: [{ conditions: [i, j], type: b, rules: [{ conditions: [l, m], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://streaming-rekognition-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: k, headers: k }, type: d }] }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: n, type: b, rules: [{ conditions: [l], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://streaming-rekognition-fips.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: o, type: b, rules: [{ conditions: [m], type: b, rules: [{ type: b, rules: [{ endpoint: { url: "https://streaming-rekognition.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: k, headers: k }, type: d }] }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { type: b, rules: [{ endpoint: { url: "https://streaming-rekognition.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] }] };
|
|
4
4
|
export const ruleSet = _data;
|