@abapify/adt-contracts 0.4.1 → 0.4.3
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/base-BfUrFNlD.d.mts +31109 -0
- package/dist/base-BfUrFNlD.d.mts.map +1 -0
- package/dist/{base-BsgeOhzu.mjs → base-CJ5t6dbP.mjs} +696 -108
- package/dist/base-CJ5t6dbP.mjs.map +1 -0
- package/dist/base.d.mts +2 -2
- package/dist/base.mjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +54 -2
- package/dist/index.mjs.map +1 -0
- package/dist/schemas-DjN7IPy_.d.mts +9607 -0
- package/dist/schemas-DjN7IPy_.d.mts.map +1 -0
- package/dist/schemas.d.mts +2 -2
- package/dist/schemas.mjs +4 -1
- package/dist/schemas.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/base-BErcZz8D.d.mts +0 -23593
- package/dist/base-BErcZz8D.d.mts.map +0 -1
- package/dist/base-BsgeOhzu.mjs.map +0 -1
- package/dist/schemas-C0LyT-1a.d.mts +0 -9148
- package/dist/schemas-C0LyT-1a.d.mts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { acoverageResult, acoverageStatements, adtcore, atc, atcRun, atcworklist, atomFeed, aunitResult, aunitRun, badi, blueSource, checkrun, classes, configuration, configurations as configurations$1, dataelementWrapper, dclSource, ddlSource, discovery, domain, fmodules, groups as groups$1, http as http$2, includes, interfaces, packagesV1, programs, servicebinding, srvdSource, systeminformation, tabletype, transportUseraction, transportfind, transportmanagment, transportmanagmentCreate, transportmanagmentSingle } from "./schemas.mjs";
|
|
1
|
+
import { acoverageResult, acoverageStatements, adtcore, atc, atcRun, atcworklist, atomFeed, aunitResult, aunitRun, badi, blueSource, checkrun, classes, configuration, configurations as configurations$1, dataelementWrapper, dclSource, ddlSource, ddlxSource, discovery, domain, dtebSource, fmodules, groups as groups$1, http as http$2, includes, interfaces, objectProperties, packagesV1, programs, servicebinding, srvdSource, systeminformation, tabletype, transportUseraction, transportfind, transportmanagment, transportmanagmentCreate, transportmanagmentSingle } from "./schemas.mjs";
|
|
2
2
|
import { createClient, http, http as http$1 } from "@abapify/speci/rest";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/text-schema.ts
|
|
@@ -132,12 +132,21 @@ function createIncludeOperations(basePath, includeType, nameTransform) {
|
|
|
132
132
|
function crud(options) {
|
|
133
133
|
const { basePath, schema, contentType, accept = contentType, nameTransform = (n) => n.toLowerCase(), sources, includes } = options;
|
|
134
134
|
return {
|
|
135
|
+
/** Schema for XML serialization/deserialization */
|
|
135
136
|
bodySchema: schema,
|
|
137
|
+
/**
|
|
138
|
+
* GET {basePath}/{name}
|
|
139
|
+
* Retrieve object metadata
|
|
140
|
+
*/
|
|
136
141
|
get: (name, queryOptions) => http.get(`${basePath}/${nameTransform(name)}`, {
|
|
137
142
|
responses: { 200: schema },
|
|
138
143
|
headers: { Accept: accept },
|
|
139
144
|
query: queryOptions?.version ? { version: queryOptions.version } : void 0
|
|
140
145
|
}),
|
|
146
|
+
/**
|
|
147
|
+
* POST {basePath}
|
|
148
|
+
* Create a new object
|
|
149
|
+
*/
|
|
141
150
|
post: (queryOptions) => http.post(basePath, {
|
|
142
151
|
body: schema,
|
|
143
152
|
responses: { 200: schema },
|
|
@@ -147,6 +156,10 @@ function crud(options) {
|
|
|
147
156
|
},
|
|
148
157
|
query: queryOptions?.corrNr ? { corrNr: queryOptions.corrNr } : void 0
|
|
149
158
|
}),
|
|
159
|
+
/**
|
|
160
|
+
* PUT {basePath}/{name}
|
|
161
|
+
* Update object metadata
|
|
162
|
+
*/
|
|
150
163
|
put: (name, queryOptions) => http.put(`${basePath}/${nameTransform(name)}`, {
|
|
151
164
|
body: schema,
|
|
152
165
|
responses: { 200: schema },
|
|
@@ -159,6 +172,10 @@ function crud(options) {
|
|
|
159
172
|
...queryOptions?.lockHandle ? { lockHandle: queryOptions.lockHandle } : {}
|
|
160
173
|
}
|
|
161
174
|
}),
|
|
175
|
+
/**
|
|
176
|
+
* DELETE {basePath}/{name}
|
|
177
|
+
* Delete object
|
|
178
|
+
*/
|
|
162
179
|
delete: (name, queryOptions) => http.delete(`${basePath}/${nameTransform(name)}`, {
|
|
163
180
|
responses: { 204: void 0 },
|
|
164
181
|
query: {
|
|
@@ -166,6 +183,13 @@ function crud(options) {
|
|
|
166
183
|
...queryOptions?.lockHandle ? { lockHandle: queryOptions.lockHandle } : {}
|
|
167
184
|
}
|
|
168
185
|
}),
|
|
186
|
+
/**
|
|
187
|
+
* POST {basePath}/{name}?_action=LOCK
|
|
188
|
+
* Lock object for modification
|
|
189
|
+
*
|
|
190
|
+
* Response contains lock handle in XML format:
|
|
191
|
+
* <asx:abap>...<DATA><LOCK_HANDLE>xxx</LOCK_HANDLE><CORRNR>yyy</CORRNR>...</DATA>...</asx:abap>
|
|
192
|
+
*/
|
|
169
193
|
lock: (name, lockOptions) => http.post(`${basePath}/${nameTransform(name)}`, {
|
|
170
194
|
responses: { 200: void 0 },
|
|
171
195
|
headers: {
|
|
@@ -179,6 +203,10 @@ function crud(options) {
|
|
|
179
203
|
...lockOptions?.corrNr ? { corrNr: lockOptions.corrNr } : {}
|
|
180
204
|
}
|
|
181
205
|
}),
|
|
206
|
+
/**
|
|
207
|
+
* POST {basePath}/{name}?_action=UNLOCK
|
|
208
|
+
* Unlock object
|
|
209
|
+
*/
|
|
182
210
|
unlock: (name, unlockOptions) => http.post(`${basePath}/${nameTransform(name)}`, {
|
|
183
211
|
responses: { 200: void 0 },
|
|
184
212
|
headers: {
|
|
@@ -191,6 +219,10 @@ function crud(options) {
|
|
|
191
219
|
lockHandle: unlockOptions.lockHandle
|
|
192
220
|
}
|
|
193
221
|
}),
|
|
222
|
+
/**
|
|
223
|
+
* GET {basePath}/{name}/objectstructure
|
|
224
|
+
* Get object structure (includes, methods, attributes, etc.)
|
|
225
|
+
*/
|
|
194
226
|
objectstructure: (name, structureOptions) => http.get(`${basePath}/${nameTransform(name)}/objectstructure`, {
|
|
195
227
|
responses: { 200: void 0 },
|
|
196
228
|
query: {
|
|
@@ -243,7 +275,11 @@ function repo(basePath, schema, contentType, nameTransform, accept) {
|
|
|
243
275
|
/**
|
|
244
276
|
* /sap/bc/adt/cts/transportrequests/valuehelp/attribute
|
|
245
277
|
*/
|
|
246
|
-
const attribute = {
|
|
278
|
+
const attribute = {
|
|
279
|
+
/**
|
|
280
|
+
* GET /sap/bc/adt/cts/transportrequests/valuehelp/attribute{?maxItemCount}{&name}
|
|
281
|
+
*/
|
|
282
|
+
get: (params) => http.get("/sap/bc/adt/cts/transportrequests/valuehelp/attribute", {
|
|
247
283
|
query: params,
|
|
248
284
|
responses: { 200: void 0 },
|
|
249
285
|
headers: { Accept: "application/xml" }
|
|
@@ -254,7 +290,11 @@ const attribute = { get: (params) => http.get("/sap/bc/adt/cts/transportrequests
|
|
|
254
290
|
/**
|
|
255
291
|
* /sap/bc/adt/cts/transportrequests/valuehelp/target
|
|
256
292
|
*/
|
|
257
|
-
const target = {
|
|
293
|
+
const target = {
|
|
294
|
+
/**
|
|
295
|
+
* GET /sap/bc/adt/cts/transportrequests/valuehelp/target{?maxItemCount}{&name}
|
|
296
|
+
*/
|
|
297
|
+
get: (params) => http.get("/sap/bc/adt/cts/transportrequests/valuehelp/target", {
|
|
258
298
|
query: params,
|
|
259
299
|
responses: { 200: void 0 },
|
|
260
300
|
headers: { Accept: "application/xml" }
|
|
@@ -265,7 +305,11 @@ const target = { get: (params) => http.get("/sap/bc/adt/cts/transportrequests/va
|
|
|
265
305
|
/**
|
|
266
306
|
* /sap/bc/adt/cts/transportrequests/valuehelp/ctsproject
|
|
267
307
|
*/
|
|
268
|
-
const ctsproject = {
|
|
308
|
+
const ctsproject = {
|
|
309
|
+
/**
|
|
310
|
+
* GET /sap/bc/adt/cts/transportrequests/valuehelp/ctsproject{?maxItemCount}{&name}
|
|
311
|
+
*/
|
|
312
|
+
get: (params) => http.get("/sap/bc/adt/cts/transportrequests/valuehelp/ctsproject", {
|
|
269
313
|
query: params,
|
|
270
314
|
responses: { 200: void 0 },
|
|
271
315
|
headers: { Accept: "application/xml" }
|
|
@@ -276,7 +320,11 @@ const ctsproject = { get: (params) => http.get("/sap/bc/adt/cts/transportrequest
|
|
|
276
320
|
/**
|
|
277
321
|
* /sap/bc/adt/cts/transportrequests/valuehelp/object
|
|
278
322
|
*/
|
|
279
|
-
const object = {
|
|
323
|
+
const object = {
|
|
324
|
+
/**
|
|
325
|
+
* GET /sap/bc/adt/cts/transportrequests/valuehelp/object/{field}{?maxItemCount}{&name}
|
|
326
|
+
*/
|
|
327
|
+
get: (field, params) => http.get(`/sap/bc/adt/cts/transportrequests/valuehelp/object/${field}`, {
|
|
280
328
|
query: params,
|
|
281
329
|
responses: { 200: void 0 },
|
|
282
330
|
headers: { Accept: "application/xml" }
|
|
@@ -312,14 +360,19 @@ const reference = { get: () => http.get("/sap/bc/adt/cts/transportrequests/refer
|
|
|
312
360
|
* @schema configurations.xsd, configuration.xsd
|
|
313
361
|
*/
|
|
314
362
|
const configurations = contract({
|
|
363
|
+
/** GET list of search configurations */
|
|
315
364
|
get: () => http$1.get("/sap/bc/adt/cts/transportrequests/searchconfiguration/configurations", {
|
|
316
365
|
responses: { 200: configurations$1 },
|
|
317
366
|
headers: { Accept: "application/vnd.sap.adt.configurations.v1+xml" }
|
|
318
367
|
}),
|
|
368
|
+
/** GET a specific configuration by ID */
|
|
319
369
|
getById: (_configId) => http$1.get("/sap/bc/adt/cts/transportrequests/searchconfiguration/configurations/${configId}", {
|
|
320
370
|
responses: { 200: configuration },
|
|
321
371
|
headers: { Accept: "application/vnd.sap.adt.configuration.v1+xml" }
|
|
322
372
|
}),
|
|
373
|
+
/** PUT update a specific configuration by ID - body type inferred from schema
|
|
374
|
+
* Note: If-Match header is automatically added by the adapter from cached ETag
|
|
375
|
+
*/
|
|
323
376
|
put: (_configId) => http$1.put("/sap/bc/adt/cts/transportrequests/searchconfiguration/configurations/${configId}", {
|
|
324
377
|
responses: { 200: configuration },
|
|
325
378
|
headers: {
|
|
@@ -336,7 +389,9 @@ const configurations = contract({
|
|
|
336
389
|
* /sap/bc/adt/cts/transportrequests/searchconfiguration/metadata
|
|
337
390
|
* @schema configuration.xsd
|
|
338
391
|
*/
|
|
339
|
-
const metadata = contract({
|
|
392
|
+
const metadata = contract({
|
|
393
|
+
/** GET default search configuration metadata */
|
|
394
|
+
get: () => http$1.get("/sap/bc/adt/cts/transportrequests/searchconfiguration/metadata", {
|
|
340
395
|
responses: { 200: configuration },
|
|
341
396
|
headers: { Accept: "application/vnd.sap.adt.configuration.metadata.v1+xml" }
|
|
342
397
|
}) });
|
|
@@ -351,41 +406,95 @@ const searchconfiguration = {
|
|
|
351
406
|
metadata
|
|
352
407
|
};
|
|
353
408
|
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/adt/cts/transportrequests/change-owner-schema.ts
|
|
411
|
+
function isChangeOwnerRoot(root) {
|
|
412
|
+
if (typeof root !== "object" || root === null) return false;
|
|
413
|
+
const { useraction, number, targetuser } = root;
|
|
414
|
+
return useraction === "changeowner" && typeof number === "string" && number.length > 0 && typeof targetuser === "string" && targetuser.length > 0;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Narrow request schema for the CTS change-owner action.
|
|
418
|
+
*
|
|
419
|
+
* SAP models these attributes on the broader transport-management root. This
|
|
420
|
+
* wrapper keeps the call-site body narrow while delegating XML parsing and
|
|
421
|
+
* serialization to that generated SAP schema.
|
|
422
|
+
*/
|
|
423
|
+
const changeOwnerBodySchema = {
|
|
424
|
+
_infer: void 0,
|
|
425
|
+
parse: (raw) => {
|
|
426
|
+
const root = transportmanagment.parse(raw)?.root;
|
|
427
|
+
if (!isChangeOwnerRoot(root)) throw new Error("Invalid CTS change-owner body");
|
|
428
|
+
return { root: {
|
|
429
|
+
number: root.number,
|
|
430
|
+
targetuser: root.targetuser,
|
|
431
|
+
useraction: "changeowner"
|
|
432
|
+
} };
|
|
433
|
+
},
|
|
434
|
+
build: (body) => transportmanagment.build(body)
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/adt/cts/transportrequests/add-task-schema.ts
|
|
439
|
+
/** Narrow body used by SAP's hypermedia `newtask` relation. */
|
|
440
|
+
const addTaskBodySchema = {
|
|
441
|
+
_infer: void 0,
|
|
442
|
+
parse: (raw) => {
|
|
443
|
+
const root = transportmanagment.parse(raw)?.root;
|
|
444
|
+
if (!root || !root.targetuser) throw new Error("Invalid CTS add-task body");
|
|
445
|
+
return { root: { targetuser: root.targetuser } };
|
|
446
|
+
},
|
|
447
|
+
build: (body) => transportmanagment.build(body)
|
|
448
|
+
};
|
|
449
|
+
|
|
354
450
|
//#endregion
|
|
355
451
|
//#region src/adt/cts/transportrequests/useraction.ts
|
|
356
452
|
/**
|
|
357
453
|
* /sap/bc/adt/cts/transportrequests - user-action body endpoints
|
|
358
454
|
*
|
|
359
|
-
* SAP ADT uses
|
|
360
|
-
*
|
|
361
|
-
* endpoints that wrap those three operations.
|
|
455
|
+
* SAP ADT uses distinct lifecycle endpoints for release, changeowner, and
|
|
456
|
+
* newrequest and newtask actions. This file exposes typed contracts for them.
|
|
362
457
|
*
|
|
363
|
-
* release → POST /{trkorr}
|
|
364
|
-
* changeowner →
|
|
458
|
+
* release → POST /{trkorr}/newreleasejobs (no body)
|
|
459
|
+
* changeowner → PUT /{trkorr} (requires tm:number and tm:targetuser)
|
|
460
|
+
* newtask → POST /{trkorr}/tasks (requires tm:targetuser)
|
|
365
461
|
* newrequest → POST / (creates a new transport request)
|
|
366
|
-
*
|
|
367
|
-
* All three share the same namespace and content-type but differ in
|
|
368
|
-
* request shape and URL, so we expose them as separate methods with
|
|
369
|
-
* strongly-typed options while sharing a single schema.
|
|
370
462
|
*/
|
|
371
463
|
const CONTENT_TYPE = "application/vnd.sap.adt.transportorganizer.v1+xml";
|
|
372
464
|
const useraction = {
|
|
373
|
-
|
|
374
|
-
|
|
465
|
+
/**
|
|
466
|
+
* Start and synchronously report a transport/task release job.
|
|
467
|
+
*/
|
|
468
|
+
release: (trkorr) => http$1.post(`/sap/bc/adt/cts/transportrequests/${trkorr}/newreleasejobs`, {
|
|
469
|
+
responses: { 200: transportmanagment },
|
|
470
|
+
headers: { Accept: CONTENT_TYPE }
|
|
471
|
+
}),
|
|
472
|
+
/**
|
|
473
|
+
* PUT /{trkorr} with useraction="changeowner".
|
|
474
|
+
*/
|
|
475
|
+
reassign: (trkorr, _options) => http$1.put(`/sap/bc/adt/cts/transportrequests/${trkorr}`, {
|
|
476
|
+
body: changeOwnerBodySchema,
|
|
375
477
|
responses: { 200: transportmanagmentSingle },
|
|
376
478
|
headers: {
|
|
377
479
|
Accept: CONTENT_TYPE,
|
|
378
480
|
"Content-Type": CONTENT_TYPE
|
|
379
481
|
}
|
|
380
482
|
}),
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
483
|
+
/** Create a modifiable task below an existing request. */
|
|
484
|
+
addTask: (trkorr, _options) => http$1.post(`/sap/bc/adt/cts/transportrequests/${trkorr}/tasks`, {
|
|
485
|
+
body: addTaskBodySchema,
|
|
486
|
+
responses: { 200: transportmanagment },
|
|
384
487
|
headers: {
|
|
385
488
|
Accept: CONTENT_TYPE,
|
|
386
489
|
"Content-Type": CONTENT_TYPE
|
|
387
490
|
}
|
|
388
491
|
}),
|
|
492
|
+
/**
|
|
493
|
+
* POST / with useraction="newrequest"
|
|
494
|
+
*
|
|
495
|
+
* Creates a brand-new transport request. Body carries the nested
|
|
496
|
+
* tm:request / tm:task with desc / type / target / owner.
|
|
497
|
+
*/
|
|
389
498
|
create: (_options) => http$1.post("/sap/bc/adt/cts/transportrequests", {
|
|
390
499
|
body: transportUseraction,
|
|
391
500
|
responses: { 200: transportmanagmentSingle },
|
|
@@ -404,15 +513,18 @@ const useraction = {
|
|
|
404
513
|
*/
|
|
405
514
|
/** Re-export schema for consumers that need direct parsing */
|
|
406
515
|
const transportrequests = {
|
|
516
|
+
/** GET / - List transports */
|
|
407
517
|
list: (params) => http$1.get("/sap/bc/adt/cts/transportrequests", {
|
|
408
518
|
query: params,
|
|
409
519
|
responses: { 200: transportmanagment },
|
|
410
520
|
headers: { Accept: "*/*" }
|
|
411
521
|
}),
|
|
522
|
+
/** GET /{trkorr} - Get single transport */
|
|
412
523
|
get: (trkorr) => http$1.get(`/sap/bc/adt/cts/transportrequests/${trkorr}`, {
|
|
413
524
|
responses: { 200: transportmanagmentSingle },
|
|
414
525
|
headers: { Accept: "application/vnd.sap.adt.transportorganizer.v1+xml" }
|
|
415
526
|
}),
|
|
527
|
+
/** POST / - Create new transport (response has root/request structure like single) */
|
|
416
528
|
create: () => http$1.post("/sap/bc/adt/cts/transportrequests", {
|
|
417
529
|
body: transportmanagmentCreate,
|
|
418
530
|
responses: { 200: transportmanagmentSingle },
|
|
@@ -421,6 +533,7 @@ const transportrequests = {
|
|
|
421
533
|
"Content-Type": "application/xml"
|
|
422
534
|
}
|
|
423
535
|
}),
|
|
536
|
+
/** POST /{trkorr} - Action on transport (release, etc.) */
|
|
424
537
|
post: (trkorr) => http$1.post(`/sap/bc/adt/cts/transportrequests/${trkorr}`, {
|
|
425
538
|
body: transportmanagment,
|
|
426
539
|
responses: { 200: transportmanagment },
|
|
@@ -429,6 +542,7 @@ const transportrequests = {
|
|
|
429
542
|
"Content-Type": "application/xml"
|
|
430
543
|
}
|
|
431
544
|
}),
|
|
545
|
+
/** PUT /{trkorr} - Update transport */
|
|
432
546
|
put: (trkorr) => http$1.put(`/sap/bc/adt/cts/transportrequests/${trkorr}`, {
|
|
433
547
|
body: transportmanagment,
|
|
434
548
|
responses: { 200: transportmanagment },
|
|
@@ -437,6 +551,7 @@ const transportrequests = {
|
|
|
437
551
|
"Content-Type": "application/xml"
|
|
438
552
|
}
|
|
439
553
|
}),
|
|
554
|
+
/** DELETE /{trkorr} - Delete transport */
|
|
440
555
|
delete: (trkorr) => http$1.delete(`/sap/bc/adt/cts/transportrequests/${trkorr}`, { responses: { 204: void 0 } }),
|
|
441
556
|
reference,
|
|
442
557
|
valuehelp,
|
|
@@ -458,23 +573,36 @@ const transportrequests = {
|
|
|
458
573
|
* Transport function codes (TRFUNCTION field)
|
|
459
574
|
*/
|
|
460
575
|
const TransportFunction = {
|
|
576
|
+
/** Workbench request - development objects */
|
|
461
577
|
WORKBENCH: "K",
|
|
578
|
+
/** Customizing request - configuration */
|
|
462
579
|
CUSTOMIZING: "W",
|
|
580
|
+
/** Transport of copies */
|
|
463
581
|
TRANSPORT_OF_COPIES: "T",
|
|
582
|
+
/** Development/correction task */
|
|
464
583
|
DEVELOPMENT_CORRECTION: "S",
|
|
584
|
+
/** Repair task */
|
|
465
585
|
REPAIR: "R",
|
|
586
|
+
/** Unclassified task */
|
|
466
587
|
UNCLASSIFIED: "X",
|
|
588
|
+
/** Customizing task */
|
|
467
589
|
CUSTOMIZING_TASK: "Q",
|
|
590
|
+
/** Wildcard - all types */
|
|
468
591
|
ALL: "*"
|
|
469
592
|
};
|
|
470
593
|
/**
|
|
471
594
|
* Transport status codes (TRSTATUS field) - for response parsing
|
|
472
595
|
*/
|
|
473
596
|
const TransportStatus = {
|
|
597
|
+
/** Modifiable - can be edited */
|
|
474
598
|
MODIFIABLE: "D",
|
|
599
|
+
/** Release started - in progress */
|
|
475
600
|
RELEASE_STARTED: "O",
|
|
601
|
+
/** Release in preparation */
|
|
476
602
|
RELEASE_IN_PREPARATION: "P",
|
|
603
|
+
/** Released - locked, cannot be edited */
|
|
477
604
|
RELEASED: "R",
|
|
605
|
+
/** Locked */
|
|
478
606
|
LOCKED: "L"
|
|
479
607
|
};
|
|
480
608
|
/**
|
|
@@ -486,7 +614,30 @@ function normalizeTransportFindResponse(response) {
|
|
|
486
614
|
if (!headers) return [];
|
|
487
615
|
return Array.isArray(headers) ? headers : [headers];
|
|
488
616
|
}
|
|
489
|
-
const transports = {
|
|
617
|
+
const transports = {
|
|
618
|
+
/**
|
|
619
|
+
* Search transports with filters
|
|
620
|
+
*
|
|
621
|
+
* GET /sap/bc/adt/cts/transports?_action=FIND&user=X&trfunction=*
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* // Find all modifiable workbench requests for current user
|
|
625
|
+
* const result = await client.cts.transports.find({
|
|
626
|
+
* _action: 'FIND',
|
|
627
|
+
* user: 'PPLENKOV',
|
|
628
|
+
* trfunction: '*',
|
|
629
|
+
* });
|
|
630
|
+
*
|
|
631
|
+
* @example
|
|
632
|
+
* // Find with status filter
|
|
633
|
+
* const result = await client.cts.transports.find({
|
|
634
|
+
* _action: 'FIND',
|
|
635
|
+
* user: '*',
|
|
636
|
+
* trfunction: 'K',
|
|
637
|
+
* requestStatus: 'D', // Modifiable only
|
|
638
|
+
* });
|
|
639
|
+
*/
|
|
640
|
+
find: (params) => http.get("/sap/bc/adt/cts/transports", {
|
|
490
641
|
query: params,
|
|
491
642
|
responses: { 200: transportfind },
|
|
492
643
|
headers: { Accept: "*/*" }
|
|
@@ -498,7 +649,11 @@ const transports = { find: (params) => http.get("/sap/bc/adt/cts/transports", {
|
|
|
498
649
|
* /sap/bc/adt/cts/transportchecks
|
|
499
650
|
* @source transportchecks.json
|
|
500
651
|
*/
|
|
501
|
-
const transportchecks = {
|
|
652
|
+
const transportchecks = {
|
|
653
|
+
/**
|
|
654
|
+
* GET /sap/bc/adt/cts/transportchecks
|
|
655
|
+
*/
|
|
656
|
+
get: () => http.get("/sap/bc/adt/cts/transportchecks", {
|
|
502
657
|
responses: { 200: void 0 },
|
|
503
658
|
headers: { Accept: "application/xml" }
|
|
504
659
|
}) };
|
|
@@ -532,11 +687,17 @@ const ctsContract = {
|
|
|
532
687
|
* @generated - DO NOT EDIT MANUALLY
|
|
533
688
|
*/
|
|
534
689
|
const worklistsContract = contract({
|
|
690
|
+
/**
|
|
691
|
+
* GET ATC worklist
|
|
692
|
+
*/
|
|
535
693
|
get: (worklistId, params) => http$1.get(`/sap/bc/adt/atc/worklists/${worklistId}`, {
|
|
536
694
|
query: params,
|
|
537
695
|
responses: { 200: atcworklist },
|
|
538
696
|
headers: { Accept: "*/*" }
|
|
539
697
|
}),
|
|
698
|
+
/**
|
|
699
|
+
* GET ATC worklist
|
|
700
|
+
*/
|
|
540
701
|
objectset: (worklistId, objectSetName, params) => http$1.get(`/sap/bc/adt/atc/worklists/${worklistId}/${objectSetName}`, {
|
|
541
702
|
query: params,
|
|
542
703
|
responses: { 200: atcworklist },
|
|
@@ -555,31 +716,49 @@ const worklistsContract = contract({
|
|
|
555
716
|
* @generated - DO NOT EDIT MANUALLY
|
|
556
717
|
*/
|
|
557
718
|
const resultsContract = contract({
|
|
719
|
+
/**
|
|
720
|
+
* GET ATC results
|
|
721
|
+
*/
|
|
558
722
|
active: (params) => http$1.get("/sap/bc/adt/atc/results", {
|
|
559
723
|
query: params,
|
|
560
724
|
responses: { 200: atcworklist },
|
|
561
725
|
headers: { Accept: "application/xml" }
|
|
562
726
|
}),
|
|
727
|
+
/**
|
|
728
|
+
* GET ATC results
|
|
729
|
+
*/
|
|
563
730
|
activeforsysid: (params) => http$1.get("/sap/bc/adt/atc/results", {
|
|
564
731
|
query: params,
|
|
565
732
|
responses: { 200: atcworklist },
|
|
566
733
|
headers: { Accept: "application/xml" }
|
|
567
734
|
}),
|
|
735
|
+
/**
|
|
736
|
+
* GET ATC results
|
|
737
|
+
*/
|
|
568
738
|
user: (params) => http$1.get("/sap/bc/adt/atc/results", {
|
|
569
739
|
query: params,
|
|
570
740
|
responses: { 200: atcworklist },
|
|
571
741
|
headers: { Accept: "application/xml" }
|
|
572
742
|
}),
|
|
743
|
+
/**
|
|
744
|
+
* GET ATC results
|
|
745
|
+
*/
|
|
573
746
|
central: (params) => http$1.get("/sap/bc/adt/atc/results", {
|
|
574
747
|
query: params,
|
|
575
748
|
responses: { 200: atcworklist },
|
|
576
749
|
headers: { Accept: "application/xml" }
|
|
577
750
|
}),
|
|
751
|
+
/**
|
|
752
|
+
* GET ATC results
|
|
753
|
+
*/
|
|
578
754
|
centralforsysid: (params) => http$1.get("/sap/bc/adt/atc/results", {
|
|
579
755
|
query: params,
|
|
580
756
|
responses: { 200: atcworklist },
|
|
581
757
|
headers: { Accept: "application/xml" }
|
|
582
758
|
}),
|
|
759
|
+
/**
|
|
760
|
+
* GET ATC results
|
|
761
|
+
*/
|
|
583
762
|
displayid: (displayId, params) => http$1.get(`/sap/bc/adt/atc/results/${displayId}`, {
|
|
584
763
|
query: params,
|
|
585
764
|
responses: { 200: atcworklist },
|
|
@@ -606,7 +785,11 @@ const resultsContract = contract({
|
|
|
606
785
|
*
|
|
607
786
|
* NOTE: Not in SAP discovery - manually defined
|
|
608
787
|
*/
|
|
609
|
-
const customizing = contract({
|
|
788
|
+
const customizing = contract({
|
|
789
|
+
/**
|
|
790
|
+
* GET /sap/bc/adt/atc/customizing
|
|
791
|
+
*/
|
|
792
|
+
get: () => http$1.get("/sap/bc/adt/atc/customizing", {
|
|
610
793
|
responses: { 200: atc },
|
|
611
794
|
headers: { Accept: "application/xml" }
|
|
612
795
|
}) });
|
|
@@ -616,7 +799,12 @@ const customizing = contract({ get: () => http$1.get("/sap/bc/adt/atc/customizin
|
|
|
616
799
|
* NOTE: POST endpoint with body - not in SAP discovery
|
|
617
800
|
* @source atcruns.json
|
|
618
801
|
*/
|
|
619
|
-
const runs = contract({
|
|
802
|
+
const runs = contract({
|
|
803
|
+
/**
|
|
804
|
+
* POST /sap/bc/adt/atc/runs{?worklistId,clientWait}
|
|
805
|
+
* Run ATC checks on objects specified in the request body
|
|
806
|
+
*/
|
|
807
|
+
post: (params) => http$1.post("/sap/bc/adt/atc/runs", {
|
|
620
808
|
query: params,
|
|
621
809
|
body: atcRun,
|
|
622
810
|
responses: { 200: atcworklist },
|
|
@@ -630,7 +818,14 @@ const runs = contract({ post: (params) => http$1.post("/sap/bc/adt/atc/runs", {
|
|
|
630
818
|
*
|
|
631
819
|
* Adds POST (create) endpoint not in generated contract
|
|
632
820
|
*/
|
|
633
|
-
const worklistsExtended = contract({
|
|
821
|
+
const worklistsExtended = contract({
|
|
822
|
+
/**
|
|
823
|
+
* POST /sap/bc/adt/atc/worklists{?checkVariant}
|
|
824
|
+
* Create a new ATC worklist
|
|
825
|
+
*
|
|
826
|
+
* NOTE: Not in SAP discovery - manually defined
|
|
827
|
+
*/
|
|
828
|
+
create: (params) => http$1.post("/sap/bc/adt/atc/worklists", {
|
|
634
829
|
query: params,
|
|
635
830
|
responses: { 200: atcworklist },
|
|
636
831
|
headers: { Accept: "*/*" }
|
|
@@ -653,51 +848,6 @@ const atcContract = {
|
|
|
653
848
|
}
|
|
654
849
|
};
|
|
655
850
|
|
|
656
|
-
//#endregion
|
|
657
|
-
//#region src/adt/aunit/coverage-link.ts
|
|
658
|
-
/**
|
|
659
|
-
* Coverage link helper for AUnit responses.
|
|
660
|
-
*
|
|
661
|
-
* When coverage is enabled on an ABAP Unit run, the aunit:runResult
|
|
662
|
-
* contains an atom:link with `rel` referring to the coverage measurement.
|
|
663
|
-
* Example:
|
|
664
|
-
*
|
|
665
|
-
* <atom:link href="/sap/bc/adt/runtime/traces/coverage/measurements/6D664D9B46CB1FE1859107ADE8729541"
|
|
666
|
-
* rel="http://www.sap.com/adt/relations/runtime/traces/coverage/measurements"/>
|
|
667
|
-
*
|
|
668
|
-
* The measurement ID is the hex segment after /measurements/.
|
|
669
|
-
*/
|
|
670
|
-
const COVERAGE_MEASUREMENT_HREF_RE = /\/sap\/bc\/adt\/runtime\/traces\/coverage\/measurements\/([A-Fa-f0-9]+)/;
|
|
671
|
-
/**
|
|
672
|
-
* Walk the given node (and, shallowly, its top-level children) searching
|
|
673
|
-
* for an atom:link whose href points to a coverage measurement. Returns
|
|
674
|
-
* the measurement ID (hex string) if found, otherwise undefined.
|
|
675
|
-
*/
|
|
676
|
-
function extractCoverageMeasurementId(result) {
|
|
677
|
-
if (!result || typeof result !== "object") return void 0;
|
|
678
|
-
const seen = /* @__PURE__ */ new Set();
|
|
679
|
-
const queue = [result];
|
|
680
|
-
while (queue.length > 0) {
|
|
681
|
-
const current = queue.shift();
|
|
682
|
-
if (!current || typeof current !== "object" || seen.has(current)) continue;
|
|
683
|
-
seen.add(current);
|
|
684
|
-
const obj = current;
|
|
685
|
-
const links = obj.link;
|
|
686
|
-
let linkList;
|
|
687
|
-
if (Array.isArray(links)) linkList = links;
|
|
688
|
-
else if (links && typeof links === "object") linkList = [links];
|
|
689
|
-
else linkList = [];
|
|
690
|
-
for (const link of linkList) {
|
|
691
|
-
const href = link && typeof link === "object" ? link.href ?? void 0 : void 0;
|
|
692
|
-
if (!href) continue;
|
|
693
|
-
const match = COVERAGE_MEASUREMENT_HREF_RE.exec(href);
|
|
694
|
-
if (match) return match[1];
|
|
695
|
-
}
|
|
696
|
-
for (const value of Object.values(obj)) if (Array.isArray(value)) for (const v of value) queue.push(v);
|
|
697
|
-
else if (value && typeof value === "object") queue.push(value);
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
|
|
701
851
|
//#endregion
|
|
702
852
|
//#region src/adt/aunit/index.ts
|
|
703
853
|
/**
|
|
@@ -715,7 +865,14 @@ function extractCoverageMeasurementId(result) {
|
|
|
715
865
|
*
|
|
716
866
|
* NOTE: Not in SAP discovery - manually defined
|
|
717
867
|
*/
|
|
718
|
-
const testruns = contract({
|
|
868
|
+
const testruns = contract({
|
|
869
|
+
/**
|
|
870
|
+
* POST /sap/bc/adt/abapunit/testruns
|
|
871
|
+
* Execute ABAP Unit test run with a runConfiguration body
|
|
872
|
+
*
|
|
873
|
+
* @returns runResult with programs, test classes, methods, and alerts
|
|
874
|
+
*/
|
|
875
|
+
post: () => http$1.post("/sap/bc/adt/abapunit/testruns", {
|
|
719
876
|
body: aunitRun,
|
|
720
877
|
responses: { 200: aunitResult },
|
|
721
878
|
headers: {
|
|
@@ -806,7 +963,12 @@ const interfacesContract = crud({
|
|
|
806
963
|
* /sap/bc/adt/oo/classrun
|
|
807
964
|
* Execute console application classes (IF_OO_ADT_CLASSRUN)
|
|
808
965
|
*/
|
|
809
|
-
const classrunContract = contract({
|
|
966
|
+
const classrunContract = contract({
|
|
967
|
+
/**
|
|
968
|
+
* POST /sap/bc/adt/oo/classrun/{classname}{?profilerId}
|
|
969
|
+
* Execute a class implementing IF_OO_ADT_CLASSRUN
|
|
970
|
+
*/
|
|
971
|
+
post: (classname, params) => http$1.post(`/sap/bc/adt/oo/classrun/${classname.toLowerCase()}`, {
|
|
810
972
|
query: params,
|
|
811
973
|
responses: { 200: void 0 },
|
|
812
974
|
headers: { Accept: "text/plain" }
|
|
@@ -828,7 +990,17 @@ const ooContract = {
|
|
|
828
990
|
* Endpoint: GET /sap/bc/adt/discovery
|
|
829
991
|
* Returns AtomPub service document describing available ADT services.
|
|
830
992
|
*/
|
|
831
|
-
const discoveryContract = {
|
|
993
|
+
const discoveryContract = {
|
|
994
|
+
/**
|
|
995
|
+
* Get Discovery Information
|
|
996
|
+
*
|
|
997
|
+
* Returns the ADT service discovery document in AtomPub format.
|
|
998
|
+
* This document describes all available ADT services, workspaces, and collections.
|
|
999
|
+
*
|
|
1000
|
+
* @endpoint GET /sap/bc/adt/discovery
|
|
1001
|
+
* @returns AtomPub service document with workspace and collection information
|
|
1002
|
+
*/
|
|
1003
|
+
getDiscovery: () => http$1.get("/sap/bc/adt/discovery", {
|
|
832
1004
|
responses: { 200: discovery },
|
|
833
1005
|
headers: { Accept: "application/atomsvc+xml" }
|
|
834
1006
|
}) };
|
|
@@ -851,13 +1023,25 @@ const discoveryContract = { getDiscovery: () => http$1.get("/sap/bc/adt/discover
|
|
|
851
1023
|
* // Create a new package
|
|
852
1024
|
* await client.adt.packages.post({ corrNr: 'DEVK900001' });
|
|
853
1025
|
*/
|
|
854
|
-
const
|
|
1026
|
+
const packageCrudContract = crud({
|
|
855
1027
|
basePath: "/sap/bc/adt/packages",
|
|
856
1028
|
schema: packagesV1,
|
|
857
1029
|
contentType: "application/vnd.sap.adt.packages.v2+xml",
|
|
858
1030
|
accept: "application/vnd.sap.adt.packages.v2+xml, application/vnd.sap.adt.packages.v1+xml",
|
|
859
1031
|
nameTransform: (n) => encodeURIComponent(n)
|
|
860
1032
|
});
|
|
1033
|
+
/**
|
|
1034
|
+
* Typed package operations which are not CRUD-shaped. The discovery document
|
|
1035
|
+
* advertises this as `/sap/bc/adt/packages/$tree{?packagename,type}`.
|
|
1036
|
+
*/
|
|
1037
|
+
const packagesContract = contract({
|
|
1038
|
+
...packageCrudContract,
|
|
1039
|
+
tree: (params) => http$1.get("/sap/bc/adt/packages/$tree", {
|
|
1040
|
+
query: params,
|
|
1041
|
+
responses: { 200: packagesV1 },
|
|
1042
|
+
headers: { Accept: "application/vnd.sap.adt.packages.v2+xml" }
|
|
1043
|
+
})
|
|
1044
|
+
});
|
|
861
1045
|
|
|
862
1046
|
//#endregion
|
|
863
1047
|
//#region src/adt/core/http/sessions.ts
|
|
@@ -867,7 +1051,18 @@ const packagesContract = crud({
|
|
|
867
1051
|
* HTTP session management and CSRF token initialization.
|
|
868
1052
|
* Path: /sap/bc/adt/core/http/sessions
|
|
869
1053
|
*/
|
|
870
|
-
const sessionsContract = {
|
|
1054
|
+
const sessionsContract = {
|
|
1055
|
+
/**
|
|
1056
|
+
* Get or create an HTTP session
|
|
1057
|
+
* Also initializes CSRF token for subsequent requests
|
|
1058
|
+
*
|
|
1059
|
+
* Uses x-sap-security-session: create to establish a proper security session.
|
|
1060
|
+
* All subsequent operations should use x-sap-security-session: use to stay
|
|
1061
|
+
* within the same security session (required for lock/unlock).
|
|
1062
|
+
*
|
|
1063
|
+
* @returns Session information with CSRF token and links
|
|
1064
|
+
*/
|
|
1065
|
+
getSession: () => http$1.get("/sap/bc/adt/core/http/sessions", {
|
|
871
1066
|
responses: { 200: http$2 },
|
|
872
1067
|
headers: {
|
|
873
1068
|
Accept: "application/vnd.sap.adt.core.http.session.v3+xml",
|
|
@@ -885,7 +1080,13 @@ const sessionsContract = { getSession: () => http$1.get("/sap/bc/adt/core/http/s
|
|
|
885
1080
|
* Returns system information including SAP release, client, user details.
|
|
886
1081
|
* Path: /sap/bc/adt/core/http/systeminformation
|
|
887
1082
|
*/
|
|
888
|
-
const systeminformationContract = contract({
|
|
1083
|
+
const systeminformationContract = contract({
|
|
1084
|
+
/**
|
|
1085
|
+
* Get system information
|
|
1086
|
+
*
|
|
1087
|
+
* @returns System information (systemID, client, userName, etc.)
|
|
1088
|
+
*/
|
|
1089
|
+
getSystemInfo: () => http$1.get("/sap/bc/adt/core/http/systeminformation", {
|
|
889
1090
|
responses: { 200: systeminformation },
|
|
890
1091
|
headers: { Accept: "application/vnd.sap.adt.core.http.systeminformation.v1+json" }
|
|
891
1092
|
}) });
|
|
@@ -909,7 +1110,32 @@ const coreContract = { http: httpContract };
|
|
|
909
1110
|
* ABAP object search operations.
|
|
910
1111
|
* Path: /sap/bc/adt/repository/informationsystem/search
|
|
911
1112
|
*/
|
|
912
|
-
const searchContract = {
|
|
1113
|
+
const searchContract = {
|
|
1114
|
+
/**
|
|
1115
|
+
* Quick search for ABAP objects
|
|
1116
|
+
*
|
|
1117
|
+
* @param query - Search query (supports wildcards like *)
|
|
1118
|
+
* @param maxResults - Maximum number of results (default: 50)
|
|
1119
|
+
* @param packageName - Filter by package name
|
|
1120
|
+
* @param objectType - Filter by object type (e.g., 'CLAS', 'INTF')
|
|
1121
|
+
* @returns Object references matching the search query (union of all adtcore element types)
|
|
1122
|
+
*
|
|
1123
|
+
* @example
|
|
1124
|
+
* // Search for classes starting with ZCL
|
|
1125
|
+
* const results = await client.repository.informationsystem.search.quickSearch({
|
|
1126
|
+
* query: 'zcl*',
|
|
1127
|
+
* maxResults: 10
|
|
1128
|
+
* });
|
|
1129
|
+
*
|
|
1130
|
+
* @example
|
|
1131
|
+
* // List all objects in a package
|
|
1132
|
+
* const results = await client.repository.informationsystem.search.quickSearch({
|
|
1133
|
+
* query: '*',
|
|
1134
|
+
* packageName: 'ZABAPGIT_EXAMPLES',
|
|
1135
|
+
* maxResults: 200
|
|
1136
|
+
* });
|
|
1137
|
+
*/
|
|
1138
|
+
quickSearch: (options) => http$1.get("/sap/bc/adt/repository/informationsystem/search", {
|
|
913
1139
|
query: {
|
|
914
1140
|
operation: "quickSearch",
|
|
915
1141
|
query: options.query,
|
|
@@ -983,9 +1209,10 @@ function buildUsageReferenceRequestXml(scopeResultXml) {
|
|
|
983
1209
|
const prologEnd = noProlog.indexOf("?>");
|
|
984
1210
|
if (prologEnd !== -1) noProlog = noProlog.slice(prologEnd + 2).replace(/^\s+/, "");
|
|
985
1211
|
}
|
|
1212
|
+
const scopeElement = noProlog.replaceAll(/usagereferences:usageScopeResult/g, "usagereferences:scope");
|
|
986
1213
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
987
1214
|
<usagereferences:usageReferenceRequest xmlns:usagereferences="${USAGEREFS_NAMESPACE}">\n <usagereferences:affectedObjects/>
|
|
988
|
-
${
|
|
1215
|
+
${scopeElement}\n</usagereferences:usageReferenceRequest>`;
|
|
989
1216
|
}
|
|
990
1217
|
/**
|
|
991
1218
|
* Step 1: fetch the default scope for a given object URI.
|
|
@@ -1026,11 +1253,80 @@ const usageReferencesContract = {
|
|
|
1026
1253
|
search
|
|
1027
1254
|
};
|
|
1028
1255
|
|
|
1256
|
+
//#endregion
|
|
1257
|
+
//#region src/adt/repository/sourceversions.ts
|
|
1258
|
+
/**
|
|
1259
|
+
* ADT Repository source-history contracts.
|
|
1260
|
+
*
|
|
1261
|
+
* Both operations follow URIs supplied by SAP ADT responses. They deliberately
|
|
1262
|
+
* do not construct version paths from an object URI.
|
|
1263
|
+
*/
|
|
1264
|
+
const ADT_ORIGIN = "https://adt.invalid";
|
|
1265
|
+
const ADT_PATH = "/sap/bc/adt";
|
|
1266
|
+
const INVALID_URI_MESSAGE = "Expected an ADT-relative URI under /sap/bc/adt";
|
|
1267
|
+
/**
|
|
1268
|
+
* Guard an opaque ADT URI supplied by SAP before we turn it into an
|
|
1269
|
+
* authenticated request. Other contracts which accept SAP-discovered URIs
|
|
1270
|
+
* share this boundary rather than reimplementing a slightly different URL
|
|
1271
|
+
* policy.
|
|
1272
|
+
*/
|
|
1273
|
+
function assertAdtRelativeUri(uri) {
|
|
1274
|
+
let parsed;
|
|
1275
|
+
try {
|
|
1276
|
+
parsed = new URL(uri, ADT_ORIGIN);
|
|
1277
|
+
} catch {
|
|
1278
|
+
throw new TypeError(INVALID_URI_MESSAGE);
|
|
1279
|
+
}
|
|
1280
|
+
const isRootRelative = uri.startsWith("/") && !uri.startsWith("//");
|
|
1281
|
+
const isAdtPath = parsed.pathname === ADT_PATH || parsed.pathname.startsWith(`${ADT_PATH}/`);
|
|
1282
|
+
if (uri !== uri.trim() || !isRootRelative || parsed.origin !== ADT_ORIGIN || !isAdtPath || parsed.hash) throw new TypeError(INVALID_URI_MESSAGE);
|
|
1283
|
+
}
|
|
1284
|
+
const sourceversionsContract = contract({
|
|
1285
|
+
list: (params) => {
|
|
1286
|
+
assertAdtRelativeUri(params.versionsUri);
|
|
1287
|
+
return http$1.get(params.versionsUri, {
|
|
1288
|
+
responses: { 200: atomFeed },
|
|
1289
|
+
headers: { Accept: "application/atom+xml;type=feed" }
|
|
1290
|
+
});
|
|
1291
|
+
},
|
|
1292
|
+
get: (params) => {
|
|
1293
|
+
assertAdtRelativeUri(params.sourceUri);
|
|
1294
|
+
return http$1.get(params.sourceUri, {
|
|
1295
|
+
responses: { 200: void 0 },
|
|
1296
|
+
headers: { Accept: "text/plain" }
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
|
|
1301
|
+
//#endregion
|
|
1302
|
+
//#region src/adt/repository/informationsystem/objectproperties.ts
|
|
1303
|
+
/**
|
|
1304
|
+
* ADT Repository Information System — object properties.
|
|
1305
|
+
*
|
|
1306
|
+
* SAP supplies the canonical object URI through quick search or object
|
|
1307
|
+
* metadata. This endpoint enriches it with generic facets such as package
|
|
1308
|
+
* and application component; it does not construct an object-specific URL.
|
|
1309
|
+
*/
|
|
1310
|
+
const OBJECT_PROPERTIES_RESULT_MIME = "application/vnd.sap.adt.repository.objproperties.result.v1+xml";
|
|
1311
|
+
const objectPropertiesContract = { values: (params) => {
|
|
1312
|
+
assertAdtRelativeUri(params.uri);
|
|
1313
|
+
const facets = [...new Set(params.facets ?? [])].filter((facet) => facet.trim().length > 0);
|
|
1314
|
+
return http$1.get("/sap/bc/adt/repository/informationsystem/objectproperties/values", {
|
|
1315
|
+
query: {
|
|
1316
|
+
uri: params.uri,
|
|
1317
|
+
...facets.length > 0 ? { facet: facets } : {}
|
|
1318
|
+
},
|
|
1319
|
+
responses: { 200: objectProperties },
|
|
1320
|
+
headers: { Accept: OBJECT_PROPERTIES_RESULT_MIME }
|
|
1321
|
+
});
|
|
1322
|
+
} };
|
|
1323
|
+
|
|
1029
1324
|
//#endregion
|
|
1030
1325
|
//#region src/adt/repository/informationsystem/index.ts
|
|
1031
1326
|
const informationsystemContract = {
|
|
1032
1327
|
search: searchContract,
|
|
1033
|
-
usageReferences: usageReferencesContract
|
|
1328
|
+
usageReferences: usageReferencesContract,
|
|
1329
|
+
objectProperties: objectPropertiesContract
|
|
1034
1330
|
};
|
|
1035
1331
|
|
|
1036
1332
|
//#endregion
|
|
@@ -1062,7 +1358,8 @@ const objectstructureContract = contract({ get: (params) => http$1.get(`${params
|
|
|
1062
1358
|
//#region src/adt/repository/index.ts
|
|
1063
1359
|
const repositoryContract = {
|
|
1064
1360
|
informationsystem: informationsystemContract,
|
|
1065
|
-
objectstructure: objectstructureContract
|
|
1361
|
+
objectstructure: objectstructureContract,
|
|
1362
|
+
sourceversions: sourceversionsContract
|
|
1066
1363
|
};
|
|
1067
1364
|
|
|
1068
1365
|
//#endregion
|
|
@@ -1178,10 +1475,12 @@ const basePath$4 = "/sap/bc/adt/functions/groups/${groupName}/fmodules";
|
|
|
1178
1475
|
* CRUD operations for function modules within a function group
|
|
1179
1476
|
*/
|
|
1180
1477
|
const functionModulesContract = contract({
|
|
1478
|
+
/** GET .../fmodules/{fmName} - Get function module metadata */
|
|
1181
1479
|
get: (_groupName, _fmName) => http$1.get(basePath$4 + "/${fmName}", {
|
|
1182
1480
|
responses: { 200: fmodules },
|
|
1183
1481
|
headers: { Accept: accept$2 }
|
|
1184
1482
|
}),
|
|
1483
|
+
/** POST .../fmodules - Create function module */
|
|
1185
1484
|
post: (groupName, queryOptions) => http$1.post(basePath$4, {
|
|
1186
1485
|
body: fmodules,
|
|
1187
1486
|
responses: { 200: fmodules },
|
|
@@ -1191,6 +1490,7 @@ const functionModulesContract = contract({
|
|
|
1191
1490
|
},
|
|
1192
1491
|
query: queryOptions?.corrNr ? { corrNr: queryOptions.corrNr } : void 0
|
|
1193
1492
|
}),
|
|
1493
|
+
/** PUT .../fmodules/{fmName} - Update function module metadata */
|
|
1194
1494
|
put: (groupName, fmName, options) => http$1.put(basePath$4 + "/${fmName}", {
|
|
1195
1495
|
body: fmodules,
|
|
1196
1496
|
responses: { 200: fmodules },
|
|
@@ -1203,6 +1503,7 @@ const functionModulesContract = contract({
|
|
|
1203
1503
|
...options?.corrNr ? { corrNr: options.corrNr } : {}
|
|
1204
1504
|
}
|
|
1205
1505
|
}),
|
|
1506
|
+
/** DELETE .../fmodules/{fmName} - Delete function module */
|
|
1206
1507
|
delete: (groupName, fmName, options) => http$1.delete(basePath$4 + "/${fmName}", {
|
|
1207
1508
|
responses: { 204: void 0 },
|
|
1208
1509
|
query: {
|
|
@@ -1210,6 +1511,7 @@ const functionModulesContract = contract({
|
|
|
1210
1511
|
...options?.corrNr ? { corrNr: options.corrNr } : {}
|
|
1211
1512
|
}
|
|
1212
1513
|
}),
|
|
1514
|
+
/** POST .../fmodules/{fmName}?_action=LOCK - Lock function module */
|
|
1213
1515
|
lock: (groupName, fmName, options) => http$1.post(basePath$4 + "/${fmName}", {
|
|
1214
1516
|
responses: { 200: void 0 },
|
|
1215
1517
|
headers: {
|
|
@@ -1223,6 +1525,7 @@ const functionModulesContract = contract({
|
|
|
1223
1525
|
...options?.corrNr ? { corrNr: options.corrNr } : {}
|
|
1224
1526
|
}
|
|
1225
1527
|
}),
|
|
1528
|
+
/** POST .../fmodules/{fmName}?_action=UNLOCK - Unlock function module */
|
|
1226
1529
|
unlock: (groupName, fmName, options) => http$1.post(basePath$4 + "/${fmName}", {
|
|
1227
1530
|
responses: { 200: void 0 },
|
|
1228
1531
|
headers: {
|
|
@@ -1235,11 +1538,14 @@ const functionModulesContract = contract({
|
|
|
1235
1538
|
lockHandle: options.lockHandle
|
|
1236
1539
|
}
|
|
1237
1540
|
}),
|
|
1541
|
+
/** Source code operations */
|
|
1238
1542
|
source: { main: {
|
|
1543
|
+
/** GET .../fmodules/{fmName}/source/main - Get source code */
|
|
1239
1544
|
get: (_groupName, _fmName) => http$1.get(basePath$4 + "/${fmName}/source/main", {
|
|
1240
1545
|
responses: { 200: void 0 },
|
|
1241
1546
|
headers: { Accept: "text/plain" }
|
|
1242
1547
|
}),
|
|
1548
|
+
/** PUT .../fmodules/{fmName}/source/main - Update source code */
|
|
1243
1549
|
put: (groupName, fmName, options) => http$1.put(basePath$4 + "/${fmName}/source/main", {
|
|
1244
1550
|
body: textPlain,
|
|
1245
1551
|
responses: { 200: void 0 },
|
|
@@ -1367,7 +1673,9 @@ const tablesContract = {
|
|
|
1367
1673
|
* typed as a plain-text endpoint.
|
|
1368
1674
|
*/
|
|
1369
1675
|
const basePath$1 = "/sap/bc/adt/ddic/db/settings";
|
|
1370
|
-
const tablesettingsContract = contract({
|
|
1676
|
+
const tablesettingsContract = contract({
|
|
1677
|
+
/** GET /sap/bc/adt/ddic/db/settings/{name} - Retrieve table settings XML */
|
|
1678
|
+
get: (name) => http$1.get(`${basePath$1}/${name.toLowerCase()}`, {
|
|
1371
1679
|
responses: { 200: void 0 },
|
|
1372
1680
|
headers: { Accept: "application/vnd.sap.adt.table.settings.v2+xml" }
|
|
1373
1681
|
}) });
|
|
@@ -1394,7 +1702,7 @@ const tabletypesContract = crud({
|
|
|
1394
1702
|
* ADT CDS DDL Source Contract
|
|
1395
1703
|
*
|
|
1396
1704
|
* Endpoint: /sap/bc/adt/ddic/ddl/sources
|
|
1397
|
-
* Content-Type: application/vnd.sap.adt.
|
|
1705
|
+
* Content-Type: application/vnd.sap.adt.ddlSource+xml
|
|
1398
1706
|
* Object type: DDLS
|
|
1399
1707
|
*
|
|
1400
1708
|
* CDS Data Definition sources — the SAP endpoint for CDS views / data
|
|
@@ -1404,8 +1712,9 @@ const tabletypesContract = crud({
|
|
|
1404
1712
|
const ddlSourcesContract = crud({
|
|
1405
1713
|
basePath: "/sap/bc/adt/ddic/ddl/sources",
|
|
1406
1714
|
schema: ddlSource,
|
|
1407
|
-
contentType: "application/vnd.sap.adt.
|
|
1408
|
-
accept: "application/vnd.sap.adt.
|
|
1715
|
+
contentType: "application/vnd.sap.adt.ddlSource+xml",
|
|
1716
|
+
accept: "application/vnd.sap.adt.ddlSource+xml",
|
|
1717
|
+
nameTransform: (name) => encodeURIComponent(name.toLowerCase()),
|
|
1409
1718
|
sources: ["main"]
|
|
1410
1719
|
});
|
|
1411
1720
|
|
|
@@ -1422,14 +1731,15 @@ const ddlContract = { sources: ddlSourcesContract };
|
|
|
1422
1731
|
* (Note: the SAP endpoint for DCL sources lives under `acm/dcl`, not
|
|
1423
1732
|
* `ddic/dcl`. The contract is exported under `ddic.dcl` for API
|
|
1424
1733
|
* parity with the ADK and the sibling DDL contract.)
|
|
1425
|
-
* Content-Type: application/vnd.sap.adt.
|
|
1734
|
+
* Content-Type: application/vnd.sap.adt.dclSource+xml
|
|
1426
1735
|
* Object type: DCLS
|
|
1427
1736
|
*/
|
|
1428
1737
|
const dclSourcesContract = crud({
|
|
1429
1738
|
basePath: "/sap/bc/adt/acm/dcl/sources",
|
|
1430
1739
|
schema: dclSource,
|
|
1431
|
-
contentType: "application/vnd.sap.adt.
|
|
1432
|
-
accept: "application/vnd.sap.adt.
|
|
1740
|
+
contentType: "application/vnd.sap.adt.dclSource+xml",
|
|
1741
|
+
accept: "application/vnd.sap.adt.dclSource+xml",
|
|
1742
|
+
nameTransform: (name) => encodeURIComponent(name.toLowerCase()),
|
|
1433
1743
|
sources: ["main"]
|
|
1434
1744
|
});
|
|
1435
1745
|
|
|
@@ -1437,6 +1747,73 @@ const dclSourcesContract = crud({
|
|
|
1437
1747
|
//#region src/adt/ddic/dcl/index.ts
|
|
1438
1748
|
const dclContract = { sources: dclSourcesContract };
|
|
1439
1749
|
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region src/adt/ddic/ddlx/sources.ts
|
|
1752
|
+
const ddlxSourcesContract = crud({
|
|
1753
|
+
basePath: "/sap/bc/adt/ddic/ddlx/sources",
|
|
1754
|
+
schema: ddlxSource,
|
|
1755
|
+
contentType: "application/vnd.sap.adt.ddic.ddlx.v1+xml",
|
|
1756
|
+
accept: "application/vnd.sap.adt.ddic.ddlx.v1+xml",
|
|
1757
|
+
nameTransform: (name) => encodeURIComponent(name.toLowerCase()),
|
|
1758
|
+
sources: ["main"]
|
|
1759
|
+
});
|
|
1760
|
+
|
|
1761
|
+
//#endregion
|
|
1762
|
+
//#region src/adt/ddic/ddlx/index.ts
|
|
1763
|
+
const ddlxContract = { sources: ddlxSourcesContract };
|
|
1764
|
+
|
|
1765
|
+
//#endregion
|
|
1766
|
+
//#region src/adt/ddic/dsfd/sources.ts
|
|
1767
|
+
const dsfdSourcesContract = crud({
|
|
1768
|
+
basePath: "/sap/bc/adt/ddic/dsfd/sources",
|
|
1769
|
+
schema: blueSource,
|
|
1770
|
+
contentType: "application/vnd.sap.adt.blues.v1+xml",
|
|
1771
|
+
accept: "application/vnd.sap.adt.blues.v1+xml",
|
|
1772
|
+
nameTransform: (name) => encodeURIComponent(name.toLowerCase()),
|
|
1773
|
+
sources: ["main"]
|
|
1774
|
+
});
|
|
1775
|
+
|
|
1776
|
+
//#endregion
|
|
1777
|
+
//#region src/adt/ddic/dsfd/index.ts
|
|
1778
|
+
const dsfdContract = { sources: dsfdSourcesContract };
|
|
1779
|
+
|
|
1780
|
+
//#endregion
|
|
1781
|
+
//#region src/adt/ddic/dsfi/index.ts
|
|
1782
|
+
const dsfiDefinitionSchema = {
|
|
1783
|
+
_infer: void 0,
|
|
1784
|
+
parse: (raw) => JSON.parse(raw),
|
|
1785
|
+
build: (value) => JSON.stringify(value)
|
|
1786
|
+
};
|
|
1787
|
+
const baseContract$1 = crud({
|
|
1788
|
+
basePath: "/sap/bc/adt/ddic/dsfi",
|
|
1789
|
+
schema: blueSource,
|
|
1790
|
+
contentType: "application/vnd.sap.adt.blues.v1+xml",
|
|
1791
|
+
accept: "application/vnd.sap.adt.blues.v1+xml",
|
|
1792
|
+
nameTransform: (name) => encodeURIComponent(name.toLowerCase())
|
|
1793
|
+
});
|
|
1794
|
+
const dsfiContract = {
|
|
1795
|
+
...baseContract$1,
|
|
1796
|
+
source: { main: { get: (name) => http.get(`/sap/bc/adt/ddic/dsfi/${encodeURIComponent(name.toLowerCase())}/source/main`, {
|
|
1797
|
+
responses: { 200: dsfiDefinitionSchema },
|
|
1798
|
+
headers: { Accept: "application/json" }
|
|
1799
|
+
}) } }
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
//#endregion
|
|
1803
|
+
//#region src/adt/ddic/dteb/sources.ts
|
|
1804
|
+
const dtebSourcesContract = crud({
|
|
1805
|
+
basePath: "/sap/bc/adt/ddic/dteb/sources",
|
|
1806
|
+
schema: dtebSource,
|
|
1807
|
+
contentType: "application/vnd.sap.adt.ddic.dteb.v1+xml",
|
|
1808
|
+
accept: "application/vnd.sap.adt.ddic.dteb.v1+xml",
|
|
1809
|
+
nameTransform: (name) => encodeURIComponent(name.toLowerCase()),
|
|
1810
|
+
sources: ["main"]
|
|
1811
|
+
});
|
|
1812
|
+
|
|
1813
|
+
//#endregion
|
|
1814
|
+
//#region src/adt/ddic/dteb/index.ts
|
|
1815
|
+
const dtebContract = { sources: dtebSourcesContract };
|
|
1816
|
+
|
|
1440
1817
|
//#endregion
|
|
1441
1818
|
//#region src/adt/ddic/srvd/sources.ts
|
|
1442
1819
|
/**
|
|
@@ -1458,6 +1835,7 @@ const srvdSourcesContract = crud({
|
|
|
1458
1835
|
schema: srvdSource,
|
|
1459
1836
|
contentType: "application/vnd.sap.adt.ddic.srvd.v1+xml",
|
|
1460
1837
|
accept: "application/vnd.sap.adt.ddic.srvd.v1+xml",
|
|
1838
|
+
nameTransform: (name) => encodeURIComponent(name.toLowerCase()),
|
|
1461
1839
|
sources: ["main"]
|
|
1462
1840
|
});
|
|
1463
1841
|
|
|
@@ -1476,6 +1854,10 @@ const ddicContract = {
|
|
|
1476
1854
|
tabletypes: tabletypesContract,
|
|
1477
1855
|
ddl: ddlContract,
|
|
1478
1856
|
dcl: dclContract,
|
|
1857
|
+
ddlx: ddlxContract,
|
|
1858
|
+
dsfd: dsfdContract,
|
|
1859
|
+
dsfi: dsfiContract,
|
|
1860
|
+
dteb: dtebContract,
|
|
1479
1861
|
srvd: srvdContract
|
|
1480
1862
|
};
|
|
1481
1863
|
|
|
@@ -1488,6 +1870,16 @@ const ddicContract = {
|
|
|
1488
1870
|
* Path: /sap/bc/adt/system/users
|
|
1489
1871
|
*/
|
|
1490
1872
|
const usersContract = {
|
|
1873
|
+
/**
|
|
1874
|
+
* Search for users by query string
|
|
1875
|
+
*
|
|
1876
|
+
* @param options.querystring - Search query (supports wildcards like *)
|
|
1877
|
+
* @param options.maxcount - Maximum number of results
|
|
1878
|
+
* @returns Atom feed with matching user entries (id = username, title = full name)
|
|
1879
|
+
*
|
|
1880
|
+
* @example
|
|
1881
|
+
* const results = await client.system.users.search({ querystring: 'DEV*', maxcount: 10 });
|
|
1882
|
+
*/
|
|
1491
1883
|
search: (options) => http$1.get("/sap/bc/adt/system/users", {
|
|
1492
1884
|
query: {
|
|
1493
1885
|
querystring: options.querystring,
|
|
@@ -1496,6 +1888,15 @@ const usersContract = {
|
|
|
1496
1888
|
responses: { 200: atomFeed },
|
|
1497
1889
|
headers: { Accept: "application/atom+xml;type=feed" }
|
|
1498
1890
|
}),
|
|
1891
|
+
/**
|
|
1892
|
+
* Get a specific user by username
|
|
1893
|
+
*
|
|
1894
|
+
* @param username - SAP username (e.g., 'DEVELOPER')
|
|
1895
|
+
* @returns Atom feed with a single user entry
|
|
1896
|
+
*
|
|
1897
|
+
* @example
|
|
1898
|
+
* const user = await client.system.users.get('DEVELOPER');
|
|
1899
|
+
*/
|
|
1499
1900
|
get: (username) => http$1.get(`/sap/bc/adt/system/users/${encodeURIComponent(username)}`, {
|
|
1500
1901
|
responses: { 200: atomFeed },
|
|
1501
1902
|
headers: { Accept: "application/atom+xml;type=feed" }
|
|
@@ -1525,22 +1926,47 @@ const usersContract = {
|
|
|
1525
1926
|
*/
|
|
1526
1927
|
const pemBody = { _infer: void 0 };
|
|
1527
1928
|
const psesContract = {
|
|
1929
|
+
/**
|
|
1930
|
+
* List all Personal Security Environments (identities).
|
|
1931
|
+
*
|
|
1932
|
+
* `GET /sap/bc/adt/system/security/pses`
|
|
1933
|
+
*/
|
|
1528
1934
|
list: () => http$1.get("/sap/bc/adt/system/security/pses", {
|
|
1529
1935
|
responses: { 200: atomFeed },
|
|
1530
1936
|
headers: { Accept: "application/atom+xml;type=feed" }
|
|
1531
1937
|
}),
|
|
1938
|
+
/**
|
|
1939
|
+
* Get a single PSE identified by `{context}/{applic}`.
|
|
1940
|
+
*
|
|
1941
|
+
* `GET /sap/bc/adt/system/security/pses/{context}/{applic}`
|
|
1942
|
+
*/
|
|
1532
1943
|
get: (context, applic) => http$1.get(`/sap/bc/adt/system/security/pses/${encodeURIComponent(context)}/${encodeURIComponent(applic)}`, {
|
|
1533
1944
|
responses: { 200: atomFeed },
|
|
1534
1945
|
headers: { Accept: "application/atom+xml;type=feed" }
|
|
1535
1946
|
}),
|
|
1947
|
+
/**
|
|
1948
|
+
* List certificates inside a PSE.
|
|
1949
|
+
*
|
|
1950
|
+
* `GET /sap/bc/adt/system/security/pses/{context}/{applic}/certificates`
|
|
1951
|
+
*/
|
|
1536
1952
|
listCertificates: (context, applic) => http$1.get(`/sap/bc/adt/system/security/pses/${encodeURIComponent(context)}/${encodeURIComponent(applic)}/certificates`, {
|
|
1537
1953
|
responses: { 200: atomFeed },
|
|
1538
1954
|
headers: { Accept: "application/atom+xml;type=feed" }
|
|
1539
1955
|
}),
|
|
1956
|
+
/**
|
|
1957
|
+
* Fetch the PEM of a single certificate in a PSE.
|
|
1958
|
+
*
|
|
1959
|
+
* `GET /sap/bc/adt/system/security/pses/{context}/{applic}/certificates/{id}`
|
|
1960
|
+
*/
|
|
1540
1961
|
getCertificate: (context, applic, id) => http$1.get(`/sap/bc/adt/system/security/pses/${encodeURIComponent(context)}/${encodeURIComponent(applic)}/certificates/${encodeURIComponent(id)}`, {
|
|
1541
1962
|
responses: { 200: void 0 },
|
|
1542
1963
|
headers: { Accept: "application/x-pem-file" }
|
|
1543
1964
|
}),
|
|
1965
|
+
/**
|
|
1966
|
+
* Upload a PEM certificate into a PSE. The body is the PEM text.
|
|
1967
|
+
*
|
|
1968
|
+
* `POST /sap/bc/adt/system/security/pses/{context}/{applic}/certificates`
|
|
1969
|
+
*/
|
|
1544
1970
|
uploadCertificate: (context, applic) => http$1.post(`/sap/bc/adt/system/security/pses/${encodeURIComponent(context)}/${encodeURIComponent(applic)}/certificates`, {
|
|
1545
1971
|
body: pemBody,
|
|
1546
1972
|
responses: { 200: atomFeed },
|
|
@@ -1549,6 +1975,11 @@ const psesContract = {
|
|
|
1549
1975
|
"Content-Type": "application/x-pem-file"
|
|
1550
1976
|
}
|
|
1551
1977
|
}),
|
|
1978
|
+
/**
|
|
1979
|
+
* Delete a certificate from a PSE.
|
|
1980
|
+
*
|
|
1981
|
+
* `DELETE /sap/bc/adt/system/security/pses/{context}/{applic}/certificates/{id}`
|
|
1982
|
+
*/
|
|
1552
1983
|
deleteCertificate: (context, applic, id) => http$1.delete(`/sap/bc/adt/system/security/pses/${encodeURIComponent(context)}/${encodeURIComponent(applic)}/certificates/${encodeURIComponent(id)}`, { responses: { 204: void 0 } })
|
|
1553
1984
|
};
|
|
1554
1985
|
|
|
@@ -1578,7 +2009,15 @@ const systemContract = {
|
|
|
1578
2009
|
* Request body: checkObjectList (chkrun:CheckObjectList)
|
|
1579
2010
|
* Response: checkRunReports (chkrun:CheckReportList)
|
|
1580
2011
|
*/
|
|
1581
|
-
const checkObjects = contract({
|
|
2012
|
+
const checkObjects = contract({
|
|
2013
|
+
/**
|
|
2014
|
+
* POST /sap/bc/adt/checkruns
|
|
2015
|
+
* Submit a checkObjectList and receive checkRunReports.
|
|
2016
|
+
*
|
|
2017
|
+
* Both request and response use the same `checkrun` schema (union discriminated
|
|
2018
|
+
* by the root element: `checkObjectList` for requests, `checkRunReports` for responses).
|
|
2019
|
+
*/
|
|
2020
|
+
post: () => http$1.post("/sap/bc/adt/checkruns", {
|
|
1582
2021
|
body: checkrun,
|
|
1583
2022
|
responses: { 200: checkrun },
|
|
1584
2023
|
headers: {
|
|
@@ -1609,7 +2048,15 @@ const checkrunsContract = { checkObjects };
|
|
|
1609
2048
|
* Activate one or more ABAP objects.
|
|
1610
2049
|
* Request body: adtcore:objectReferences (AdtcoreSchema variant)
|
|
1611
2050
|
*/
|
|
1612
|
-
const activate = contract({
|
|
2051
|
+
const activate = contract({
|
|
2052
|
+
/**
|
|
2053
|
+
* POST /sap/bc/adt/activation{?method,preauditRequested}
|
|
2054
|
+
*
|
|
2055
|
+
* Submit an objectReferences body to activate the listed objects.
|
|
2056
|
+
* The `method` query param selects the action (default: "activate").
|
|
2057
|
+
* The response XML is not strictly typed here – callers may ignore it.
|
|
2058
|
+
*/
|
|
2059
|
+
post: (params) => http$1.post("/sap/bc/adt/activation", {
|
|
1613
2060
|
query: params,
|
|
1614
2061
|
body: adtcore,
|
|
1615
2062
|
responses: { 200: adtcore },
|
|
@@ -1667,7 +2114,9 @@ const dataPreviewFreestyleRequestSchema = {
|
|
|
1667
2114
|
* Accept: application/json
|
|
1668
2115
|
* Body: raw ABAP SQL SELECT statement
|
|
1669
2116
|
*/
|
|
1670
|
-
const freestyle = {
|
|
2117
|
+
const freestyle = {
|
|
2118
|
+
/** POST /datapreview/freestyle - execute a free-style SQL query */
|
|
2119
|
+
post: (query) => http$1.post("/sap/bc/adt/datapreview/freestyle", {
|
|
1671
2120
|
body: dataPreviewFreestyleRequestSchema,
|
|
1672
2121
|
responses: { 200: dataPreviewFreestyleResponseSchema },
|
|
1673
2122
|
headers: {
|
|
@@ -1690,6 +2139,74 @@ const freestyle = { post: (query) => http$1.post("/sap/bc/adt/datapreview/freest
|
|
|
1690
2139
|
*/
|
|
1691
2140
|
const datapreviewContract = { freestyle };
|
|
1692
2141
|
|
|
2142
|
+
//#endregion
|
|
2143
|
+
//#region src/adt/runtime/traces/coverage/request.ts
|
|
2144
|
+
const COVERAGE_NAMESPACE = "http://www.sap.com/adt/cov";
|
|
2145
|
+
const ADT_CORE_NAMESPACE = "http://www.sap.com/adt/core";
|
|
2146
|
+
const STATEMENTS_RELATION = "http://www.sap.com/adt/relations/runtime/traces/coverage/results/statements";
|
|
2147
|
+
const coverageXmlBody = {
|
|
2148
|
+
parse: (value) => String(value),
|
|
2149
|
+
build: (value) => value,
|
|
2150
|
+
_infer: void 0
|
|
2151
|
+
};
|
|
2152
|
+
function escapeXmlAttribute(value) {
|
|
2153
|
+
return value.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
2154
|
+
}
|
|
2155
|
+
function buildCoverageQuery(objectUris) {
|
|
2156
|
+
const objectReferences = objectUris.map((uri) => `<adtcore:objectReference adtcore:uri="${escapeXmlAttribute(uri)}"/>`).join("\n");
|
|
2157
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2158
|
+
<cov:query xmlns:cov="${COVERAGE_NAMESPACE}">
|
|
2159
|
+
<adtcore:objectSets xmlns:adtcore="${ADT_CORE_NAMESPACE}">
|
|
2160
|
+
<objectSet kind="inclusive">
|
|
2161
|
+
<adtcore:objectReferences>
|
|
2162
|
+
${objectReferences}
|
|
2163
|
+
</adtcore:objectReferences>
|
|
2164
|
+
</objectSet>
|
|
2165
|
+
</adtcore:objectSets>
|
|
2166
|
+
</cov:query>`;
|
|
2167
|
+
}
|
|
2168
|
+
function takeUnseenRecord(value, seenValues) {
|
|
2169
|
+
if (!value || typeof value !== "object" || seenValues.has(value)) return;
|
|
2170
|
+
seenValues.add(value);
|
|
2171
|
+
return value;
|
|
2172
|
+
}
|
|
2173
|
+
function takeStatementUri(record, seenUris) {
|
|
2174
|
+
const { rel, href } = record;
|
|
2175
|
+
if (rel !== STATEMENTS_RELATION || typeof href !== "string" || seenUris.has(href)) return;
|
|
2176
|
+
seenUris.add(href);
|
|
2177
|
+
return href;
|
|
2178
|
+
}
|
|
2179
|
+
function enqueueChildObjects(record, queue) {
|
|
2180
|
+
for (const child of Object.values(record)) {
|
|
2181
|
+
if (Array.isArray(child)) {
|
|
2182
|
+
queue.push(...child);
|
|
2183
|
+
continue;
|
|
2184
|
+
}
|
|
2185
|
+
if (child && typeof child === "object") queue.push(child);
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
function extractCoverageStatementUris(value) {
|
|
2189
|
+
const statementUris = [];
|
|
2190
|
+
const seenUris = /* @__PURE__ */ new Set();
|
|
2191
|
+
const seenValues = /* @__PURE__ */ new Set();
|
|
2192
|
+
const queue = [value];
|
|
2193
|
+
while (queue.length > 0) {
|
|
2194
|
+
const record = takeUnseenRecord(queue.shift(), seenValues);
|
|
2195
|
+
if (!record) continue;
|
|
2196
|
+
const statementUri = takeStatementUri(record, seenUris);
|
|
2197
|
+
if (statementUri) statementUris.push(statementUri);
|
|
2198
|
+
enqueueChildObjects(record, queue);
|
|
2199
|
+
}
|
|
2200
|
+
return statementUris;
|
|
2201
|
+
}
|
|
2202
|
+
function buildStatementsBulkRequest(statementUris) {
|
|
2203
|
+
const requests = statementUris.map((uri) => `<statementsRequest get="${escapeXmlAttribute(uri)}"/>`).join("\n");
|
|
2204
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2205
|
+
<cov:statementsBulkRequest xmlns:cov="${COVERAGE_NAMESPACE}">
|
|
2206
|
+
${requests}
|
|
2207
|
+
</cov:statementsBulkRequest>`;
|
|
2208
|
+
}
|
|
2209
|
+
|
|
1693
2210
|
//#endregion
|
|
1694
2211
|
//#region src/adt/runtime/traces/coverage/measurements.ts
|
|
1695
2212
|
/**
|
|
@@ -1699,16 +2216,25 @@ const datapreviewContract = { freestyle };
|
|
|
1699
2216
|
* created measurement. Used as the second step of the aunit → coverage
|
|
1700
2217
|
* flow: aunit run → atom:link to measurement → POST this endpoint.
|
|
1701
2218
|
*
|
|
1702
|
-
* Content-Type: application/xml
|
|
1703
|
-
* Accept: application/xml
|
|
2219
|
+
* Content-Type: application/xml
|
|
2220
|
+
* Accept: application/xml
|
|
1704
2221
|
*/
|
|
1705
|
-
const
|
|
1706
|
-
const measurements = contract({
|
|
2222
|
+
const XML_CONTENT_TYPE$1 = "application/xml";
|
|
2223
|
+
const measurements = contract({
|
|
2224
|
+
/**
|
|
2225
|
+
* POST /sap/bc/adt/runtime/traces/coverage/measurements/{identifier}
|
|
2226
|
+
* ?withAdditionalTypeInfo=true
|
|
2227
|
+
*
|
|
2228
|
+
* Returns the coverage tree rooted at ADT_ROOT_NODE with coverage
|
|
2229
|
+
* totals (branch/procedure/statement) for each object reference.
|
|
2230
|
+
*/
|
|
2231
|
+
post: (identifier) => http$1.post(`/sap/bc/adt/runtime/traces/coverage/measurements/${identifier}`, {
|
|
1707
2232
|
query: { withAdditionalTypeInfo: true },
|
|
2233
|
+
body: coverageXmlBody,
|
|
1708
2234
|
responses: { 200: acoverageResult },
|
|
1709
2235
|
headers: {
|
|
1710
|
-
Accept:
|
|
1711
|
-
"Content-Type":
|
|
2236
|
+
Accept: XML_CONTENT_TYPE$1,
|
|
2237
|
+
"Content-Type": "application/xml"
|
|
1712
2238
|
}
|
|
1713
2239
|
}) });
|
|
1714
2240
|
|
|
@@ -1717,15 +2243,24 @@ const measurements = contract({ post: (identifier) => http$1.post(`/sap/bc/adt/r
|
|
|
1717
2243
|
/**
|
|
1718
2244
|
* /sap/bc/adt/runtime/traces/coverage/results/{id}/statements
|
|
1719
2245
|
*
|
|
1720
|
-
*
|
|
2246
|
+
* POST returns the cov:statementsBulkResponse with per-method statement
|
|
1721
2247
|
* / branch / procedure coverage details.
|
|
1722
2248
|
*
|
|
1723
|
-
* Content-Type: application/xml
|
|
2249
|
+
* Content-Type: application/xml
|
|
2250
|
+
* Accept: application/xml
|
|
1724
2251
|
*/
|
|
1725
|
-
const
|
|
1726
|
-
const statements = contract({
|
|
2252
|
+
const XML_CONTENT_TYPE = "application/xml";
|
|
2253
|
+
const statements = contract({
|
|
2254
|
+
/**
|
|
2255
|
+
* POST /sap/bc/adt/runtime/traces/coverage/results/{identifier}/statements
|
|
2256
|
+
*/
|
|
2257
|
+
post: (identifier) => http$1.post(`/sap/bc/adt/runtime/traces/coverage/results/${identifier}/statements`, {
|
|
2258
|
+
body: coverageXmlBody,
|
|
1727
2259
|
responses: { 200: acoverageStatements },
|
|
1728
|
-
headers: {
|
|
2260
|
+
headers: {
|
|
2261
|
+
Accept: XML_CONTENT_TYPE,
|
|
2262
|
+
"Content-Type": "application/xml"
|
|
2263
|
+
}
|
|
1729
2264
|
}) });
|
|
1730
2265
|
|
|
1731
2266
|
//#endregion
|
|
@@ -2112,6 +2647,7 @@ const behaviordefinitionsContract = crud({
|
|
|
2112
2647
|
schema: blueSource,
|
|
2113
2648
|
contentType: "application/vnd.sap.adt.blues.v1+xml",
|
|
2114
2649
|
accept: "application/vnd.sap.adt.blues.v1+xml",
|
|
2650
|
+
nameTransform: (name) => encodeURIComponent(name.toLowerCase()),
|
|
2115
2651
|
sources: ["main"]
|
|
2116
2652
|
});
|
|
2117
2653
|
|
|
@@ -2125,7 +2661,7 @@ const boContract = { behaviordefinitions: behaviordefinitionsContract };
|
|
|
2125
2661
|
* ADT RAP Service Binding (SRVB) Contract
|
|
2126
2662
|
*
|
|
2127
2663
|
* Endpoint: /sap/bc/adt/businessservices/bindings
|
|
2128
|
-
* Content-Type: application/vnd.sap.adt.businessservices.servicebinding.
|
|
2664
|
+
* Content-Type: application/vnd.sap.adt.businessservices.servicebinding.v2+xml
|
|
2129
2665
|
* Object type: SRVB/SVB
|
|
2130
2666
|
*
|
|
2131
2667
|
* RAP Service Binding — binds a Service Definition (SRVD) to a runtime
|
|
@@ -2140,12 +2676,13 @@ const boContract = { behaviordefinitions: behaviordefinitionsContract };
|
|
|
2140
2676
|
* Reference: abapGit handler zcl_abapgit_object_srvb.
|
|
2141
2677
|
*/
|
|
2142
2678
|
const basePath = "/sap/bc/adt/businessservices/bindings";
|
|
2143
|
-
const nameTransform = (n) => n.toLowerCase();
|
|
2679
|
+
const nameTransform = (n) => encodeURIComponent(n.toLowerCase());
|
|
2144
2680
|
const baseContract = crud({
|
|
2145
2681
|
basePath,
|
|
2146
2682
|
schema: servicebinding,
|
|
2147
|
-
contentType: "application/vnd.sap.adt.businessservices.servicebinding.
|
|
2148
|
-
accept: "application/vnd.sap.adt.businessservices.servicebinding.
|
|
2683
|
+
contentType: "application/vnd.sap.adt.businessservices.servicebinding.v2+xml",
|
|
2684
|
+
accept: "application/vnd.sap.adt.businessservices.servicebinding.v2+xml",
|
|
2685
|
+
nameTransform
|
|
2149
2686
|
});
|
|
2150
2687
|
/**
|
|
2151
2688
|
* Publish/unpublish extension for SRVB.
|
|
@@ -2400,6 +2937,56 @@ const completion = contract({ post: (query) => http$1.post("/sap/bc/adt/codeassi
|
|
|
2400
2937
|
//#region src/adt/codeassistance/index.ts
|
|
2401
2938
|
const codeassistanceContract = { completion };
|
|
2402
2939
|
|
|
2940
|
+
//#endregion
|
|
2941
|
+
//#region src/adt/vit/wb/objectproperties.ts
|
|
2942
|
+
/**
|
|
2943
|
+
* ADT vit/wb — Basic Object Properties (classic Workbench metadata).
|
|
2944
|
+
*
|
|
2945
|
+
* Endpoint template (from ADT discovery):
|
|
2946
|
+
* GET /sap/bc/adt/vit/wb/object_type/{type}/object_name/{name}
|
|
2947
|
+
*
|
|
2948
|
+
* Accept: application/vnd.sap.adt.basic.object.properties+xml
|
|
2949
|
+
* Response: adtcore:mainObject
|
|
2950
|
+
*
|
|
2951
|
+
* Classic BAdI uses vit types:
|
|
2952
|
+
* sxsdxd — BAdI definition (repository type SXSD/XD)
|
|
2953
|
+
* sxcixi — BAdI implementation (repository type SXCI/XI)
|
|
2954
|
+
*/
|
|
2955
|
+
const BASIC_OBJECT_PROPERTIES_MIME = "application/vnd.sap.adt.basic.object.properties+xml";
|
|
2956
|
+
/** vit/wb object_type segment for classic BAdI definitions. */
|
|
2957
|
+
const CLASSIC_BADI_DEFINITION_VIT_TYPE = "sxsdxd";
|
|
2958
|
+
/** vit/wb object_type segment for classic BAdI implementations. */
|
|
2959
|
+
const CLASSIC_BADI_IMPLEMENTATION_VIT_TYPE = "sxcixi";
|
|
2960
|
+
function objectPropertiesPath(vitType, objectName) {
|
|
2961
|
+
const normalizedType = vitType.trim().toLowerCase();
|
|
2962
|
+
const normalizedName = objectName.trim().toLowerCase();
|
|
2963
|
+
return `/sap/bc/adt/vit/wb/object_type/${encodeURIComponent(normalizedType)}/object_name/${encodeURIComponent(normalizedName)}`;
|
|
2964
|
+
}
|
|
2965
|
+
function getByVitType(vitType) {
|
|
2966
|
+
return (objectName) => http$1.get(objectPropertiesPath(vitType, objectName), {
|
|
2967
|
+
responses: { 200: adtcore },
|
|
2968
|
+
headers: { Accept: BASIC_OBJECT_PROPERTIES_MIME }
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
/**
|
|
2972
|
+
* /sap/bc/adt/vit/wb/object_type/{type}/object_name/{name}
|
|
2973
|
+
*/
|
|
2974
|
+
const vitWbObjectPropertiesContract = contract({
|
|
2975
|
+
/** Generic read for any vit/wb object_type segment. */
|
|
2976
|
+
get: (params) => http$1.get(objectPropertiesPath(params.vitType, params.objectName), {
|
|
2977
|
+
responses: { 200: adtcore },
|
|
2978
|
+
headers: { Accept: BASIC_OBJECT_PROPERTIES_MIME }
|
|
2979
|
+
}),
|
|
2980
|
+
/** Classic BAdI definition (SXSD/XD). */
|
|
2981
|
+
getDefinition: getByVitType(CLASSIC_BADI_DEFINITION_VIT_TYPE),
|
|
2982
|
+
/** Classic BAdI implementation (SXCI/XI). */
|
|
2983
|
+
getImplementation: getByVitType(CLASSIC_BADI_IMPLEMENTATION_VIT_TYPE)
|
|
2984
|
+
});
|
|
2985
|
+
|
|
2986
|
+
//#endregion
|
|
2987
|
+
//#region src/adt/vit/index.ts
|
|
2988
|
+
const vitContract = { wb: { objectProperties: vitWbObjectPropertiesContract } };
|
|
2989
|
+
|
|
2403
2990
|
//#endregion
|
|
2404
2991
|
//#region src/adt/index.ts
|
|
2405
2992
|
/**
|
|
@@ -2427,7 +3014,8 @@ const adtContract = {
|
|
|
2427
3014
|
businessservices: businessservicesContract,
|
|
2428
3015
|
enhancements: enhancementsContract,
|
|
2429
3016
|
flp: flpContract,
|
|
2430
|
-
codeassistance: codeassistanceContract
|
|
3017
|
+
codeassistance: codeassistanceContract,
|
|
3018
|
+
vit: vitContract
|
|
2431
3019
|
};
|
|
2432
3020
|
|
|
2433
3021
|
//#endregion
|
|
@@ -2464,5 +3052,5 @@ function contract(definition) {
|
|
|
2464
3052
|
}
|
|
2465
3053
|
|
|
2466
3054
|
//#endregion
|
|
2467
|
-
export {
|
|
2468
|
-
//# sourceMappingURL=base-
|
|
3055
|
+
export { coverageContract as $, usageReferencesContract as $t, gctsBranchesSchema as A, structuresContract as At, gctsPullSchema as B, objectstructureContract as Bt, enhancementsContract as C, dclContract as Ct, boContract as D, tabletypesContract as Dt, bindingsContract as E, ddlSourcesContract as Et, gctsCreateBranchResponseSchema as F, functionGroupsContract as Ft, runtimeContract as G, sourceversionsContract as Gt, gctsRepositorySchema as H, OBJECT_PROPERTIES_RESULT_MIME as Ht, gctsCreateRepositoryBodySchema as I, programsModuleContract as It, profile as J, SEARCH_REQUEST_MIME as Jt, dumps as K, SCOPE_REQUEST_MIME as Kt, gctsGenericOkSchema as L, includesContract as Lt, gctsCommitResponseSchema as M, domainsContract as Mt, gctsConfigSchema as N, functionsContract as Nt, behaviordefinitionsContract as O, tablesettingsContract as Ot, gctsCreateBranchBodySchema as P, functionModulesContract as Pt, runtimeTraceListSchema as Q, buildUsageScopeRequestXml as Qt, gctsLogSchema as R, programsContract as Rt, normalizeOdataFeed as S, ddlxSourcesContract as St, businessservicesContract as T, ddlContract as Tt, gctsSetConfigBodySchema as U, objectPropertiesContract as Ut, gctsRepositoriesSchema as V, informationsystemContract as Vt, gctsSetItemBodySchema as W, assertAdtRelativeUri as Wt, runtimeDumpListSchema as X, USAGEREFS_NAMESPACE as Xt, runtimeDumpDetailSchema as Y, SEARCH_RESPONSE_MIME as Yt, runtimeTraceDetailSchema as Z, buildUsageReferenceRequestXml as Zt, flpGroupListSchema as _, TransportStatus as _n, dtebSourcesContract as _t, vitContract as a, packagesContract as an, extractCoverageStatementUris as at, flpTileSchema as b, crud as bn, dsfdSourcesContract as bt, CLASSIC_BADI_IMPLEMENTATION_VIT_TYPE as c, classrunContract as cn, activationContract as ct, completion as d, aunitContract as dn, psesContract as dt, searchContract as en, statements as et, completionRequestSchema as f, atcContract as fn, usersContract as ft, flpCatalogSchema as g, TransportFunction as gn, dtebContract as gt, flpCatalogListSchema as h, ctsContract as hn, srvdSourcesContract as ht, adtContract as i, sessionsContract as in, coverageXmlBody as it, gctsCommitBodySchema as j, dataelementsContract as jt, gctsContract as k, tablesContract as kt, vitWbObjectPropertiesContract as l, interfacesContract as ln, checkrunsContract as lt, flpContract as m, worklistsContract as mn, srvdContract as mt, createAdtClient as n, httpContract as nn, buildCoverageQuery as nt, BASIC_OBJECT_PROPERTIES_MIME as o, discoveryContract as on, datapreviewContract as ot, completionResponseSchema as p, resultsContract as pn, ddicContract as pt, tracesContract as q, SCOPE_RESPONSE_MIME as qt, http$1 as r, systeminformationContract as rn, buildStatementsBulkRequest as rt, CLASSIC_BADI_DEFINITION_VIT_TYPE as s, ooContract as sn, freestyle as st, contract as t, coreContract as tn, measurements as tt, codeassistanceContract as u, classesContract as un, systemContract as ut, flpGroupSchema as v, normalizeTransportFindResponse as vn, dsfiContract as vt, enhoxhhContract as w, dclSourcesContract as wt, normalizeOdataEntity as x, repo as xn, ddlxContract as xt, flpTileListSchema as y, transports as yn, dsfdContract as yt, gctsObjectsSchema as z, repositoryContract as zt };
|
|
3056
|
+
//# sourceMappingURL=base-CJ5t6dbP.mjs.map
|