@contember/schema
Advanced tools
Comparing version 0.10.0-alpha.2 to 0.10.0-alpha.3
@@ -89,6 +89,6 @@ import Input from './input'; | ||
visitOneHasMany(entity: Entity, relation: OneHasManyRelation, targetEntity: Entity, targetRelation: ManyHasOneRelation): T; | ||
visitOneHasOneOwner(entity: Entity, relation: OneHasOneOwnerRelation, targetEntity: Entity, targetRelation: OneHasOneInversedRelation | null): T; | ||
visitOneHasOneInversed(entity: Entity, relation: OneHasOneInversedRelation, targetEntity: Entity, targetRelation: OneHasOneOwnerRelation): T; | ||
visitManyHasManyOwner(entity: Entity, relation: ManyHasManyOwnerRelation, targetEntity: Entity, targetRelation: ManyHasManyInversedRelation | null): T; | ||
visitManyHasManyInversed(entity: Entity, relation: ManyHasManyInversedRelation, targetEntity: Entity, targetRelation: ManyHasManyOwnerRelation): T; | ||
visitOneHasOneOwning(entity: Entity, relation: OneHasOneOwningRelation, targetEntity: Entity, targetRelation: OneHasOneInverseRelation | null): T; | ||
visitOneHasOneInverse(entity: Entity, relation: OneHasOneInverseRelation, targetEntity: Entity, targetRelation: OneHasOneOwningRelation): T; | ||
visitManyHasManyOwning(entity: Entity, relation: ManyHasManyOwningRelation, targetEntity: Entity, targetRelation: ManyHasManyInverseRelation | null): T; | ||
visitManyHasManyInverse(entity: Entity, relation: ManyHasManyInverseRelation, targetEntity: Entity, targetRelation: ManyHasManyOwningRelation): T; | ||
} | ||
@@ -105,5 +105,7 @@ interface RelationByGenericTypeVisitor<T> { | ||
} | ||
type AnyInversedRelation = OneHasManyRelation | OneHasOneInversedRelation | ManyHasManyInversedRelation; | ||
type AnyOwningRelation = ManyHasOneRelation | OneHasOneOwnerRelation | ManyHasManyOwnerRelation; | ||
type AnyRelation = AnyInversedRelation | AnyOwningRelation; | ||
type AnyInverseRelation = OneHasManyRelation | OneHasOneInverseRelation | ManyHasManyInverseRelation; | ||
/** @deprecated */ | ||
type AnyInversedRelation = AnyInverseRelation; | ||
type AnyOwningRelation = ManyHasOneRelation | OneHasOneOwningRelation | ManyHasManyOwningRelation; | ||
type AnyRelation = AnyInverseRelation | AnyOwningRelation; | ||
interface Relation<T extends RelationType = RelationType> extends Field<T> { | ||
@@ -114,8 +116,14 @@ name: string; | ||
} | ||
interface InversedRelation extends Relation { | ||
interface InverseRelation extends Relation { | ||
ownedBy: string; | ||
} | ||
interface OwnerRelation extends Relation { | ||
/** @deprecated */ | ||
interface InversedRelation extends InverseRelation { | ||
} | ||
interface OwningRelation extends Relation { | ||
inversedBy?: string; | ||
} | ||
/** @deprecated */ | ||
interface OwnerRelation extends OwningRelation { | ||
} | ||
enum OnDelete { | ||
@@ -152,8 +160,17 @@ cascade = "cascade", | ||
} | ||
type OneHasManyRelation = Relation<RelationType.OneHasMany> & InversedRelation & OrderableRelation; | ||
type ManyHasOneRelation = Relation<RelationType.ManyHasOne> & OwnerRelation & JoiningColumnRelation & NullableRelation; | ||
type OneHasOneInversedRelation = Relation<RelationType.OneHasOne> & InversedRelation & NullableRelation; | ||
type OneHasOneOwnerRelation = Relation<RelationType.OneHasOne> & OwnerRelation & JoiningColumnRelation & NullableRelation; | ||
type ManyHasManyInversedRelation = Relation<RelationType.ManyHasMany> & InversedRelation & OrderableRelation; | ||
type ManyHasManyOwnerRelation = Relation<RelationType.ManyHasMany> & OwnerRelation & JoiningTableRelation & OrderableRelation; | ||
type OneHasManyRelation = Relation<RelationType.OneHasMany> & InverseRelation & OrderableRelation; | ||
type ManyHasOneRelation = Relation<RelationType.ManyHasOne> & OwningRelation & JoiningColumnRelation & NullableRelation; | ||
type OneHasOneInverseRelation = Relation<RelationType.OneHasOne> & InverseRelation & NullableRelation; | ||
/** @deprecated */ | ||
type OneHasOneInversedRelation = OneHasOneInverseRelation; | ||
type OneHasOneOwningRelation = Relation<RelationType.OneHasOne> & OwningRelation & JoiningColumnRelation & NullableRelation & { | ||
orphanRemoval?: true; | ||
}; | ||
/** @deprecated */ | ||
type OneHasOneOwnerRelation = OneHasOneOwningRelation; | ||
type ManyHasManyInverseRelation = Relation<RelationType.ManyHasMany> & InverseRelation & OrderableRelation; | ||
/** @deprecated */ | ||
type ManyHasManyInversedRelation = ManyHasManyInverseRelation; | ||
type ManyHasManyOwningRelation = Relation<RelationType.ManyHasMany> & OwningRelation & JoiningTableRelation & OrderableRelation; | ||
type ManyHasManyOwnerRelation = ManyHasManyOwningRelation; | ||
interface Schema { | ||
@@ -160,0 +177,0 @@ enums: { |
import Value from './value'; | ||
declare namespace Result { | ||
type MutationFieldResult = CreateResult | UpdateResult | DeleteResult; | ||
interface CreateResult { | ||
@@ -26,2 +27,3 @@ ok: boolean; | ||
errorMessage?: string; | ||
errors: ExecutionError[]; | ||
validation: ValidationResult; | ||
@@ -47,3 +49,5 @@ } | ||
interface ExecutionError { | ||
/** @deprecated */ | ||
path: PathFragment[]; | ||
paths: PathFragment[][]; | ||
type: ExecutionErrorType; | ||
@@ -50,0 +54,0 @@ message?: string; |
{ | ||
"name": "@contember/schema", | ||
"version": "0.10.0-alpha.2", | ||
"version": "0.10.0-alpha.3", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -124,28 +124,28 @@ import Input from './input' | ||
visitOneHasOneOwner( | ||
visitOneHasOneOwning( | ||
entity: Entity, | ||
relation: OneHasOneOwnerRelation, | ||
relation: OneHasOneOwningRelation, | ||
targetEntity: Entity, | ||
targetRelation: OneHasOneInversedRelation | null, | ||
targetRelation: OneHasOneInverseRelation | null, | ||
): T | ||
visitOneHasOneInversed( | ||
visitOneHasOneInverse( | ||
entity: Entity, | ||
relation: OneHasOneInversedRelation, | ||
relation: OneHasOneInverseRelation, | ||
targetEntity: Entity, | ||
targetRelation: OneHasOneOwnerRelation, | ||
targetRelation: OneHasOneOwningRelation, | ||
): T | ||
visitManyHasManyOwner( | ||
visitManyHasManyOwning( | ||
entity: Entity, | ||
relation: ManyHasManyOwnerRelation, | ||
relation: ManyHasManyOwningRelation, | ||
targetEntity: Entity, | ||
targetRelation: ManyHasManyInversedRelation | null, | ||
targetRelation: ManyHasManyInverseRelation | null, | ||
): T | ||
visitManyHasManyInversed( | ||
visitManyHasManyInverse( | ||
entity: Entity, | ||
relation: ManyHasManyInversedRelation, | ||
relation: ManyHasManyInverseRelation, | ||
targetEntity: Entity, | ||
targetRelation: ManyHasManyOwnerRelation, | ||
targetRelation: ManyHasManyOwningRelation, | ||
): T | ||
@@ -172,8 +172,11 @@ } | ||
export type AnyInversedRelation = OneHasManyRelation | OneHasOneInversedRelation | ManyHasManyInversedRelation | ||
export type AnyInverseRelation = OneHasManyRelation | OneHasOneInverseRelation | ManyHasManyInverseRelation | ||
export type AnyOwningRelation = ManyHasOneRelation | OneHasOneOwnerRelation | ManyHasManyOwnerRelation | ||
/** @deprecated */ | ||
export type AnyInversedRelation = AnyInverseRelation | ||
export type AnyRelation = AnyInversedRelation | AnyOwningRelation | ||
export type AnyOwningRelation = ManyHasOneRelation | OneHasOneOwningRelation | ManyHasManyOwningRelation | ||
export type AnyRelation = AnyInverseRelation | AnyOwningRelation | ||
export interface Relation<T extends RelationType = RelationType> extends Field<T> { | ||
@@ -185,10 +188,16 @@ name: string | ||
export interface InversedRelation extends Relation { | ||
export interface InverseRelation extends Relation { | ||
ownedBy: string | ||
} | ||
export interface OwnerRelation extends Relation { | ||
/** @deprecated */ | ||
export interface InversedRelation extends InverseRelation {} | ||
export interface OwningRelation extends Relation { | ||
inversedBy?: string | ||
} | ||
/** @deprecated */ | ||
export interface OwnerRelation extends OwningRelation {} | ||
export enum OnDelete { | ||
@@ -230,18 +239,28 @@ cascade = 'cascade', | ||
export type OneHasManyRelation = Relation<RelationType.OneHasMany> & InversedRelation & OrderableRelation | ||
export type OneHasManyRelation = Relation<RelationType.OneHasMany> & InverseRelation & OrderableRelation | ||
export type ManyHasOneRelation = Relation<RelationType.ManyHasOne> & | ||
OwnerRelation & | ||
OwningRelation & | ||
JoiningColumnRelation & | ||
NullableRelation | ||
export type OneHasOneInversedRelation = Relation<RelationType.OneHasOne> & InversedRelation & NullableRelation | ||
export type OneHasOneOwnerRelation = Relation<RelationType.OneHasOne> & | ||
OwnerRelation & | ||
export type OneHasOneInverseRelation = Relation<RelationType.OneHasOne> & InverseRelation & NullableRelation | ||
/** @deprecated */ | ||
export type OneHasOneInversedRelation = OneHasOneInverseRelation | ||
export type OneHasOneOwningRelation = Relation<RelationType.OneHasOne> & | ||
OwningRelation & | ||
JoiningColumnRelation & | ||
NullableRelation | ||
export type ManyHasManyInversedRelation = Relation<RelationType.ManyHasMany> & InversedRelation & OrderableRelation | ||
export type ManyHasManyOwnerRelation = Relation<RelationType.ManyHasMany> & | ||
OwnerRelation & | ||
NullableRelation & { | ||
orphanRemoval?: true | ||
} | ||
/** @deprecated */ | ||
export type OneHasOneOwnerRelation = OneHasOneOwningRelation | ||
export type ManyHasManyInverseRelation = Relation<RelationType.ManyHasMany> & InverseRelation & OrderableRelation | ||
/** @deprecated */ | ||
export type ManyHasManyInversedRelation = ManyHasManyInverseRelation | ||
export type ManyHasManyOwningRelation = Relation<RelationType.ManyHasMany> & | ||
OwningRelation & | ||
JoiningTableRelation & | ||
OrderableRelation | ||
export type ManyHasManyOwnerRelation = ManyHasManyOwningRelation | ||
export interface Schema { | ||
@@ -248,0 +267,0 @@ enums: { [name: string]: string[] } |
import Value from './value' | ||
namespace Result { | ||
export type MutationFieldResult = CreateResult | UpdateResult | DeleteResult | ||
export interface CreateResult { | ||
@@ -30,2 +32,3 @@ ok: boolean | ||
errorMessage?: string | ||
errors: ExecutionError[] | ||
validation: ValidationResult | ||
@@ -55,3 +58,5 @@ } | ||
export interface ExecutionError { | ||
/** @deprecated */ | ||
path: PathFragment[] | ||
paths: PathFragment[][] | ||
type: ExecutionErrorType | ||
@@ -58,0 +63,0 @@ message?: string |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
276331
1344
7
0