0.3.0 • Published 3 years ago

@tunadao1/service v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Service

GITHUB-BADGE codecov codecov codecov

Getting Started

1. Install Service

npm i @tunadao1/service --save

2. Import

ES6

import service from '@tunadao1/service';

CommonJS

const service = require('@tunadao1/service').default;

Using

Create a service instance

Service expects to receive 3 parameters:

NameTypeObs
tokenstring
contractNumberstring
environmentstringDEV, HOMOLOG, PROD

Example:

import service from '@tunadao1/service';

service({
	token:  '49eaf9775c959416',
	contractNumber:  '003349338695',
	environment:  'HOMOLOG'
})

Access the modules

After creating an instance of service it is possible to access the modules, which are named by the name of each responsible squad or global in the case of global modules.

Example:

import service from '@tunadao1/service';

service({
	token:  '49eaf9775c959416',
	contractNumber:  '003349338695',
	environment:  'HOMOLOG'
}).Home // Home, Technician, Financial, Global

Access the sub modules

After accessing a module, you will have access to its submodules, which are features of a functionality.

Example:

import service from '@tunadao1/service';

// ...
const response = await service({
	token:  '49eaf9775c959416',
	contractNumber:  '003349338695',
	environment:  'HOMOLOG'
}).Home.Netflix.getEligibility();

Service uses Axios under the hood, then returns an AxiosPromise.

Modules

0.3.0

3 years ago

0.2.3

3 years ago

0.2.0

3 years ago

0.0.1

3 years ago