@mcp-abap-adt/adt-clients 7.3.1 → 7.4.2
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/dist/clients/AdtClient.d.ts +32 -0
- package/dist/clients/AdtClient.d.ts.map +1 -1
- package/dist/clients/AdtClient.js +75 -30
- package/dist/core/accessControl/AdtAccessControl.d.ts +3 -1
- package/dist/core/accessControl/AdtAccessControl.d.ts.map +1 -1
- package/dist/core/accessControl/AdtAccessControl.js +11 -2
- package/dist/core/appendStructure/AdtAppendStructure.d.ts +3 -1
- package/dist/core/appendStructure/AdtAppendStructure.d.ts.map +1 -1
- package/dist/core/appendStructure/AdtAppendStructure.js +11 -2
- package/dist/core/authorizationField/AdtAuthorizationField.d.ts +3 -1
- package/dist/core/authorizationField/AdtAuthorizationField.d.ts.map +1 -1
- package/dist/core/authorizationField/AdtAuthorizationField.js +14 -3
- package/dist/core/behaviorDefinition/AdtBehaviorDefinition.d.ts +3 -1
- package/dist/core/behaviorDefinition/AdtBehaviorDefinition.d.ts.map +1 -1
- package/dist/core/behaviorDefinition/AdtBehaviorDefinition.js +11 -2
- package/dist/core/behaviorImplementation/AdtBehaviorImplementation.d.ts +2 -1
- package/dist/core/behaviorImplementation/AdtBehaviorImplementation.d.ts.map +1 -1
- package/dist/core/behaviorImplementation/AdtBehaviorImplementation.js +6 -3
- package/dist/core/class/AdtClass.d.ts +3 -1
- package/dist/core/class/AdtClass.d.ts.map +1 -1
- package/dist/core/class/AdtClass.js +16 -3
- package/dist/core/dataElement/AdtDataElement.d.ts +3 -1
- package/dist/core/dataElement/AdtDataElement.d.ts.map +1 -1
- package/dist/core/dataElement/AdtDataElement.js +9 -1
- package/dist/core/ddl/AdtDdl.d.ts +3 -1
- package/dist/core/ddl/AdtDdl.d.ts.map +1 -1
- package/dist/core/ddl/AdtDdl.js +11 -2
- package/dist/core/domain/AdtDomain.d.ts +3 -1
- package/dist/core/domain/AdtDomain.d.ts.map +1 -1
- package/dist/core/domain/AdtDomain.js +11 -1
- package/dist/core/enhancement/AdtEnhancement.d.ts +12 -1
- package/dist/core/enhancement/AdtEnhancement.d.ts.map +1 -1
- package/dist/core/enhancement/AdtEnhancement.js +35 -4
- package/dist/core/featureToggle/AdtFeatureToggle.d.ts +3 -1
- package/dist/core/featureToggle/AdtFeatureToggle.d.ts.map +1 -1
- package/dist/core/featureToggle/AdtFeatureToggle.js +14 -2
- package/dist/core/functionGroup/AdtFunctionGroup.d.ts +3 -1
- package/dist/core/functionGroup/AdtFunctionGroup.d.ts.map +1 -1
- package/dist/core/functionGroup/AdtFunctionGroup.js +9 -1
- package/dist/core/functionInclude/AdtFunctionInclude.d.ts +9 -1
- package/dist/core/functionInclude/AdtFunctionInclude.d.ts.map +1 -1
- package/dist/core/functionInclude/AdtFunctionInclude.js +33 -3
- package/dist/core/functionModule/AdtFunctionModule.d.ts +9 -1
- package/dist/core/functionModule/AdtFunctionModule.d.ts.map +1 -1
- package/dist/core/functionModule/AdtFunctionModule.js +27 -2
- package/dist/core/interface/AdtInterface.d.ts +3 -1
- package/dist/core/interface/AdtInterface.d.ts.map +1 -1
- package/dist/core/interface/AdtInterface.js +11 -2
- package/dist/core/messageClass/AdtMessageClass.d.ts +3 -1
- package/dist/core/messageClass/AdtMessageClass.d.ts.map +1 -1
- package/dist/core/messageClass/AdtMessageClass.js +11 -2
- package/dist/core/metadataExtension/AdtMetadataExtension.d.ts +3 -1
- package/dist/core/metadataExtension/AdtMetadataExtension.d.ts.map +1 -1
- package/dist/core/metadataExtension/AdtMetadataExtension.js +9 -1
- package/dist/core/package/AdtPackage.d.ts +3 -1
- package/dist/core/package/AdtPackage.d.ts.map +1 -1
- package/dist/core/package/AdtPackage.js +11 -2
- package/dist/core/program/AdtProgram.d.ts +3 -1
- package/dist/core/program/AdtProgram.d.ts.map +1 -1
- package/dist/core/program/AdtProgram.js +11 -2
- package/dist/core/scalarFunction/AdtScalarFunction.d.ts +3 -1
- package/dist/core/scalarFunction/AdtScalarFunction.d.ts.map +1 -1
- package/dist/core/scalarFunction/AdtScalarFunction.js +11 -2
- package/dist/core/scalarFunctionImplementation/AdtScalarFunctionImplementation.d.ts +3 -1
- package/dist/core/scalarFunctionImplementation/AdtScalarFunctionImplementation.d.ts.map +1 -1
- package/dist/core/scalarFunctionImplementation/AdtScalarFunctionImplementation.js +14 -2
- package/dist/core/serviceDefinition/AdtServiceDefinition.d.ts +6 -3
- package/dist/core/serviceDefinition/AdtServiceDefinition.d.ts.map +1 -1
- package/dist/core/serviceDefinition/AdtServiceDefinition.js +14 -4
- package/dist/core/shared/LockRegistry.d.ts +77 -0
- package/dist/core/shared/LockRegistry.d.ts.map +1 -0
- package/dist/core/shared/LockRegistry.js +91 -0
- package/dist/core/structure/AdtStructure.d.ts +3 -1
- package/dist/core/structure/AdtStructure.d.ts.map +1 -1
- package/dist/core/structure/AdtStructure.js +11 -2
- package/dist/core/table/AdtTable.d.ts +3 -1
- package/dist/core/table/AdtTable.d.ts.map +1 -1
- package/dist/core/table/AdtTable.js +11 -2
- package/dist/core/tabletype/AdtDdicTableType.d.ts +3 -1
- package/dist/core/tabletype/AdtDdicTableType.d.ts.map +1 -1
- package/dist/core/tabletype/AdtDdicTableType.js +9 -1
- package/dist/core/transformation/AdtTransformation.d.ts +3 -1
- package/dist/core/transformation/AdtTransformation.d.ts.map +1 -1
- package/dist/core/transformation/AdtTransformation.js +11 -2
- package/package.json +1 -1
|
@@ -37,6 +37,7 @@ import { type IScalarFunctionImplementationConfig, type IScalarFunctionImplement
|
|
|
37
37
|
import { type IAdtServiceBinding } from '../core/service';
|
|
38
38
|
import { type IServiceDefinitionConfig, type IServiceDefinitionState } from '../core/serviceDefinition';
|
|
39
39
|
import { AdtUtils } from '../core/shared/AdtUtils';
|
|
40
|
+
import { type LockFailure, LockRegistry } from '../core/shared/LockRegistry';
|
|
40
41
|
import { type IStructureConfig, type IStructureState } from '../core/structure';
|
|
41
42
|
import { type ITableConfig, type ITableState } from '../core/table';
|
|
42
43
|
import { type ITableTypeConfig, type ITableTypeState } from '../core/tabletype';
|
|
@@ -64,6 +65,11 @@ export declare class AdtClient {
|
|
|
64
65
|
protected logger: ILogger;
|
|
65
66
|
protected systemContext: IAdtSystemContext;
|
|
66
67
|
protected contentTypes?: import('../core/shared/contentTypes').IAdtContentTypes;
|
|
68
|
+
/**
|
|
69
|
+
* Session-scoped registry of locks held by handlers created from this client.
|
|
70
|
+
* All handlers share one stateful session, so all their locks belong here.
|
|
71
|
+
*/
|
|
72
|
+
protected readonly lockRegistry: LockRegistry;
|
|
67
73
|
constructor(connection: IAbapConnection, logger?: ILogger, options?: IAdtClientOptions);
|
|
68
74
|
/**
|
|
69
75
|
* Get high-level operations for Class objects
|
|
@@ -85,6 +91,32 @@ export declare class AdtClient {
|
|
|
85
91
|
* @returns IAdtObject instance for Domain operations
|
|
86
92
|
*/
|
|
87
93
|
getDomain(): IAdtObject<IDomainConfig, IDomainState>;
|
|
94
|
+
/**
|
|
95
|
+
* Last-resort cleanup: release every lock still held by handlers created from
|
|
96
|
+
* this client. Returns the locks that could not be released.
|
|
97
|
+
*
|
|
98
|
+
* This is a safety net for abandoned locks (a forgot-to-unlock, or a managed
|
|
99
|
+
* flow that threw before its unlock). Preventing a timeout from interrupting a
|
|
100
|
+
* lock→unlock critical section remains the caller's responsibility.
|
|
101
|
+
*/
|
|
102
|
+
unlockAll(): Promise<LockFailure[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Keys of locks currently held by handlers created from this client
|
|
105
|
+
* (e.g. `Domain/ZFOO`, `DataElement/ZBAR`). Lets a consumer inspect whether a
|
|
106
|
+
* session was left with dangling locks before deciding to `unlockAll()`.
|
|
107
|
+
*/
|
|
108
|
+
get pendingLocks(): string[];
|
|
109
|
+
/**
|
|
110
|
+
* Release all held locks when used with `await using`.
|
|
111
|
+
*
|
|
112
|
+
* Best-effort: like {@link unlockAll}, this never throws — a lock whose unlock
|
|
113
|
+
* fails is retained rather than surfaced as an error, so a disposer failure
|
|
114
|
+
* cannot mask the error that ended the `using` scope. Any residual failures
|
|
115
|
+
* are logged as a warning and remain observable via {@link pendingLocks}.
|
|
116
|
+
* Callers that must react to unlock failures should call `unlockAll()`
|
|
117
|
+
* explicitly and inspect the returned `LockFailure[]`.
|
|
118
|
+
*/
|
|
119
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
88
120
|
/**
|
|
89
121
|
* Get high-level operations for DataElement objects
|
|
90
122
|
* @returns IAdtObject instance for DataElement operations
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdtClient.d.ts","sourceRoot":"","sources":["../../src/clients/AdtClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,OAAO,EACR,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAML,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAU,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;A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W,CAAC;IAUvE;;;OAGG;IACH,cAAc,IAAI,UAAU,CAAC,kBAAkB,EAAE,WAAW,CAAC;CAS9D"}
|
|
@@ -39,6 +39,7 @@ const scalarFunctionImplementation_1 = require("../core/scalarFunctionImplementa
|
|
|
39
39
|
const service_1 = require("../core/service");
|
|
40
40
|
const serviceDefinition_1 = require("../core/serviceDefinition");
|
|
41
41
|
const AdtUtils_1 = require("../core/shared/AdtUtils");
|
|
42
|
+
const LockRegistry_1 = require("../core/shared/LockRegistry");
|
|
42
43
|
const structure_1 = require("../core/structure");
|
|
43
44
|
const table_1 = require("../core/table");
|
|
44
45
|
const tabletype_1 = require("../core/tabletype");
|
|
@@ -50,8 +51,15 @@ class AdtClient {
|
|
|
50
51
|
logger;
|
|
51
52
|
systemContext;
|
|
52
53
|
contentTypes;
|
|
54
|
+
/**
|
|
55
|
+
* Session-scoped registry of locks held by handlers created from this client.
|
|
56
|
+
* All handlers share one stateful session, so all their locks belong here.
|
|
57
|
+
*/
|
|
58
|
+
lockRegistry;
|
|
53
59
|
constructor(connection, logger, options) {
|
|
54
60
|
this.connection = connection;
|
|
61
|
+
// Pass the connection so unlockAll() can keep the whole batch stateful.
|
|
62
|
+
this.lockRegistry = new LockRegistry_1.LockRegistry(connection);
|
|
55
63
|
this.logger = logger ?? {
|
|
56
64
|
debug: () => { },
|
|
57
65
|
info: () => { },
|
|
@@ -84,63 +92,100 @@ class AdtClient {
|
|
|
84
92
|
* @returns IAdtObject instance for Class operations
|
|
85
93
|
*/
|
|
86
94
|
getClass() {
|
|
87
|
-
return new class_1.AdtClass(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
95
|
+
return new class_1.AdtClass(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
88
96
|
}
|
|
89
97
|
/**
|
|
90
98
|
* Get high-level operations for Program objects
|
|
91
99
|
* @returns IAdtObject instance for Program operations
|
|
92
100
|
*/
|
|
93
101
|
getProgram() {
|
|
94
|
-
return new program_1.AdtProgram(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
102
|
+
return new program_1.AdtProgram(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
95
103
|
}
|
|
96
104
|
/**
|
|
97
105
|
* Get high-level operations for Interface objects
|
|
98
106
|
* @returns IAdtObject instance for Interface operations
|
|
99
107
|
*/
|
|
100
108
|
getInterface() {
|
|
101
|
-
return new interface_1.AdtInterface(this.connection, this.logger, this.systemContext);
|
|
109
|
+
return new interface_1.AdtInterface(this.connection, this.logger, this.systemContext, undefined, this.lockRegistry);
|
|
102
110
|
}
|
|
103
111
|
/**
|
|
104
112
|
* Get high-level operations for Domain objects
|
|
105
113
|
* @returns IAdtObject instance for Domain operations
|
|
106
114
|
*/
|
|
107
115
|
getDomain() {
|
|
108
|
-
return new domain_1.AdtDomain(this.connection, this.logger, this.systemContext);
|
|
116
|
+
return new domain_1.AdtDomain(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Last-resort cleanup: release every lock still held by handlers created from
|
|
120
|
+
* this client. Returns the locks that could not be released.
|
|
121
|
+
*
|
|
122
|
+
* This is a safety net for abandoned locks (a forgot-to-unlock, or a managed
|
|
123
|
+
* flow that threw before its unlock). Preventing a timeout from interrupting a
|
|
124
|
+
* lock→unlock critical section remains the caller's responsibility.
|
|
125
|
+
*/
|
|
126
|
+
async unlockAll() {
|
|
127
|
+
return this.lockRegistry.unlockAll();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Keys of locks currently held by handlers created from this client
|
|
131
|
+
* (e.g. `Domain/ZFOO`, `DataElement/ZBAR`). Lets a consumer inspect whether a
|
|
132
|
+
* session was left with dangling locks before deciding to `unlockAll()`.
|
|
133
|
+
*/
|
|
134
|
+
get pendingLocks() {
|
|
135
|
+
return this.lockRegistry.pending;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Release all held locks when used with `await using`.
|
|
139
|
+
*
|
|
140
|
+
* Best-effort: like {@link unlockAll}, this never throws — a lock whose unlock
|
|
141
|
+
* fails is retained rather than surfaced as an error, so a disposer failure
|
|
142
|
+
* cannot mask the error that ended the `using` scope. Any residual failures
|
|
143
|
+
* are logged as a warning and remain observable via {@link pendingLocks}.
|
|
144
|
+
* Callers that must react to unlock failures should call `unlockAll()`
|
|
145
|
+
* explicitly and inspect the returned `LockFailure[]`.
|
|
146
|
+
*/
|
|
147
|
+
async [Symbol.asyncDispose]() {
|
|
148
|
+
const failures = await this.unlockAll();
|
|
149
|
+
if (failures.length > 0) {
|
|
150
|
+
this.logger.warn(`[AdtClient] dispose left ${failures.length} lock(s) unreleased: ${failures
|
|
151
|
+
.map((f) => f.key)
|
|
152
|
+
.join(', ')}. They remain in pendingLocks; retry unlockAll() or rely on session-drop.`);
|
|
153
|
+
}
|
|
109
154
|
}
|
|
110
155
|
/**
|
|
111
156
|
* Get high-level operations for DataElement objects
|
|
112
157
|
* @returns IAdtObject instance for DataElement operations
|
|
113
158
|
*/
|
|
114
159
|
getDataElement() {
|
|
115
|
-
return new dataElement_1.AdtDataElement(this.connection, this.logger, this.systemContext);
|
|
160
|
+
return new dataElement_1.AdtDataElement(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
116
161
|
}
|
|
117
162
|
/**
|
|
118
163
|
* Get high-level operations for AuthorizationField objects
|
|
119
164
|
* @returns IAdtObject instance for AuthorizationField operations
|
|
120
165
|
*/
|
|
121
166
|
getAuthorizationField() {
|
|
122
|
-
return new authorizationField_1.AdtAuthorizationField(this.connection, this.logger, this.systemContext);
|
|
167
|
+
return new authorizationField_1.AdtAuthorizationField(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
123
168
|
}
|
|
124
169
|
/**
|
|
125
170
|
* Get high-level operations for Structure objects
|
|
126
171
|
* @returns IAdtObject instance for Structure operations
|
|
127
172
|
*/
|
|
128
173
|
getStructure() {
|
|
129
|
-
return new structure_1.AdtStructure(this.connection, this.logger, this.systemContext);
|
|
174
|
+
return new structure_1.AdtStructure(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
130
175
|
}
|
|
131
176
|
/**
|
|
132
177
|
* Get high-level operations for Table objects
|
|
133
178
|
* @returns IAdtObject instance for Table operations
|
|
134
179
|
*/
|
|
135
180
|
getTable() {
|
|
136
|
-
return new table_1.AdtTable(this.connection, this.logger, this.systemContext);
|
|
181
|
+
return new table_1.AdtTable(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
137
182
|
}
|
|
138
183
|
/**
|
|
139
184
|
* Get high-level operations for TableType (DDIC Table Type) objects
|
|
140
185
|
* @returns IAdtObject instance for TableType operations
|
|
141
186
|
*/
|
|
142
187
|
getTableType() {
|
|
143
|
-
return new tabletype_1.AdtDdicTableType(this.connection, this.logger, this.systemContext);
|
|
188
|
+
return new tabletype_1.AdtDdicTableType(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
144
189
|
}
|
|
145
190
|
/**
|
|
146
191
|
* Generic client for ABAP DDL source objects (`/sap/bc/adt/ddic/ddl/sources/`):
|
|
@@ -150,42 +195,42 @@ class AdtClient {
|
|
|
150
195
|
* @returns IAdtObject instance for DDL source operations
|
|
151
196
|
*/
|
|
152
197
|
getDdl() {
|
|
153
|
-
return new ddl_1.AdtDdl(this.connection, this.logger, this.systemContext);
|
|
198
|
+
return new ddl_1.AdtDdl(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
154
199
|
}
|
|
155
200
|
/**
|
|
156
201
|
* Get high-level operations for FunctionGroup objects
|
|
157
202
|
* @returns IAdtObject instance for FunctionGroup operations
|
|
158
203
|
*/
|
|
159
204
|
getFunctionGroup() {
|
|
160
|
-
return new functionGroup_1.AdtFunctionGroup(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
205
|
+
return new functionGroup_1.AdtFunctionGroup(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
161
206
|
}
|
|
162
207
|
/**
|
|
163
208
|
* Get high-level operations for FunctionModule objects
|
|
164
209
|
* @returns IAdtObject instance for FunctionModule operations
|
|
165
210
|
*/
|
|
166
211
|
getFunctionModule() {
|
|
167
|
-
return new functionModule_1.AdtFunctionModule(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
212
|
+
return new functionModule_1.AdtFunctionModule(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
168
213
|
}
|
|
169
214
|
/**
|
|
170
215
|
* Get high-level operations for FunctionInclude objects
|
|
171
216
|
* @returns IAdtObject instance for FunctionInclude operations
|
|
172
217
|
*/
|
|
173
218
|
getFunctionInclude() {
|
|
174
|
-
return new functionInclude_1.AdtFunctionInclude(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
219
|
+
return new functionInclude_1.AdtFunctionInclude(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
175
220
|
}
|
|
176
221
|
/**
|
|
177
222
|
* Get high-level operations for Package objects
|
|
178
223
|
* @returns IAdtObject instance for Package operations
|
|
179
224
|
*/
|
|
180
225
|
getPackage() {
|
|
181
|
-
return new package_1.AdtPackage(this.connection, this.logger, this.systemContext);
|
|
226
|
+
return new package_1.AdtPackage(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
182
227
|
}
|
|
183
228
|
/**
|
|
184
229
|
* Get high-level operations for MessageClass (MSAG/N) objects
|
|
185
230
|
* @returns IAdtObject instance for MessageClass operations
|
|
186
231
|
*/
|
|
187
232
|
getMessageClass() {
|
|
188
|
-
return new messageClass_1.AdtMessageClass(this.connection, this.logger, this.systemContext);
|
|
233
|
+
return new messageClass_1.AdtMessageClass(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
189
234
|
}
|
|
190
235
|
/**
|
|
191
236
|
* Get high-level operations for a single message within a MessageClass.
|
|
@@ -200,7 +245,7 @@ class AdtClient {
|
|
|
200
245
|
* @returns IAdtObject instance for AccessControl operations
|
|
201
246
|
*/
|
|
202
247
|
getAccessControl() {
|
|
203
|
-
return new accessControl_1.AdtAccessControl(this.connection, this.logger, this.systemContext);
|
|
248
|
+
return new accessControl_1.AdtAccessControl(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
204
249
|
}
|
|
205
250
|
/**
|
|
206
251
|
* Get high-level operations for Transformation objects (XSLT)
|
|
@@ -208,32 +253,32 @@ class AdtClient {
|
|
|
208
253
|
* @returns IAdtObject instance for Transformation operations
|
|
209
254
|
*/
|
|
210
255
|
getTransformation() {
|
|
211
|
-
return new transformation_1.AdtTransformation(this.connection, this.logger, this.systemContext);
|
|
256
|
+
return new transformation_1.AdtTransformation(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
212
257
|
}
|
|
213
258
|
/**
|
|
214
259
|
* Get high-level operations for ServiceDefinition objects
|
|
215
260
|
* @returns IAdtObject instance for ServiceDefinition operations
|
|
216
261
|
*/
|
|
217
262
|
getServiceDefinition() {
|
|
218
|
-
return new serviceDefinition_1.AdtServiceDefinition(this.connection, this.logger, this.systemContext);
|
|
263
|
+
return new serviceDefinition_1.AdtServiceDefinition(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
219
264
|
}
|
|
220
265
|
/**
|
|
221
266
|
* Get high-level operations for CDS Scalar Function (DSFD/SCF) objects
|
|
222
267
|
*/
|
|
223
268
|
getScalarFunction() {
|
|
224
|
-
return new scalarFunction_1.AdtScalarFunction(this.connection, this.logger, this.systemContext);
|
|
269
|
+
return new scalarFunction_1.AdtScalarFunction(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
225
270
|
}
|
|
226
271
|
/**
|
|
227
272
|
* Get high-level operations for Scalar Function Implementation (DSFI/SFI) objects
|
|
228
273
|
*/
|
|
229
274
|
getScalarFunctionImplementation() {
|
|
230
|
-
return new scalarFunctionImplementation_1.AdtScalarFunctionImplementation(this.connection, this.logger, this.systemContext);
|
|
275
|
+
return new scalarFunctionImplementation_1.AdtScalarFunctionImplementation(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
231
276
|
}
|
|
232
277
|
/**
|
|
233
278
|
* Get high-level operations for Append Structure (TABL/DS) objects
|
|
234
279
|
*/
|
|
235
280
|
getAppendStructure() {
|
|
236
|
-
return new appendStructure_1.AdtAppendStructure(this.connection, this.logger, this.systemContext);
|
|
281
|
+
return new appendStructure_1.AdtAppendStructure(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
237
282
|
}
|
|
238
283
|
/**
|
|
239
284
|
* Get high-level operations for ServiceBinding objects
|
|
@@ -253,21 +298,21 @@ class AdtClient {
|
|
|
253
298
|
* @returns IAdtObject instance for BehaviorDefinition operations
|
|
254
299
|
*/
|
|
255
300
|
getBehaviorDefinition() {
|
|
256
|
-
return new behaviorDefinition_1.AdtBehaviorDefinition(this.connection, this.logger, this.systemContext);
|
|
301
|
+
return new behaviorDefinition_1.AdtBehaviorDefinition(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
257
302
|
}
|
|
258
303
|
/**
|
|
259
304
|
* Get high-level operations for BehaviorImplementation objects
|
|
260
305
|
* @returns IAdtObject instance for BehaviorImplementation operations
|
|
261
306
|
*/
|
|
262
307
|
getBehaviorImplementation() {
|
|
263
|
-
return new behaviorImplementation_1.AdtBehaviorImplementation(this.connection, this.logger);
|
|
308
|
+
return new behaviorImplementation_1.AdtBehaviorImplementation(this.connection, this.logger, this.lockRegistry);
|
|
264
309
|
}
|
|
265
310
|
/**
|
|
266
311
|
* Get high-level operations for MetadataExtension objects
|
|
267
312
|
* @returns IAdtObject instance for MetadataExtension operations
|
|
268
313
|
*/
|
|
269
314
|
getMetadataExtension() {
|
|
270
|
-
return new metadataExtension_1.AdtMetadataExtension(this.connection, this.logger, this.systemContext);
|
|
315
|
+
return new metadataExtension_1.AdtMetadataExtension(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
271
316
|
}
|
|
272
317
|
/**
|
|
273
318
|
* Get high-level operations for Enhancement objects
|
|
@@ -280,14 +325,14 @@ class AdtClient {
|
|
|
280
325
|
* @returns IAdtObject instance for Enhancement operations
|
|
281
326
|
*/
|
|
282
327
|
getEnhancement() {
|
|
283
|
-
return new enhancement_1.AdtEnhancement(this.connection, this.logger, this.systemContext);
|
|
328
|
+
return new enhancement_1.AdtEnhancement(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
284
329
|
}
|
|
285
330
|
/**
|
|
286
331
|
* Get high-level operations for FeatureToggle objects
|
|
287
332
|
* @returns IFeatureToggleObject instance for FeatureToggle operations
|
|
288
333
|
*/
|
|
289
334
|
getFeatureToggle() {
|
|
290
|
-
return new featureToggle_1.AdtFeatureToggle(this.connection, this.logger, this.systemContext);
|
|
335
|
+
return new featureToggle_1.AdtFeatureToggle(this.connection, this.logger, this.systemContext, this.lockRegistry);
|
|
291
336
|
}
|
|
292
337
|
/**
|
|
293
338
|
* Get high-level operations for UnitTest objects
|
|
@@ -330,28 +375,28 @@ class AdtClient {
|
|
|
330
375
|
* @returns IAdtObject instance for LocalTestClass operations
|
|
331
376
|
*/
|
|
332
377
|
getLocalTestClass() {
|
|
333
|
-
return new class_1.AdtLocalTestClass(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
378
|
+
return new class_1.AdtLocalTestClass(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
334
379
|
}
|
|
335
380
|
/**
|
|
336
381
|
* Get high-level operations for LocalTypes objects
|
|
337
382
|
* @returns IAdtObject instance for LocalTypes operations
|
|
338
383
|
*/
|
|
339
384
|
getLocalTypes() {
|
|
340
|
-
return new class_1.AdtLocalTypes(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
385
|
+
return new class_1.AdtLocalTypes(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
341
386
|
}
|
|
342
387
|
/**
|
|
343
388
|
* Get high-level operations for LocalDefinitions objects
|
|
344
389
|
* @returns IAdtObject instance for LocalDefinitions operations
|
|
345
390
|
*/
|
|
346
391
|
getLocalDefinitions() {
|
|
347
|
-
return new class_1.AdtLocalDefinitions(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
392
|
+
return new class_1.AdtLocalDefinitions(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
348
393
|
}
|
|
349
394
|
/**
|
|
350
395
|
* Get high-level operations for LocalMacros objects
|
|
351
396
|
* @returns IAdtObject instance for LocalMacros operations
|
|
352
397
|
*/
|
|
353
398
|
getLocalMacros() {
|
|
354
|
-
return new class_1.AdtLocalMacros(this.connection, this.logger, this.systemContext, this.contentTypes);
|
|
399
|
+
return new class_1.AdtLocalMacros(this.connection, this.logger, this.systemContext, this.contentTypes, this.lockRegistry);
|
|
355
400
|
}
|
|
356
401
|
}
|
|
357
402
|
exports.AdtClient = AdtClient;
|
|
@@ -19,14 +19,16 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { IAbapConnection, IAdtObject, IAdtOperationOptions, ILogger } from '@mcp-abap-adt/interfaces';
|
|
21
21
|
import type { IAdtSystemContext } from '../../clients/AdtClient';
|
|
22
|
+
import { type LockRegistry } from '../shared/LockRegistry';
|
|
22
23
|
import type { IReadOptions } from '../shared/types';
|
|
23
24
|
import type { IAccessControlConfig, IAccessControlState } from './types';
|
|
24
25
|
export declare class AdtAccessControl implements IAdtObject<IAccessControlConfig, IAccessControlState> {
|
|
25
26
|
private readonly connection;
|
|
26
27
|
private readonly logger?;
|
|
27
28
|
private readonly systemContext;
|
|
29
|
+
private readonly lockTracker;
|
|
28
30
|
readonly objectType: string;
|
|
29
|
-
constructor(connection: IAbapConnection, logger?: ILogger, systemContext?: IAdtSystemContext);
|
|
31
|
+
constructor(connection: IAbapConnection, logger?: ILogger, systemContext?: IAdtSystemContext, lockRegistry?: LockRegistry);
|
|
30
32
|
/**
|
|
31
33
|
* Validate access control configuration before creation
|
|
32
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdtAccessControl.d.ts","sourceRoot":"","sources":["../../../src/core/accessControl/AdtAccessControl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;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mC/B;;;OAGG;IACG,QAAQ,CACZ,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACpC,OAAO,CAAC,mBAAmB,CAAC;IAqB/B;;OAEG;IACG,KAAK,CACT,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACrC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC;IAoB/B;;OAEG;IACG,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAclE;;OAEG;IACG,MAAM,CACV,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACrC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,CAAC;IAmB/B,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAIjD,gBAAgB,CAAC,UAAU,EAAE,MAAM;CAGpC"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.AdtAccessControl = void 0;
|
|
23
23
|
const internalUtils_1 = require("../../utils/internalUtils");
|
|
24
|
+
const LockRegistry_1 = require("../shared/LockRegistry");
|
|
24
25
|
const activation_1 = require("./activation");
|
|
25
26
|
const check_1 = require("./check");
|
|
26
27
|
const create_1 = require("./create");
|
|
@@ -35,11 +36,13 @@ class AdtAccessControl {
|
|
|
35
36
|
connection;
|
|
36
37
|
logger;
|
|
37
38
|
systemContext;
|
|
39
|
+
lockTracker;
|
|
38
40
|
objectType = 'AccessControl';
|
|
39
|
-
constructor(connection, logger, systemContext) {
|
|
41
|
+
constructor(connection, logger, systemContext, lockRegistry) {
|
|
40
42
|
this.connection = connection;
|
|
41
43
|
this.logger = logger;
|
|
42
44
|
this.systemContext = systemContext ?? {};
|
|
45
|
+
this.lockTracker = (0, LockRegistry_1.createLockTracker)(lockRegistry, this.objectType, (name, lockHandle) => (0, unlock_1.unlockAccessControl)(this.connection, name, lockHandle));
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
45
48
|
* Validate access control configuration before creation
|
|
@@ -228,6 +231,7 @@ class AdtAccessControl {
|
|
|
228
231
|
this.logger?.info?.('Step 1: Locking access control');
|
|
229
232
|
this.connection.setSessionType('stateful');
|
|
230
233
|
lockHandle = await (0, lock_1.lockAccessControl)(this.connection, config.accessControlName);
|
|
234
|
+
this.lockTracker.track(config.accessControlName, lockHandle);
|
|
231
235
|
this.logger?.info?.('Access control locked, handle:', lockHandle);
|
|
232
236
|
// 2. Check inactive with code for update (from options or config)
|
|
233
237
|
const codeToCheck = options?.sourceCode || config.sourceCode;
|
|
@@ -245,10 +249,11 @@ class AdtAccessControl {
|
|
|
245
249
|
transport_request: config.transportRequest,
|
|
246
250
|
}, lockHandle);
|
|
247
251
|
this.logger?.info?.('Access control updated');
|
|
252
|
+
// Poll the inactive version: the write above produced it; the active version may not exist yet.
|
|
248
253
|
// 3.5. Read with long polling (wait for object to be ready after update)
|
|
249
254
|
this.logger?.info?.('read (wait for object ready after update)');
|
|
250
255
|
try {
|
|
251
|
-
await this.read({ accessControlName: config.accessControlName }, '
|
|
256
|
+
await this.read({ accessControlName: config.accessControlName }, 'inactive', { withLongPolling: true });
|
|
252
257
|
this.logger?.info?.('object is ready after update');
|
|
253
258
|
}
|
|
254
259
|
catch (readError) {
|
|
@@ -262,6 +267,7 @@ class AdtAccessControl {
|
|
|
262
267
|
this.connection.setSessionType('stateful');
|
|
263
268
|
await (0, unlock_1.unlockAccessControl)(this.connection, config.accessControlName, lockHandle);
|
|
264
269
|
this.connection.setSessionType('stateless');
|
|
270
|
+
this.lockTracker.untrack(config.accessControlName);
|
|
265
271
|
lockHandle = undefined;
|
|
266
272
|
this.logger?.info?.('Access control unlocked');
|
|
267
273
|
}
|
|
@@ -304,6 +310,7 @@ class AdtAccessControl {
|
|
|
304
310
|
this.connection.setSessionType('stateful');
|
|
305
311
|
await (0, unlock_1.unlockAccessControl)(this.connection, config.accessControlName, lockHandle);
|
|
306
312
|
this.connection.setSessionType('stateless');
|
|
313
|
+
this.lockTracker.untrack(config.accessControlName);
|
|
307
314
|
}
|
|
308
315
|
catch (unlockError) {
|
|
309
316
|
this.logger?.warn?.('Failed to unlock during cleanup:', (0, internalUtils_1.safeErrorMessage)(unlockError));
|
|
@@ -410,6 +417,7 @@ class AdtAccessControl {
|
|
|
410
417
|
}
|
|
411
418
|
this.connection.setSessionType('stateful');
|
|
412
419
|
const lockHandle = await (0, lock_1.lockAccessControl)(this.connection, config.accessControlName);
|
|
420
|
+
this.lockTracker.track(config.accessControlName, lockHandle);
|
|
413
421
|
return lockHandle;
|
|
414
422
|
}
|
|
415
423
|
/**
|
|
@@ -422,6 +430,7 @@ class AdtAccessControl {
|
|
|
422
430
|
this.connection.setSessionType('stateful');
|
|
423
431
|
const result = await (0, unlock_1.unlockAccessControl)(this.connection, config.accessControlName, lockHandle);
|
|
424
432
|
this.connection.setSessionType('stateless');
|
|
433
|
+
this.lockTracker.untrack(config.accessControlName);
|
|
425
434
|
return {
|
|
426
435
|
unlockResult: result,
|
|
427
436
|
errors: [],
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IAbapConnection, IAdtObject, IAdtOperationOptions, ILogger } from '@mcp-abap-adt/interfaces';
|
|
6
6
|
import type { IAdtSystemContext } from '../../clients/AdtClient';
|
|
7
|
+
import { type LockRegistry } from '../shared/LockRegistry';
|
|
7
8
|
import type { IReadOptions } from '../shared/types';
|
|
8
9
|
import type { IAppendStructureConfig, IAppendStructureState } from './types';
|
|
9
10
|
export declare class AdtAppendStructure implements IAdtObject<IAppendStructureConfig, IAppendStructureState> {
|
|
10
11
|
private readonly connection;
|
|
11
12
|
private readonly logger?;
|
|
12
13
|
private readonly systemContext;
|
|
14
|
+
private readonly lockTracker;
|
|
13
15
|
readonly objectType: string;
|
|
14
|
-
constructor(connection: IAbapConnection, logger?: ILogger, systemContext?: IAdtSystemContext);
|
|
16
|
+
constructor(connection: IAbapConnection, logger?: ILogger, systemContext?: IAdtSystemContext, lockRegistry?: LockRegistry);
|
|
15
17
|
validate(config: Partial<IAppendStructureConfig>): Promise<IAppendStructureState>;
|
|
16
18
|
create(config: IAppendStructureConfig, _options?: IAdtOperationOptions): Promise<IAppendStructureState>;
|
|
17
19
|
read(config: Partial<IAppendStructureConfig>, version?: 'active' | 'inactive', options?: IReadOptions): Promise<IAppendStructureState | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdtAppendStructure.d.ts","sourceRoot":"","sources":["../../../src/core/appendStructure/AdtAppendStructure.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAEV,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,OAAO,EACR,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAWpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAW7E,qBAAa,kBACX,YAAW,UAAU,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;IAEpE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,SAAgB,UAAU,EAAE,MAAM,CAAqB;gBAGrD,UAAU,EAAE,eAAe,EAC3B,MAAM,CAAC,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"AdtAppendStructure.d.ts","sourceRoot":"","sources":["../../../src/core/appendStructure/AdtAppendStructure.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAEV,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,OAAO,EACR,MAAM,0BAA0B,CA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,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,GACtC,OAAO,CAAC,qBAAqB,CAAC;IAa3B,MAAM,CACV,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,EACvC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,qBAAqB,CAAC;IAgJ3B,MAAM,CACV,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,GACtC,OAAO,CAAC,qBAAqB,CAAC;IAmB3B,QAAQ,CACZ,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,GACtC,OAAO,CAAC,qBAAqB,CAAC;IAU3B,KAAK,CACT,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,EACvC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC;IAY3B,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAY9D,MAAM,CACV,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,EACvC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,qBAAqB,CAAC;IAiBjC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC;IAInD,gBAAgB,CAAC,UAAU,EAAE,MAAM;CAGpC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AdtAppendStructure = void 0;
|
|
4
4
|
const internalUtils_1 = require("../../utils/internalUtils");
|
|
5
|
+
const LockRegistry_1 = require("../shared/LockRegistry");
|
|
5
6
|
const activation_1 = require("./activation");
|
|
6
7
|
const check_1 = require("./check");
|
|
7
8
|
const create_1 = require("./create");
|
|
@@ -17,11 +18,13 @@ class AdtAppendStructure {
|
|
|
17
18
|
connection;
|
|
18
19
|
logger;
|
|
19
20
|
systemContext;
|
|
21
|
+
lockTracker;
|
|
20
22
|
objectType = 'AppendStructure';
|
|
21
|
-
constructor(connection, logger, systemContext) {
|
|
23
|
+
constructor(connection, logger, systemContext, lockRegistry) {
|
|
22
24
|
this.connection = connection;
|
|
23
25
|
this.logger = logger;
|
|
24
26
|
this.systemContext = systemContext ?? {};
|
|
27
|
+
this.lockTracker = (0, LockRegistry_1.createLockTracker)(lockRegistry, this.objectType, (name, lockHandle) => (0, unlock_1.unlockAppendStructure)(this.connection, name, lockHandle));
|
|
25
28
|
}
|
|
26
29
|
async validate(config) {
|
|
27
30
|
const state = { errors: [] };
|
|
@@ -119,6 +122,7 @@ class AdtAppendStructure {
|
|
|
119
122
|
try {
|
|
120
123
|
this.connection.setSessionType('stateful');
|
|
121
124
|
lockHandle = await (0, lock_1.lockAppendStructure)(this.connection, config.appendStructureName);
|
|
125
|
+
this.lockTracker.track(config.appendStructureName, lockHandle);
|
|
122
126
|
const codeToCheck = options?.sourceCode || config.sourceCode;
|
|
123
127
|
if (codeToCheck) {
|
|
124
128
|
await (0, check_1.checkAppendStructure)(this.connection, config.appendStructureName, 'inactive', codeToCheck);
|
|
@@ -142,6 +146,7 @@ class AdtAppendStructure {
|
|
|
142
146
|
finally {
|
|
143
147
|
this.connection.setSessionType('stateless');
|
|
144
148
|
}
|
|
149
|
+
this.lockTracker.untrack(config.appendStructureName);
|
|
145
150
|
lockHandle = undefined;
|
|
146
151
|
}
|
|
147
152
|
await (0, check_1.checkAppendStructure)(this.connection, config.appendStructureName, 'inactive');
|
|
@@ -163,6 +168,7 @@ class AdtAppendStructure {
|
|
|
163
168
|
try {
|
|
164
169
|
this.connection.setSessionType('stateful');
|
|
165
170
|
await (0, unlock_1.unlockAppendStructure)(this.connection, config.appendStructureName, lockHandle);
|
|
171
|
+
this.lockTracker.untrack(config.appendStructureName);
|
|
166
172
|
}
|
|
167
173
|
catch (unlockError) {
|
|
168
174
|
this.logger?.warn?.('Failed to unlock during cleanup:', (0, internalUtils_1.safeErrorMessage)(unlockError));
|
|
@@ -225,7 +231,9 @@ class AdtAppendStructure {
|
|
|
225
231
|
if (!config.appendStructureName)
|
|
226
232
|
throw new Error('Append structure name is required');
|
|
227
233
|
this.connection.setSessionType('stateful');
|
|
228
|
-
|
|
234
|
+
const lockHandle = await (0, lock_1.lockAppendStructure)(this.connection, config.appendStructureName);
|
|
235
|
+
this.lockTracker.track(config.appendStructureName, lockHandle);
|
|
236
|
+
return lockHandle;
|
|
229
237
|
}
|
|
230
238
|
async unlock(config, lockHandle) {
|
|
231
239
|
if (!config.appendStructureName)
|
|
@@ -233,6 +241,7 @@ class AdtAppendStructure {
|
|
|
233
241
|
this.connection.setSessionType('stateful');
|
|
234
242
|
try {
|
|
235
243
|
const unlockResult = await (0, unlock_1.unlockAppendStructure)(this.connection, config.appendStructureName, lockHandle);
|
|
244
|
+
this.lockTracker.untrack(config.appendStructureName);
|
|
236
245
|
return { unlockResult, errors: [] };
|
|
237
246
|
}
|
|
238
247
|
finally {
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import type { IAbapConnection, IAdtObject, IAdtOperationOptions, ILogger, IObjectVersion } from '@mcp-abap-adt/interfaces';
|
|
18
18
|
import type { IAdtSystemContext } from '../../clients/AdtClient';
|
|
19
|
+
import { type LockRegistry } from '../shared/LockRegistry';
|
|
19
20
|
import { type IReadOptions } from './read';
|
|
20
21
|
import type { IAuthorizationFieldConfig, IAuthorizationFieldState } from './types';
|
|
21
22
|
export declare class AdtAuthorizationField implements IAdtObject<IAuthorizationFieldConfig, IAuthorizationFieldState> {
|
|
22
23
|
private readonly connection;
|
|
23
24
|
private readonly logger?;
|
|
24
25
|
private readonly systemContext;
|
|
26
|
+
private readonly lockTracker;
|
|
25
27
|
readonly objectType: string;
|
|
26
|
-
constructor(connection: IAbapConnection, logger?: ILogger, systemContext?: IAdtSystemContext);
|
|
28
|
+
constructor(connection: IAbapConnection, logger?: ILogger, systemContext?: IAdtSystemContext, lockRegistry?: LockRegistry);
|
|
27
29
|
/**
|
|
28
30
|
* Map camelCase config to the snake_case low-level params the functions expect.
|
|
29
31
|
* Kept private — callers should always go through the handler.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdtAuthorizationField.d.ts","sourceRoot":"","sources":["../../../src/core/authorizationField/AdtAuthorizationField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAEV,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"AdtAuthorizationField.d.ts","sourceRoot":"","sources":["../../../src/core/authorizationField/AdtAuthorizationField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAEV,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,wBAAwB,CAAC;AAWhC,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,QAAQ,CAAC;AACnE,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AAIjB,qBAAa,qBACX,YAAW,UAAU,CAAC,yBAAyB,EAAE,wBAAwB,CAAC;IAE1E,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAC1C,SAAgB,UAAU,EAAE,MAAM,CAAwB;gBAGxD,UAAU,EAAE,eAAe,EAC3B,MAAM,CAAC,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,iBAAiB,EACjC,Y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