@vibeorm/schema 3.0.0 → 4.1.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.
@@ -51,6 +51,8 @@ export type DialectCapabilities = {
51
51
  readonly exclusionConstraints: boolean;
52
52
  readonly exclusionExtensions: readonly string[];
53
53
  readonly checkNormalization: "rollback" | "temporary" | "sourceText";
54
+ /** Typed JSON text, text length and fail-closed boolean expressions in CHECKs. */
55
+ readonly schemaCheckExpressions: boolean;
54
56
  /** Native database row policies; PGlite additionally needs a verified restricted role. */
55
57
  readonly nativeRowLevelSecurity: boolean;
56
58
  /** INSERT/UPDATE/DELETE ... RETURNING. False ⇒ insertId + re-select fallback. */
package/dist/errors.d.ts CHANGED
@@ -58,6 +58,14 @@ export declare const VIBE_ERROR_CODES: readonly [
58
58
  "VIBE_RLS_CONTEXT",
59
59
  /** SQLSTATE 42501: insufficient privilege, including policy WITH CHECK failure. */
60
60
  "VIBE_PERMISSION_DENIED",
61
+ /**
62
+ * A known read was cancelled by its caller. Fixed metadata: reason:
63
+ * "caller-aborted", stage: "before-dispatch" | "waiting-for-connection" |
64
+ * "running", databaseCancelled: boolean. True requires the original
65
+ * statement's server cancellation failure, not just a signal being sent.
66
+ * Unrelated driver failures retain their original mapped codes.
67
+ */
68
+ "VIBE_CANCELLED",
61
69
  /** Driver/connection failure not mapped to a more specific code. */
62
70
  "VIBE_ADAPTER",
63
71
  /**
@@ -324,15 +324,32 @@ export declare function buildExtensionRegistry(params: {
324
324
  }): ExtensionRegistry;
325
325
  /** An empty registry — the default when no extensions are configured. */
326
326
  export declare const EMPTY_EXTENSION_REGISTRY: ExtensionRegistry;
327
+ /** Whether built-in declarations establish public-only physical ownership for this model. */
328
+ export declare function hasPublicExtensionDeclaration(params: {
329
+ schema: SchemaIR;
330
+ model: string;
331
+ }): boolean;
332
+ /** Refuse placement that built-in extension SQL and ownership cannot preserve. */
333
+ export declare function assertExtensionModelPlacement(params: {
334
+ namespace?: string;
335
+ dialect?: Dialect;
336
+ }): void;
337
+ /** Admit built-in extension declarations before generation, migration or runtime work. */
338
+ export declare function assertExtensionPlacement(params: {
339
+ schema: SchemaIR;
340
+ dialect?: Dialect;
341
+ }): void;
327
342
  /**
328
343
  * Merge two declaration fragments for the same (extension, model) — e.g. a
329
344
  * field-type lowering plus a model attribute. One level deep: object values
330
- * merge shallowly, everything else is last-wins. Used identically by the
331
- * .prisma parser and the TS DSL so both sources produce byte-identical IR.
345
+ * merge shallowly. Built-in index-bearing declarations cannot repeat their
346
+ * field list; custom extension merging retains its existing last-wins behavior.
347
+ * Used identically by the parser and TS DSL.
332
348
  */
333
349
  export declare function mergeExtensionDeclarations(params: {
334
350
  base: Readonly<Record<string, unknown>>;
335
351
  next: Readonly<Record<string, unknown>>;
352
+ extension?: string;
336
353
  }): Record<string, unknown>;
337
354
  /**
338
355
  * Per-model declarations one extension gathered from schema attributes,
package/dist/index.d.ts CHANGED
@@ -3,14 +3,16 @@
3
3
  * and the VibeError contract for VibeORM v2.
4
4
  */
5
5
  export { SQL_NAMESPACES, assertSqlNamespace, qualifiedSqlName, sqlNamespaceIssue } from "./namespaces.ts";
6
+ export { assertNativeRlsAdmission } from "./native-rls-admission.ts";
7
+ export { modelSqlNamespace } from "./model-sql-namespace.ts";
6
8
  export { assertIndexOperatorClasses } from "./index-operator-classes.ts";
7
9
  export type { DatabaseModuleOptions, DatabaseModuleManifest, DatabaseModuleArtifact } from "./database-module.ts";
8
10
  export { prepareDatabaseModuleSchema } from "./module-schema.ts";
9
11
  export type { ExclusionIR, ExclusionSpec, ExclusionKey, ExclusionEndpoint } from "./exclusion.ts";
10
12
  export { DIALECTS, ENUM_STORAGES, enumStorageOf, fieldTypeIdentity, isEnumType, providerToDialect } from "./ir.ts";
11
- export type { CascadeAction, DatasourceIR, DefaultValueIR, Dialect, EnumIR, EnumStorage, ExtensionDeclIR, FieldIR, FieldType, IndexFieldIR, CheckIR, IndexIR, IndexKind, ModelIR, Provider, RelationIR, RelationType, ScalarType, SchemaIR, } from "./ir.ts";
12
- export { PREDICATE_COMPARISON_OPS, isPredicateFieldRef, predicateFieldNames, predicateKey } from "./predicate.ts";
13
- export type { PredicateComparisonOp, PredicateFieldRef, PredicateIR, PredicateOperand, PredicateValue } from "./predicate.ts";
13
+ export type { CascadeAction, DatasourceIR, DefaultValueIR, Dialect, EnumIR, EnumStorage, ExtensionDeclIR, FieldIR, FieldType, JsonSchemaRefIR, IndexFieldIR, CheckIR, IndexIR, IndexKind, ModelIR, Provider, RelationIR, RelationType, ScalarType, SchemaIR, } from "./ir.ts";
14
+ export { PREDICATE_COMPARISON_OPS, assertPredicateCapabilities, inspectPredicate, isPredicateFieldRef, predicateFieldNames, predicateKey } from "./predicate.ts";
15
+ export type { PredicateComparisonOp, PredicateExpression, PredicateFieldRef, PredicateIR, PredicateOperand, PredicateValue } from "./predicate.ts";
14
16
  export { assertMigrationObjects, isSqlObjectDefinition, isSqlObjectIdentity, sqlObjectKey, sqlObjectNamespace } from "./migration-objects.ts";
15
17
  export type { MigrationObjectIR, QualifiedSqlName, SqlObjectDefinition, SqlObjectDefinitionFormat, SqlObjectFacts, SqlObjectIdentity } from "./migration-objects.ts";
16
18
  export type { AdvisoryLockMode, DialectCapabilities, FullTextEngine, RowLockStrength, RowLockWaitPolicy, TimeOfDayType, } from "./capabilities.ts";
@@ -19,7 +21,7 @@ export { READ_ONLY_REFUSAL_REASONS, ReadOnlyClientError, SCOPED_REFUSAL_REASONS,
19
21
  export type { ReadOnlyRefusalReason, ScopedRefusalReason, VibeErrorCode } from "./errors.ts";
20
22
  export { decodePrismaString, encodePrismaString, exactDecimalLiteral, exactIntegerLiteral } from "./prisma-literal.ts";
21
23
  export { RESERVED_CLIENT_NAMES, RESERVED_DELEGATE_NAMES, isReservedClientName, isReservedDelegateName, } from "./reserved.ts";
22
- export { EMPTY_EXTENSION_REGISTRY, buildExtensionRegistry, defineExtension, extensionDeclarations, extensionManifestEntry, extensionOptionsHash, mergeExtensionDeclarations, } from "./extension.ts";
24
+ export { assertExtensionModelPlacement, assertExtensionPlacement, EMPTY_EXTENSION_REGISTRY, buildExtensionRegistry, defineExtension, extensionDeclarations, extensionManifestEntry, extensionOptionsHash, mergeExtensionDeclarations, } from "./extension.ts";
23
25
  export type { ExtensionArtifact, ExtensionArtifactOwner, ExtensionAttributeArgs, ExtensionAttributeValue, ExtensionClientContribution, ExtensionClientPlane, ExtensionDoctorCheck, ExtensionDoctorHook, ExtensionDoctorReport, ExtensionFieldType, ExtensionImportSpec, ExtensionManifestEntry, ExtensionMigratePlane, ExtensionModelAttribute, ExtensionModelTypeNames, ExtensionRegistry, ExtensionRuntimePlane, ExtensionSchemaContext, ExtensionSqlExecutor, ExtensionSqlPlane, ExtensionWhereOperator, SqlFragmentPart, SqlFragmentSpec, VibeExtension, } from "./extension.ts";
24
26
  export { buildComputedManifest, validateComputedConfig } from "./computed.ts";
25
27
  export type { ComputedConfig, ComputedFieldSpec, ComputedManifestEntry } from "./computed.ts";
@@ -35,4 +37,5 @@ export { RLS_CONTEXT_REASONS, RlsContextError } from "./errors.ts";
35
37
  export type { RlsContextReason } from "./errors.ts";
36
38
  export { isImplicitManyToManyRelation, validateRlsContextIR } from "./validate.ts";
37
39
  export { scalarListDefault, serializeJsonDefault } from "./default-values.ts";
40
+ export { assertJsonSchemaRef, hasJsonSchemaAnnotation, jsonSchemaRefIssue, jsonTypeAnnotationIssue, jsonTypeAnnotationRef, normalizeJsonSchemaRef } from "./json-schema-ref.ts";
38
41
  //# sourceMappingURL=index.d.ts.map