@abapify/adk 0.0.0 → 0.3.6
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 +78 -1
- package/package.json +31 -3
package/README.md
CHANGED
|
@@ -1,3 +1,80 @@
|
|
|
1
1
|
# @abapify/adk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/abapify/adt-cli/pkgs/npm/%40abapify%2Fadk)
|
|
4
|
+
|
|
5
|
+
ABAP Development Kit — schema-driven construction and serialization of ABAP objects.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
ADK provides typed representations of ABAP objects (classes, interfaces, packages, etc.) built from ADT XML responses. It handles parsing, construction, and lazy loading of source includes — no HTTP calls inside ADK itself.
|
|
10
|
+
|
|
11
|
+
Key properties:
|
|
12
|
+
|
|
13
|
+
- **Schema-first**: types derived from `@abapify/adt-schemas` (XSD-generated)
|
|
14
|
+
- **Pure construction**: no network calls, no side effects
|
|
15
|
+
- **Lazy source loading**: includes fetched on demand via an injected fetcher
|
|
16
|
+
- **Immutable snapshots**: objects represent a point-in-time state
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @abapify/adk
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { AdkFactory } from '@abapify/adk';
|
|
28
|
+
|
|
29
|
+
const factory = new AdkFactory();
|
|
30
|
+
|
|
31
|
+
// Parse ADT XML response into a typed object
|
|
32
|
+
const classObj = factory.fromAdtXml('CLAS/OC', xmlString);
|
|
33
|
+
|
|
34
|
+
console.log(classObj.kind); // 'CLAS/OC'
|
|
35
|
+
console.log(classObj.name); // 'ZCL_MY_CLASS'
|
|
36
|
+
|
|
37
|
+
// Lazy-load source (requires a fetcher injected via the CLI or client)
|
|
38
|
+
const source = await classObj.getSource();
|
|
39
|
+
const includes = await classObj.getIncludes();
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Architecture
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
adt-schemas (XSD-derived TypeScript types)
|
|
46
|
+
↓
|
|
47
|
+
adk (parse ADT XML → domain objects) ← this package
|
|
48
|
+
↓
|
|
49
|
+
adt-cli (orchestrate: fetch → parse → serialize)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
ADK sits between the HTTP layer (`adt-client`) and the serialization layer (`adt-plugin-*`). The CLI passes raw ADT XML to ADK, receives typed objects, and hands them to format plugins.
|
|
53
|
+
|
|
54
|
+
## Supported Object Types
|
|
55
|
+
|
|
56
|
+
| ABAP Type | Description |
|
|
57
|
+
| --------- | -------------- |
|
|
58
|
+
| `CLAS/OC` | ABAP class |
|
|
59
|
+
| `INTF/OI` | ABAP interface |
|
|
60
|
+
| `DEVC/K` | Package |
|
|
61
|
+
|
|
62
|
+
## Bridge Pattern (CLI Integration)
|
|
63
|
+
|
|
64
|
+
The CLI registers object handlers using ADK adapters:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
this.handlers.set(
|
|
68
|
+
'CLAS',
|
|
69
|
+
(client) =>
|
|
70
|
+
new AdkObjectHandler(
|
|
71
|
+
client,
|
|
72
|
+
(xml) => ClassAdtAdapter.fromAdtXML(xml),
|
|
73
|
+
(name) => `/sap/bc/adt/oo/classes/${name.toLowerCase()}`,
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abapify/adk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.3.6",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
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
|
+
"@abapify/adt-client": "0.3.6",
|
|
20
|
+
"@abapify/adt-locks": "0.3.6",
|
|
21
|
+
"@abapify/adt-schemas": "0.3.6"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/abapify/adt-cli.git",
|
|
26
|
+
"directory": "packages/adk"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/abapify/adt-cli/tree/main/packages/adk#readme",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/abapify/adt-cli/issues"
|
|
31
|
+
},
|
|
32
|
+
"description": "ABAP Development Kit — typed object model for ABAP Repository objects (classes, interfaces, programs, tables, …) with ADT XML serialization"
|
|
33
|
+
}
|