🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@uniformdev/context

Package Overview
Dependencies
Maintainers
8
Versions
1038
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uniformdev/context - npm Package Compare versions

Comparing version
20.72.4-alpha.13
to
20.72.4-alpha.16
+23
-2
dist/api/api.js

@@ -44,2 +44,3 @@ "use strict";

ApiClientError: () => ApiClientError,
BearerTokenNotValidOrExpiredError: () => BearerTokenNotValidOrExpiredError,
CachedAggregateClient: () => CachedAggregateClient,

@@ -60,2 +61,3 @@ CachedContextClient: () => CachedContextClient,

TestClient: () => TestClient,
UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE: () => UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE,
UncachedAggregateClient: () => UncachedAggregateClient,

@@ -83,2 +85,3 @@ UncachedContextClient: () => UncachedContextClient,

var defaultLimitPolicy = (0, import_p_limit.default)(6);
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
var ApiClientError = class _ApiClientError extends Error {

@@ -99,2 +102,8 @@ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {

};
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
}
};

@@ -135,3 +144,3 @@ // src/api/ApiClient.ts

return this.options.limitPolicy(async () => {
var _a;
var _a, _b;
const coreHeaders = this.options.apiKey ? {

@@ -172,5 +181,15 @@ "x-api-key": this.options.apiKey

}
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
throw new BearerTokenNotValidOrExpiredError(
message,
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
fetchUri.toString(),
apiResponse.status,
apiResponse.statusText,
_ApiClient.getRequestId(apiResponse)
);
}
throw new ApiClientError(
message,
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
fetchUri.toString(),

@@ -646,2 +665,3 @@ apiResponse.status,

ApiClientError,
BearerTokenNotValidOrExpiredError,
CachedAggregateClient,

@@ -662,2 +682,3 @@ CachedContextClient,

TestClient,
UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE,
UncachedAggregateClient,

@@ -664,0 +685,0 @@ UncachedContextClient,

@@ -15,2 +15,3 @@ var __defProp = Object.defineProperty;

var defaultLimitPolicy = pLimit(6);
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
var ApiClientError = class _ApiClientError extends Error {

@@ -31,2 +32,8 @@ constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {

};
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
}
};

@@ -67,3 +74,3 @@ // src/api/ApiClient.ts

return this.options.limitPolicy(async () => {
var _a;
var _a, _b;
const coreHeaders = this.options.apiKey ? {

@@ -104,5 +111,15 @@ "x-api-key": this.options.apiKey

}
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
throw new BearerTokenNotValidOrExpiredError(
message,
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
fetchUri.toString(),
apiResponse.status,
apiResponse.statusText,
_ApiClient.getRequestId(apiResponse)
);
}
throw new ApiClientError(
message,
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
fetchUri.toString(),

@@ -577,2 +594,3 @@ apiResponse.status,

ApiClientError,
BearerTokenNotValidOrExpiredError,
CachedAggregateClient,

@@ -593,2 +611,3 @@ CachedContextClient,

TestClient,
UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE,
UncachedAggregateClient,

@@ -595,0 +614,0 @@ UncachedContextClient,

+2
-2
{
"name": "@uniformdev/context",
"version": "20.72.4-alpha.13+a24dcae01b",
"version": "20.72.4-alpha.16+0254f3a82e",
"description": "Uniform Context core package",

@@ -73,3 +73,3 @@ "license": "SEE LICENSE IN LICENSE.txt",

},
"gitHead": "a24dcae01b019225974c60290cfef988f1405ea8"
"gitHead": "0254f3a82ed24bc02a26abbb3b7c453c44f0f8a8"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display