2.1.19 • Published 7 months ago

@pagali/client v2.1.19

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
7 months ago

@pagali/client

linecov stmtcov branchcov functioncov

Package containing SDKs to simplify requests to Pagali API

Usage:

/* Your Api Key and API Url */
const clientConfig = {
  accessToken: '<your_api_key>',
  url: '<api_url>',
};

const client = new PagaliClient(clientConfig);

const merchants = await client.management.merchants.get({}, { params: { 'page[number]': 1, 'page[size]': 5 } });

The client also comes with a configurable cache layer that uses Redis to store responses from GET requests. See the example below to configure and use it:

/* Your Api Key and API Url */
const clientConfig = {
  accessToken: '<your_api_key>',
  url: '<api_url>',
};

/* Your Redis Config */
const cacheConfig = {
  host: '<your_redis_host>',
  port: '<your_redis_port>',
  db: '<your_redis_db_number>',
  password: '<your_redis_password>',
  keyPrefix: '<your_custom_key_prefix>',
};

const client = new PagaliClient(clientConfig, cacheConfig);

/* Specify the ttl value (in seconds) to make use of redis for storing/retrieving the result */
const merchants = await client.management.merchants.get({}, { params: { 'page[number]': 1, 'page[size]': 5 } });
const firstMerchantId = merchants[0].id;
const merchant = await client.management.merchants.getOne(firstMerchantId, {}, { cacheTtlSeconds: 60 });

/* Close the underlying redis connection */
client.shutdown();
2.1.18

7 months ago

2.1.19

7 months ago

2.1.2

10 months ago

2.1.1

10 months ago

2.1.4

10 months ago

2.1.5

9 months ago

2.1.8

9 months ago

2.1.7

9 months ago

2.1.9

9 months ago

2.1.17

8 months ago

2.1.14

8 months ago

2.1.15

8 months ago

2.1.12

9 months ago

2.1.13

9 months ago

2.1.11

9 months ago

2.1.13-dev1.0

8 months ago

2.1.0

11 months ago

2.0.19

1 year ago

2.0.18

1 year ago

2.0.20

12 months ago

2.0.21

12 months ago

2.0.17

1 year ago

2.0.16

1 year ago

2.0.15

1 year ago

2.0.14

1 year ago

2.0.13

1 year ago

2.0.11

1 year ago

2.0.10

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago