x-ng2-http-interceptor
Version:
Adds interception capability around angular http api
101 lines • 3.66 kB
JavaScript
import { InterceptorUtils } from './interceptor-utils';
export var InterceptorResponseWrapper = (function () {
function InterceptorResponseWrapper(builder) {
InterceptorUtils.assign(this, builder);
}
Object.defineProperty(InterceptorResponseWrapper.prototype, "url", {
get: function () {
return this._url;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "options", {
get: function () {
return this._options;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "response", {
get: function () {
return this._response;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "sharedData", {
get: function () {
return this._sharedData;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "shortCircuitTriggeredBy", {
get: function () {
return +this._shortCircuitTriggeredBy;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "forceReturnResponse", {
get: function () {
return !!this._forceReturnResponse;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "forceRequestCompletion", {
get: function () {
return !!this._forceRequestCompletion;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "responseGeneratedByShortCircuitHandler", {
get: function () {
return !!this._responseGeneratedByShortCircuitHandler;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "err", {
get: function () {
return this._err;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "errEncounteredAt", {
get: function () {
return +this._errEncounteredAt;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "errEncounteredInRequestCycle", {
get: function () {
return !!this._errEncounteredInRequestCycle;
},
enumerable: true,
configurable: true
});
Object.defineProperty(InterceptorResponseWrapper.prototype, "responseGeneratedByErrHandler", {
get: function () {
return !!this._err && !!this._response;
},
enumerable: true,
configurable: true
});
InterceptorResponseWrapper.prototype.isShortCircuited = function () {
return this._shortCircuitTriggeredBy !== undefined && this._shortCircuitTriggeredBy !== null && !!this._shortCircuitTriggeredBy;
};
InterceptorResponseWrapper.prototype.circuitShortedByMe = function (currentStep) {
return this.isShortCircuited() && this._shortCircuitTriggeredBy === currentStep;
};
InterceptorResponseWrapper.prototype.errThrownByMe = function (currentStep) {
return !!this._errEncounteredAt && this._errEncounteredAt === currentStep;
};
return InterceptorResponseWrapper;
}());
//# sourceMappingURL=interceptor-response-wrapper.js.map