efficy-enterprise-api
Version:
The Efficy Enterprise API is developed for server-side usage in a Node.js environment (e.g. for integrations) and also bundled for usage inside an Efficy browser session for client-side JSON RPC requests.
37 lines (29 loc) • 686 B
JavaScript
import uuidv4 from './utils/uuidv4.mjs';
import {ParseGentle} from './utils/parsing.mjs';
/**
* Low level class representing an RPC operation
*/
class RemoteObject {
#remoteAPI;
/** @protected */
requestObject;
/** @protected */
responseObject;
/** @protected */
id;
constructor(remoteAPI) {
this.#remoteAPI = remoteAPI;
this.id = uuidv4();
this.requestObject = {};
this.responseObject = {};
}
/** @protected */
get api() {
return this.#remoteAPI;
}
/** @protected */
afterExecute() {
this.responseObject = ParseGentle.numberProperties(this.responseObject, ["edithandle", "key"]);
}
}
export default RemoteObject;