@@ -16,11 +16,14 @@ import {
1616}  from  "@repo/database/lib/queries" ; 
1717import  {  createClient  }  from  "@repo/database/lib/client" ; 
1818import  {  config  }  from  "@repo/database/dbDotEnv" ; 
19+ import  type  {  Tables  }  from  "@repo/database/dbTypes" ; 
1920import  { 
2021  fetchOrCreateSpaceDirect , 
2122  createLoggedInClient , 
2223}  from  "@repo/database/lib/contextFunctions" ; 
2324
25+ type  ConceptKA  =  ( keyof  Tables < "Concept" > ) [ ] ; 
26+ 
2427config ( ) ; 
2528const  platform  =  "Roam" ; 
2629let  supabase  =  createClient ( ) ; 
@@ -38,6 +41,7 @@ if (error || !data || !data.id) {
3841const  spaceId  =  data . id ; 
3942supabase  =  await  createLoggedInClient ( platform ,  spaceId ,  "password" ) ; 
4043if  ( ! supabase )  process . exit ( 1 ) ; 
44+ /* eslint-disable @typescript-eslint/naming-convention */ 
4145const  queries  =  { 
4246  "Query all nodes" : {  schemaLocalIds : [ ] ,  fetchNodes : true  } , 
4347  "Query all relations" : {  schemaLocalIds : [ ] ,  fetchNodes : false  } , 
@@ -59,20 +63,20 @@ const queries = {
5963  // Previous will be slow, more efficient to filter on base node, and in some relation, as follows: 
6064  "Query all nodes of a given type in some relation" : { 
6165    schemaLocalIds : [ "hypothesis" ] , 
62-     relationFields : [ "id" ]  as  any , 
66+     relationFields : [ "id" ]  as  ConceptKA , 
6367  } , 
6468  "Query all nodes in some relation to a node of a certain author" : { 
6569    schemaLocalIds : [ ] , 
6670    inRelsToNodesOfAuthor : "account_3" , 
67-     relationFields : [ "id" ]  as  any , 
68-     relationSubNodesFields : [ "id" ]  as  any , 
71+     relationFields : [ "id" ]  as  ConceptKA , 
72+     relationSubNodesFields : [ "id" ]  as  ConceptKA , 
6973  } , 
7074  // Previous will be slow, more efficient to start on given type, and in some relation, as follows: 
7175  "Query all nodes of a certain author in some relation" : { 
7276    schemaLocalIds : [ ] , 
7377    nodeAuthor : "account_3" , 
74-     relationFields : [ "id" ]  as  any , 
75-     relationSubNodesFields : [ "id" ]  as  any , 
78+     relationFields : [ "id" ]  as  ConceptKA , 
79+     relationSubNodesFields : [ "id" ]  as  ConceptKA , 
7680  } , 
7781  "In relation to a specific node." : { 
7882    schemaLocalIds : [ ] , 
@@ -81,10 +85,11 @@ const queries = {
8185  "A specific node's relation." : { 
8286    schemaLocalIds : [ ] , 
8387    baseNodeLocalIds : [ "claim_11" ] , 
84-     relationFields : [ "id" ]  as  any , 
85-     relationSubNodesFields : [ "id" ]  as  any , 
88+     relationFields : [ "id" ]  as  ConceptKA , 
89+     relationSubNodesFields : [ "id" ]  as  ConceptKA , 
8690  } , 
8791} ; 
92+ /* eslint-enable @typescript-eslint/naming-convention */ 
8893await  getSchemaConcepts ( supabase ,  spaceId ,  true ) ; 
8994const  benches  =  [ ] ; 
9095for  ( const  [ description ,  query ]  of  Object . entries ( queries ) )  { 
0 commit comments