idea-aws 4.4.13 → 4.4.14
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/src/cognito.d.ts +13 -1
- package/dist/src/cognito.js +15 -0
- package/dist/src/dynamoDB.d.ts +1 -1
- package/dist/src/dynamoDB.js +1 -1
- package/package.json +2 -2
package/dist/src/cognito.d.ts
CHANGED
|
@@ -97,6 +97,14 @@ export declare class Cognito {
|
|
|
97
97
|
* Update a (Cognito)User's attributes, excluding the attributes that require specific methods.
|
|
98
98
|
*/
|
|
99
99
|
updateUser(user: CognitoUser, userPoolId: string): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Disable a cognito user.
|
|
102
|
+
*/
|
|
103
|
+
disableUser(email: string, userPoolId: string): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Enable a cognito user.
|
|
106
|
+
*/
|
|
107
|
+
enableUser(email: string, userPoolId: string): Promise<void>;
|
|
100
108
|
/**
|
|
101
109
|
* Sign out the user from all devices.
|
|
102
110
|
*/
|
|
@@ -148,10 +156,14 @@ export interface CognitoUserGeneric {
|
|
|
148
156
|
* The email (=== username).
|
|
149
157
|
*/
|
|
150
158
|
email: string;
|
|
159
|
+
/**
|
|
160
|
+
* Whether the user has been disabled.
|
|
161
|
+
*/
|
|
162
|
+
disabled: boolean;
|
|
151
163
|
/**
|
|
152
164
|
* Cognito can have custom attributes.
|
|
153
165
|
*/
|
|
154
|
-
[attribute: string]: string;
|
|
166
|
+
[attribute: string]: string | number | boolean;
|
|
155
167
|
}
|
|
156
168
|
/**
|
|
157
169
|
* Options when creating a new user.
|
package/dist/src/cognito.js
CHANGED
|
@@ -68,6 +68,7 @@ class Cognito {
|
|
|
68
68
|
(user.Attributes ?? user.UserAttributes ?? []).forEach((a) => (userAttributes[a.Name] = a.Value));
|
|
69
69
|
if (!userAttributes.userId)
|
|
70
70
|
userAttributes.userId = userAttributes.sub;
|
|
71
|
+
userAttributes.disabled = !user.Enabled;
|
|
71
72
|
return userAttributes;
|
|
72
73
|
}
|
|
73
74
|
//
|
|
@@ -316,6 +317,20 @@ class Cognito {
|
|
|
316
317
|
});
|
|
317
318
|
await this.client.send(command);
|
|
318
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* Disable a cognito user.
|
|
322
|
+
*/
|
|
323
|
+
async disableUser(email, userPoolId) {
|
|
324
|
+
const command = new CognitoIP.AdminDisableUserCommand({ UserPoolId: userPoolId, Username: email });
|
|
325
|
+
await this.client.send(command);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Enable a cognito user.
|
|
329
|
+
*/
|
|
330
|
+
async enableUser(email, userPoolId) {
|
|
331
|
+
const command = new CognitoIP.AdminEnableUserCommand({ UserPoolId: userPoolId, Username: email });
|
|
332
|
+
await this.client.send(command);
|
|
333
|
+
}
|
|
319
334
|
/**
|
|
320
335
|
* Sign out the user from all devices.
|
|
321
336
|
*/
|
package/dist/src/dynamoDB.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class DynamoDB {
|
|
|
15
15
|
*/
|
|
16
16
|
unmarshall(data: Record<string, any>, options?: DDBUtils.unmarshallOptions): Record<string, any>;
|
|
17
17
|
/**
|
|
18
|
-
* Returns an IUNID: IDEA's Unique Nano IDentifier, which is an id unique through an
|
|
18
|
+
* Returns an IUNID: IDEA's Unique Nano IDentifier, which is an id unique through an AWS region inside an account.
|
|
19
19
|
* Note: no need of an auth check for external uses: the permissions depend from the context in which it's executed.
|
|
20
20
|
* @param project project code
|
|
21
21
|
* @return the IUNID
|
package/dist/src/dynamoDB.js
CHANGED
|
@@ -49,7 +49,7 @@ class DynamoDB {
|
|
|
49
49
|
return DDBUtils.unmarshall(data, options);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Returns an IUNID: IDEA's Unique Nano IDentifier, which is an id unique through an
|
|
52
|
+
* Returns an IUNID: IDEA's Unique Nano IDentifier, which is an id unique through an AWS region inside an account.
|
|
53
53
|
* Note: no need of an auth check for external uses: the permissions depend from the context in which it's executed.
|
|
54
54
|
* @param project project code
|
|
55
55
|
* @return the IUNID
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "idea-aws",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.14",
|
|
4
4
|
"description": "AWS wrappers to use in IDEA's back-ends",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@aws-lambda-powertools/metrics": "^1.18.1",
|
|
41
41
|
"@aws-lambda-powertools/tracer": "^1.18.1",
|
|
42
|
-
"idea-toolbox": "^7.0.
|
|
42
|
+
"idea-toolbox": "^7.0.11",
|
|
43
43
|
"nanoid": "^3.3.7",
|
|
44
44
|
"nodemailer": "^6.9.14",
|
|
45
45
|
"source-map-support": "^0.5.21"
|