File tree Expand file tree Collapse file tree
packages/database/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 CrossAppEmbedding ,
33 InlineCrossAppContent ,
44 CrossAppNode ,
5+ CrossAppRelation ,
56} from "../crossAppContracts" ;
67import { LocalContentDataInput , LocalConceptDataInput } from "../inputTypes" ;
78import { Enums , CompositeTypes } from "../dbTypes" ;
@@ -79,3 +80,21 @@ export const crossAppNodeToDbConcept = (
7980 last_modified : node . modifiedAt ?. toISOString ( ) ,
8081 } ) ;
8182} ;
83+
84+ export const crossAppRelationToDbConcept = (
85+ node : CrossAppRelation ,
86+ ) : LocalConceptDataInput => {
87+ return filterUndefined < LocalConceptDataInput > ( {
88+ // use LocalIds... not ideal
89+ name : `${ node . localId } : ${ node . source } -${ node . relationType } -> ${ node . destination } ` ,
90+ source_local_id : node . localId ,
91+ author_local_id : node . authorId ,
92+ schema_represented_by_local_id : node . relationType ,
93+ local_reference_content : {
94+ source : node . source ,
95+ destination : node . destination ,
96+ } ,
97+ created : node . createdAt ?. toISOString ( ) ,
98+ last_modified : node . modifiedAt ?. toISOString ( ) ,
99+ } ) ;
100+ } ;
You can’t perform that action at this time.
0 commit comments