Skip to content

Commit e0a7a9c

Browse files
authored
Merge pull request #28 from owenr88/release/1.2.11
1.2.11
2 parents 87941dc + dcb09c0 commit e0a7a9c

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

packages/cognito-export/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cognito-export",
33
"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",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"bin": "dist/cli.js",

packages/cognito-export/src/CognitoBase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CognitoBase {
1212
protected verbose: boolean;
1313
protected userPoolId: string;
1414
protected cognito: CognitoIdentityProvider | undefined;
15-
protected customAttributes: Record<string, z.ZodType<string | number>> = {}
15+
protected customAttributes: Record<string, z.ZodType> = {}
1616

1717
constructor(options: CognitoExportProps) {
1818
this.verbose = !!options.verbose;
@@ -83,7 +83,7 @@ class CognitoBase {
8383
// Set the custom attributes
8484
userPool.UserPool?.SchemaAttributes?.forEach((attr) => {
8585
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("");
8787
}
8888
});
8989
if(Object.keys(this.customAttributes).length) {

packages/cognito-import/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cognito-import",
33
"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",
55
"main": "dist/index.js",
66
"bin": "dist/cli.js",
77
"repository": {

packages/cognito-import/src/CognitoBase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class CognitoBase {
1515
protected iamArn: string | undefined;
1616
protected userPoolId: string;
1717
protected cognito: CognitoIdentityProvider | undefined;
18-
protected customAttributes: Record<string, z.ZodType<string | number>> = {}
18+
protected customAttributes: Record<string, z.ZodType> = {};
1919

2020
constructor(options: CognitoExportProps) {
2121
this.verbose = !!options.verbose;
@@ -89,7 +89,7 @@ class CognitoBase {
8989
userPool.UserPool?.SchemaAttributes?.forEach((attr) => {
9090
if (attr.Name && attr.Name.startsWith("custom:")) {
9191
// 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('');
9393
}
9494
});
9595
if(Object.keys(this.customAttributes).length) {

packages/zod-cognito/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "zod-cognito",
33
"description": "Zod schemas for AWS Cognito User Pools",
4-
"version": "1.2.10",
4+
"version": "1.2.11",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"repository": {

0 commit comments

Comments
 (0)