idea-aws 4.4.16 → 4.4.17

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.
@@ -81,6 +81,10 @@ export declare class Cognito {
81
81
  * Change the email address (== username) associated to a user.
82
82
  */
83
83
  updateEmail(email: string, newEmail: string, userPoolId: string): Promise<void>;
84
+ /**
85
+ * Verify the email address (== username) associated to a user.
86
+ */
87
+ verifyEmail(email: string, userPoolId: string, unverify?: boolean): Promise<void>;
84
88
  /**
85
89
  * Change the password to sign in for a user.
86
90
  */
@@ -264,6 +264,17 @@ class Cognito {
264
264
  // sign out the user from all its devices and resolve
265
265
  await this.globalSignOut(newEmail, userPoolId);
266
266
  }
267
+ /**
268
+ * Verify the email address (== username) associated to a user.
269
+ */
270
+ async verifyEmail(email, userPoolId, unverify = false) {
271
+ const command = new CognitoIP.AdminUpdateUserAttributesCommand({
272
+ UserPoolId: userPoolId,
273
+ Username: email,
274
+ UserAttributes: [{ Name: 'email_verified', Value: unverify ? 'false' : 'true' }]
275
+ });
276
+ await this.client.send(command);
277
+ }
267
278
  /**
268
279
  * Change the password to sign in for a user.
269
280
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idea-aws",
3
- "version": "4.4.16",
3
+ "version": "4.4.17",
4
4
  "description": "AWS wrappers to use in IDEA's back-ends",
5
5
  "license": "MPL-2.0",
6
6
  "main": "dist/index.js",