@aws-sdk/client-rekognition 3.309.0 → 3.312.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +16 -0
  2. package/dist-cjs/Rekognition.js +30 -0
  3. package/dist-cjs/commands/CreateFaceLivenessSessionCommand.js +45 -0
  4. package/dist-cjs/commands/GetFaceLivenessSessionResultsCommand.js +46 -0
  5. package/dist-cjs/commands/index.js +2 -0
  6. package/dist-cjs/endpoint/ruleset.js +3 -3
  7. package/dist-cjs/models/index.js +1 -0
  8. package/dist-cjs/models/models_0.js +36 -2
  9. package/dist-cjs/models/models_1.js +2 -0
  10. package/dist-cjs/protocols/Aws_json1_1.js +256 -255
  11. package/dist-es/Rekognition.js +30 -0
  12. package/dist-es/commands/CreateFaceLivenessSessionCommand.js +41 -0
  13. package/dist-es/commands/GetFaceLivenessSessionResultsCommand.js +42 -0
  14. package/dist-es/commands/index.js +2 -0
  15. package/dist-es/endpoint/ruleset.js +3 -3
  16. package/dist-es/models/index.js +1 -0
  17. package/dist-es/models/models_0.js +31 -0
  18. package/dist-es/models/models_1.js +1 -0
  19. package/dist-es/protocols/Aws_json1_1.js +250 -253
  20. package/dist-types/Rekognition.d.ts +51 -10
  21. package/dist-types/RekognitionClient.d.ts +4 -2
  22. package/dist-types/commands/CopyProjectVersionCommand.d.ts +1 -0
  23. package/dist-types/commands/CreateFaceLivenessSessionCommand.d.ts +94 -0
  24. package/dist-types/commands/CreateStreamProcessorCommand.d.ts +17 -7
  25. package/dist-types/commands/DeleteProjectPolicyCommand.d.ts +1 -0
  26. package/dist-types/commands/DetectLabelsCommand.d.ts +2 -3
  27. package/dist-types/commands/GetFaceLivenessSessionResultsCommand.d.ts +88 -0
  28. package/dist-types/commands/ListProjectPoliciesCommand.d.ts +1 -0
  29. package/dist-types/commands/PutProjectPolicyCommand.d.ts +1 -0
  30. package/dist-types/commands/StopProjectVersionCommand.d.ts +1 -0
  31. package/dist-types/commands/UpdateStreamProcessorCommand.d.ts +4 -1
  32. package/dist-types/commands/index.d.ts +2 -0
  33. package/dist-types/endpoint/EndpointParameters.d.ts +1 -1
  34. package/dist-types/models/index.d.ts +1 -0
  35. package/dist-types/models/models_0.d.ts +241 -106
  36. package/dist-types/models/models_1.d.ts +56 -0
  37. package/dist-types/protocols/Aws_json1_1.d.ts +18 -0
  38. package/dist-types/ts3.4/Rekognition.d.ts +34 -0
  39. package/dist-types/ts3.4/RekognitionClient.d.ts +12 -0
  40. package/dist-types/ts3.4/commands/CreateFaceLivenessSessionCommand.d.ts +41 -0
  41. package/dist-types/ts3.4/commands/GetFaceLivenessSessionResultsCommand.d.ts +41 -0
  42. package/dist-types/ts3.4/commands/UpdateStreamProcessorCommand.d.ts +1 -1
  43. package/dist-types/ts3.4/commands/index.d.ts +2 -0
  44. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +1 -1
  45. package/dist-types/ts3.4/models/index.d.ts +1 -0
  46. package/dist-types/ts3.4/models/models_0.d.ts +59 -17
  47. package/dist-types/ts3.4/models/models_1.d.ts +17 -0
  48. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +24 -0
  49. package/package.json +36 -36
@@ -2,6 +2,7 @@ import { CompareFacesCommand, } from "./commands/CompareFacesCommand";
2
2
  import { CopyProjectVersionCommand, } from "./commands/CopyProjectVersionCommand";
3
3
  import { CreateCollectionCommand, } from "./commands/CreateCollectionCommand";
4
4
  import { CreateDatasetCommand, } from "./commands/CreateDatasetCommand";
5
+ import { CreateFaceLivenessSessionCommand, } from "./commands/CreateFaceLivenessSessionCommand";
5
6
  import { CreateProjectCommand, } from "./commands/CreateProjectCommand";
6
7
  import { CreateProjectVersionCommand, } from "./commands/CreateProjectVersionCommand";
7
8
  import { CreateStreamProcessorCommand, } from "./commands/CreateStreamProcessorCommand";
@@ -28,6 +29,7 @@ import { GetCelebrityInfoCommand, } from "./commands/GetCelebrityInfoCommand";
28
29
  import { GetCelebrityRecognitionCommand, } from "./commands/GetCelebrityRecognitionCommand";
29
30
  import { GetContentModerationCommand, } from "./commands/GetContentModerationCommand";
30
31
  import { GetFaceDetectionCommand, } from "./commands/GetFaceDetectionCommand";
32
+ import { GetFaceLivenessSessionResultsCommand, } from "./commands/GetFaceLivenessSessionResultsCommand";
31
33
  import { GetFaceSearchCommand, } from "./commands/GetFaceSearchCommand";
32
34
  import { GetLabelDetectionCommand, } from "./commands/GetLabelDetectionCommand";
33
35
  import { GetPersonTrackingCommand, } from "./commands/GetPersonTrackingCommand";
@@ -119,6 +121,20 @@ export class Rekognition extends RekognitionClient {
119
121
  return this.send(command, optionsOrCb);
120
122
  }
121
123
  }
124
+ createFaceLivenessSession(args, optionsOrCb, cb) {
125
+ const command = new CreateFaceLivenessSessionCommand(args);
126
+ if (typeof optionsOrCb === "function") {
127
+ this.send(command, optionsOrCb);
128
+ }
129
+ else if (typeof cb === "function") {
130
+ if (typeof optionsOrCb !== "object")
131
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
132
+ this.send(command, optionsOrCb || {}, cb);
133
+ }
134
+ else {
135
+ return this.send(command, optionsOrCb);
136
+ }
137
+ }
122
138
  createProject(args, optionsOrCb, cb) {
123
139
  const command = new CreateProjectCommand(args);
124
140
  if (typeof optionsOrCb === "function") {
@@ -483,6 +499,20 @@ export class Rekognition extends RekognitionClient {
483
499
  return this.send(command, optionsOrCb);
484
500
  }
485
501
  }
502
+ getFaceLivenessSessionResults(args, optionsOrCb, cb) {
503
+ const command = new GetFaceLivenessSessionResultsCommand(args);
504
+ if (typeof optionsOrCb === "function") {
505
+ this.send(command, optionsOrCb);
506
+ }
507
+ else if (typeof cb === "function") {
508
+ if (typeof optionsOrCb !== "object")
509
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
510
+ this.send(command, optionsOrCb || {}, cb);
511
+ }
512
+ else {
513
+ return this.send(command, optionsOrCb);
514
+ }
515
+ }
486
516
  getFaceSearch(args, optionsOrCb, cb) {
487
517
  const command = new GetFaceSearchCommand(args);
488
518
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,41 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { de_CreateFaceLivenessSessionCommand, se_CreateFaceLivenessSessionCommand } from "../protocols/Aws_json1_1";
5
+ export class CreateFaceLivenessSessionCommand extends $Command {
6
+ static getEndpointParameterInstructions() {
7
+ return {
8
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
9
+ Endpoint: { type: "builtInParams", name: "endpoint" },
10
+ Region: { type: "builtInParams", name: "region" },
11
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
12
+ };
13
+ }
14
+ constructor(input) {
15
+ super();
16
+ this.input = input;
17
+ }
18
+ resolveMiddleware(clientStack, configuration, options) {
19
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
20
+ this.middlewareStack.use(getEndpointPlugin(configuration, CreateFaceLivenessSessionCommand.getEndpointParameterInstructions()));
21
+ const stack = clientStack.concat(this.middlewareStack);
22
+ const { logger } = configuration;
23
+ const clientName = "RekognitionClient";
24
+ const commandName = "CreateFaceLivenessSessionCommand";
25
+ const handlerExecutionContext = {
26
+ logger,
27
+ clientName,
28
+ commandName,
29
+ inputFilterSensitiveLog: (_) => _,
30
+ outputFilterSensitiveLog: (_) => _,
31
+ };
32
+ const { requestHandler } = configuration;
33
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
34
+ }
35
+ serialize(input, context) {
36
+ return se_CreateFaceLivenessSessionCommand(input, context);
37
+ }
38
+ deserialize(output, context) {
39
+ return de_CreateFaceLivenessSessionCommand(output, context);
40
+ }
41
+ }
@@ -0,0 +1,42 @@
1
+ import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
2
+ import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3
+ import { Command as $Command } from "@aws-sdk/smithy-client";
4
+ import { GetFaceLivenessSessionResultsResponseFilterSensitiveLog, } from "../models/models_0";
5
+ import { de_GetFaceLivenessSessionResultsCommand, se_GetFaceLivenessSessionResultsCommand, } from "../protocols/Aws_json1_1";
6
+ export class GetFaceLivenessSessionResultsCommand extends $Command {
7
+ static getEndpointParameterInstructions() {
8
+ return {
9
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
10
+ Endpoint: { type: "builtInParams", name: "endpoint" },
11
+ Region: { type: "builtInParams", name: "region" },
12
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
13
+ };
14
+ }
15
+ constructor(input) {
16
+ super();
17
+ this.input = input;
18
+ }
19
+ resolveMiddleware(clientStack, configuration, options) {
20
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
21
+ this.middlewareStack.use(getEndpointPlugin(configuration, GetFaceLivenessSessionResultsCommand.getEndpointParameterInstructions()));
22
+ const stack = clientStack.concat(this.middlewareStack);
23
+ const { logger } = configuration;
24
+ const clientName = "RekognitionClient";
25
+ const commandName = "GetFaceLivenessSessionResultsCommand";
26
+ const handlerExecutionContext = {
27
+ logger,
28
+ clientName,
29
+ commandName,
30
+ inputFilterSensitiveLog: (_) => _,
31
+ outputFilterSensitiveLog: GetFaceLivenessSessionResultsResponseFilterSensitiveLog,
32
+ };
33
+ const { requestHandler } = configuration;
34
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
35
+ }
36
+ serialize(input, context) {
37
+ return se_GetFaceLivenessSessionResultsCommand(input, context);
38
+ }
39
+ deserialize(output, context) {
40
+ return de_GetFaceLivenessSessionResultsCommand(output, context);
41
+ }
42
+ }
@@ -2,6 +2,7 @@ export * from "./CompareFacesCommand";
2
2
  export * from "./CopyProjectVersionCommand";
3
3
  export * from "./CreateCollectionCommand";
4
4
  export * from "./CreateDatasetCommand";
5
+ export * from "./CreateFaceLivenessSessionCommand";
5
6
  export * from "./CreateProjectCommand";
6
7
  export * from "./CreateProjectVersionCommand";
7
8
  export * from "./CreateStreamProcessorCommand";
@@ -28,6 +29,7 @@ export * from "./GetCelebrityInfoCommand";
28
29
  export * from "./GetCelebrityRecognitionCommand";
29
30
  export * from "./GetContentModerationCommand";
30
31
  export * from "./GetFaceDetectionCommand";
32
+ export * from "./GetFaceLivenessSessionResultsCommand";
31
33
  export * from "./GetFaceSearchCommand";
32
34
  export * from "./GetLabelDetectionCommand";
33
35
  export * from "./GetPersonTrackingCommand";
@@ -1,4 +1,4 @@
1
- const s = "fn", t = "argv", u = "ref";
2
- const a = true, b = false, c = "String", d = "PartitionResult", e = "tree", f = "error", g = "endpoint", h = "stringEquals", i = { "required": true, "default": false, "type": "Boolean" }, j = { [u]: "Region" }, k = { [u]: "Endpoint" }, l = { [s]: "booleanEquals", [t]: [{ [u]: "UseFIPS" }, true] }, m = { [s]: "booleanEquals", [t]: [{ [u]: "UseDualStack" }, true] }, n = {}, o = { [s]: "booleanEquals", [t]: [true, { [s]: "getAttr", [t]: [{ [u]: d }, "supportsFIPS"] }] }, p = { [s]: "booleanEquals", [t]: [true, { [s]: "getAttr", [t]: [{ [u]: d }, "supportsDualStack"] }] }, q = [l], r = [m];
3
- const _data = { version: "1.0", parameters: { Region: { required: a, type: c }, UseDualStack: i, UseFIPS: i, Endpoint: { required: b, type: c } }, rules: [{ conditions: [{ [s]: "aws.partition", [t]: [j], assign: d }], type: e, rules: [{ conditions: [{ [s]: "isSet", [t]: [k] }], type: e, rules: [{ conditions: q, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: f }, { type: e, rules: [{ conditions: r, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: f }, { endpoint: { url: k, properties: n, headers: n }, type: g }] }] }, { conditions: [l, m], type: e, rules: [{ conditions: [o, p], type: e, rules: [{ endpoint: { url: "https://rekognition-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: g }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: f }] }, { conditions: q, type: e, rules: [{ conditions: [o], type: e, rules: [{ type: e, rules: [{ conditions: [{ [s]: h, [t]: [j, "rekognition.ca-central-1"] }], endpoint: { url: "https://rekognition-fips.ca-central-1.amazonaws.com", properties: n, headers: n }, type: g }, { conditions: [{ [s]: h, [t]: [j, "rekognition.us-east-1"] }], endpoint: { url: "https://rekognition-fips.us-east-1.amazonaws.com", properties: n, headers: n }, type: g }, { conditions: [{ [s]: h, [t]: [j, "rekognition.us-east-2"] }], endpoint: { url: "https://rekognition-fips.us-east-2.amazonaws.com", properties: n, headers: n }, type: g }, { conditions: [{ [s]: h, [t]: [j, "rekognition.us-west-1"] }], endpoint: { url: "https://rekognition-fips.us-west-1.amazonaws.com", properties: n, headers: n }, type: g }, { conditions: [{ [s]: h, [t]: [j, "rekognition.us-west-2"] }], endpoint: { url: "https://rekognition-fips.us-west-2.amazonaws.com", properties: n, headers: n }, type: g }, { conditions: [{ [s]: h, [t]: [j, "rekognition.us-gov-west-1"] }], endpoint: { url: "https://rekognition-fips.us-gov-west-1.amazonaws.com", properties: n, headers: n }, type: g }, { endpoint: { url: "https://rekognition-fips.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: g }] }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: f }] }, { conditions: r, type: e, rules: [{ conditions: [p], type: e, rules: [{ endpoint: { url: "https://rekognition.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: n, headers: n }, type: g }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: f }] }, { endpoint: { url: "https://rekognition.{Region}.{PartitionResult#dnsSuffix}", properties: n, headers: n }, type: g }] }] };
1
+ const q = "required", r = "fn", s = "argv", t = "ref";
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://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://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://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://rekognition.{Region}.{PartitionResult#dnsSuffix}", properties: k, headers: k }, type: d }] }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] }] };
4
4
  export const ruleSet = _data;
@@ -1 +1,2 @@
1
1
  export * from "./models_0";
2
+ export * from "./models_1";
@@ -1,3 +1,4 @@
1
+ import { SENSITIVE_STRING, } from "@aws-sdk/smithy-client";
1
2
  import { RekognitionServiceException as __BaseException } from "./RekognitionServiceException";
2
3
  export class AccessDeniedException extends __BaseException {
3
4
  constructor(opts) {
@@ -420,6 +421,27 @@ export const VideoColorRange = {
420
421
  FULL: "FULL",
421
422
  LIMITED: "LIMITED",
422
423
  };
424
+ export const LivenessSessionStatus = {
425
+ CREATED: "CREATED",
426
+ FAILED: "FAILED",
427
+ IN_PROGRESS: "IN_PROGRESS",
428
+ SUCCEEDED: "SUCCEEDED",
429
+ };
430
+ export class SessionNotFoundException extends __BaseException {
431
+ constructor(opts) {
432
+ super({
433
+ name: "SessionNotFoundException",
434
+ $fault: "client",
435
+ ...opts,
436
+ });
437
+ this.name = "SessionNotFoundException";
438
+ this.$fault = "client";
439
+ Object.setPrototypeOf(this, SessionNotFoundException.prototype);
440
+ this.Message = opts.Message;
441
+ this.Code = opts.Code;
442
+ this.Logref = opts.Logref;
443
+ }
444
+ }
423
445
  export const LabelDetectionAggregateBy = {
424
446
  SEGMENTS: "SEGMENTS",
425
447
  TIMESTAMPS: "TIMESTAMPS",
@@ -506,3 +528,12 @@ export const StreamProcessorParameterToDelete = {
506
528
  ConnectedHomeMinConfidence: "ConnectedHomeMinConfidence",
507
529
  RegionsOfInterest: "RegionsOfInterest",
508
530
  };
531
+ export const AuditImageFilterSensitiveLog = (obj) => ({
532
+ ...obj,
533
+ ...(obj.Bytes && { Bytes: SENSITIVE_STRING }),
534
+ });
535
+ export const GetFaceLivenessSessionResultsResponseFilterSensitiveLog = (obj) => ({
536
+ ...obj,
537
+ ...(obj.ReferenceImage && { ReferenceImage: AuditImageFilterSensitiveLog(obj.ReferenceImage) }),
538
+ ...(obj.AuditImages && { AuditImages: obj.AuditImages.map((item) => AuditImageFilterSensitiveLog(item)) }),
539
+ });
@@ -0,0 +1 @@
1
+ export {};