Skip to content

Commit 8340c5c

Browse files
(JS) Remove documentation for removed deprecated content in v4 (#2029)
* doc: remove mail-client * doc: add operation request builder * fix: lint * fix: vale * fix: remove mail-client sidebar * fix: link * fix: note annotation * Apply suggestions from code review * Apply suggestions from code review --------- Co-authored-by: Deeksha Sinha <[email protected]>
1 parent 4fc6850 commit 8340c5c

File tree

18 files changed

+85
-376
lines changed

18 files changed

+85
-376
lines changed

.vale.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ StylesPath = styles
66
Vocab = SAP
77
; MinAlertLevel = suggestion
88
MinAlertLevel = warning
9+
WordTemplate = \b(?:%s)\b
910

1011
[formats]
1112
mdx = md
@@ -15,6 +16,5 @@ BasedOnStyles = Vale, SAP
1516
BlockIgnores = (<(img|br|Tabs|Redirect|a|MvnBadge|embed|Csrf)\s[^>]+>+?), \
1617
(?s) *(import[^\n]+;)
1718
TokenIgnores = (<(img|br|Tabs|Redirect|a|MvnBadge|embed|Csrf)\s[^\n]+>+?)
18-
WordTemplate = \b(?:%s)\b
1919

2020
Vale.Terms = warning

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ For the [Support](https://github.com/SAP/cloud-sdk-js/issues) on SAP Cloud SDK f
1111

1212
## Looking for the repository of the SAP Cloud SDK for JavaScript / TypeScript?
1313

14-
Find it here [here](https://github.com/SAP/cloud-sdk-js).
14+
Find it [here](https://github.com/SAP/cloud-sdk-js).
1515

1616
## Getting Support
1717

docs-js/features/connectivity/destination.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Some reasons to separate destinations and the application are:
3333
- Different customers may want to configure different systems.
3434
- Multiple applications might want to access the same systems.
3535

36-
Use [destinations](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.Destination.html) to execute [arbitrary requests](./generic-http-client.mdx), [OData requests](../odata/overview.mdx), and [OpenAPI requests](../openapi/overview.mdx) as well as to [send e-mails](../mail-client/mail-client.mdx).
36+
Use [destinations](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.Destination.html) to execute [arbitrary requests](./generic-http-client.mdx), [OData requests](../odata/overview.mdx), and [OpenAPI requests](../openapi/overview.mdx).
3737
The following examples use `req.execute()`, assuming req is an OData or OpenAPI request, to demonstrate options for the destination lookup.
38-
The same options apply to `executeHttpRequest()` and `sendMail()`.
38+
The same options apply to `executeHttpRequest()`.
3939

4040
## Referencing Destinations by Name
4141

@@ -328,7 +328,7 @@ In a productive environment, in most cases you will use the [destination service
328328
To access the destination service, the SAP Cloud SDK will first fetch an access token from the XSUAA service.
329329
The token retrieved from the XSUAA service is used to make a call to the destination service and receive the destinations.
330330
The destination service returns a destination with all relevant authentication information depending on the used authentication flow.
331-
Listed below are the SDK-supported authentication flows, categorized based on whether a user JWT (`jwt` property in [destination fetch options](#destination-fetch-options)) is required to retrieve a destination.
331+
Listed below are the supported authentication flows in SAP Cloud SDK, categorized based on whether a user JWT (`jwt` property in [destination fetch options](#destination-fetch-options)) is required to retrieve a destination.
332332

333333
- No user JWT required
334334

@@ -569,7 +569,7 @@ The SAP Cloud SDK adds those additional headers and query parameters for every c
569569

570570
### Forwarding Auth Tokens
571571

572-
The SDK provides the option of configuring a destination to directly forward the given JWT to the target system.
572+
SAP Cloud SDK provides the option of configuring a destination to directly forward the given JWT to the target system.
573573
This behavior can be enabled by setting the `forwardAuthToken` property on the destination to `true`, as shown in the code snippet below:
574574

575575
```ts

docs-js/features/mail-client/mail-client.mdx

Lines changed: 0 additions & 196 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
If the response structure does not match the transformation type, the promise from `execute(destination)` will be resolved into `undefined`.
2+
3+
The default transformer expects the following response format:
4+
5+
```json
6+
{
7+
"d": {
8+
"Count": 0
9+
}
10+
}
11+
```
12+
13+
Assume the actual response has an additional layer `Foo`:
14+
15+
```json
16+
{
17+
"d": {
18+
"Foo": {
19+
"Count": 0
20+
}
21+
}
22+
}
23+
```
24+
25+
In this case, `dataAccessor` can be used in the following way to modify the response into the desired form for further deserialization.
26+
27+
```ts
28+
operationRequestBuilder.execute(destination, data => data.d.Foo);
29+
```

docs-js/features/odata/common/function-imports/entity-return-type.mdx renamed to docs-js/features/odata/common/operation-imports/entity-return-type.mdx

File renamed without changes.

docs-js/features/odata/common/function-imports/etag-function-import.mdx renamed to docs-js/features/odata/common/operation-imports/etag-function-import.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Operations do not support ETag handling automatically.
1+
Function or action imports do not support ETag handling automatically.
22
If your service requires the version identifier of an entity to be present, you can pass it to the request on your own using the `addCustomHeaders()` method (see example below).
3-
With this approach, you have to retrieve the required entity with a `GET` request, before executing the function import.
4-
Note, that if the function import execution succeeds, the version identifier of your entity will be outdated.
3+
With this approach, you have to retrieve the required entity with a `GET` request, before executing the operation.
4+
Note, that if the operation execution succeeds, the version identifier of your entity will be outdated.
55

66
```ts
7-
myFunction()
7+
operationRequestBuilder()
88
.addCustomHeaders({ 'if-match': entity.versionIdentifier })
99
.execute(destination);
1010
```

docs-js/features/odata/common/function-imports/index.jsx renamed to docs-js/features/odata/common/operation-imports/index.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22
import EtagFunctionImportContent from './etag-function-import.mdx';
33
import EntityReturnTypeContent from './entity-return-type.mdx';
4+
import RequestBuilderContent from './request-builder.mdx';
5+
import DataAccessorContent from './data-accessor.mdx';
46

57
export function EtagFunctionImport() {
68
return <EtagFunctionImportContent />;
@@ -9,3 +11,11 @@ export function EtagFunctionImport() {
911
export function EntityReturnType() {
1012
return <EntityReturnTypeContent />;
1113
}
14+
15+
export function RequestBuilder() {
16+
return <RequestBuilderContent />;
17+
}
18+
19+
export function DataAccessor() {
20+
return <DataAccessorContent />;
21+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
The operation request builder helps build a request for service operations such as function and action imports if they are exposed.
2+
3+
:::note
4+
Note that action imports are only supported in OData v4.
5+
But the usage of function and action imports are similar.
6+
:::
7+
8+
The example below execute an action import from the [Inbound Delivery (A2X)](https://api.sap.com/api/API_INBOUND_DELIVERY_SRV_0002/overview) service against a destination.
9+
To learn how to generate an API client from the service definition, look at [this article](../../generate-odata-client.mdx).
10+
11+
```ts
12+
import { postGoodsReceipt } from './inbound/API_INBOUND_DELIVERY_SRV_0002';
13+
postGoodsReceipt({ deliveryDocument: '123456' }).execute(destination);
14+
```

docs-js/features/odata/odata-v2-client.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ keywords:
1414
---
1515

1616
import { SkipCsrf, Csrf } from '../common';
17-
import { Select, ChangeSetExample, RequestBuilder } from './v2';
17+
import { Select, ChangeSetExample } from './v2';
1818
import { SkipCsrfExample, CustomCsrf, ETag } from './common';
1919
import {
2020
CustomFields,
@@ -48,9 +48,11 @@ import {
4848
FilterFunctions
4949
} from './common/query-parameter';
5050
import {
51+
RequestBuilder,
52+
DataAccessor,
5153
EtagFunctionImport,
5254
EntityReturnType
53-
} from './common/function-imports';
55+
} from './common/operation-imports';
5456
import {
5557
BatchIntro,
5658
RetrieveRequests,
@@ -199,12 +201,12 @@ If you need to adjust the way CSRF tokens are fetched, you can do so by using [m
199201

200202
<FilterFunctions />
201203

202-
## Function Imports
203-
204-
### Request Builder
204+
## Operation Request Builder
205205

206206
<RequestBuilder />
207207

208+
<DataAccessor />
209+
208210
<EntityReturnType />
209211

210212
### Setting ETag
@@ -218,15 +220,15 @@ If you need to adjust the way CSRF tokens are fetched, you can do so by using [m
218220
### Retrieve Request
219221

220222
A retrieve request represents an HTTP `GET` request.
221-
In terms of the SAP Cloud SDK this includes all requests built by [`GetAllRequestBuilder`](#getall-request-builder), [`GetByKeyRequestBuilder`](#getbykey-request-builder), and [`FunctionImportRequestBuilder`](#function-imports) using `GET` requests.
223+
In terms of the SAP Cloud SDK this includes all requests built by [`GetAllRequestBuilder`](#getall-request-builder), [`GetByKeyRequestBuilder`](#getbykey-request-builder), and [`OperationRequestBuilder`](#operation-request-builder) using `GET` requests.
222224
If you use TypeScript, a type error will appear when including a function import changing the data.
223225

224226
<RetrieveRequests />
225227

226228
### Changeset
227229

228230
A changeset is a collection of HTTP `POST`, `PUT`, `PATCH` and `DELETE` operations.
229-
Such operations are built by the [`CreateRequestBuilder`](#create-request-builder), [`UpdateRequestBuilder`](#update-request-builder), [`DeleteRequestBuilder`](#delete-request-builder), or [`FunctionImportRequestBuilder`](#function-imports).
231+
Such operations are built by the [`CreateRequestBuilder`](#create-request-builder), [`UpdateRequestBuilder`](#update-request-builder), [`DeleteRequestBuilder`](#delete-request-builder), or [`OperationRequestBuilder`](#operation-request-builder).
230232
If you use TypeScript, a type error will appear when including a function import reading the data.
231233

232234
<ChangeSet />

0 commit comments

Comments
 (0)