@pristine-ts/aws 0.0.402 → 0.0.404

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 (114) hide show
  1. package/dist/lib/cjs/aws.module.js +12 -3
  2. package/dist/lib/cjs/aws.module.js.map +1 -1
  3. package/dist/lib/cjs/clients/cloudformation.client.js +68 -11
  4. package/dist/lib/cjs/clients/cloudformation.client.js.map +1 -1
  5. package/dist/lib/cjs/clients/cloudfront.client.js.map +1 -1
  6. package/dist/lib/cjs/clients/dynamodb.client.js +170 -35
  7. package/dist/lib/cjs/clients/dynamodb.client.js.map +1 -1
  8. package/dist/lib/cjs/clients/event-bridge.client.js.map +1 -1
  9. package/dist/lib/cjs/clients/s3.client.js +25 -3
  10. package/dist/lib/cjs/clients/s3.client.js.map +1 -1
  11. package/dist/lib/cjs/clients/secrets-manager.client.js.map +1 -1
  12. package/dist/lib/cjs/clients/ses.client.js.map +1 -1
  13. package/dist/lib/cjs/clients/sqs.client.js.map +1 -1
  14. package/dist/lib/cjs/decorators/dynamic-table-name.decorator.js.map +1 -1
  15. package/dist/lib/cjs/enums/cloudformation-deployment-status.enum.js.map +1 -1
  16. package/dist/lib/cjs/enums/dynamodb-event-type.enum.js.map +1 -1
  17. package/dist/lib/cjs/enums/dynamodb-sort-order.enum.js.map +1 -1
  18. package/dist/lib/cjs/enums/event-bridge-event-type.enum.js.map +1 -1
  19. package/dist/lib/cjs/enums/kafka-event-type.enum.js.map +1 -1
  20. package/dist/lib/cjs/enums/s3-event-type.enum.js.map +1 -1
  21. package/dist/lib/cjs/enums/s3-presigned-operation-type.enum.js.map +1 -1
  22. package/dist/lib/cjs/enums/sns-event-type.enum.js.map +1 -1
  23. package/dist/lib/cjs/enums/sqs-event-type.enum.js.map +1 -1
  24. package/dist/lib/cjs/errors/dynamodb-item-already-exists.error.js.map +1 -1
  25. package/dist/lib/cjs/errors/dynamodb-item-not-found.error.js.map +1 -1
  26. package/dist/lib/cjs/errors/dynamodb-table-not-found.error.js.map +1 -1
  27. package/dist/lib/cjs/errors/dynamodb-validation.error.js.map +1 -1
  28. package/dist/lib/cjs/errors/dynamodb.error.js.map +1 -1
  29. package/dist/lib/cjs/errors/event-bridge-send-message.error.js.map +1 -1
  30. package/dist/lib/cjs/errors/get-secret-secrets-manager.error.js.map +1 -1
  31. package/dist/lib/cjs/errors/ses-send.error.js.map +1 -1
  32. package/dist/lib/cjs/errors/sqs-send-message.error.js.map +1 -1
  33. package/dist/lib/cjs/errors/ssm-resolver.error.js.map +1 -1
  34. package/dist/lib/cjs/event-payloads/event-bridge.payload.js.map +1 -1
  35. package/dist/lib/cjs/event-payloads/kafka.event-payload.js.map +1 -1
  36. package/dist/lib/cjs/mappers/dynamodb-event.mapper.js +33 -33
  37. package/dist/lib/cjs/mappers/dynamodb-event.mapper.js.map +1 -1
  38. package/dist/lib/cjs/mappers/event-bridge-event.mapper.js.map +1 -1
  39. package/dist/lib/cjs/mappers/kafka-event.mapper.js.map +1 -1
  40. package/dist/lib/cjs/mappers/s3-event.mapper.js +14 -14
  41. package/dist/lib/cjs/mappers/s3-event.mapper.js.map +1 -1
  42. package/dist/lib/cjs/mappers/sns-event.mapper.js +14 -14
  43. package/dist/lib/cjs/mappers/sns-event.mapper.js.map +1 -1
  44. package/dist/lib/cjs/mappers/sqs-event.mapper.js.map +1 -1
  45. package/dist/lib/cjs/models/dynamodb.model.js.map +1 -1
  46. package/dist/lib/cjs/models/event-bridge-message.model.js.map +1 -1
  47. package/dist/lib/cjs/models/sns.model.js.map +1 -1
  48. package/dist/lib/cjs/resolvers/ssm.resolver.js.map +1 -1
  49. package/dist/lib/cjs/results/list.result.js +6 -6
  50. package/dist/lib/cjs/results/list.result.js.map +1 -1
  51. package/dist/lib/esm/aws.module.js +12 -3
  52. package/dist/lib/esm/aws.module.js.map +1 -1
  53. package/dist/lib/esm/clients/cloudformation.client.js +68 -11
  54. package/dist/lib/esm/clients/cloudformation.client.js.map +1 -1
  55. package/dist/lib/esm/clients/cloudfront.client.js.map +1 -1
  56. package/dist/lib/esm/clients/dynamodb.client.js +170 -35
  57. package/dist/lib/esm/clients/dynamodb.client.js.map +1 -1
  58. package/dist/lib/esm/clients/event-bridge.client.js.map +1 -1
  59. package/dist/lib/esm/clients/s3.client.js +25 -3
  60. package/dist/lib/esm/clients/s3.client.js.map +1 -1
  61. package/dist/lib/esm/clients/secrets-manager.client.js.map +1 -1
  62. package/dist/lib/esm/clients/ses.client.js.map +1 -1
  63. package/dist/lib/esm/clients/sqs.client.js +1 -1
  64. package/dist/lib/esm/clients/sqs.client.js.map +1 -1
  65. package/dist/lib/esm/decorators/dynamic-table-name.decorator.js.map +1 -1
  66. package/dist/lib/esm/enums/cloudformation-deployment-status.enum.js.map +1 -1
  67. package/dist/lib/esm/enums/dynamodb-event-type.enum.js.map +1 -1
  68. package/dist/lib/esm/enums/dynamodb-sort-order.enum.js.map +1 -1
  69. package/dist/lib/esm/enums/event-bridge-event-type.enum.js.map +1 -1
  70. package/dist/lib/esm/enums/kafka-event-type.enum.js.map +1 -1
  71. package/dist/lib/esm/enums/s3-event-type.enum.js.map +1 -1
  72. package/dist/lib/esm/enums/s3-presigned-operation-type.enum.js.map +1 -1
  73. package/dist/lib/esm/enums/sns-event-type.enum.js.map +1 -1
  74. package/dist/lib/esm/enums/sqs-event-type.enum.js.map +1 -1
  75. package/dist/lib/esm/errors/dynamodb-item-already-exists.error.js.map +1 -1
  76. package/dist/lib/esm/errors/dynamodb-item-not-found.error.js.map +1 -1
  77. package/dist/lib/esm/errors/dynamodb-table-not-found.error.js.map +1 -1
  78. package/dist/lib/esm/errors/dynamodb-validation.error.js.map +1 -1
  79. package/dist/lib/esm/errors/dynamodb.error.js.map +1 -1
  80. package/dist/lib/esm/errors/event-bridge-send-message.error.js.map +1 -1
  81. package/dist/lib/esm/errors/get-secret-secrets-manager.error.js.map +1 -1
  82. package/dist/lib/esm/errors/ses-send.error.js.map +1 -1
  83. package/dist/lib/esm/errors/sqs-send-message.error.js.map +1 -1
  84. package/dist/lib/esm/errors/ssm-resolver.error.js.map +1 -1
  85. package/dist/lib/esm/event-payloads/event-bridge.payload.js.map +1 -1
  86. package/dist/lib/esm/event-payloads/kafka.event-payload.js.map +1 -1
  87. package/dist/lib/esm/mappers/dynamodb-event.mapper.js +33 -33
  88. package/dist/lib/esm/mappers/dynamodb-event.mapper.js.map +1 -1
  89. package/dist/lib/esm/mappers/event-bridge-event.mapper.js.map +1 -1
  90. package/dist/lib/esm/mappers/kafka-event.mapper.js.map +1 -1
  91. package/dist/lib/esm/mappers/s3-event.mapper.js +14 -14
  92. package/dist/lib/esm/mappers/s3-event.mapper.js.map +1 -1
  93. package/dist/lib/esm/mappers/sns-event.mapper.js +14 -14
  94. package/dist/lib/esm/mappers/sns-event.mapper.js.map +1 -1
  95. package/dist/lib/esm/mappers/sqs-event.mapper.js.map +1 -1
  96. package/dist/lib/esm/models/dynamodb.model.js.map +1 -1
  97. package/dist/lib/esm/models/event-bridge-message.model.js.map +1 -1
  98. package/dist/lib/esm/models/sns.model.js.map +1 -1
  99. package/dist/lib/esm/resolvers/ssm.resolver.js.map +1 -1
  100. package/dist/lib/esm/results/list.result.js +6 -6
  101. package/dist/lib/esm/results/list.result.js.map +1 -1
  102. package/dist/types/clients/dynamodb.client.d.ts +39 -11
  103. package/dist/types/interfaces/cloudformation-client.interface.d.ts +1 -1
  104. package/dist/types/interfaces/dynamodb-client.interface.d.ts +33 -5
  105. package/dist/types/interfaces/s3-client.interface.d.ts +1 -1
  106. package/dist/types/mappers/dynamodb-event.mapper.d.ts +13 -13
  107. package/dist/types/mappers/event-bridge-event.mapper.d.ts +1 -1
  108. package/dist/types/mappers/kafka-event.mapper.d.ts +1 -1
  109. package/dist/types/mappers/s3-event.mapper.d.ts +7 -7
  110. package/dist/types/mappers/sns-event.mapper.d.ts +7 -7
  111. package/dist/types/mappers/sqs-event.mapper.d.ts +1 -1
  112. package/dist/types/results/list.result.d.ts +2 -2
  113. package/package.json +7 -7
  114. package/readme.md +20 -7
@@ -1,4 +1,4 @@
1
- import { EventMapperInterface, EventResponse, ExecutionContextInterface, EventsExecutionOptionsInterface } from "@pristine-ts/core";
1
+ import { EventMapperInterface, EventResponse, EventsExecutionOptionsInterface, ExecutionContextInterface } from "@pristine-ts/core";
2
2
  import { DynamodbEventPayload } from "../event-payloads/dynamodb.event-payload";
3
3
  /**
4
4
  * Mapper to map the DynamoDb event into a Pristine event.
@@ -6,18 +6,6 @@ import { DynamodbEventPayload } from "../event-payloads/dynamodb.event-payload";
6
6
  * It is module scoped so that it gets injected only if the AWS module is imported.
7
7
  */
8
8
  export declare class DynamodbEventMapper implements EventMapperInterface<DynamodbEventPayload, void> {
9
- /**
10
- * Finds the enum value corresponding to the event name.
11
- * @param eventName The event name of the DynamoDb event.
12
- * @private
13
- */
14
- private findEnum;
15
- /**
16
- * Parses the keys from the DynamoDb event
17
- * @param object The keys to be parsed
18
- * @private
19
- */
20
- private parseKeys;
21
9
  /**
22
10
  * Parses the DynamoDb event into a Pristine event.
23
11
  * @param rawEvent The raw DynamoDb event
@@ -48,4 +36,16 @@ export declare class DynamodbEventMapper implements EventMapperInterface<Dynamod
48
36
  * @param executionContext The execution context of the event.
49
37
  */
50
38
  reverseMap(eventResponse: EventResponse<DynamodbEventPayload, void>, response: any, executionContext: ExecutionContextInterface<any>): void;
39
+ /**
40
+ * Finds the enum value corresponding to the event name.
41
+ * @param eventName The event name of the DynamoDb event.
42
+ * @private
43
+ */
44
+ private findEnum;
45
+ /**
46
+ * Parses the keys from the DynamoDb event
47
+ * @param object The keys to be parsed
48
+ * @private
49
+ */
50
+ private parseKeys;
51
51
  }
@@ -1,4 +1,4 @@
1
- import { EventMapperInterface, EventResponse, ExecutionContextInterface, EventsExecutionOptionsInterface } from "@pristine-ts/core";
1
+ import { EventMapperInterface, EventResponse, EventsExecutionOptionsInterface, ExecutionContextInterface } from "@pristine-ts/core";
2
2
  import { EventBridgePayload } from "../event-payloads/event-bridge.payload";
3
3
  /**
4
4
  * Mapper to map the Event bridge event into a Pristine event.
@@ -1,4 +1,4 @@
1
- import { EventMapperInterface, EventResponse, ExecutionContextInterface, EventsExecutionOptionsInterface } from "@pristine-ts/core";
1
+ import { EventMapperInterface, EventResponse, EventsExecutionOptionsInterface, ExecutionContextInterface } from "@pristine-ts/core";
2
2
  import { KafkaEventPayload } from "../event-payloads/kafka.event-payload";
3
3
  /**
4
4
  * Mapper to map the Kafka event from the AWS kafka connector into a Pristine event.
@@ -1,4 +1,4 @@
1
- import { EventMapperInterface, EventResponse, ExecutionContextInterface, EventsExecutionOptionsInterface } from "@pristine-ts/core";
1
+ import { EventMapperInterface, EventResponse, EventsExecutionOptionsInterface, ExecutionContextInterface } from "@pristine-ts/core";
2
2
  import { S3EventPayload } from "../event-payloads/s3.event-payload";
3
3
  /**
4
4
  * Mapper to map the S3 event into a Pristine event.
@@ -6,12 +6,6 @@ import { S3EventPayload } from "../event-payloads/s3.event-payload";
6
6
  * It is module scoped so that it gets injected only if the AWS module is imported.
7
7
  */
8
8
  export declare class S3EventMapper implements EventMapperInterface<S3EventPayload, void> {
9
- /**
10
- * Finds the enum value corresponding to the event name.
11
- * @param eventName The event name of the S3 event.
12
- * @private
13
- */
14
- private findEnum;
15
9
  /**
16
10
  * Parses the S3 event into a Pristine event.
17
11
  * @param rawEvent The raw S3 event
@@ -42,4 +36,10 @@ export declare class S3EventMapper implements EventMapperInterface<S3EventPayloa
42
36
  * @param executionContext The execution context of the event.
43
37
  */
44
38
  reverseMap(eventResponse: EventResponse<S3EventPayload, void>, response: any, executionContext: ExecutionContextInterface<any>): void;
39
+ /**
40
+ * Finds the enum value corresponding to the event name.
41
+ * @param eventName The event name of the S3 event.
42
+ * @private
43
+ */
44
+ private findEnum;
45
45
  }
@@ -1,4 +1,4 @@
1
- import { EventMapperInterface, EventResponse, ExecutionContextInterface, EventsExecutionOptionsInterface } from "@pristine-ts/core";
1
+ import { EventMapperInterface, EventResponse, EventsExecutionOptionsInterface, ExecutionContextInterface } from "@pristine-ts/core";
2
2
  import { SnsEventPayload } from "../event-payloads/sns.event-payload";
3
3
  /**
4
4
  * Mapper to map the Sns event into a Pristine event.
@@ -6,12 +6,6 @@ import { SnsEventPayload } from "../event-payloads/sns.event-payload";
6
6
  * It is module scoped so that it gets injected only if the AWS module is imported.
7
7
  */
8
8
  export declare class SnsEventMapper implements EventMapperInterface<SnsEventPayload, void> {
9
- /**
10
- * Finds the enum value corresponding to the event name.
11
- * @param eventName The event name of the SNS event.
12
- * @private
13
- */
14
- private findEnum;
15
9
  /**
16
10
  * Parses the SNS event into a Pristine event.
17
11
  * @param rawEvent The raw SNS event
@@ -42,4 +36,10 @@ export declare class SnsEventMapper implements EventMapperInterface<SnsEventPayl
42
36
  * @param executionContext The execution context of the event.
43
37
  */
44
38
  reverseMap(eventResponse: EventResponse<SnsEventPayload, void>, response: any, executionContext: ExecutionContextInterface<any>): void;
39
+ /**
40
+ * Finds the enum value corresponding to the event name.
41
+ * @param eventName The event name of the SNS event.
42
+ * @private
43
+ */
44
+ private findEnum;
45
45
  }
@@ -1,4 +1,4 @@
1
- import { EventMapperInterface, EventResponse, ExecutionContextInterface, EventsExecutionOptionsInterface } from "@pristine-ts/core";
1
+ import { EventMapperInterface, EventResponse, EventsExecutionOptionsInterface, ExecutionContextInterface } from "@pristine-ts/core";
2
2
  import { SqsEventPayload } from "../event-payloads/sqs.event-payload";
3
3
  /**
4
4
  * Mapper to map the Sqs event into a Pristine event.
@@ -14,8 +14,8 @@ export declare class ListResult<T> implements IterableIterator<T> {
14
14
  * @param _paginationResult The pagination results of the query.
15
15
  */
16
16
  constructor(_items: T[], _paginationResult?: PaginationResult | undefined);
17
- [Symbol.iterator](): ListResult<T>;
18
- next(): IteratorResult<T, T | undefined>;
19
17
  get paginationResult(): PaginationResult | undefined;
20
18
  get items(): T[];
19
+ [Symbol.iterator](): ListResult<T>;
20
+ next(): IteratorResult<T, T | undefined>;
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pristine-ts/aws",
3
- "version": "0.0.402",
3
+ "version": "0.0.404",
4
4
  "description": "",
5
5
  "module": "dist/lib/esm/aws.module.js",
6
6
  "main": "dist/lib/cjs/aws.module.js",
@@ -30,11 +30,11 @@
30
30
  "@awslabs-community-fork/dynamodb-data-mapper": "^0.7.13",
31
31
  "@awslabs-community-fork/dynamodb-data-marshaller": "^0.7.13",
32
32
  "@awslabs-community-fork/dynamodb-expressions": "^0.7.13",
33
- "@pristine-ts/common": "^0.0.402",
34
- "@pristine-ts/core": "^0.0.402",
35
- "@pristine-ts/logging": "^0.0.402",
36
- "@pristine-ts/networking": "^0.0.402",
37
- "@pristine-ts/security": "^0.0.402",
33
+ "@pristine-ts/common": "^0.0.404",
34
+ "@pristine-ts/core": "^0.0.404",
35
+ "@pristine-ts/logging": "^0.0.404",
36
+ "@pristine-ts/networking": "^0.0.404",
37
+ "@pristine-ts/security": "^0.0.404",
38
38
  "uuid": "^9.0.1"
39
39
  },
40
40
  "publishConfig": {
@@ -74,5 +74,5 @@
74
74
  "src/*.{js,ts}"
75
75
  ]
76
76
  },
77
- "gitHead": "eb786cf4d88015781c3f053b5dfb22365c12b9e3"
77
+ "gitHead": "9abf20c5f2fd4b22b1295f6465ec0b7d19c1724e"
78
78
  }
package/readme.md CHANGED
@@ -1,16 +1,22 @@
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
2
+
3
+ Amazon Web Services (AWS) is a Cloud service powered by Amazon. It has a lot of different services. The goal of this AWS
4
+ module is to try to make it as seamless
3
5
  as possible to integrate with as many services as possible.
4
6
 
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
7
+ If you are using AWS, you are definitely familiar with the [AWS SDK](https://aws.amazon.com/sdk-for-javascript/). The
8
+ AWS SDK is very well built. However, there are a lot of
6
9
  things that aren't encapsulated and the goal of this module is to make it even easier to interact with AWS Services.
7
10
 
8
11
  ### Wrapper clients
9
12
 
10
13
  #### 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
14
 
13
- The `DynamodbClient` implements the `DynamodbClientInterface` allowing to mock your database layer in unit tests very easily.
15
+ DynamoDB is the NoSQL managed service by AWS. DynamoDB is not extremely straightforward or easy to use. Therefore, we
16
+ have created a DynamoDB Client that simplifies the interaction with DynamoDB.
17
+
18
+ The `DynamodbClient` implements the `DynamodbClientInterface` allowing to mock your database layer in unit tests very
19
+ easily.
14
20
 
15
21
  In your class, you can easily request to have the `DynamodbClientInterface` be injected like this:
16
22
 
@@ -26,11 +32,18 @@ class MyService {
26
32
  #### SQS Client
27
33
 
28
34
  ### 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
35
 
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.
36
+ One of the most complicated thing when interacting with AWS, is the parsing of AWS events. As you will see later on,
37
+ Pristine has its own mechanic for handling Events and we are transforming AWS Events into Pristine Events.
38
+
39
+ In a nutshell, this means that you can easily listen to any AWS Events by creating a class that implements the
40
+ `EventListenerInterface` and specifies the Event you want to listen to.
32
41
 
33
42
  ### Resolvers
43
+
34
44
  #### 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
45
+
46
+ AWS has a service called SSM that allows you to store sensitive information such as passwords. The SSM Resolver can be
47
+ used with the configuration service and will resolve values in the SSM for you. The only thing you have to worry about,
48
+ is to
36
49
  inject the configuration value in your class. How it's being retrieved is handled by Pristine for you.