@mcp-abap-adt/interfaces 0.1.4 → 0.1.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/CHANGELOG.md CHANGED
@@ -7,6 +7,54 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.6] - 2025-12-09
11
+
12
+ ### Added
13
+ - **Unified Operation Options Interface**: Created `IAdtOperationOptions` interface
14
+ - Unified interface for both create and update operations (replaces `CreateOptions` and `UpdateOptions`)
15
+ - Includes all fields from both interfaces: `activateOnCreate`, `activateOnUpdate`, `deleteOnFailure`, `sourceCode`, `xmlContent`, `timeout`
16
+ - `sourceCode` and `xmlContent` now available for update operations (previously only in create)
17
+ - `timeout?: number` - Timeout for operations in milliseconds (default: 1000)
18
+ - Prevents operation failures due to system not completing commands in time
19
+ - Increase timeout for complex operations or slow systems
20
+
21
+ ### Changed
22
+ - **Operation Options Interfaces**: Unified `CreateOptions` and `UpdateOptions` into `IAdtOperationOptions`
23
+ - Both create and update operations now use the same interface
24
+ - `sourceCode` and `xmlContent` are now available for update operations
25
+ - Removed `lockHandle` field from update options (update operations always start with lock internally)
26
+ - All interfaces now follow `I` prefix convention (`IAdtOperationOptions`)
27
+
28
+ ### Removed
29
+ - **Deprecated Interfaces**: Removed `CreateOptions` and `UpdateOptions` interfaces
30
+ - Replaced by unified `IAdtOperationOptions` interface
31
+ - No backward compatibility maintained (version < 1.0.0)
32
+
33
+ ## [0.1.5] - 2025-12-09
34
+
35
+ ### Added
36
+ - **High-Level ADT Object Operations Interface**: Added `IAdtObject` interface for high-level CRUD operations
37
+ - `IAdtObject<TConfig, TReadResult>` - Main interface for ADT object operations
38
+ - Provides simplified CRUD operations with automatic operation chains, error handling, and resource cleanup
39
+ - Methods: `validate()`, `create()`, `read()`, `update()`, `delete()`, `activate()`, `check()`
40
+ - Supports full operation chains:
41
+ - Create: validate → create → check → lock → check(inactive) → update → unlock → check → activate
42
+ - Update: lock → check(inactive) → update → unlock → check → activate
43
+ - Delete: check(deletion) → delete
44
+ - **Operation Options Interfaces**: Added options interfaces for create and update operations
45
+ - `CreateOptions` - Options for create operations:
46
+ - `activateOnCreate?: boolean` - Activate object after creation (default: false)
47
+ - `deleteOnFailure?: boolean` - Delete object if creation fails (default: false)
48
+ - `sourceCode?: string` - Source code to use for update after create
49
+ - `xmlContent?: string` - XML content to use for update after create
50
+ - `UpdateOptions` - Options for update operations:
51
+ - `activateOnUpdate?: boolean` - Activate object after update (default: false)
52
+ - `deleteOnFailure?: boolean` - Delete object if update fails (default: false)
53
+ - `lockHandle?: string` - Lock handle if object is already locked
54
+ - **ADT Domain**: New domain for ADT client interfaces
55
+ - All interfaces exported from `@mcp-abap-adt/interfaces` under ADT domain
56
+ - Located in `src/adt/IAdtObject.ts`
57
+
10
58
  ## [0.1.4] - 2025-12-08
11
59
 
12
60
  ### Breaking Changes
@@ -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 ADT operations (create and update)
13
+ * Unified interface for both create and update operations
14
+ */
15
+ export interface IAdtOperationOptions {
16
+ /**
17
+ * Activate object after creation (for create operations)
18
+ * @default false
19
+ */
20
+ activateOnCreate?: boolean;
21
+ /**
22
+ * Activate object after update (for update operations)
23
+ * @default false
24
+ */
25
+ activateOnUpdate?: boolean;
26
+ /**
27
+ * Delete object if operation fails
28
+ * @default false
29
+ */
30
+ deleteOnFailure?: boolean;
31
+ /**
32
+ * Source code to use for update
33
+ * Used in create operations for update after create, and in update operations
34
+ */
35
+ sourceCode?: string;
36
+ /**
37
+ * XML content to use for update
38
+ * Used for objects that use XML format (e.g., Domain, DataElement)
39
+ * Used in create operations for update after create, and in update operations
40
+ */
41
+ xmlContent?: string;
42
+ /**
43
+ * Timeout for operations in milliseconds
44
+ * @default 1000 (1 second)
45
+ *
46
+ * CRITICAL: Without timeouts, operations may fail due to system not completing commands in time.
47
+ * Increase timeout for complex operations or slow systems.
48
+ *
49
+ * Example: timeout: 5000 for 5 seconds
50
+ */
51
+ timeout?: number;
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?: IAdtOperationOptions): 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?: IAdtOperationOptions): 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;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;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;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IACxD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAE3D;;;;;;;;;OASG;IACH,MAAM,CACJ,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;;;;OAKG;IACH,IAAI,CACF,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EACxB,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,GAC9B,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAEpC;;;;;;;;;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,aAAa,CAAC,CAAC;IAEzD;;;;OAIG;IACH,QAAQ,CAAC,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 });
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, IAdtOperationOptions } from './adt/IAdtObject';
29
30
  //# sourceMappingURL=index.d.ts.map
@@ -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,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3E,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,YAAY,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGv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,EAAE,MAAM,6BAA6B,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,cAAc,WAAW,CAAC;AAG1B,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/interfaces",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Shared interfaces for MCP ABAP ADT packages",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",