@contember/client-content-generator
Advanced tools
Comparing version 2.0.0-alpha.27 to 2.0.0-alpha.28
@@ -9,3 +9,10 @@ import { getEnumTypeName } from "./utils.js"; | ||
} | ||
return code || "export {}\n"; | ||
code += `export type ContemberClientEnums = { | ||
`; | ||
for (const enumName of Object.keys(model.enums)) { | ||
code += ` ${enumName}: ${getEnumTypeName(enumName)} | ||
`; | ||
} | ||
code += "}\n\n"; | ||
return code; | ||
} | ||
@@ -12,0 +19,0 @@ } |
@@ -31,2 +31,5 @@ import { acceptEveryFieldVisitor } from "@contember/schema-utils"; | ||
}) | ||
), | ||
enums: Object.fromEntries( | ||
Object.entries(model.enums).map(([name, enumType]) => [name, enumType]) | ||
) | ||
@@ -33,0 +36,0 @@ }; |
@@ -9,3 +9,10 @@ import { getEnumTypeName } from "./utils.js"; | ||
} | ||
return code || "export {}\n"; | ||
code += `export type ContemberClientEnums = { | ||
`; | ||
for (const enumName of Object.keys(model.enums)) { | ||
code += ` ${enumName}: ${getEnumTypeName(enumName)} | ||
`; | ||
} | ||
code += "}\n\n"; | ||
return code; | ||
} | ||
@@ -12,0 +19,0 @@ } |
@@ -31,2 +31,5 @@ import { acceptEveryFieldVisitor } from "@contember/schema-utils"; | ||
}) | ||
), | ||
enums: Object.fromEntries( | ||
Object.entries(model.enums).map(([name, enumType]) => [name, enumType]) | ||
) | ||
@@ -33,0 +36,0 @@ }; |
{ | ||
"name": "@contember/client-content-generator", | ||
"license": "Apache-2.0", | ||
"version": "2.0.0-alpha.27", | ||
"version": "2.0.0-alpha.28", | ||
"type": "module", | ||
@@ -36,8 +36,8 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@contember/client-content": "2.0.0-alpha.27", | ||
"@contember/schema": "2.0.0-alpha.27", | ||
"@contember/schema-utils": "2.0.0-alpha.27" | ||
"@contember/client-content": "2.0.0-alpha.28", | ||
"@contember/schema": "2.0.0-alpha.28", | ||
"@contember/schema-utils": "2.0.0-alpha.28" | ||
}, | ||
"devDependencies": { | ||
"@contember/schema-definition": "2.0.0-alpha.27", | ||
"@contember/schema-definition": "2.0.0-alpha.28", | ||
"@types/node": "^20.16.11" | ||
@@ -44,0 +44,0 @@ }, |
@@ -10,5 +10,9 @@ import { Model } from '@contember/schema' | ||
} | ||
return code || 'export {}\n' | ||
code += `export type ContemberClientEnums = {\n` | ||
for (const enumName of Object.keys(model.enums)) { | ||
code += `\t${enumName}: ${getEnumTypeName(enumName)}\n` | ||
} | ||
code += '}\n\n' | ||
return code | ||
} | ||
} |
@@ -37,2 +37,5 @@ import { SchemaNames, SchemaEntityNames } from '@contember/client-content' | ||
), | ||
enums: Object.fromEntries( | ||
Object.entries(model.enums).map(([name, enumType]) => [name, enumType]), | ||
), | ||
} | ||
@@ -39,0 +42,0 @@ } |
@@ -21,4 +21,9 @@ import { describe, expect, test } from 'vitest' | ||
| "express" | ||
export type ContemberClientEnums = { | ||
OrderStatus: OrderStatus | ||
orderType: OrderType | ||
} | ||
" | ||
`) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
203322
2108
+ Added@contember/client-content@2.0.0-alpha.28(transitive)
+ Added@contember/graphql-builder@2.0.0-alpha.28(transitive)
+ Added@contember/graphql-client@2.0.0-alpha.28(transitive)
+ Added@contember/schema@2.0.0-alpha.28(transitive)
+ Added@contember/schema-utils@2.0.0-alpha.28(transitive)
+ Added@contember/typesafe@2.0.0-alpha.28(transitive)
- Removed@contember/client-content@2.0.0-alpha.27(transitive)
- Removed@contember/graphql-builder@2.0.0-alpha.27(transitive)
- Removed@contember/graphql-client@2.0.0-alpha.27(transitive)
- Removed@contember/schema@2.0.0-alpha.27(transitive)
- Removed@contember/schema-utils@2.0.0-alpha.27(transitive)
- Removed@contember/typesafe@2.0.0-alpha.27(transitive)