@mcp-abap-adt/interfaces 0.1.3 → 0.1.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/CHANGELOG.md +59 -0
- package/README.md +3 -0
- package/dist/adt/IAdtObject.d.ts +121 -0
- package/dist/adt/IAdtObject.d.ts.map +1 -0
- package/dist/adt/IAdtObject.js +11 -0
- package/dist/connection/IAbapConnection.d.ts +0 -3
- package/dist/connection/IAbapConnection.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,65 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.5] - 2025-12-09
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **High-Level ADT Object Operations Interface**: Added `IAdtObject` interface for high-level CRUD operations
|
|
14
|
+
- `IAdtObject<TConfig, TReadResult>` - Main interface for ADT object operations
|
|
15
|
+
- Provides simplified CRUD operations with automatic operation chains, error handling, and resource cleanup
|
|
16
|
+
- Methods: `validate()`, `create()`, `read()`, `update()`, `delete()`, `activate()`, `check()`
|
|
17
|
+
- Supports full operation chains:
|
|
18
|
+
- Create: validate → create → check → lock → check(inactive) → update → unlock → check → activate
|
|
19
|
+
- Update: lock → check(inactive) → update → unlock → check → activate
|
|
20
|
+
- Delete: check(deletion) → delete
|
|
21
|
+
- **Operation Options Interfaces**: Added options interfaces for create and update operations
|
|
22
|
+
- `CreateOptions` - Options for create operations:
|
|
23
|
+
- `activateOnCreate?: boolean` - Activate object after creation (default: false)
|
|
24
|
+
- `deleteOnFailure?: boolean` - Delete object if creation fails (default: false)
|
|
25
|
+
- `sourceCode?: string` - Source code to use for update after create
|
|
26
|
+
- `xmlContent?: string` - XML content to use for update after create
|
|
27
|
+
- `UpdateOptions` - Options for update operations:
|
|
28
|
+
- `activateOnUpdate?: boolean` - Activate object after update (default: false)
|
|
29
|
+
- `deleteOnFailure?: boolean` - Delete object if update fails (default: false)
|
|
30
|
+
- `lockHandle?: string` - Lock handle if object is already locked
|
|
31
|
+
- **ADT Domain**: New domain for ADT client interfaces
|
|
32
|
+
- All interfaces exported from `@mcp-abap-adt/interfaces` under ADT domain
|
|
33
|
+
- Located in `src/adt/IAdtObject.ts`
|
|
34
|
+
|
|
35
|
+
## [0.1.4] - 2025-12-08
|
|
36
|
+
|
|
37
|
+
### Breaking Changes
|
|
38
|
+
|
|
39
|
+
- **Session State Methods Removed from IAbapConnection**: Removed session state management methods from connection interface
|
|
40
|
+
- `getSessionState()` method removed from `IAbapConnection`
|
|
41
|
+
- `setSessionState()` method removed from `IAbapConnection`
|
|
42
|
+
- Session state management is no longer a responsibility of connection package
|
|
43
|
+
- Connection package now focuses solely on HTTP communication
|
|
44
|
+
- Session state persistence should be handled by higher-level packages (e.g., auth-broker)
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- **Connection Package Scope**: Updated `IAbapConnection` interface to reflect connection package responsibilities
|
|
49
|
+
- Connection package handles only HTTP communication and session headers
|
|
50
|
+
- Token refresh is not a responsibility of connection package - handled by `@mcp-abap-adt/auth-broker` package
|
|
51
|
+
- Session state persistence is not part of connection package scope
|
|
52
|
+
|
|
53
|
+
### Migration Guide
|
|
54
|
+
|
|
55
|
+
If you were using session state methods:
|
|
56
|
+
|
|
57
|
+
**Before (0.1.x)**:
|
|
58
|
+
```typescript
|
|
59
|
+
const state = connection.getSessionState();
|
|
60
|
+
connection.setSessionState(state);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**After (0.1.4)**:
|
|
64
|
+
```typescript
|
|
65
|
+
// Session state management is now handled by auth-broker or other higher-level packages
|
|
66
|
+
// Connection package only handles HTTP communication
|
|
67
|
+
```
|
|
68
|
+
|
|
10
69
|
## [0.1.3] - 2025-12-07
|
|
11
70
|
|
|
12
71
|
### Added
|
package/README.md
CHANGED
|
@@ -95,6 +95,9 @@ This package is responsible for:
|
|
|
95
95
|
|
|
96
96
|
### Connection Domain (`connection/`)
|
|
97
97
|
- `IAbapConnection` - Main connection interface for ADT operations
|
|
98
|
+
- Handles HTTP communication with SAP systems
|
|
99
|
+
- Manages session headers (stateful/stateless mode via `setSessionType()`)
|
|
100
|
+
- Note: Token refresh and session state persistence are handled by other packages (e.g., auth-broker)
|
|
98
101
|
- `IAbapRequestOptions` - Request options for ADT operations
|
|
99
102
|
|
|
100
103
|
### SAP Domain (`sap/`)
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level ADT Object Operations Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the interface for high-level CRUD operations on ADT objects.
|
|
5
|
+
* This interface is implemented by Adt{Entity} classes (e.g., AdtClass, AdtDomain).
|
|
6
|
+
*
|
|
7
|
+
* Unlike Builders which provide low-level method chaining, this interface
|
|
8
|
+
* provides high-level operation chains with automatic error handling and cleanup.
|
|
9
|
+
*/
|
|
10
|
+
import { AxiosResponse } from 'axios';
|
|
11
|
+
/**
|
|
12
|
+
* Options for create operations
|
|
13
|
+
*/
|
|
14
|
+
export interface CreateOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Activate object after creation
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
activateOnCreate?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Delete object if creation fails
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
deleteOnFailure?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Source code to use for update after create
|
|
27
|
+
*/
|
|
28
|
+
sourceCode?: string;
|
|
29
|
+
/**
|
|
30
|
+
* XML content to use for update after create
|
|
31
|
+
*/
|
|
32
|
+
xmlContent?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Options for update operations
|
|
36
|
+
*/
|
|
37
|
+
export interface UpdateOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Activate object after update
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
activateOnUpdate?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Delete object if update fails
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
deleteOnFailure?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Lock handle if object is already locked
|
|
50
|
+
*/
|
|
51
|
+
lockHandle?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* High-level ADT Object Operations Interface
|
|
55
|
+
*
|
|
56
|
+
* Provides simplified CRUD operations with automatic operation chains,
|
|
57
|
+
* error handling, and resource cleanup.
|
|
58
|
+
*
|
|
59
|
+
* @template TConfig - Configuration type for the object (e.g., ClassBuilderConfig)
|
|
60
|
+
* @template TReadResult - Result type for read operations (defaults to TConfig)
|
|
61
|
+
*/
|
|
62
|
+
export interface IAdtObject<TConfig, TReadResult = TConfig> {
|
|
63
|
+
/**
|
|
64
|
+
* Validate object configuration before creation
|
|
65
|
+
* @param config - Object configuration
|
|
66
|
+
* @returns Validation response from ADT
|
|
67
|
+
*/
|
|
68
|
+
validate(config: Partial<TConfig>): Promise<AxiosResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* Create object with full operation chain:
|
|
71
|
+
* validate → create → check → lock → check(inactive) → update → unlock → check → activate (optional)
|
|
72
|
+
*
|
|
73
|
+
* @param config - Object configuration
|
|
74
|
+
* @param options - Create options (activation, cleanup, source code)
|
|
75
|
+
* @returns Created object configuration
|
|
76
|
+
* @throws Error if validation fails (object is not created)
|
|
77
|
+
* @throws Error if any operation fails (with cleanup if deleteOnFailure=true)
|
|
78
|
+
*/
|
|
79
|
+
create(config: TConfig, options?: CreateOptions): Promise<TReadResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Read object
|
|
82
|
+
* @param config - Object identification (name, etc.)
|
|
83
|
+
* @param version - 'active' or 'inactive'
|
|
84
|
+
* @returns Object configuration or source code, or undefined if not found
|
|
85
|
+
*/
|
|
86
|
+
read(config: Partial<TConfig>, version?: 'active' | 'inactive'): Promise<TReadResult | undefined>;
|
|
87
|
+
/**
|
|
88
|
+
* Update object with full operation chain:
|
|
89
|
+
* lock → check(inactive) → update → unlock → check → activate (optional)
|
|
90
|
+
*
|
|
91
|
+
* @param config - Object configuration with updates
|
|
92
|
+
* @param options - Update options (activation, cleanup, lock handle)
|
|
93
|
+
* @returns Updated object configuration
|
|
94
|
+
* @throws Error if lock fails
|
|
95
|
+
* @throws Error if any operation fails (with cleanup if deleteOnFailure=true)
|
|
96
|
+
*/
|
|
97
|
+
update(config: Partial<TConfig>, options?: UpdateOptions): Promise<TReadResult>;
|
|
98
|
+
/**
|
|
99
|
+
* Delete object
|
|
100
|
+
* Performs deletion check before deleting.
|
|
101
|
+
*
|
|
102
|
+
* @param config - Object identification
|
|
103
|
+
* @returns Delete response from ADT
|
|
104
|
+
* @throws Error if deletion check fails (object is not deleted)
|
|
105
|
+
*/
|
|
106
|
+
delete(config: Partial<TConfig>): Promise<AxiosResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* Activate object
|
|
109
|
+
* @param config - Object identification
|
|
110
|
+
* @returns Activation response from ADT
|
|
111
|
+
*/
|
|
112
|
+
activate(config: Partial<TConfig>): Promise<AxiosResponse>;
|
|
113
|
+
/**
|
|
114
|
+
* Check object (syntax, consistency, etc.)
|
|
115
|
+
* @param config - Object identification
|
|
116
|
+
* @param status - Optional status to check ('active', 'inactive', 'deletion')
|
|
117
|
+
* @returns Check response from ADT
|
|
118
|
+
*/
|
|
119
|
+
check(config: Partial<TConfig>, status?: string): Promise<AxiosResponse>;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=IAdtObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAdtObject.d.ts","sourceRoot":"","sources":["../../src/adt/IAdtObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA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AC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAE3D;;;;;OAKG;IACH,KAAK,CACH,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EACxB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* High-level ADT Object Operations Interface
|
|
4
|
+
*
|
|
5
|
+
* Defines the interface for high-level CRUD operations on ADT objects.
|
|
6
|
+
* This interface is implemented by Adt{Entity} classes (e.g., AdtClass, AdtDomain).
|
|
7
|
+
*
|
|
8
|
+
* Unlike Builders which provide low-level method chaining, this interface
|
|
9
|
+
* provides high-level operation chains with automatic error handling and cleanup.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ISapConfig } from '../sap/ISapConfig';
|
|
2
|
-
import type { ISessionState } from '../storage/ISessionState';
|
|
3
2
|
import type { IAbapRequestOptions } from './IAbapRequestOptions';
|
|
4
3
|
/**
|
|
5
4
|
* Axios response type - using any to avoid dependency on axios package
|
|
@@ -15,7 +14,5 @@ export interface IAbapConnection {
|
|
|
15
14
|
makeAdtRequest(options: IAbapRequestOptions): Promise<AxiosResponse>;
|
|
16
15
|
connect(): Promise<void>;
|
|
17
16
|
reset(): void;
|
|
18
|
-
getSessionState(): ISessionState | null;
|
|
19
|
-
setSessionState(state: ISessionState): void;
|
|
20
17
|
}
|
|
21
18
|
//# sourceMappingURL=IAbapConnection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAbapConnection.d.ts","sourceRoot":"","sources":["../../src/connection/IAbapConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"IAbapConnection.d.ts","sourceRoot":"","sources":["../../src/connection/IAbapConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAEhC,MAAM,WAAW,eAAe;IAC9B,SAAS,IAAI,UAAU,CAAC;IACxB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,CAAC;IACrD,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACrE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;CACf"}
|
package/dist/index.d.ts
CHANGED
|
@@ -26,4 +26,5 @@ export { AuthMethodPriority } from './validation/IValidatedAuthConfig';
|
|
|
26
26
|
export type { ITokenRefreshResult } from './utils/ITokenRefreshResult';
|
|
27
27
|
export type { ITimeoutConfig } from './utils/ITimeoutConfig';
|
|
28
28
|
export * from './Headers';
|
|
29
|
+
export type { IAdtObject, CreateOptions, UpdateOptions } from './adt/IAdtObject';
|
|
29
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,i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