Skip to content

Commit ec004cc

Browse files
committed
JS Server: Just prettified tdkSchema.ts
1 parent 6898f84 commit ec004cc

1 file changed

Lines changed: 84 additions & 84 deletions

File tree

servers/javascript/src/tdkSchema.ts

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ export interface TDK {
3636
export const GetInfoCommand = "/";
3737

3838
export 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

4747
export const ResetCommand = "/reset";
4848

4949
export 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

5555
export const GetAllDocumentsCommand = "/getAllDocuments";
5656

5757
export interface GetAllDocumentsRequest extends TestRequest {
58-
database: string,
59-
collections: string[],
58+
database : string,
59+
collections : string[],
6060
}
6161

6262
export 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
6565
export const GetDocumentCommand = "/getDocument";
6666

6767
export 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

7575
export 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

8181
export const UpdateDatabaseCommand = "/updateDatabase";
8282

8383
export interface UpdateDatabaseRequest extends TestRequest {
84-
database: string,
85-
updates: DatabaseUpdateItem[],
84+
database : string,
85+
updates : DatabaseUpdateItem[],
8686
}
8787

8888
export 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

9898
export const StartReplicatorCommand = "/startReplicator";
9999

100100
export 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

116116
export 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

125125
export interface Filter {
126-
name: string,
127-
params?: cbl.JSONObject,
126+
name : string,
127+
params? : cbl.JSONObject,
128128
}
129129

130130
export interface ReplicatorAuthenticator {
131-
type: 'BASIC' | 'SESSION',
131+
type : 'BASIC' | 'SESSION',
132132
}
133133

134134
export interface ReplicatorBasicAuthenticator extends ReplicatorAuthenticator {
135-
type: 'BASIC',
136-
username: string,
137-
password: string,
135+
type : 'BASIC',
136+
username : string,
137+
password : string,
138138
}
139139

140140
export interface ReplicatorSessionAuthenticator extends ReplicatorAuthenticator {
141-
type: 'SESSION',
142-
sessionID: string,
143-
cookieName: string,
141+
type : 'SESSION',
142+
sessionID : string,
143+
cookieName : string,
144144
}
145145

146146
export interface StartReplicatorResponse {
147-
id: string
147+
id : string
148148
}
149149

150150

151151
export const StopReplicatorCommand = "/stopReplicator";
152152

153153
export interface StopReplicatorRequest extends TestRequest {
154-
id: string,
154+
id : string,
155155
}
156156

157157

158158
export const GetReplicatorStatusCommand = "/getReplicatorStatus";
159159

160160
export interface GetReplicatorStatusRequest extends TestRequest {
161-
id: string,
161+
id : string,
162162
}
163163

164164
export 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

171171
export 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

179179
export interface ErrorInfo {
180-
domain: string,
181-
code: number,
182-
message: string,
180+
domain : string,
181+
code : number,
182+
message : string,
183183
}
184184

185185

186186
export const SnapshotDocumentsCommand = "/snapshotDocuments";
187187

188188
export 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

193193
export interface SnapshotDocumentsResponse {
194-
id: string,
194+
id : string,
195195
}
196196

197197

198198
export const VerifyDocumentsCommand = "/verifyDocuments";
199199

200200
export interface VerifyDocumentsRequest extends TestRequest {
201-
database: string,
202-
snapshot: string,
203-
changes: DatabaseUpdateItem[],
201+
database : string,
202+
snapshot : string,
203+
changes : DatabaseUpdateItem[],
204204
}
205205

206206
export 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

215215
export const PerformMaintenanceCommand = "/performMaintenance";
216216

217217
export 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

223223
export const NewSessionCommand = "/newSession";
224224

225225
export 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

231231
export const RunQueryCommand = "/runQuery";
232232

233233
export interface RunQueryRequest extends TestRequest {
234-
database: string,
235-
query: string,
234+
database : string,
235+
query : string,
236236
}
237237

238238
export interface RunQueryResponse {
239-
results: cbl.JSONArray,
239+
results : cbl.JSONArray,
240240
}
241241

242242

243243
export const LogCommand = "/log";
244244

245245
export 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` */
258258
export interface DatasetIndex {
259-
name: string,
260-
collections: string[],
259+
name : string,
260+
collections : string[],
261261
}
262262

263263
export type DatasetDoc = cbl.JSONObject & {
264-
_id: string,
264+
_id : string,
265265
}

0 commit comments

Comments
 (0)