@ima/plugin-halson-rest-client
Version:
HAL+JSON REST API client for IMA applications.
40 lines (39 loc) • 1.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, /**
* The REST API client for the HAL+JSON REST API.
*/ "default", {
enumerable: true,
get: function() {
return HalsonRestClient;
}
});
const _pluginrestclient = require("@ima/plugin-rest-client");
const _HalsonLinkGenerator = /*#__PURE__*/ _interop_require_default(require("./HalsonLinkGenerator"));
const _HalsonResponsePostProcessor = /*#__PURE__*/ _interop_require_default(require("./HalsonResponsePostProcessor"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
class HalsonRestClient extends _pluginrestclient.AbstractRestClient {
/**
* Initializes the HALSON REST API client.
*
* @param {import('@ima/core').HttpAgent} httpAgent The IMA HTTP agent used for communication
* with the REST API.
* @param {Configurator} configurator URL to the REST API root.
* @param {RequestPreProcessor[]} preProcessors The request pre-processors.
* @param {ResponsePostProcessor[]} postProcessors The response
* post-processors. The response will be processed by the
* {@linkcode HalsonResponsePostProcessor} before it will be passed
* to the provided post-processors.
*/ constructor(httpAgent, configurator, preProcessors = [], postProcessors = []){
super(httpAgent, configurator, new _HalsonLinkGenerator.default(), preProcessors, [
new _HalsonResponsePostProcessor.default()
].concat(postProcessors));
}
}
//# sourceMappingURL=HalsonRestClient.js.map