@@ -18,6 +18,7 @@ export const ALLOWED_CLUSTER_NAME_CHARACTERS_ERROR =
1818const ALLOWED_PROJECT_NAME_CHARACTERS_REGEX = / ^ [ a - z A - Z 0 - 9 \s ( ) @ & + : . _ ' , - ] + $ / ;
1919export const ALLOWED_PROJECT_NAME_CHARACTERS_ERROR =
2020 "Project names can't be longer than 64 characters and can only contain letters, numbers, spaces, and the following symbols: ( ) @ & + : . _ - ' ," ;
21+
2122export const CommonArgs = {
2223 string : ( ) : ZodString => z . string ( ) . regex ( NO_UNICODE_REGEX , NO_UNICODE_ERROR ) ,
2324
@@ -70,14 +71,15 @@ export const AtlasArgs = {
7071 z . string ( ) . min ( 1 , "Password is required" ) . max ( 100 , "Password must be 100 characters or less" ) ,
7172} ;
7273
73- export const ProjectAndClusterArgs = {
74+ export const ProjectArgs = {
7475 projectId : AtlasArgs . projectId ( ) ,
75- clusterName : AtlasArgs . clusterName ( ) . describe ( "Atlas cluster name" ) ,
7676} ;
7777
78- export const ProjectArgs = {
79- projectId : AtlasArgs . projectId ( ) ,
78+ export const ProjectAndClusterArgs = {
79+ ...ProjectArgs ,
80+ clusterName : AtlasArgs . clusterName ( ) . describe ( "Atlas cluster name" ) ,
8081} ;
82+
8183function toEJSON < T extends object | undefined > ( value : T ) : T {
8284 if ( ! value ) {
8385 return value ;
@@ -89,11 +91,3 @@ function toEJSON<T extends object | undefined>(value: T): T {
8991export function zEJSON ( ) : z . AnyZodObject {
9092 return z . object ( { } ) . passthrough ( ) . transform ( toEJSON ) as unknown as z . AnyZodObject ;
9193}
92- export const ProjectAndClusterArgs = {
93- projectId : AtlasArgs . projectId ( ) ,
94- clusterName : AtlasArgs . clusterName ( ) . describe ( "Atlas cluster name" ) ,
95- } ;
96-
97- export const ProjectArgs = {
98- projectId : AtlasArgs . projectId ( ) ,
99- } ;
0 commit comments