JSPM

  • Created
  • Published
  • Downloads 952
  • Score
    100M100P100Q111980F
  • License Apache-2.0

Common component, that provides scheme proxy caching mapping (ISPC)

Package Exports

  • @mojaloop/inter-scheme-proxy-cache-lib
  • @mojaloop/inter-scheme-proxy-cache-lib/dist/index.js
  • @mojaloop/inter-scheme-proxy-cache-lib/dist/index.mjs
  • @mojaloop/inter-scheme-proxy-cache-lib/dist/lib/storages/RedisProxyCache
  • @mojaloop/inter-scheme-proxy-cache-lib/dist/lib/storages/RedisProxyCache.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mojaloop/inter-scheme-proxy-cache-lib) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@mojaloop/inter-scheme-proxy-cache-lib

inter-scheme-proxy-cache-lib is a common component that provides proxy caching mapping. It helps reliably integrate proxy functionality throughout the all involved services.

Use cases:

  • Proxy caching. (see details)
  • Failure count cache with max failure count per {Id}. (see details)

Quick Start

Installation

npm install @mojaloop/inter-scheme-proxy-cache-lib

Basic Usage

// ESM
import { createProxyCache, STORAGE_TYPES } from '@mojaloop/inter-scheme-proxy-cache-lib';
// CJS
const { createProxyCache } = require('@mojaloop/inter-scheme-proxy-cache-lib');

const proxyCache = createProxyCache(STORAGE_TYPES.redis, { 
  clster: [
    { host: 'localhost', port: 6379 },
  ],
  ...
});
await proxyCache.connect();
await proxyCache.addDfspIdToProxyMapping('dfsp_1', 'proxyAB');

API docs

Check IProxyCache interface docs to get more details.

Comprehensive and interactive API documentation, based on TypeScript source code of the package, could be found here

Environment Variables

Env Variable Name Default Value Description
PROXY_CACHE_LOG_LEVEL warn The log level for the proxyCache
PROXY_CACHE_DEFAULT_TTL_SEC 30 Default cache TTL for sendToProxiesList keys

Development

Build

Command to transpile Typescript into JS:

npm run build

Tests

npm test

Generate Typedoc documentation

npm run docs

Collaborators