@bscotch/bravo
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -45,2 +45,3 @@ import { BravoError } from '../errors.js'; | ||
protected _requestsRemaining: number; | ||
protected _requestsLimit: number; | ||
protected _requestsMade: number; | ||
@@ -68,2 +69,3 @@ protected _limitResetsAt?: Date; | ||
remaining: number; | ||
limit: number; | ||
limitResetsAt: Date | undefined; | ||
@@ -70,0 +72,0 @@ }; |
@@ -81,2 +81,3 @@ "use strict"; | ||
this._requestsRemaining = Infinity; | ||
this._requestsLimit = Infinity; | ||
this._requestsMade = 0; | ||
@@ -112,2 +113,3 @@ this._fetch = node_fetch_1.default; | ||
remaining: this._requestsRemaining, | ||
limit: this._requestsLimit, | ||
limitResetsAt: this._limitResetsAt, | ||
@@ -147,11 +149,15 @@ }; | ||
this._backendId = res.backendId || this._backendId; | ||
this._limitResetsAt = res.limitResetsAt || this._limitResetsAt; | ||
this._requestsRemaining = | ||
typeof res.requestsRemaining == 'number' | ||
? res.requestsRemaining | ||
: this._requestsRemaining; | ||
this._limitResetsAt = res.limitResetsAt; | ||
this._requestsLimit = res.limit; | ||
this._requestsRemaining = res.requestsRemaining; | ||
if (this._requestsRemaining < 1 || res.status == 429) { | ||
// TODO: Set an interval before allowing requests to go through again, OR SOMETHING | ||
this._requestsRemaining = 0; | ||
this._logger.warn(`Favro API rate limit reached!`); | ||
this._logger.warn(`Favro API rate limit reached! ${JSON.stringify({ | ||
status: res.status, | ||
remaining: this._requestsRemaining, | ||
made: this._requestsMade, | ||
limit: res.limit, | ||
resetAt: this._limitResetsAt, | ||
}, null, 2)}`); | ||
} | ||
@@ -178,2 +184,2 @@ if (res.status > 299) { | ||
exports.FavroClient = FavroClient; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRmF2cm9DbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2NsaWVudExpYi9GYXZyb0NsaWVudC50cyJ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QUNuRCxHQUFHO2dCQUNILE1BQU07Z0JBQ04sSUFBSSxFQUFFLE1BQU0sV0FBVyxDQUFDLElBQUksRUFBRTthQUMvQixDQUFDLENBQUM7U0FDSjtRQUNELElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLE1BQU0sR0FBRyxHQUFHLEVBQUUsc0JBQXNCLEdBQUcsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQUFDO1FBQ2xFLE1BQU0sVUFBVSxHQUFHLE1BQU0sR0FBRyxDQUFDLGFBQWEsRUFBRSxDQUFDO1FBQzdDLElBQ0UsVUFBVTtZQUNWLE9BQU8sVUFBVSxJQUFJLFFBQVE7WUFDN0IsU0FBUyxJQUFJLFVBQVUsRUFDdkI7WUFDQSxtQkFBbUI7WUFDbkIsTUFBTSxPQUFPLEdBQUcsVUFBVSxDQUFDLE9BQU8sQ0FBQztZQUNuQyxNQUFNLElBQUksc0JBQVUsQ0FDbEIsb0NBQW9DLEdBQUcsQ0FBQyxNQUFNLHlCQUF5QixPQUFPLElBQUksQ0FDbkYsQ0FBQztTQUNIO1FBQ0QsT0FBTyxHQUFHLENBQUM7SUFDYixDQUFDO0NBQ0Y7QUFsS0Qsa0NBa0tDIn0= |
@@ -20,2 +20,3 @@ import type { Response } from 'node-fetch'; | ||
get limitResetsAt(): Date; | ||
get limit(): number; | ||
get backendId(): string | undefined; | ||
@@ -22,0 +23,0 @@ getParsedBody(): Promise<Data | null>; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const errors_js_1 = require("../errors.js"); | ||
const utility_js_1 = require("../utility.js"); | ||
function dataIsNull(data) { | ||
@@ -37,7 +38,19 @@ return data === null; | ||
get requestsRemaining() { | ||
return Number(this._response.headers.get('X-RateLimit-Remaining')); | ||
return (0, utility_js_1.stringToNumber)(this._response.headers.get('X-RateLimit-Remaining'), { | ||
defaultIfNullish: Infinity, | ||
customError: this._client.error, | ||
}); | ||
} | ||
get limitResetsAt() { | ||
return new Date(this._response.headers.get('X-RateLimit-Reset')); | ||
return (0, utility_js_1.stringToDate)(this._response.headers.get('X-RateLimit-Limit'), { | ||
defaultIfNullish: new Date(), | ||
customError: this._client.error, | ||
}); | ||
} | ||
get limit() { | ||
return (0, utility_js_1.stringToNumber)(this._response.headers.get('X-RateLimit-Limit'), { | ||
defaultIfNullish: Infinity, | ||
customError: this._client.error, | ||
}); | ||
} | ||
get backendId() { | ||
@@ -103,2 +116,2 @@ return (this._response.headers.get('X-Favro-Backend-Identifier') || undefined); | ||
exports.FavroResponse = FavroResponse; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRmF2cm9SZXNwb25zZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvY2xpZW50TGliL0ZhdnJvUmVzcG9uc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsNkJBQTBCO0FBRTFCLDRDQUEwQztBQUcxQyxTQUFTLFVBQVUsQ0FBQyxJQUFTO0lBQzNCLE9BQU8sSUFBSSxLQUFLLElBQUksQ0FBQztBQUN2QixDQUFDO0FBRUQsU0FBUyxpQkFBaUIsQ0FDeEIsSUFBUztJQUVULE9BQU8sQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksS0FBSyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNsRCxDQUFDO0FBRUQsU0FBUyxpQkFBaUIsQ0FDeEIsSUFBUztJQUVULE9BQU8sQ0FDTCxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUM7UUFDakIsQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLENBQUM7UUFDeEIsTUFBTSxJQUFJLElBQUk7UUFDZCxVQUFVLElBQUksSUFBSSxDQUNuQixDQUFDO0FBQ0osQ0FBQztBQUVELE1BQWEsYUFBYTtJQVd4QixZQUFzQixPQUFlLEVBQVksU0FBbUI7UUF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0FDMUIsQ0FBQyxDQUFDO1FBQ0gsT0FBTyxHQUFHLENBQUM7SUFDYixDQUFDO0lBRUQsS0FBSyxDQUFDLGVBQWU7UUFDbkIsTUFBTSxJQUFJLEdBQUcsTUFBTSxJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7UUFDeEMsSUFBSSxDQUFDLElBQUksRUFBRTtZQUNULE9BQU8sRUFBRSxDQUFDO1NBQ1g7UUFDRCxJQUFJLGlCQUFpQixDQUFDLElBQUksQ0FBQyxFQUFFO1lBQzNCLE9BQU8sQ0FBQyxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQztTQUMzQjtRQUNELE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNoQixDQUFDO0NBQ0Y7QUFuSEQsc0NBbUhDIn0= |
/// <reference types="node" /> | ||
import type { ArrayMatchFunction } from '../types/Utility.js'; | ||
import type { ArrayMatchFunction, Nullable } from '../types/Utility.js'; | ||
import { BravoError } from './errors.js'; | ||
export declare function stringsMatchIgnoringCase(string1: string, string2: string): boolean; | ||
@@ -62,3 +63,17 @@ export declare function stringsMatch(string1: string, string2: string, options?: { | ||
export declare function isNullish(value: any): value is null | undefined; | ||
export declare function isNumber(value: any): value is number; | ||
export declare function isTruthyString(value: any): value is string; | ||
export declare function stringToDate(dateString: Nullable<string>, options?: { | ||
defaultIfNullish?: Date; | ||
customError?: typeof BravoError; | ||
}): Date; | ||
/** | ||
* Convert a numeric string to a number. If the string argument is | ||
* nullish, throw an error unless `defaultIfNullish` is provided. | ||
*/ | ||
export declare function stringToNumber(string: Nullable<string>, options?: { | ||
defaultIfNullish?: number; | ||
customError?: typeof BravoError; | ||
}): number; | ||
export {}; | ||
//# sourceMappingURL=utility.d.ts.map |
@@ -13,3 +13,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isNullish = exports.generateRandomString = exports.generateRandomBytes = exports.stringsOrObjectsToStrings = exports.stringOrObjectToString = exports.createIsMatchFilter = exports.isMatch = exports.wrapIfNotArray = exports.removeFromArray = exports.ensureArrayExistsAndAddUniqueBy = exports.ensureArrayExistsAndAddUnique = exports.addToUniqueArrayBy = exports.addToUniqueArray = exports.selectRandom = exports.toBase64 = exports.findRequiredByField = exports.findByField = exports.find = exports.stringsMatch = exports.stringsMatchIgnoringCase = void 0; | ||
exports.stringToNumber = exports.stringToDate = exports.isTruthyString = exports.isNumber = exports.isNullish = exports.generateRandomString = exports.generateRandomBytes = exports.stringsOrObjectsToStrings = exports.stringOrObjectToString = exports.createIsMatchFilter = exports.isMatch = exports.wrapIfNotArray = exports.removeFromArray = exports.ensureArrayExistsAndAddUniqueBy = exports.ensureArrayExistsAndAddUnique = exports.addToUniqueArrayBy = exports.addToUniqueArray = exports.selectRandom = exports.toBase64 = exports.findRequiredByField = exports.findByField = exports.find = exports.stringsMatch = exports.stringsMatchIgnoringCase = void 0; | ||
const errors_js_1 = require("./errors.js"); | ||
@@ -215,2 +215,41 @@ const crypto_1 = __importDefault(require("crypto")); | ||
exports.isNullish = isNullish; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbGl0eS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvdXRpbGl0eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQ0EsMkNBQTJEO0FBQzNELG9EQUE0QjtBQUU1QixTQUFnQix3QkFBd0IsQ0FBQyxPQUFlLEVBQUUsT0FBZTtJQUN2RSxLQUFLLE1BQU0sR0FBRyxJQUFJLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxFQUFFO1FBQ3BDLElBQUEsNEJBQWdCLEVBQUMsT0FBTyxHQUFHLElBQUksUUFBUSxFQUFFLDRCQUE0QixDQUFDLENBQUM7S0FDeEU7SUFDRCxPQUFPLENBQ0wsT0FBTyxDQUFDLGlCQUFp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R0FBRyxFQUFFLENBQUM7UUFDMUIsS0FBSyxNQUFNLElBQUksSUFBSSxTQUFTLEVBQUU7WUFDNUIsTUFBTSxhQUFhLEdBQ2pCLENBQUMsSUFBSSxHQUFHLENBQUMsZ0JBQWdCLEdBQUcsZ0JBQWdCLENBQUMsQ0FBQyxHQUFHLGdCQUFnQixDQUFDO1lBQ3BFLGNBQWMsQ0FBQyxJQUFJLENBQUMsYUFBYSxDQUFDLENBQUM7U0FDcEM7UUFDRCxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0tBQ3REO1NBQU07UUFDTCxNQUFNLElBQUksc0JBQVUsQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO0tBQzlDO0FBQ0gsQ0FBQztBQXRCRCxvREFzQkM7QUFFRCxTQUFnQixTQUFTLENBQUMsS0FBVTtJQUNsQyxPQUFPLEtBQUssS0FBSyxJQUFJLElBQUksS0FBSyxLQUFLLFNBQVMsQ0FBQztBQUMvQyxDQUFDO0FBRkQsOEJBRUMifQ== | ||
function isNumber(value) { | ||
return typeof value === 'number'; | ||
} | ||
exports.isNumber = isNumber; | ||
function isTruthyString(value) { | ||
return typeof value === 'string' && value.length > 0; | ||
} | ||
exports.isTruthyString = isTruthyString; | ||
function stringToDate(dateString, options) { | ||
if (isTruthyString(dateString)) { | ||
const date = new Date(dateString); | ||
if (isNaN(date.getTime())) { | ||
throw new ((options === null || options === void 0 ? void 0 : options.customError) || errors_js_1.BravoError)(`Cannot convert ${dateString} to a date`); | ||
} | ||
return date; | ||
} | ||
if (options === null || options === void 0 ? void 0 : options.defaultIfNullish) { | ||
return options === null || options === void 0 ? void 0 : options.defaultIfNullish; | ||
} | ||
throw new ((options === null || options === void 0 ? void 0 : options.customError) || errors_js_1.BravoError)(`Cannot convert ${dateString} to a date`); | ||
} | ||
exports.stringToDate = stringToDate; | ||
/** | ||
* Convert a numeric string to a number. If the string argument is | ||
* nullish, throw an error unless `defaultIfNullish` is provided. | ||
*/ | ||
function stringToNumber(string, options) { | ||
if (isTruthyString(string)) { | ||
if (isNaN(Number(string))) { | ||
throw new ((options === null || options === void 0 ? void 0 : options.customError) || errors_js_1.BravoError)('String is not a number'); | ||
} | ||
return +string; | ||
} | ||
if ((options === null || options === void 0 ? void 0 : options.defaultIfNullish) !== undefined) { | ||
return options === null || options === void 0 ? void 0 : options.defaultIfNullish; | ||
} | ||
throw new ((options === null || options === void 0 ? void 0 : options.customError) || errors_js_1.BravoError)(`Cannot convert ${string} to a number`); | ||
} | ||
exports.stringToNumber = stringToNumber; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbGl0eS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvdXRpbGl0eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQ0EsMkNBQTJEO0FBQzNELG9EQUE0QjtBQUU1QixTQUFnQix3QkFBd0IsQ0FBQyxPQUFlLEVBQUUsT0FBZTtJQUN2RSxLQUFLLE1BQU0sR0FBRyxJQUFJLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxFQUFFO1FBQ3BDLElBQUEsNEJBQWdCLEVBQUMsT0FBTyxHQUFHLElBQUksUUFBUSxFQUFFLDRCQUE0QixDQUFDLENBQUM7S0FDeEU7SUFDRCxPQUFPLENBQ0wsT0FBTyxDQUFDLGlCQUFpQixFQUFFLENBQUMsSUFBSSxFQUFFLElBQUksT0FBTyxDQUFDLGlCQUFpQixFQUFFLENBQUMsSUFBSSxFQUFFLENBQ3pFLENBQUM7QUFDSixDQUFDO0FBUEQsNERBT0M7QUFFRCxTQUFnQixZQUFZLENBQzFCLE9BQWUsRUFDZixPQUFlLEVBQ2YsT0FBa0M7SUFFbEMsSUFBSSxPQUFPLGFBQVAsT0FBT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BQUM7QUFoQkQsd0NBZ0JDIn0= |
@@ -21,2 +21,3 @@ export declare type ArrayMatchFunction<T> = (item: T, idx?: number, allItems?: T[]) => any | Promise<any>; | ||
export declare type Nullish = null | undefined; | ||
export declare type Nullable<T> = T | Nullish; | ||
export declare type NotNullish<T> = Exclude<T, Nullish>; | ||
@@ -23,0 +24,0 @@ export declare type NotNull<T> = Exclude<T, null>; |
@@ -0,1 +1,10 @@ | ||
## [2.1.1](https://github.com/bscotch/favro-sdk/compare/v2.1.0...v2.1.1) (2021-10-05) | ||
### Features | ||
* Improve handling of rate limit monitoring, since it doesn't ([bc72c29](https://github.com/bscotch/favro-sdk/commit/bc72c29f59415ebd4435e98a58788ce303948614)) | ||
# [2.1.0](https://github.com/bscotch/favro-sdk/compare/v2.0.2...v2.1.0) (2021-10-04) | ||
@@ -2,0 +11,0 @@ |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"engines": { | ||
@@ -18,0 +18,0 @@ "node": ">=14" |
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
418507
5177