@cardano-graphql/util
Advanced tools
Comparing version 3.1.1 to 3.2.0
import { loadQueryNode } from './queryNodeLoading'; | ||
import * as scalars from './scalars'; | ||
export * from './data_fetching'; | ||
export * from './knownEras'; | ||
export * from './stringModifiers'; | ||
declare const _default: { | ||
onFailedAttemptFor: (operation: string) => ({ attemptNumber, message, retriesLeft }: import("p-retry").FailedAttemptError) => void; | ||
onFailedAttemptFor: (operation: string, logger?: import("ts-log").Logger) => ({ attemptNumber, message, retriesLeft }: import("p-retry").FailedAttemptError) => void; | ||
loadQueryNode: typeof loadQueryNode; | ||
@@ -6,0 +9,0 @@ scalars: typeof scalars; |
@@ -21,2 +21,5 @@ "use strict"; | ||
}; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -26,2 +29,5 @@ const onFailedAttemptFor_1 = require("./onFailedAttemptFor"); | ||
const scalars = __importStar(require("./scalars")); | ||
__exportStar(require("./data_fetching"), exports); | ||
__exportStar(require("./knownEras"), exports); | ||
__exportStar(require("./stringModifiers"), exports); | ||
exports.default = { | ||
@@ -28,0 +34,0 @@ onFailedAttemptFor: onFailedAttemptFor_1.onFailedAttemptFor, |
import { FailedAttemptError } from 'p-retry'; | ||
export declare const onFailedAttemptFor: (operation: string) => ({ attemptNumber, message, retriesLeft }: FailedAttemptError) => void; | ||
import { Logger } from 'ts-log'; | ||
export declare const onFailedAttemptFor: (operation: string, logger?: Logger) => ({ attemptNumber, message, retriesLeft }: FailedAttemptError) => void; | ||
//# sourceMappingURL=onFailedAttemptFor.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.onFailedAttemptFor = void 0; | ||
exports.onFailedAttemptFor = (operation) => ({ attemptNumber, message, retriesLeft }) => { | ||
const ts_log_1 = require("ts-log"); | ||
exports.onFailedAttemptFor = (operation, logger = ts_log_1.dummyLogger) => ({ attemptNumber, message, retriesLeft }) => { | ||
const nextAction = retriesLeft > 0 ? 'retrying...' : 'exiting'; | ||
console.warn(message); | ||
console.log(`${operation}: Attempt ${attemptNumber} of ${attemptNumber + retriesLeft}, ${nextAction}`); | ||
logger.trace(message); | ||
logger.debug(`${operation}: Attempt ${attemptNumber} of ${attemptNumber + retriesLeft}, ${nextAction}`); | ||
if (retriesLeft === 0) { | ||
console.error(message); | ||
logger.error(message); | ||
process.exit(1); | ||
@@ -11,0 +12,0 @@ } |
{ | ||
"name": "@cardano-graphql/util", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "Common utilities", | ||
@@ -12,3 +12,3 @@ "main": "dist/index.js", | ||
"prepack": "yarn build", | ||
"test": "shx echo No tests in this package" | ||
"test": "yarn build && NODE_ENV=test jest -c ./test/jest.config.js" | ||
}, | ||
@@ -30,3 +30,4 @@ "repository": { | ||
"graphql-tag": "^2.10.3", | ||
"p-retry": "^4.2.0" | ||
"p-retry": "^4.2.0", | ||
"ts-log": "^2.2.3" | ||
}, | ||
@@ -33,0 +34,0 @@ "devDependencies": { |
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
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
573255
65
411
0
6
+ Addedts-log@^2.2.3
+ Addedts-log@2.2.7(transitive)