@aphro/schema-api
Advanced tools
Comparing version 0.0.11 to 0.1.0
# @aphro/schema-api | ||
## 0.1.0 | ||
### Minor Changes | ||
- Support for standalone / junction edges | ||
## 0.0.11 | ||
@@ -4,0 +10,0 @@ |
@@ -18,6 +18,6 @@ export declare type ValidationError = { | ||
nodes: { | ||
[key: NodeReference]: Node; | ||
[key: NodeReference]: SchemaNode; | ||
}; | ||
edges: { | ||
[key: EdgeReference]: Edge; | ||
[key: EdgeReference]: SchemaEdge; | ||
}; | ||
@@ -41,3 +41,4 @@ }; | ||
} | ||
export declare type Node = { | ||
export declare type SchemaNode = { | ||
type: 'node'; | ||
name: NodeAst['name']; | ||
@@ -52,2 +53,3 @@ primaryKey: string; | ||
export declare type NodeSpec = { | ||
readonly type: 'node'; | ||
readonly primaryKey: string; | ||
@@ -60,9 +62,6 @@ readonly storage: StorageConfig; | ||
declare type EdgeSpecBase = { | ||
source: NodeSpec; | ||
dest: NodeSpec; | ||
readonly source: NodeSpec; | ||
readonly dest: NodeSpec; | ||
}; | ||
export declare type EdgeSpec = ({ | ||
type: 'junction'; | ||
storage: StorageConfig; | ||
} & EdgeSpecBase) | ({ | ||
export declare type EdgeSpec = JunctionEdgeSpec | ({ | ||
type: 'field'; | ||
@@ -76,2 +75,8 @@ sourceField: string; | ||
} & EdgeSpecBase); | ||
export declare type JunctionEdgeSpec = { | ||
readonly type: 'junction'; | ||
readonly storage: StorageConfig; | ||
readonly sourceField: string; | ||
readonly destField: string; | ||
} & EdgeSpecBase; | ||
export declare type EdgeType = EdgeSpec['type']; | ||
@@ -97,12 +102,11 @@ declare type TypeConfig = { | ||
}; | ||
export declare type Edge = { | ||
export declare type SchemaEdge = { | ||
type: 'standaloneEdge'; | ||
name: EdgeAst['name']; | ||
src: NodeReferenceOrQualifiedColumn; | ||
dest: NodeReferenceOrQualifiedColumn | null; | ||
dest: NodeReferenceOrQualifiedColumn; | ||
fields: { | ||
[key: UnqalifiedFieldReference]: Field; | ||
}; | ||
extensions: { | ||
[Property in EdgeExtension['name']]?: EdgeExtension; | ||
}; | ||
extensions: EdgeExtensions; | ||
storage: StorageConfig; | ||
@@ -120,3 +124,3 @@ }; | ||
export declare type NodeAstExtension = NodeAstExtensions[keyof NodeAstExtensions]; | ||
export declare type NodeExtension = Node['extensions'][keyof Node['extensions']]; | ||
export declare type NodeExtension = SchemaNode['extensions'][keyof SchemaNode['extensions']]; | ||
export declare type NodeAst = { | ||
@@ -133,3 +137,16 @@ type: 'node'; | ||
}; | ||
export declare type EdgeExtension = Index | Invert | Constrain | Storage; | ||
export interface EdgeExtensions { | ||
index?: Index; | ||
invert?: Invert; | ||
constrain?: Constrain; | ||
storage?: Storage; | ||
} | ||
export interface EdgeAstExtensions { | ||
index: Index; | ||
invert: Invert; | ||
storage: Storage; | ||
constraint: Constrain; | ||
} | ||
export declare type EdgeAstExtension = EdgeAstExtensions[keyof EdgeAstExtensions]; | ||
export declare type EdgeExtension = SchemaEdge['extensions'][keyof SchemaEdge['extensions']]; | ||
export declare type EdgeAst = { | ||
@@ -139,3 +156,3 @@ type: 'edge'; | ||
src: NodeReferenceOrQualifiedColumn; | ||
dest: NodeReferenceOrQualifiedColumn | null; | ||
dest: NodeReferenceOrQualifiedColumn; | ||
fields: Field[]; | ||
@@ -142,0 +159,0 @@ extensions: EdgeExtension[]; |
{ | ||
"name": "@aphro/schema-api", | ||
"version": "0.0.11", | ||
"version": "0.1.0", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -28,6 +28,6 @@ export type ValidationError = { | ||
nodes: { | ||
[key: NodeReference]: Node; | ||
[key: NodeReference]: SchemaNode; | ||
}; | ||
edges: { | ||
[key: EdgeReference]: Edge; | ||
[key: EdgeReference]: SchemaEdge; | ||
}; | ||
@@ -54,3 +54,4 @@ }; | ||
export type Node = { | ||
export type SchemaNode = { | ||
type: 'node'; | ||
name: NodeAst['name']; | ||
@@ -66,2 +67,3 @@ primaryKey: string; | ||
export type NodeSpec = { | ||
readonly type: 'node'; | ||
readonly primaryKey: string; | ||
@@ -73,12 +75,9 @@ readonly storage: StorageConfig; | ||
type EdgeSpecBase = { | ||
source: NodeSpec; | ||
dest: NodeSpec; | ||
readonly source: NodeSpec; | ||
readonly dest: NodeSpec; | ||
}; | ||
export type EdgeSpec = | ||
| JunctionEdgeSpec | ||
| ({ | ||
type: 'junction'; | ||
storage: StorageConfig; | ||
} & EdgeSpecBase) | ||
| ({ | ||
type: 'field'; | ||
@@ -94,2 +93,9 @@ sourceField: string; | ||
export type JunctionEdgeSpec = { | ||
readonly type: 'junction'; | ||
readonly storage: StorageConfig; | ||
readonly sourceField: string; | ||
readonly destField: string; | ||
} & EdgeSpecBase; | ||
export type EdgeType = EdgeSpec['type']; | ||
@@ -120,12 +126,11 @@ | ||
export type Edge = { | ||
export type SchemaEdge = { | ||
type: 'standaloneEdge'; | ||
name: EdgeAst['name']; | ||
src: NodeReferenceOrQualifiedColumn; | ||
dest: NodeReferenceOrQualifiedColumn | null; | ||
dest: NodeReferenceOrQualifiedColumn; | ||
fields: { | ||
[key: UnqalifiedFieldReference]: Field; | ||
}; | ||
extensions: { | ||
[Property in EdgeExtension['name']]?: EdgeExtension; | ||
}; | ||
extensions: EdgeExtensions; | ||
storage: StorageConfig; | ||
@@ -148,3 +153,3 @@ }; | ||
export type NodeAstExtension = NodeAstExtensions[keyof NodeAstExtensions]; | ||
export type NodeExtension = Node['extensions'][keyof Node['extensions']]; | ||
export type NodeExtension = SchemaNode['extensions'][keyof SchemaNode['extensions']]; | ||
@@ -165,4 +170,18 @@ export type NodeAst = { | ||
export type EdgeExtension = Index | Invert | Constrain | Storage; | ||
export interface EdgeExtensions { | ||
index?: Index; | ||
invert?: Invert; | ||
constrain?: Constrain; | ||
storage?: Storage; | ||
} | ||
export interface EdgeAstExtensions { | ||
index: Index; | ||
invert: Invert; | ||
storage: Storage; | ||
constraint: Constrain; | ||
} | ||
export type EdgeAstExtension = EdgeAstExtensions[keyof EdgeAstExtensions]; | ||
export type EdgeExtension = SchemaEdge['extensions'][keyof SchemaEdge['extensions']]; | ||
export type EdgeAst = { | ||
@@ -172,3 +191,3 @@ type: 'edge'; | ||
src: NodeReferenceOrQualifiedColumn; | ||
dest: NodeReferenceOrQualifiedColumn | null; | ||
dest: NodeReferenceOrQualifiedColumn; | ||
fields: Field[]; | ||
@@ -175,0 +194,0 @@ extensions: EdgeExtension[]; |
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
27610
577