@trunkrs/common 1.11.3 → 1.11.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trunkrs/common",
3
- "version": "1.11.3",
3
+ "version": "1.11.6",
4
4
  "description": "Common standards library for development in Trunkrs",
5
5
  "types": "./index.d.ts",
6
6
  "repository": "https://github.com/Trunkrs/common.git",
@@ -0,0 +1,5 @@
1
+ import ErrorBase from '../../../models/errors/ErrorBase';
2
+ declare class LambdaInvocationFailedError extends ErrorBase {
3
+ constructor(error?: any);
4
+ }
5
+ export default LambdaInvocationFailedError;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const ErrorBase_1 = __importDefault(require("../../../models/errors/ErrorBase"));
7
+ class LambdaInvocationFailedError extends ErrorBase_1.default {
8
+ constructor(error) {
9
+ super();
10
+ this.message =
11
+ `Lambda Invocation Failed with error: ${JSON.stringify(error, null, 2)}`;
12
+ Error.captureStackTrace(this);
13
+ }
14
+ }
15
+ exports.default = LambdaInvocationFailedError;
16
+ //# sourceMappingURL=LambdaInvocationFailedError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LambdaInvocationFailedError.js","sourceRoot":"","sources":["../../../../services/aws/LambdaClient/LambdaInvocationFailedError.ts"],"names":[],"mappings":";;;;;AAAA,iFAAwD;AAExD,MAAM,2BAA4B,SAAQ,mBAAS;IACjD,YAAmB,KAAW;QAC5B,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,OAAO;YACV,wCAAwC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAA;QAC1E,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACF;AAED,kBAAe,2BAA2B,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Serializer } from '../../utils/serialization';
1
+ import { Serializer } from '../../../utils/serialization';
2
2
  declare class LambdaClient<TResponse = unknown, TInvokeArgs = unknown> {
3
3
  protected readonly functionArn: string;
4
4
  protected readonly serializer: Serializer;
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const LambdaInvocationFailedError_1 = __importDefault(require("./LambdaInvocationFailedError"));
3
7
  class LambdaClient {
4
8
  constructor(functionArn, serializer, lambdaInstance) {
5
9
  this.functionArn = functionArn;
@@ -14,6 +18,9 @@ class LambdaClient {
14
18
  Payload: serializedInput,
15
19
  FunctionName: this.functionArn,
16
20
  }).promise();
21
+ if (result.FunctionError) {
22
+ throw new LambdaInvocationFailedError_1.default(result.FunctionError);
23
+ }
17
24
  if (!result.Payload) {
18
25
  return;
19
26
  }
@@ -22,4 +29,4 @@ class LambdaClient {
22
29
  }
23
30
  }
24
31
  exports.default = LambdaClient;
25
- //# sourceMappingURL=LambdaClient.js.map
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../services/aws/LambdaClient/index.ts"],"names":[],"mappings":";;;;;AACA,gGAAuE;AAEvE,MAAM,YAAY;IAChB,YACqB,WAAmB,EACnB,UAAsB,EACtB,cAA0B;QAF1B,gBAAW,GAAX,WAAW,CAAQ;QACnB,eAAU,GAAV,UAAU,CAAY;QACtB,mBAAc,GAAd,cAAc,CAAY;IAC5C,CAAC;IAEG,KAAK,CAAC,YAAY,CAAC,IAAkB;QAC1C,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI;YAC5B,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ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