@pristine-ts/aws 0.0.142 → 0.0.146

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.
@@ -12,11 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.HttpRequestMapper = void 0;
13
13
  const tsyringe_1 = require("tsyringe");
14
14
  const method_mapper_1 = require("./method.mapper");
15
- const body_mapper_1 = require("./body-mapper");
16
15
  let HttpRequestMapper = class HttpRequestMapper {
17
- constructor(methodMapper, bodyMapper) {
16
+ constructor(methodMapper) {
18
17
  this.methodMapper = methodMapper;
19
- this.bodyMapper = bodyMapper;
20
18
  }
21
19
  /**
22
20
  * Maps and HttpRequest (Api gateway version 2.0) to a Pristine request.
@@ -27,15 +25,14 @@ let HttpRequestMapper = class HttpRequestMapper {
27
25
  url: request.requestContext.http.path,
28
26
  headers: request.headers,
29
27
  httpMethod: this.methodMapper.map(request.requestContext.http.method),
30
- body: this.bodyMapper.map(request.body),
28
+ body: request.body,
31
29
  rawBody: request.body,
32
30
  };
33
31
  }
34
32
  };
35
33
  HttpRequestMapper = __decorate([
36
34
  tsyringe_1.injectable(),
37
- __metadata("design:paramtypes", [method_mapper_1.MethodMapper,
38
- body_mapper_1.BodyMapper])
35
+ __metadata("design:paramtypes", [method_mapper_1.MethodMapper])
39
36
  ], HttpRequestMapper);
40
37
  exports.HttpRequestMapper = HttpRequestMapper;
41
38
  //# sourceMappingURL=http-request.mapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-request.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/http-request.mapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAoC;AAGpC,mDAA6C;AAE7C,+CAAyC;AAGzC,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,YAA6B,YAA0B,EAC1B,UAAsB;QADtB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAY;IACnD,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAAyB;QACzB,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI;YACrC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;YACrE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;YACvC,OAAO,EAAE,OAAO,CAAC,IAAI;SACxB,CAAA;IACL,CAAC;CACJ,CAAA;AAlBY,iBAAiB;IAD7B,qBAAU,EAAE;qCAEkC,4BAAY;QACd,wBAAU;GAF1C,iBAAiB,CAkB7B;AAlBY,8CAAiB"}
1
+ {"version":3,"file":"http-request.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/http-request.mapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAoC;AAGpC,mDAA6C;AAI7C,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IACvD,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAAyB;QACzB,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI;YACrC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;YACrE,IAAI,EAAC,OAAO,CAAC,IAAI;YACjB,OAAO,EAAE,OAAO,CAAC,IAAI;SACxB,CAAA;IACL,CAAC;CACJ,CAAA;AAjBY,iBAAiB;IAD7B,qBAAU,EAAE;qCAEkC,4BAAY;GAD9C,iBAAiB,CAiB7B;AAjBY,8CAAiB"}
@@ -10,7 +10,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./body-mapper"), exports);
14
13
  __exportStar(require("./http-request.mapper"), exports);
15
14
  __exportStar(require("./method.mapper"), exports);
16
15
  __exportStar(require("./request.mapper"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../../../src/mappers/mappers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAgC;AAChC,mDAAiC;AACjC,oDAAkC;AAClC,4DAA0C"}
1
+ {"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../../../src/mappers/mappers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAsC;AACtC,kDAAgC;AAChC,mDAAiC;AACjC,oDAAkC;AAClC,4DAA0C"}
@@ -12,30 +12,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.RestApiRequestMapper = void 0;
13
13
  const tsyringe_1 = require("tsyringe");
14
14
  const method_mapper_1 = require("./method.mapper");
15
- const body_mapper_1 = require("./body-mapper");
16
15
  let RestApiRequestMapper = class RestApiRequestMapper {
17
- constructor(methodMapper, bodyMapper) {
16
+ constructor(methodMapper) {
18
17
  this.methodMapper = methodMapper;
19
- this.bodyMapper = bodyMapper;
20
18
  }
21
19
  /**
22
20
  * Maps a rest api request (Api gateway version 1.0) to a Pristine request.
23
- * @param request The resst api request from Api gateway.
21
+ * @param request The rest api request from Api gateway.
24
22
  */
25
23
  map(request) {
26
24
  return {
27
25
  url: request.path,
28
26
  headers: request.headers,
29
27
  httpMethod: this.methodMapper.map(request.httpMethod),
30
- body: this.bodyMapper.map(request.body),
28
+ body: request.body,
31
29
  rawBody: request.body,
32
30
  };
33
31
  }
34
32
  };
35
33
  RestApiRequestMapper = __decorate([
36
34
  tsyringe_1.injectable(),
37
- __metadata("design:paramtypes", [method_mapper_1.MethodMapper,
38
- body_mapper_1.BodyMapper])
35
+ __metadata("design:paramtypes", [method_mapper_1.MethodMapper])
39
36
  ], RestApiRequestMapper);
40
37
  exports.RestApiRequestMapper = RestApiRequestMapper;
41
38
  //# sourceMappingURL=rest-api-request.mapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rest-api-request.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/rest-api-request.mapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAoC;AAGpC,mDAA6C;AAE7C,+CAAyC;AAGzC,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAC7B,YAA6B,YAA0B,EAC1B,UAAsB;QADtB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAY;IACnD,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAA4B;QAC5B,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,IAAI;YACjB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC;YACrD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;YACvC,OAAO,EAAE,OAAO,CAAC,IAAI;SACxB,CAAA;IACL,CAAC;CACJ,CAAA;AAlBY,oBAAoB;IADhC,qBAAU,EAAE;qCAEkC,4BAAY;QACd,wBAAU;GAF1C,oBAAoB,CAkBhC;AAlBY,oDAAoB"}
1
+ {"version":3,"file":"rest-api-request.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/rest-api-request.mapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAoC;AAGpC,mDAA6C;AAI7C,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAC7B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IACvD,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAA4B;QAC5B,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,IAAI;YACjB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC;YACrD,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,OAAO,CAAC,IAAI;SACxB,CAAA;IACL,CAAC;CACJ,CAAA;AAjBY,oBAAoB;IADhC,qBAAU,EAAE;qCAEkC,4BAAY;GAD9C,oBAAoB,CAiBhC;AAjBY,oDAAoB"}
@@ -9,11 +9,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { injectable } from "tsyringe";
11
11
  import { MethodMapper } from "./method.mapper";
12
- import { BodyMapper } from "./body-mapper";
13
12
  let HttpRequestMapper = class HttpRequestMapper {
14
- constructor(methodMapper, bodyMapper) {
13
+ constructor(methodMapper) {
15
14
  this.methodMapper = methodMapper;
16
- this.bodyMapper = bodyMapper;
17
15
  }
18
16
  /**
19
17
  * Maps and HttpRequest (Api gateway version 2.0) to a Pristine request.
@@ -24,15 +22,14 @@ let HttpRequestMapper = class HttpRequestMapper {
24
22
  url: request.requestContext.http.path,
25
23
  headers: request.headers,
26
24
  httpMethod: this.methodMapper.map(request.requestContext.http.method),
27
- body: this.bodyMapper.map(request.body),
25
+ body: request.body,
28
26
  rawBody: request.body,
29
27
  };
30
28
  }
31
29
  };
32
30
  HttpRequestMapper = __decorate([
33
31
  injectable(),
34
- __metadata("design:paramtypes", [MethodMapper,
35
- BodyMapper])
32
+ __metadata("design:paramtypes", [MethodMapper])
36
33
  ], HttpRequestMapper);
37
34
  export { HttpRequestMapper };
38
35
  //# sourceMappingURL=http-request.mapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-request.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/http-request.mapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAGzC,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,YAA6B,YAA0B,EAC1B,UAAsB;QADtB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAY;IACnD,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAAyB;QACzB,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI;YACrC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;YACrE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;YACvC,OAAO,EAAE,OAAO,CAAC,IAAI;SACxB,CAAA;IACL,CAAC;CACJ,CAAA;AAlBY,iBAAiB;IAD7B,UAAU,EAAE;qCAEkC,YAAY;QACd,UAAU;GAF1C,iBAAiB,CAkB7B;SAlBY,iBAAiB"}
1
+ {"version":3,"file":"http-request.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/http-request.mapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAI7C,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IACvD,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAAyB;QACzB,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI;YACrC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;YACrE,IAAI,EAAC,OAAO,CAAC,IAAI;YACjB,OAAO,EAAE,OAAO,CAAC,IAAI;SACxB,CAAA;IACL,CAAC;CACJ,CAAA;AAjBY,iBAAiB;IAD7B,UAAU,EAAE;qCAEkC,YAAY;GAD9C,iBAAiB,CAiB7B;SAjBY,iBAAiB"}
@@ -1,4 +1,3 @@
1
- export * from "./body-mapper";
2
1
  export * from "./http-request.mapper";
3
2
  export * from "./method.mapper";
4
3
  export * from "./request.mapper";
@@ -1 +1 @@
1
- {"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../../../src/mappers/mappers.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../../../src/mappers/mappers.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC"}
@@ -9,30 +9,27 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { injectable } from "tsyringe";
11
11
  import { MethodMapper } from "./method.mapper";
12
- import { BodyMapper } from "./body-mapper";
13
12
  let RestApiRequestMapper = class RestApiRequestMapper {
14
- constructor(methodMapper, bodyMapper) {
13
+ constructor(methodMapper) {
15
14
  this.methodMapper = methodMapper;
16
- this.bodyMapper = bodyMapper;
17
15
  }
18
16
  /**
19
17
  * Maps a rest api request (Api gateway version 1.0) to a Pristine request.
20
- * @param request The resst api request from Api gateway.
18
+ * @param request The rest api request from Api gateway.
21
19
  */
22
20
  map(request) {
23
21
  return {
24
22
  url: request.path,
25
23
  headers: request.headers,
26
24
  httpMethod: this.methodMapper.map(request.httpMethod),
27
- body: this.bodyMapper.map(request.body),
25
+ body: request.body,
28
26
  rawBody: request.body,
29
27
  };
30
28
  }
31
29
  };
32
30
  RestApiRequestMapper = __decorate([
33
31
  injectable(),
34
- __metadata("design:paramtypes", [MethodMapper,
35
- BodyMapper])
32
+ __metadata("design:paramtypes", [MethodMapper])
36
33
  ], RestApiRequestMapper);
37
34
  export { RestApiRequestMapper };
38
35
  //# sourceMappingURL=rest-api-request.mapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rest-api-request.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/rest-api-request.mapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAGzC,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAC7B,YAA6B,YAA0B,EAC1B,UAAsB;QADtB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAY;IACnD,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAA4B;QAC5B,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,IAAI;YACjB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC;YACrD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;YACvC,OAAO,EAAE,OAAO,CAAC,IAAI;SACxB,CAAA;IACL,CAAC;CACJ,CAAA;AAlBY,oBAAoB;IADhC,UAAU,EAAE;qCAEkC,YAAY;QACd,UAAU;GAF1C,oBAAoB,CAkBhC;SAlBY,oBAAoB"}
1
+ {"version":3,"file":"rest-api-request.mapper.js","sourceRoot":"","sources":["../../../../src/mappers/rest-api-request.mapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAI7C,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAC7B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IACvD,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAA4B;QAC5B,OAAO;YACH,GAAG,EAAE,OAAO,CAAC,IAAI;YACjB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC;YACrD,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,OAAO,CAAC,IAAI;SACxB,CAAA;IACL,CAAC;CACJ,CAAA;AAjBY,oBAAoB;IADhC,UAAU,EAAE;qCAEkC,YAAY;GAD9C,oBAAoB,CAiBhC;SAjBY,oBAAoB"}
@@ -2,11 +2,9 @@ import { RequestInterface } from "@pristine-ts/common";
2
2
  import { RequestMapperInterface } from "../interfaces/request-mapper.interface";
3
3
  import { MethodMapper } from "./method.mapper";
4
4
  import { HttpRequestModel } from "../models/http-request.model";
5
- import { BodyMapper } from "./body-mapper";
6
5
  export declare class HttpRequestMapper implements RequestMapperInterface {
7
6
  private readonly methodMapper;
8
- private readonly bodyMapper;
9
- constructor(methodMapper: MethodMapper, bodyMapper: BodyMapper);
7
+ constructor(methodMapper: MethodMapper);
10
8
  /**
11
9
  * Maps and HttpRequest (Api gateway version 2.0) to a Pristine request.
12
10
  * @param request
@@ -1,4 +1,3 @@
1
- export * from "./body-mapper";
2
1
  export * from "./http-request.mapper";
3
2
  export * from "./method.mapper";
4
3
  export * from "./request.mapper";
@@ -2,14 +2,12 @@ import { RequestInterface } from "@pristine-ts/common";
2
2
  import { RequestMapperInterface } from "../interfaces/request-mapper.interface";
3
3
  import { MethodMapper } from "./method.mapper";
4
4
  import { RestApiRequestModel } from "../models/rest-api-request.model";
5
- import { BodyMapper } from "./body-mapper";
6
5
  export declare class RestApiRequestMapper implements RequestMapperInterface {
7
6
  private readonly methodMapper;
8
- private readonly bodyMapper;
9
- constructor(methodMapper: MethodMapper, bodyMapper: BodyMapper);
7
+ constructor(methodMapper: MethodMapper);
10
8
  /**
11
9
  * Maps a rest api request (Api gateway version 1.0) to a Pristine request.
12
- * @param request The resst api request from Api gateway.
10
+ * @param request The rest api request from Api gateway.
13
11
  */
14
12
  map(request: RestApiRequestModel): RequestInterface;
15
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pristine-ts/aws",
3
- "version": "0.0.142",
3
+ "version": "0.0.146",
4
4
  "description": "",
5
5
  "module": "dist/lib/esm/aws.module.js",
6
6
  "main": "dist/lib/cjs/aws.module.js",
@@ -23,11 +23,11 @@
23
23
  "@awslabs-community-fork/dynamodb-data-mapper": "^0.7.9",
24
24
  "@awslabs-community-fork/dynamodb-data-marshaller": "^0.7.9",
25
25
  "@awslabs-community-fork/dynamodb-expressions": "^0.7.9",
26
- "@pristine-ts/common": "^0.0.142",
27
- "@pristine-ts/event": "^0.0.142",
28
- "@pristine-ts/logging": "^0.0.142",
29
- "@pristine-ts/networking": "^0.0.142",
30
- "@pristine-ts/security": "^0.0.142"
26
+ "@pristine-ts/common": "^0.0.146",
27
+ "@pristine-ts/event": "^0.0.146",
28
+ "@pristine-ts/logging": "^0.0.146",
29
+ "@pristine-ts/networking": "^0.0.146",
30
+ "@pristine-ts/security": "^0.0.146"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
@@ -66,5 +66,5 @@
66
66
  "src/*.{js,ts}"
67
67
  ]
68
68
  },
69
- "gitHead": "e52197322a79fd79ed7aef8ae77533b15a860a03"
69
+ "gitHead": "7a412e622af2fc1402875187d1292d6e685b665c"
70
70
  }
package/readme.md CHANGED
@@ -1 +1,36 @@
1
1
  # AWS module
2
+ Amazon Web Services (AWS) is a Cloud service powered by Amazon. It has a lot of different services. The goal of this AWS module is to try to make it as seamless
3
+ as possible to integrate with as many services as possible.
4
+
5
+ If you are using AWS, you are definitely familiar with the [AWS SDK](https://aws.amazon.com/sdk-for-javascript/). The AWS SDK is very well built. However, there are a lot of
6
+ things that aren't encapsulated and the goal of this module is to make it even easier to interact with AWS Services.
7
+
8
+ ### Wrapper clients
9
+
10
+ #### DynamoDB Client
11
+ DynamoDB is the NoSQL managed service by AWS. DynamoDB is not extremely straightforward or easy to use. Therefore, we have created a DynamoDB Client that simplifies the interaction with DynamoDB.
12
+
13
+ The `DynamodbClient` implements the `DynamodbClientInterface` allowing to mock your database layer in unit tests very easily.
14
+
15
+ In your class, you can easily request to have the `DynamodbClientInterface` be injected like this:
16
+
17
+ ```
18
+ @injectable()
19
+ class MyService {
20
+ constructor(@inject("DynamodbClientInterface") private readonly dynamodbClient: DynamodbClientInterface) {}
21
+ }
22
+ ```
23
+
24
+ #### Event Bridge Client
25
+
26
+ #### SQS Client
27
+
28
+ ### Event Parsers
29
+ One of the most complicated thing when interacting with AWS, is the parsing of AWS events. As you will see later on, Pristine has its own mechanic for handling Events and we are transforming AWS Events into Pristine Events.
30
+
31
+ In a nutshell, this means that you can easily listen to any AWS Events by creating a class that implements the `EventListenerInterface` and specifies the Event you want to listen to.
32
+
33
+ ### Resolvers
34
+ #### SSM Resolver
35
+ AWS has a service called SSM that allows you to store sensitive information such as passwords. The SSM Resolver can be used with the configuration service and will resolve values in the SSM for you. The only thing you have to worry about, is to
36
+ inject the configuration value in your class. How it's being retrieved is handled by Pristine for you.
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.BodyMapper = void 0;
13
- const tsyringe_1 = require("tsyringe");
14
- let BodyMapper = class BodyMapper {
15
- constructor() {
16
- }
17
- /**
18
- * Maps a body. Parses the body if possible.
19
- * @param body The body.
20
- */
21
- map(body) {
22
- let parsedBody;
23
- if (!body) {
24
- return;
25
- }
26
- try {
27
- return JSON.parse(body);
28
- }
29
- catch (e) {
30
- return body;
31
- }
32
- }
33
- };
34
- BodyMapper = __decorate([
35
- tsyringe_1.injectable(),
36
- __metadata("design:paramtypes", [])
37
- ], BodyMapper);
38
- exports.BodyMapper = BodyMapper;
39
- //# sourceMappingURL=body-mapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"body-mapper.js","sourceRoot":"","sources":["../../../../src/mappers/body-mapper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAoC;AAGpC,IAAa,UAAU,GAAvB,MAAa,UAAU;IACnB;IACA,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,IAAwB;QACxB,IAAI,UAAU,CAAC;QACf,IAAG,CAAC,IAAI,EAAC;YACL,OAAO;SACV;QACD,IAAI;YACA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC3B;QAAC,OAAO,CAAC,EAAE;YACR,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ,CAAA;AAnBY,UAAU;IADtB,qBAAU,EAAE;;GACA,UAAU,CAmBtB;AAnBY,gCAAU"}
@@ -1,36 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { injectable } from "tsyringe";
11
- let BodyMapper = class BodyMapper {
12
- constructor() {
13
- }
14
- /**
15
- * Maps a body. Parses the body if possible.
16
- * @param body The body.
17
- */
18
- map(body) {
19
- let parsedBody;
20
- if (!body) {
21
- return;
22
- }
23
- try {
24
- return JSON.parse(body);
25
- }
26
- catch (e) {
27
- return body;
28
- }
29
- }
30
- };
31
- BodyMapper = __decorate([
32
- injectable(),
33
- __metadata("design:paramtypes", [])
34
- ], BodyMapper);
35
- export { BodyMapper };
36
- //# sourceMappingURL=body-mapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"body-mapper.js","sourceRoot":"","sources":["../../../../src/mappers/body-mapper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,IAAa,UAAU,GAAvB,MAAa,UAAU;IACnB;IACA,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,IAAwB;QACxB,IAAI,UAAU,CAAC;QACf,IAAG,CAAC,IAAI,EAAC;YACL,OAAO;SACV;QACD,IAAI;YACA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC3B;QAAC,OAAO,CAAC,EAAE;YACR,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ,CAAA;AAnBY,UAAU;IADtB,UAAU,EAAE;;GACA,UAAU,CAmBtB;SAnBY,UAAU"}
@@ -1,8 +0,0 @@
1
- export declare class BodyMapper {
2
- constructor();
3
- /**
4
- * Maps a body. Parses the body if possible.
5
- * @param body The body.
6
- */
7
- map(body: string | undefined): any;
8
- }