Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/regression/test/issue-204/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
20 changes: 13 additions & 7 deletions tests/regression/test/issue-204/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* eslint-disable */

import { type SchemaDef } from "@zenstackhq/orm/schema";
export const schema = {
const _schema = {
provider: {
type: "sqlite"
},
Expand Down Expand Up @@ -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;
Loading