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

aaro

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aaro

Aaro api client

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Aaro REST API - JavaScript Library

New JavaScript library for Aaro REST API, supports CommonJS (CJS).

Requests are made with Axios library with support to promises.

GitHub issues GitHub license npm version

Installation

npm install --save aaro

Getting started

Generate API credentials (Bearer Token) following this instructions https://aaro-api.netlify.app/#authentication/ .

Check out the Aaro API endpoints and data that can be manipulated in https://aaro-api.netlify.app/.

Setup

CJS example:

const { Aaro, Token } = require('aaro');

(async () => {
    const baseUrl = 'https://erp.aaro.com.tr';

    const token = await Token(baseUrl, 'username', 'password').then(
        (rp) => rp.data.access_token
    );

    const aaro = new Aaro({
        baseUrl,
        accessToken: token,
    });

    aaro.get('Stok', {
        SayfaSatirSayisi: 100,
        StokID: '1567,1562',
    }).then((response) => console.log(response.data.Model.length));
})();

Options

OptionTypeRequiredDescription
baseUrlStringyesYour Erp URL, example: https://erp.aaro.com.tr
accessToken StringyesYour bearer token
encodingStringnoEncoding, default is 'utf-8'
timeoutIntegernoDefine the request timeout
axiosConfigObjectnoDefine the custom Axios config, also override this library options

Methods

GET

  • .get(endpoint)
  • .get(endpoint, params)
ParamsTypeDescription
endpointStringAaro API endpoint, example: Stok or Stok/StokMiktarListe
paramsObjectQuery strings params, example: { sayfa: 2, SayfaSatirSayisi:100 }

POST

  • .post(endpoint, data)
  • .post(endpoint, data, params)
ParamsTypeDescription
endpointStringAaro API endpoint, example: Stok or Depo
dataObjectJS object to be converted into JSON and sent in the request
paramsObjectQuery strings params

PUT

  • .put(endpoint, data)
  • .put(endpoint, data, params)
ParamsTypeDescription
endpointStringAaro API endpoint, example: StokVergi
dataObjectJS object to be converted into JSON and sent in the request
paramsObjectQuery strings params

DELETE

  • .delete(endpoint)
  • .delete(endpoint, params)
ParamsTypeDescription
endpointStringAaro API endpoint, example: Stok or Depo
dataObjectJS object to be converted into JSON and sent in the request

Example of use

const { Aaro, Token } = require('aaro');

(async () => {
    const baseUrl = 'https://erp.aaro.com.tr';

    const token = await Token(baseUrl, 'username', 'password').then(
        (rp) => rp.data.access_token
    );

    const aaro = new Aaro({
        baseUrl,
        accessToken: token,
    });

    aaro.get('Stok', {
        Sayfa: 1,
        SayfaSatirSayisi: 10,
        StokID: '1567,1562,8591,1531,7879,7875,6382,6384,6383,7879,6385',
    }).then((response) => console.log(response.data.Model));
})();

Changelog

See changelog for details

Keywords

FAQs

Package last updated on 26 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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