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

rest-client-sdk

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-client-sdk - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

28

dist/client/AbstractClient.js

@@ -19,3 +19,3 @@ Object.defineProperty(exports,"__esModule",{value:true});var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _urijs=require('urijs');var _urijs2=_interopRequireDefault(_urijs);

{
{var pathParameters=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];
throw new Error('AbstractClient::getPathBase can not be called directly.\n You must implement "getPathBase" method.');}},{key:'getName',value:function getName()

@@ -30,4 +30,4 @@

id){var queryParam=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];
var url=this._generateUrlFromParams(queryParam,id);
id){var queryParam=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];var pathParameters=arguments.length<=2||arguments[2]===undefined?{}:arguments[2];
var url=this._generateUrlFromParams(queryParam,pathParameters,id);

@@ -37,4 +37,4 @@ return this.createEntityFromJsonResponse(this.authorizedFetch(url),'item');}},{key:'findBy',value:function findBy(

criteria){
var url=this._generateUrlFromParams(criteria);
criteria){var pathParameters=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];
var url=this._generateUrlFromParams(criteria,pathParameters);

@@ -44,8 +44,8 @@ return this.createEntityFromJsonResponse(this.authorizedFetch(url),'list');}},{key:'findAll',value:function findAll()

{
return this.findBy({});}},{key:'create',value:function create(
{var pathParameters=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];
return this.findBy({},pathParameters);}},{key:'create',value:function create(
entity){
var url=this.getPathBase();
entity){var pathParameters=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];
var url=this.getPathBase(pathParameters);

@@ -100,2 +100,8 @@ return this.createEntityFromJsonResponse(

if(this.sdk.config.prefix){
var segments=url.segment();
segments.unshift(this.sdk.config.prefix);
url.segment(segments);}
return url;}},{key:'authorizedFetch',value:function authorizedFetch(

@@ -110,3 +116,3 @@

queryParam){var id=arguments.length<=1||arguments[1]===undefined?null:arguments[1];
queryParam){var pathParameters=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];var id=arguments.length<=2||arguments[2]===undefined?null:arguments[2];
var params=queryParam;

@@ -117,3 +123,3 @@ if(this.sdk.config.useDefaultParameters){

var url=new _urijs2.default(!!id?this.getPathBase()+'/'+id:this.getPathBase());
var url=new _urijs2.default(!!id?this.getPathBase(pathParameters)+'/'+id:this.getPathBase(pathParameters));
if(params){

@@ -120,0 +126,0 @@ url.addSearch(params);}

{
"name": "rest-client-sdk",
"version": "0.3.0",
"version": "0.4.0",
"description": "Rest Client SDK for API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -53,2 +53,4 @@ Mapado Rest Client JS SDK [![Build Status](https://travis-ci.org/mapado/rest-client-js-sdk.svg?branch=master)](https://travis-ci.org/mapado/rest-client-js-sdk)

port: 443,
segment: '/my-api',
useDefaultParameters: true,
}; // path and scheme are mandatory

@@ -55,0 +57,0 @@

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