@@ -70,7 +70,7 @@ class GeneratorError extends Schema.TaggedErrorClass<GeneratorError>()("Generato
7070 }
7171}
7272
73- const ManualSchemas : Record < string , typeof Schema . Json . Type > = {
73+ const ManualSchemas : Record < string , Schema . Json > = {
7474 GetAuthStatusParams : {
7575 type : "object" ,
7676 title : "GetAuthStatusParams" ,
@@ -218,7 +218,7 @@ function collectSchemaEntries(
218218 return entries ;
219219}
220220
221- function normalizeNullableTypes ( value : typeof Schema . Json . Type ) : typeof Schema . Json . Type {
221+ function normalizeNullableTypes ( value : Schema . Json ) : Schema . Json {
222222 if ( Array . isArray ( value ) ) {
223223 return value . map ( normalizeNullableTypes ) ;
224224 }
@@ -230,10 +230,7 @@ function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.J
230230 key ,
231231 normalizeNullableTypes ( child ) ,
232232 ] ) ;
233- const normalizedObject = Object . fromEntries ( normalizedEntries ) as Record <
234- string ,
235- typeof Schema . Json . Type
236- > ;
233+ const normalizedObject = Object . fromEntries ( normalizedEntries ) as Record < string , Schema . Json > ;
237234 const typeValue = normalizedObject . type ;
238235
239236 if ( ! Array . isArray ( typeValue ) ) {
@@ -251,7 +248,7 @@ function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.J
251248 }
252249 const nonNullType = nonNullTypes [ 0 ] ! ;
253250
254- const nextObject : Record < string , typeof Schema . Json . Type > = { } ;
251+ const nextObject : Record < string , Schema . Json > = { } ;
255252 for ( const [ key , child ] of Object . entries ( normalizedObject ) ) {
256253 if ( key !== "type" ) {
257254 nextObject [ key ] = child ;
@@ -269,7 +266,7 @@ function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.J
269266 } ;
270267}
271268
272- function stripNullDefaults ( value : typeof Schema . Json . Type ) : typeof Schema . Json . Type {
269+ function stripNullDefaults ( value : Schema . Json ) : Schema . Json {
273270 if ( Array . isArray ( value ) ) {
274271 return value . map ( stripNullDefaults ) ;
275272 }
@@ -281,7 +278,7 @@ function stripNullDefaults(value: typeof Schema.Json.Type): typeof Schema.Json.T
281278 Object . entries ( value )
282279 . filter ( ( [ key , child ] ) => ! ( key === "default" && child === null ) )
283280 . map ( ( [ key , child ] ) => [ key , stripNullDefaults ( child ) ] ) ,
284- ) as typeof Schema . Json . Type ;
281+ ) as Schema . Json ;
285282}
286283
287284function toPascalCaseMethod ( method : string ) {
@@ -417,7 +414,7 @@ function renderSchemaMap(
417414}
418415
419416function renderSchemaTypeReference ( schemaName : string ) {
420- return schemaName === "undefined" ? "undefined" : `typeof CodexSchema.${ schemaName } .Type ` ;
417+ return schemaName === "undefined" ? "undefined" : `CodexSchema.${ schemaName } ` ;
421418}
422419
423420function exportNameForPath ( filePath : string ) : string {
@@ -468,11 +465,11 @@ function buildJsonSchemaFiles(
468465}
469466
470467function rewriteExternalRefs (
471- value : typeof Schema . Json . Type ,
468+ value : Schema . Json ,
472469 localDefinitionNames : ReadonlyMap < string , string > ,
473470 currentNamespace : string | undefined ,
474471 exportNameByQualifiedName : ReadonlyMap < string , string > ,
475- ) : typeof Schema . Json . Type {
472+ ) : Schema . Json {
476473 if ( Array . isArray ( value ) ) {
477474 return value . map ( ( entry ) =>
478475 rewriteExternalRefs ( entry , localDefinitionNames , currentNamespace , exportNameByQualifiedName ) ,
@@ -522,7 +519,7 @@ function rewriteExternalRefs(
522519 ) ,
523520 ] ;
524521 } ) ,
525- ) as typeof Schema . Json . Type ;
522+ ) as Schema . Json ;
526523}
527524
528525const generateFiles = Effect . fn ( "generateFiles" ) ( function * ( ) {
@@ -543,7 +540,7 @@ const generateFiles = Effect.fn("generateFiles")(function* () {
543540 const exportNameByQualifiedName = new Map (
544541 jsonSchemaFiles . map ( ( file ) => [ file . qualifiedName , file . exportName ] ) ,
545542 ) ;
546- const aggregateSchemas : Record < string , typeof Schema . Json . Type > = { } ;
543+ const aggregateSchemas : Record < string , Schema . Json > = { } ;
547544
548545 for ( const file of jsonSchemaFiles ) {
549546 const raw = yield * fetchText ( file . downloadUrl ) ;
@@ -568,7 +565,7 @@ const generateFiles = Effect.fn("generateFiles")(function* () {
568565 ) ;
569566 }
570567
571- const topLevelSchema : Record < string , typeof Schema . Json . Type > = { } ;
568+ const topLevelSchema : Record < string , Schema . Json > = { } ;
572569 for ( const [ key , value ] of Object . entries ( parsed ) ) {
573570 if ( key !== "definitions" ) {
574571 topLevelSchema [ key ] = value ;
0 commit comments