@mcp-abap-adt/interfaces 0.1.14 → 0.1.15

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 CHANGED
@@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.15] - 2025-12-12
11
+
12
+ ### Added
13
+ - **Long Polling Support for Read Operations**: Added optional `withLongPolling` parameter to all GET-based read methods
14
+ - **IAdtObject Interface**:
15
+ - `read(config, version?, options?)` - Added optional `options?: { withLongPolling?: boolean }` parameter
16
+ - `readMetadata(config, options?)` - Added optional `options?: { withLongPolling?: boolean }` parameter
17
+ - `readTransport(config, options?)` - Added optional `options?: { withLongPolling?: boolean }` parameter
18
+ - **IBuilder Interface** (in `@mcp-abap-adt/adt-clients`):
19
+ - `read(version?, options?)` - Added optional `options?: { withLongPolling?: boolean }` parameter
20
+ - **Usage**: When `withLongPolling: true` is specified, the request includes `?withLongPolling=true` query parameter
21
+ - This allows the server to hold the connection open until the object becomes available or a timeout occurs
22
+ - Useful after create/activate operations to wait until object is ready for reading
23
+ - Can replace timeout-based polling in tests and production code
24
+ - **Example**:
25
+ ```typescript
26
+ // Wait for object to become available after creation
27
+ const domain = await adtDomain.read(
28
+ { domainName: 'Z_TEST' },
29
+ 'active',
30
+ { withLongPolling: true }
31
+ );
32
+
33
+ // Read metadata with long polling
34
+ const metadata = await adtDomain.readMetadata(
35
+ { domainName: 'Z_TEST' },
36
+ { withLongPolling: true }
37
+ );
38
+ ```
39
+
10
40
  ## [0.1.14] - 2025-12-19
11
41
 
12
42
  ### Added
package/README.md CHANGED
@@ -14,6 +14,7 @@ npm install @mcp-abap-adt/interfaces
14
14
 
15
15
  This package contains all interfaces organized by domain:
16
16
 
17
+ - **`adt/`** - ADT object operations interfaces (IAdtObject, operation options, error codes)
17
18
  - **`auth/`** - Core authentication interfaces (configs, auth types)
18
19
  - **`token/`** - Token-related interfaces (token provider, results, options)
19
20
  - **`session/`** - Session storage interface
@@ -21,7 +22,7 @@ This package contains all interfaces organized by domain:
21
22
  - **`connection/`** - Connection interfaces (AbapConnection, request options)
22
23
  - **`sap/`** - SAP-specific configuration (SapConfig, SapAuthType)
23
24
  - **`storage/`** - Storage interfaces (session storage, state)
24
- - **`logging/`** - Logging interfaces
25
+ - **`logging/`** - Logging interfaces (ILogger, LogLevel enum)
25
26
  - **`validation/`** - Validation interfaces
26
27
  - **`utils/`** - Utility types and interfaces
27
28
 
@@ -33,6 +34,8 @@ This ensures consistency across all packages and follows TypeScript naming conve
33
34
 
34
35
  ## Usage
35
36
 
37
+ ### Basic Imports
38
+
36
39
  ```typescript
37
40
  import {
38
41
  IAuthorizationConfig,
@@ -46,6 +49,30 @@ import {
46
49
  } from '@mcp-abap-adt/interfaces';
47
50
  ```
48
51
 
52
+ ### ADT Object Operations
53
+
54
+ ```typescript
55
+ import {
56
+ IAdtObject,
57
+ IAdtOperationOptions,
58
+ AdtObjectErrorCodes,
59
+ LogLevel
60
+ } from '@mcp-abap-adt/interfaces';
61
+
62
+ // Example: Read with long polling
63
+ const domain = await adtDomain.read(
64
+ { domainName: 'Z_TEST' },
65
+ 'active',
66
+ { withLongPolling: true } // Wait until object is available
67
+ );
68
+
69
+ // Example: Read metadata with long polling
70
+ const metadata = await adtDomain.readMetadata(
71
+ { domainName: 'Z_TEST' },
72
+ { withLongPolling: true }
73
+ );
74
+ ```
75
+
49
76
  ## Responsibilities and Design Principles
50
77
 
51
78
  ### Core Development Principle
@@ -76,6 +103,24 @@ This package is responsible for:
76
103
 
77
104
  ## Interface Domains
78
105
 
106
+ ### ADT Domain (`adt/`)
107
+ - `IAdtObject<TConfig, TReadResult>` - High-level ADT object operations interface
108
+ - Provides simplified CRUD operations with automatic operation chains, error handling, and resource cleanup
109
+ - Methods: `validate()`, `create()`, `read()`, `readMetadata()`, `readTransport()`, `update()`, `delete()`, `activate()`, `check()`
110
+ - All read methods support optional `withLongPolling` parameter for waiting until object becomes available
111
+ - Supports full operation chains:
112
+ - Create: validate → create → check → lock → check(inactive) → update → unlock → check → activate
113
+ - Update: lock → check(inactive) → update → unlock → check → activate
114
+ - Delete: check(deletion) → delete
115
+ - `IAdtOperationOptions` - Unified options for create and update operations
116
+ - Fields: `activateOnCreate`, `activateOnUpdate`, `deleteOnFailure`, `sourceCode`, `xmlContent`, `timeout`
117
+ - `AdtObjectErrorCodes` - Error code constants for ADT object operations
118
+ - Constants: `OBJECT_NOT_FOUND`, `OBJECT_NOT_READY`, `VALIDATION_FAILED`, `CREATE_FAILED`, `UPDATE_FAILED`, `DELETE_FAILED`, `ACTIVATE_FAILED`, `CHECK_FAILED`, `LOCK_FAILED`, `UNLOCK_FAILED`
119
+ - `IAdtObjectState` - Base state interface for ADT object operations
120
+ - Fields: `validationResponse`, `createResult`, `lockHandle`, `updateResult`, `checkResult`, `unlockResult`, `activateResult`, `deleteResult`, `readResult`, `metadataResult`, `transportResult`, `errors`
121
+ - `IAdtObjectConfig` - Base configuration interface for ADT objects
122
+ - Common fields: `packageName`, `description`, `transportRequest`
123
+
79
124
  ### Authentication Domain (`auth/`)
80
125
  - `IAuthorizationConfig` - Authorization values (UAA credentials, refresh token)
81
126
  - `IConnectionConfig` - Connection values (service URL, token, client, language)
@@ -110,6 +155,8 @@ This package is responsible for:
110
155
 
111
156
  ### Logging Domain (`logging/`)
112
157
  - `ILogger` - Logger interface
158
+ - `LogLevel` - Log level enum (`ERROR = 0`, `WARN = 1`, `INFO = 2`, `DEBUG = 3`)
159
+ - Exported from package root: `import { LogLevel } from '@mcp-abap-adt/interfaces'`
113
160
 
114
161
  ### Validation Domain (`validation/`)
115
162
  - `IValidatedAuthConfig` - Validated authentication configuration
@@ -122,18 +122,28 @@ export interface IAdtObject<TConfig, TReadResult = TConfig> {
122
122
  *
123
123
  * @param config - Object identification (name, etc.)
124
124
  * @param version - 'active' or 'inactive'
125
+ * @param options - Optional read options
126
+ * @param options.withLongPolling - If true, adds ?withLongPolling=true to wait for object to become available
127
+ * Useful after create/activate operations to wait until object is ready
125
128
  * @returns Object configuration or source code, or undefined if not found
126
129
  */
127
- read(config: Partial<TConfig>, version?: 'active' | 'inactive'): Promise<TReadResult | undefined>;
130
+ read(config: Partial<TConfig>, version?: 'active' | 'inactive', options?: {
131
+ withLongPolling?: boolean;
132
+ }): Promise<TReadResult | undefined>;
128
133
  /**
129
134
  * Read object metadata (object characteristics: package, responsible, description, etc.)
130
135
  * For objects with source code (Class, Interface, Program), this reads metadata separately from source code.
131
136
  * For objects without source code (Domain, DataElement), this may delegate to read() as read() already returns metadata.
132
137
  *
133
138
  * @param config - Object identification (name, etc.)
139
+ * @param options - Optional read options
140
+ * @param options.withLongPolling - If true, adds ?withLongPolling=true to wait for object to become available
141
+ * Useful after create/activate operations to wait until object is ready
134
142
  * @returns State with metadata result
135
143
  */
136
- readMetadata(config: Partial<TConfig>): Promise<TReadResult>;
144
+ readMetadata(config: Partial<TConfig>, options?: {
145
+ withLongPolling?: boolean;
146
+ }): Promise<TReadResult>;
137
147
  /**
138
148
  * Update object with full operation chain:
139
149
  * lock → check(inactive) → update → unlock → check → activate (optional)
@@ -171,8 +181,13 @@ export interface IAdtObject<TConfig, TReadResult = TConfig> {
171
181
  /**
172
182
  * Read transport request information for the object
173
183
  * @param config - Object identification
184
+ * @param options - Optional read options
185
+ * @param options.withLongPolling - If true, adds ?withLongPolling=true to wait for object to become available
186
+ * Useful after create/activate operations to wait until object is ready
174
187
  * @returns State with transport result
175
188
  */
176
- readTransport(config: Partial<TConfig>): Promise<TReadResult>;
189
+ readTransport(config: Partial<TConfig>, options?: {
190
+ withLongPolling?: boolean;
191
+ }): Promise<TReadResult>;
177
192
  }
178
193
  //# sourceMappingURL=IAdtObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IAdtObject.d.ts","sourceRoot":"","sources":["../../src/adt/IAdtObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQ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W,CAAC,CAAC;IAExB;;;;;;;OAOG;IACH,aAAa,CACX,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EACxB,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,GACtC,OAAO,CAAC,WAAW,CAAC,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/interfaces",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Shared interfaces for MCP ABAP ADT packages",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",