Introduce new module @sap/cloud-sdk-analytics to provide insights into the SDK usage for further improving the SDK in the future.
To review what data is collected and enable analytics, you need to opt-in as described here.
No data about your projects will be collected as long as you don't opt-in. We never collect personal data.
Due to a change of the naming strategy for entity classes in the OData client generator, entities that were previously named using the pattern EntityType_<number> might now have a different name when regenerated.
Due to the introduction of an SDK-specific logger, the format of log messages created by the SAP Cloud SDK has changed.
Install the CLI via npm (npm install @sap-cloud-sdk/cli).
For more information on how to use the CLI, take a look at the Readme or call sap-cloud-sdk --help after installing.
The CLI is available as open source under Apache License 2.0 from the github.com repository. Contributions are welcome.
Add an SDK-specific logger based on winston that produces filterable logs in Kibana / on SAP Cloud Platform as well as better formatted logs locally. It is consistently used within the SDK and can be used for application code as well.
Support the handling of destinations with OAuth2SAMLBearerAssertion authentication type that include a property SystemUser. The system user will be used instead of the currently logged in user to retrieve an access token to the destination. That is, no principal propagation takes place. As a consequence, no user JWT is required.
Include URL of requested service in error messages of failed OData requests.
Use correct type DestinationOptions in execute method of OData VDM request builders. The type used previously was overly restrictive, which prevented passing of valid objects like a selectionStrategy, even though the code actually handles it.
Improve error handling and console output for the systems and credentials defined for local testing in the systems.json and credentials.json files, respectively.
Please note that we have not released a new version 1.11.2 of the OData client generator (module @sap/cloud-sdk-generator) due to technical reasons. 1.10.0 remains the current version of the generator. As a consequence, the new features of the OData client mentioned below (batch and CSN files) are not yet available for custom OData clients generated by the generator.
In preparation for an upcoming change to the way how the XSUAA service supplies verification keys to applications, the SAP Cloud SDK from version 1.11.2 onwards retrieves the key from the XSUAA service instead of relying on a verification key present in the XSUAA service binding credentials.
Previous versions of the SDK only recognized an access token in the authorization header if "Bearer" was spelled in title case. Now, retrieveJwt does a case insensitive check for "bearer". That means, "bearer" and "Bearer" are now equally supported as correct authorization header.
OData client: Support OData batch requests for batch processing that allows grouping several operations into one single request, resulting in better performance.
Support create, update and delete requests as part of change sets within a batch request that group a set of write operations into a transaction.
Use the new method changeset that each module for a OData service exposes (see example for business partner service) to construct a change set. Pass prepared create, update, and delete request builders as parameters to the method (instead of executing them). Then, pass the constructed change set to the batch method.
Execute the batch request like any other request builder using the method execute, which returns a promise of a list of BatchResponse.
BatchResponse is a union type, representing the response of an indiviual retrieve request or change set that was passed to the batch request. Use isSuccess to verify that the retrieve request or change set was successful. Then, use a type assertion like response as ReadResponse based on your knowledge of the expected response to further work with the response.
The CSN files are available from the corresponding folder in node_modules after npm-installing an SDK module.
Validate user access tokens issued by XSUAA with the verification key retrieved from the XSUAA service (online verification), instead of relying on a verification key present in the XSUAA service binding credentials (offline verification). The retrieved key is cached for 15 minutes (depending on feedback, the cache duration may change in the future. If you use the SDK's verifyJwt method, no action is required.
OData client: Improve the fromJson method of entity builders to properly parse a JSON in the notation used elsewhere in the SDK, with links and attributes in camel-case.
OData client: Fix compilation issues when using any entity builder and "strictNullChecks": true is set in the tsconfig.json file of the project.
Support destinations with authentication type ClientCertificateAuthentication.
Provide the option to update OData entities using PUT instead of PATCH (which is used by default) via the replaceWholeEntityWithPut method.
Support response format used by SAP Cloud for Customer for retrieving a single OData entity by key (in GetByKeyRequestBuilder).
Add an option to ignore version identifiers as part of delete requests by using the ignoreVersionIdentifier method.
Support "Location ID" property of Cloud Connector in on-premise destinations. This previously caused the connection to fail if a Location ID was expected by the Cloud Connector.
Fix an issue with the OData client where it failed if the x-csrf-token header was ignored by the destination. Now, a warning will be logged instead and the execution continues to enable compatibility with more systems.
Fix an issue with the OData client where it failed because a set-cookie header was expected but not returned by a destination. Now, a warning will be logged instead and the execution continues to enable compatibility with more systems.
Fix an issue where TypeScript code generated with the OData client generator (@sap/cloud-sdk-generator) did not compile when "strict": true is set in the project's tsconfig.json.
We have increased the timeout of circuit breakers used to retrieved access tokens and destinations from 3 to 10 seconds.
As part of the update of the OData VDM to SAP S/4HANA Cloud 1908, the package @sap/cloud-sdk-vdm-outbound-delivery-service has been removed from the SAP API Business Hub and, as a consequence, from the SDK. Use @sap/cloud-sdk-vdm-outbound-delivery-v2-service instead.
When executing an OData request with implicit resolution of destinations, or when using useOrFetchDestination or getDestination explicitly, service bindings represented as destinations now take precedence over querying the destination service. If you have a service binding with the same name as a destination configured in the SAP Cloud Platform cockpit, this will lead to different behavior in your application, because of the newly introduced support for service bindings. Therefore we recommend using unique names across destinations and service bindings.
Deprecate the misnamed interface HttpReponse. Use HttpResponse instead.
Support accessing destinations provided as service bindings by SAP Cloud Platform Extension Factory.
Previously existing functions to create instances of complex types from JSON such as createTimeSheetDataFields have been deprecated in favor of explicit builder functions available from separate namespaces such as TimeSheetDataFields.build.
Build and execute generic HTTP requests against a given destination, taking care of interacting with the destination service and any authentication flow.
Call executeHttpRequest with a destination and the HTTP request to simply send an HTTP request using axios as HTTP request library.
If you need more control, you can use buildHttpRequest to create an object with the minimal configuration for an HTTP request after resolving the destination and applying authentication. The returned object can be used as basis for an Axios request, or inspected manually.
Provide convenience function retrieveJwt to read authentication tokens in JWT format from a request.
Provide convenience function verifyJwt to verify a JWT while decoding it.
Automatically apply the circuit breaker design pattern to provide resilience out-of-the-box while calling remote services such as destination and XSUAA service. You can disable this by passing ResilienceOptions when executing an OData request or when fetching the destination.
OData client: Provide direct access to methods serializeEntity and deserializeEntity for (de)serializing an OData entity according to the OData v2 standard.
OData client generator: Fix name clashes between names of function imports and complex types instances builders. To create a complex type instance from JSON, use the separately provided build function, such as TimeSheetDataFields.build.
Add missing types for the http-proxy-agent dependency.
Transparently support destinations with authentication typeOAuth2ClientCredentials on SAP Cloud Platform Cloud Foundry. The SDK will automatically apply the client credentials flow for such destinations.
The dependency of the new module @sap/cloud-sdk-generator to fast-xml-parser
is not properly defined, leading to errors such as Cannot find module 'fast-xml-parser' when
calling the generator.
This has been fixed in version 1.4.2.
This allows generating a client library for custom OData services that simplifies accessing OData
for SAP S/4HANA Cloud OData services.
After installing the package @sap/cloud-sdk-generator, use the command
For example, npx generate-odata-client --help will print the usage instructions and available
Fix an issue where destinations with protocol HTTP led to an error like Protocol "http:" not
supported. Expected "https:".
Fix an issue where deserialization of certain entities failed due to cyclic dependencies across linked
entities that caused entities to be undefined.
Fix how HTTPAgent is imported to ensure module interoperability.
OData VDM: Support custom fields of OData entities. Custom fields are properties that are not part
of the standard API but added, for example, via in-app extensions in SAP S/4HANA.
Deserialize custom fields when retrieved via an OData service request and serialize custom fields on
create and update requests.
Offer methods getCustomField for retrieving and setCustomField for setting a
specific custom field on an entity, as well as getCustomFields for retrieving all custom
fields and hasCustomField for checking if a custom field exists.
OData VDM: Provide a static representation (for example, BusinessPartner.ALL_FIELDS)
on each entity type for all fields of that entity. This representation can used in select query options to
retrieve all fields when also expanding navigation properties.
OData VDM: fix an issue where OData properties of type Edm.DateTime were not
serialized or deserialized correctly. Now, timezone offsets are correctly taken into account.
OData VDM: fix an issue when expanding navigation properties where selecting all fields of
associated entities (without specifying specific fields to select) did not work.
The SAP S/4HANA Cloud SDK has been renamed to
SAP Cloud SDK. For now, technical artifact names on source code level remain unchanged. You do not
need to change your source code or dependencies.
Connect to SAP S/4HANA on-premise via the Cloud Connector and SAP Cloud Platform connectivity service.
No code change is necessary to use this feature. On-premise connections are handled transparently by the
SAP Cloud SDK where configured.
The SDK will proxy requests to destinations with proxy type OnPremise through the cloud
connector if an instance of the connectivity service is bound to the application. Only the necessary setup
is required as described in the documentation
for on-premise connectivity.