@aws-sdk/client-textract 3.38.0 → 3.39.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/CHANGELOG.md +11 -0
- package/dist-cjs/Textract.js +30 -0
- package/dist-cjs/commands/GetExpenseAnalysisCommand.js +36 -0
- package/dist-cjs/commands/StartExpenseAnalysisCommand.js +36 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/endpoints.js +5 -0
- package/dist-cjs/models/models_0.js +26 -2
- package/dist-cjs/protocols/Aws_json1_1.js +306 -1
- package/dist-es/Textract.js +30 -0
- package/dist-es/commands/GetExpenseAnalysisCommand.js +39 -0
- package/dist-es/commands/StartExpenseAnalysisCommand.js +39 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/endpoints.js +5 -0
- package/dist-es/models/models_0.js +16 -0
- package/dist-es/protocols/Aws_json1_1.js +314 -0
- package/dist-types/Textract.d.ts +47 -2
- package/dist-types/TextractClient.d.ts +4 -2
- package/dist-types/commands/GetExpenseAnalysisCommand.d.ts +51 -0
- package/dist-types/commands/StartDocumentAnalysisCommand.d.ts +1 -1
- package/dist-types/commands/StartDocumentTextDetectionCommand.d.ts +1 -1
- package/dist-types/commands/StartExpenseAnalysisCommand.d.ts +50 -0
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/models/models_0.d.ts +123 -2
- package/dist-types/protocols/Aws_json1_1.d.ts +6 -0
- package/dist-types/ts3.4/Textract.d.ts +10 -0
- package/dist-types/ts3.4/TextractClient.d.ts +4 -2
- package/dist-types/ts3.4/commands/GetExpenseAnalysisCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/StartExpenseAnalysisCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/models/models_0.d.ts +58 -0
- package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +6 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.39.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.38.0...v3.39.0) (2021-10-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **clients:** update clients as of 2021/10/28 ([#2955](https://github.com/aws/aws-sdk-js-v3/issues/2955)) ([378d161](https://github.com/aws/aws-sdk-js-v3/commit/378d16166de49b06263291001986715d9533cadf))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.38.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.37.0...v3.38.0) (2021-10-22)
|
|
7
18
|
|
|
8
19
|
|
package/dist-cjs/Textract.js
CHANGED
|
@@ -6,8 +6,10 @@ const AnalyzeExpenseCommand_1 = require("./commands/AnalyzeExpenseCommand");
|
|
|
6
6
|
const DetectDocumentTextCommand_1 = require("./commands/DetectDocumentTextCommand");
|
|
7
7
|
const GetDocumentAnalysisCommand_1 = require("./commands/GetDocumentAnalysisCommand");
|
|
8
8
|
const GetDocumentTextDetectionCommand_1 = require("./commands/GetDocumentTextDetectionCommand");
|
|
9
|
+
const GetExpenseAnalysisCommand_1 = require("./commands/GetExpenseAnalysisCommand");
|
|
9
10
|
const StartDocumentAnalysisCommand_1 = require("./commands/StartDocumentAnalysisCommand");
|
|
10
11
|
const StartDocumentTextDetectionCommand_1 = require("./commands/StartDocumentTextDetectionCommand");
|
|
12
|
+
const StartExpenseAnalysisCommand_1 = require("./commands/StartExpenseAnalysisCommand");
|
|
11
13
|
const TextractClient_1 = require("./TextractClient");
|
|
12
14
|
class Textract extends TextractClient_1.TextractClient {
|
|
13
15
|
analyzeDocument(args, optionsOrCb, cb) {
|
|
@@ -80,6 +82,20 @@ class Textract extends TextractClient_1.TextractClient {
|
|
|
80
82
|
return this.send(command, optionsOrCb);
|
|
81
83
|
}
|
|
82
84
|
}
|
|
85
|
+
getExpenseAnalysis(args, optionsOrCb, cb) {
|
|
86
|
+
const command = new GetExpenseAnalysisCommand_1.GetExpenseAnalysisCommand(args);
|
|
87
|
+
if (typeof optionsOrCb === "function") {
|
|
88
|
+
this.send(command, optionsOrCb);
|
|
89
|
+
}
|
|
90
|
+
else if (typeof cb === "function") {
|
|
91
|
+
if (typeof optionsOrCb !== "object")
|
|
92
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
93
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return this.send(command, optionsOrCb);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
83
99
|
startDocumentAnalysis(args, optionsOrCb, cb) {
|
|
84
100
|
const command = new StartDocumentAnalysisCommand_1.StartDocumentAnalysisCommand(args);
|
|
85
101
|
if (typeof optionsOrCb === "function") {
|
|
@@ -108,5 +124,19 @@ class Textract extends TextractClient_1.TextractClient {
|
|
|
108
124
|
return this.send(command, optionsOrCb);
|
|
109
125
|
}
|
|
110
126
|
}
|
|
127
|
+
startExpenseAnalysis(args, optionsOrCb, cb) {
|
|
128
|
+
const command = new StartExpenseAnalysisCommand_1.StartExpenseAnalysisCommand(args);
|
|
129
|
+
if (typeof optionsOrCb === "function") {
|
|
130
|
+
this.send(command, optionsOrCb);
|
|
131
|
+
}
|
|
132
|
+
else if (typeof cb === "function") {
|
|
133
|
+
if (typeof optionsOrCb !== "object")
|
|
134
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
135
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
return this.send(command, optionsOrCb);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
111
141
|
}
|
|
112
142
|
exports.Textract = Textract;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetExpenseAnalysisCommand = void 0;
|
|
4
|
+
const middleware_serde_1 = require("@aws-sdk/middleware-serde");
|
|
5
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
|
+
const models_0_1 = require("../models/models_0");
|
|
7
|
+
const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
|
|
8
|
+
class GetExpenseAnalysisCommand extends smithy_client_1.Command {
|
|
9
|
+
constructor(input) {
|
|
10
|
+
super();
|
|
11
|
+
this.input = input;
|
|
12
|
+
}
|
|
13
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
14
|
+
this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
15
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
16
|
+
const { logger } = configuration;
|
|
17
|
+
const clientName = "TextractClient";
|
|
18
|
+
const commandName = "GetExpenseAnalysisCommand";
|
|
19
|
+
const handlerExecutionContext = {
|
|
20
|
+
logger,
|
|
21
|
+
clientName,
|
|
22
|
+
commandName,
|
|
23
|
+
inputFilterSensitiveLog: models_0_1.GetExpenseAnalysisRequest.filterSensitiveLog,
|
|
24
|
+
outputFilterSensitiveLog: models_0_1.GetExpenseAnalysisResponse.filterSensitiveLog,
|
|
25
|
+
};
|
|
26
|
+
const { requestHandler } = configuration;
|
|
27
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
28
|
+
}
|
|
29
|
+
serialize(input, context) {
|
|
30
|
+
return Aws_json1_1_1.serializeAws_json1_1GetExpenseAnalysisCommand(input, context);
|
|
31
|
+
}
|
|
32
|
+
deserialize(output, context) {
|
|
33
|
+
return Aws_json1_1_1.deserializeAws_json1_1GetExpenseAnalysisCommand(output, context);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.GetExpenseAnalysisCommand = GetExpenseAnalysisCommand;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StartExpenseAnalysisCommand = void 0;
|
|
4
|
+
const middleware_serde_1 = require("@aws-sdk/middleware-serde");
|
|
5
|
+
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
|
+
const models_0_1 = require("../models/models_0");
|
|
7
|
+
const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
|
|
8
|
+
class StartExpenseAnalysisCommand extends smithy_client_1.Command {
|
|
9
|
+
constructor(input) {
|
|
10
|
+
super();
|
|
11
|
+
this.input = input;
|
|
12
|
+
}
|
|
13
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
14
|
+
this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
15
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
16
|
+
const { logger } = configuration;
|
|
17
|
+
const clientName = "TextractClient";
|
|
18
|
+
const commandName = "StartExpenseAnalysisCommand";
|
|
19
|
+
const handlerExecutionContext = {
|
|
20
|
+
logger,
|
|
21
|
+
clientName,
|
|
22
|
+
commandName,
|
|
23
|
+
inputFilterSensitiveLog: models_0_1.StartExpenseAnalysisRequest.filterSensitiveLog,
|
|
24
|
+
outputFilterSensitiveLog: models_0_1.StartExpenseAnalysisResponse.filterSensitiveLog,
|
|
25
|
+
};
|
|
26
|
+
const { requestHandler } = configuration;
|
|
27
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
28
|
+
}
|
|
29
|
+
serialize(input, context) {
|
|
30
|
+
return Aws_json1_1_1.serializeAws_json1_1StartExpenseAnalysisCommand(input, context);
|
|
31
|
+
}
|
|
32
|
+
deserialize(output, context) {
|
|
33
|
+
return Aws_json1_1_1.deserializeAws_json1_1StartExpenseAnalysisCommand(output, context);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.StartExpenseAnalysisCommand = StartExpenseAnalysisCommand;
|
|
@@ -6,5 +6,7 @@ tslib_1.__exportStar(require("./AnalyzeExpenseCommand"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./DetectDocumentTextCommand"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./GetDocumentAnalysisCommand"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./GetDocumentTextDetectionCommand"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./GetExpenseAnalysisCommand"), exports);
|
|
9
10
|
tslib_1.__exportStar(require("./StartDocumentAnalysisCommand"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./StartDocumentTextDetectionCommand"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./StartExpenseAnalysisCommand"), exports);
|
package/dist-cjs/endpoints.js
CHANGED
|
@@ -62,22 +62,27 @@ const partitionHash = {
|
|
|
62
62
|
"us-west-1",
|
|
63
63
|
"us-west-2",
|
|
64
64
|
],
|
|
65
|
+
regionRegex: "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",
|
|
65
66
|
hostname: "textract.{region}.amazonaws.com",
|
|
66
67
|
},
|
|
67
68
|
"aws-cn": {
|
|
68
69
|
regions: ["cn-north-1", "cn-northwest-1"],
|
|
70
|
+
regionRegex: "^cn\\-\\w+\\-\\d+$",
|
|
69
71
|
hostname: "textract.{region}.amazonaws.com.cn",
|
|
70
72
|
},
|
|
71
73
|
"aws-iso": {
|
|
72
74
|
regions: ["us-iso-east-1", "us-iso-west-1"],
|
|
75
|
+
regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
|
|
73
76
|
hostname: "textract.{region}.c2s.ic.gov",
|
|
74
77
|
},
|
|
75
78
|
"aws-iso-b": {
|
|
76
79
|
regions: ["us-isob-east-1"],
|
|
80
|
+
regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
|
|
77
81
|
hostname: "textract.{region}.sc2s.sgov.gov",
|
|
78
82
|
},
|
|
79
83
|
"aws-us-gov": {
|
|
80
84
|
regions: ["fips-us-gov-east-1", "fips-us-gov-west-1", "us-gov-east-1", "us-gov-west-1"],
|
|
85
|
+
regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
|
|
81
86
|
hostname: "textract.{region}.amazonaws.com",
|
|
82
87
|
},
|
|
83
88
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.StartDocumentTextDetectionResponse = exports.StartDocumentTextDetectionRequest = exports.StartDocumentAnalysisResponse = exports.StartDocumentAnalysisRequest = exports.OutputConfig = exports.NotificationChannel = exports.LimitExceededException = void 0;
|
|
3
|
+
exports.GetExpenseAnalysisRequest = exports.GetDocumentTextDetectionResponse = exports.GetDocumentTextDetectionRequest = exports.InvalidKMSKeyException = exports.InvalidJobIdException = exports.GetDocumentAnalysisResponse = exports.Warning = exports.JobStatus = exports.GetDocumentAnalysisRequest = exports.DocumentLocation = exports.DetectDocumentTextResponse = exports.DetectDocumentTextRequest = exports.AnalyzeExpenseResponse = exports.ExpenseDocument = exports.LineItemGroup = exports.LineItemFields = exports.ExpenseField = exports.ExpenseType = exports.ExpenseDetection = exports.AnalyzeExpenseRequest = exports.UnsupportedDocumentException = exports.ThrottlingException = exports.ProvisionedThroughputExceededException = exports.InvalidS3ObjectException = exports.InvalidParameterException = exports.InternalServerError = exports.HumanLoopQuotaExceededException = exports.DocumentTooLargeException = exports.BadDocumentException = exports.AnalyzeDocumentResponse = exports.HumanLoopActivationOutput = exports.DocumentMetadata = exports.Block = exports.TextType = exports.SelectionStatus = exports.Relationship = exports.RelationshipType = exports.Geometry = exports.Point = exports.BoundingBox = exports.EntityType = exports.BlockType = exports.AnalyzeDocumentRequest = exports.HumanLoopConfig = exports.HumanLoopDataAttributes = exports.ContentClassifier = exports.FeatureType = exports.Document = exports.S3Object = exports.AccessDeniedException = void 0;
|
|
4
|
+
exports.StartExpenseAnalysisResponse = exports.StartExpenseAnalysisRequest = exports.StartDocumentTextDetectionResponse = exports.StartDocumentTextDetectionRequest = exports.StartDocumentAnalysisResponse = exports.StartDocumentAnalysisRequest = exports.OutputConfig = exports.NotificationChannel = exports.LimitExceededException = exports.IdempotentParameterMismatchException = exports.GetExpenseAnalysisResponse = void 0;
|
|
5
5
|
var AccessDeniedException;
|
|
6
6
|
(function (AccessDeniedException) {
|
|
7
7
|
AccessDeniedException.filterSensitiveLog = (obj) => ({
|
|
@@ -296,6 +296,18 @@ var GetDocumentTextDetectionResponse;
|
|
|
296
296
|
...obj,
|
|
297
297
|
});
|
|
298
298
|
})(GetDocumentTextDetectionResponse = exports.GetDocumentTextDetectionResponse || (exports.GetDocumentTextDetectionResponse = {}));
|
|
299
|
+
var GetExpenseAnalysisRequest;
|
|
300
|
+
(function (GetExpenseAnalysisRequest) {
|
|
301
|
+
GetExpenseAnalysisRequest.filterSensitiveLog = (obj) => ({
|
|
302
|
+
...obj,
|
|
303
|
+
});
|
|
304
|
+
})(GetExpenseAnalysisRequest = exports.GetExpenseAnalysisRequest || (exports.GetExpenseAnalysisRequest = {}));
|
|
305
|
+
var GetExpenseAnalysisResponse;
|
|
306
|
+
(function (GetExpenseAnalysisResponse) {
|
|
307
|
+
GetExpenseAnalysisResponse.filterSensitiveLog = (obj) => ({
|
|
308
|
+
...obj,
|
|
309
|
+
});
|
|
310
|
+
})(GetExpenseAnalysisResponse = exports.GetExpenseAnalysisResponse || (exports.GetExpenseAnalysisResponse = {}));
|
|
299
311
|
var IdempotentParameterMismatchException;
|
|
300
312
|
(function (IdempotentParameterMismatchException) {
|
|
301
313
|
IdempotentParameterMismatchException.filterSensitiveLog = (obj) => ({
|
|
@@ -344,3 +356,15 @@ var StartDocumentTextDetectionResponse;
|
|
|
344
356
|
...obj,
|
|
345
357
|
});
|
|
346
358
|
})(StartDocumentTextDetectionResponse = exports.StartDocumentTextDetectionResponse || (exports.StartDocumentTextDetectionResponse = {}));
|
|
359
|
+
var StartExpenseAnalysisRequest;
|
|
360
|
+
(function (StartExpenseAnalysisRequest) {
|
|
361
|
+
StartExpenseAnalysisRequest.filterSensitiveLog = (obj) => ({
|
|
362
|
+
...obj,
|
|
363
|
+
});
|
|
364
|
+
})(StartExpenseAnalysisRequest = exports.StartExpenseAnalysisRequest || (exports.StartExpenseAnalysisRequest = {}));
|
|
365
|
+
var StartExpenseAnalysisResponse;
|
|
366
|
+
(function (StartExpenseAnalysisResponse) {
|
|
367
|
+
StartExpenseAnalysisResponse.filterSensitiveLog = (obj) => ({
|
|
368
|
+
...obj,
|
|
369
|
+
});
|
|
370
|
+
})(StartExpenseAnalysisResponse = exports.StartExpenseAnalysisResponse || (exports.StartExpenseAnalysisResponse = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeAws_json1_1StartDocumentTextDetectionCommand = exports.deserializeAws_json1_1StartDocumentAnalysisCommand = exports.deserializeAws_json1_1GetDocumentTextDetectionCommand = exports.deserializeAws_json1_1GetDocumentAnalysisCommand = exports.deserializeAws_json1_1DetectDocumentTextCommand = exports.deserializeAws_json1_1AnalyzeExpenseCommand = exports.deserializeAws_json1_1AnalyzeDocumentCommand = exports.serializeAws_json1_1StartDocumentTextDetectionCommand = exports.serializeAws_json1_1StartDocumentAnalysisCommand = exports.serializeAws_json1_1GetDocumentTextDetectionCommand = exports.serializeAws_json1_1GetDocumentAnalysisCommand = exports.serializeAws_json1_1DetectDocumentTextCommand = exports.serializeAws_json1_1AnalyzeExpenseCommand = exports.serializeAws_json1_1AnalyzeDocumentCommand = void 0;
|
|
3
|
+
exports.deserializeAws_json1_1StartExpenseAnalysisCommand = exports.deserializeAws_json1_1StartDocumentTextDetectionCommand = exports.deserializeAws_json1_1StartDocumentAnalysisCommand = exports.deserializeAws_json1_1GetExpenseAnalysisCommand = exports.deserializeAws_json1_1GetDocumentTextDetectionCommand = exports.deserializeAws_json1_1GetDocumentAnalysisCommand = exports.deserializeAws_json1_1DetectDocumentTextCommand = exports.deserializeAws_json1_1AnalyzeExpenseCommand = exports.deserializeAws_json1_1AnalyzeDocumentCommand = exports.serializeAws_json1_1StartExpenseAnalysisCommand = exports.serializeAws_json1_1StartDocumentTextDetectionCommand = exports.serializeAws_json1_1StartDocumentAnalysisCommand = exports.serializeAws_json1_1GetExpenseAnalysisCommand = exports.serializeAws_json1_1GetDocumentTextDetectionCommand = exports.serializeAws_json1_1GetDocumentAnalysisCommand = exports.serializeAws_json1_1DetectDocumentTextCommand = exports.serializeAws_json1_1AnalyzeExpenseCommand = exports.serializeAws_json1_1AnalyzeDocumentCommand = 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 serializeAws_json1_1AnalyzeDocumentCommand = async (input, context) => {
|
|
@@ -53,6 +53,16 @@ const serializeAws_json1_1GetDocumentTextDetectionCommand = async (input, contex
|
|
|
53
53
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
54
54
|
};
|
|
55
55
|
exports.serializeAws_json1_1GetDocumentTextDetectionCommand = serializeAws_json1_1GetDocumentTextDetectionCommand;
|
|
56
|
+
const serializeAws_json1_1GetExpenseAnalysisCommand = async (input, context) => {
|
|
57
|
+
const headers = {
|
|
58
|
+
"content-type": "application/x-amz-json-1.1",
|
|
59
|
+
"x-amz-target": "Textract.GetExpenseAnalysis",
|
|
60
|
+
};
|
|
61
|
+
let body;
|
|
62
|
+
body = JSON.stringify(serializeAws_json1_1GetExpenseAnalysisRequest(input, context));
|
|
63
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
64
|
+
};
|
|
65
|
+
exports.serializeAws_json1_1GetExpenseAnalysisCommand = serializeAws_json1_1GetExpenseAnalysisCommand;
|
|
56
66
|
const serializeAws_json1_1StartDocumentAnalysisCommand = async (input, context) => {
|
|
57
67
|
const headers = {
|
|
58
68
|
"content-type": "application/x-amz-json-1.1",
|
|
@@ -73,6 +83,16 @@ const serializeAws_json1_1StartDocumentTextDetectionCommand = async (input, cont
|
|
|
73
83
|
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
74
84
|
};
|
|
75
85
|
exports.serializeAws_json1_1StartDocumentTextDetectionCommand = serializeAws_json1_1StartDocumentTextDetectionCommand;
|
|
86
|
+
const serializeAws_json1_1StartExpenseAnalysisCommand = async (input, context) => {
|
|
87
|
+
const headers = {
|
|
88
|
+
"content-type": "application/x-amz-json-1.1",
|
|
89
|
+
"x-amz-target": "Textract.StartExpenseAnalysis",
|
|
90
|
+
};
|
|
91
|
+
let body;
|
|
92
|
+
body = JSON.stringify(serializeAws_json1_1StartExpenseAnalysisRequest(input, context));
|
|
93
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
94
|
+
};
|
|
95
|
+
exports.serializeAws_json1_1StartExpenseAnalysisCommand = serializeAws_json1_1StartExpenseAnalysisCommand;
|
|
76
96
|
const deserializeAws_json1_1AnalyzeDocumentCommand = async (output, context) => {
|
|
77
97
|
if (output.statusCode >= 300) {
|
|
78
98
|
return deserializeAws_json1_1AnalyzeDocumentCommandError(output, context);
|
|
@@ -620,6 +640,109 @@ const deserializeAws_json1_1GetDocumentTextDetectionCommandError = async (output
|
|
|
620
640
|
delete response.Message;
|
|
621
641
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
622
642
|
};
|
|
643
|
+
const deserializeAws_json1_1GetExpenseAnalysisCommand = async (output, context) => {
|
|
644
|
+
if (output.statusCode >= 300) {
|
|
645
|
+
return deserializeAws_json1_1GetExpenseAnalysisCommandError(output, context);
|
|
646
|
+
}
|
|
647
|
+
const data = await parseBody(output.body, context);
|
|
648
|
+
let contents = {};
|
|
649
|
+
contents = deserializeAws_json1_1GetExpenseAnalysisResponse(data, context);
|
|
650
|
+
const response = {
|
|
651
|
+
$metadata: deserializeMetadata(output),
|
|
652
|
+
...contents,
|
|
653
|
+
};
|
|
654
|
+
return Promise.resolve(response);
|
|
655
|
+
};
|
|
656
|
+
exports.deserializeAws_json1_1GetExpenseAnalysisCommand = deserializeAws_json1_1GetExpenseAnalysisCommand;
|
|
657
|
+
const deserializeAws_json1_1GetExpenseAnalysisCommandError = async (output, context) => {
|
|
658
|
+
const parsedOutput = {
|
|
659
|
+
...output,
|
|
660
|
+
body: await parseBody(output.body, context),
|
|
661
|
+
};
|
|
662
|
+
let response;
|
|
663
|
+
let errorCode = "UnknownError";
|
|
664
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
665
|
+
switch (errorCode) {
|
|
666
|
+
case "AccessDeniedException":
|
|
667
|
+
case "com.amazonaws.textract#AccessDeniedException":
|
|
668
|
+
response = {
|
|
669
|
+
...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
670
|
+
name: errorCode,
|
|
671
|
+
$metadata: deserializeMetadata(output),
|
|
672
|
+
};
|
|
673
|
+
break;
|
|
674
|
+
case "InternalServerError":
|
|
675
|
+
case "com.amazonaws.textract#InternalServerError":
|
|
676
|
+
response = {
|
|
677
|
+
...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
|
|
678
|
+
name: errorCode,
|
|
679
|
+
$metadata: deserializeMetadata(output),
|
|
680
|
+
};
|
|
681
|
+
break;
|
|
682
|
+
case "InvalidJobIdException":
|
|
683
|
+
case "com.amazonaws.textract#InvalidJobIdException":
|
|
684
|
+
response = {
|
|
685
|
+
...(await deserializeAws_json1_1InvalidJobIdExceptionResponse(parsedOutput, context)),
|
|
686
|
+
name: errorCode,
|
|
687
|
+
$metadata: deserializeMetadata(output),
|
|
688
|
+
};
|
|
689
|
+
break;
|
|
690
|
+
case "InvalidKMSKeyException":
|
|
691
|
+
case "com.amazonaws.textract#InvalidKMSKeyException":
|
|
692
|
+
response = {
|
|
693
|
+
...(await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)),
|
|
694
|
+
name: errorCode,
|
|
695
|
+
$metadata: deserializeMetadata(output),
|
|
696
|
+
};
|
|
697
|
+
break;
|
|
698
|
+
case "InvalidParameterException":
|
|
699
|
+
case "com.amazonaws.textract#InvalidParameterException":
|
|
700
|
+
response = {
|
|
701
|
+
...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
702
|
+
name: errorCode,
|
|
703
|
+
$metadata: deserializeMetadata(output),
|
|
704
|
+
};
|
|
705
|
+
break;
|
|
706
|
+
case "InvalidS3ObjectException":
|
|
707
|
+
case "com.amazonaws.textract#InvalidS3ObjectException":
|
|
708
|
+
response = {
|
|
709
|
+
...(await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)),
|
|
710
|
+
name: errorCode,
|
|
711
|
+
$metadata: deserializeMetadata(output),
|
|
712
|
+
};
|
|
713
|
+
break;
|
|
714
|
+
case "ProvisionedThroughputExceededException":
|
|
715
|
+
case "com.amazonaws.textract#ProvisionedThroughputExceededException":
|
|
716
|
+
response = {
|
|
717
|
+
...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
|
|
718
|
+
name: errorCode,
|
|
719
|
+
$metadata: deserializeMetadata(output),
|
|
720
|
+
};
|
|
721
|
+
break;
|
|
722
|
+
case "ThrottlingException":
|
|
723
|
+
case "com.amazonaws.textract#ThrottlingException":
|
|
724
|
+
response = {
|
|
725
|
+
...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
726
|
+
name: errorCode,
|
|
727
|
+
$metadata: deserializeMetadata(output),
|
|
728
|
+
};
|
|
729
|
+
break;
|
|
730
|
+
default:
|
|
731
|
+
const parsedBody = parsedOutput.body;
|
|
732
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
733
|
+
response = {
|
|
734
|
+
...parsedBody,
|
|
735
|
+
name: `${errorCode}`,
|
|
736
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
737
|
+
$fault: "client",
|
|
738
|
+
$metadata: deserializeMetadata(output),
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
const message = response.message || response.Message || errorCode;
|
|
742
|
+
response.message = message;
|
|
743
|
+
delete response.Message;
|
|
744
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
745
|
+
};
|
|
623
746
|
const deserializeAws_json1_1StartDocumentAnalysisCommand = async (output, context) => {
|
|
624
747
|
if (output.statusCode >= 300) {
|
|
625
748
|
return deserializeAws_json1_1StartDocumentAnalysisCommandError(output, context);
|
|
@@ -890,6 +1013,141 @@ const deserializeAws_json1_1StartDocumentTextDetectionCommandError = async (outp
|
|
|
890
1013
|
delete response.Message;
|
|
891
1014
|
return Promise.reject(Object.assign(new Error(message), response));
|
|
892
1015
|
};
|
|
1016
|
+
const deserializeAws_json1_1StartExpenseAnalysisCommand = async (output, context) => {
|
|
1017
|
+
if (output.statusCode >= 300) {
|
|
1018
|
+
return deserializeAws_json1_1StartExpenseAnalysisCommandError(output, context);
|
|
1019
|
+
}
|
|
1020
|
+
const data = await parseBody(output.body, context);
|
|
1021
|
+
let contents = {};
|
|
1022
|
+
contents = deserializeAws_json1_1StartExpenseAnalysisResponse(data, context);
|
|
1023
|
+
const response = {
|
|
1024
|
+
$metadata: deserializeMetadata(output),
|
|
1025
|
+
...contents,
|
|
1026
|
+
};
|
|
1027
|
+
return Promise.resolve(response);
|
|
1028
|
+
};
|
|
1029
|
+
exports.deserializeAws_json1_1StartExpenseAnalysisCommand = deserializeAws_json1_1StartExpenseAnalysisCommand;
|
|
1030
|
+
const deserializeAws_json1_1StartExpenseAnalysisCommandError = async (output, context) => {
|
|
1031
|
+
const parsedOutput = {
|
|
1032
|
+
...output,
|
|
1033
|
+
body: await parseBody(output.body, context),
|
|
1034
|
+
};
|
|
1035
|
+
let response;
|
|
1036
|
+
let errorCode = "UnknownError";
|
|
1037
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1038
|
+
switch (errorCode) {
|
|
1039
|
+
case "AccessDeniedException":
|
|
1040
|
+
case "com.amazonaws.textract#AccessDeniedException":
|
|
1041
|
+
response = {
|
|
1042
|
+
...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
1043
|
+
name: errorCode,
|
|
1044
|
+
$metadata: deserializeMetadata(output),
|
|
1045
|
+
};
|
|
1046
|
+
break;
|
|
1047
|
+
case "BadDocumentException":
|
|
1048
|
+
case "com.amazonaws.textract#BadDocumentException":
|
|
1049
|
+
response = {
|
|
1050
|
+
...(await deserializeAws_json1_1BadDocumentExceptionResponse(parsedOutput, context)),
|
|
1051
|
+
name: errorCode,
|
|
1052
|
+
$metadata: deserializeMetadata(output),
|
|
1053
|
+
};
|
|
1054
|
+
break;
|
|
1055
|
+
case "DocumentTooLargeException":
|
|
1056
|
+
case "com.amazonaws.textract#DocumentTooLargeException":
|
|
1057
|
+
response = {
|
|
1058
|
+
...(await deserializeAws_json1_1DocumentTooLargeExceptionResponse(parsedOutput, context)),
|
|
1059
|
+
name: errorCode,
|
|
1060
|
+
$metadata: deserializeMetadata(output),
|
|
1061
|
+
};
|
|
1062
|
+
break;
|
|
1063
|
+
case "IdempotentParameterMismatchException":
|
|
1064
|
+
case "com.amazonaws.textract#IdempotentParameterMismatchException":
|
|
1065
|
+
response = {
|
|
1066
|
+
...(await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
|
|
1067
|
+
name: errorCode,
|
|
1068
|
+
$metadata: deserializeMetadata(output),
|
|
1069
|
+
};
|
|
1070
|
+
break;
|
|
1071
|
+
case "InternalServerError":
|
|
1072
|
+
case "com.amazonaws.textract#InternalServerError":
|
|
1073
|
+
response = {
|
|
1074
|
+
...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
|
|
1075
|
+
name: errorCode,
|
|
1076
|
+
$metadata: deserializeMetadata(output),
|
|
1077
|
+
};
|
|
1078
|
+
break;
|
|
1079
|
+
case "InvalidKMSKeyException":
|
|
1080
|
+
case "com.amazonaws.textract#InvalidKMSKeyException":
|
|
1081
|
+
response = {
|
|
1082
|
+
...(await deserializeAws_json1_1InvalidKMSKeyExceptionResponse(parsedOutput, context)),
|
|
1083
|
+
name: errorCode,
|
|
1084
|
+
$metadata: deserializeMetadata(output),
|
|
1085
|
+
};
|
|
1086
|
+
break;
|
|
1087
|
+
case "InvalidParameterException":
|
|
1088
|
+
case "com.amazonaws.textract#InvalidParameterException":
|
|
1089
|
+
response = {
|
|
1090
|
+
...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1091
|
+
name: errorCode,
|
|
1092
|
+
$metadata: deserializeMetadata(output),
|
|
1093
|
+
};
|
|
1094
|
+
break;
|
|
1095
|
+
case "InvalidS3ObjectException":
|
|
1096
|
+
case "com.amazonaws.textract#InvalidS3ObjectException":
|
|
1097
|
+
response = {
|
|
1098
|
+
...(await deserializeAws_json1_1InvalidS3ObjectExceptionResponse(parsedOutput, context)),
|
|
1099
|
+
name: errorCode,
|
|
1100
|
+
$metadata: deserializeMetadata(output),
|
|
1101
|
+
};
|
|
1102
|
+
break;
|
|
1103
|
+
case "LimitExceededException":
|
|
1104
|
+
case "com.amazonaws.textract#LimitExceededException":
|
|
1105
|
+
response = {
|
|
1106
|
+
...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
1107
|
+
name: errorCode,
|
|
1108
|
+
$metadata: deserializeMetadata(output),
|
|
1109
|
+
};
|
|
1110
|
+
break;
|
|
1111
|
+
case "ProvisionedThroughputExceededException":
|
|
1112
|
+
case "com.amazonaws.textract#ProvisionedThroughputExceededException":
|
|
1113
|
+
response = {
|
|
1114
|
+
...(await deserializeAws_json1_1ProvisionedThroughputExceededExceptionResponse(parsedOutput, context)),
|
|
1115
|
+
name: errorCode,
|
|
1116
|
+
$metadata: deserializeMetadata(output),
|
|
1117
|
+
};
|
|
1118
|
+
break;
|
|
1119
|
+
case "ThrottlingException":
|
|
1120
|
+
case "com.amazonaws.textract#ThrottlingException":
|
|
1121
|
+
response = {
|
|
1122
|
+
...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
1123
|
+
name: errorCode,
|
|
1124
|
+
$metadata: deserializeMetadata(output),
|
|
1125
|
+
};
|
|
1126
|
+
break;
|
|
1127
|
+
case "UnsupportedDocumentException":
|
|
1128
|
+
case "com.amazonaws.textract#UnsupportedDocumentException":
|
|
1129
|
+
response = {
|
|
1130
|
+
...(await deserializeAws_json1_1UnsupportedDocumentExceptionResponse(parsedOutput, context)),
|
|
1131
|
+
name: errorCode,
|
|
1132
|
+
$metadata: deserializeMetadata(output),
|
|
1133
|
+
};
|
|
1134
|
+
break;
|
|
1135
|
+
default:
|
|
1136
|
+
const parsedBody = parsedOutput.body;
|
|
1137
|
+
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1138
|
+
response = {
|
|
1139
|
+
...parsedBody,
|
|
1140
|
+
name: `${errorCode}`,
|
|
1141
|
+
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1142
|
+
$fault: "client",
|
|
1143
|
+
$metadata: deserializeMetadata(output),
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
const message = response.message || response.Message || errorCode;
|
|
1147
|
+
response.message = message;
|
|
1148
|
+
delete response.Message;
|
|
1149
|
+
return Promise.reject(Object.assign(new Error(message), response));
|
|
1150
|
+
};
|
|
893
1151
|
const deserializeAws_json1_1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
894
1152
|
const body = parsedOutput.body;
|
|
895
1153
|
const deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
|
|
@@ -1115,6 +1373,13 @@ const serializeAws_json1_1GetDocumentTextDetectionRequest = (input, context) =>
|
|
|
1115
1373
|
...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
|
|
1116
1374
|
};
|
|
1117
1375
|
};
|
|
1376
|
+
const serializeAws_json1_1GetExpenseAnalysisRequest = (input, context) => {
|
|
1377
|
+
return {
|
|
1378
|
+
...(input.JobId !== undefined && input.JobId !== null && { JobId: input.JobId }),
|
|
1379
|
+
...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
|
|
1380
|
+
...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
|
|
1381
|
+
};
|
|
1382
|
+
};
|
|
1118
1383
|
const serializeAws_json1_1HumanLoopConfig = (input, context) => {
|
|
1119
1384
|
return {
|
|
1120
1385
|
...(input.DataAttributes !== undefined &&
|
|
@@ -1191,6 +1456,24 @@ const serializeAws_json1_1StartDocumentTextDetectionRequest = (input, context) =
|
|
|
1191
1456
|
input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }),
|
|
1192
1457
|
};
|
|
1193
1458
|
};
|
|
1459
|
+
const serializeAws_json1_1StartExpenseAnalysisRequest = (input, context) => {
|
|
1460
|
+
return {
|
|
1461
|
+
...(input.ClientRequestToken !== undefined &&
|
|
1462
|
+
input.ClientRequestToken !== null && { ClientRequestToken: input.ClientRequestToken }),
|
|
1463
|
+
...(input.DocumentLocation !== undefined &&
|
|
1464
|
+
input.DocumentLocation !== null && {
|
|
1465
|
+
DocumentLocation: serializeAws_json1_1DocumentLocation(input.DocumentLocation, context),
|
|
1466
|
+
}),
|
|
1467
|
+
...(input.JobTag !== undefined && input.JobTag !== null && { JobTag: input.JobTag }),
|
|
1468
|
+
...(input.KMSKeyId !== undefined && input.KMSKeyId !== null && { KMSKeyId: input.KMSKeyId }),
|
|
1469
|
+
...(input.NotificationChannel !== undefined &&
|
|
1470
|
+
input.NotificationChannel !== null && {
|
|
1471
|
+
NotificationChannel: serializeAws_json1_1NotificationChannel(input.NotificationChannel, context),
|
|
1472
|
+
}),
|
|
1473
|
+
...(input.OutputConfig !== undefined &&
|
|
1474
|
+
input.OutputConfig !== null && { OutputConfig: serializeAws_json1_1OutputConfig(input.OutputConfig, context) }),
|
|
1475
|
+
};
|
|
1476
|
+
};
|
|
1194
1477
|
const deserializeAws_json1_1AccessDeniedException = (output, context) => {
|
|
1195
1478
|
return {
|
|
1196
1479
|
Code: smithy_client_1.expectString(output.Code),
|
|
@@ -1405,6 +1688,23 @@ const deserializeAws_json1_1GetDocumentTextDetectionResponse = (output, context)
|
|
|
1405
1688
|
: undefined,
|
|
1406
1689
|
};
|
|
1407
1690
|
};
|
|
1691
|
+
const deserializeAws_json1_1GetExpenseAnalysisResponse = (output, context) => {
|
|
1692
|
+
return {
|
|
1693
|
+
AnalyzeExpenseModelVersion: smithy_client_1.expectString(output.AnalyzeExpenseModelVersion),
|
|
1694
|
+
DocumentMetadata: output.DocumentMetadata !== undefined && output.DocumentMetadata !== null
|
|
1695
|
+
? deserializeAws_json1_1DocumentMetadata(output.DocumentMetadata, context)
|
|
1696
|
+
: undefined,
|
|
1697
|
+
ExpenseDocuments: output.ExpenseDocuments !== undefined && output.ExpenseDocuments !== null
|
|
1698
|
+
? deserializeAws_json1_1ExpenseDocumentList(output.ExpenseDocuments, context)
|
|
1699
|
+
: undefined,
|
|
1700
|
+
JobStatus: smithy_client_1.expectString(output.JobStatus),
|
|
1701
|
+
NextToken: smithy_client_1.expectString(output.NextToken),
|
|
1702
|
+
StatusMessage: smithy_client_1.expectString(output.StatusMessage),
|
|
1703
|
+
Warnings: output.Warnings !== undefined && output.Warnings !== null
|
|
1704
|
+
? deserializeAws_json1_1Warnings(output.Warnings, context)
|
|
1705
|
+
: undefined,
|
|
1706
|
+
};
|
|
1707
|
+
};
|
|
1408
1708
|
const deserializeAws_json1_1HumanLoopActivationOutput = (output, context) => {
|
|
1409
1709
|
return {
|
|
1410
1710
|
HumanLoopActivationConditionsEvaluationResults: output.HumanLoopActivationConditionsEvaluationResults !== undefined &&
|
|
@@ -1581,6 +1881,11 @@ const deserializeAws_json1_1StartDocumentTextDetectionResponse = (output, contex
|
|
|
1581
1881
|
JobId: smithy_client_1.expectString(output.JobId),
|
|
1582
1882
|
};
|
|
1583
1883
|
};
|
|
1884
|
+
const deserializeAws_json1_1StartExpenseAnalysisResponse = (output, context) => {
|
|
1885
|
+
return {
|
|
1886
|
+
JobId: smithy_client_1.expectString(output.JobId),
|
|
1887
|
+
};
|
|
1888
|
+
};
|
|
1584
1889
|
const deserializeAws_json1_1ThrottlingException = (output, context) => {
|
|
1585
1890
|
return {
|
|
1586
1891
|
Code: smithy_client_1.expectString(output.Code),
|
package/dist-es/Textract.js
CHANGED
|
@@ -4,8 +4,10 @@ import { AnalyzeExpenseCommand, } from "./commands/AnalyzeExpenseCommand";
|
|
|
4
4
|
import { DetectDocumentTextCommand, } from "./commands/DetectDocumentTextCommand";
|
|
5
5
|
import { GetDocumentAnalysisCommand, } from "./commands/GetDocumentAnalysisCommand";
|
|
6
6
|
import { GetDocumentTextDetectionCommand, } from "./commands/GetDocumentTextDetectionCommand";
|
|
7
|
+
import { GetExpenseAnalysisCommand, } from "./commands/GetExpenseAnalysisCommand";
|
|
7
8
|
import { StartDocumentAnalysisCommand, } from "./commands/StartDocumentAnalysisCommand";
|
|
8
9
|
import { StartDocumentTextDetectionCommand, } from "./commands/StartDocumentTextDetectionCommand";
|
|
10
|
+
import { StartExpenseAnalysisCommand, } from "./commands/StartExpenseAnalysisCommand";
|
|
9
11
|
import { TextractClient } from "./TextractClient";
|
|
10
12
|
var Textract = (function (_super) {
|
|
11
13
|
__extends(Textract, _super);
|
|
@@ -82,6 +84,20 @@ var Textract = (function (_super) {
|
|
|
82
84
|
return this.send(command, optionsOrCb);
|
|
83
85
|
}
|
|
84
86
|
};
|
|
87
|
+
Textract.prototype.getExpenseAnalysis = function (args, optionsOrCb, cb) {
|
|
88
|
+
var command = new GetExpenseAnalysisCommand(args);
|
|
89
|
+
if (typeof optionsOrCb === "function") {
|
|
90
|
+
this.send(command, optionsOrCb);
|
|
91
|
+
}
|
|
92
|
+
else if (typeof cb === "function") {
|
|
93
|
+
if (typeof optionsOrCb !== "object")
|
|
94
|
+
throw new Error("Expect http options but get " + typeof optionsOrCb);
|
|
95
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return this.send(command, optionsOrCb);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
85
101
|
Textract.prototype.startDocumentAnalysis = function (args, optionsOrCb, cb) {
|
|
86
102
|
var command = new StartDocumentAnalysisCommand(args);
|
|
87
103
|
if (typeof optionsOrCb === "function") {
|
|
@@ -110,6 +126,20 @@ var Textract = (function (_super) {
|
|
|
110
126
|
return this.send(command, optionsOrCb);
|
|
111
127
|
}
|
|
112
128
|
};
|
|
129
|
+
Textract.prototype.startExpenseAnalysis = function (args, optionsOrCb, cb) {
|
|
130
|
+
var command = new StartExpenseAnalysisCommand(args);
|
|
131
|
+
if (typeof optionsOrCb === "function") {
|
|
132
|
+
this.send(command, optionsOrCb);
|
|
133
|
+
}
|
|
134
|
+
else if (typeof cb === "function") {
|
|
135
|
+
if (typeof optionsOrCb !== "object")
|
|
136
|
+
throw new Error("Expect http options but get " + typeof optionsOrCb);
|
|
137
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return this.send(command, optionsOrCb);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
113
143
|
return Textract;
|
|
114
144
|
}(TextractClient));
|
|
115
145
|
export { Textract };
|