in src/main.ts [921:975]
protected registerProvider(options: undefined): Disposable {
const client = this._client;
let getRestorePlan = (ownerUri: string, restoreInfo: azdata.RestoreInfo): Thenable<azdata.RestorePlanResponse> => {
let params: types.RestoreParams = { options: restoreInfo.options, ownerUri, taskExecutionMode: restoreInfo.taskExecutionMode };
return client.sendRequest(protocol.RestorePlanRequest.type, params).then(
r => r,
e => {
client.logFailedRequest(protocol.RestorePlanRequest.type, e);
return Promise.resolve(undefined);
}
);
};
let restore = (ownerUri: string, restoreInfo: azdata.RestoreInfo): Thenable<azdata.RestoreResponse> => {
let params: types.RestoreParams = { options: restoreInfo.options, ownerUri, taskExecutionMode: restoreInfo.taskExecutionMode };
return client.sendRequest(protocol.RestoreRequest.type, params).then(
r => r,
e => {
client.logFailedRequest(protocol.RestoreRequest.type, e);
return Promise.resolve(undefined);
}
);
};
let getRestoreConfigInfo = (ownerUri: string): Thenable<azdata.RestoreConfigInfo> => {
let params: types.RestoreConfigInfoRequestParams = { ownerUri };
return client.sendRequest(protocol.RestoreConfigInfoRequest.type, params).then(
r => r,
e => {
client.logFailedRequest(protocol.RestoreConfigInfoRequest.type, e);
return Promise.resolve(undefined);
}
);
};
let cancelRestorePlan = (ownerUri: string, restoreInfo: azdata.RestoreInfo): Thenable<boolean> => {
let params: types.RestoreParams = { options: restoreInfo.options, ownerUri, taskExecutionMode: restoreInfo.taskExecutionMode };
return client.sendRequest(protocol.CancelRestorePlanRequest.type, params).then(
r => r,
e => {
client.logFailedRequest(protocol.CancelRestorePlanRequest.type, e);
return Promise.resolve(undefined);
}
);
};
return azdata.dataprotocol.registerRestoreProvider({
providerId: client.providerId,
cancelRestorePlan,
getRestoreConfigInfo,
getRestorePlan,
restore
});
}