@@ -2,7 +2,7 @@ import { org } from "@modelix/model-client";
22import { toRoleJS } from "@modelix/ts-model-api" ;
33import { watchEffect } from "vue" ;
44import { useModelClient } from "./useModelClient" ;
5- import { useReplicatedModel } from "./useReplicatedModels " ;
5+ import { useReplicatedModel } from "./useReplicatedModel " ;
66import IdSchemeJS = org . modelix . model . client2 . IdSchemeJS ;
77
88type ClientJS = org . modelix . model . client2 . ClientJS ;
@@ -13,7 +13,33 @@ const { loadModelsFromJson } = org.modelix.model.client2;
1313import ReplicatedModelParameters = org . modelix . model . client2 . ReplicatedModelParameters ;
1414
1515test ( "test wrapper backwards compatibility" , ( done ) => {
16- class SuccessfulClientJS {
16+ class SuccessfulClientJS implements ClientJS {
17+ startReplicatedModel (
18+ repositoryId : string ,
19+ branchId : string ,
20+ idScheme : org . modelix . model . client2 . IdSchemeJS ,
21+ ) : Promise < org . modelix . model . client2 . ReplicatedModelJS > {
22+ // Mock implementation that returns a dummy object with a branch
23+ const rootNode = loadModelsFromJson ( [ JSON . stringify ( { root : { } } ) ] ) ;
24+ rootNode . setPropertyValue ( toRoleJS ( "branchId" ) , branchId ) ;
25+
26+ const branch = {
27+ rootNode,
28+ getRootNodes : ( ) => [ rootNode ] ,
29+ addListener : jest . fn ( ) ,
30+ removeListener : jest . fn ( ) ,
31+ resolveNode : jest . fn ( ) ,
32+ } ;
33+
34+ const replicatedModel = {
35+ getBranch : ( ) => branch ,
36+ dispose : jest . fn ( ) ,
37+ getCurrentVersionInformation : jest . fn ( ) ,
38+ } as unknown as ReplicatedModelJS ;
39+
40+ return Promise . resolve ( replicatedModel ) ;
41+ }
42+
1743 startReplicatedModels (
1844 parameters : ReplicatedModelParameters [ ] ,
1945 ) : Promise < ReplicatedModelJS > {
@@ -38,6 +64,141 @@ test("test wrapper backwards compatibility", (done) => {
3864
3965 return Promise . resolve ( replicatedModel ) ;
4066 }
67+
68+ readonly __doNotUseOrImplementIt : any ;
69+
70+ createBranch (
71+ repositoryId : string ,
72+ branchId : string ,
73+ versionHash : string ,
74+ ) : Promise < void > {
75+ throw Error ( "Not implemented" ) ;
76+ }
77+
78+ deleteBranch ( repositoryId : string , branchId : string ) : Promise < boolean > {
79+ throw Error ( "Not implemented" ) ;
80+ }
81+
82+ diffAsMutationParameters (
83+ repositoryId : string ,
84+ newVersion : string ,
85+ oldVersion : string ,
86+ ) : Promise < Array < org . modelix . model . client2 . MutationParametersJS > > {
87+ throw Error ( "Not implemented" ) ;
88+ }
89+
90+ dispose ( ) : void {
91+ throw Error ( "Not implemented" ) ;
92+ }
93+
94+ fetchBranches ( repositoryId : string ) : Promise < Array < string > > {
95+ throw Error ( "Not implemented" ) ;
96+ }
97+
98+ fetchBranchesWithHashes (
99+ repositoryId : string ,
100+ ) : Promise < Array < org . modelix . model . server . api . BranchInfo > > {
101+ throw Error ( "Not implemented" ) ;
102+ }
103+
104+ fetchRepositories ( ) : Promise < Array < string > > {
105+ throw Error ( "Not implemented" ) ;
106+ }
107+
108+ getHistoryForFixedIntervals (
109+ repositoryId : string ,
110+ headVersion : string ,
111+ intervalDurationSeconds : number ,
112+ skip : number ,
113+ limit : number ,
114+ ) : Promise < Array < org . modelix . model . client2 . HistoryIntervalJS > > {
115+ throw Error ( "Not implemented" ) ;
116+ }
117+
118+ getHistoryForFixedIntervalsForBranch (
119+ repositoryId : string ,
120+ branchId : string ,
121+ intervalDurationSeconds : number ,
122+ skip : number ,
123+ limit : number ,
124+ ) : Promise < Array < org . modelix . model . client2 . HistoryIntervalJS > > {
125+ throw Error ( "Not implemented" ) ;
126+ }
127+
128+ getHistoryForProvidedIntervals (
129+ repositoryId : string ,
130+ headVersion : string ,
131+ splitAt : Array < Date > ,
132+ ) : Promise < Array < org . modelix . model . client2 . HistoryIntervalJS > > {
133+ throw Error ( "Not implemented" ) ;
134+ }
135+
136+ getHistoryForProvidedIntervalsForBranch (
137+ repositoryId : string ,
138+ branchId : string ,
139+ splitAt : Array < Date > ,
140+ ) : Promise < Array < org . modelix . model . client2 . HistoryIntervalJS > > {
141+ throw Error ( "Not implemented" ) ;
142+ }
143+
144+ getHistoryRange (
145+ repositoryId : string ,
146+ headVersion : string ,
147+ skip : number ,
148+ limit : number ,
149+ ) : Promise < Array < org . modelix . model . client2 . VersionInformationJS > > {
150+ throw Error ( "Not implemented" ) ;
151+ }
152+
153+ getHistoryRangeForBranch (
154+ repositoryId : string ,
155+ branchId : string ,
156+ skip : number ,
157+ limit : number ,
158+ ) : Promise < Array < org . modelix . model . client2 . VersionInformationJS > > {
159+ throw Error ( "Not implemented" ) ;
160+ }
161+
162+ getHistorySessions (
163+ repositoryId : string ,
164+ headVersion : string ,
165+ delaySeconds : number ,
166+ skip : number ,
167+ limit : number ,
168+ ) : Promise < Array < org . modelix . model . client2 . HistoryIntervalJS > > {
169+ throw Error ( "Not implemented" ) ;
170+ }
171+
172+ getHistorySessionsForBranch (
173+ repositoryId : string ,
174+ branchId : string ,
175+ delaySeconds : number ,
176+ skip : number ,
177+ limit : number ,
178+ ) : Promise < Array < org . modelix . model . client2 . HistoryIntervalJS > > {
179+ throw Error ( "Not implemented" ) ;
180+ }
181+
182+ initRepository ( repositoryId : string , useRoleIds ?: boolean ) : Promise < void > {
183+ throw Error ( "Not implemented" ) ;
184+ }
185+
186+ loadReadonlyVersion (
187+ repositoryId : string ,
188+ versionHash : string ,
189+ ) : Promise < org . modelix . model . client2 . VersionInformationWithModelTree > {
190+ throw Error ( "Not implemented" ) ;
191+ }
192+
193+ revertTo (
194+ repositoryId : string ,
195+ branchId : string ,
196+ targetVersionHash : string ,
197+ ) : Promise < string > {
198+ throw Error ( "Not implemented" ) ;
199+ }
200+
201+ setClientProvidedUserId ( userId : string ) : void { }
41202 }
42203
43204 const { client } = useModelClient ( "anURL" , ( ) =>
0 commit comments