-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Remote Service Integration for SAP CAP Applications (Node.js)
esi-cap is an API package for Enterprise System Integration based on SAP CAP (SAP Cloud Application Programming Model). It streamlines communication with remote systems and provides native support for service associations, requiring minimal configuration to achieve out-of-the-box connectivity.
Explore our sample application for a practical implementation of this package. It demonstrates integration patterns, service bindings, and setup essentials.
The package is available on npm and can be installed as follows:
npm install esi-cap@latestThe package is organized into two primary modules:
esiModule: Contains the core integration logic and foundational functions for system communication.utilsModule: Provides a suite of generic utility functions to support common development tasks.
Contains the core integration logic and foundational functions for system communication. Its core capabilities are outlined below:
| Feature | Module Name | Description |
|---|---|---|
| Remote Communication | connect |
Streamlined protocols for connecting to external APIs. Simplifies connectivity with minimal configuration. It supports API of soap, odata v4/v2, rest, iflow-https. |
| Service Implementation | impl |
Native support for remote service associations. Reduces boilerplate code for complex data models. |
| Enriched Logging | log |
Pre-configured patterns for SAP environment logging. Accelerates development using CAP best practices. |
| Core Functions |
service, query
|
Foundational functions for system-to-system messaging. Ensures consistent data handling across the enterprise. |
Provides a suite of generic utility functions to support common development tasks. Refer to the utils for more details.
const { cds } = require('@sap/cds');
const { esi, utils } = require('esi-cap');
// impl usage
const srvImpl = cds.service.impl(esi.impl.RemoteService);
// connect usage
const srv = esi.connect.to('<ServiceName>');
srv.run(SELECT.from('<EntityName').where('<Where Clause').columns('<Columns list'));
// log usage
const logger = esi.log('<LoggerName>');
const data = { a: 1, b: "Hello" };
logger.warn(esi.service.events.PreOn, req, "data", data); // [2026-01-01T12:32:20.197Z] [WARN] [<LoggerName>] [PreOn:READ:<Name of Service>.<Name of Entity>] - data | { a: 1, b: "Hello" }
// utils usage
const valid = await utils.date.isValid("2026-04-20");
const items = [{ id: 1, name: "A" }, { id: 2, name: "B" }];
const grouped = utils.array.toGroupByPropertyName(items, "name");
const merged = utils.json.merge({ a: 1 }, { b: 2 }); // { a: 1, b: 2 }We welcome your feedback, feature requests, and bug reports!
Submit an issue via our GitHub Issues Tracker. Community feedback are appreciated and help shape the project’s evolution.
This package is provided under the terms of the SAP-Code-World Usage License Agreement.
© 2025 SAP-Code-World. All rights reserved.