@@ -36,27 +36,27 @@ export interface TDK {
3636export const GetInfoCommand = "/" ;
3737
3838export interface GetInfoResponse {
39- version : string ,
40- apiVersion : number ,
41- cbl : "couchbase-lite-js" ,
42- device : Record < string , string > ,
43- additionalInfo ?: string ,
39+ version : string ,
40+ apiVersion : number ,
41+ cbl : "couchbase-lite-js" ,
42+ device : Record < string , string > ,
43+ additionalInfo ? : string ,
4444}
4545
4646
4747export const ResetCommand = "/reset" ;
4848
4949export interface ResetRequest extends TestRequest {
50- databases : null | Record < string , { collections : string [ ] | undefined } | { dataset : string } > ;
51- test : string | undefined ;
50+ databases : null | Record < string , { collections : string [ ] | undefined } | { dataset : string } > ;
51+ test : string | undefined ;
5252}
5353
5454
5555export const GetAllDocumentsCommand = "/getAllDocuments" ;
5656
5757export interface GetAllDocumentsRequest extends TestRequest {
58- database : string ,
59- collections : string [ ] ,
58+ database : string ,
59+ collections : string [ ] ,
6060}
6161
6262export type GetAllDocumentsResponse = Record < string , Array < { id :cbl . DocID , rev :cbl . RevID } > > ;
@@ -65,185 +65,185 @@ export type GetAllDocumentsResponse = Record<string, Array<{id:cbl.DocID, rev:cb
6565export const GetDocumentCommand = "/getDocument" ;
6666
6767export interface GetDocumentRequest extends TestRequest {
68- database : string ,
69- document : {
70- collection : string ,
71- id : cbl . DocID
68+ database : string ,
69+ document : {
70+ collection : string ,
71+ id : cbl . DocID
7272 }
7373}
7474
7575export type GetDocumentResponse = cbl . JSONObject & {
76- _id : cbl . DocID ,
77- _revs : string , // comma-delimited RevIDs
76+ _id : cbl . DocID ,
77+ _revs : string , // comma-delimited RevIDs
7878}
7979
8080
8181export const UpdateDatabaseCommand = "/updateDatabase" ;
8282
8383export interface UpdateDatabaseRequest extends TestRequest {
84- database : string ,
85- updates : DatabaseUpdateItem [ ] ,
84+ database : string ,
85+ updates : DatabaseUpdateItem [ ] ,
8686}
8787
8888export interface DatabaseUpdateItem {
89- type : 'UPDATE' | 'DELETE' | 'PURGE' ,
90- collection : string ,
91- documentID : cbl . DocID ,
92- updatedProperties ?: cbl . JSONObject [ ] ,
93- removedProperties ?: string [ ] ,
94- updatedBlobs ?: Record < string , string > , // KeyPath -> blob URL
89+ type : 'UPDATE' | 'DELETE' | 'PURGE' ,
90+ collection : string ,
91+ documentID : cbl . DocID ,
92+ updatedProperties ? : cbl . JSONObject [ ] ,
93+ removedProperties ? : string [ ] ,
94+ updatedBlobs ? : Record < string , string > , // KeyPath -> blob URL
9595}
9696
9797
9898export const StartReplicatorCommand = "/startReplicator" ;
9999
100100export interface StartReplicatorRequest extends TestRequest {
101101 config : {
102- database : string ,
103- collections : ReplicatorCollection [ ] ,
104- endpoint : string ,
105- replicatorType ?: 'push' | 'pull' | 'pushAndPull' , // default is 'pushAndPull'
106- continuous ?: boolean ,
107- authenticator ?: ReplicatorAuthenticator ,
102+ database : string ,
103+ collections : ReplicatorCollection [ ] ,
104+ endpoint : string ,
105+ replicatorType ? : 'push' | 'pull' | 'pushAndPull' , // default is 'pushAndPull'
106+ continuous ? : boolean ,
107+ authenticator ? : ReplicatorAuthenticator ,
108108 enableDocumentListener ?: boolean ,
109- enableAutoPurge ?: boolean , // default is true
110- headers ?: Record < string , string > ,
111- pinnedServerCert ?: string ,
109+ enableAutoPurge ? : boolean , // default is true
110+ headers ? : Record < string , string > ,
111+ pinnedServerCert ? : string ,
112112 } ,
113- reset ?: boolean ,
113+ reset ? : boolean ,
114114}
115115
116116export interface ReplicatorCollection {
117- names : string [ ] ,
118- channels ?: string [ ] ,
119- documentIDs ?: cbl . DocID [ ] ,
120- pushFilter ?: Filter ,
121- pullFilter ?: Filter ,
122- conflictResolver ?: Filter ,
117+ names : string [ ] ,
118+ channels ? : string [ ] ,
119+ documentIDs ? : cbl . DocID [ ] ,
120+ pushFilter ? : Filter ,
121+ pullFilter ? : Filter ,
122+ conflictResolver ? : Filter ,
123123}
124124
125125export interface Filter {
126- name : string ,
127- params ?: cbl . JSONObject ,
126+ name : string ,
127+ params ? : cbl . JSONObject ,
128128}
129129
130130export interface ReplicatorAuthenticator {
131- type : 'BASIC' | 'SESSION' ,
131+ type : 'BASIC' | 'SESSION' ,
132132}
133133
134134export interface ReplicatorBasicAuthenticator extends ReplicatorAuthenticator {
135- type : 'BASIC' ,
136- username : string ,
137- password : string ,
135+ type : 'BASIC' ,
136+ username : string ,
137+ password : string ,
138138}
139139
140140export interface ReplicatorSessionAuthenticator extends ReplicatorAuthenticator {
141- type : 'SESSION' ,
142- sessionID : string ,
143- cookieName : string ,
141+ type : 'SESSION' ,
142+ sessionID : string ,
143+ cookieName : string ,
144144}
145145
146146export interface StartReplicatorResponse {
147- id : string
147+ id : string
148148}
149149
150150
151151export const StopReplicatorCommand = "/stopReplicator" ;
152152
153153export interface StopReplicatorRequest extends TestRequest {
154- id : string ,
154+ id : string ,
155155}
156156
157157
158158export const GetReplicatorStatusCommand = "/getReplicatorStatus" ;
159159
160160export interface GetReplicatorStatusRequest extends TestRequest {
161- id : string ,
161+ id : string ,
162162}
163163
164164export interface GetReplicatorStatusResponse {
165- activity : string ,
166- progress : { completed : boolean } ,
167- documents ?: DocumentReplication [ ] ,
168- error ?: ErrorInfo ,
165+ activity : string ,
166+ progress : { completed : boolean } ,
167+ documents ? : DocumentReplication [ ] ,
168+ error ? : ErrorInfo ,
169169}
170170
171171export interface DocumentReplication {
172- collection : string ,
173- documentID : cbl . DocID ,
174- isPush ?: boolean ,
175- flags ?: Array < 'deleted' | 'accessRemoved' > ;
176- error ?: ErrorInfo
172+ collection : string ,
173+ documentID : cbl . DocID ,
174+ isPush ? : boolean ,
175+ flags ? : Array < 'deleted' | 'accessRemoved' > ;
176+ error ? : ErrorInfo
177177}
178178
179179export interface ErrorInfo {
180- domain : string ,
181- code : number ,
182- message : string ,
180+ domain : string ,
181+ code : number ,
182+ message : string ,
183183}
184184
185185
186186export const SnapshotDocumentsCommand = "/snapshotDocuments" ;
187187
188188export interface SnapshotDocumentsRequest extends TestRequest {
189- database : string ,
190- documents : Array < { collection : string , id : cbl . DocID } > ,
189+ database : string ,
190+ documents : Array < { collection : string , id : cbl . DocID } > ,
191191}
192192
193193export interface SnapshotDocumentsResponse {
194- id : string ,
194+ id : string ,
195195}
196196
197197
198198export const VerifyDocumentsCommand = "/verifyDocuments" ;
199199
200200export interface VerifyDocumentsRequest extends TestRequest {
201- database : string ,
202- snapshot : string ,
203- changes : DatabaseUpdateItem [ ] ,
201+ database : string ,
202+ snapshot : string ,
203+ changes : DatabaseUpdateItem [ ] ,
204204}
205205
206206export interface VerifyDocumentsResponse {
207- result : boolean ,
207+ result : boolean ,
208208 description ?: string ,
209- actual ?: cbl . JSONValue ,
210- expected ?: cbl . JSONValue ,
211- document ?: cbl . CBLDocument | cbl . JSONObject , // Document will stringify to an object
209+ actual ? : cbl . JSONValue ,
210+ expected ? : cbl . JSONValue ,
211+ document ? : cbl . CBLDocument | cbl . JSONObject , // Document will stringify to an object
212212}
213213
214214
215215export const PerformMaintenanceCommand = "/performMaintenance" ;
216216
217217export interface PerformMaintenanceRequest extends TestRequest {
218- database : string ,
219- maintenanceType : 'compact' | 'integrityCheck' | 'optimize' | 'fullOptimize' ,
218+ database : string ,
219+ maintenanceType : 'compact' | 'integrityCheck' | 'optimize' | 'fullOptimize' ,
220220}
221221
222222
223223export const NewSessionCommand = "/newSession" ;
224224
225225export interface NewSessionRequest extends TestRequest {
226- id : string ,
227- logging ?: { url : string , tag : string } ,
226+ id : string ,
227+ logging ? : { url : string , tag : string } ,
228228}
229229
230230
231231export const RunQueryCommand = "/runQuery" ;
232232
233233export interface RunQueryRequest extends TestRequest {
234- database : string ,
235- query : string ,
234+ database : string ,
235+ query : string ,
236236}
237237
238238export interface RunQueryResponse {
239- results : cbl . JSONArray ,
239+ results : cbl . JSONArray ,
240240}
241241
242242
243243export const LogCommand = "/log" ;
244244
245245export interface LogRequest extends TestRequest {
246- message : string ,
246+ message : string ,
247247}
248248
249249
@@ -256,10 +256,10 @@ export const kBlobBaseURL = "https://media.githubusercontent.com/media/couchbase
256256
257257/** Schema of `index.json` */
258258export interface DatasetIndex {
259- name : string ,
260- collections : string [ ] ,
259+ name : string ,
260+ collections : string [ ] ,
261261}
262262
263263export type DatasetDoc = cbl . JSONObject & {
264- _id : string ,
264+ _id : string ,
265265}
0 commit comments