@mcp-abap-adt/compact-modify 21.0.0 → 22.0.1

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.
Files changed (40) hide show
  1. package/README.md +3 -0
  2. package/dist/handlers/compactWriteRoutes.d.ts +1 -1
  3. package/dist/handlers/compactWriteRoutes.d.ts.map +1 -1
  4. package/dist/handlers/compactWriteRoutes.js.map +1 -1
  5. package/dist/handlers/handleHandlerActivate.d.ts +137 -12
  6. package/dist/handlers/handleHandlerActivate.d.ts.map +1 -1
  7. package/dist/handlers/handleHandlerActivate.js +64 -86
  8. package/dist/handlers/handleHandlerActivate.js.map +1 -1
  9. package/dist/handlers/handleHandlerCreate.d.ts +317 -8
  10. package/dist/handlers/handleHandlerCreate.d.ts.map +1 -1
  11. package/dist/handlers/handleHandlerCreate.js +26 -3
  12. package/dist/handlers/handleHandlerCreate.js.map +1 -1
  13. package/dist/handlers/handleHandlerDelete.d.ts +173 -5
  14. package/dist/handlers/handleHandlerDelete.d.ts.map +1 -1
  15. package/dist/handlers/handleHandlerDelete.js +4 -2
  16. package/dist/handlers/handleHandlerDelete.js.map +1 -1
  17. package/dist/handlers/handleHandlerLock.d.ts +48 -9
  18. package/dist/handlers/handleHandlerLock.d.ts.map +1 -1
  19. package/dist/handlers/handleHandlerLock.js +14 -8
  20. package/dist/handlers/handleHandlerLock.js.map +1 -1
  21. package/dist/handlers/handleHandlerProfileRun.d.ts +62 -4
  22. package/dist/handlers/handleHandlerProfileRun.d.ts.map +1 -1
  23. package/dist/handlers/handleHandlerProfileRun.js +4 -2
  24. package/dist/handlers/handleHandlerProfileRun.js.map +1 -1
  25. package/dist/handlers/handleHandlerProfileSchedule.d.ts +1 -1
  26. package/dist/handlers/handleHandlerProfileSchedule.js +1 -1
  27. package/dist/handlers/handleHandlerProfileSchedule.js.map +1 -1
  28. package/dist/handlers/handleHandlerUnitTestRun.d.ts +35 -5
  29. package/dist/handlers/handleHandlerUnitTestRun.d.ts.map +1 -1
  30. package/dist/handlers/handleHandlerUnitTestRun.js +1 -1
  31. package/dist/handlers/handleHandlerUnitTestRun.js.map +1 -1
  32. package/dist/handlers/handleHandlerUnlock.d.ts +47 -14
  33. package/dist/handlers/handleHandlerUnlock.d.ts.map +1 -1
  34. package/dist/handlers/handleHandlerUnlock.js +14 -8
  35. package/dist/handlers/handleHandlerUnlock.js.map +1 -1
  36. package/dist/handlers/handleHandlerUpdate.d.ts +267 -8
  37. package/dist/handlers/handleHandlerUpdate.d.ts.map +1 -1
  38. package/dist/handlers/handleHandlerUpdate.js +21 -3
  39. package/dist/handlers/handleHandlerUpdate.js.map +1 -1
  40. package/package.json +4 -4
@@ -1,16 +1,13 @@
1
- import type { CompactObjectType } from '@mcp-abap-adt/lib/compact-shared';
2
- import type { HandlerContext } from '@mcp-abap-adt/lib/handlers';
1
+ import { type HandlerContext } from '@mcp-abap-adt/lib/handlers';
3
2
  export declare const TOOL_DEFINITION: {
4
- readonly name: "HandlerUpdate";
5
- readonly available_in: readonly ["onprem", "cloud"];
6
- readonly description: "Writes the object named by object_type and its name parameter (class_name, program_name, ddl_name, table_name, …) under its lock: sends the one write request of its type under lock_handle, the lock handle of the object, and answers SAP's result. The write sets the whole content to the one given. lock_handle and object_type required: PACKAGE(package_name*, source_code*, transport_request), DOMAIN(domain_name*, source_code*, transport_request), DATA_ELEMENT(data_element_name*, source_code*, transport_request), FUNCTION_GROUP(function_group_name*, source_code*, transport_request), TABLE(table_name*, ddl_code*, transport_request), STRUCTURE(structure_name*, ddl_code*, transport_request), DDL(ddl_name*, ddl_source*, transport_request), SERVICE_DEFINITION(service_definition_name*, source_code*, transport_request), CLASS(class_name*, source_code*, transport_request), LOCAL_TEST_CLASS(class_name*, test_class_code*, transport_request), LOCAL_TYPES(class_name*, local_types_code*, transport_request), LOCAL_DEFINITIONS(class_name*, definitions_code*, transport_request), LOCAL_MACROS(class_name*, macros_code*, transport_request), UNIT_TEST(class_name*, test_class_source*, transport_request), CDS_UNIT_TEST(class_name*, test_class_source*, transport_request), PROGRAM(program_name*, source_code*, transport_request) [onprem only], INTERFACE(interface_name*, source_code*, transport_request), FUNCTION_MODULE(function_module_name*, function_group_name*, source_code*, transport_request), BEHAVIOR_DEFINITION(name*, source_code*, transport_request), BEHAVIOR_IMPLEMENTATION(class_name*, implementation_code*, transport_request), METADATA_EXTENSION(name*, source_code*, transport_request), SERVICE_BINDING(service_binding_name*, desired_publication_state*, binding_variant*, service_name, service_version). For PACKAGE, DOMAIN, DATA_ELEMENT and FUNCTION_GROUP, source_code is the whole metadata document, sent as given. For LOCAL_TEST_CLASS, LOCAL_TYPES, LOCAL_DEFINITIONS, LOCAL_MACROS, UNIT_TEST, CDS_UNIT_TEST and BEHAVIOR_IMPLEMENTATION, lock_handle is the class's lock handle. For SERVICE_BINDING the write is its publication request, sent under the lock_handle given, an empty one included; service_name and service_version (default 0001) name the service of an OData V2 binding. transport_request is sent as the write's corrNr. Over Streamable HTTP the write takes the lock's state_handle: send it as the state_handle argument of every call under the lock (or in the x-mcp-state-handle header); the write is sent only under a lock the instance it reaches holds.";
3
+ readonly description: string;
7
4
  readonly inputSchema: {
8
5
  readonly type: "object";
9
6
  readonly properties: {
10
7
  readonly object_type: {
11
8
  readonly type: "string";
12
- readonly enum: import("../../../dist/lib/compact/compactObjectTypes").CompactObjectType[];
13
- readonly description: "ABAP object type for routed compact operation.";
9
+ readonly enum: ("CLASS" | "INTERFACE" | "FUNCTION_GROUP" | "TABLE" | "STRUCTURE" | "DDL" | "DOMAIN" | "DATA_ELEMENT" | "BEHAVIOR_DEFINITION" | "METADATA_EXTENSION" | "PACKAGE" | "SERVICE_DEFINITION" | "SERVICE_BINDING" | "FUNCTION_MODULE" | "BEHAVIOR_IMPLEMENTATION" | "UNIT_TEST" | "CDS_UNIT_TEST" | "LOCAL_TEST_CLASS" | "LOCAL_TYPES" | "LOCAL_DEFINITIONS" | "LOCAL_MACROS")[] | readonly ["PACKAGE", "DOMAIN", "DATA_ELEMENT", "FUNCTION_GROUP", "TABLE", "STRUCTURE", "DDL", "SERVICE_DEFINITION", "CLASS", "LOCAL_TEST_CLASS", "LOCAL_TYPES", "LOCAL_DEFINITIONS", "LOCAL_MACROS", "UNIT_TEST", "CDS_UNIT_TEST", "PROGRAM", "INTERFACE", "FUNCTION_MODULE", "BEHAVIOR_DEFINITION", "BEHAVIOR_IMPLEMENTATION", "METADATA_EXTENSION", "SERVICE_BINDING"];
10
+ readonly description: string;
14
11
  };
15
12
  readonly lock_handle: {
16
13
  readonly type: "string";
@@ -133,9 +130,271 @@ export declare const TOOL_DEFINITION: {
133
130
  };
134
131
  readonly required: readonly ["object_type", "lock_handle"];
135
132
  };
133
+ readonly variants: {
134
+ readonly onprem: import("../../../dist/lib/variantDefinition").StatedOnVariant<{
135
+ readonly type: "object";
136
+ readonly properties: {
137
+ readonly object_type: {
138
+ readonly type: "string";
139
+ readonly enum: ("CLASS" | "INTERFACE" | "FUNCTION_GROUP" | "TABLE" | "STRUCTURE" | "DDL" | "DOMAIN" | "DATA_ELEMENT" | "BEHAVIOR_DEFINITION" | "METADATA_EXTENSION" | "PACKAGE" | "SERVICE_DEFINITION" | "SERVICE_BINDING" | "FUNCTION_MODULE" | "BEHAVIOR_IMPLEMENTATION" | "UNIT_TEST" | "CDS_UNIT_TEST" | "LOCAL_TEST_CLASS" | "LOCAL_TYPES" | "LOCAL_DEFINITIONS" | "LOCAL_MACROS")[] | readonly ["PACKAGE", "DOMAIN", "DATA_ELEMENT", "FUNCTION_GROUP", "TABLE", "STRUCTURE", "DDL", "SERVICE_DEFINITION", "CLASS", "LOCAL_TEST_CLASS", "LOCAL_TYPES", "LOCAL_DEFINITIONS", "LOCAL_MACROS", "UNIT_TEST", "CDS_UNIT_TEST", "PROGRAM", "INTERFACE", "FUNCTION_MODULE", "BEHAVIOR_DEFINITION", "BEHAVIOR_IMPLEMENTATION", "METADATA_EXTENSION", "SERVICE_BINDING"];
140
+ readonly description: string;
141
+ };
142
+ readonly lock_handle: {
143
+ readonly type: "string";
144
+ readonly description: "The lock handle of the object (for a class include, of the class): the write is sent under it.";
145
+ };
146
+ readonly transport_request: {
147
+ readonly type: "string";
148
+ readonly description: "Transport request id, sent as the write's corrNr (the types whose description names it).";
149
+ };
150
+ readonly class_name: {
151
+ readonly type: "string";
152
+ readonly description: "ABAP class name.";
153
+ };
154
+ readonly program_name: {
155
+ readonly type: "string";
156
+ readonly description: "ABAP program name.";
157
+ };
158
+ readonly domain_name: {
159
+ readonly type: "string";
160
+ readonly description: "ABAP domain name.";
161
+ };
162
+ readonly function_module_name: {
163
+ readonly type: "string";
164
+ readonly description: "ABAP function module name.";
165
+ };
166
+ readonly function_group_name: {
167
+ readonly type: "string";
168
+ readonly description: "ABAP function group name.";
169
+ };
170
+ readonly package_name: {
171
+ readonly type: "string";
172
+ readonly description: "ABAP package name.";
173
+ };
174
+ readonly ddl_name: {
175
+ readonly type: "string";
176
+ readonly description: "DDL source name (CDS view, AMDP table function, etc.).";
177
+ };
178
+ readonly source_code: {
179
+ readonly type: "string";
180
+ readonly description: "The content written: the source, or for PACKAGE, DOMAIN, DATA_ELEMENT and FUNCTION_GROUP the whole metadata document.";
181
+ };
182
+ readonly ddl_source: {
183
+ readonly type: "string";
184
+ readonly description: "Complete DDL source code (for DDL update).";
185
+ };
186
+ readonly table_name: {
187
+ readonly type: "string";
188
+ readonly description: "Table name.";
189
+ };
190
+ readonly structure_name: {
191
+ readonly type: "string";
192
+ readonly description: "Structure name.";
193
+ };
194
+ readonly data_element_name: {
195
+ readonly type: "string";
196
+ readonly description: "Data element name.";
197
+ };
198
+ readonly interface_name: {
199
+ readonly type: "string";
200
+ readonly description: "Interface name.";
201
+ };
202
+ readonly service_definition_name: {
203
+ readonly type: "string";
204
+ readonly description: "Service definition name.";
205
+ };
206
+ readonly service_binding_name: {
207
+ readonly type: "string";
208
+ readonly description: "Service binding name.";
209
+ };
210
+ readonly service_name: {
211
+ readonly type: "string";
212
+ readonly description: "Published service name (SERVICE_BINDING, an OData V2 binding).";
213
+ };
214
+ readonly service_version: {
215
+ readonly type: "string";
216
+ readonly description: "Published service version (SERVICE_BINDING, an OData V2 binding). Default 0001.";
217
+ };
218
+ readonly name: {
219
+ readonly type: "string";
220
+ readonly description: "Object name for handlers that require a generic `name` (behavior definition, metadata extension).";
221
+ };
222
+ readonly ddl_code: {
223
+ readonly type: "string";
224
+ readonly description: "Complete DDL source code (for TABLE/STRUCTURE update).";
225
+ };
226
+ readonly implementation_code: {
227
+ readonly type: "string";
228
+ readonly description: "Behavior implementation methods source code.";
229
+ };
230
+ readonly test_class_source: {
231
+ readonly type: "string";
232
+ readonly description: "ABAP source of the local test classes (UNIT_TEST and CDS_UNIT_TEST update).";
233
+ };
234
+ readonly test_class_code: {
235
+ readonly type: "string";
236
+ readonly description: "Updated source for the local test class.";
237
+ };
238
+ readonly local_types_code: {
239
+ readonly type: "string";
240
+ readonly description: "Updated source for class local types.";
241
+ };
242
+ readonly definitions_code: {
243
+ readonly type: "string";
244
+ readonly description: "Updated source for class local definitions.";
245
+ };
246
+ readonly macros_code: {
247
+ readonly type: "string";
248
+ readonly description: "Updated source for class local macros.";
249
+ };
250
+ readonly binding_variant: {
251
+ readonly type: "string";
252
+ readonly enum: readonly ["ODATA_V2_UI", "ODATA_V2_WEB_API", "ODATA_V4_UI", "ODATA_V4_WEB_API"];
253
+ readonly description: "Service binding variant (service binding update).";
254
+ };
255
+ readonly desired_publication_state: {
256
+ readonly type: "string";
257
+ readonly enum: readonly ["published", "unpublished"];
258
+ readonly description: "Target publication state (service binding update).";
259
+ };
260
+ };
261
+ readonly required: readonly ["object_type", "lock_handle"];
262
+ }>;
263
+ readonly cloud: import("../../../dist/lib/variantDefinition").StatedOnVariant<{
264
+ readonly type: "object";
265
+ readonly properties: {
266
+ readonly object_type: {
267
+ readonly type: "string";
268
+ readonly enum: ("CLASS" | "INTERFACE" | "FUNCTION_GROUP" | "TABLE" | "STRUCTURE" | "DDL" | "DOMAIN" | "DATA_ELEMENT" | "BEHAVIOR_DEFINITION" | "METADATA_EXTENSION" | "PACKAGE" | "SERVICE_DEFINITION" | "SERVICE_BINDING" | "FUNCTION_MODULE" | "BEHAVIOR_IMPLEMENTATION" | "UNIT_TEST" | "CDS_UNIT_TEST" | "LOCAL_TEST_CLASS" | "LOCAL_TYPES" | "LOCAL_DEFINITIONS" | "LOCAL_MACROS")[] | readonly ["PACKAGE", "DOMAIN", "DATA_ELEMENT", "FUNCTION_GROUP", "TABLE", "STRUCTURE", "DDL", "SERVICE_DEFINITION", "CLASS", "LOCAL_TEST_CLASS", "LOCAL_TYPES", "LOCAL_DEFINITIONS", "LOCAL_MACROS", "UNIT_TEST", "CDS_UNIT_TEST", "PROGRAM", "INTERFACE", "FUNCTION_MODULE", "BEHAVIOR_DEFINITION", "BEHAVIOR_IMPLEMENTATION", "METADATA_EXTENSION", "SERVICE_BINDING"];
269
+ readonly description: string;
270
+ };
271
+ readonly lock_handle: {
272
+ readonly type: "string";
273
+ readonly description: "The lock handle of the object (for a class include, of the class): the write is sent under it.";
274
+ };
275
+ readonly transport_request: {
276
+ readonly type: "string";
277
+ readonly description: "Transport request id, sent as the write's corrNr (the types whose description names it).";
278
+ };
279
+ readonly class_name: {
280
+ readonly type: "string";
281
+ readonly description: "ABAP class name.";
282
+ };
283
+ readonly program_name: {
284
+ readonly type: "string";
285
+ readonly description: "ABAP program name.";
286
+ };
287
+ readonly domain_name: {
288
+ readonly type: "string";
289
+ readonly description: "ABAP domain name.";
290
+ };
291
+ readonly function_module_name: {
292
+ readonly type: "string";
293
+ readonly description: "ABAP function module name.";
294
+ };
295
+ readonly function_group_name: {
296
+ readonly type: "string";
297
+ readonly description: "ABAP function group name.";
298
+ };
299
+ readonly package_name: {
300
+ readonly type: "string";
301
+ readonly description: "ABAP package name.";
302
+ };
303
+ readonly ddl_name: {
304
+ readonly type: "string";
305
+ readonly description: "DDL source name (CDS view, AMDP table function, etc.).";
306
+ };
307
+ readonly source_code: {
308
+ readonly type: "string";
309
+ readonly description: "The content written: the source, or for PACKAGE, DOMAIN, DATA_ELEMENT and FUNCTION_GROUP the whole metadata document.";
310
+ };
311
+ readonly ddl_source: {
312
+ readonly type: "string";
313
+ readonly description: "Complete DDL source code (for DDL update).";
314
+ };
315
+ readonly table_name: {
316
+ readonly type: "string";
317
+ readonly description: "Table name.";
318
+ };
319
+ readonly structure_name: {
320
+ readonly type: "string";
321
+ readonly description: "Structure name.";
322
+ };
323
+ readonly data_element_name: {
324
+ readonly type: "string";
325
+ readonly description: "Data element name.";
326
+ };
327
+ readonly interface_name: {
328
+ readonly type: "string";
329
+ readonly description: "Interface name.";
330
+ };
331
+ readonly service_definition_name: {
332
+ readonly type: "string";
333
+ readonly description: "Service definition name.";
334
+ };
335
+ readonly service_binding_name: {
336
+ readonly type: "string";
337
+ readonly description: "Service binding name.";
338
+ };
339
+ readonly service_name: {
340
+ readonly type: "string";
341
+ readonly description: "Published service name (SERVICE_BINDING, an OData V2 binding).";
342
+ };
343
+ readonly service_version: {
344
+ readonly type: "string";
345
+ readonly description: "Published service version (SERVICE_BINDING, an OData V2 binding). Default 0001.";
346
+ };
347
+ readonly name: {
348
+ readonly type: "string";
349
+ readonly description: "Object name for handlers that require a generic `name` (behavior definition, metadata extension).";
350
+ };
351
+ readonly ddl_code: {
352
+ readonly type: "string";
353
+ readonly description: "Complete DDL source code (for TABLE/STRUCTURE update).";
354
+ };
355
+ readonly implementation_code: {
356
+ readonly type: "string";
357
+ readonly description: "Behavior implementation methods source code.";
358
+ };
359
+ readonly test_class_source: {
360
+ readonly type: "string";
361
+ readonly description: "ABAP source of the local test classes (UNIT_TEST and CDS_UNIT_TEST update).";
362
+ };
363
+ readonly test_class_code: {
364
+ readonly type: "string";
365
+ readonly description: "Updated source for the local test class.";
366
+ };
367
+ readonly local_types_code: {
368
+ readonly type: "string";
369
+ readonly description: "Updated source for class local types.";
370
+ };
371
+ readonly definitions_code: {
372
+ readonly type: "string";
373
+ readonly description: "Updated source for class local definitions.";
374
+ };
375
+ readonly macros_code: {
376
+ readonly type: "string";
377
+ readonly description: "Updated source for class local macros.";
378
+ };
379
+ readonly binding_variant: {
380
+ readonly type: "string";
381
+ readonly enum: readonly ["ODATA_V2_UI", "ODATA_V2_WEB_API", "ODATA_V4_UI", "ODATA_V4_WEB_API"];
382
+ readonly description: "Service binding variant (service binding update).";
383
+ };
384
+ readonly desired_publication_state: {
385
+ readonly type: "string";
386
+ readonly enum: readonly ["published", "unpublished"];
387
+ readonly description: "Target publication state (service binding update).";
388
+ };
389
+ };
390
+ readonly required: readonly ["object_type", "lock_handle"];
391
+ }>;
392
+ };
393
+ readonly name: "HandlerUpdate";
394
+ readonly available_in: readonly ["onprem", "cloud"];
136
395
  };
137
396
  type HandlerUpdateArgs = {
138
- object_type: CompactObjectType;
397
+ object_type: string;
139
398
  } & Record<string, unknown>;
140
399
  /** One request: the type's write under `lock_handle` (`handleUpdateUnderLock`, spec §4.6). */
141
400
  export declare function handleHandlerUpdate(context: HandlerContext, args: HandlerUpdateArgs): Promise<unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"handleHandlerUpdate.d.ts","sourceRoot":"","sources":["../../src/handlers/handleHandlerUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMlB,CAAC;AAEX,KAAK,iBAAiB,GAAG;IAAE,WAAW,EAAE,iBAAiB,CAAA;CAAE,GAAG,MAAM,CAClE,MAAM,EACN,OAAO,CACR,CAAC;AAEF,8FAA8F;AAC9F,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,iBAAiB,oBAGxB"}
1
+ {"version":3,"file":"handleHandlerUpdate.d.ts","sourceRoot":"","sources":["../../src/handlers/handleHandlerUpdate.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,4BAA4B,CAAC;AAI5E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOlB,CAAC;AAEX,KAAK,iBAAiB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3E,8FAA8F;AAC9F,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,iBAAiB,oBAqBxB"}
@@ -3,15 +3,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TOOL_DEFINITION = void 0;
4
4
  exports.handleHandlerUpdate = handleHandlerUpdate;
5
5
  const compact_shared_1 = require("@mcp-abap-adt/lib/compact-shared");
6
+ const handlers_1 = require("@mcp-abap-adt/lib/handlers");
7
+ const utils_1 = require("@mcp-abap-adt/lib/utils");
6
8
  const compactWriteRoutes_1 = require("./compactWriteRoutes");
7
9
  exports.TOOL_DEFINITION = {
8
10
  name: 'HandlerUpdate',
9
11
  available_in: ['onprem', 'cloud'],
10
- description: "Writes the object named by object_type and its name parameter (class_name, program_name, ddl_name, table_name, …) under its lock: sends the one write request of its type under lock_handle, the lock handle of the object, and answers SAP's result. The write sets the whole content to the one given. lock_handle and object_type required: PACKAGE(package_name*, source_code*, transport_request), DOMAIN(domain_name*, source_code*, transport_request), DATA_ELEMENT(data_element_name*, source_code*, transport_request), FUNCTION_GROUP(function_group_name*, source_code*, transport_request), TABLE(table_name*, ddl_code*, transport_request), STRUCTURE(structure_name*, ddl_code*, transport_request), DDL(ddl_name*, ddl_source*, transport_request), SERVICE_DEFINITION(service_definition_name*, source_code*, transport_request), CLASS(class_name*, source_code*, transport_request), LOCAL_TEST_CLASS(class_name*, test_class_code*, transport_request), LOCAL_TYPES(class_name*, local_types_code*, transport_request), LOCAL_DEFINITIONS(class_name*, definitions_code*, transport_request), LOCAL_MACROS(class_name*, macros_code*, transport_request), UNIT_TEST(class_name*, test_class_source*, transport_request), CDS_UNIT_TEST(class_name*, test_class_source*, transport_request), PROGRAM(program_name*, source_code*, transport_request) [onprem only], INTERFACE(interface_name*, source_code*, transport_request), FUNCTION_MODULE(function_module_name*, function_group_name*, source_code*, transport_request), BEHAVIOR_DEFINITION(name*, source_code*, transport_request), BEHAVIOR_IMPLEMENTATION(class_name*, implementation_code*, transport_request), METADATA_EXTENSION(name*, source_code*, transport_request), SERVICE_BINDING(service_binding_name*, desired_publication_state*, binding_variant*, service_name, service_version). For PACKAGE, DOMAIN, DATA_ELEMENT and FUNCTION_GROUP, source_code is the whole metadata document, sent as given. For LOCAL_TEST_CLASS, LOCAL_TYPES, LOCAL_DEFINITIONS, LOCAL_MACROS, UNIT_TEST, CDS_UNIT_TEST and BEHAVIOR_IMPLEMENTATION, lock_handle is the class's lock handle. For SERVICE_BINDING the write is its publication request, sent under the lock_handle given, an empty one included; service_name and service_version (default 0001) name the service of an OData V2 binding. transport_request is sent as the write's corrNr. Over Streamable HTTP the write takes the lock's state_handle: send it as the state_handle argument of every call under the lock (or in the x-mcp-state-handle header); the write is sent only under a lock the instance it reaches holds.",
11
- inputSchema: compact_shared_1.compactUpdateSchema,
12
+ ...(0, compact_shared_1.byVariant)((variant) => ({
13
+ description: (0, compact_shared_1.compactUpdateDescription)(variant),
14
+ inputSchema: (0, compact_shared_1.compactUpdateSchemaFor)(compact_shared_1.COMPACT_UPDATE[variant]),
15
+ })),
12
16
  };
13
17
  /** One request: the type's write under `lock_handle` (`handleUpdateUnderLock`, spec §4.6). */
14
18
  async function handleHandlerUpdate(context, args) {
15
- return (0, compactWriteRoutes_1.routeCompactWrite)(context, 'update', args);
19
+ // The boundary of object_type: one of the declared variant's members
20
+ // (`COMPACT_UPDATE`); past it, the route is typed by it.
21
+ if (!args.object_type) {
22
+ // The router refuses it, in its own words and through its log.
23
+ return (0, compactWriteRoutes_1.routeCompactWrite)(context, 'update', {
24
+ ...args,
25
+ object_type: undefined,
26
+ });
27
+ }
28
+ const variant = (0, handlers_1.variantOf)(context.connection);
29
+ const member = (0, compact_shared_1.acceptedOf)(args.object_type, compact_shared_1.COMPACT_UPDATE[variant]);
30
+ if (member === undefined) {
31
+ return (0, utils_1.return_error)(new Error(`Unsupported update for object_type: ${args.object_type}. ${(0, compact_shared_1.supported)(compact_shared_1.COMPACT_UPDATE[variant])}`));
32
+ }
33
+ return (0, compactWriteRoutes_1.routeCompactWrite)(context, 'update', { ...args, object_type: member });
16
34
  }
17
35
  //# sourceMappingURL=handleHandlerUpdate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleHandlerUpdate.js","sourceRoot":"","sources":["../../src/handlers/handleHandlerUpdate.ts"],"names":[],"mappings":";;;AAmBA,kDAKC;AAvBD,qEAAuE;AAEvE,6DAAyD;AAE5C,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAU;IAC1C,WAAW,EACT,4gFAA4gF;IAC9gF,WAAW,EAAE,oCAAmB;CACxB,CAAC;AAOX,8FAA8F;AACvF,KAAK,UAAU,mBAAmB,CACvC,OAAuB,EACvB,IAAuB;IAEvB,OAAO,IAAA,sCAAiB,EAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC"}
1
+ {"version":3,"file":"handleHandlerUpdate.js","sourceRoot":"","sources":["../../src/handlers/handleHandlerUpdate.ts"],"names":[],"mappings":";;;AAwBA,kDAuBC;AA/CD,qEAO0C;AAC1C,yDAA4E;AAC5E,mDAAuD;AACvD,6DAAyD;AAE5C,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAU;IAC1C,GAAG,IAAA,0BAAS,EAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACzB,WAAW,EAAE,IAAA,yCAAwB,EAAC,OAAO,CAAC;QAC9C,WAAW,EAAE,IAAA,uCAAsB,EAAC,+BAAc,CAAC,OAAO,CAAC,CAAC;KAC7D,CAAC,CAAC;CACK,CAAC;AAIX,8FAA8F;AACvF,KAAK,UAAU,mBAAmB,CACvC,OAAuB,EACvB,IAAuB;IAEvB,qEAAqE;IACrE,yDAAyD;IACzD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACtB,+DAA+D;QAC/D,OAAO,IAAA,sCAAiB,EAAC,OAAO,EAAE,QAAQ,EAAE;YAC1C,GAAG,IAAI;YACP,WAAW,EAAE,SAAS;SACvB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,oBAAS,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAA,2BAAU,EAAC,IAAI,CAAC,WAAW,EAAE,+BAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,IAAA,oBAAY,EACjB,IAAI,KAAK,CACP,uCAAuC,IAAI,CAAC,WAAW,KAAK,IAAA,0BAAS,EAAC,+BAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CACjG,CACF,CAAC;IACJ,CAAC;IACD,OAAO,IAAA,sCAAiB,EAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;AAChF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/compact-modify",
3
- "version": "21.0.0",
3
+ "version": "22.0.1",
4
4
  "description": "The compact ABAP ADT tools that write, lock, activate or execute: one tool per operation, the object in the arguments.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Oleksii Kyslytsia <oleksij.kyslytsja@gmail.com>",
@@ -51,13 +51,13 @@
51
51
  "prepublishOnly": "npm run build"
52
52
  },
53
53
  "dependencies": {
54
- "@mcp-abap-adt/interfaces-adt": "^20.1.0"
54
+ "@mcp-abap-adt/interfaces-adt": "^24.0.1"
55
55
  },
56
56
  "peerDependencies": {
57
- "@mcp-abap-adt/lib": "^21.0.0"
57
+ "@mcp-abap-adt/lib": "^22.0.1"
58
58
  },
59
59
  "devDependencies": {
60
- "@mcp-abap-adt/lib": "^21.0.0",
60
+ "@mcp-abap-adt/lib": "^22.0.1",
61
61
  "typescript": "^6.0.2",
62
62
  "@types/node": "^22.20.5"
63
63
  }