11import { Things , SchemaActions , Prepositions , ThingProperties , } from './schema'
22import type { NounFields , NounProperties } from './properties'
3- import type { BSON , Document , ObjectId , Collection as MongoCollection } from 'mongodb'
4- import { App , Docs , Site , Brand , NounViews } from './ui'
3+ import { App , Docs , Site , Brand , NounViews , Story } from './ui'
54import { API , Data } from './api'
65import { stringify } from './utils'
6+ import { Machines } from './state'
77
88export const createGraph = < G extends Graph < G > > ( graph : { nouns : Nouns < G > } & Partial < G > ) => {
99 graph . toString = ( ) => stringify ( graph )
@@ -17,6 +17,7 @@ export type Graph<G extends Graph<G> = DefaultGraph> = {
1717 events : Partial < Events < G > >
1818 plurals : Partial < Plurals < G > >
1919 properties : Partial < NounProperties < G > >
20+ machines : Partial < Machines < G > >
2021 fields : Partial < NounFields < G > >
2122 views : Partial < NounViews < G > >
2223 app : Partial < App < G > >
@@ -26,6 +27,7 @@ export type Graph<G extends Graph<G> = DefaultGraph> = {
2627 docs : Partial < Docs < G > >
2728 db : Partial < Data < G > >
2829 brand : Partial < Brand < G > >
30+ story : Partial < Story < G > >
2931}
3032
3133type DefaultGraph = {
@@ -57,6 +59,7 @@ type DefaultGraph = {
5759 actions : { } ,
5860 triggers : { } ,
5961 events : { } ,
62+ machines : { } ,
6063 plurals : { } ,
6164 properties : { } ,
6265 fields : { } ,
@@ -68,6 +71,7 @@ type DefaultGraph = {
6871 docs : { } ,
6972 db : { } ,
7073 brand : { } ,
74+ story : { } ,
7175}
7276
7377export type Noun < G extends Graph < G > > = Things | keyof G [ 'nouns' ]
0 commit comments