@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
40 lines (38 loc) • 1.23 kB
JavaScript
import { RpcInboundClient } from '../rpc-inbound-client';
import { RpcAliveKey } from './rpc-alive-model';
export class RpcAliveClient {
/**
* The alive command.
*
* @param rpc the Rpc instance.
* @param data the Rpc alive data object.
* @return Promise<void> the promise object.
*/
static alive(rpc, data) {
if (!data) {
data = { timestamp: Date.now() };
}
return RpcInboundClient.call(rpc, RpcAliveKey.command, RpcAliveKey.version, data);
}
/**
* The alive forever command.
*
* @param rpc the Rpc instance.
* @return Promise<void> the promise object.
*/
static forever(rpc) {
const data = { timestamp: Date.now(), forever: true };
return RpcInboundClient.call(rpc, RpcAliveKey.command, RpcAliveKey.version, data);
}
/**
* The reset forever state command.
*
* @param rpc the Rpc instance.
* @return Promise<void> the promise object.
*/
static reset(rpc) {
const data = { timestamp: Date.now(), forever: false };
return RpcInboundClient.call(rpc, RpcAliveKey.command, RpcAliveKey.version, data);
}
}
//# sourceMappingURL=rpc-alive-client.js.map