apollo-link-retry
Advanced tools
Comparing version 2.2.10 to 2.2.11
@@ -0,69 +1,4 @@ | ||
import { __extends, __awaiter, __generator } from 'tslib'; | ||
import { Observable, ApolloLink } from 'apollo-link'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
var extendStatics = function(d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
function __extends(d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
function __generator(thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
} | ||
function buildDelayFunction(_a) { | ||
@@ -70,0 +5,0 @@ var _b = _a === void 0 ? {} : _a, _c = _b.initial, initial = _c === void 0 ? 300 : _c, _d = _b.max, max = _d === void 0 ? Infinity : _d, _e = _b.jitter, jitter = _e === void 0 ? true : _e; |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('apollo-link')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'apollo-link'], factory) : | ||
(global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.retry = {}), global.apolloLink.core)); | ||
}(this, function (exports, apolloLink) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('apollo-link')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'apollo-link'], factory) : | ||
(global = global || self, factory((global.apolloLink = global.apolloLink || {}, global.apolloLink.retry = {}), global.tslib, global.apolloLink.core)); | ||
}(this, function (exports, tslib_1, apolloLink) { 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
function buildDelayFunction(_a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.initial, initial = _c === void 0 ? 300 : _c, _d = _b.max, max = _d === void 0 ? Infinity : _d, _e = _b.jitter, jitter = _e === void 0 ? true : _e; | ||
var baseDelay; | ||
if (jitter) { | ||
baseDelay = initial; | ||
} | ||
else { | ||
baseDelay = initial / 2; | ||
} | ||
return function delayFunction(count) { | ||
var delay = Math.min(max, baseDelay * Math.pow(2, count)); | ||
if (jitter) { | ||
delay = Math.random() * delay; | ||
} | ||
return delay; | ||
}; | ||
} | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
function buildRetryFunction(_a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.max, max = _c === void 0 ? 5 : _c, retryIf = _b.retryIf; | ||
return function retryFunction(count, operation, error) { | ||
if (count >= max) | ||
return false; | ||
return retryIf ? retryIf(error, operation) : !!error; | ||
}; | ||
} | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/* global Reflect, Promise */ | ||
var RetryableOperation = (function () { | ||
function RetryableOperation(operation, nextLink, delayFor, retryIf) { | ||
var _this = this; | ||
this.operation = operation; | ||
this.nextLink = nextLink; | ||
this.delayFor = delayFor; | ||
this.retryIf = retryIf; | ||
this.retryCount = 0; | ||
this.values = []; | ||
this.complete = false; | ||
this.canceled = false; | ||
this.observers = []; | ||
this.currentSubscription = null; | ||
this.onNext = function (value) { | ||
_this.values.push(value); | ||
for (var _i = 0, _a = _this.observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.next(value); | ||
} | ||
}; | ||
this.onComplete = function () { | ||
_this.complete = true; | ||
for (var _i = 0, _a = _this.observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.complete(); | ||
} | ||
}; | ||
this.onError = function (error) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var shouldRetry, _i, _a, observer; | ||
return tslib_1.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
this.retryCount += 1; | ||
return [4, this.retryIf(this.retryCount, this.operation, error)]; | ||
case 1: | ||
shouldRetry = _b.sent(); | ||
if (shouldRetry) { | ||
this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error)); | ||
return [2]; | ||
} | ||
this.error = error; | ||
for (_i = 0, _a = this.observers; _i < _a.length; _i++) { | ||
observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.error(error); | ||
} | ||
return [2]; | ||
} | ||
}); | ||
}); }; | ||
} | ||
RetryableOperation.prototype.subscribe = function (observer) { | ||
if (this.canceled) { | ||
throw new Error("Subscribing to a retryable link that was canceled is not supported"); | ||
} | ||
this.observers.push(observer); | ||
for (var _i = 0, _a = this.values; _i < _a.length; _i++) { | ||
var value = _a[_i]; | ||
observer.next(value); | ||
} | ||
if (this.complete) { | ||
observer.complete(); | ||
} | ||
else if (this.error) { | ||
observer.error(this.error); | ||
} | ||
}; | ||
RetryableOperation.prototype.unsubscribe = function (observer) { | ||
var index = this.observers.indexOf(observer); | ||
if (index < 0) { | ||
throw new Error("RetryLink BUG! Attempting to unsubscribe unknown observer!"); | ||
} | ||
this.observers[index] = null; | ||
if (this.observers.every(function (o) { return o === null; })) { | ||
this.cancel(); | ||
} | ||
}; | ||
RetryableOperation.prototype.start = function () { | ||
if (this.currentSubscription) | ||
return; | ||
this.try(); | ||
}; | ||
RetryableOperation.prototype.cancel = function () { | ||
if (this.currentSubscription) { | ||
this.currentSubscription.unsubscribe(); | ||
} | ||
clearTimeout(this.timerId); | ||
this.timerId = null; | ||
this.currentSubscription = null; | ||
this.canceled = true; | ||
}; | ||
RetryableOperation.prototype.try = function () { | ||
this.currentSubscription = this.nextLink(this.operation).subscribe({ | ||
next: this.onNext, | ||
error: this.onError, | ||
complete: this.onComplete, | ||
}); | ||
}; | ||
RetryableOperation.prototype.scheduleRetry = function (delay) { | ||
var _this = this; | ||
if (this.timerId) { | ||
throw new Error("RetryLink BUG! Encountered overlapping retries"); | ||
} | ||
this.timerId = setTimeout(function () { | ||
_this.timerId = null; | ||
_this.try(); | ||
}, delay); | ||
}; | ||
return RetryableOperation; | ||
}()); | ||
var RetryLink = (function (_super) { | ||
tslib_1.__extends(RetryLink, _super); | ||
function RetryLink(_a) { | ||
var _b = _a === void 0 ? {} : _a, delay = _b.delay, attempts = _b.attempts; | ||
var _this = _super.call(this) || this; | ||
_this.delayFor = | ||
typeof delay === 'function' ? delay : buildDelayFunction(delay); | ||
_this.retryIf = | ||
typeof attempts === 'function' ? attempts : buildRetryFunction(attempts); | ||
return _this; | ||
} | ||
RetryLink.prototype.request = function (operation, nextLink) { | ||
var retryable = new RetryableOperation(operation, nextLink, this.delayFor, this.retryIf); | ||
retryable.start(); | ||
return new apolloLink.Observable(function (observer) { | ||
retryable.subscribe(observer); | ||
return function () { | ||
retryable.unsubscribe(observer); | ||
}; | ||
}); | ||
}; | ||
return RetryLink; | ||
}(apolloLink.ApolloLink)); | ||
var extendStatics = function(d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
exports.RetryLink = RetryLink; | ||
function __extends(d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
} | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
function __generator(thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
} | ||
function buildDelayFunction(_a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.initial, initial = _c === void 0 ? 300 : _c, _d = _b.max, max = _d === void 0 ? Infinity : _d, _e = _b.jitter, jitter = _e === void 0 ? true : _e; | ||
var baseDelay; | ||
if (jitter) { | ||
baseDelay = initial; | ||
} | ||
else { | ||
baseDelay = initial / 2; | ||
} | ||
return function delayFunction(count) { | ||
var delay = Math.min(max, baseDelay * Math.pow(2, count)); | ||
if (jitter) { | ||
delay = Math.random() * delay; | ||
} | ||
return delay; | ||
}; | ||
} | ||
function buildRetryFunction(_a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.max, max = _c === void 0 ? 5 : _c, retryIf = _b.retryIf; | ||
return function retryFunction(count, operation, error) { | ||
if (count >= max) | ||
return false; | ||
return retryIf ? retryIf(error, operation) : !!error; | ||
}; | ||
} | ||
var RetryableOperation = (function () { | ||
function RetryableOperation(operation, nextLink, delayFor, retryIf) { | ||
var _this = this; | ||
this.operation = operation; | ||
this.nextLink = nextLink; | ||
this.delayFor = delayFor; | ||
this.retryIf = retryIf; | ||
this.retryCount = 0; | ||
this.values = []; | ||
this.complete = false; | ||
this.canceled = false; | ||
this.observers = []; | ||
this.currentSubscription = null; | ||
this.onNext = function (value) { | ||
_this.values.push(value); | ||
for (var _i = 0, _a = _this.observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.next(value); | ||
} | ||
}; | ||
this.onComplete = function () { | ||
_this.complete = true; | ||
for (var _i = 0, _a = _this.observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.complete(); | ||
} | ||
}; | ||
this.onError = function (error) { return __awaiter(_this, void 0, void 0, function () { | ||
var shouldRetry, _i, _a, observer; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
this.retryCount += 1; | ||
return [4, this.retryIf(this.retryCount, this.operation, error)]; | ||
case 1: | ||
shouldRetry = _b.sent(); | ||
if (shouldRetry) { | ||
this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error)); | ||
return [2]; | ||
} | ||
this.error = error; | ||
for (_i = 0, _a = this.observers; _i < _a.length; _i++) { | ||
observer = _a[_i]; | ||
if (!observer) | ||
continue; | ||
observer.error(error); | ||
} | ||
return [2]; | ||
} | ||
}); | ||
}); }; | ||
} | ||
RetryableOperation.prototype.subscribe = function (observer) { | ||
if (this.canceled) { | ||
throw new Error("Subscribing to a retryable link that was canceled is not supported"); | ||
} | ||
this.observers.push(observer); | ||
for (var _i = 0, _a = this.values; _i < _a.length; _i++) { | ||
var value = _a[_i]; | ||
observer.next(value); | ||
} | ||
if (this.complete) { | ||
observer.complete(); | ||
} | ||
else if (this.error) { | ||
observer.error(this.error); | ||
} | ||
}; | ||
RetryableOperation.prototype.unsubscribe = function (observer) { | ||
var index = this.observers.indexOf(observer); | ||
if (index < 0) { | ||
throw new Error("RetryLink BUG! Attempting to unsubscribe unknown observer!"); | ||
} | ||
this.observers[index] = null; | ||
if (this.observers.every(function (o) { return o === null; })) { | ||
this.cancel(); | ||
} | ||
}; | ||
RetryableOperation.prototype.start = function () { | ||
if (this.currentSubscription) | ||
return; | ||
this.try(); | ||
}; | ||
RetryableOperation.prototype.cancel = function () { | ||
if (this.currentSubscription) { | ||
this.currentSubscription.unsubscribe(); | ||
} | ||
clearTimeout(this.timerId); | ||
this.timerId = null; | ||
this.currentSubscription = null; | ||
this.canceled = true; | ||
}; | ||
RetryableOperation.prototype.try = function () { | ||
this.currentSubscription = this.nextLink(this.operation).subscribe({ | ||
next: this.onNext, | ||
error: this.onError, | ||
complete: this.onComplete, | ||
}); | ||
}; | ||
RetryableOperation.prototype.scheduleRetry = function (delay) { | ||
var _this = this; | ||
if (this.timerId) { | ||
throw new Error("RetryLink BUG! Encountered overlapping retries"); | ||
} | ||
this.timerId = setTimeout(function () { | ||
_this.timerId = null; | ||
_this.try(); | ||
}, delay); | ||
}; | ||
return RetryableOperation; | ||
}()); | ||
var RetryLink = (function (_super) { | ||
__extends(RetryLink, _super); | ||
function RetryLink(_a) { | ||
var _b = _a === void 0 ? {} : _a, delay = _b.delay, attempts = _b.attempts; | ||
var _this = _super.call(this) || this; | ||
_this.delayFor = | ||
typeof delay === 'function' ? delay : buildDelayFunction(delay); | ||
_this.retryIf = | ||
typeof attempts === 'function' ? attempts : buildRetryFunction(attempts); | ||
return _this; | ||
} | ||
RetryLink.prototype.request = function (operation, nextLink) { | ||
var retryable = new RetryableOperation(operation, nextLink, this.delayFor, this.retryIf); | ||
retryable.start(); | ||
return new apolloLink.Observable(function (observer) { | ||
retryable.subscribe(observer); | ||
return function () { | ||
retryable.unsubscribe(observer); | ||
}; | ||
}); | ||
}; | ||
return RetryLink; | ||
}(apolloLink.ApolloLink)); | ||
exports.RetryLink = RetryLink; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); | ||
//# sourceMappingURL=bundle.umd.js.map |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./retryLink")); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./retryLink"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
} | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var apollo_link_1 = require("apollo-link"); | ||
@@ -85,5 +38,5 @@ var delayFunction_1 = require("./delayFunction"); | ||
}; | ||
this.onError = function (error) { return __awaiter(_this, void 0, void 0, function () { | ||
this.onError = function (error) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
var shouldRetry, _i, _a, observer; | ||
return __generator(this, function (_b) { | ||
return tslib_1.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
@@ -171,3 +124,3 @@ case 0: | ||
var RetryLink = (function (_super) { | ||
__extends(RetryLink, _super); | ||
tslib_1.__extends(RetryLink, _super); | ||
function RetryLink(_a) { | ||
@@ -174,0 +127,0 @@ var _b = _a === void 0 ? {} : _a, delay = _b.delay, attempts = _b.attempts; |
{ | ||
"name": "apollo-link-retry", | ||
"version": "2.2.10", | ||
"version": "2.2.11", | ||
"description": "Retry Apollo Link for GraphQL Network Stack", | ||
@@ -16,2 +16,3 @@ "author": "Evans Hauser <evanshauser@gmail.com>", | ||
"typings": "./lib/index.d.ts", | ||
"sideEffects": false, | ||
"repository": { | ||
@@ -26,15 +27,10 @@ "type": "git", | ||
"scripts": { | ||
"build:browser": "browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-link && npm run minify:browser", | ||
"build": "tsc -p ./tsconfig.cjs.json", | ||
"bundle": "rollup -c", | ||
"build": "tsc && rollup -c", | ||
"clean": "rimraf lib/* && rimraf coverage/*", | ||
"coverage": "jest --coverage", | ||
"filesize": "npm run build && npm run build:browser", | ||
"filesize": "../../scripts/minify", | ||
"lint": "tslint -c \"../../tslint.json\" -p tsconfig.json -c ../../tslint.json src/*.ts", | ||
"minify:browser": "uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js", | ||
"postbuild": "npm run bundle", | ||
"prebuild": "npm run clean", | ||
"prepare": "npm run lint && npm run build", | ||
"prepublishOnly": "npm run clean && npm run build", | ||
"test": "jest", | ||
"prepare": "npm run build", | ||
"test": "npm run lint && jest", | ||
"watch": "tsc -w -p . & rollup -c -w" | ||
@@ -44,8 +40,8 @@ }, | ||
"@types/zen-observable": "0.8.0", | ||
"apollo-link": "^1.2.8" | ||
"apollo-link": "^1.2.9", | ||
"tslib": "^1.9.3" | ||
}, | ||
"devDependencies": { | ||
"@types/graphql": "14.0.5", | ||
"@types/graphql": "14.0.7", | ||
"@types/jest": "22.2.3", | ||
"browserify": "16.2.3", | ||
"graphql": "14.1.1", | ||
@@ -55,7 +51,6 @@ "graphql-tag": "2.10.1", | ||
"rimraf": "2.6.3", | ||
"rollup": "0.68.2", | ||
"rollup": "1.4.1", | ||
"ts-jest": "22.4.6", | ||
"tslint": "5.12.1", | ||
"tslint": "5.13.1", | ||
"typescript": "3.0.3", | ||
"uglify-js": "3.4.9", | ||
"wait-for-observables": "1.0.3" | ||
@@ -76,3 +71,3 @@ }, | ||
}, | ||
"gitHead": "6f5d0cfb73e61c6f83caed9e37d37c4451a64c7b" | ||
"gitHead": "2c960e057de9d664855bb18df4a4bd25c88bb6ef" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
199884
11
164
0
3
723
+ Addedtslib@^1.9.3
Updatedapollo-link@^1.2.9