Socket
Socket
Sign inDemoInstall

atomicassets

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atomicassets - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

build/Errors/ApiError.d.ts

2

build/API/Explorer/index.d.ts
import ExplorerActionGenerator from '../../Actions/Explorer';
import { ApiAsset, ApiCollection, ApiConfig, ApiLog, ApiOffer, ApiSchema, ApiSchemaStats, ApiTemplate, ApiTemplateStats, ApiTransfer } from './types';
import { ApiAsset, ApiCollection, ApiConfig, ApiLog, ApiOffer, ApiSchema, ApiSchemaStats, ApiTemplate, ApiTemplateStats, ApiTransfer } from './Types';
declare type Fetch = (input?: Request | string, init?: RequestInit) => Promise<Response>;

@@ -4,0 +4,0 @@ declare type ApiArgs = {

@@ -7,3 +7,3 @@ "use strict";

const Explorer_1 = __importDefault(require("../../Actions/Explorer"));
const ExplorerError_1 = __importDefault(require("../../Errors/ExplorerError"));
const ApiError_1 = __importDefault(require("../../Errors/ApiError"));
class ExplorerApi {

@@ -87,22 +87,18 @@ constructor(endpoint, namespace, args) {

let response;
let json = null;
const f = this.fetchBuiltin;
const queryString = Object.keys(args).map((key) => {
return key + '=' + encodeURIComponent(args[key]);
}).join('&');
try {
const f = this.fetchBuiltin;
const queryString = Object.keys(args).map((key) => {
return key + '=' + encodeURIComponent(args[key]);
}).join('&');
response = await f(this.endpoint + '/' + this.namespace + path + (queryString.length > 0 ? '?' + queryString : ''));
if (response.status === 200) {
json = await response.json();
}
}
catch (e) {
e.isFetchError = true;
throw e;
throw new ApiError_1.default(e.message, 500);
}
if (json === null) {
throw new Error('Invalid status code received');
const json = await response.json();
if (response.status !== 200) {
throw new ApiError_1.default(json.message, response.status);
}
if (!json.success) {
throw new ExplorerError_1.default(json.message);
throw new ApiError_1.default(json.message, response.status);
}

@@ -109,0 +105,0 @@ return json.data;

@@ -12,3 +12,3 @@ {

"license": "MIT",
"version": "0.9.0",
"version": "0.9.1",
"main": "build/index.js",

@@ -20,2 +20,3 @@ "types": "build/index.d.ts",

"build:web": "webpack --config webpack.prod.js",
"build": "yarn run build:npm && yarn run build:web",
"lint": "tslint -p tsconfig.json",

@@ -22,0 +23,0 @@ "test": "mocha -r ts-node/register test/**/*.test.ts"

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