idea-aws 4.1.1 → 4.2.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/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './src/s3';
8
8
  export * from './src/secretsManager';
9
9
  export * from './src/ses';
10
10
  export * from './src/sns';
11
+ export * from './src/ssm';
11
12
  export * from './src/translate';
12
13
  export * from './src/attachments';
13
14
  export * from './src/logger';
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ __exportStar(require("./src/s3"), exports);
24
24
  __exportStar(require("./src/secretsManager"), exports);
25
25
  __exportStar(require("./src/ses"), exports);
26
26
  __exportStar(require("./src/sns"), exports);
27
+ __exportStar(require("./src/ssm"), exports);
27
28
  __exportStar(require("./src/translate"), exports);
28
29
  __exportStar(require("./src/attachments"), exports);
29
30
  __exportStar(require("./src/logger"), exports);
@@ -85,6 +85,10 @@ export declare class Cognito {
85
85
  * Send to a user the instructions to change the password.
86
86
  */
87
87
  forgotPassword(email: string, cognitoUserPoolClientId: string): Promise<CognitoIP.CodeDeliveryDetailsType>;
88
+ /**
89
+ * Complete the flow of a password forgot.
90
+ */
91
+ confirmForgotPassword(email: string, newPassword: string, confirmationCode: string, cognitoUserPoolClientId: string): Promise<void>;
88
92
  /**
89
93
  * Update a (Cognito)User's attributes, excluding the attributes that require specific methods.
90
94
  */
@@ -286,6 +286,18 @@ class Cognito {
286
286
  const { CodeDeliveryDetails } = await this.cognito.send(command);
287
287
  return CodeDeliveryDetails;
288
288
  }
289
+ /**
290
+ * Complete the flow of a password forgot.
291
+ */
292
+ async confirmForgotPassword(email, newPassword, confirmationCode, cognitoUserPoolClientId) {
293
+ const command = new CognitoIP.ConfirmForgotPasswordCommand({
294
+ ClientId: cognitoUserPoolClientId,
295
+ Username: email,
296
+ ConfirmationCode: confirmationCode,
297
+ Password: newPassword
298
+ });
299
+ await this.cognito.send(command);
300
+ }
289
301
  /**
290
302
  * Update a (Cognito)User's attributes, excluding the attributes that require specific methods.
291
303
  */
@@ -0,0 +1,16 @@
1
+ import * as AWSSystemsManager from '@aws-sdk/client-ssm';
2
+ /**
3
+ * A wrapper for AWS Systems Manager (SSM).
4
+ */
5
+ export declare class SystemsManager {
6
+ protected ssm: AWSSystemsManager.SSMClient;
7
+ constructor();
8
+ /**
9
+ * Get a parameter by its name (path).
10
+ */
11
+ getParameterByName(name: string): Promise<string>;
12
+ /**
13
+ * Get a parameter (with decryption) by its name (path).
14
+ */
15
+ getSecretByName(name: string): Promise<string>;
16
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.SystemsManager = void 0;
27
+ const AWSSystemsManager = __importStar(require("@aws-sdk/client-ssm"));
28
+ /**
29
+ * A wrapper for AWS Systems Manager (SSM).
30
+ */
31
+ class SystemsManager {
32
+ constructor() {
33
+ this.ssm = new AWSSystemsManager.SSMClient();
34
+ }
35
+ /**
36
+ * Get a parameter by its name (path).
37
+ */
38
+ async getParameterByName(name) {
39
+ const command = new AWSSystemsManager.GetParameterCommand({ Name: name });
40
+ const result = await this.ssm.send(command);
41
+ return result.Parameter.Value;
42
+ }
43
+ /**
44
+ * Get a parameter (with decryption) by its name (path).
45
+ */
46
+ async getSecretByName(name) {
47
+ const command = new AWSSystemsManager.GetParameterCommand({ Name: name, WithDecryption: true });
48
+ const result = await this.ssm.send(command);
49
+ return result.Parameter.Value;
50
+ }
51
+ }
52
+ exports.SystemsManager = SystemsManager;
package/index.ts CHANGED
@@ -9,6 +9,7 @@ export * from './src/s3';
9
9
  export * from './src/secretsManager';
10
10
  export * from './src/ses';
11
11
  export * from './src/sns';
12
+ export * from './src/ssm';
12
13
  export * from './src/translate';
13
14
  export * from './src/attachments';
14
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idea-aws",
3
- "version": "4.1.1",
3
+ "version": "4.2.1",
4
4
  "description": "AWS wrappers to use in IDEA's back-ends",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,6 +55,7 @@
55
55
  "@aws-sdk/client-ses": "^3.398.0",
56
56
  "@aws-sdk/client-sesv2": "^3.388.0",
57
57
  "@aws-sdk/client-sns": "^3.388.0",
58
+ "@aws-sdk/client-ssm": "^3.419.0",
58
59
  "@aws-sdk/client-translate": "^3.388.0",
59
60
  "@aws-sdk/lib-dynamodb": "^3.388.0",
60
61
  "@aws-sdk/lib-storage": "^3.388.0",