File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " cognito-export" ,
3
3
"description" : " A simple CLI tool and JavaScript package for exporting users from an AWS Cognito user pool." ,
4
- "version" : " 1.2.10 " ,
4
+ "version" : " 1.2.11 " ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
7
7
"bin" : " dist/cli.js" ,
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class CognitoBase {
12
12
protected verbose : boolean ;
13
13
protected userPoolId : string ;
14
14
protected cognito : CognitoIdentityProvider | undefined ;
15
- protected customAttributes : Record < string , z . ZodType < string | number > > = { }
15
+ protected customAttributes : Record < string , z . ZodType > = { }
16
16
17
17
constructor ( options : CognitoExportProps ) {
18
18
this . verbose = ! ! options . verbose ;
@@ -83,7 +83,7 @@ class CognitoBase {
83
83
// Set the custom attributes
84
84
userPool . UserPool ?. SchemaAttributes ?. forEach ( ( attr ) => {
85
85
if ( attr . Name && attr . Name . startsWith ( "custom:" ) ) {
86
- this . customAttributes [ attr . Name ] = z . union ( [ z . string ( ) , z . number ( ) ] ) ;
86
+ this . customAttributes [ attr . Name ] = z . union ( [ z . string ( ) , z . number ( ) ] ) . optional ( ) . default ( "" ) ;
87
87
}
88
88
} ) ;
89
89
if ( Object . keys ( this . customAttributes ) . length ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " cognito-import" ,
3
3
"description" : " A simple CLI tool and JavaScript package for importing users into an AWS Cognito user pool." ,
4
- "version" : " 1.2.10 " ,
4
+ "version" : " 1.2.11 " ,
5
5
"main" : " dist/index.js" ,
6
6
"bin" : " dist/cli.js" ,
7
7
"repository" : {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class CognitoBase {
15
15
protected iamArn : string | undefined ;
16
16
protected userPoolId : string ;
17
17
protected cognito : CognitoIdentityProvider | undefined ;
18
- protected customAttributes : Record < string , z . ZodType < string | number > > = { }
18
+ protected customAttributes : Record < string , z . ZodType > = { } ;
19
19
20
20
constructor ( options : CognitoExportProps ) {
21
21
this . verbose = ! ! options . verbose ;
@@ -89,7 +89,7 @@ class CognitoBase {
89
89
userPool . UserPool ?. SchemaAttributes ?. forEach ( ( attr ) => {
90
90
if ( attr . Name && attr . Name . startsWith ( "custom:" ) ) {
91
91
// TODO: #24 We know the data type of the custom attribute, so we should validate against it
92
- this . customAttributes [ attr . Name ] = z . union ( [ z . string ( ) , z . number ( ) ] )
92
+ this . customAttributes [ attr . Name ] = z . union ( [ z . string ( ) , z . number ( ) ] ) . optional ( ) . default ( '' ) ;
93
93
}
94
94
} ) ;
95
95
if ( Object . keys ( this . customAttributes ) . length ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " zod-cognito" ,
3
3
"description" : " Zod schemas for AWS Cognito User Pools" ,
4
- "version" : " 1.2.10 " ,
4
+ "version" : " 1.2.11 " ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
7
7
"repository" : {
You can’t perform that action at this time.
0 commit comments