How agorapay/node-sdk works
Project type and purpose
• This is an open-source Node.js SDK (client library) for interacting with the CAPSPayment REST API.
• Its goal is to provide a strongly-typed TypeScript interface (and compiled JavaScript) so that downstream applications can easily call CAPSPayment services (Payin, Payout, Transfer, Operation, AccountHolder, etc.).
File structure
• Top-level:
• src/ – all TypeScript source, organized per API module (e.g., src/PayinApi, src/TransferApi, src/models, src/utils)
• lib/ – compiled JS + declaration files, mirroring src/ structure
• index.ts – SDK entry point (“CAPSPaymentAPI” class)
• tsconfig.json, ESLint/Prettier configs, package.json – build, lint, publish config
• Patterns:
• Modular API clients: each directory under src/*Api exports a class with methods for that endpoint group
• Shared models under src/models
• Shared HTTP transport & helpers under src/utils (apiRest, enums, Utils)
README for additional insights
• The README shows instantiation of CAPSPaymentAPI with credentials and URLs, then retrieving module clients (e.g., operationApi = capsPaymentApi.operationApi()).
• It lists out each endpoint, SDK function, and HTTP method, confirming that each module class wraps one or more REST endpoints.