@@ -19,12 +19,15 @@ import {
1919import { fetchEmbeddingsForNodes } from "./upsertNodesAsContentWithEmbeddings" ;
2020import { convertRoamNodeToLocalContent } from "./upsertNodesAsContentWithEmbeddings" ;
2121import type { DGSupabaseClient } from "@repo/database/lib/client" ;
22- import type { Json , CompositeTypes , Enums } from "@repo/database/dbTypes" ;
22+ import type { Json , Enums } from "@repo/database/dbTypes" ;
2323import { render as renderToast } from "roamjs-components/components/Toast" ;
2424import internalError from "~/utils/internalError" ;
25- type LocalContentDataInput = Partial < CompositeTypes < "content_local_input" > > ;
26- type AccountLocalInput = CompositeTypes < "account_local_input" > ;
2725import { FatalError } from "@repo/database/lib/contextFunctions" ;
26+ import type {
27+ LocalConceptDataInput ,
28+ LocalContentDataInput ,
29+ LocalAccountDataInput ,
30+ } from "@repo/database/inputTypes" ;
2831
2932const SYNC_FUNCTION = "embedding" ;
3033// Minimal interval between syncs of all clients for this task.
@@ -42,8 +45,6 @@ type SyncTaskInfo = {
4245 shouldProceed : boolean ;
4346} ;
4447
45- type LocalConceptDataInput = Partial < CompositeTypes < "concept_local_input" > > ;
46-
4748const chunk = < T > ( array : T [ ] , size : number ) : T [ ] [ ] => {
4849 const chunks : T [ ] [ ] = [ ] ;
4950 for ( let i = 0 ; i < array . length ; i += size ) {
@@ -388,7 +389,7 @@ export const upsertNodesToSupabaseAsContentWithEmbeddings = async (
388389 await uploadBatches ( chunk ( nodesWithEmbeddings , BATCH_SIZE ) ) ;
389390} ;
390391
391- const getAllUsers = async ( ) : Promise < AccountLocalInput [ ] > => {
392+ const getAllUsers = async ( ) : Promise < LocalAccountDataInput [ ] > => {
392393 const query = `[:find ?author_local_id ?author_name
393394 :keys author_local_id name
394395 :where
@@ -412,7 +413,7 @@ const getAllUsers = async (): Promise<AccountLocalInput[]> => {
412413} ;
413414
414415const upsertUsers = async (
415- users : AccountLocalInput [ ] ,
416+ users : LocalAccountDataInput [ ] ,
416417 supabaseClient : DGSupabaseClient ,
417418 context : SupabaseContext ,
418419) => {
0 commit comments