Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@sap-cloud-sdk/resilience

SAP164kApache-2.04.0.2TypeScript support: included

SAP Cloud SDK for JavaScript resilience

sap-cloud-sdk, cloud-sdk, sap-cloud-platform, middlewares, resilience

readme

SAP Cloud SDK for JavaScript Logo

build REUSE status Fosstars security rating

SAP Cloud SDK

An SDK to reduce your development effort when building side-by-side extension applications on SAP Business Technology Platform that integrate with SAP solutions and services such as SAP S/4HANA, SAP SuccessFactors, and many others.

Announcement - Upgrade Strategy

We have released version 4 of the SAP Cloud SDK for JavaScript on npm. Check out the upgrade guide for detailed instructions. The upgrade effort should be less than 1 day for an average project and should not take more than a week for larger projects.

It is recommended to upgrade to version 4 as version 3.x will not be actively maintained, with the exception of critical security vulnerabilities for up to 3 months.

Please share your ideas, suggestions or improvements in our GitHub discussion.

Looking for documentation?

Check our API documentation and getting started guide on our documentation portal.

Table of Contents

Packages

This project publishes multiple packages and is managed using turborepo.

@sap-cloud-sdk/http-client

This package contains the generic http-client functionality with built-in connectivity with executeHttpRequest(). The generic http-client adds SAP infrastructure specific functionality on top of a standard HTTP Client.

To install the SAP Cloud SDK http-client in your project, run:

$ npm install @sap-cloud-sdk/http-client

@sap-cloud-sdk/connectivity

This package contains all Cloud Foundry connectivity service related methods like getDestination() and registerDestination().

To install the SAP Cloud SDK conectivity in your project, run:

$ npm install @sap-cloud-sdk/connectivity

@sap-cloud-sdk/odata-v2

This package contains all OData version 2 specific functionality, like the request builders for create/update operations, predefined filter functions, batch. Package @sap-cloud-sdk/odata-v4 contains the same functionality for OData verison 4.

To install the SAP Cloud SDK odata-v2 in your project, run:

$ npm install @sap-cloud-sdk/odata-v2

Similarly, to install the SAP Cloud SDK odata-v4, use:

$ npm install @sap-cloud-sdk/odata-v4

@sap-cloud-sdk/generator

The SAP Cloud SDK generator is a command line interface (CLI) that allows you to create clients for your own OData services or other SAP systems besides SAP S/4HANA based on their service specifications.

To install the SAP Cloud SDK generator in your project, run:

$ npm install @sap-cloud-sdk/generator

@sap-cloud-sdk/test-util

The test-util package makes writing tests for your SAP Business Technology Platform application more convenient.

To install the SAP Cloud SDK test-util as development dependencies in your project, run:

$ npm install -D @sap-cloud-sdk/test-util

How to switch to the Open Source version of the SAP Cloud SDK

Please ignore this section, if you have never used the SAP Cloud SDK with a version < 1.18.0. If you are using an old version of the SAP Cloud SDK, you might want to read how to migrate to this Open Source version of the SAP Cloud SDK.

SAP Cloud SDK Sample Projects

We have created multiple sample projects which showcase the use of the SAP Cloud SDK for TypeScript/JavaScript in different scenarios. Each project outlines the configurations needed to execute it locally and to deploy the project to SAP Business Technology Platform.

Feedback

Feel free to leave your feedback in form of GitHub issues for bugs and feature requests. If you have broader questions, we are active on StackOverflow too.

Contribute

Want to contribute? Check out our contribution guide and follow our code of conduct.

License

This project is licensed under the terms of the Apache 2.0 license as noted in the license file.

This project depends on libraries licensed under the SAP Developer license agreement. This limits the use of those dependencies to development purposes only.

changelog

//: # (Example known issue: Making OData requests using a proxy defined in the environment variables is not possible (see improvements).) //: # (Example compatibility note: [core] Rename entityConstructor, linkedEntity, fieldName [properties](https://help.sap.com/doc/7f30fcdb8c424be9b1d4ecbfd7dd972f/1.0/en-US/classes/_sap_cloud_sdk_core.entity.html\) in generated entities to _entityConstructor, _linkedEntity, _fieldName.) //: # (Example new functionality: [generator] Support the generation of clients for services using nested complex types.) //: # (Example improvement: Allow setting the log levels of SDK loggers more conveniently through a single function [setLogLevel\(\)](https://help.sap.com/doc/7f30fcdb8c424be9b1d4ecbfd7dd972f/1.0/en-US/modules/_sap_cloud_sdk_util.html#setloglevel\).) //: # (Example fixed issue: Fix the parameter type of fromJson method so that passing a json object with illegal attributes is not allowed. For example, { bupa : '1' } cannot be passed to the method when building a BusinessPartner.) //: # (Example function removed: [generator] Remove the option: aggregatorDirectoryName) //: # (Example function moved: Move the following functions to connectivity package)

Next

Breaking Changes

Function removed

  • Function moved

Signature changed

-

Implementation changed

-

4.0.2

Fixed Issues

  • [connectivity] Remove destination cache in getDestinationFromServiceBinding() function to let cached destinations retrieved in getDestinationFromDestinationService() function be added with the proxyConfiguration property.

4.0.1

Fixed Issues

  • [eslint-config] Downgrade @stylistic/eslint-plugin to v3 as v4 is EMS-only. (97ad0ad)

4.0.0

Improvements

  • [connectivity] Enable destination caching by default when retrieving destinations via the destination service. Change affects behavior of getDestination() method, getAllDestinationsFromDestinationService() method, generated client's execute() method and generic HTTP requests execution using executeHttpRequest(). (d69325a)
  • [generator, odata-common, odata-v4] Support precision handling during serialization of Edm.DateTimeOffset fields in OData v4. (ab6ca60)

Compatibility Notes

  • [connectivity] The following deprecated content has been removed from the package:
    • The behaviour of getAgentConfig() function is changed to be asynchronous. The temporary asynchronous function getAgentConfigAsync() has been removed.
    • The destinationForServiceBinding() function has been removed. Use getDestinationFromServiceBinding() instead.
    • The PartialDestinationFetchOptions type has been removed. Use either ServiceBindingTransformOptions or getDestinationFromServiceBinding() function.
    • The serviceToken() function no longer takes xsuaaCredentials as part of the options parameter.
    • The parseDestination() function is no longer a public API.
    • The DestinationForServiceBindingOptions interface has been renamed to DestinationFromServiceBindingOptions. (7d92a1b)
  • [connectivity] Disable iasToXsuaaTokenExchange by default if not defined. (25c9dd8)
  • [odata-common] The following deprecated content has been removed from the package:
    • The FunctionImportParameters type has been removed. Use OperationParameters instead.
    • The ODataFunctionImportRequestConfig constant has been removed. Use ODataFunctionRequestConfig instead.
    • The FunctionImportParameter constant has been removed. Use OperationParameter instead.
    • The ActionFunctionImportRequestBuilderBase constant has been removed. Use OperationRequestBuilderBase instead. (7d92a1b)
  • [odata-v2] The following deprecated content has been removed from the package:
    • The ODataFunctionImportRequestConfig constant has been removed. Use ODataFunctionRequestConfig instead.
    • The FunctionImportRequestBuilder constant has been removed. Use OperationRequestBuilder instead. (7d92a1b)
  • [odata-v4] The following deprecated content has been removed from the package:
    • The ODataFunctionImportRequestConfig constant has been removed. Use ODataFunctionRequestConfig instead.
    • The ActionImportParameter class has been removed. Use OperationParameter instead.
    • The ActionImportParameters type has been removed. Use OperationParameters instead.
    • The FunctionImportRequestBuilder class has been removed. Use OperationRequestBuilder instead.
    • The BoundFunctionImportRequestBuilder class has been removed. Use OperationRequestBuilder instead.
    • The BoundActionImportRequestBuilder class has been removed. Use OperationRequestBuilder instead.
    • The ODataActionImportRequestConfig constant has been removed. Use ODataActionRequestConfig instead.
    • The ODataBoundActionImportRequestConfig class has been removed. Use ODataBoundActionRequestConfig instead.
    • The OdataBoundFunctionImportRequestConfig constant has been removed. Use ODataBoundFunctionRequestConfig instead.
    • The ActionImportRequestBuilder class has been removed. Use OperationRequestBuilder instead. (7d92a1b)
  • [resilience] The following deprecated content has been removed from the package:
    • The circuitBreakerHttp constant has been removed. Use circuitBreaker instead. (7d92a1b)
  • [util] The following deprecated content has been removed from the package:
    • The assoc constant has been removed. There is no replacement. (7d92a1b)