@aws-amplify/predictions 4.0.61 → 4.0.62-unstable.2

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 (82) hide show
  1. package/CHANGELOG.md +0 -8
  2. package/lib/.tsbuildinfo +3 -0
  3. package/lib/Predictions.d.ts +49 -0
  4. package/lib/Predictions.js +4 -34
  5. package/lib/Predictions.js.map +1 -1
  6. package/lib/Providers/AmazonAIConvertPredictionsProvider.d.ts +20 -0
  7. package/lib/Providers/AmazonAIConvertPredictionsProvider.js +10 -62
  8. package/lib/Providers/AmazonAIConvertPredictionsProvider.js.map +1 -1
  9. package/lib/Providers/AmazonAIIdentifyPredictionsProvider.d.ts +49 -0
  10. package/lib/Providers/AmazonAIIdentifyPredictionsProvider.js +18 -84
  11. package/lib/Providers/AmazonAIIdentifyPredictionsProvider.js.map +1 -1
  12. package/lib/Providers/AmazonAIInterpretPredictionsProvider.d.ts +14 -0
  13. package/lib/Providers/AmazonAIInterpretPredictionsProvider.js +15 -83
  14. package/lib/Providers/AmazonAIInterpretPredictionsProvider.js.map +1 -1
  15. package/lib/Providers/AmazonAIPredictionsProvider.d.ts +14 -0
  16. package/lib/Providers/AmazonAIPredictionsProvider.js +2 -18
  17. package/lib/Providers/AmazonAIPredictionsProvider.js.map +1 -1
  18. package/lib/Providers/IdentifyTextUtils.d.ts +40 -0
  19. package/lib/Providers/IdentifyTextUtils.js +7 -17
  20. package/lib/Providers/IdentifyTextUtils.js.map +1 -1
  21. package/lib/Providers/Utils.d.ts +13 -0
  22. package/lib/Providers/index.d.ts +5 -0
  23. package/lib/index.d.ts +4 -0
  24. package/lib/index.js +4 -20
  25. package/lib/index.js.map +1 -1
  26. package/lib/types/AWSTypes.d.ts +125 -0
  27. package/lib/types/Predictions.d.ts +281 -0
  28. package/lib/types/Providers/AbstractConvertPredictionsProvider.d.ts +9 -0
  29. package/lib/types/Providers/AbstractConvertPredictionsProvider.js +2 -14
  30. package/lib/types/Providers/AbstractConvertPredictionsProvider.js.map +1 -1
  31. package/lib/types/Providers/AbstractIdentifyPredictionsProvider.d.ts +9 -0
  32. package/lib/types/Providers/AbstractIdentifyPredictionsProvider.js +2 -14
  33. package/lib/types/Providers/AbstractIdentifyPredictionsProvider.js.map +1 -1
  34. package/lib/types/Providers/AbstractInterpretPredictionsProvider.d.ts +7 -0
  35. package/lib/types/Providers/AbstractInterpretPredictionsProvider.js +2 -14
  36. package/lib/types/Providers/AbstractInterpretPredictionsProvider.js.map +1 -1
  37. package/lib/types/Providers/AbstractPredictionsProvider.d.ts +7 -0
  38. package/lib/types/Providers/index.d.ts +4 -0
  39. package/lib/types/Providers/index.js +5 -7
  40. package/lib/types/Providers/index.js.map +1 -1
  41. package/lib/types/index.d.ts +1 -0
  42. package/lib/types/index.js +2 -4
  43. package/lib/types/index.js.map +1 -1
  44. package/lib-esm/.tsbuildinfo +3 -0
  45. package/lib-esm/Predictions.js +1 -31
  46. package/lib-esm/Predictions.js.map +1 -1
  47. package/lib-esm/Providers/AmazonAIConvertPredictionsProvider.d.ts +0 -4
  48. package/lib-esm/Providers/AmazonAIConvertPredictionsProvider.js +1 -53
  49. package/lib-esm/Providers/AmazonAIConvertPredictionsProvider.js.map +1 -1
  50. package/lib-esm/Providers/AmazonAIIdentifyPredictionsProvider.d.ts +0 -4
  51. package/lib-esm/Providers/AmazonAIIdentifyPredictionsProvider.js +3 -66
  52. package/lib-esm/Providers/AmazonAIIdentifyPredictionsProvider.js.map +1 -1
  53. package/lib-esm/Providers/AmazonAIInterpretPredictionsProvider.d.ts +0 -4
  54. package/lib-esm/Providers/AmazonAIInterpretPredictionsProvider.js +1 -69
  55. package/lib-esm/Providers/AmazonAIInterpretPredictionsProvider.js.map +1 -1
  56. package/lib-esm/Providers/AmazonAIPredictionsProvider.d.ts +0 -4
  57. package/lib-esm/Providers/AmazonAIPredictionsProvider.js +1 -17
  58. package/lib-esm/Providers/AmazonAIPredictionsProvider.js.map +1 -1
  59. package/lib-esm/Providers/IdentifyTextUtils.js +1 -11
  60. package/lib-esm/Providers/IdentifyTextUtils.js.map +1 -1
  61. package/lib-esm/index.d.ts +0 -4
  62. package/lib-esm/index.js +2 -16
  63. package/lib-esm/index.js.map +1 -1
  64. package/lib-esm/types/Providers/AbstractConvertPredictionsProvider.js +1 -13
  65. package/lib-esm/types/Providers/AbstractConvertPredictionsProvider.js.map +1 -1
  66. package/lib-esm/types/Providers/AbstractIdentifyPredictionsProvider.js +1 -13
  67. package/lib-esm/types/Providers/AbstractIdentifyPredictionsProvider.js.map +1 -1
  68. package/lib-esm/types/Providers/AbstractInterpretPredictionsProvider.js +1 -13
  69. package/lib-esm/types/Providers/AbstractInterpretPredictionsProvider.js.map +1 -1
  70. package/package.json +14 -10
  71. package/src/Providers/AmazonAIConvertPredictionsProvider.ts +4 -8
  72. package/src/Providers/AmazonAIIdentifyPredictionsProvider.ts +4 -8
  73. package/src/Providers/AmazonAIInterpretPredictionsProvider.ts +2 -8
  74. package/src/Providers/AmazonAIPredictionsProvider.ts +0 -5
  75. package/src/index.ts +2 -17
  76. package/build.js +0 -5
  77. package/dist/aws-amplify-predictions.js +0 -101211
  78. package/dist/aws-amplify-predictions.js.map +0 -1
  79. package/dist/aws-amplify-predictions.min.js +0 -26
  80. package/dist/aws-amplify-predictions.min.js.map +0 -1
  81. package/index.js +0 -7
  82. package/webpack.config.dev.js +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractIdentifyPredictionsProvider.js","sourceRoot":"","sources":["../../../src/types/Providers/AbstractIdentifyPredictionsProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAGN,qBAAqB,EACrB,uBAAuB,EAEvB,mBAAmB,GAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,qCAAqC,CAAC,CAAC;AAEjE;IAAkE,uDAA2B;IAA7F;;IAuCA,CAAC;IAtCA,yDAAW,GAAX;QACC,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,sDAAQ,GAAR,UACC,KAAsE;QAItE,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;YAC/B,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;SAChC;aAAM,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE;YACxC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;SAClC;aAAM,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE;YAC1C,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SACpC;IACF,CAAC;IAES,0DAAY,GAAtB,UACC,KAAwB;QAExB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,4DAAc,GAAxB,UACC,KAA0B;QAE1B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACvE,CAAC;IAES,8DAAgB,GAA1B,UACC,KAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACzE,CAAC;IACF,0CAAC;AAAD,CAAC,AAvCD,CAAkE,2BAA2B,GAuC5F"}
1
+ {"version":3,"file":"AbstractIdentifyPredictionsProvider.js","sourceRoot":"","sources":["../../../src/types/Providers/AbstractIdentifyPredictionsProvider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAGN,qBAAqB,EACrB,uBAAuB,EAEvB,mBAAmB,GAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,qCAAqC,CAAC,CAAC;AAEjE;IAAkE,uDAA2B;IAA7F;;IAuCA,CAAC;IAtCA,yDAAW,GAAX;QACC,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,sDAAQ,GAAR,UACC,KAAsE;QAItE,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;YAC/B,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;SAChC;aAAM,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE;YACxC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;SAClC;aAAM,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE;YAC1C,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SACpC;IACF,CAAC;IAES,0DAAY,GAAtB,UACC,KAAwB;QAExB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACtE,CAAC;IAES,4DAAc,GAAxB,UACC,KAA0B;QAE1B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACvE,CAAC;IAES,8DAAgB,GAA1B,UACC,KAA4B;QAE5B,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACzE,CAAC;IACF,0CAAC;AAAD,CAAC,AAvCD,CAAkE,2BAA2B,GAuC5F"}
@@ -1,16 +1,4 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
1
+ import { __extends } from "tslib";
14
2
  import { AbstractPredictionsProvider } from './AbstractPredictionsProvider';
15
3
  import { isInterpretTextInput, } from '../Predictions';
16
4
  var AbstractInterpretPredictionsProvider = /** @class */ (function (_super) {
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractInterpretPredictionsProvider.js","sourceRoot":"","sources":["../../../src/types/Providers/AbstractInterpretPredictionsProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAGN,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AAExB;IAAmE,wDAA2B;IAA9F;;IAgBA,CAAC;IAfA,0DAAW,GAAX;QACC,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,wDAAS,GAAT,UAAU,KAAyB;QAClC,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE;YAChC,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACjC;IACF,CAAC;IAES,4DAAa,GAAvB,UACC,KAAyB;QAEzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACpE,CAAC;IACF,2CAAC;AAAD,CAAC,AAhBD,CAAmE,2BAA2B,GAgB7F"}
1
+ {"version":3,"file":"AbstractInterpretPredictionsProvider.js","sourceRoot":"","sources":["../../../src/types/Providers/AbstractInterpretPredictionsProvider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAGN,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AAExB;IAAmE,wDAA2B;IAA9F;;IAgBA,CAAC;IAfA,0DAAW,GAAX;QACC,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,wDAAS,GAAT,UAAU,KAAyB;QAClC,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE;YAChC,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACjC;IACF,CAAC;IAES,4DAAa,GAAvB,UACC,KAAyB;QAEzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACpE,CAAC;IACF,2CAAC;AAAD,CAAC,AAhBD,CAAmE,2BAA2B,GAgB7F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/predictions",
3
- "version": "4.0.61",
3
+ "version": "4.0.62-unstable.2+55e13f5a7",
4
4
  "description": "Machine learning category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -9,11 +9,8 @@
9
9
  "./lib/index": "./lib-esm/index.js"
10
10
  },
11
11
  "sideEffects": [
12
- "./src/Predictions.ts",
13
12
  "./lib/Predictions.js",
14
- "./lib-esm/Predictions.js",
15
- "./dist/aws-amplify-predictions.min.js",
16
- "./dist/aws-amplify-predictions.js"
13
+ "./lib-esm/Predictions.js"
17
14
  ],
18
15
  "scripts": {
19
16
  "test": "jest -w 1 --passWithNoTests --coverage --maxWorkers 2",
@@ -25,9 +22,10 @@
25
22
  "build": "npm run clean && npm run build:esm && npm run build:cjs",
26
23
  "clean": "rimraf lib-esm lib dist",
27
24
  "format": "echo \"Not implemented\"",
28
- "lint": "tslint 'src/**/*.ts'",
25
+ "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
29
26
  "generate-docs-local": "typedoc --out docs src",
30
- "generate-docs-root": "typedoc --out ../../docs src"
27
+ "generate-docs-root": "typedoc --out ../../docs src",
28
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 87.84"
31
29
  },
32
30
  "repository": {
33
31
  "type": "git",
@@ -39,9 +37,14 @@
39
37
  "url": "https://github.com/aws/aws-amplify/issues"
40
38
  },
41
39
  "homepage": "https://aws-amplify.github.io/",
40
+ "files": [
41
+ "lib",
42
+ "lib-esm",
43
+ "src"
44
+ ],
42
45
  "dependencies": {
43
- "@aws-amplify/core": "4.7.12",
44
- "@aws-amplify/storage": "4.5.14",
46
+ "@aws-amplify/core": "4.7.13-unstable.2+55e13f5a7",
47
+ "@aws-amplify/storage": "4.5.15-unstable.2+55e13f5a7",
45
48
  "@aws-sdk/client-comprehend": "3.6.1",
46
49
  "@aws-sdk/client-polly": "3.6.1",
47
50
  "@aws-sdk/client-rekognition": "3.6.1",
@@ -49,6 +52,7 @@
49
52
  "@aws-sdk/client-translate": "3.6.1",
50
53
  "@aws-sdk/eventstream-marshaller": "3.6.1",
51
54
  "@aws-sdk/util-utf8-node": "3.6.1",
55
+ "tslib": "^1.8.0",
52
56
  "uuid": "^3.2.1"
53
57
  },
54
58
  "jest": {
@@ -95,5 +99,5 @@
95
99
  "lib-esm"
96
100
  ]
97
101
  },
98
- "gitHead": "f2a588ee786fe23d391d600e5eb0a3f277b4841c"
102
+ "gitHead": "55e13f5a77488793f97b9c7ffe963aaa0c687884"
99
103
  }
@@ -254,9 +254,10 @@ export class AmazonAIConvertPredictionsProvider extends AbstractConvertPredictio
254
254
  let fullText = '';
255
255
  connection.onmessage = message => {
256
256
  try {
257
- const decodedMessage = AmazonAIConvertPredictionsProvider.serializeDataFromTranscribe(
258
- message
259
- );
257
+ const decodedMessage =
258
+ AmazonAIConvertPredictionsProvider.serializeDataFromTranscribe(
259
+ message
260
+ );
260
261
  if (decodedMessage) {
261
262
  fullText += decodedMessage + ' ';
262
263
  }
@@ -427,8 +428,3 @@ export class AmazonAIConvertPredictionsProvider extends AbstractConvertPredictio
427
428
  return signedUrl;
428
429
  }
429
430
  }
430
-
431
- /**
432
- * @deprecated use named import
433
- */
434
- export default AmazonAIConvertPredictionsProvider;
@@ -3,7 +3,7 @@ import {
3
3
  ConsoleLogger as Logger,
4
4
  getAmplifyUserAgent,
5
5
  } from '@aws-amplify/core';
6
- import Storage from '@aws-amplify/storage';
6
+ import { Storage } from '@aws-amplify/storage';
7
7
  import { AbstractIdentifyPredictionsProvider } from '../types/Providers';
8
8
  import {
9
9
  RekognitionClient,
@@ -80,7 +80,8 @@ export class AmazonAIIdentifyPredictionsProvider extends AbstractIdentifyPredict
80
80
  };
81
81
  Storage.get(source.key, storageConfig)
82
82
  .then((url: string) => {
83
- const parser = /https:\/\/([a-zA-Z0-9%-_.]+)\.s3\.[A-Za-z0-9%-._~]+\/([a-zA-Z0-9%-._~/]+)\?/;
83
+ const parser =
84
+ /https:\/\/([a-zA-Z0-9%-_.]+)\.s3\.[A-Za-z0-9%-._~]+\/([a-zA-Z0-9%-._~/]+)\?/;
84
85
  const parsedURL = url.match(parser);
85
86
  if (parsedURL.length < 3) rej('Invalid S3 key was given.');
86
87
  res({
@@ -449,7 +450,7 @@ export class AmazonAIIdentifyPredictionsProvider extends AbstractIdentifyPredict
449
450
  'Beard',
450
451
  'Mustache',
451
452
  'EyesOpen',
452
- 'MouthOpen'
453
+ 'MouthOpen',
453
454
  ];
454
455
  const faceAttributes = makeCamelCase(detail, attributeKeys);
455
456
  if (detail.Emotions) {
@@ -479,8 +480,3 @@ export class AmazonAIIdentifyPredictionsProvider extends AbstractIdentifyPredict
479
480
  return ('' + externalImageId).replace(/::/g, '/');
480
481
  }
481
482
  }
482
-
483
- /**
484
- * @deprecated use named import
485
- */
486
- export default AmazonAIIdentifyPredictionsProvider;
@@ -45,9 +45,8 @@ export class AmazonAIInterpretPredictionsProvider extends AbstractInterpretPredi
45
45
  } = {},
46
46
  } = ({} = input);
47
47
 
48
- const {
49
- text: { source: { language = undefined } = {} } = {},
50
- } = ({} = input as any); // language is only required for specific interpret types
48
+ const { text: { source: { language = undefined } = {} } = {} } = ({} =
49
+ input as any); // language is only required for specific interpret types
51
50
 
52
51
  const comprehendClient = new ComprehendClient({
53
52
  credentials,
@@ -284,8 +283,3 @@ export class AmazonAIInterpretPredictionsProvider extends AbstractInterpretPredi
284
283
  }
285
284
  }
286
285
  }
287
-
288
- /**
289
- * @deprecated use named import
290
- */
291
- export default AmazonAIInterpretPredictionsProvider;
@@ -65,8 +65,3 @@ export class AmazonAIPredictionsProvider extends AbstractPredictionsProvider {
65
65
  return this.identifyProvider.identify(input);
66
66
  }
67
67
  }
68
-
69
- /**
70
- * @deprecated use named import
71
- */
72
- export default AmazonAIPredictionsProvider;
package/src/index.ts CHANGED
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
5
- * the License. A copy of the License is located at
6
- *
7
- * http://aws.amazon.com/apache2.0/
8
- *
9
- * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
10
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
11
- * and limitations under the License.
12
- */
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
13
3
  import { Predictions } from './Predictions';
14
4
 
15
5
  import {
@@ -28,8 +18,3 @@ export {
28
18
  AmazonAIPredictionsProvider,
29
19
  AmazonAIInterpretPredictionsProvider,
30
20
  };
31
-
32
- /**
33
- * @deprecated use named import
34
- */
35
- export default Predictions;
package/build.js DELETED
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const build = require('../../scripts/build');
4
-
5
- build(process.argv[2], process.argv[3]);