Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@devcycle/js-cloud-server-sdk

Package Overview
Dependencies
Maintainers
6
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devcycle/js-cloud-server-sdk - npm Package Compare versions

Comparing version 1.8.0 to 1.8.1

3

lib/shared/server-request/src/request.d.ts

@@ -6,4 +6,7 @@ import { RequestInitWithRetry } from 'fetch-retry';

}
export declare const exponentialBackoff: RequestInitWithRetry['retryDelay'];
export declare function handleResponse(res: Response): Promise<Response>;
export declare function getWithTimeout(url: string, requestConfig: RequestInit | RequestInitWithRetry, timeout: number): Promise<Response>;
export declare function post(url: string, requestConfig: RequestInit | RequestInitWithRetry, sdkKey: string): Promise<Response>;
export declare function patch(url: string, requestConfig: RequestInit | RequestInitWithRetry, sdkKey: string): Promise<Response>;
export declare function get(url: string, requestConfig: RequestInit | RequestInitWithRetry): Promise<Response>;
"use strict";
// NOTE: This file is duplicated in "sdk/js/src/RequestUtils" because nx:rollup cant build non-external dependencies
// from outside the root directory https://github.com/nrwl/nx/issues/10395
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -6,3 +8,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
exports.get = exports.post = exports.getWithTimeout = exports.ResponseError = void 0;
exports.get = exports.patch = exports.post = exports.getWithTimeout = exports.handleResponse = exports.exponentialBackoff = exports.ResponseError = void 0;
const fetch_retry_1 = __importDefault(require("fetch-retry"));

@@ -21,2 +23,3 @@ class ResponseError extends Error {

};
exports.exponentialBackoff = exponentialBackoff;
const retryOnRequestError = (retries) => {

@@ -33,3 +36,3 @@ return (attempt, error, response) => {

};
const handleResponse = async (res) => {
async function handleResponse(res) {
// res.ok only checks for 200-299 status codes

@@ -49,3 +52,4 @@ if (!res.ok && res.status >= 400) {

return res;
};
}
exports.handleResponse = handleResponse;
async function getWithTimeout(url, requestConfig, timeout) {

@@ -79,2 +83,17 @@ const controller = new AbortController();

exports.post = post;
async function patch(url, requestConfig, sdkKey) {
const [_fetch, config] = await getFetchAndConfig(requestConfig);
const patchHeaders = {
...config.headers,
Authorization: sdkKey,
'Content-Type': 'application/json',
};
const res = await _fetch(url, {
...config,
headers: patchHeaders,
method: 'PATCH',
});
return handleResponse(res);
}
exports.patch = patch;
async function get(url, requestConfig) {

@@ -106,3 +125,3 @@ const [_fetch, config] = await getFetchAndConfig(requestConfig);

newConfig.retryOn = retryOnRequestError(requestConfig.retries);
newConfig.retryDelay = exponentialBackoff;
newConfig.retryDelay = exports.exponentialBackoff;
return [await getFetchWithRetry(), newConfig];

@@ -109,0 +128,0 @@ }

8

package.json
{
"name": "@devcycle/js-cloud-server-sdk",
"version": "1.8.0",
"version": "1.8.1",
"description": "The DevCycle JS Cloud Bucketing Server SDK used for feature management.",
"license": "MIT",
"dependencies": {
"@devcycle/types": "^1.9.0",
"cross-fetch": "^3.1.8",
"fetch-retry": "^5.0.3",
"@devcycle/types": "^1.9.1",
"cross-fetch": "^4.0.0",
"fetch-retry": "^5.0.6",
"lodash": "^4.17.21"

@@ -11,0 +11,0 @@ },

@@ -6,4 +6,7 @@ import { RequestInitWithRetry } from 'fetch-retry';

}
export declare const exponentialBackoff: RequestInitWithRetry['retryDelay'];
export declare function handleResponse(res: Response): Promise<Response>;
export declare function getWithTimeout(url: string, requestConfig: RequestInit | RequestInitWithRetry, timeout: number): Promise<Response>;
export declare function post(url: string, requestConfig: RequestInit | RequestInitWithRetry, sdkKey: string): Promise<Response>;
export declare function patch(url: string, requestConfig: RequestInit | RequestInitWithRetry, sdkKey: string): Promise<Response>;
export declare function get(url: string, requestConfig: RequestInit | RequestInitWithRetry): Promise<Response>;
"use strict";
// NOTE: This file is duplicated in "sdk/js/src/RequestUtils" because nx:rollup cant build non-external dependencies
// from outside the root directory https://github.com/nrwl/nx/issues/10395
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -6,3 +8,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
exports.get = exports.post = exports.getWithTimeout = exports.ResponseError = void 0;
exports.get = exports.patch = exports.post = exports.getWithTimeout = exports.handleResponse = exports.exponentialBackoff = exports.ResponseError = void 0;
const fetch_retry_1 = __importDefault(require("fetch-retry"));

@@ -21,2 +23,3 @@ class ResponseError extends Error {

};
exports.exponentialBackoff = exponentialBackoff;
const retryOnRequestError = (retries) => {

@@ -33,3 +36,3 @@ return (attempt, error, response) => {

};
const handleResponse = async (res) => {
async function handleResponse(res) {
// res.ok only checks for 200-299 status codes

@@ -49,3 +52,4 @@ if (!res.ok && res.status >= 400) {

return res;
};
}
exports.handleResponse = handleResponse;
async function getWithTimeout(url, requestConfig, timeout) {

@@ -79,2 +83,17 @@ const controller = new AbortController();

exports.post = post;
async function patch(url, requestConfig, sdkKey) {
const [_fetch, config] = await getFetchAndConfig(requestConfig);
const patchHeaders = {
...config.headers,
Authorization: sdkKey,
'Content-Type': 'application/json',
};
const res = await _fetch(url, {
...config,
headers: patchHeaders,
method: 'PATCH',
});
return handleResponse(res);
}
exports.patch = patch;
async function get(url, requestConfig) {

@@ -106,3 +125,3 @@ const [_fetch, config] = await getFetchAndConfig(requestConfig);

newConfig.retryOn = retryOnRequestError(requestConfig.retries);
newConfig.retryDelay = exponentialBackoff;
newConfig.retryDelay = exports.exponentialBackoff;
return [await getFetchWithRetry(), newConfig];

@@ -109,0 +128,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc