@abapify/adt-rfc 0.0.0 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -1
- package/package.json +35 -3
package/README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
1
|
# @abapify/adt-rfc
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SOAP-over-HTTP RFC transport for SAP systems. Calls classic RFC function modules (BAPIs, STFC_CONNECTION, TH_USER_LIST, custom FMs, etc.) without requiring the native `libsapnwrfc` SDK — by tunnelling the call through SAP's built-in `/sap/bc/soap/rfc` endpoint.
|
|
4
|
+
|
|
5
|
+
> This package lives **outside** the `/sap/bc/adt/*` URL space. RFC is a separate transport layer from ADT — that's why it's a separate package, not a schema/contract under `@abapify/adt-client`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add @abapify/adt-rfc
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { createAdtClient } from '@abapify/adt-client';
|
|
17
|
+
import { createRfcClient } from '@abapify/adt-rfc';
|
|
18
|
+
|
|
19
|
+
const adt = createAdtClient({
|
|
20
|
+
baseUrl: 'https://my.sap.example.com',
|
|
21
|
+
username: 'DEVELOPER',
|
|
22
|
+
password: '…',
|
|
23
|
+
client: '100',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const rfc = createRfcClient({
|
|
27
|
+
fetch: (url, opts) => adt.fetch(url, opts),
|
|
28
|
+
client: '100',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const resp = await rfc.call('STFC_CONNECTION', { REQUTEXT: 'hello' });
|
|
32
|
+
console.log(resp.ECHOTEXT); // → "hello"
|
|
33
|
+
console.log(resp.RESPTEXT); // → "SAP R/3 Rel. 7.55 Sysid: TRL …"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Parameter types
|
|
37
|
+
|
|
38
|
+
Parameters and responses are modelled as loose JSON trees:
|
|
39
|
+
|
|
40
|
+
| RFC type | TypeScript representation |
|
|
41
|
+
| --------- | ------------------------------------- |
|
|
42
|
+
| Scalar | `string \| number \| boolean \| null` |
|
|
43
|
+
| Structure | `{ FIELD1: …, FIELD2: … }` |
|
|
44
|
+
| Table | `[{ FIELD: … }, { FIELD: … }]` |
|
|
45
|
+
|
|
46
|
+
Tables are serialised as SAP's `<TABLE_NAME><item>…</item><item>…</item></TABLE_NAME>` convention on the wire.
|
|
47
|
+
|
|
48
|
+
## Errors
|
|
49
|
+
|
|
50
|
+
- **`RfcSoapFault`** — the server returned a `soap:Fault`. Exposes `faultcode`, `faultstring`, and the raw response body.
|
|
51
|
+
- **`RfcTransportUnavailable`** — the `/sap/bc/soap/rfc` endpoint returned 401/403/404/501. Some SAP systems disable SOAP-RFC; catch this to downgrade gracefully.
|
|
52
|
+
|
|
53
|
+
## Limitations
|
|
54
|
+
|
|
55
|
+
- **SOAP-RFC only.** Native `libsapnwrfc` binding (via `node-rfc`) is deliberately out of scope — track `@abapify/adt-plugin-rfc-native` for that future path.
|
|
56
|
+
- **Type encoding.** SAP's SOAP-RFC wrapper does not round-trip every RFC data type perfectly. Binary fields come back as base64-looking strings; dates/times come back as SAP internal strings (`YYYYMMDD`, `HHMMSS`). Callers convert.
|
|
57
|
+
- **Authentication.** Reuses the ADT client's session/CSRF/cookie state — no separate auth plumbing.
|
|
58
|
+
|
|
59
|
+
## See also
|
|
60
|
+
|
|
61
|
+
- Spec: `docs/roadmap/epics/e13-startrfc.md`
|
|
62
|
+
- Reference implementation: `tmp/sapcli-ref/sapcli/sap/rfc/`
|
package/package.json
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abapify/adt-rfc",
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.3.5",
|
|
7
|
+
"description": "SAP RFC transport for @abapify — SOAP-over-HTTP RFC implementation (/sap/bc/soap/rfc)",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"types": "./dist/index.d.mts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/index.mjs",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"sap",
|
|
21
|
+
"rfc",
|
|
22
|
+
"soap",
|
|
23
|
+
"abap",
|
|
24
|
+
"startrfc"
|
|
25
|
+
],
|
|
26
|
+
"author": "Booking.com",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/abapify/adt-cli.git",
|
|
31
|
+
"directory": "packages/adt-rfc"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/abapify/adt-cli/tree/main/packages/adt-rfc#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/abapify/adt-cli/issues"
|
|
36
|
+
}
|
|
37
|
+
}
|