@aws-amplify/predictions 6.0.1-unstable.cfbde4c.0 → 6.0.1
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/{lib → dist/cjs}/Predictions.js +4 -2
- package/dist/cjs/Predictions.js.map +1 -0
- package/{lib → dist/cjs}/errors/PredictionsError.js +3 -1
- package/dist/cjs/errors/PredictionsError.js.map +1 -0
- package/{lib → dist/cjs}/errors/types/validation.js +3 -1
- package/dist/cjs/errors/types/validation.js.map +1 -0
- package/{lib → dist/cjs}/errors/utils/assertValidationError.js +3 -1
- package/dist/cjs/errors/utils/assertValidationError.js.map +1 -0
- package/{lib → dist/cjs}/index.js +3 -1
- package/dist/cjs/index.js.map +1 -0
- package/{lib → dist/cjs}/providers/AmazonAIConvertPredictionsProvider.js +3 -1
- package/dist/cjs/providers/AmazonAIConvertPredictionsProvider.js.map +1 -0
- package/{lib → dist/cjs}/providers/AmazonAIIdentifyPredictionsProvider.js +3 -1
- package/dist/cjs/providers/AmazonAIIdentifyPredictionsProvider.js.map +1 -0
- package/{lib → dist/cjs}/providers/AmazonAIInterpretPredictionsProvider.js +3 -1
- package/dist/cjs/providers/AmazonAIInterpretPredictionsProvider.js.map +1 -0
- package/{lib → dist/cjs}/providers/IdentifyTextUtils.js +3 -1
- package/dist/cjs/providers/IdentifyTextUtils.js.map +1 -0
- package/{lib → dist/cjs}/providers/Utils.js +3 -1
- package/dist/cjs/providers/Utils.js.map +1 -0
- package/{lib → dist/cjs}/providers/index.js +3 -1
- package/dist/cjs/providers/index.js.map +1 -0
- package/{lib → dist/cjs}/types/AWSTypes.js +3 -1
- package/dist/cjs/types/AWSTypes.js.map +1 -0
- package/{lib → dist/cjs}/types/Predictions.js +3 -1
- package/dist/cjs/types/Predictions.js.map +1 -0
- package/{lib → dist/cjs}/types/index.js +3 -1
- package/dist/cjs/types/index.js.map +1 -0
- package/{lib-esm/Predictions.js → dist/esm/Predictions.mjs} +11 -5
- package/dist/esm/Predictions.mjs.map +1 -0
- package/{lib-esm/errors/PredictionsError.js → dist/esm/errors/PredictionsError.mjs} +6 -2
- package/dist/esm/errors/PredictionsError.mjs.map +1 -0
- package/{lib-esm/errors/types/validation.js → dist/esm/errors/types/validation.mjs} +5 -2
- package/dist/esm/errors/types/validation.mjs.map +1 -0
- package/{lib-esm/errors/utils/assertValidationError.js → dist/esm/errors/utils/assertValidationError.mjs} +7 -3
- package/dist/esm/errors/utils/assertValidationError.mjs.map +1 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -0
- package/{lib-esm/providers/AmazonAIConvertPredictionsProvider.js → dist/esm/providers/AmazonAIConvertPredictionsProvider.mjs} +16 -12
- package/dist/esm/providers/AmazonAIConvertPredictionsProvider.mjs.map +1 -0
- package/{lib-esm/providers/AmazonAIIdentifyPredictionsProvider.js → dist/esm/providers/AmazonAIIdentifyPredictionsProvider.mjs} +16 -12
- package/dist/esm/providers/AmazonAIIdentifyPredictionsProvider.mjs.map +1 -0
- package/{lib-esm/providers/AmazonAIInterpretPredictionsProvider.js → dist/esm/providers/AmazonAIInterpretPredictionsProvider.mjs} +11 -7
- package/dist/esm/providers/AmazonAIInterpretPredictionsProvider.mjs.map +1 -0
- package/{lib-esm/providers/IdentifyTextUtils.js → dist/esm/providers/IdentifyTextUtils.mjs} +7 -3
- package/dist/esm/providers/IdentifyTextUtils.mjs.map +1 -0
- package/{lib-esm/providers/Utils.js → dist/esm/providers/Utils.mjs} +6 -3
- package/dist/esm/providers/Utils.mjs.map +1 -0
- package/dist/esm/providers/index.mjs +4 -0
- package/dist/esm/providers/index.mjs.map +1 -0
- package/dist/esm/types/AWSTypes.mjs +2 -0
- package/dist/esm/types/AWSTypes.mjs.map +1 -0
- package/{lib-esm/types/Predictions.js → dist/esm/types/Predictions.mjs} +20 -17
- package/dist/esm/types/Predictions.mjs.map +1 -0
- package/dist/esm/types/index.mjs +2 -0
- package/dist/esm/types/index.mjs.map +1 -0
- package/package.json +119 -121
- package/src/Predictions.ts +2 -2
- package/src/providers/AmazonAIConvertPredictionsProvider.ts +2 -6
- package/src/providers/AmazonAIIdentifyPredictionsProvider.ts +2 -6
- package/lib/Predictions.d.ts +0 -15
- package/lib/errors/PredictionsError.d.ts +0 -4
- package/lib/errors/types/validation.d.ts +0 -14
- package/lib/errors/utils/assertValidationError.d.ts +0 -2
- package/lib/index.d.ts +0 -2
- package/lib/providers/AmazonAIConvertPredictionsProvider.d.ts +0 -19
- package/lib/providers/AmazonAIIdentifyPredictionsProvider.d.ts +0 -48
- package/lib/providers/AmazonAIInterpretPredictionsProvider.d.ts +0 -14
- package/lib/providers/IdentifyTextUtils.d.ts +0 -16
- package/lib/providers/Utils.d.ts +0 -13
- package/lib/providers/index.d.ts +0 -4
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/AWSTypes.d.ts +0 -124
- package/lib/types/Predictions.d.ts +0 -298
- package/lib/types/index.d.ts +0 -1
- package/lib-esm/index.js +0 -3
- package/lib-esm/providers/index.js +0 -6
- package/lib-esm/tsconfig.tsbuildinfo +0 -1
- package/lib-esm/types/AWSTypes.js +0 -1
- package/lib-esm/types/index.js +0 -3
- /package/{lib-esm → dist/esm}/Predictions.d.ts +0 -0
- /package/{lib-esm → dist/esm}/errors/PredictionsError.d.ts +0 -0
- /package/{lib-esm → dist/esm}/errors/types/validation.d.ts +0 -0
- /package/{lib-esm → dist/esm}/errors/utils/assertValidationError.d.ts +0 -0
- /package/{lib-esm → dist/esm}/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/providers/AmazonAIConvertPredictionsProvider.d.ts +0 -0
- /package/{lib-esm → dist/esm}/providers/AmazonAIIdentifyPredictionsProvider.d.ts +0 -0
- /package/{lib-esm → dist/esm}/providers/AmazonAIInterpretPredictionsProvider.d.ts +0 -0
- /package/{lib-esm → dist/esm}/providers/IdentifyTextUtils.d.ts +0 -0
- /package/{lib-esm → dist/esm}/providers/Utils.d.ts +0 -0
- /package/{lib-esm → dist/esm}/providers/index.d.ts +0 -0
- /package/{lib-esm → dist/esm}/types/AWSTypes.d.ts +0 -0
- /package/{lib-esm → dist/esm}/types/Predictions.d.ts +0 -0
- /package/{lib-esm → dist/esm}/types/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,123 +1,121 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
"gitHead": "cfbde4c7962de77bd43ba20811b84c4d7d333b42"
|
|
2
|
+
"name": "@aws-amplify/predictions",
|
|
3
|
+
"version": "6.0.1",
|
|
4
|
+
"description": "Machine learning category of aws-amplify",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
|
+
"typings": "./dist/esm/index.d.ts",
|
|
8
|
+
"react-native": "./src/index.ts",
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"./dist/cjs/Predictions.js",
|
|
11
|
+
"./dist/esm/Predictions.mjs"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "npm run lint && jest -w 1 --passWithNoTests --coverage --maxWorkers 2",
|
|
15
|
+
"test:size": "size-limit",
|
|
16
|
+
"build-with-test": "npm run clean && npm run build",
|
|
17
|
+
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
|
|
18
|
+
"build:esm-cjs": "rollup -c rollup.config.mjs",
|
|
19
|
+
"build:cjs:watch": "rimraf dist/cjs && tsc -m commonjs --outDir dist/cjs --watch",
|
|
20
|
+
"build:esm:watch": "rimraf dist/esm && tsc -m esnext --outDir dist/esm --watch",
|
|
21
|
+
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
|
|
22
|
+
"clean": "npm run clean:size && rimraf dist lib lib-esm",
|
|
23
|
+
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
24
|
+
"format": "echo \"Not implemented\"",
|
|
25
|
+
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
|
|
26
|
+
"generate-docs-local": "typedoc --out docs src",
|
|
27
|
+
"generate-docs-root": "typedoc --out ../../docs src",
|
|
28
|
+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.json -t 87.84"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/aws-amplify/amplify-js.git"
|
|
33
|
+
},
|
|
34
|
+
"author": "Amazon Web Services",
|
|
35
|
+
"license": "Apache-2.0",
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/aws/aws-amplify/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://aws-amplify.github.io/",
|
|
40
|
+
"files": [
|
|
41
|
+
"dist/cjs",
|
|
42
|
+
"dist/esm",
|
|
43
|
+
"src"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@aws-amplify/storage": "6.0.1",
|
|
47
|
+
"@aws-sdk/client-comprehend": "3.398.0",
|
|
48
|
+
"@aws-sdk/client-polly": "3.398.0",
|
|
49
|
+
"@aws-sdk/client-rekognition": "3.398.0",
|
|
50
|
+
"@aws-sdk/client-textract": "3.398.0",
|
|
51
|
+
"@aws-sdk/client-translate": "3.398.0",
|
|
52
|
+
"@smithy/eventstream-codec": "2.0.9",
|
|
53
|
+
"@smithy/util-utf8": "2.0.0",
|
|
54
|
+
"buffer": "4.9.2",
|
|
55
|
+
"tslib": "^2.5.0",
|
|
56
|
+
"uuid": "^9.0.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@aws-amplify/core": "^6.0.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@aws-amplify/core": "6.0.1",
|
|
63
|
+
"@rollup/plugin-typescript": "11.1.5",
|
|
64
|
+
"rollup": "3.29.4",
|
|
65
|
+
"typescript": "5.0.2"
|
|
66
|
+
},
|
|
67
|
+
"size-limit": [
|
|
68
|
+
{
|
|
69
|
+
"name": "Predictions",
|
|
70
|
+
"path": "./dist/esm/index.mjs",
|
|
71
|
+
"import": "{ Predictions }",
|
|
72
|
+
"limit": "69.8 kB"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"jest": {
|
|
76
|
+
"globals": {
|
|
77
|
+
"ts-jest": {
|
|
78
|
+
"diagnostics": {
|
|
79
|
+
"pathRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$"
|
|
80
|
+
},
|
|
81
|
+
"tsConfig": {
|
|
82
|
+
"downlevelIteration": true,
|
|
83
|
+
"allowJs": true,
|
|
84
|
+
"types": [
|
|
85
|
+
"@types/jest"
|
|
86
|
+
],
|
|
87
|
+
"outDir": "./tsconfig.json",
|
|
88
|
+
"noEmitOnError": false,
|
|
89
|
+
"noImplicitAny": false,
|
|
90
|
+
"skipLibCheck": true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"transform": {
|
|
95
|
+
"^.+\\.(js|jsx|ts|tsx)$": "ts-jest"
|
|
96
|
+
},
|
|
97
|
+
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
|
|
98
|
+
"moduleFileExtensions": [
|
|
99
|
+
"ts",
|
|
100
|
+
"tsx",
|
|
101
|
+
"js",
|
|
102
|
+
"json",
|
|
103
|
+
"jsx"
|
|
104
|
+
],
|
|
105
|
+
"testEnvironment": "jsdom",
|
|
106
|
+
"testURL": "http://localhost/",
|
|
107
|
+
"coverageThreshold": {
|
|
108
|
+
"global": {
|
|
109
|
+
"branches": 0,
|
|
110
|
+
"functions": 0,
|
|
111
|
+
"lines": 0,
|
|
112
|
+
"statements": 0
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"coveragePathIgnorePatterns": [
|
|
116
|
+
"/node_modules/",
|
|
117
|
+
"dist"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"gitHead": "f1408db3f570c4a18ada40cecbe7e68a0b31f1fe"
|
|
123
121
|
}
|
package/src/Predictions.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { ConsoleLogger
|
|
3
|
+
import { ConsoleLogger } from '@aws-amplify/core';
|
|
4
4
|
import {
|
|
5
5
|
AmazonAIConvertPredictionsProvider,
|
|
6
6
|
AmazonAIIdentifyPredictionsProvider,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
TranslateTextOutput,
|
|
24
24
|
} from './types';
|
|
25
25
|
|
|
26
|
-
const logger = new
|
|
26
|
+
const logger = new ConsoleLogger('Predictions');
|
|
27
27
|
|
|
28
28
|
export class PredictionsClass {
|
|
29
29
|
private convertProvider = new AmazonAIConvertPredictionsProvider();
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
4
|
-
Amplify,
|
|
5
|
-
ConsoleLogger as Logger,
|
|
6
|
-
fetchAuthSession,
|
|
7
|
-
} from '@aws-amplify/core';
|
|
3
|
+
import { Amplify, ConsoleLogger, fetchAuthSession } from '@aws-amplify/core';
|
|
8
4
|
import {
|
|
9
5
|
AWSCredentials,
|
|
10
6
|
Category,
|
|
@@ -40,7 +36,7 @@ import {
|
|
|
40
36
|
isValidConvertInput,
|
|
41
37
|
} from '../types';
|
|
42
38
|
|
|
43
|
-
const logger = new
|
|
39
|
+
const logger = new ConsoleLogger('AmazonAIConvertPredictionsProvider');
|
|
44
40
|
const eventBuilder = new EventStreamCodec(toUtf8, fromUtf8);
|
|
45
41
|
|
|
46
42
|
const LANGUAGES_CODE_IN_8KHZ = ['fr-FR', 'en-AU', 'en-GB', 'fr-CA'];
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import {
|
|
4
|
-
Amplify,
|
|
5
|
-
ConsoleLogger as Logger,
|
|
6
|
-
fetchAuthSession,
|
|
7
|
-
} from '@aws-amplify/core';
|
|
3
|
+
import { Amplify, ConsoleLogger, fetchAuthSession } from '@aws-amplify/core';
|
|
8
4
|
import {
|
|
9
5
|
Category,
|
|
10
6
|
PredictionsAction,
|
|
@@ -66,7 +62,7 @@ import {
|
|
|
66
62
|
} from './IdentifyTextUtils';
|
|
67
63
|
import { blobToArrayBuffer, makeCamelCase, makeCamelCaseArray } from './Utils';
|
|
68
64
|
|
|
69
|
-
const logger = new
|
|
65
|
+
const logger = new ConsoleLogger('AmazonAIIdentifyPredictionsProvider');
|
|
70
66
|
|
|
71
67
|
export class AmazonAIIdentifyPredictionsProvider {
|
|
72
68
|
private rekognitionClient?: RekognitionClient;
|
package/lib/Predictions.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IdentifyEntitiesInput, IdentifyEntitiesOutput, IdentifyLabelsInput, IdentifyLabelsOutput, IdentifyTextInput, IdentifyTextOutput, InterpretTextInput, InterpretTextOutput, SpeechToTextInput, SpeechToTextOutput, TextToSpeechInput, TextToSpeechOutput, TranslateTextInput, TranslateTextOutput } from './types';
|
|
2
|
-
export declare class PredictionsClass {
|
|
3
|
-
private convertProvider;
|
|
4
|
-
private identifyProvider;
|
|
5
|
-
private interpretProvider;
|
|
6
|
-
getModuleName(): string;
|
|
7
|
-
interpret(input: InterpretTextInput): Promise<InterpretTextOutput>;
|
|
8
|
-
convert(input: TranslateTextInput): Promise<TranslateTextOutput>;
|
|
9
|
-
convert(input: TextToSpeechInput): Promise<TextToSpeechOutput>;
|
|
10
|
-
convert(input: SpeechToTextInput): Promise<SpeechToTextOutput>;
|
|
11
|
-
identify(input: IdentifyTextInput): Promise<IdentifyTextOutput>;
|
|
12
|
-
identify(input: IdentifyLabelsInput): Promise<IdentifyLabelsOutput>;
|
|
13
|
-
identify(input: IdentifyEntitiesInput): Promise<IdentifyEntitiesOutput>;
|
|
14
|
-
}
|
|
15
|
-
export declare const Predictions: PredictionsClass;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AmplifyErrorMap } from '@aws-amplify/core/internals/utils';
|
|
2
|
-
export declare enum PredictionsValidationErrorCode {
|
|
3
|
-
CelebrityDetectionNotEnabled = "CelebrityDetectionNotEnabled",
|
|
4
|
-
InvalidInput = "InvalidInput",
|
|
5
|
-
InvalidSource = "InvalidSource",
|
|
6
|
-
NoCredentials = "NoCredentials",
|
|
7
|
-
NoLanguage = "NoLanguage",
|
|
8
|
-
NoRegion = "NoRegion",
|
|
9
|
-
NoSource = "NoSource",
|
|
10
|
-
NoSourceLanguage = "NoSourceLanguage",
|
|
11
|
-
NoTargetLanguage = "NoTargetLanguage",
|
|
12
|
-
NoVoiceId = "NoVoiceId"
|
|
13
|
-
}
|
|
14
|
-
export declare const validationErrorMap: AmplifyErrorMap<PredictionsValidationErrorCode>;
|
package/lib/index.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { Predictions } from './Predictions';
|
|
2
|
-
export { IdentifyEntitiesInput, IdentifyEntitiesOutput, IdentifyLabelsInput, IdentifyLabelsOutput, IdentifyTextInput, IdentifyTextOutput, InterpretTextInput, InterpretTextOutput, SpeechToTextInput, SpeechToTextOutput, TextToSpeechInput, TextToSpeechOutput, TranslateTextInput, TranslateTextOutput, } from './types';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SpeechToTextInput, SpeechToTextOutput, TextToSpeechInput, TextToSpeechOutput, TranslateTextInput, TranslateTextOutput } from '../types';
|
|
2
|
-
export declare class AmazonAIConvertPredictionsProvider {
|
|
3
|
-
private translateClient?;
|
|
4
|
-
private pollyClient?;
|
|
5
|
-
getProviderName(): string;
|
|
6
|
-
convert(input: TranslateTextInput | TextToSpeechInput | SpeechToTextInput): Promise<TextToSpeechOutput | TranslateTextOutput | SpeechToTextOutput>;
|
|
7
|
-
protected translateText(input: TranslateTextInput): Promise<TranslateTextOutput>;
|
|
8
|
-
protected convertTextToSpeech(input: TextToSpeechInput): Promise<TextToSpeechOutput>;
|
|
9
|
-
protected convertSpeechToText(input: SpeechToTextInput): Promise<SpeechToTextOutput>;
|
|
10
|
-
static serializeDataFromTranscribe(message: MessageEvent): string;
|
|
11
|
-
private sendDataToTranscribe;
|
|
12
|
-
private sendEncodedDataToTranscribe;
|
|
13
|
-
private getAudioEventMessage;
|
|
14
|
-
private pcmEncode;
|
|
15
|
-
private inputSampleRate;
|
|
16
|
-
private downsampleBuffer;
|
|
17
|
-
private openConnectionWithTranscribe;
|
|
18
|
-
private generateTranscribeUrl;
|
|
19
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { IdentifyEntitiesInput, IdentifyEntitiesOutput, IdentifyLabelsInput, IdentifyLabelsOutput, IdentifyTextInput, IdentifyTextOutput } from '../types';
|
|
2
|
-
export declare class AmazonAIIdentifyPredictionsProvider {
|
|
3
|
-
private rekognitionClient?;
|
|
4
|
-
private textractClient?;
|
|
5
|
-
getProviderName(): string;
|
|
6
|
-
identify(input: IdentifyTextInput | IdentifyLabelsInput | IdentifyEntitiesInput): Promise<IdentifyTextOutput | IdentifyLabelsOutput | IdentifyEntitiesOutput>;
|
|
7
|
-
/**
|
|
8
|
-
* Verify user input source and converts it into source object readable by Rekognition and Textract.
|
|
9
|
-
* Note that Rekognition and Textract use the same source interface, so we need not worry about types.
|
|
10
|
-
* @param {IdentifySource} source - User input source that directs to the object user wants
|
|
11
|
-
* to identify (storage, file, or bytes).
|
|
12
|
-
* @return {Promise<Image>} - Promise resolving to the converted source object.
|
|
13
|
-
*/
|
|
14
|
-
private configureSource;
|
|
15
|
-
/**
|
|
16
|
-
* Recognize text from real-world images and documents (plain text, forms and tables). Detects text in the input
|
|
17
|
-
* image and converts it into machine-readable text.
|
|
18
|
-
* @param {IdentifySource} source - Object containing the source image and feature types to analyze.
|
|
19
|
-
* @return {Promise<IdentifyTextOutput>} - Promise resolving to object containing identified texts.
|
|
20
|
-
*/
|
|
21
|
-
protected identifyText(input: IdentifyTextInput): Promise<IdentifyTextOutput>;
|
|
22
|
-
/**
|
|
23
|
-
* Identify instances of real world entities from an image and if it contains unsafe content.
|
|
24
|
-
* @param {IdentifyLabelsInput} input - Object containing the source image and entity type to identify.
|
|
25
|
-
* @return {Promise<IdentifyLabelsOutput>} - Promise resolving to an array of identified entities.
|
|
26
|
-
*/
|
|
27
|
-
protected identifyLabels(input: IdentifyLabelsInput): Promise<IdentifyLabelsOutput>;
|
|
28
|
-
/**
|
|
29
|
-
* Calls Rekognition.detectLabels and organizes the returned data.
|
|
30
|
-
* @param {DetectLabelsInput} param - parameter to be passed onto Rekognition
|
|
31
|
-
* @return {Promise<IdentifyLabelsOutput>} - Promise resolving to organized detectLabels response.
|
|
32
|
-
*/
|
|
33
|
-
private detectLabels;
|
|
34
|
-
/**
|
|
35
|
-
* Calls Rekognition.detectModerationLabels and organizes the returned data.
|
|
36
|
-
* @param {Rekognition.DetectLabelsRequest} param - Parameter to be passed onto Rekognition
|
|
37
|
-
* @return {Promise<IdentifyLabelsOutput>} - Promise resolving to organized detectModerationLabels response.
|
|
38
|
-
*/
|
|
39
|
-
private detectModerationLabels;
|
|
40
|
-
/**
|
|
41
|
-
* Identify faces within an image that is provided as input, and match faces from a collection
|
|
42
|
-
* or identify celebrities.
|
|
43
|
-
* @param {IdentifyEntityInput} input - object containing the source image and face match options.
|
|
44
|
-
* @return {Promise<IdentifyEntityOutput>} Promise resolving to identify results.
|
|
45
|
-
*/
|
|
46
|
-
protected identifyEntities(input: IdentifyEntitiesInput): Promise<IdentifyEntitiesOutput>;
|
|
47
|
-
private decodeExternalImageId;
|
|
48
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { InterpretTextInput, InterpretTextOutput } from '../types';
|
|
2
|
-
export declare class AmazonAIInterpretPredictionsProvider {
|
|
3
|
-
private comprehendClient?;
|
|
4
|
-
getProviderName(): string;
|
|
5
|
-
interpret(input: InterpretTextInput): Promise<InterpretTextOutput>;
|
|
6
|
-
interpretText(input: InterpretTextInput): Promise<InterpretTextOutput>;
|
|
7
|
-
private detectKeyPhrases;
|
|
8
|
-
private detectSyntax;
|
|
9
|
-
private serializeSyntaxFromComprehend;
|
|
10
|
-
private detectSentiment;
|
|
11
|
-
private detectEntities;
|
|
12
|
-
private serializeEntitiesFromComprehend;
|
|
13
|
-
private detectLanguage;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IdentifyTextOutput } from '../types';
|
|
2
|
-
import { BlockList, TextDetectionList } from '../types/AWSTypes';
|
|
3
|
-
/**
|
|
4
|
-
* Organizes blocks from Rekognition API to each of the categories and and structures
|
|
5
|
-
* their data accordingly.
|
|
6
|
-
* @param {BlockList} source - Array containing blocks returned from Textract API.
|
|
7
|
-
* @return {IdentifyTextOutput} - Object that categorizes each block and its information.
|
|
8
|
-
*/
|
|
9
|
-
export declare function categorizeRekognitionBlocks(blocks: TextDetectionList): IdentifyTextOutput;
|
|
10
|
-
/**
|
|
11
|
-
* Organizes blocks from Textract API to each of the categories and and structures
|
|
12
|
-
* their data accordingly.
|
|
13
|
-
* @param {BlockList} source - Array containing blocks returned from Textract API.
|
|
14
|
-
* @return {IdentifyTextOutput} - Object that categorizes each block and its information.
|
|
15
|
-
*/
|
|
16
|
-
export declare function categorizeTextractBlocks(blocks: BlockList): IdentifyTextOutput;
|
package/lib/providers/Utils.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Changes object keys to camel case. If optional parameter `keys` is given, then we extract only the
|
|
3
|
-
* keys specified in `keys`.
|
|
4
|
-
*/
|
|
5
|
-
export declare function makeCamelCase(obj?: any, keys?: string[]): {} | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* Given an array of object, call makeCamelCase(...) on each option.
|
|
8
|
-
*/
|
|
9
|
-
export declare function makeCamelCaseArray(objArr?: object[], keys?: string[]): ({} | undefined)[] | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Converts blob to array buffer
|
|
12
|
-
*/
|
|
13
|
-
export declare function blobToArrayBuffer(blob: Blob): Promise<Uint8Array>;
|
package/lib/providers/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { AmazonAIConvertPredictionsProvider } from './AmazonAIConvertPredictionsProvider';
|
|
2
|
-
import { AmazonAIIdentifyPredictionsProvider } from './AmazonAIIdentifyPredictionsProvider';
|
|
3
|
-
import { AmazonAIInterpretPredictionsProvider } from './AmazonAIInterpretPredictionsProvider';
|
|
4
|
-
export { AmazonAIConvertPredictionsProvider, AmazonAIIdentifyPredictionsProvider, AmazonAIInterpretPredictionsProvider, };
|