@vibeorm/dsl 2.4.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VibeORM contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/column.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * dsl.int().default(42)
9
9
  * dsl.string({ optional: true })
10
10
  */
11
- import type { EnumStorage } from "@vibeorm/schema";
11
+ import type { EnumStorage, JsonSchemaRefIR } from "@vibeorm/schema";
12
12
  import type { BaseColumnConfig, BigIntColumnConfig, BooleanColumnConfig, BytesColumnConfig, ColumnDef, ColumnType, DatetimeColumnConfig, DecimalColumnConfig, ExtensionTypeConfig, FloatColumnConfig, IdColumnConfig, IdGeneratorType, InlineEnumConfig, IntColumnConfig, JsonColumnConfig, StringColumnConfig } from "./types.ts";
13
13
  /**
14
14
  * Shallow-clones a column definition with a fresh `__config`, so columns
@@ -141,6 +141,8 @@ export declare function datetime(config?: DatetimeColumnConfig): ChainableDateti
141
141
  /** Json column with a consumer-declared payload type (typed JSON). */
142
142
  export declare class ChainableJsonColumn extends ChainableColumn<"json"> {
143
143
  constructor(config?: JsonColumnConfig);
144
+ /** Bind runtime write/read validation to a consumer-owned named export. */
145
+ schema(reference: JsonSchemaRefIR): this;
144
146
  /**
145
147
  * Declares the TS type of this column's payload. Written as a
146
148
  * `/// @type(Name from "specifier")` doc comment — the annotation rides the
package/dist/index.d.ts CHANGED
@@ -59,7 +59,7 @@ export type { MergedOneToOneSide, PlannedIndex, PlannedRelation, PlannedRelation
59
59
  export type { SchemaOptions } from "./schema.ts";
60
60
  export type { ActiveTemplate, AuditTemplate, BaseTemplate, BaseWithWorkspaceTemplate, ExternalIdTemplate, FieldsTemplate, MetadataTemplate, NameDescriptionTemplate, TemplatesApi, } from "./templates.ts";
61
61
  export type { ValidationError } from "./validate.ts";
62
- export type { DefineRlsOptions, MergedRelations, RlsColumnKind, RlsContextRef, RlsContextRefs, RlsDef, RlsPolicies, BaseColumnConfig, BigIntColumnConfig, BooleanColumnConfig, BytesColumnConfig, CascadeAction, ChildrenBuilder, ChildrenDef, ChildrenRelationConfig, ChildrenSchemaCallback, ColumnDef, ColumnKeys, ColumnRef, ColumnRefKind, ColumnRefKindOf, ColumnType, CreateModelConfig, DatetimeColumnConfig, DecimalColumnConfig, EnumDef, EnumFieldConfig, EnumStorage, EnumValues, ExtensionAttributeUse, ExtensionTypeConfig, FloatColumnConfig, GeneratorOutput, IdColumnConfig, IdGeneratorType, IndexBuilder, IndexCallback, IndexDef, IndexOptions, ChecksCallback, ModelCheckConfig, ModelPolicyConfig, NamedCheckDef, PartialIndexDef, PredicateBuilder, PredicateFieldExpr, UniqueIndexOptions, IndexType, InlineEnumConfig, IntColumnConfig, JsonColumnConfig, ManyRelationDefConfig, ModelColumnRefs, ModelDef, OneRelationDefConfig, PrismaGeneratorConfig, RelationRefInput, RelationTarget, RelationsBuilder, RelationsMap, RelationsOutput, SchemaColumnNames, SchemaDef, SchemaDefinition, SchemaInput, StoredRelationDef, StringColumnConfig, ThroughRef, UnsupportedColumnConfig, } from "./types.ts";
62
+ export type { DefineRlsOptions, MergedRelations, RlsColumnKind, RlsContextRef, RlsContextRefs, RlsDef, RlsPolicies, BaseColumnConfig, BigIntColumnConfig, BooleanColumnConfig, BytesColumnConfig, CascadeAction, ChildrenBuilder, ChildrenDef, ChildrenRelationConfig, ChildrenSchemaCallback, ColumnDef, ColumnKeys, ColumnRef, ColumnRefKind, ColumnRefKindOf, ColumnType, CreateModelConfig, DatetimeColumnConfig, DecimalColumnConfig, EnumDef, EnumFieldConfig, EnumStorage, EnumValues, ExtensionAttributeUse, ExtensionTypeConfig, FloatColumnConfig, GeneratorOutput, IdColumnConfig, IdGeneratorType, IndexBuilder, IndexCallback, IndexDef, IndexOptions, ChecksCallback, ModelCheckConfig, ModelPolicyConfig, NamedCheckDef, PartialIndexDef, PredicateBuilder, PredicateExpr, PredicateFieldExpr, UniqueIndexOptions, IndexType, InlineEnumConfig, IntColumnConfig, JsonColumnConfig, ManyRelationDefConfig, ModelColumnRefs, ModelDef, OneRelationDefConfig, PrismaGeneratorConfig, RelationRefInput, RelationTarget, RelationsBuilder, RelationsMap, RelationsOutput, SchemaColumnNames, SchemaDef, SchemaDefinition, SchemaInput, StoredRelationDef, StringColumnConfig, ThroughRef, UnsupportedColumnConfig, } from "./types.ts";
63
63
  /**
64
64
  * Creates an enum: standalone (reusable, has a `name`) or inline (one-off).
65
65
  *