Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
jjtang1985 authored Jan 8, 2025
2 parents e168dbf + 43c3c0a commit 5cc3f3e
Show file tree
Hide file tree
Showing 2,693 changed files with 30,026 additions and 8,700 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ module.exports = {
rules: {
'react/prop-types': 'off'
},
ignorePatterns: ['build/**', 'node_modules/**']
ignorePatterns: ['build/**', 'node_modules/**', 'static/**']
};
2 changes: 0 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## What Has Changed?

Explain what you are changing and why, if it isn't obvious from the diff.

**If you are working on the Java v4 docs, remember to also apply the changes to v5**
2 changes: 1 addition & 1 deletion docs-java/features/multi-tenancy/thread-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ By contrast, to pass on the current context, but modifying the tenant (and only

```java
Tenant myTenant = new DefaultTenant("foo");
Callable myTaskWithTenant = () -> TenantAccessor.executeWithTenant(myTask, myTenant);
Callable myTaskWithTenant = () -> TenantAccessor.executeWithTenant(myTenant, myTask);

ThreadContextExecutors.submit(myTaskWithTenant);
```
Expand Down
2 changes: 2 additions & 0 deletions docs-java/features/rest/generate-rest-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ The complete list of available parameters with their description is as follows:
| `<outputDirectory>` | - | Yes | Output directory for generated sources |
| `<apiPackage>` | - | Yes | Package name for the generated API classes |
| `<modelPackage>` | - | Yes | Package name for the generated Model classes |
| `<generateApis>` | `True` | No | Determines whether to generate API classes |
| `<generateModels>` | `True` | No | Determines whether to generate Model classes |
| `<deleteOutputDirectory>` | `False` | No | Determines whether to delete the output directory before running the generator |
| `<apiMaturity>` | `released` | No | Defines the maturity of the OpenAPI for which Java classes are generated. Possible values are `released` and `beta`. Please note if you define it as `beta` then [@Beta annotations](https://www.javadoc.io/doc/com.google.guava/guava/latest/com/google/common/annotations/Beta.html) are added to the generated classes which indicate that they are in an experimental state |
| `<compileScope>` | `NONE` | No | Adds the generated sources to the compilation or test phase. Respective values are `COMPILE` and `TEST_COMPILE` |
Expand Down
4 changes: 3 additions & 1 deletion docs-java/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords:
- sap cloud sdk
---

import { ReleaseNotes0To14 } from './release-notes';
import { ReleaseNotes0To14, ReleaseNotes15To29 } from './release-notes';

<!-- vale off -->

Expand Down Expand Up @@ -56,4 +56,6 @@ It will help you:
## Fixed Issues
-->

<ReleaseNotes15To29 />

<ReleaseNotes0To14 />
5 changes: 5 additions & 0 deletions docs-java/release-notes/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import React from 'react';
import Notes0To14 from './release-notes-0-to-14.mdx';
import Notes15To29 from './release-notes-15-to-29.mdx';

export function ReleaseNotes0To14() {
return <Notes0To14 />;
}

export function ReleaseNotes15To29() {
return <Notes15To29 />;
}
22 changes: 22 additions & 0 deletions docs-java/release-notes/release-notes-15-to-29.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## 5.15.0 - December 19, 2024

[All Release Changes](https://github.com/SAP/cloud-sdk-java/releases/tag/rel%2F5.15.0)

### ✨ New Functionality

- Add support for `TypeDefinition` entries in OData V4 EDMX files.
- Add `generateApis` and `generateModels` options to the `openapi-generator-maven-plugin` to
disable the generation of APIs and models respectively.

### 📈 Improvements

- Stabilize most of the remaining experimental APIs without changes, e.g.
- RequestHeaderAccessor
- ServiceBindingDestinationLoader
- OData v2 and v4 generators now use `LinkedHashMap` for the properties of the generated classes to maintain the order of the properties.

### 🐛 Fixed Issues

- Fix ApacheHttpClient5Wrapper to propagate the configuration to Spring RestTemplate.
- Fix OData v2 and v4 generators to work when property name is `value` or `values` and is of collection type.
- The internal variable is now respectively `cloudSdkValue` or `cloudSdkValues` to avoid conflicts with the `value` or `values` property.
38 changes: 37 additions & 1 deletion docs-js/features/connectivity/destination.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,42 @@ The SAP Cloud SDK provides a default implementation for the transformation of se

The default implementation also retrieves a service token, if needed.

Additionally, we provide a function to transform service bindings into OAuth2ClientCredentials destinations, assuming the service binding follows the structure outlined below:

```json
{
"VCAP_SERVICES": {
"custom-service": [
{
"name": "my-custom-service",
"label": "custom-service",
"tags": ["custom-service"],
"url": "https://example.com",
"credentials": {
"clientid": "CLIENT_ID",
"clientsecret": "CLIENT_SECRET"
}
}
]
}
}
```

If the service URL is not specified in the `url` property, it can alternatively be provided as part of the `options` parameter.

The following is a multi-tenant example, where the user's JWT is used for tenant-isolation in the cache together with a custom URL as target.

```ts
const serviceBinding = getServiceBinding('custom-service');
const userJwt = retrieveJwt(request);
const destination = getDestinationFromServiceBinding({
destinationName: 'custom-service',
jwt: userJwt,
useCache: true,
transformServiceBindingToClientCredentialsDestination(serviceBinding, { url: 'custom-url', jwt: userJwt })
})
```

For other types of service bindings or if you want to overwrite the default behavior, provide a callback function (`serviceBindingTransformFn()`) in the request execution.

For example, if you have a binding for a custom service:
Expand All @@ -210,8 +246,8 @@ For example, if you have a binding for a custom service:
"custom-service": [
// This object is passed to `serviceBindingTransformFn()`
{
"label": "custom-service",
"name": "my-custom-service",
"label": "custom-service",
"credentials": {
"url": "https://example.com",
"usr": "USERNAME",
Expand Down
5 changes: 5 additions & 0 deletions docs-js/features/mail-client/mail-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ keywords:
- TypeScript
---

:::caution
This package has been deprecated and is no longer maintained.
Use at your own risk.
:::

This documentation describes how you can send e-mails from applications deployed on the SAP BTP to your e-mail servers.
When defining e-mail servers by using the destination service on the SAP BTP, both `Internet` and `OnPremise` destinations are supported.

Expand Down
2 changes: 1 addition & 1 deletion docs-js/features/odata/execute-odata-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const { myEntityApi } = myEntityService();
myEntityApi.requestBuilder().getAll().setBasePath('my/custom/service/path');
```

This will change the base path of your request.
This will change the base path of the request.
Executing the example request above against a destination with the URL `https://my.s4-system.com` will result in a request against the target like this: `https://my.s4-system.com/my/custom/service/path/MyEntity`.

### Setting a Custom Request Configuration
Expand Down
12 changes: 12 additions & 0 deletions docs-js/features/openapi/execute-openapi-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ MyEntity.requestBuilder()

<CustomRequestConfigNote />

### Setting a Custom Service Path

A custom service path can be manually set in the `options-per-service.json` by providing a `basePath` property during client generation.
It can also be adjusted per request by using the `setBasePath()` method:

```ts
MyApi.myFunction().setBasePath('/base/path/to/service').execute(destination);
```

This will change the base path of the request.
Executing the example request above against a destination with the URL `https://my.some-system.com` will result in a request against the target like this: `https://my.some-system.com/base/path/to/service/myFunctionPath`, where `/myFunctionPath` is the API path parameter.

### Setting Middlewares

You can specify middlewares for a request via the `middleware()` method on the request builder:
Expand Down
26 changes: 26 additions & 0 deletions docs-js/features/openapi/generate-openapi-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,32 @@ npx openapi-generator --input <input> --outputDir <outputDirectory>

The `<input>` points to your specification file or a directory containing the specification(s) and `<outputDirectory>` to the target folder where the generated client(s) will be saved.

An `options-per-service.json` file is created using the `--optionsPerService` option.

- When set to a directory path, an `options-per-service.json` file is read from or created in the given directory.
- When set to a file path, the file is read or created with the given name.

This file is used for customizing subdirectory naming and contains a mapping from the original file name to the following information:

- `directoryName`: the name of the subdirectory the client code will be generated into.
- `packageName`: the name of the npm package, if a package.json file is generated.
This information is optional.
- `basePath`: the URL path to be prepended to the API path before every request.

This information can be adjusted manually and ensures that every run of the generator produces the same names for the generation.

Example:

```json
{
"path/to/your/service-specifications/MyService.yaml": {
"directoryName": "my-service",
"basePath": "/base/path/to/service",
"packageName": "my-service"
}
}
```

By default, the generated clients will each contain:

- API files as `.ts` files - one for each "API" in the service.
Expand Down
6 changes: 6 additions & 0 deletions docs-js/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import LicenseBadge from '@site/src/sap/sdk-js/LicenseBadge';
<!-- vale off -->
<!-- This line is used for our release notes automation -->

## 3.24.0 [Core Modules] - November 27, 2024

### New Functionalities

- [connectivity] Add transform function to create OAuth2ClientCredentials destinations from service bindings. (7ccc9a3)

## 3.23.0 [Core Modules] - November 15, 2024

### Fixed Issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ async getAllBusinessPartners(): Promise<BusinessPartner[]> {
return await businessPartnerApi
.requestBuilder()
.getAll()
.top(1)
.addCustomHeaders({ APIKey: '<YOUR-API-KEY>' })
.execute({
url: 'https://sandbox.api.sap.com/s4hanacloud'
Expand Down
12 changes: 12 additions & 0 deletions docs-js_versioned_docs/version-v3/environments/code/Dockerfile.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```Dockerfile title="Dockerfile"
FROM node:14-alpine

WORKDIR /workdir

COPY /deployment /workdir

RUN ["npm", "install", "--unsafe-perm"]

EXPOSE 3000
CMD ["npm", "run", "start:prod"]
```
29 changes: 29 additions & 0 deletions docs-js_versioned_docs/version-v3/environments/code/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import KymaApprouterTabsContent from './kyma-approuter-tabs.mdx';
import KymaAppTabsContent from './kyma-app-tabs.mdx';
import DockerFileContent from './Dockerfile.mdx';
import OperatorDestinationServiceContent from './operator-destination-service.mdx';
import OperatorXsuaaServiceContent from './operator-xsuaa-service.mdx';
import KubernetesOnPremiseContent from './kubernetes-on-premise.mdx';

export function DockerFile() {
return <DockerFileContent />;
}

export function OperatorDestinationService() {
return <OperatorDestinationServiceContent />;
}
export function OperatorXsuaaService() {
return <OperatorXsuaaServiceContent />;
}

export function KymaApprouterTabs() {
return <KymaApprouterTabsContent />;
}
export function KymaAppTabs() {
return <KymaAppTabsContent />;
}

export function KubernetesTransparentProxy() {
return <KubernetesOnPremiseContent />;
}
Loading

0 comments on commit 5cc3f3e

Please sign in to comment.