improve config and mock infra

This commit is contained in:
Matt Hill
2021-06-15 10:16:51 -06:00
committed by Aiden McClelland
parent c5f2379c6e
commit 1b0173197f
8 changed files with 73 additions and 37 deletions

View File

@@ -36,15 +36,40 @@ export class MockApiService extends ApiService {
// db
async getRevisions (since: number): Promise<RR.GetRevisionsRes> {
return this.http.rpcRequest({ method: 'db.revisions', params: { since } })
await pauseFor(2000)
return {
...Mock.DbDump,
id: this.nextSequence(),
}
// return this.http.rpcRequest({ method: 'db.revisions', params: { since } })
}
async getDump (): Promise<RR.GetDumpRes> {
return this.http.rpcRequest({ method: 'db.dump' })
await pauseFor(2000)
return {
...Mock.DbDump,
id: this.nextSequence(),
}
// return this.http.rpcRequest({ method: 'db.dump' })
}
async setDbValueRaw (params: RR.SetDBValueReq): Promise<RR.SetDBValueRes> {
return this.http.rpcRequest({ method: 'db.put.ui', params })
await pauseFor(2000)
return {
response: null,
revision: {
id: this.nextSequence(),
patch: [
{
op: PatchOp.REPLACE,
path: params.pointer,
value: params.value,
},
],
expireId: null,
},
}
// return this.http.rpcRequest({ method: 'db.put.ui', params })
}
// auth