diff --git a/tests/regression/test/issue-204/models.ts b/tests/regression/test/issue-204/models.ts index f7af584e..633c334b 100644 --- a/tests/regression/test/issue-204/models.ts +++ b/tests/regression/test/issue-204/models.ts @@ -9,5 +9,5 @@ import { schema as $schema, type SchemaType as $Schema } from "./schema"; import { type ModelResult as $ModelResult, type TypeDefResult as $TypeDefResult } from "@zenstackhq/orm"; export type Foo = $ModelResult<$Schema, "Foo">; export type Configuration = $TypeDefResult<$Schema, "Configuration">; -export const ShirtColor = $schema.enums.ShirtColor; +export const ShirtColor = $schema.enums.ShirtColor.values; export type ShirtColor = (typeof ShirtColor)[keyof typeof ShirtColor]; diff --git a/tests/regression/test/issue-204/schema.ts b/tests/regression/test/issue-204/schema.ts index b4ae296d..a2de389c 100644 --- a/tests/regression/test/issue-204/schema.ts +++ b/tests/regression/test/issue-204/schema.ts @@ -6,7 +6,7 @@ /* eslint-disable */ import { type SchemaDef } from "@zenstackhq/orm/schema"; -export const schema = { +const _schema = { provider: { type: "sqlite" }, @@ -47,13 +47,19 @@ export const schema = { }, enums: { ShirtColor: { - Black: "Black", - White: "White", - Red: "Red", - Green: "Green", - Blue: "Blue" + values: { + Black: "Black", + White: "White", + Red: "Red", + Green: "Green", + Blue: "Blue" + } } }, plugins: {} } as const satisfies SchemaDef; -export type SchemaType = typeof schema; +type Schema = typeof _schema & { + __brand?: "schema"; +}; +export const schema: Schema = _schema; +export type SchemaType = Schema;