@mcp-abap-adt/interfaces 0.1.14 → 0.1.16

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,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.16] - 2025-12-13
11
+
12
+ ### Changed
13
+ - **HTTP timeout docs**: Clarified `timeout` option in `IAdtOperationOptions` to explain behavior and mention `withLongPolling` interplay
14
+ - **VSCode spell checking**: Limited spell checker scope to project files to reduce false positives
15
+
16
+ ## [0.1.15] - 2025-12-12
17
+
18
+ ### Added
19
+ - **Long Polling Support for Read Operations**: Added optional `withLongPolling` parameter to all GET-based read methods
20
+ - **IAdtObject Interface**:
21
+ - `read(config, version?, options?)` - Added optional `options?: { withLongPolling?: boolean }` parameter
22
+ - `readMetadata(config, options?)` - Added optional `options?: { withLongPolling?: boolean }` parameter
23
+ - `readTransport(config, options?)` - Added optional `options?: { withLongPolling?: boolean }` parameter
24
+ - **IBuilder Interface** (in `@mcp-abap-adt/adt-clients`):
25
+ - `read(version?, options?)` - Added optional `options?: { withLongPolling?: boolean }` parameter
26
+ - **Usage**: When `withLongPolling: true` is specified, the request includes `?withLongPolling=true` query parameter
27
+ - This allows the server to hold the connection open until the object becomes available or a timeout occurs
28
+ - Useful after create/activate operations to wait until object is ready for reading
29
+ - Can replace timeout-based polling in tests and production code
30
+ - **Example**:
31
+ ```typescript
32
+ // Wait for object to become available after creation
33
+ const domain = await adtDomain.read(
34
+ { domainName: 'Z_TEST' },
35
+ 'active',
36
+ { withLongPolling: true }
37
+ );
38
+
39
+ // Read metadata with long polling
40
+ const metadata = await adtDomain.readMetadata(
41
+ { domainName: 'Z_TEST' },
42
+ { withLongPolling: true }
43
+ );
44
+ ```
45
+
10
46
  ## [0.1.14] - 2025-12-19
11
47
 
12
48
  ### Added
@@ -236,4 +272,3 @@ connection.setSessionState(state);
236
272
  - `utils/` - Utility types and interfaces
237
273
 
238
274
  [0.1.0]: https://github.com/fr0ster/mcp-abap-adt-interfaces/releases/tag/v0.1.0
239
-
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
@@ -78,13 +78,19 @@ export interface IAdtOperationOptions {
78
78
  */
79
79
  xmlContent?: string;
80
80
  /**
81
- * Timeout for operations in milliseconds
81
+ * HTTP request timeout for operations in milliseconds
82
82
  * @default 1000 (1 second)
83
83
  *
84
- * CRITICAL: Without timeouts, operations may fail due to system not completing commands in time.
84
+ * Note: This timeout is for HTTP request completion, not for waiting object readiness.
85
+ * For waiting object readiness after create/update/activate operations, use `withLongPolling: true`
86
+ * in read operations instead of fixed timeouts.
87
+ *
88
+ * The `timeout` parameter controls how long to wait for HTTP responses from the server.
85
89
  * Increase timeout for complex operations or slow systems.
86
90
  *
87
91
  * Example: timeout: 5000 for 5 seconds
92
+ *
93
+ * @see withLongPolling - Use long polling for waiting object readiness
88
94
  */
89
95
  timeout?: number;
90
96
  }
@@ -122,18 +128,28 @@ export interface IAdtObject<TConfig, TReadResult = TConfig> {
122
128
  *
123
129
  * @param config - Object identification (name, etc.)
124
130
  * @param version - 'active' or 'inactive'
131
+ * @param options - Optional read options
132
+ * @param options.withLongPolling - If true, adds ?withLongPolling=true to wait for object to become available
133
+ * Useful after create/activate operations to wait until object is ready
125
134
  * @returns Object configuration or source code, or undefined if not found
126
135
  */
127
- read(config: Partial<TConfig>, version?: 'active' | 'inactive'): Promise<TReadResult | undefined>;
136
+ read(config: Partial<TConfig>, version?: 'active' | 'inactive', options?: {
137
+ withLongPolling?: boolean;
138
+ }): Promise<TReadResult | undefined>;
128
139
  /**
129
140
  * Read object metadata (object characteristics: package, responsible, description, etc.)
130
141
  * For objects with source code (Class, Interface, Program), this reads metadata separately from source code.
131
142
  * For objects without source code (Domain, DataElement), this may delegate to read() as read() already returns metadata.
132
143
  *
133
144
  * @param config - Object identification (name, etc.)
145
+ * @param options - Optional read options
146
+ * @param options.withLongPolling - If true, adds ?withLongPolling=true to wait for object to become available
147
+ * Useful after create/activate operations to wait until object is ready
134
148
  * @returns State with metadata result
135
149
  */
136
- readMetadata(config: Partial<TConfig>): Promise<TReadResult>;
150
+ readMetadata(config: Partial<TConfig>, options?: {
151
+ withLongPolling?: boolean;
152
+ }): Promise<TReadResult>;
137
153
  /**
138
154
  * Update object with full operation chain:
139
155
  * lock → check(inactive) → update → unlock → check → activate (optional)
@@ -171,8 +187,13 @@ export interface IAdtObject<TConfig, TReadResult = TConfig> {
171
187
  /**
172
188
  * Read transport request information for the object
173
189
  * @param config - Object identification
190
+ * @param options - Optional read options
191
+ * @param options.withLongPolling - If true, adds ?withLongPolling=true to wait for object to become available
192
+ * Useful after create/activate operations to wait until object is ready
174
193
  * @returns State with transport result
175
194
  */
176
- readTransport(config: Partial<TConfig>): Promise<TReadResult>;
195
+ readTransport(config: Partial<TConfig>, options?: {
196
+ withLongPolling?: boolean;
197
+ }): Promise<TReadResult>;
177
198
  }
178
199
  //# sourceMappingURL=IAdtObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IAdtObject.d.ts","sourceRoot":"","sources":["../../src/adt/IAdtObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB;IAC9B,6BAA6B;;IAE7B,iFAAiF;;IAEjF,+BAA+B;;IAE/B,6BAA6B;;IAE7B,2BAA2B;;IAE3B,6BAA6B;;IAE7B,+BAA+B;;IAE/B,0BAA0B;;IAE1B,4BAA4B;;IAE5B,8BAA8B;;CAEtB,CAAC;AAEX;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B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AAE,QAAQ,GAAG,UAAU,EAC/B,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,GACtC,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAEpC;;;;;;;;;;OAUG;IACH,YAAY,CACV,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EACxB,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,GACtC,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;;;;;;;;OASG;IACH,MAAM,CACJ,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EACxB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEvD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzD;;;;;;OAMG;IACH,KAAK,CACH,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EACxB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,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.16",
4
4
  "description": "Shared interfaces for MCP ABAP ADT packages",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",