x-ng2-http-interceptor
Version:
Adds interception capability around angular http api
91 lines • 4.08 kB
JavaScript
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
import { InterceptorUtils } from './interceptor-utils';
import { InterceptorRequestBuilder } from './interceptor-request-builder';
/**
* !!INTERNAL USE ONLY!!
* Utility builder for creating a new instance of _InterceptorRequest with additional ability to set internal properties aswell
* Use InterceptorRequestBuilderInternal.new() to instantiate the builder
*/
export var InterceptorRequestBuilderInternal = (function (_super) {
__extends(InterceptorRequestBuilderInternal, _super);
/**
* Use InterceptorRequestBuilderInternal.new() to instantiate the builder
*/
function InterceptorRequestBuilderInternal() {
_super.call(this);
}
InterceptorRequestBuilderInternal.new = function (request) {
var builder = new InterceptorRequestBuilderInternal();
InterceptorUtils.assign(builder, request);
return builder;
};
InterceptorRequestBuilderInternal.prototype.url = function (url) {
_super.prototype.url.call(this, url);
return this;
};
InterceptorRequestBuilderInternal.prototype.options = function (options) {
_super.prototype.options.call(this, options);
return this;
};
InterceptorRequestBuilderInternal.prototype.sharedData = function (sharedData) {
_super.prototype.sharedData.call(this, sharedData);
return this;
};
InterceptorRequestBuilderInternal.prototype.shortCircuitAtCurrentStep = function (shortCircuitAtCurrentStep) {
_super.prototype.shortCircuitAtCurrentStep.call(this, shortCircuitAtCurrentStep);
return this;
};
InterceptorRequestBuilderInternal.prototype.alsoForceRequestCompletion = function (alsoForceRequestCompletion) {
_super.prototype.alsoForceRequestCompletion.call(this, alsoForceRequestCompletion);
return this;
};
InterceptorRequestBuilderInternal.prototype.alreadyShortCircuited = function (alreadyShortCircuited) {
this._alreadyShortCircuited = alreadyShortCircuited;
return this;
};
InterceptorRequestBuilderInternal.prototype.shortCircuitTriggeredBy = function (shortCircuitTriggeredBy) {
this._shortCircuitTriggeredBy = shortCircuitTriggeredBy;
return this;
};
InterceptorRequestBuilderInternal.prototype.err = function (err) {
this._err = err;
return this;
};
InterceptorRequestBuilderInternal.prototype.errEncounteredAt = function (errEncounteredAt) {
this._errEncounteredAt = errEncounteredAt;
return this;
};
InterceptorRequestBuilderInternal.prototype.getUrl = function () {
return this._url;
};
InterceptorRequestBuilderInternal.prototype.getOptions = function () {
return this._options;
};
InterceptorRequestBuilderInternal.prototype.getSharedData = function () {
return this._sharedData;
};
InterceptorRequestBuilderInternal.prototype.getShortCircuitAtCurrentStep = function () {
return this._shortCircuitAtCurrentStep;
};
InterceptorRequestBuilderInternal.prototype.getAlsoForceRequestCompletion = function () {
return this._alsoForceRequestCompletion;
};
InterceptorRequestBuilderInternal.prototype.getAlreadyShortCircuited = function () {
return this._alreadyShortCircuited;
};
InterceptorRequestBuilderInternal.prototype.getShortCircuitTriggeredBy = function () {
return this._shortCircuitTriggeredBy;
};
InterceptorRequestBuilderInternal.prototype.getErr = function () {
return this._err;
};
InterceptorRequestBuilderInternal.prototype.getErrEncounteredAt = function () {
return this._errEncounteredAt;
};
return InterceptorRequestBuilderInternal;
}(InterceptorRequestBuilder));
//# sourceMappingURL=interceptor-request-builder-internal.js.map