@abapify/adk 0.4.0 → 0.4.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.
- package/dist/factory-DtyrTGlN.mjs +394 -0
- package/dist/factory-DtyrTGlN.mjs.map +1 -0
- package/dist/index.d.mts +2899 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +4300 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +4 -4
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2899 @@
|
|
|
1
|
+
import { LockEntry, LockHandle, LockHandle as LockHandle$1, LockService, LockService as LockService$1, LockStore, LockStore as LockRegistry, LockStore as LockStore$1, createLockService } from "@abapify/adt-locks";
|
|
2
|
+
import { AdtClient, AdtClient as AdtClient$1, ClassResponse as ClassResponse$1, DataElementResponse, DomainResponse, FunctionGroupResponse as FunctionGroupResponse$1, FunctionModuleResponse as FunctionModuleResponse$1, IncludeResponse as IncludeResponse$1, InterfaceResponse as InterfaceResponse$1, PackageResponse as PackageResponse$1, ProgramResponse as ProgramResponse$1, TableResponse, TableTypeResponse, TransportGetResponse } from "@abapify/adt-client";
|
|
3
|
+
|
|
4
|
+
//#region src/base/adt.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Extract the abapClass variant from ClassResponse union
|
|
7
|
+
* ClassResponse = { abapClass: ... } | { abapClassInclude: ... }
|
|
8
|
+
* ADK Class objects only use the abapClass variant
|
|
9
|
+
*/
|
|
10
|
+
type ClassResponse = Extract<ClassResponse$1, {
|
|
11
|
+
abapClass: unknown;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Extract the abapInterface variant from InterfaceResponse union
|
|
15
|
+
*/
|
|
16
|
+
type InterfaceResponse = Extract<InterfaceResponse$1, {
|
|
17
|
+
abapInterface: unknown;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Extract the package variant from PackageResponse union
|
|
21
|
+
* PackageResponse = { package: ... } | { packageTree: ... }
|
|
22
|
+
* ADK Package objects only use the package variant
|
|
23
|
+
*/
|
|
24
|
+
type PackageResponse = Extract<PackageResponse$1, {
|
|
25
|
+
package: unknown;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Program response type - single root element (no union needed)
|
|
29
|
+
*/
|
|
30
|
+
type ProgramResponse = ProgramResponse$1;
|
|
31
|
+
/**
|
|
32
|
+
* Include response type - single root element (no union needed)
|
|
33
|
+
*/
|
|
34
|
+
type IncludeResponse = IncludeResponse$1;
|
|
35
|
+
/**
|
|
36
|
+
* Function group response type - single root element (no union needed)
|
|
37
|
+
*/
|
|
38
|
+
type FunctionGroupResponse = FunctionGroupResponse$1;
|
|
39
|
+
/**
|
|
40
|
+
* Function module response type - single root element (no union needed)
|
|
41
|
+
*/
|
|
42
|
+
type FunctionModuleResponse = FunctionModuleResponse$1;
|
|
43
|
+
/**
|
|
44
|
+
* ADT REST contracts accessible via client.adt.*
|
|
45
|
+
*
|
|
46
|
+
* This is the typed contract layer from adt-client.
|
|
47
|
+
* Example: client.adt.oo.classes.get('ZCL_MY_CLASS')
|
|
48
|
+
*/
|
|
49
|
+
type AdtContracts = AdtClient$1['adt'];
|
|
50
|
+
/**
|
|
51
|
+
* ADK Contract interface
|
|
52
|
+
*
|
|
53
|
+
* Proxy to adt-client contracts.
|
|
54
|
+
* Provides typed access to ADT REST endpoints.
|
|
55
|
+
*/
|
|
56
|
+
interface AdkContract {
|
|
57
|
+
/** OO contracts (classes, interfaces) */
|
|
58
|
+
readonly oo: AdtContracts['oo'];
|
|
59
|
+
/** Packages contract */
|
|
60
|
+
readonly packages: AdtContracts['packages'];
|
|
61
|
+
/** CTS contracts (transports) */
|
|
62
|
+
readonly cts: AdtContracts['cts'];
|
|
63
|
+
/** Core contracts (discovery, sessions) */
|
|
64
|
+
readonly core: AdtContracts['core'];
|
|
65
|
+
/** Repository contracts (search) */
|
|
66
|
+
readonly repository: AdtContracts['repository'];
|
|
67
|
+
/** Programs contracts */
|
|
68
|
+
readonly programs: AdtContracts['programs'];
|
|
69
|
+
/** Functions contracts (function groups) */
|
|
70
|
+
readonly functions: AdtContracts['functions'];
|
|
71
|
+
/** DDIC contracts (domains, data elements, structures, tables, table types) */
|
|
72
|
+
readonly ddic: AdtContracts['ddic'];
|
|
73
|
+
/** BO contracts (behavior definitions) */
|
|
74
|
+
readonly bo: AdtContracts['bo'];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Create ADK contract from ADT client
|
|
78
|
+
*
|
|
79
|
+
* @param client - ADT client instance from createAdtClient()
|
|
80
|
+
* @returns ADK contract proxy
|
|
81
|
+
*/
|
|
82
|
+
declare function createAdkContract(client: AdtClient$1): AdkContract;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/base/context.d.ts
|
|
85
|
+
/**
|
|
86
|
+
* Context provided to all ADK objects
|
|
87
|
+
*
|
|
88
|
+
* Provides direct access to ADT client.
|
|
89
|
+
* Objects use client.adt.* for contracts and client.services.* for services.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* // In AdkClass.load():
|
|
93
|
+
* const data = await this.ctx.client.adt.oo.classes.get(this.name);
|
|
94
|
+
*
|
|
95
|
+
* // In AdkTransport:
|
|
96
|
+
* const transport = await this.ctx.client.services.transports.get(this.id);
|
|
97
|
+
*/
|
|
98
|
+
interface AdkContext {
|
|
99
|
+
/**
|
|
100
|
+
* ADT client instance
|
|
101
|
+
*
|
|
102
|
+
* Provides:
|
|
103
|
+
* - client.adt.* - Low-level REST contracts
|
|
104
|
+
* - client.services.* - High-level service APIs
|
|
105
|
+
* - client.fetch() - Raw HTTP for edge cases
|
|
106
|
+
*/
|
|
107
|
+
readonly client: AdtClient;
|
|
108
|
+
/**
|
|
109
|
+
* Optional lock store for persisting lock handles to disk.
|
|
110
|
+
*
|
|
111
|
+
* When provided, lock()/unlock() will register/deregister entries
|
|
112
|
+
* so that stale locks can be recovered after process crashes.
|
|
113
|
+
* If not provided, locks are only held in memory (default behavior).
|
|
114
|
+
*/
|
|
115
|
+
readonly lockStore?: LockStore$1;
|
|
116
|
+
/**
|
|
117
|
+
* Lock service for centralized lock/unlock operations.
|
|
118
|
+
*
|
|
119
|
+
* Provides HTTP lock/unlock + automatic store registration.
|
|
120
|
+
* Used by ADK models, CLI commands, and export logic so that
|
|
121
|
+
* every lock operation is tracked in a single store.
|
|
122
|
+
*/
|
|
123
|
+
readonly lockService?: LockService$1;
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/base/model.d.ts
|
|
127
|
+
/**
|
|
128
|
+
* Save mode for create/update operations
|
|
129
|
+
* - 'update': PUT to existing object (default, fails if doesn't exist)
|
|
130
|
+
* - 'create': POST to create new object (skips POST if already exists, then updates)
|
|
131
|
+
* - 'upsert': Try PUT first, fall back to POST if 404
|
|
132
|
+
*/
|
|
133
|
+
type SaveMode = 'update' | 'create' | 'upsert';
|
|
134
|
+
/**
|
|
135
|
+
* Options for save operations
|
|
136
|
+
*/
|
|
137
|
+
interface SaveOptions {
|
|
138
|
+
/** Transport request for the change */
|
|
139
|
+
transport?: string;
|
|
140
|
+
/** Save as inactive (default: false) */
|
|
141
|
+
inactive?: boolean;
|
|
142
|
+
/** Save mode: 'update' (default), 'create', or 'upsert' */
|
|
143
|
+
mode?: SaveMode;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Result of bulk activation
|
|
147
|
+
*/
|
|
148
|
+
interface ActivationResult {
|
|
149
|
+
/** Number of successfully activated objects */
|
|
150
|
+
success: number;
|
|
151
|
+
/** Number of objects that failed activation */
|
|
152
|
+
failed: number;
|
|
153
|
+
/** Activation messages (errors, warnings) */
|
|
154
|
+
messages: string[];
|
|
155
|
+
/** Raw response from SAP (for debugging) */
|
|
156
|
+
response?: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Atom link (from atom:link element)
|
|
160
|
+
* Used for HATEOAS-style navigation in ADT responses
|
|
161
|
+
*/
|
|
162
|
+
interface AtomLink {
|
|
163
|
+
href: string;
|
|
164
|
+
rel?: string;
|
|
165
|
+
type?: string;
|
|
166
|
+
title?: string;
|
|
167
|
+
etag?: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* ADT object reference (adtcore:objectReference)
|
|
171
|
+
*/
|
|
172
|
+
interface AdtObjectReference {
|
|
173
|
+
uri?: string;
|
|
174
|
+
name?: string;
|
|
175
|
+
type?: string;
|
|
176
|
+
description?: string;
|
|
177
|
+
packageName?: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Base data contract for all ADK objects
|
|
181
|
+
* Matches XSD AdtObject type attributes and elements
|
|
182
|
+
*/
|
|
183
|
+
interface AdkObjectData {
|
|
184
|
+
name: string;
|
|
185
|
+
type: string;
|
|
186
|
+
description?: string;
|
|
187
|
+
changedBy?: string;
|
|
188
|
+
changedAt?: string | Date;
|
|
189
|
+
createdBy?: string;
|
|
190
|
+
createdAt?: string | Date;
|
|
191
|
+
version?: string;
|
|
192
|
+
language?: string;
|
|
193
|
+
descriptionTextLimit?: number;
|
|
194
|
+
links?: AtomLink[];
|
|
195
|
+
containerRef?: AdtObjectReference;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Main object data contract (extends AdtObject)
|
|
199
|
+
* Matches XSD AdtMainObject type
|
|
200
|
+
*/
|
|
201
|
+
interface AdkMainObjectData extends AdkObjectData {
|
|
202
|
+
packageRef?: AdtObjectReference;
|
|
203
|
+
masterSystem?: string;
|
|
204
|
+
masterLanguage?: string;
|
|
205
|
+
responsible?: string;
|
|
206
|
+
abapLanguageVersion?: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Base class for all ADK objects
|
|
210
|
+
*
|
|
211
|
+
* All ADK objects (AdkPackage, AdkTransportRequest, etc.) extend this.
|
|
212
|
+
* Supports deferred loading - create with just a name, then call load().
|
|
213
|
+
*
|
|
214
|
+
* Note: Uses loose type constraint for D to allow schema-inferred types
|
|
215
|
+
* from contracts which may have different shapes. The getters safely
|
|
216
|
+
* handle missing properties with defaults.
|
|
217
|
+
*
|
|
218
|
+
* @typeParam K - The object kind (from AdkKind)
|
|
219
|
+
* @typeParam D - The internal data type (typically schema-inferred from contract)
|
|
220
|
+
*/
|
|
221
|
+
declare abstract class AdkObject<K extends AdkKind = AdkKind, D = any> {
|
|
222
|
+
/** Object kind identifier */
|
|
223
|
+
abstract readonly kind: K;
|
|
224
|
+
/**
|
|
225
|
+
* ADT object URI - base path for all operations.
|
|
226
|
+
* Example: `/sap/bc/adt/oo/classes/zcl_my_class`
|
|
227
|
+
*/
|
|
228
|
+
abstract get objectUri(): string;
|
|
229
|
+
/**
|
|
230
|
+
* ADT collection URI - base path for creating new objects.
|
|
231
|
+
* Example: `/sap/bc/adt/oo/classes`
|
|
232
|
+
* Default: derived from objectUri by removing the object name
|
|
233
|
+
*/
|
|
234
|
+
get collectionUri(): string;
|
|
235
|
+
protected ctx: AdkContext;
|
|
236
|
+
/** Public access to the ADT client for plugins and external code */
|
|
237
|
+
get client(): AdtClient;
|
|
238
|
+
protected _data?: D;
|
|
239
|
+
protected _name: string;
|
|
240
|
+
protected cache: Map<string, unknown>;
|
|
241
|
+
protected dirty: Set<string>;
|
|
242
|
+
protected _lockHandle?: LockHandle$1;
|
|
243
|
+
/** Set by save() when all pending changes are identical to SAP state */
|
|
244
|
+
_unchanged: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Create ADK object
|
|
247
|
+
* @param ctx - ADK context
|
|
248
|
+
* @param dataOrName - Full data object OR just the object name for deferred loading
|
|
249
|
+
*/
|
|
250
|
+
constructor(ctx: AdkContext, dataOrName: D | string);
|
|
251
|
+
/**
|
|
252
|
+
* Adopt a richer context (merge services into existing context).
|
|
253
|
+
*
|
|
254
|
+
* Used by AdkObjectSet to propagate lockService / lockStore
|
|
255
|
+
* to objects created by plugins that only have { client }.
|
|
256
|
+
* Keeps the original client reference intact.
|
|
257
|
+
*/
|
|
258
|
+
adoptContext(ctx: AdkContext): void;
|
|
259
|
+
/**
|
|
260
|
+
* Load object data from SAP
|
|
261
|
+
*
|
|
262
|
+
* Default implementation uses crudContract.get() and unwraps with wrapperKey.
|
|
263
|
+
* Objects without crudContract must override this.
|
|
264
|
+
*
|
|
265
|
+
* @returns this (for chaining)
|
|
266
|
+
*/
|
|
267
|
+
load(): Promise<this>;
|
|
268
|
+
/** Whether data has been loaded */
|
|
269
|
+
get isLoaded(): boolean;
|
|
270
|
+
/**
|
|
271
|
+
* Get data - auto-loads if not already loaded
|
|
272
|
+
* @returns Promise that resolves to the data
|
|
273
|
+
*/
|
|
274
|
+
data(): Promise<D>;
|
|
275
|
+
/**
|
|
276
|
+
* Get data synchronously - throws if not loaded
|
|
277
|
+
* Use when you know data is already loaded
|
|
278
|
+
*/
|
|
279
|
+
get dataSync(): D;
|
|
280
|
+
/** Set data (for subclasses to use after loading) */
|
|
281
|
+
protected setData(data: D): void;
|
|
282
|
+
/** Helper to access data with AdkObjectData properties */
|
|
283
|
+
private get coreData();
|
|
284
|
+
/** ADT object name (adtcore:name) - available even before load() */
|
|
285
|
+
get name(): string;
|
|
286
|
+
/** ADT object type (adtcore:type, e.g. 'RQRQ', 'DEVC/K') - requires load() */
|
|
287
|
+
get type(): string;
|
|
288
|
+
/** Description text (adtcore:description) */
|
|
289
|
+
get description(): string;
|
|
290
|
+
/** Version state (adtcore:version) - active, inactive, etc. */
|
|
291
|
+
get version(): string;
|
|
292
|
+
/** Current language (adtcore:language) */
|
|
293
|
+
get language(): string;
|
|
294
|
+
/** User who last modified (adtcore:changedBy) */
|
|
295
|
+
get changedBy(): string;
|
|
296
|
+
/** Last modification timestamp (adtcore:changedAt) */
|
|
297
|
+
get changedAt(): Date;
|
|
298
|
+
/** User who created (adtcore:createdBy) */
|
|
299
|
+
get createdBy(): string;
|
|
300
|
+
/** Creation timestamp (adtcore:createdAt) */
|
|
301
|
+
get createdAt(): Date;
|
|
302
|
+
/** All atom:link elements */
|
|
303
|
+
get links(): AtomLink[];
|
|
304
|
+
/** Find link by rel attribute */
|
|
305
|
+
getLink(rel: string): AtomLink | undefined;
|
|
306
|
+
/** Get link href by rel, or undefined */
|
|
307
|
+
getLinkHref(rel: string): string | undefined;
|
|
308
|
+
/** Container reference (adtcore:containerRef) */
|
|
309
|
+
get containerRef(): AdtObjectReference | undefined;
|
|
310
|
+
/** Check if object is currently locked */
|
|
311
|
+
get isLocked(): boolean;
|
|
312
|
+
/** Get current lock handle */
|
|
313
|
+
get lockHandle(): LockHandle$1 | undefined;
|
|
314
|
+
/**
|
|
315
|
+
* Lock the object for modification
|
|
316
|
+
*
|
|
317
|
+
* Delegates to the lock service (single lock mechanism).
|
|
318
|
+
*
|
|
319
|
+
* The lock response contains:
|
|
320
|
+
* - LOCK_HANDLE: Required for subsequent PUT/unlock operations
|
|
321
|
+
* - CORRNR: Transport request assigned to this object (use for PUT if no explicit transport)
|
|
322
|
+
* - CORRUSER: User who owns the transport
|
|
323
|
+
*
|
|
324
|
+
* @param transport - Optional transport request to use for locking.
|
|
325
|
+
* Required when object is already in a transport.
|
|
326
|
+
*/
|
|
327
|
+
lock(transport?: string): Promise<LockHandle$1>;
|
|
328
|
+
/**
|
|
329
|
+
* Unlock the object
|
|
330
|
+
*
|
|
331
|
+
* Delegates to the lock service (single lock mechanism).
|
|
332
|
+
*/
|
|
333
|
+
unlock(): Promise<void>;
|
|
334
|
+
/**
|
|
335
|
+
* Set lock handle (for subclasses that need custom lock logic)
|
|
336
|
+
*/
|
|
337
|
+
protected setLockHandle(handle: LockHandle$1 | undefined): void;
|
|
338
|
+
/**
|
|
339
|
+
* Save the object to SAP
|
|
340
|
+
*
|
|
341
|
+
* Generic implementation that handles:
|
|
342
|
+
* - Lock/unlock lifecycle
|
|
343
|
+
* - Mode switching (create/update/upsert)
|
|
344
|
+
* - Error handling
|
|
345
|
+
*
|
|
346
|
+
* Subclasses implement `saveViaContract()` to provide the typed contract call.
|
|
347
|
+
*
|
|
348
|
+
* Modes:
|
|
349
|
+
* - 'update' (default): PUT to existing object
|
|
350
|
+
* - 'create': POST skeleton, then lock → PUT/source → unlock (Eclipse ADT pattern)
|
|
351
|
+
* - 'upsert': Check existence, create if needed, then update
|
|
352
|
+
*
|
|
353
|
+
* @param options - Save options
|
|
354
|
+
* @returns this (for chaining)
|
|
355
|
+
*/
|
|
356
|
+
save(options?: SaveOptions): Promise<this>;
|
|
357
|
+
/**
|
|
358
|
+
* Wrapper key for the data in contract requests/responses
|
|
359
|
+
*
|
|
360
|
+
* Contracts wrap data like { abapClass: ... } or { abapInterface: ... }.
|
|
361
|
+
* Subclasses that support save override this.
|
|
362
|
+
*/
|
|
363
|
+
protected get wrapperKey(): string | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* CRUD contract for this object type
|
|
366
|
+
*
|
|
367
|
+
* Subclasses that support save override this to return their contract.
|
|
368
|
+
*/
|
|
369
|
+
protected get crudContract(): any;
|
|
370
|
+
/**
|
|
371
|
+
* Execute the typed contract call for save
|
|
372
|
+
*
|
|
373
|
+
* Generic implementation using wrapperKey and crudContract.
|
|
374
|
+
* Objects that don't support save leave wrapperKey/crudContract undefined.
|
|
375
|
+
*
|
|
376
|
+
* For 'create' mode: POSTs skeleton data (minimal fields).
|
|
377
|
+
* For 'update' mode: PUTs full data (all fields except abapLanguageVersion).
|
|
378
|
+
*
|
|
379
|
+
* @param mode - 'create' (POST skeleton) or 'update' (PUT full)
|
|
380
|
+
* @param options - Contract options (transport, lockHandle)
|
|
381
|
+
*/
|
|
382
|
+
protected saveViaContract(mode: 'create' | 'update', options: {
|
|
383
|
+
transport?: string;
|
|
384
|
+
lockHandle?: string;
|
|
385
|
+
}): Promise<void>;
|
|
386
|
+
/**
|
|
387
|
+
* Get skeleton data for object creation (POST).
|
|
388
|
+
*
|
|
389
|
+
* Returns only the minimal fields needed to create the object on SAP.
|
|
390
|
+
* SAP creates the object structure (includes, etc.) from these fields.
|
|
391
|
+
* Full metadata and source code are sent via PUT in the update step.
|
|
392
|
+
*
|
|
393
|
+
* Override in subclasses that need different skeleton fields.
|
|
394
|
+
*/
|
|
395
|
+
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
396
|
+
/**
|
|
397
|
+
* Check if the object exists on the SAP system.
|
|
398
|
+
*
|
|
399
|
+
* Used by upsert mode to decide between update and create paths upfront.
|
|
400
|
+
* On BTP, locking a non-existent DDIC object creates a draft that persists
|
|
401
|
+
* even after unlock, blocking subsequent POST (create) attempts. Checking
|
|
402
|
+
* existence first with GET avoids this problem entirely.
|
|
403
|
+
*/
|
|
404
|
+
protected checkObjectExists(): Promise<boolean>;
|
|
405
|
+
/**
|
|
406
|
+
* Check if error is a 404 Not Found
|
|
407
|
+
*/
|
|
408
|
+
protected isNotFoundError(e: unknown): boolean;
|
|
409
|
+
/**
|
|
410
|
+
* Upsert fallback: try POST (create), treat 422 "already exists" as unchanged.
|
|
411
|
+
* Extracted to avoid duplication in lock-catch and saveViaContract-catch paths.
|
|
412
|
+
*/
|
|
413
|
+
private fallbackToCreate;
|
|
414
|
+
/**
|
|
415
|
+
* Check if error suggests the object doesn't exist or the operation
|
|
416
|
+
* is not supported for the current state.
|
|
417
|
+
*
|
|
418
|
+
* Some SAP DDIC endpoints (TABL, TTYP) return 405 Method Not Allowed
|
|
419
|
+
* instead of 404 when attempting to lock or PUT a non-existent object.
|
|
420
|
+
* In upsert mode, both should trigger a fallback to POST (create).
|
|
421
|
+
*/
|
|
422
|
+
protected shouldFallbackToCreate(e: unknown): boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Check if error is a 422 "already exists" from a POST create attempt
|
|
425
|
+
*/
|
|
426
|
+
protected isAlreadyExistsError(e: unknown): boolean;
|
|
427
|
+
/**
|
|
428
|
+
* Check if object has pending sources to save
|
|
429
|
+
* Subclasses with source code (classes, interfaces) override this
|
|
430
|
+
*/
|
|
431
|
+
protected hasPendingSources(): boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Normalize source code for comparison.
|
|
434
|
+
* Trims trailing whitespace/newlines so minor formatting differences
|
|
435
|
+
* don't trigger unnecessary saves.
|
|
436
|
+
*/
|
|
437
|
+
protected normalizeSource(source: string): string;
|
|
438
|
+
/**
|
|
439
|
+
* Check if pending sources are unchanged vs SAP (pre-lock comparison).
|
|
440
|
+
* Sets _unchanged = true if nothing needs saving.
|
|
441
|
+
*
|
|
442
|
+
* Default handles single-source objects (_pendingSource) by fetching
|
|
443
|
+
* GET {objectUri}/source/main and comparing.
|
|
444
|
+
* AdkClass overrides this for multi-include logic.
|
|
445
|
+
*/
|
|
446
|
+
protected checkPendingSourcesUnchanged(): Promise<void>;
|
|
447
|
+
/**
|
|
448
|
+
* Check if metadata-only objects are unchanged on SAP.
|
|
449
|
+
*
|
|
450
|
+
* For objects without source code (DDIC types like DOMA, DTEL, TABL, TTYP),
|
|
451
|
+
* fetches the current SAP state and compares only the fields present in
|
|
452
|
+
* the local data. SAP returns extra volatile fields (timestamps, links,
|
|
453
|
+
* version, etc.) that are ignored — only semantic fields matter.
|
|
454
|
+
*/
|
|
455
|
+
protected checkMetadataUnchanged(): Promise<void>;
|
|
456
|
+
/**
|
|
457
|
+
* Refresh cached ETags after acquiring a lock.
|
|
458
|
+
*
|
|
459
|
+
* SAP changes the object's internal version when a lock is acquired,
|
|
460
|
+
* which invalidates any cached ETags. Without refreshing, the next
|
|
461
|
+
* PUT sends a stale If-Match header and SAP returns HTTP 412.
|
|
462
|
+
*
|
|
463
|
+
* For objects with pending sources: re-GET {objectUri}/source/main
|
|
464
|
+
* For metadata-only objects: re-GET via crudContract.get()
|
|
465
|
+
*
|
|
466
|
+
* Subclasses with multiple source endpoints (e.g., AdkClass with includes)
|
|
467
|
+
* should override this to refresh all relevant endpoints.
|
|
468
|
+
*/
|
|
469
|
+
protected refreshETagsAfterLock(): Promise<void>;
|
|
470
|
+
/**
|
|
471
|
+
* Save pending sources to SAP.
|
|
472
|
+
*
|
|
473
|
+
* Default handles single-source objects (_pendingSource) by PUTting
|
|
474
|
+
* to {objectUri}/source/main.
|
|
475
|
+
* AdkClass overrides this for multi-include logic.
|
|
476
|
+
*/
|
|
477
|
+
protected savePendingSources(options?: {
|
|
478
|
+
lockHandle?: string;
|
|
479
|
+
transport?: string;
|
|
480
|
+
}): Promise<void>;
|
|
481
|
+
/**
|
|
482
|
+
* Set source content for a source-based object
|
|
483
|
+
*
|
|
484
|
+
* Generic implementation for objects with source code (classes, includes, etc.)
|
|
485
|
+
* Subclasses should override if they need custom source handling.
|
|
486
|
+
*
|
|
487
|
+
* @param sourcePath - Relative path to source (e.g., '/source/main')
|
|
488
|
+
* @param content - Source code content
|
|
489
|
+
* @param options - Save options
|
|
490
|
+
*/
|
|
491
|
+
setSource(sourcePath: string, content: string, options?: SaveOptions): Promise<void>;
|
|
492
|
+
/**
|
|
493
|
+
* Activate this object
|
|
494
|
+
*
|
|
495
|
+
* Activates a single object. For bulk activation of multiple objects,
|
|
496
|
+
* use `AdkObjectSet.activateAll()`.
|
|
497
|
+
*
|
|
498
|
+
* @returns this (for chaining)
|
|
499
|
+
*/
|
|
500
|
+
activate(): Promise<this>;
|
|
501
|
+
/** Lazy load a segment (async) - fetches only once, then cached */
|
|
502
|
+
protected lazy<T>(key: string, loader: () => Promise<T>): Promise<T>;
|
|
503
|
+
/** Lazy compute a segment (sync) - computes only once, then cached */
|
|
504
|
+
protected cached<T>(key: string, compute: () => T): T;
|
|
505
|
+
/** Set a cached value directly (for local/generated data) */
|
|
506
|
+
protected set<T>(key: string, value: T): void;
|
|
507
|
+
/** Mark a segment as dirty (modified locally) */
|
|
508
|
+
protected markDirty(key: string): void;
|
|
509
|
+
/** Check if any segment (or specific segment) is dirty */
|
|
510
|
+
isDirty(segment?: string): boolean;
|
|
511
|
+
/** Clear cache for a segment (force reload on next access) */
|
|
512
|
+
protected invalidate(key: string): void;
|
|
513
|
+
/**
|
|
514
|
+
* Fetch a text resource from an ADT endpoint.
|
|
515
|
+
* Delegates to the underlying ADT client's fetch.
|
|
516
|
+
*
|
|
517
|
+
* @param url - ADT endpoint path (e.g., '/sap/bc/adt/ddic/dataelements/spras')
|
|
518
|
+
* @param headers - Optional HTTP headers (defaults to no Accept header, letting server choose)
|
|
519
|
+
* @returns Response content as text, or undefined if 404
|
|
520
|
+
*/
|
|
521
|
+
fetchText(url: string, headers?: Record<string, string>): Promise<string | undefined>;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Base class for main development objects (AdtMainObject)
|
|
525
|
+
*
|
|
526
|
+
* Extends AdkObject with package reference, responsible user, and master language.
|
|
527
|
+
* Used for repository objects like classes, interfaces, packages, etc.
|
|
528
|
+
*
|
|
529
|
+
* Note: Uses type assertions internally because schema-inferred types from
|
|
530
|
+
* contracts may have different shapes than AdkMainObjectData. The getters
|
|
531
|
+
* safely handle missing properties with defaults.
|
|
532
|
+
*
|
|
533
|
+
* @typeParam K - The object kind (from AdkKind)
|
|
534
|
+
* @typeParam D - The internal data type (typically schema-inferred from contract)
|
|
535
|
+
*/
|
|
536
|
+
declare abstract class AdkMainObject<K extends AdkKind = AdkKind, D = any> extends AdkObject<K, D> {
|
|
537
|
+
private get mainData();
|
|
538
|
+
/** Package reference (adtcore:packageRef) */
|
|
539
|
+
get packageRef(): AdtObjectReference | undefined;
|
|
540
|
+
/** Package name (convenience getter) */
|
|
541
|
+
get package(): string;
|
|
542
|
+
/** Master system (adtcore:masterSystem) */
|
|
543
|
+
get masterSystem(): string;
|
|
544
|
+
/** Master language (adtcore:masterLanguage) */
|
|
545
|
+
get masterLanguage(): string;
|
|
546
|
+
/** Responsible user (adtcore:responsible) */
|
|
547
|
+
get responsible(): string;
|
|
548
|
+
/** ABAP language version (adtcore:abapLanguageVersion) */
|
|
549
|
+
get abapLanguageVersion(): string;
|
|
550
|
+
/**
|
|
551
|
+
* Save main source code to SAP.
|
|
552
|
+
* Requires the object to be locked before calling.
|
|
553
|
+
* Subclasses may override to add additional behavior (e.g. cache invalidation).
|
|
554
|
+
*/
|
|
555
|
+
saveMainSource(source: string, options?: {
|
|
556
|
+
lockHandle?: string;
|
|
557
|
+
transport?: string;
|
|
558
|
+
}): Promise<void>;
|
|
559
|
+
}
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region src/objects/repository/clas/clas.types.d.ts
|
|
562
|
+
/**
|
|
563
|
+
* Class category (class:category attribute)
|
|
564
|
+
*/
|
|
565
|
+
type ClassCategory = 'generalObjectType' | 'exceptionClass' | 'testClass' | 'exitClass' | 'areaClass' | 'factoryClass' | 'persistentClass' | 'bspClass' | 'staticTypedLcpClass' | 'behaviorPool' | 'rfcProxyClass' | 'entityEventHandler' | 'communicationConnectionClass' | 'others';
|
|
566
|
+
/**
|
|
567
|
+
* Class include type (class:includeType attribute)
|
|
568
|
+
*/
|
|
569
|
+
type ClassIncludeType = 'main' | 'definitions' | 'implementations' | 'macros' | 'testclasses' | 'localtypes';
|
|
570
|
+
/**
|
|
571
|
+
* Class visibility (class:visibility attribute)
|
|
572
|
+
*/
|
|
573
|
+
type ClassVisibility = 'public' | 'protected' | 'private';
|
|
574
|
+
/**
|
|
575
|
+
* Class include section
|
|
576
|
+
*/
|
|
577
|
+
interface ClassInclude {
|
|
578
|
+
readonly includeType: ClassIncludeType;
|
|
579
|
+
readonly sourceUri: string;
|
|
580
|
+
readonly name: string;
|
|
581
|
+
readonly type: string;
|
|
582
|
+
readonly version: string;
|
|
583
|
+
readonly changedAt: Date;
|
|
584
|
+
readonly createdAt: Date;
|
|
585
|
+
readonly changedBy: string;
|
|
586
|
+
readonly createdBy: string;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* ABAP Class interface
|
|
590
|
+
*
|
|
591
|
+
* Plugins work with this interface - implementation is internal.
|
|
592
|
+
* Mirrors ADT class:abapClass structure.
|
|
593
|
+
*/
|
|
594
|
+
interface AbapClass extends AbapObject {
|
|
595
|
+
readonly kind: 'Class';
|
|
596
|
+
readonly responsible: string;
|
|
597
|
+
readonly masterLanguage: string;
|
|
598
|
+
readonly language: string;
|
|
599
|
+
readonly version: string;
|
|
600
|
+
readonly createdAt: Date;
|
|
601
|
+
readonly createdBy: string;
|
|
602
|
+
readonly changedAt: Date;
|
|
603
|
+
readonly changedBy: string;
|
|
604
|
+
readonly category: ClassCategory;
|
|
605
|
+
readonly final: boolean;
|
|
606
|
+
readonly abstract: boolean;
|
|
607
|
+
readonly visibility: ClassVisibility;
|
|
608
|
+
readonly sharedMemoryEnabled: boolean;
|
|
609
|
+
readonly modeled: boolean;
|
|
610
|
+
readonly fixPointArithmetic: boolean;
|
|
611
|
+
readonly activeUnicodeCheck: boolean;
|
|
612
|
+
readonly superClassRef?: AdtObjectReference;
|
|
613
|
+
readonly messageClassRef?: AdtObjectReference;
|
|
614
|
+
readonly packageRef?: AdtObjectReference;
|
|
615
|
+
readonly includes: ClassInclude[];
|
|
616
|
+
/**
|
|
617
|
+
* Get main source code (global definitions + implementations)
|
|
618
|
+
*/
|
|
619
|
+
getMainSource(): Promise<string>;
|
|
620
|
+
/**
|
|
621
|
+
* Get source code for a specific include
|
|
622
|
+
*/
|
|
623
|
+
getIncludeSource(includeType: ClassIncludeType): Promise<string>;
|
|
624
|
+
/**
|
|
625
|
+
* Get definitions include source
|
|
626
|
+
*/
|
|
627
|
+
getDefinitions(): Promise<string>;
|
|
628
|
+
/**
|
|
629
|
+
* Get implementations include source
|
|
630
|
+
*/
|
|
631
|
+
getImplementations(): Promise<string>;
|
|
632
|
+
/**
|
|
633
|
+
* Get test classes source
|
|
634
|
+
*/
|
|
635
|
+
getTestClasses(): Promise<string>;
|
|
636
|
+
}
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/objects/repository/clas/clas.model.d.ts
|
|
639
|
+
/**
|
|
640
|
+
* Class data type - imported from contract
|
|
641
|
+
*
|
|
642
|
+
* The schema wraps everything in an 'abapClass' element, so we unwrap it here
|
|
643
|
+
* to provide a flat structure for ADK consumers.
|
|
644
|
+
*/
|
|
645
|
+
type ClassXml = ClassResponse['abapClass'];
|
|
646
|
+
/**
|
|
647
|
+
* ADK Class object
|
|
648
|
+
*
|
|
649
|
+
* Inherits from AdkMainObject which provides:
|
|
650
|
+
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
651
|
+
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
652
|
+
*
|
|
653
|
+
* Access class-specific properties via `data`:
|
|
654
|
+
* - data.category, data.final, data.abstract, data.visibility
|
|
655
|
+
* - data.sharedMemoryEnabled, data.modeled, data.fixPointArithmetic
|
|
656
|
+
* - data.superClassRef, data.messageClassRef, data.include
|
|
657
|
+
*/
|
|
658
|
+
declare class AdkClass extends AdkMainObject<typeof Class, ClassXml> {
|
|
659
|
+
static readonly kind: "Class";
|
|
660
|
+
readonly kind: "Class";
|
|
661
|
+
get objectUri(): string;
|
|
662
|
+
getMainSource(): Promise<string>;
|
|
663
|
+
getIncludeSource(includeType: ClassIncludeType): Promise<string>;
|
|
664
|
+
getDefinitions(): Promise<string>;
|
|
665
|
+
getImplementations(): Promise<string>;
|
|
666
|
+
getTestClasses(): Promise<string>;
|
|
667
|
+
/**
|
|
668
|
+
* Save main source code
|
|
669
|
+
* Requires object to be locked first
|
|
670
|
+
*/
|
|
671
|
+
saveMainSource(source: string, options?: {
|
|
672
|
+
lockHandle?: string;
|
|
673
|
+
transport?: string;
|
|
674
|
+
}): Promise<void>;
|
|
675
|
+
/**
|
|
676
|
+
* Save include source code
|
|
677
|
+
* Requires object to be locked first
|
|
678
|
+
*/
|
|
679
|
+
saveIncludeSource(includeType: ClassIncludeType, source: string, options?: {
|
|
680
|
+
lockHandle?: string;
|
|
681
|
+
transport?: string;
|
|
682
|
+
}): Promise<void>;
|
|
683
|
+
/**
|
|
684
|
+
* Save all pending sources (set via _pendingSources)
|
|
685
|
+
* Used by export workflow after deserialization from abapGit
|
|
686
|
+
* Overrides base class method
|
|
687
|
+
*
|
|
688
|
+
* Note: unchanged detection is handled by checkPendingSourcesUnchanged()
|
|
689
|
+
* which runs BEFORE lock acquisition. By the time we reach here,
|
|
690
|
+
* at least one source differs — save them all.
|
|
691
|
+
*/
|
|
692
|
+
protected savePendingSources(options?: {
|
|
693
|
+
lockHandle?: string;
|
|
694
|
+
transport?: string;
|
|
695
|
+
}): Promise<void>;
|
|
696
|
+
/**
|
|
697
|
+
* Pre-lock comparison: check if all pending sources match SAP
|
|
698
|
+
* If identical, sets _unchanged = true so save() skips locking and PUT
|
|
699
|
+
*/
|
|
700
|
+
protected checkPendingSourcesUnchanged(): Promise<void>;
|
|
701
|
+
/**
|
|
702
|
+
* Check if object has pending sources to save
|
|
703
|
+
* Overrides base class method
|
|
704
|
+
*/
|
|
705
|
+
protected hasPendingSources(): boolean;
|
|
706
|
+
/**
|
|
707
|
+
* Refresh cached ETags for all pending source endpoints after locking.
|
|
708
|
+
* Classes have multiple source URLs (main + includes) that all need fresh ETags.
|
|
709
|
+
*/
|
|
710
|
+
protected refreshETagsAfterLock(): Promise<void>;
|
|
711
|
+
protected get wrapperKey(): string;
|
|
712
|
+
protected get crudContract(): any;
|
|
713
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkClass>;
|
|
714
|
+
/**
|
|
715
|
+
* Check if a class exists on SAP
|
|
716
|
+
*/
|
|
717
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
718
|
+
/**
|
|
719
|
+
* Create a new ABAP class on SAP
|
|
720
|
+
*
|
|
721
|
+
* @param name - Class name (e.g., 'ZCL_MY_CLASS')
|
|
722
|
+
* @param description - Short description
|
|
723
|
+
* @param packageName - Package to assign the class to
|
|
724
|
+
* @param options - Save options (transport)
|
|
725
|
+
* @param ctx - Optional ADK context
|
|
726
|
+
*/
|
|
727
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
728
|
+
transport?: string;
|
|
729
|
+
}, ctx?: AdkContext): Promise<AdkClass>;
|
|
730
|
+
/**
|
|
731
|
+
* Delete an ABAP class from SAP
|
|
732
|
+
*
|
|
733
|
+
* @param name - Class name
|
|
734
|
+
* @param options - Delete options (transport)
|
|
735
|
+
* @param ctx - Optional ADK context
|
|
736
|
+
*/
|
|
737
|
+
static delete(name: string, options?: {
|
|
738
|
+
transport?: string;
|
|
739
|
+
lockHandle?: string;
|
|
740
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
741
|
+
}
|
|
742
|
+
//#endregion
|
|
743
|
+
//#region src/objects/repository/intf/intf.model.d.ts
|
|
744
|
+
/**
|
|
745
|
+
* Interface data type - imported from contract
|
|
746
|
+
*
|
|
747
|
+
* The schema wraps everything in an 'abapInterface' element, so we unwrap it here
|
|
748
|
+
* to provide a flat structure for ADK consumers.
|
|
749
|
+
*/
|
|
750
|
+
type InterfaceXml = InterfaceResponse['abapInterface'];
|
|
751
|
+
/**
|
|
752
|
+
* ADK Interface object
|
|
753
|
+
*
|
|
754
|
+
* Inherits from AdkMainObject which provides:
|
|
755
|
+
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
756
|
+
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
757
|
+
*
|
|
758
|
+
* Access interface-specific properties via `data`:
|
|
759
|
+
* - data.modeled, data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck
|
|
760
|
+
*/
|
|
761
|
+
declare class AdkInterface extends AdkMainObject<typeof Interface, InterfaceXml> {
|
|
762
|
+
static readonly kind: "Interface";
|
|
763
|
+
readonly kind: "Interface";
|
|
764
|
+
get objectUri(): string;
|
|
765
|
+
getSource(): Promise<string>;
|
|
766
|
+
protected get wrapperKey(): string;
|
|
767
|
+
protected get crudContract(): any;
|
|
768
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkInterface>;
|
|
769
|
+
/**
|
|
770
|
+
* Check if an interface exists on SAP
|
|
771
|
+
*/
|
|
772
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
773
|
+
/**
|
|
774
|
+
* Create a new ABAP interface on SAP
|
|
775
|
+
*
|
|
776
|
+
* @param name - Interface name (e.g., 'ZIF_MY_INTERFACE')
|
|
777
|
+
* @param description - Short description
|
|
778
|
+
* @param packageName - Package to assign the interface to
|
|
779
|
+
* @param options - Save options (transport)
|
|
780
|
+
* @param ctx - Optional ADK context
|
|
781
|
+
*/
|
|
782
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
783
|
+
transport?: string;
|
|
784
|
+
}, ctx?: AdkContext): Promise<AdkInterface>;
|
|
785
|
+
/**
|
|
786
|
+
* Delete an ABAP interface from SAP
|
|
787
|
+
*
|
|
788
|
+
* @param name - Interface name
|
|
789
|
+
* @param options - Delete options (transport)
|
|
790
|
+
* @param ctx - Optional ADK context
|
|
791
|
+
*/
|
|
792
|
+
static delete(name: string, options?: {
|
|
793
|
+
transport?: string;
|
|
794
|
+
lockHandle?: string;
|
|
795
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
796
|
+
}
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/objects/repository/devc/devc.types.d.ts
|
|
799
|
+
/**
|
|
800
|
+
* Package type (pak:packageType attribute)
|
|
801
|
+
*/
|
|
802
|
+
type PackageType = 'development' | 'structure' | 'main';
|
|
803
|
+
/**
|
|
804
|
+
* Reference to another object (used for superPackage, etc.)
|
|
805
|
+
* Re-exported for backward compatibility
|
|
806
|
+
*/
|
|
807
|
+
type ObjectReference = AdtObjectReference;
|
|
808
|
+
/**
|
|
809
|
+
* Package attributes (pak:attributes element)
|
|
810
|
+
*/
|
|
811
|
+
interface PackageAttributes {
|
|
812
|
+
readonly packageType: PackageType;
|
|
813
|
+
readonly isEncapsulated: boolean;
|
|
814
|
+
readonly isAddingObjectsAllowed: boolean;
|
|
815
|
+
readonly recordChanges: boolean;
|
|
816
|
+
readonly languageVersion: string;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Application component info
|
|
820
|
+
*/
|
|
821
|
+
interface ApplicationComponent {
|
|
822
|
+
readonly name: string;
|
|
823
|
+
readonly description: string;
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Software component info
|
|
827
|
+
*/
|
|
828
|
+
interface SoftwareComponent {
|
|
829
|
+
readonly name: string;
|
|
830
|
+
readonly description: string;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Transport layer info
|
|
834
|
+
*/
|
|
835
|
+
interface TransportLayer {
|
|
836
|
+
readonly name: string;
|
|
837
|
+
readonly description: string;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Transport configuration
|
|
841
|
+
*/
|
|
842
|
+
interface TransportConfig {
|
|
843
|
+
readonly softwareComponent?: SoftwareComponent;
|
|
844
|
+
readonly transportLayer?: TransportLayer;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* ABAP Package interface
|
|
848
|
+
*
|
|
849
|
+
* Plugins work with this interface - implementation is internal.
|
|
850
|
+
* Mirrors ADT pak:package structure.
|
|
851
|
+
*/
|
|
852
|
+
interface AbapPackage extends AbapObject {
|
|
853
|
+
readonly kind: 'Package';
|
|
854
|
+
readonly responsible: string;
|
|
855
|
+
readonly masterLanguage: string;
|
|
856
|
+
readonly language: string;
|
|
857
|
+
readonly version: string;
|
|
858
|
+
readonly createdAt: Date;
|
|
859
|
+
readonly createdBy: string;
|
|
860
|
+
readonly changedAt: Date;
|
|
861
|
+
readonly changedBy: string;
|
|
862
|
+
readonly attributes: PackageAttributes;
|
|
863
|
+
readonly superPackage?: AdtObjectReference;
|
|
864
|
+
readonly applicationComponent?: ApplicationComponent;
|
|
865
|
+
readonly transport?: TransportConfig;
|
|
866
|
+
/**
|
|
867
|
+
* Get direct subpackages
|
|
868
|
+
*/
|
|
869
|
+
getSubpackages(): Promise<AbapPackage[]>;
|
|
870
|
+
/**
|
|
871
|
+
* Get objects contained in this package (direct, not recursive)
|
|
872
|
+
*/
|
|
873
|
+
getObjects(): Promise<AbapObject[]>;
|
|
874
|
+
/**
|
|
875
|
+
* Get all objects recursively (includes subpackages)
|
|
876
|
+
*/
|
|
877
|
+
getAllObjects(): Promise<AbapObject[]>;
|
|
878
|
+
}
|
|
879
|
+
//#endregion
|
|
880
|
+
//#region src/objects/repository/devc/devc.model.d.ts
|
|
881
|
+
/**
|
|
882
|
+
* Package data type - inferred from packagesContract response
|
|
883
|
+
*
|
|
884
|
+
* The schema wraps everything in a 'package' element, so we unwrap it here
|
|
885
|
+
* to provide a flat structure for ADK consumers.
|
|
886
|
+
*/
|
|
887
|
+
type PackageXml = NonNullable<PackageResponse['package']>;
|
|
888
|
+
/**
|
|
889
|
+
* ADK Package object
|
|
890
|
+
*
|
|
891
|
+
* Inherits from AdkMainObject which provides:
|
|
892
|
+
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
893
|
+
* - AdkMainObject: packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
894
|
+
*
|
|
895
|
+
* Note: For packages, the parent package is stored in `superPackage` not `packageRef`.
|
|
896
|
+
* The `package` getter is overridden to return the super package name.
|
|
897
|
+
*/
|
|
898
|
+
declare class AdkPackage extends AdkMainObject<typeof Package, PackageXml> implements AbapPackage {
|
|
899
|
+
static readonly kind: "Package";
|
|
900
|
+
readonly kind: "Package";
|
|
901
|
+
get objectUri(): string;
|
|
902
|
+
get package(): string;
|
|
903
|
+
get attributes(): PackageAttributes;
|
|
904
|
+
get superPackage(): ObjectReference | undefined;
|
|
905
|
+
get applicationComponent(): ApplicationComponent | undefined;
|
|
906
|
+
get transport(): TransportConfig | undefined;
|
|
907
|
+
getSubpackages(): Promise<AbapPackage[]>;
|
|
908
|
+
getObjects(): Promise<AbapObject[]>;
|
|
909
|
+
getAllObjects(): Promise<AbapObject[]>;
|
|
910
|
+
load(): Promise<this>;
|
|
911
|
+
protected get wrapperKey(): "package";
|
|
912
|
+
protected get crudContract(): any;
|
|
913
|
+
/**
|
|
914
|
+
* Get skeleton data for package creation (POST).
|
|
915
|
+
*
|
|
916
|
+
* SAP requires ALL elements in the Package xs:sequence, even if empty.
|
|
917
|
+
* The sequence order is: attributes, superPackage, extensionAlias, switch,
|
|
918
|
+
* applicationComponent, transport, translation, useAccesses,
|
|
919
|
+
* packageInterfaces, subPackages.
|
|
920
|
+
* Missing elements cause "System expected the element ..." 400 errors.
|
|
921
|
+
*/
|
|
922
|
+
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
923
|
+
/**
|
|
924
|
+
* Get a package by name
|
|
925
|
+
*
|
|
926
|
+
* @param name - Package name (e.g., '$TMP', 'ZPACKAGE')
|
|
927
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
928
|
+
*/
|
|
929
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkPackage>;
|
|
930
|
+
/**
|
|
931
|
+
* Check if a package exists on SAP
|
|
932
|
+
*
|
|
933
|
+
* @param name - Package name
|
|
934
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
935
|
+
* @returns true if package exists, false otherwise
|
|
936
|
+
*/
|
|
937
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
938
|
+
/**
|
|
939
|
+
* Create a new package on SAP
|
|
940
|
+
*
|
|
941
|
+
* Builds an AdkPackage with the given data and saves it in 'create' mode.
|
|
942
|
+
*
|
|
943
|
+
* @param name - Package name (e.g., 'ZABAPGIT_EXAMPLES_CLAS')
|
|
944
|
+
* @param data - Package data (superPackage, attributes, transport, etc.)
|
|
945
|
+
* @param options - Save options (transport request)
|
|
946
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
947
|
+
*/
|
|
948
|
+
static create(name: string, data: Partial<PackageXml>, options?: {
|
|
949
|
+
transport?: string;
|
|
950
|
+
}, ctx?: AdkContext): Promise<AdkPackage>;
|
|
951
|
+
/**
|
|
952
|
+
* Delete an ABAP package from SAP
|
|
953
|
+
*
|
|
954
|
+
* @param name - Package name
|
|
955
|
+
* @param options - Delete options (transport, lockHandle)
|
|
956
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
957
|
+
*/
|
|
958
|
+
static delete(name: string, options?: {
|
|
959
|
+
transport?: string;
|
|
960
|
+
lockHandle?: string;
|
|
961
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
962
|
+
}
|
|
963
|
+
//#endregion
|
|
964
|
+
//#region src/objects/repository/prog/prog.model.d.ts
|
|
965
|
+
/**
|
|
966
|
+
* Program data type - unwrap from root element
|
|
967
|
+
*
|
|
968
|
+
* The schema wraps everything in an 'abapProgram' element, so we unwrap it here
|
|
969
|
+
* to provide a flat structure for ADK consumers.
|
|
970
|
+
*/
|
|
971
|
+
type ProgramXml = ProgramResponse['abapProgram'];
|
|
972
|
+
/**
|
|
973
|
+
* ADK Program object
|
|
974
|
+
*
|
|
975
|
+
* Inherits from AdkMainObject which provides:
|
|
976
|
+
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
977
|
+
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
978
|
+
*
|
|
979
|
+
* Access program-specific properties via `data`:
|
|
980
|
+
* - data.programType, data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck
|
|
981
|
+
*/
|
|
982
|
+
declare class AdkProgram extends AdkMainObject<typeof Program, ProgramXml> {
|
|
983
|
+
static readonly kind: "Program";
|
|
984
|
+
readonly kind: "Program";
|
|
985
|
+
get objectUri(): string;
|
|
986
|
+
getSource(): Promise<string>;
|
|
987
|
+
protected get wrapperKey(): string;
|
|
988
|
+
protected get crudContract(): any;
|
|
989
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkProgram>;
|
|
990
|
+
/**
|
|
991
|
+
* Check if a program exists on SAP
|
|
992
|
+
*/
|
|
993
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
994
|
+
/**
|
|
995
|
+
* Create a new ABAP program on SAP
|
|
996
|
+
*
|
|
997
|
+
* @param name - Program name (e.g., 'ZMYPROGRAM')
|
|
998
|
+
* @param description - Short description
|
|
999
|
+
* @param packageName - Package to assign the program to
|
|
1000
|
+
* @param options - Save options (transport)
|
|
1001
|
+
* @param ctx - Optional ADK context
|
|
1002
|
+
*/
|
|
1003
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1004
|
+
transport?: string;
|
|
1005
|
+
}, ctx?: AdkContext): Promise<AdkProgram>;
|
|
1006
|
+
/**
|
|
1007
|
+
* Delete an ABAP program from SAP
|
|
1008
|
+
*
|
|
1009
|
+
* @param name - Program name
|
|
1010
|
+
* @param options - Delete options (transport)
|
|
1011
|
+
* @param ctx - Optional ADK context
|
|
1012
|
+
*/
|
|
1013
|
+
static delete(name: string, options?: {
|
|
1014
|
+
transport?: string;
|
|
1015
|
+
lockHandle?: string;
|
|
1016
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1017
|
+
}
|
|
1018
|
+
//#endregion
|
|
1019
|
+
//#region src/objects/repository/incl/incl.model.d.ts
|
|
1020
|
+
/**
|
|
1021
|
+
* Include data type - unwrap from root element.
|
|
1022
|
+
*
|
|
1023
|
+
* The schema wraps everything in an 'abapInclude' element, so we unwrap
|
|
1024
|
+
* it here to provide a flat structure for ADK consumers.
|
|
1025
|
+
*/
|
|
1026
|
+
type IncludeXml = IncludeResponse['abapInclude'];
|
|
1027
|
+
/**
|
|
1028
|
+
* ADK Include object
|
|
1029
|
+
*
|
|
1030
|
+
* Inherits from AdkMainObject which provides:
|
|
1031
|
+
* - AdkObject: name, type, description, version, language, changedBy/At,
|
|
1032
|
+
* createdBy/At, links
|
|
1033
|
+
* - AdkMainObject: package, packageRef, responsible, masterLanguage,
|
|
1034
|
+
* masterSystem, abapLanguageVersion
|
|
1035
|
+
*
|
|
1036
|
+
* Access include-specific properties via `data`:
|
|
1037
|
+
* - data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck,
|
|
1038
|
+
* data.contextRef (pointer to the main program)
|
|
1039
|
+
*/
|
|
1040
|
+
declare class AdkInclude extends AdkMainObject<typeof Include, IncludeXml> {
|
|
1041
|
+
static readonly kind: "Include";
|
|
1042
|
+
readonly kind: "Include";
|
|
1043
|
+
get objectUri(): string;
|
|
1044
|
+
getSource(): Promise<string>;
|
|
1045
|
+
protected get wrapperKey(): string;
|
|
1046
|
+
protected get crudContract(): any;
|
|
1047
|
+
/**
|
|
1048
|
+
* Skeleton POST data for includes.
|
|
1049
|
+
*
|
|
1050
|
+
* Extends the base skeleton (name/type/description/packageRef) with
|
|
1051
|
+
* `contextRef`, which sapcli's `sap.adt.Include(..., master=...)` serializes
|
|
1052
|
+
* at creation time. Without this the include would be created detached
|
|
1053
|
+
* from its main program.
|
|
1054
|
+
*/
|
|
1055
|
+
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
1056
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkInclude>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Check if an include exists on SAP
|
|
1059
|
+
*/
|
|
1060
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Create a new ABAP include on SAP
|
|
1063
|
+
*
|
|
1064
|
+
* @param name - Include name (e.g., 'ZMY_INCLUDE')
|
|
1065
|
+
* @param description - Short description
|
|
1066
|
+
* @param packageName - Package to assign the include to
|
|
1067
|
+
* @param options - Save options (transport, master program)
|
|
1068
|
+
* @param ctx - Optional ADK context
|
|
1069
|
+
*/
|
|
1070
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1071
|
+
transport?: string;
|
|
1072
|
+
master?: string;
|
|
1073
|
+
}, ctx?: AdkContext): Promise<AdkInclude>;
|
|
1074
|
+
/**
|
|
1075
|
+
* Delete an ABAP include from SAP
|
|
1076
|
+
*
|
|
1077
|
+
* @param name - Include name
|
|
1078
|
+
* @param options - Delete options (transport, lockHandle)
|
|
1079
|
+
* @param ctx - Optional ADK context
|
|
1080
|
+
*/
|
|
1081
|
+
static delete(name: string, options?: {
|
|
1082
|
+
transport?: string;
|
|
1083
|
+
lockHandle?: string;
|
|
1084
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1085
|
+
}
|
|
1086
|
+
//#endregion
|
|
1087
|
+
//#region src/objects/repository/fugr/fugr.model.d.ts
|
|
1088
|
+
/**
|
|
1089
|
+
* Function group data type - unwrap from root element
|
|
1090
|
+
*
|
|
1091
|
+
* The schema wraps everything in an 'abapFunctionGroup' element, so we unwrap it here
|
|
1092
|
+
* to provide a flat structure for ADK consumers.
|
|
1093
|
+
*/
|
|
1094
|
+
type FunctionGroupXml = FunctionGroupResponse['abapFunctionGroup'];
|
|
1095
|
+
/**
|
|
1096
|
+
* ADK Function Group object
|
|
1097
|
+
*
|
|
1098
|
+
* Inherits from AdkMainObject which provides:
|
|
1099
|
+
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
1100
|
+
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
1101
|
+
*
|
|
1102
|
+
* Access function group-specific properties via `data`:
|
|
1103
|
+
* - data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck
|
|
1104
|
+
*/
|
|
1105
|
+
declare class AdkFunctionGroup extends AdkMainObject<typeof FunctionGroup, FunctionGroupXml> {
|
|
1106
|
+
static readonly kind: "FunctionGroup";
|
|
1107
|
+
readonly kind: "FunctionGroup";
|
|
1108
|
+
get objectUri(): string;
|
|
1109
|
+
getSource(): Promise<string>;
|
|
1110
|
+
protected get wrapperKey(): string;
|
|
1111
|
+
protected get crudContract(): any;
|
|
1112
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkFunctionGroup>;
|
|
1113
|
+
/**
|
|
1114
|
+
* Check if a function group exists on SAP
|
|
1115
|
+
*/
|
|
1116
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1117
|
+
/**
|
|
1118
|
+
* Create a new ABAP function group on SAP
|
|
1119
|
+
*/
|
|
1120
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1121
|
+
transport?: string;
|
|
1122
|
+
}, ctx?: AdkContext): Promise<AdkFunctionGroup>;
|
|
1123
|
+
/**
|
|
1124
|
+
* Delete an ABAP function group from SAP
|
|
1125
|
+
*/
|
|
1126
|
+
static delete(name: string, options?: {
|
|
1127
|
+
transport?: string;
|
|
1128
|
+
lockHandle?: string;
|
|
1129
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1130
|
+
}
|
|
1131
|
+
//#endregion
|
|
1132
|
+
//#region src/objects/repository/fugr/func/func.model.d.ts
|
|
1133
|
+
/**
|
|
1134
|
+
* Function module data type - unwrap from root element
|
|
1135
|
+
*
|
|
1136
|
+
* The schema wraps everything in an 'abapFunctionModule' element, so we unwrap it here
|
|
1137
|
+
* to provide a flat structure for ADK consumers.
|
|
1138
|
+
*/
|
|
1139
|
+
type FunctionModuleXml = FunctionModuleResponse['abapFunctionModule'];
|
|
1140
|
+
/**
|
|
1141
|
+
* ADK Function Module object
|
|
1142
|
+
*
|
|
1143
|
+
* Function modules are child objects of function groups. Unlike main objects
|
|
1144
|
+
* (classes, interfaces, etc.), they don't have their own package reference.
|
|
1145
|
+
* All API operations require the parent group name in the URL path.
|
|
1146
|
+
*
|
|
1147
|
+
* Key differences from AdkMainObject:
|
|
1148
|
+
* - Requires `groupName` for URI construction and all CRUD operations
|
|
1149
|
+
* - Overrides lock/unlock/load/save to pass groupName to contract calls
|
|
1150
|
+
* - No packageRef (lives within parent function group's package)
|
|
1151
|
+
*/
|
|
1152
|
+
declare class AdkFunctionModule extends AdkObject<typeof FunctionModule, FunctionModuleXml> {
|
|
1153
|
+
static readonly kind: "FunctionModule";
|
|
1154
|
+
readonly kind: "FunctionModule";
|
|
1155
|
+
/** Parent function group name */
|
|
1156
|
+
groupName: string;
|
|
1157
|
+
/**
|
|
1158
|
+
* Constructor supports two calling patterns:
|
|
1159
|
+
*
|
|
1160
|
+
* 1. Direct (3-arg): `new AdkFunctionModule(ctx, groupName, nameOrData)`
|
|
1161
|
+
* Used by static factory method and when group name is known upfront.
|
|
1162
|
+
*
|
|
1163
|
+
* 2. Factory (2-arg): `new AdkFunctionModule(ctx, data)`
|
|
1164
|
+
* Used by ADK factory's `getWithData()`. The groupName is extracted from
|
|
1165
|
+
* `data._groupName` or `data.containerRef.name`.
|
|
1166
|
+
*/
|
|
1167
|
+
constructor(ctx: AdkContext, groupNameOrData: string | FunctionModuleXml, dataOrName?: FunctionModuleXml | string);
|
|
1168
|
+
get objectUri(): string;
|
|
1169
|
+
get collectionUri(): string;
|
|
1170
|
+
protected get wrapperKey(): string;
|
|
1171
|
+
protected get crudContract(): any;
|
|
1172
|
+
/**
|
|
1173
|
+
* Load function module data from SAP
|
|
1174
|
+
*
|
|
1175
|
+
* Overrides base to pass groupName as first arg to contract.get()
|
|
1176
|
+
*/
|
|
1177
|
+
load(): Promise<this>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Get skeleton data for FM creation (POST).
|
|
1180
|
+
*
|
|
1181
|
+
* FMs only need name, type, description, and processing attributes.
|
|
1182
|
+
* No packageRef — FMs inherit the package from their parent FUGR.
|
|
1183
|
+
*/
|
|
1184
|
+
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
1185
|
+
/**
|
|
1186
|
+
* Execute the typed contract call for save
|
|
1187
|
+
*
|
|
1188
|
+
* Overrides base to pass groupName to contract.put()/post()
|
|
1189
|
+
*/
|
|
1190
|
+
protected saveViaContract(mode: 'create' | 'update', options: {
|
|
1191
|
+
transport?: string;
|
|
1192
|
+
lockHandle?: string;
|
|
1193
|
+
}): Promise<void>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Check if the function module exists on the SAP system.
|
|
1196
|
+
*
|
|
1197
|
+
* Overrides base to pass groupName to contract.get()
|
|
1198
|
+
*/
|
|
1199
|
+
protected checkObjectExists(): Promise<boolean>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Refresh cached ETags after acquiring a lock.
|
|
1202
|
+
*
|
|
1203
|
+
* FM's savePendingSources() does a metadata PUT first (to apply processingType),
|
|
1204
|
+
* then a source PUT. Both need fresh ETags after locking.
|
|
1205
|
+
* The contract uses groupName + name (potentially UPPERCASE), so we must
|
|
1206
|
+
* refresh via the contract to match the same cache key.
|
|
1207
|
+
*/
|
|
1208
|
+
protected refreshETagsAfterLock(): Promise<void>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Strip the parameter comment block from FM source code.
|
|
1211
|
+
*
|
|
1212
|
+
* abapGit serializes FM source with a "Local Interface" comment block
|
|
1213
|
+
* that describes IMPORTING/EXPORTING/CHANGING/TABLES/EXCEPTIONS.
|
|
1214
|
+
* SAP ADT rejects this block when saving source — it manages the
|
|
1215
|
+
* interface metadata separately. Strip it before sending.
|
|
1216
|
+
*
|
|
1217
|
+
* Pattern:
|
|
1218
|
+
* ```
|
|
1219
|
+
* *"----------------------------------------------------------------------
|
|
1220
|
+
* *"*"Local Interface:
|
|
1221
|
+
* *" IMPORTING ...
|
|
1222
|
+
* *"----------------------------------------------------------------------
|
|
1223
|
+
* ```
|
|
1224
|
+
*/
|
|
1225
|
+
private stripParameterCommentBlock;
|
|
1226
|
+
/**
|
|
1227
|
+
* Save pending source for function module.
|
|
1228
|
+
*
|
|
1229
|
+
* Overrides base to:
|
|
1230
|
+
* 1. PUT metadata first (SAP ignores processingType and other attributes during POST)
|
|
1231
|
+
* 2. Refresh source ETag (metadata PUT changes the object version)
|
|
1232
|
+
* 3. Strip the parameter comment block that abapGit includes
|
|
1233
|
+
* 4. Use the FM-specific source endpoint via groupName
|
|
1234
|
+
*/
|
|
1235
|
+
protected savePendingSources(options?: {
|
|
1236
|
+
lockHandle?: string;
|
|
1237
|
+
transport?: string;
|
|
1238
|
+
}): Promise<void>;
|
|
1239
|
+
/**
|
|
1240
|
+
* Extract the body of a FUNCTION...ENDFUNCTION block.
|
|
1241
|
+
*
|
|
1242
|
+
* SAP reconstructs the FUNCTION header when returning source code:
|
|
1243
|
+
* Local: `FUNCTION zage_fm.` (lowercase, period inline)
|
|
1244
|
+
* SAP: `FUNCTION ZAGE_FM\n " template comment"\n.` (uppercase, period on own line)
|
|
1245
|
+
*
|
|
1246
|
+
* The body between the header and ENDFUNCTION is identical, so we compare
|
|
1247
|
+
* only that part. The header ends at the first period that terminates the
|
|
1248
|
+
* FUNCTION statement (either inline `FUNCTION name.` or on a separate line `.`).
|
|
1249
|
+
*/
|
|
1250
|
+
private extractFunctionBody;
|
|
1251
|
+
/**
|
|
1252
|
+
* Pre-lock comparison for FM source.
|
|
1253
|
+
*
|
|
1254
|
+
* Overrides base to:
|
|
1255
|
+
* 1. Strip parameter comment block from local source
|
|
1256
|
+
* 2. Extract only the function body (between FUNCTION header and ENDFUNCTION)
|
|
1257
|
+
* from both local and SAP source, because SAP reconstructs the FUNCTION
|
|
1258
|
+
* header with uppercase name and template comments.
|
|
1259
|
+
*/
|
|
1260
|
+
protected checkPendingSourcesUnchanged(): Promise<void>;
|
|
1261
|
+
getSource(): Promise<string>;
|
|
1262
|
+
/**
|
|
1263
|
+
* Get a function module by name
|
|
1264
|
+
*
|
|
1265
|
+
* @param groupName - Parent function group name
|
|
1266
|
+
* @param name - Function module name
|
|
1267
|
+
* @param ctx - Optional ADK context (uses global if not provided)
|
|
1268
|
+
*/
|
|
1269
|
+
static get(groupName: string, name: string, ctx?: AdkContext): Promise<AdkFunctionModule>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Check if a function module exists on SAP
|
|
1272
|
+
*/
|
|
1273
|
+
static exists(groupName: string, name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1274
|
+
/**
|
|
1275
|
+
* Create a new ABAP function module on SAP
|
|
1276
|
+
*/
|
|
1277
|
+
static create(groupName: string, name: string, description: string, options?: {
|
|
1278
|
+
transport?: string;
|
|
1279
|
+
processingType?: string;
|
|
1280
|
+
}, ctx?: AdkContext): Promise<AdkFunctionModule>;
|
|
1281
|
+
/**
|
|
1282
|
+
* Delete a function module from SAP
|
|
1283
|
+
*/
|
|
1284
|
+
static delete(groupName: string, name: string, options?: {
|
|
1285
|
+
transport?: string;
|
|
1286
|
+
lockHandle?: string;
|
|
1287
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1288
|
+
}
|
|
1289
|
+
//#endregion
|
|
1290
|
+
//#region src/objects/cts/transport/transport.types.d.ts
|
|
1291
|
+
/**
|
|
1292
|
+
* Full response type from TransportService.get()
|
|
1293
|
+
*
|
|
1294
|
+
* The schema wraps everything in a 'root' element, so we unwrap it here
|
|
1295
|
+
* to provide a flat structure for ADK consumers.
|
|
1296
|
+
*/
|
|
1297
|
+
type TransportData = TransportGetResponse['root'];
|
|
1298
|
+
/** Request data from schema */
|
|
1299
|
+
type TransportRequestData = NonNullable<TransportData['request']>;
|
|
1300
|
+
/** Task data from schema */
|
|
1301
|
+
type TransportTaskData = NonNullable<TransportRequestData['task']> extends (infer T)[] ? T : NonNullable<TransportRequestData['task']>;
|
|
1302
|
+
/** Object data from schema */
|
|
1303
|
+
type TransportObjectData = NonNullable<TransportTaskData['abap_object']> extends (infer T)[] ? T : NonNullable<TransportTaskData['abap_object']>;
|
|
1304
|
+
/** Transport status codes */
|
|
1305
|
+
type TransportStatus = 'D' | 'R' | 'N';
|
|
1306
|
+
/** Transport type */
|
|
1307
|
+
type TransportType = 'K' | 'W' | 'T' | 'C';
|
|
1308
|
+
type TransportTask = TransportTaskData;
|
|
1309
|
+
type TransportObject = TransportObjectData;
|
|
1310
|
+
/**
|
|
1311
|
+
* Options for creating a transport
|
|
1312
|
+
*/
|
|
1313
|
+
interface TransportCreateOptions {
|
|
1314
|
+
description: string;
|
|
1315
|
+
type?: TransportType;
|
|
1316
|
+
target?: string;
|
|
1317
|
+
project?: string;
|
|
1318
|
+
owner?: string;
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Options for updating a transport
|
|
1322
|
+
*/
|
|
1323
|
+
interface TransportUpdateOptions {
|
|
1324
|
+
description?: string;
|
|
1325
|
+
target?: string;
|
|
1326
|
+
owner?: string;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Result of release operation
|
|
1330
|
+
*/
|
|
1331
|
+
interface ReleaseResult {
|
|
1332
|
+
success: boolean;
|
|
1333
|
+
message?: string;
|
|
1334
|
+
}
|
|
1335
|
+
//#endregion
|
|
1336
|
+
//#region src/objects/cts/transport/transport-object.d.ts
|
|
1337
|
+
/**
|
|
1338
|
+
* Transport Object - wrapper for ABAP objects in a transport
|
|
1339
|
+
*/
|
|
1340
|
+
declare class AdkTransportObject {
|
|
1341
|
+
private readonly data;
|
|
1342
|
+
constructor(data: TransportObjectData);
|
|
1343
|
+
get pgmid(): string;
|
|
1344
|
+
get type(): string;
|
|
1345
|
+
get name(): string;
|
|
1346
|
+
get wbtype(): string | undefined;
|
|
1347
|
+
get objectInfo(): string | undefined;
|
|
1348
|
+
get objectDescription(): string | undefined;
|
|
1349
|
+
get lockStatus(): string | undefined;
|
|
1350
|
+
get uri(): string | undefined;
|
|
1351
|
+
/** Full object key (PGMID/TYPE/NAME) */
|
|
1352
|
+
get key(): string;
|
|
1353
|
+
/** Raw schema data */
|
|
1354
|
+
get raw(): TransportObjectData;
|
|
1355
|
+
}
|
|
1356
|
+
//#endregion
|
|
1357
|
+
//#region src/objects/cts/transport/transport.d.ts
|
|
1358
|
+
/** Clear config cache (for testing) */
|
|
1359
|
+
declare function clearConfigCache(): void;
|
|
1360
|
+
interface TransportObjectDataInternal {
|
|
1361
|
+
name: string;
|
|
1362
|
+
type: string;
|
|
1363
|
+
response: TransportData;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Transport Request - main transport object
|
|
1367
|
+
*
|
|
1368
|
+
* Handles both requests (K) and can be extended for tasks (T).
|
|
1369
|
+
* Uses ADT contracts directly - no intermediate service layer.
|
|
1370
|
+
*/
|
|
1371
|
+
declare class AdkTransportRequest extends AdkObject<typeof TransportRequest, TransportObjectDataInternal> {
|
|
1372
|
+
readonly kind: "TransportRequest";
|
|
1373
|
+
protected _tasks?: AdkTransportTask[];
|
|
1374
|
+
protected _objects?: AdkTransportObject[];
|
|
1375
|
+
constructor(ctx: AdkContext, dataOrNumber: TransportData | string);
|
|
1376
|
+
protected get response(): TransportData;
|
|
1377
|
+
/** The item's data - override in subclass for different source */
|
|
1378
|
+
protected get itemData(): TransportRequestData;
|
|
1379
|
+
get objectUri(): string;
|
|
1380
|
+
load(): Promise<this>;
|
|
1381
|
+
get itemType(): 'request' | 'task';
|
|
1382
|
+
get number(): string;
|
|
1383
|
+
get owner(): string;
|
|
1384
|
+
get description(): string;
|
|
1385
|
+
get status(): string;
|
|
1386
|
+
get statusText(): string;
|
|
1387
|
+
get target(): string;
|
|
1388
|
+
get targetDescription(): string;
|
|
1389
|
+
get uri(): string;
|
|
1390
|
+
get parent(): string;
|
|
1391
|
+
get lastChangedAt(): Date | undefined;
|
|
1392
|
+
/** Tasks belonging to this transport request */
|
|
1393
|
+
get tasks(): AdkTransportTask[];
|
|
1394
|
+
/**
|
|
1395
|
+
* All objects in this request (aggregated from tasks)
|
|
1396
|
+
* Override in AdkTransportTask for direct objects
|
|
1397
|
+
*/
|
|
1398
|
+
get objects(): AdkTransportObject[];
|
|
1399
|
+
release(): Promise<ReleaseResult>;
|
|
1400
|
+
releaseAll(): Promise<ReleaseResult>;
|
|
1401
|
+
update(changes: TransportUpdateOptions): Promise<void>;
|
|
1402
|
+
delete(): Promise<void>;
|
|
1403
|
+
/**
|
|
1404
|
+
* Reassign ownership of this transport (and optionally all tasks) to a new user.
|
|
1405
|
+
*
|
|
1406
|
+
* @param newOwner - SAP username to become the new owner
|
|
1407
|
+
* @param recursive - When true, also reassign all modifiable tasks
|
|
1408
|
+
*/
|
|
1409
|
+
reassign(newOwner: string, recursive?: boolean): Promise<void>;
|
|
1410
|
+
/**
|
|
1411
|
+
* Create a new transport request
|
|
1412
|
+
*
|
|
1413
|
+
* @param options - Transport creation options
|
|
1414
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
1415
|
+
*/
|
|
1416
|
+
static create(options: TransportCreateOptions, ctx?: AdkContext): Promise<AdkTransportRequest>;
|
|
1417
|
+
/**
|
|
1418
|
+
* Get a transport request by number
|
|
1419
|
+
*
|
|
1420
|
+
* @param number - Transport number (e.g., 'S0DK900001')
|
|
1421
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
1422
|
+
*/
|
|
1423
|
+
static get(number: string, ctx?: AdkContext): Promise<AdkTransportRequest>;
|
|
1424
|
+
/**
|
|
1425
|
+
* List all transports for the current user
|
|
1426
|
+
*
|
|
1427
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
1428
|
+
*/
|
|
1429
|
+
static list(ctx?: AdkContext): Promise<AdkTransportRequest[]>;
|
|
1430
|
+
/**
|
|
1431
|
+
* Get current user from the system metadata
|
|
1432
|
+
*
|
|
1433
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
1434
|
+
*/
|
|
1435
|
+
static getCurrentUser(ctx?: AdkContext): Promise<string>;
|
|
1436
|
+
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Transport Task - child of a transport request
|
|
1439
|
+
*
|
|
1440
|
+
* Minimal overrides:
|
|
1441
|
+
* - itemData: from response.task instead of response.request
|
|
1442
|
+
* - objects: direct from task, not aggregated
|
|
1443
|
+
* - request: parent reference
|
|
1444
|
+
* - No tasks, no CRUD
|
|
1445
|
+
*/
|
|
1446
|
+
declare class AdkTransportTask extends AdkTransportRequest {
|
|
1447
|
+
private _parentRequest?;
|
|
1448
|
+
private readonly parentRef?;
|
|
1449
|
+
constructor(ctx: AdkContext, dataOrNumber: TransportData | string, parentRef?: AdkTransportRequest);
|
|
1450
|
+
protected get itemData(): TransportRequestData;
|
|
1451
|
+
get tasks(): AdkTransportTask[];
|
|
1452
|
+
get objects(): AdkTransportObject[];
|
|
1453
|
+
/** Parent transport request */
|
|
1454
|
+
get request(): AdkTransportRequest;
|
|
1455
|
+
/**
|
|
1456
|
+
* Get a transport task by number
|
|
1457
|
+
*
|
|
1458
|
+
* @param number - Task number (e.g., 'S0DK900001')
|
|
1459
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
1460
|
+
*/
|
|
1461
|
+
static get(number: string, ctx?: AdkContext): Promise<AdkTransportTask>;
|
|
1462
|
+
}
|
|
1463
|
+
//#endregion
|
|
1464
|
+
//#region src/objects/ddic/doma/doma.model.d.ts
|
|
1465
|
+
/**
|
|
1466
|
+
* Domain data type - unwrap from schema root element
|
|
1467
|
+
*/
|
|
1468
|
+
type DomainXml = DomainResponse['domain'];
|
|
1469
|
+
/**
|
|
1470
|
+
* ADK Domain object
|
|
1471
|
+
*
|
|
1472
|
+
* Inherits from AdkMainObject which provides:
|
|
1473
|
+
* - name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
1474
|
+
* - package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
1475
|
+
*
|
|
1476
|
+
* Domain-specific properties via `data`:
|
|
1477
|
+
* - data.typeInformation (dataType, length, decimals, outputLength)
|
|
1478
|
+
* - data.outputInformation (conversionExit, signPresentation, lowerCase)
|
|
1479
|
+
* - data.fixedValues
|
|
1480
|
+
*/
|
|
1481
|
+
declare class AdkDomain extends AdkMainObject<typeof Domain, DomainXml> {
|
|
1482
|
+
static readonly kind: "Domain";
|
|
1483
|
+
readonly kind: "Domain";
|
|
1484
|
+
get objectUri(): string;
|
|
1485
|
+
protected get wrapperKey(): string;
|
|
1486
|
+
protected get crudContract(): any;
|
|
1487
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkDomain>;
|
|
1488
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1489
|
+
/**
|
|
1490
|
+
* Create a new ABAP domain on SAP.
|
|
1491
|
+
*
|
|
1492
|
+
* Note: Domains are metadata-only objects (no source code). After creation,
|
|
1493
|
+
* use the `adt get domain <name>` command or abapGit-based deploy to fill in
|
|
1494
|
+
* the domain properties (data type, field length, etc.).
|
|
1495
|
+
*/
|
|
1496
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1497
|
+
transport?: string;
|
|
1498
|
+
}, ctx?: AdkContext): Promise<AdkDomain>;
|
|
1499
|
+
static delete(name: string, options?: {
|
|
1500
|
+
transport?: string;
|
|
1501
|
+
lockHandle?: string;
|
|
1502
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1503
|
+
}
|
|
1504
|
+
//#endregion
|
|
1505
|
+
//#region src/objects/ddic/dtel/dtel.model.d.ts
|
|
1506
|
+
/**
|
|
1507
|
+
* Data Element data type - unwrap from wrapper root element
|
|
1508
|
+
* SAP wraps DTEL content in a blue:wbobj element extending AdtMainObject
|
|
1509
|
+
*/
|
|
1510
|
+
type DataElementXml = DataElementResponse['wbobj'];
|
|
1511
|
+
/**
|
|
1512
|
+
* ADK Data Element object
|
|
1513
|
+
*
|
|
1514
|
+
* Inherits from AdkMainObject which provides:
|
|
1515
|
+
* - name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
1516
|
+
* - package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
1517
|
+
*
|
|
1518
|
+
* Data element-specific properties via `data`:
|
|
1519
|
+
* - data.typeKind, data.typeName, data.dataType
|
|
1520
|
+
* - data.shortDescription, data.mediumDescription, data.longDescription, data.headingDescription
|
|
1521
|
+
* - data.searchHelp
|
|
1522
|
+
*/
|
|
1523
|
+
declare class AdkDataElement extends AdkMainObject<typeof DataElement, DataElementXml> {
|
|
1524
|
+
static readonly kind: "DataElement";
|
|
1525
|
+
readonly kind: "DataElement";
|
|
1526
|
+
get objectUri(): string;
|
|
1527
|
+
protected get wrapperKey(): string;
|
|
1528
|
+
protected get crudContract(): any;
|
|
1529
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkDataElement>;
|
|
1530
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1531
|
+
/**
|
|
1532
|
+
* Create a new ABAP data element on SAP.
|
|
1533
|
+
*/
|
|
1534
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1535
|
+
transport?: string;
|
|
1536
|
+
}, ctx?: AdkContext): Promise<AdkDataElement>;
|
|
1537
|
+
static delete(name: string, options?: {
|
|
1538
|
+
transport?: string;
|
|
1539
|
+
lockHandle?: string;
|
|
1540
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1541
|
+
}
|
|
1542
|
+
//#endregion
|
|
1543
|
+
//#region src/objects/ddic/tabl/tabl.model.d.ts
|
|
1544
|
+
/**
|
|
1545
|
+
* Table/Structure data type - unwrap from blueSource wrapper root element
|
|
1546
|
+
*/
|
|
1547
|
+
type TableXml = TableResponse['blueSource'];
|
|
1548
|
+
/**
|
|
1549
|
+
* ADK Table object (database table - TABL/DT)
|
|
1550
|
+
*/
|
|
1551
|
+
declare class AdkTable extends AdkMainObject<typeof Table, TableXml> {
|
|
1552
|
+
static readonly kind: "Table";
|
|
1553
|
+
readonly kind: "Table";
|
|
1554
|
+
get objectUri(): string;
|
|
1555
|
+
/**
|
|
1556
|
+
* Get CDS-style table source code from SAP
|
|
1557
|
+
* Returns the ABAP source definition (annotations + field definitions)
|
|
1558
|
+
*/
|
|
1559
|
+
getSource(): Promise<string>;
|
|
1560
|
+
/**
|
|
1561
|
+
* Get table technical settings (DD09L data)
|
|
1562
|
+
* Returns XML from /sap/bc/adt/ddic/db/settings/{name}
|
|
1563
|
+
*/
|
|
1564
|
+
getSettings(): Promise<string>;
|
|
1565
|
+
protected get wrapperKey(): string;
|
|
1566
|
+
protected get crudContract(): any;
|
|
1567
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkTable>;
|
|
1568
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1569
|
+
/**
|
|
1570
|
+
* Create a new ABAP database table on SAP.
|
|
1571
|
+
*/
|
|
1572
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1573
|
+
transport?: string;
|
|
1574
|
+
}, ctx?: AdkContext): Promise<AdkTable>;
|
|
1575
|
+
static delete(name: string, options?: {
|
|
1576
|
+
transport?: string;
|
|
1577
|
+
lockHandle?: string;
|
|
1578
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1579
|
+
}
|
|
1580
|
+
/**
|
|
1581
|
+
* ADK Structure object (TABL/DS)
|
|
1582
|
+
*/
|
|
1583
|
+
declare class AdkStructure extends AdkMainObject<typeof Structure, TableXml> {
|
|
1584
|
+
static readonly kind: "Structure";
|
|
1585
|
+
readonly kind: "Structure";
|
|
1586
|
+
get objectUri(): string;
|
|
1587
|
+
/**
|
|
1588
|
+
* Get CDS-style structure source code from SAP
|
|
1589
|
+
* Returns the ABAP source definition (annotations + field definitions)
|
|
1590
|
+
*/
|
|
1591
|
+
getSource(): Promise<string>;
|
|
1592
|
+
protected get wrapperKey(): string;
|
|
1593
|
+
protected get crudContract(): any;
|
|
1594
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkStructure>;
|
|
1595
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Create a new ABAP structure on SAP.
|
|
1598
|
+
*/
|
|
1599
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1600
|
+
transport?: string;
|
|
1601
|
+
}, ctx?: AdkContext): Promise<AdkStructure>;
|
|
1602
|
+
static delete(name: string, options?: {
|
|
1603
|
+
transport?: string;
|
|
1604
|
+
lockHandle?: string;
|
|
1605
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1606
|
+
}
|
|
1607
|
+
//#endregion
|
|
1608
|
+
//#region src/objects/ddic/ttyp/ttyp.model.d.ts
|
|
1609
|
+
/**
|
|
1610
|
+
* Table Type data type - unwrap from schema root element
|
|
1611
|
+
*/
|
|
1612
|
+
type TableTypeXml = TableTypeResponse['tableType'];
|
|
1613
|
+
/**
|
|
1614
|
+
* ADK Table Type object
|
|
1615
|
+
*
|
|
1616
|
+
* Inherits from AdkMainObject which provides:
|
|
1617
|
+
* - name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
1618
|
+
* - package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
1619
|
+
*
|
|
1620
|
+
* Table type-specific properties via `data`:
|
|
1621
|
+
* - data.rowType (typeName, typeCategory, tableTypeSchemaReference)
|
|
1622
|
+
* - data.primaryKey
|
|
1623
|
+
* - data.secondaryKeys
|
|
1624
|
+
*/
|
|
1625
|
+
declare class AdkTableType extends AdkMainObject<typeof TableType, TableTypeXml> {
|
|
1626
|
+
static readonly kind: "TableType";
|
|
1627
|
+
readonly kind: "TableType";
|
|
1628
|
+
get objectUri(): string;
|
|
1629
|
+
protected get wrapperKey(): string;
|
|
1630
|
+
protected get crudContract(): any;
|
|
1631
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkTableType>;
|
|
1632
|
+
}
|
|
1633
|
+
//#endregion
|
|
1634
|
+
//#region src/base/kinds.d.ts
|
|
1635
|
+
/**
|
|
1636
|
+
* ADK Object Kinds
|
|
1637
|
+
*
|
|
1638
|
+
* Central registry of all ADK object types.
|
|
1639
|
+
* Import specific kinds for type-safe usage:
|
|
1640
|
+
*
|
|
1641
|
+
* @example
|
|
1642
|
+
* import { TransportRequest } from '../base/kinds';
|
|
1643
|
+
* class AdkTransportRequest extends AdkObject<typeof TransportRequest> { ... }
|
|
1644
|
+
*/
|
|
1645
|
+
declare const TransportRequest: "TransportRequest";
|
|
1646
|
+
declare const TransportTask$1: "TransportTask";
|
|
1647
|
+
declare const Package: "Package";
|
|
1648
|
+
declare const Class: "Class";
|
|
1649
|
+
declare const Interface: "Interface";
|
|
1650
|
+
declare const FunctionGroup: "FunctionGroup";
|
|
1651
|
+
declare const FunctionModule: "FunctionModule";
|
|
1652
|
+
declare const Program: "Program";
|
|
1653
|
+
declare const Include: "Include";
|
|
1654
|
+
declare const Table: "Table";
|
|
1655
|
+
declare const Structure: "Structure";
|
|
1656
|
+
declare const DataElement: "DataElement";
|
|
1657
|
+
declare const Domain: "Domain";
|
|
1658
|
+
declare const TableType: "TableType";
|
|
1659
|
+
declare const MessageClass: "MessageClass";
|
|
1660
|
+
declare const EnhancementSpot: "EnhancementSpot";
|
|
1661
|
+
/** Union type of all ADK kinds */
|
|
1662
|
+
type AdkKind = typeof TransportRequest | typeof TransportTask$1 | typeof Package | typeof Class | typeof Interface | typeof FunctionGroup | typeof FunctionModule | typeof Program | typeof Include | typeof Table | typeof Structure | typeof DataElement | typeof Domain | typeof TableType | typeof MessageClass | typeof EnhancementSpot;
|
|
1663
|
+
/**
|
|
1664
|
+
* Maps ADK kind to concrete object type
|
|
1665
|
+
*
|
|
1666
|
+
* Enables type-safe factory methods:
|
|
1667
|
+
* ```ts
|
|
1668
|
+
* const cls = factory.byKind(Class, 'ZCL_TEST'); // → AdkClass
|
|
1669
|
+
* const intf = factory.byKind(Interface, 'ZIF'); // → AdkInterface
|
|
1670
|
+
* ```
|
|
1671
|
+
*/
|
|
1672
|
+
type AdkObjectForKind<K extends AdkKind> = K extends typeof Class ? AdkClass : K extends typeof Interface ? AdkInterface : K extends typeof Package ? AdkPackage : K extends typeof Program ? AdkProgram : K extends typeof Include ? AdkInclude : K extends typeof FunctionGroup ? AdkFunctionGroup : K extends typeof FunctionModule ? AdkFunctionModule : K extends typeof TransportRequest ? AdkTransportRequest : K extends typeof TransportTask$1 ? AdkTransportTask : K extends typeof Domain ? AdkDomain : K extends typeof DataElement ? AdkDataElement : K extends typeof Table ? AdkTable : K extends typeof Structure ? AdkStructure : K extends typeof TableType ? AdkTableType : AdkObject;
|
|
1673
|
+
//#endregion
|
|
1674
|
+
//#region src/base/types.d.ts
|
|
1675
|
+
/**
|
|
1676
|
+
* Base interface for all ABAP objects
|
|
1677
|
+
*/
|
|
1678
|
+
interface AbapObject {
|
|
1679
|
+
readonly kind: AdkKind | string;
|
|
1680
|
+
readonly name: string;
|
|
1681
|
+
readonly package: string;
|
|
1682
|
+
readonly description: string;
|
|
1683
|
+
/**
|
|
1684
|
+
* ADT object type (e.g., 'DEVC/K', 'CLAS/OC')
|
|
1685
|
+
*/
|
|
1686
|
+
readonly type: string;
|
|
1687
|
+
}
|
|
1688
|
+
//#endregion
|
|
1689
|
+
//#region src/base/object-set.d.ts
|
|
1690
|
+
/**
|
|
1691
|
+
* Result of bulk save operation
|
|
1692
|
+
*/
|
|
1693
|
+
interface BulkSaveResult {
|
|
1694
|
+
/** Number of successfully saved objects */
|
|
1695
|
+
success: number;
|
|
1696
|
+
/** Number of objects that failed to save */
|
|
1697
|
+
failed: number;
|
|
1698
|
+
/** Number of unchanged objects (skipped) */
|
|
1699
|
+
unchanged: number;
|
|
1700
|
+
/** Details per object */
|
|
1701
|
+
results: Array<{
|
|
1702
|
+
object: AdkObject;
|
|
1703
|
+
success: boolean; /** True if object was skipped because source is identical to SAP */
|
|
1704
|
+
unchanged?: boolean;
|
|
1705
|
+
error?: string;
|
|
1706
|
+
}>;
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* Options for bulk save operation
|
|
1710
|
+
*/
|
|
1711
|
+
interface BulkSaveOptions extends SaveOptions {
|
|
1712
|
+
/** Continue saving remaining objects if one fails (default: true) */
|
|
1713
|
+
continueOnError?: boolean;
|
|
1714
|
+
/** Callback for progress reporting */
|
|
1715
|
+
onProgress?: (processed: number, total: number, current: AdkObject) => void;
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* Options for bulk activation
|
|
1719
|
+
*/
|
|
1720
|
+
interface BulkActivateOptions {
|
|
1721
|
+
/** Callback for progress reporting */
|
|
1722
|
+
onProgress?: (message: string) => void;
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
* ADK Object Set - Collection of objects with bulk operations
|
|
1726
|
+
*
|
|
1727
|
+
* A semantic layer for managing collections of ADK objects and
|
|
1728
|
+
* performing bulk operations like save and activate.
|
|
1729
|
+
*/
|
|
1730
|
+
declare class AdkObjectSet {
|
|
1731
|
+
private readonly ctx;
|
|
1732
|
+
private readonly objects;
|
|
1733
|
+
constructor(ctx: AdkContext);
|
|
1734
|
+
/**
|
|
1735
|
+
* Add a single object to the set
|
|
1736
|
+
*
|
|
1737
|
+
* Propagates the set's context (lockService, lockStore) to the object
|
|
1738
|
+
* so that objects created by plugins with a bare { client } context
|
|
1739
|
+
* inherit the services configured on the set.
|
|
1740
|
+
*/
|
|
1741
|
+
add(object: AdkObject): this;
|
|
1742
|
+
/**
|
|
1743
|
+
* Add multiple objects to the set
|
|
1744
|
+
*/
|
|
1745
|
+
addAll(objects: AdkObject[]): this;
|
|
1746
|
+
/**
|
|
1747
|
+
* Remove an object from the set
|
|
1748
|
+
*/
|
|
1749
|
+
remove(object: AdkObject): this;
|
|
1750
|
+
/**
|
|
1751
|
+
* Clear all objects from the set
|
|
1752
|
+
*/
|
|
1753
|
+
clear(): this;
|
|
1754
|
+
/**
|
|
1755
|
+
* Get all objects in the set
|
|
1756
|
+
*/
|
|
1757
|
+
getAll(): AdkObject[];
|
|
1758
|
+
/**
|
|
1759
|
+
* Get number of objects in the set
|
|
1760
|
+
*/
|
|
1761
|
+
get size(): number;
|
|
1762
|
+
/**
|
|
1763
|
+
* Check if set is empty
|
|
1764
|
+
*/
|
|
1765
|
+
get isEmpty(): boolean;
|
|
1766
|
+
/**
|
|
1767
|
+
* Filter objects by type
|
|
1768
|
+
*/
|
|
1769
|
+
filterByType(type: string): AdkObject[];
|
|
1770
|
+
/**
|
|
1771
|
+
* Filter objects by kind
|
|
1772
|
+
*/
|
|
1773
|
+
filterByKind(kind: string): AdkObject[];
|
|
1774
|
+
/**
|
|
1775
|
+
* Iterate over objects
|
|
1776
|
+
*/
|
|
1777
|
+
[Symbol.iterator](): Iterator<AdkObject>;
|
|
1778
|
+
/**
|
|
1779
|
+
* Save all objects in the set
|
|
1780
|
+
*
|
|
1781
|
+
* Saves each object individually, handling lock/unlock per object.
|
|
1782
|
+
* By default continues on error to save as many objects as possible.
|
|
1783
|
+
*
|
|
1784
|
+
* @param options - Save options (transport, inactive, continueOnError)
|
|
1785
|
+
* @returns Result with success/failure counts and details
|
|
1786
|
+
*/
|
|
1787
|
+
saveAll(options?: BulkSaveOptions): Promise<BulkSaveResult>;
|
|
1788
|
+
/**
|
|
1789
|
+
* Activate all objects in the set (bulk activation)
|
|
1790
|
+
*
|
|
1791
|
+
* Uses SAP's bulk activation endpoint for efficiency.
|
|
1792
|
+
* All objects are activated in a single request.
|
|
1793
|
+
*
|
|
1794
|
+
* @param options - Activation options
|
|
1795
|
+
* @returns Activation result with success/failure counts
|
|
1796
|
+
*/
|
|
1797
|
+
activateAll(options?: BulkActivateOptions): Promise<ActivationResult>;
|
|
1798
|
+
/**
|
|
1799
|
+
* Save all objects as inactive, then bulk activate, then unlock
|
|
1800
|
+
*
|
|
1801
|
+
* This is the recommended pattern for deploying multiple objects:
|
|
1802
|
+
* 1. Save all objects as inactive (handles dependencies)
|
|
1803
|
+
* 2. Bulk activate all saved objects
|
|
1804
|
+
* 3. Unlock all objects
|
|
1805
|
+
*
|
|
1806
|
+
* @param options - Save options (transport required)
|
|
1807
|
+
* @returns Combined result of save and activation
|
|
1808
|
+
*/
|
|
1809
|
+
deploy(options: BulkSaveOptions & {
|
|
1810
|
+
activate?: boolean;
|
|
1811
|
+
}): Promise<{
|
|
1812
|
+
save: BulkSaveResult;
|
|
1813
|
+
activation?: ActivationResult;
|
|
1814
|
+
}>;
|
|
1815
|
+
/**
|
|
1816
|
+
* Lock all objects in the set
|
|
1817
|
+
*
|
|
1818
|
+
* @returns Array of lock handles
|
|
1819
|
+
*/
|
|
1820
|
+
lockAll(): Promise<LockHandle[]>;
|
|
1821
|
+
/**
|
|
1822
|
+
* Unlock all objects in the set
|
|
1823
|
+
*/
|
|
1824
|
+
unlockAll(): Promise<void>;
|
|
1825
|
+
/**
|
|
1826
|
+
* Load all objects (fetch data from SAP)
|
|
1827
|
+
*
|
|
1828
|
+
* @param options - Load options
|
|
1829
|
+
* @returns This set (for chaining)
|
|
1830
|
+
*/
|
|
1831
|
+
loadAll(options?: {
|
|
1832
|
+
parallel?: boolean;
|
|
1833
|
+
}): Promise<this>;
|
|
1834
|
+
/**
|
|
1835
|
+
* Create an object set from an array of objects
|
|
1836
|
+
*/
|
|
1837
|
+
static from(objects: AdkObject[], ctx: AdkContext): AdkObjectSet;
|
|
1838
|
+
/**
|
|
1839
|
+
* Create an object set by collecting from an async generator
|
|
1840
|
+
*
|
|
1841
|
+
* Collects all objects yielded by the generator into the set.
|
|
1842
|
+
* Useful for collecting objects from format plugin export generators.
|
|
1843
|
+
*
|
|
1844
|
+
* @param generator - Async generator yielding AdkObject instances
|
|
1845
|
+
* @param ctx - ADK context for the set
|
|
1846
|
+
* @param options - Collection options
|
|
1847
|
+
* @returns Promise resolving to populated AdkObjectSet
|
|
1848
|
+
*/
|
|
1849
|
+
static fromGenerator(generator: AsyncGenerator<AdkObject>, ctx: AdkContext, options?: {
|
|
1850
|
+
/** Filter function to include/exclude objects */filter?: (obj: AdkObject) => boolean; /** Callback for each object collected */
|
|
1851
|
+
onObject?: (obj: AdkObject) => void;
|
|
1852
|
+
}): Promise<AdkObjectSet>;
|
|
1853
|
+
}
|
|
1854
|
+
//#endregion
|
|
1855
|
+
//#region src/base/global-context.d.ts
|
|
1856
|
+
/**
|
|
1857
|
+
* Initialize the global ADK context from an ADT client.
|
|
1858
|
+
*
|
|
1859
|
+
* Call this once during application bootstrap (e.g., in CLI initialization).
|
|
1860
|
+
* After initialization, ADK objects can be used without passing context.
|
|
1861
|
+
*
|
|
1862
|
+
* @param client - ADT client v2 instance
|
|
1863
|
+
* @throws Error if client is not provided
|
|
1864
|
+
*
|
|
1865
|
+
* @example
|
|
1866
|
+
* ```ts
|
|
1867
|
+
* import { initializeAdk } from '@abapify/adk';
|
|
1868
|
+
* import { createAdtClient } from '@abapify/adt-client';
|
|
1869
|
+
*
|
|
1870
|
+
* const client = createAdtClient({ ... });
|
|
1871
|
+
* initializeAdk(client);
|
|
1872
|
+
*
|
|
1873
|
+
* // Now ADK objects work without context
|
|
1874
|
+
* const transport = await AdkTransportRequest.get('S0DK900001');
|
|
1875
|
+
* ```
|
|
1876
|
+
*/
|
|
1877
|
+
declare function initializeAdk(client: AdtClient, options?: {
|
|
1878
|
+
lockStore?: LockStore$1;
|
|
1879
|
+
lockService?: LockService$1;
|
|
1880
|
+
}): void;
|
|
1881
|
+
/**
|
|
1882
|
+
* Get the global ADK context.
|
|
1883
|
+
*
|
|
1884
|
+
* Used internally by ADK objects when no explicit context is provided.
|
|
1885
|
+
*
|
|
1886
|
+
* @returns The global ADK context
|
|
1887
|
+
* @throws Error if ADK has not been initialized
|
|
1888
|
+
*
|
|
1889
|
+
* @example
|
|
1890
|
+
* ```ts
|
|
1891
|
+
* // Internal usage in ADK objects:
|
|
1892
|
+
* static async get(number: string, ctx?: AdkContext): Promise<AdkTransportRequest> {
|
|
1893
|
+
* const context = ctx ?? getGlobalContext();
|
|
1894
|
+
* // ...
|
|
1895
|
+
* }
|
|
1896
|
+
* ```
|
|
1897
|
+
*/
|
|
1898
|
+
declare function getGlobalContext(): AdkContext;
|
|
1899
|
+
/**
|
|
1900
|
+
* Check if ADK has been initialized.
|
|
1901
|
+
*
|
|
1902
|
+
* Useful for conditional logic or error handling.
|
|
1903
|
+
*
|
|
1904
|
+
* @returns true if initializeAdk() has been called
|
|
1905
|
+
*/
|
|
1906
|
+
declare function isAdkInitialized(): boolean;
|
|
1907
|
+
/**
|
|
1908
|
+
* Reset the global ADK context.
|
|
1909
|
+
*
|
|
1910
|
+
* Primarily for testing purposes. Clears the global context.
|
|
1911
|
+
*/
|
|
1912
|
+
declare function resetAdk(): void;
|
|
1913
|
+
/**
|
|
1914
|
+
* Get the global context or return undefined if not initialized.
|
|
1915
|
+
*
|
|
1916
|
+
* Unlike getGlobalContext(), this doesn't throw - useful when you want
|
|
1917
|
+
* to check if context exists before using it.
|
|
1918
|
+
*
|
|
1919
|
+
* @returns The global context or undefined
|
|
1920
|
+
*/
|
|
1921
|
+
declare function tryGetGlobalContext(): AdkContext | undefined;
|
|
1922
|
+
//#endregion
|
|
1923
|
+
//#region src/objects/repository/intf/intf.types.d.ts
|
|
1924
|
+
/**
|
|
1925
|
+
* ABAP Interface interface
|
|
1926
|
+
*
|
|
1927
|
+
* Plugins work with this interface - implementation is internal.
|
|
1928
|
+
* Mirrors ADT intf:abapInterface structure.
|
|
1929
|
+
*/
|
|
1930
|
+
interface AbapInterface extends AbapObject {
|
|
1931
|
+
readonly kind: 'Interface';
|
|
1932
|
+
readonly responsible: string;
|
|
1933
|
+
readonly masterLanguage: string;
|
|
1934
|
+
readonly language: string;
|
|
1935
|
+
readonly version: string;
|
|
1936
|
+
readonly createdAt: Date;
|
|
1937
|
+
readonly createdBy: string;
|
|
1938
|
+
readonly changedAt: Date;
|
|
1939
|
+
readonly changedBy: string;
|
|
1940
|
+
readonly modeled: boolean;
|
|
1941
|
+
readonly sourceUri: string;
|
|
1942
|
+
readonly fixPointArithmetic: boolean;
|
|
1943
|
+
readonly activeUnicodeCheck: boolean;
|
|
1944
|
+
readonly packageRef?: AdtObjectReference;
|
|
1945
|
+
/**
|
|
1946
|
+
* Get interface source code
|
|
1947
|
+
*/
|
|
1948
|
+
getSource(): Promise<string>;
|
|
1949
|
+
}
|
|
1950
|
+
//#endregion
|
|
1951
|
+
//#region src/objects/repository/prog/prog.types.d.ts
|
|
1952
|
+
/**
|
|
1953
|
+
* ABAP Program interface
|
|
1954
|
+
*
|
|
1955
|
+
* Plugins work with this interface - implementation is internal.
|
|
1956
|
+
* Mirrors ADT prog:abapProgram structure.
|
|
1957
|
+
*/
|
|
1958
|
+
interface AbapProgram extends AbapObject {
|
|
1959
|
+
readonly kind: 'Program';
|
|
1960
|
+
readonly responsible: string;
|
|
1961
|
+
readonly masterLanguage: string;
|
|
1962
|
+
readonly language: string;
|
|
1963
|
+
readonly version: string;
|
|
1964
|
+
readonly createdAt: Date;
|
|
1965
|
+
readonly createdBy: string;
|
|
1966
|
+
readonly changedAt: Date;
|
|
1967
|
+
readonly changedBy: string;
|
|
1968
|
+
readonly sourceUri: string;
|
|
1969
|
+
readonly fixPointArithmetic: boolean;
|
|
1970
|
+
readonly activeUnicodeCheck: boolean;
|
|
1971
|
+
readonly programType?: string;
|
|
1972
|
+
readonly packageRef?: AdtObjectReference;
|
|
1973
|
+
/**
|
|
1974
|
+
* Get program source code
|
|
1975
|
+
*/
|
|
1976
|
+
getSource(): Promise<string>;
|
|
1977
|
+
}
|
|
1978
|
+
//#endregion
|
|
1979
|
+
//#region src/objects/repository/incl/incl.types.d.ts
|
|
1980
|
+
/**
|
|
1981
|
+
* ABAP Include interface
|
|
1982
|
+
*
|
|
1983
|
+
* Plugins work with this interface - implementation is internal.
|
|
1984
|
+
* Mirrors ADT include:abapInclude structure.
|
|
1985
|
+
*/
|
|
1986
|
+
interface AbapInclude extends AbapObject {
|
|
1987
|
+
readonly kind: 'Include';
|
|
1988
|
+
readonly responsible: string;
|
|
1989
|
+
readonly masterLanguage: string;
|
|
1990
|
+
readonly language: string;
|
|
1991
|
+
readonly version: string;
|
|
1992
|
+
readonly createdAt: Date;
|
|
1993
|
+
readonly createdBy: string;
|
|
1994
|
+
readonly changedAt: Date;
|
|
1995
|
+
readonly changedBy: string;
|
|
1996
|
+
readonly sourceUri: string;
|
|
1997
|
+
readonly fixPointArithmetic: boolean;
|
|
1998
|
+
readonly activeUnicodeCheck: boolean;
|
|
1999
|
+
readonly packageRef?: AdtObjectReference;
|
|
2000
|
+
/** Reference to the "main" program that owns this include. */
|
|
2001
|
+
readonly contextRef?: AdtObjectReference;
|
|
2002
|
+
/** Get include source code */
|
|
2003
|
+
getSource(): Promise<string>;
|
|
2004
|
+
}
|
|
2005
|
+
//#endregion
|
|
2006
|
+
//#region src/objects/repository/fugr/fugr.types.d.ts
|
|
2007
|
+
/**
|
|
2008
|
+
* ABAP Function Group interface
|
|
2009
|
+
*
|
|
2010
|
+
* Plugins work with this interface - implementation is internal.
|
|
2011
|
+
* Mirrors ADT fugr:abapFunctionGroup structure.
|
|
2012
|
+
*/
|
|
2013
|
+
interface AbapFunctionGroup extends AbapObject {
|
|
2014
|
+
readonly kind: 'FunctionGroup';
|
|
2015
|
+
readonly responsible: string;
|
|
2016
|
+
readonly masterLanguage: string;
|
|
2017
|
+
readonly language: string;
|
|
2018
|
+
readonly version: string;
|
|
2019
|
+
readonly createdAt: Date;
|
|
2020
|
+
readonly createdBy: string;
|
|
2021
|
+
readonly changedAt: Date;
|
|
2022
|
+
readonly changedBy: string;
|
|
2023
|
+
readonly sourceUri: string;
|
|
2024
|
+
readonly fixPointArithmetic: boolean;
|
|
2025
|
+
readonly activeUnicodeCheck: boolean;
|
|
2026
|
+
readonly packageRef?: AdtObjectReference;
|
|
2027
|
+
/**
|
|
2028
|
+
* Get function group top-include source code
|
|
2029
|
+
*/
|
|
2030
|
+
getSource(): Promise<string>;
|
|
2031
|
+
}
|
|
2032
|
+
//#endregion
|
|
2033
|
+
//#region src/objects/repository/fugr/func/func.types.d.ts
|
|
2034
|
+
/**
|
|
2035
|
+
* Function module processing type
|
|
2036
|
+
*/
|
|
2037
|
+
type FunctionModuleProcessingType = 'normal' | 'rfc' | 'update';
|
|
2038
|
+
/**
|
|
2039
|
+
* Function module release state
|
|
2040
|
+
*/
|
|
2041
|
+
type FunctionModuleReleaseState = 'notReleased' | 'internal' | 'external' | 'obsolete' | 'markedForRelease';
|
|
2042
|
+
/**
|
|
2043
|
+
* ABAP Function Module interface
|
|
2044
|
+
*
|
|
2045
|
+
* Plugins work with this interface - implementation is internal.
|
|
2046
|
+
* Mirrors ADT fmodules:abapFunctionModule structure.
|
|
2047
|
+
*/
|
|
2048
|
+
interface AbapFunctionModule extends AbapObject {
|
|
2049
|
+
readonly kind: 'FunctionModule';
|
|
2050
|
+
/** Parent function group name */
|
|
2051
|
+
readonly groupName: string;
|
|
2052
|
+
readonly version: string;
|
|
2053
|
+
readonly language: string;
|
|
2054
|
+
readonly createdAt: Date;
|
|
2055
|
+
readonly createdBy: string;
|
|
2056
|
+
readonly changedAt: Date;
|
|
2057
|
+
readonly changedBy: string;
|
|
2058
|
+
readonly sourceUri: string;
|
|
2059
|
+
readonly processingType: FunctionModuleProcessingType;
|
|
2060
|
+
readonly releaseState: FunctionModuleReleaseState;
|
|
2061
|
+
readonly basXMLEnabled: boolean;
|
|
2062
|
+
/**
|
|
2063
|
+
* Get function module source code
|
|
2064
|
+
*/
|
|
2065
|
+
getSource(): Promise<string>;
|
|
2066
|
+
}
|
|
2067
|
+
//#endregion
|
|
2068
|
+
//#region src/objects/cds/ddl.model.d.ts
|
|
2069
|
+
declare class AdkDdlSource {
|
|
2070
|
+
readonly name: string;
|
|
2071
|
+
protected readonly ctx: AdkContext;
|
|
2072
|
+
constructor(ctx: AdkContext, name: string);
|
|
2073
|
+
get objectUri(): string;
|
|
2074
|
+
/** Placeholder description — full metadata requires additional SAP fetch */
|
|
2075
|
+
get description(): string;
|
|
2076
|
+
private get contract();
|
|
2077
|
+
getSource(): Promise<string>;
|
|
2078
|
+
saveMainSource(source: string, options?: {
|
|
2079
|
+
lockHandle?: string;
|
|
2080
|
+
transport?: string;
|
|
2081
|
+
}): Promise<void>;
|
|
2082
|
+
lock(transport?: string): Promise<{
|
|
2083
|
+
handle: string;
|
|
2084
|
+
}>;
|
|
2085
|
+
unlock(lockHandle: string): Promise<void>;
|
|
2086
|
+
activate(): Promise<this>;
|
|
2087
|
+
/**
|
|
2088
|
+
* Get a DDL source (does not fetch metadata, just returns handle)
|
|
2089
|
+
*/
|
|
2090
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkDdlSource>;
|
|
2091
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
2092
|
+
/**
|
|
2093
|
+
* Create a new CDS DDL source on SAP
|
|
2094
|
+
*
|
|
2095
|
+
* POST /sap/bc/adt/ddic/ddl/sources?corrNr=...
|
|
2096
|
+
* Body matches the `ddl:source` schema (extends abapsource:AbapSourceMainObject).
|
|
2097
|
+
*/
|
|
2098
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
2099
|
+
transport?: string;
|
|
2100
|
+
}, ctx?: AdkContext): Promise<AdkDdlSource>;
|
|
2101
|
+
static delete(name: string, options?: {
|
|
2102
|
+
transport?: string;
|
|
2103
|
+
lockHandle?: string;
|
|
2104
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
2105
|
+
}
|
|
2106
|
+
//#endregion
|
|
2107
|
+
//#region src/objects/cds/dcl.model.d.ts
|
|
2108
|
+
declare class AdkDclSource {
|
|
2109
|
+
readonly name: string;
|
|
2110
|
+
protected readonly ctx: AdkContext;
|
|
2111
|
+
constructor(ctx: AdkContext, name: string);
|
|
2112
|
+
get objectUri(): string;
|
|
2113
|
+
/** Placeholder description — full metadata requires additional SAP fetch */
|
|
2114
|
+
get description(): string;
|
|
2115
|
+
private get contract();
|
|
2116
|
+
getSource(): Promise<string>;
|
|
2117
|
+
saveMainSource(source: string, options?: {
|
|
2118
|
+
lockHandle?: string;
|
|
2119
|
+
transport?: string;
|
|
2120
|
+
}): Promise<void>;
|
|
2121
|
+
lock(transport?: string): Promise<{
|
|
2122
|
+
handle: string;
|
|
2123
|
+
}>;
|
|
2124
|
+
unlock(lockHandle: string): Promise<void>;
|
|
2125
|
+
activate(): Promise<this>;
|
|
2126
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkDclSource>;
|
|
2127
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
2128
|
+
/**
|
|
2129
|
+
* Create a new CDS DCL source on SAP
|
|
2130
|
+
*/
|
|
2131
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
2132
|
+
transport?: string;
|
|
2133
|
+
}, ctx?: AdkContext): Promise<AdkDclSource>;
|
|
2134
|
+
static delete(name: string, options?: {
|
|
2135
|
+
transport?: string;
|
|
2136
|
+
lockHandle?: string;
|
|
2137
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
2138
|
+
}
|
|
2139
|
+
//#endregion
|
|
2140
|
+
//#region src/objects/repository/bdef/bdef.model.d.ts
|
|
2141
|
+
declare class AdkBehaviorDefinition {
|
|
2142
|
+
/** Static ADK kind marker — used by abapGit handler registry if needed. */
|
|
2143
|
+
static readonly kind: "BehaviorDefinition";
|
|
2144
|
+
readonly kind: "BehaviorDefinition";
|
|
2145
|
+
readonly name: string;
|
|
2146
|
+
protected readonly ctx: AdkContext;
|
|
2147
|
+
constructor(ctx: AdkContext, name: string);
|
|
2148
|
+
get objectUri(): string;
|
|
2149
|
+
/** Placeholder description — full metadata requires additional SAP fetch */
|
|
2150
|
+
get description(): string;
|
|
2151
|
+
private get contract();
|
|
2152
|
+
getSource(): Promise<string>;
|
|
2153
|
+
saveMainSource(source: string, options?: {
|
|
2154
|
+
lockHandle?: string;
|
|
2155
|
+
transport?: string;
|
|
2156
|
+
}): Promise<void>;
|
|
2157
|
+
lock(transport?: string): Promise<{
|
|
2158
|
+
handle: string;
|
|
2159
|
+
}>;
|
|
2160
|
+
unlock(lockHandle: string): Promise<void>;
|
|
2161
|
+
activate(): Promise<this>;
|
|
2162
|
+
/**
|
|
2163
|
+
* Get a BDEF (validates it exists by fetching source).
|
|
2164
|
+
*/
|
|
2165
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkBehaviorDefinition>;
|
|
2166
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
2167
|
+
/**
|
|
2168
|
+
* Create a new BDEF on SAP.
|
|
2169
|
+
*
|
|
2170
|
+
* POST /sap/bc/adt/bo/behaviordefinitions?corrNr=...
|
|
2171
|
+
* Body matches the `blue:blueSource` envelope (extends
|
|
2172
|
+
* abapsource:AbapSourceMainObject).
|
|
2173
|
+
*/
|
|
2174
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
2175
|
+
transport?: string;
|
|
2176
|
+
}, ctx?: AdkContext): Promise<AdkBehaviorDefinition>;
|
|
2177
|
+
static delete(name: string, options?: {
|
|
2178
|
+
transport?: string;
|
|
2179
|
+
lockHandle?: string;
|
|
2180
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
2181
|
+
}
|
|
2182
|
+
//#endregion
|
|
2183
|
+
//#region src/objects/repository/badi/badi.model.d.ts
|
|
2184
|
+
declare class AdkBadi {
|
|
2185
|
+
/** Static ADK kind marker. */
|
|
2186
|
+
static readonly kind: "Badi";
|
|
2187
|
+
readonly kind: "Badi";
|
|
2188
|
+
readonly name: string;
|
|
2189
|
+
protected readonly ctx: AdkContext;
|
|
2190
|
+
constructor(ctx: AdkContext, name: string);
|
|
2191
|
+
/** ADT URI (lowercase path segment — SAP convention). */
|
|
2192
|
+
get objectUri(): string;
|
|
2193
|
+
/** Placeholder description — real metadata arrives via GET/objectstructure. */
|
|
2194
|
+
get description(): string;
|
|
2195
|
+
private get contract();
|
|
2196
|
+
getMetadata(): Promise<unknown>;
|
|
2197
|
+
getSource(): Promise<string>;
|
|
2198
|
+
saveMainSource(source: string, options?: {
|
|
2199
|
+
lockHandle?: string;
|
|
2200
|
+
transport?: string;
|
|
2201
|
+
}): Promise<void>;
|
|
2202
|
+
lock(transport?: string): Promise<{
|
|
2203
|
+
handle: string;
|
|
2204
|
+
}>;
|
|
2205
|
+
unlock(lockHandle: string): Promise<void>;
|
|
2206
|
+
activate(): Promise<this>;
|
|
2207
|
+
/** Fetch a BAdI / ENHO, validating existence via a metadata GET. */
|
|
2208
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkBadi>;
|
|
2209
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
2210
|
+
/**
|
|
2211
|
+
* Create a new Enhancement Implementation (BAdI container).
|
|
2212
|
+
*
|
|
2213
|
+
* Trial systems typically reject this with HTTP 403 — this is an
|
|
2214
|
+
* area that requires elevated authorisation on most SAP installs.
|
|
2215
|
+
*/
|
|
2216
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
2217
|
+
transport?: string;
|
|
2218
|
+
}, ctx?: AdkContext): Promise<AdkBadi>;
|
|
2219
|
+
static delete(name: string, options?: {
|
|
2220
|
+
transport?: string;
|
|
2221
|
+
lockHandle?: string;
|
|
2222
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
2223
|
+
}
|
|
2224
|
+
//#endregion
|
|
2225
|
+
//#region src/objects/repository/srvd/srvd.model.d.ts
|
|
2226
|
+
declare class AdkServiceDefinition {
|
|
2227
|
+
/** Static ADK kind marker — used by abapGit handler registry if needed. */
|
|
2228
|
+
static readonly kind: "ServiceDefinition";
|
|
2229
|
+
readonly kind: "ServiceDefinition";
|
|
2230
|
+
readonly name: string;
|
|
2231
|
+
protected readonly ctx: AdkContext;
|
|
2232
|
+
constructor(ctx: AdkContext, name: string);
|
|
2233
|
+
get objectUri(): string;
|
|
2234
|
+
/** Placeholder description — full metadata requires additional SAP fetch */
|
|
2235
|
+
get description(): string;
|
|
2236
|
+
private get contract();
|
|
2237
|
+
getSource(): Promise<string>;
|
|
2238
|
+
saveMainSource(source: string, options?: {
|
|
2239
|
+
lockHandle?: string;
|
|
2240
|
+
transport?: string;
|
|
2241
|
+
}): Promise<void>;
|
|
2242
|
+
lock(transport?: string): Promise<{
|
|
2243
|
+
handle: string;
|
|
2244
|
+
}>;
|
|
2245
|
+
unlock(lockHandle: string): Promise<void>;
|
|
2246
|
+
activate(): Promise<this>;
|
|
2247
|
+
/**
|
|
2248
|
+
* Get a SRVD (validates it exists by fetching source).
|
|
2249
|
+
*/
|
|
2250
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkServiceDefinition>;
|
|
2251
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
2252
|
+
/**
|
|
2253
|
+
* Create a new SRVD on SAP.
|
|
2254
|
+
*
|
|
2255
|
+
* POST /sap/bc/adt/ddic/srvd/sources?corrNr=...
|
|
2256
|
+
* Body matches the `srvd:source` envelope (extends
|
|
2257
|
+
* abapsource:AbapSourceMainObject).
|
|
2258
|
+
*/
|
|
2259
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
2260
|
+
transport?: string;
|
|
2261
|
+
}, ctx?: AdkContext): Promise<AdkServiceDefinition>;
|
|
2262
|
+
static delete(name: string, options?: {
|
|
2263
|
+
transport?: string;
|
|
2264
|
+
lockHandle?: string;
|
|
2265
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
2266
|
+
}
|
|
2267
|
+
//#endregion
|
|
2268
|
+
//#region src/objects/repository/srvb/srvb.model.d.ts
|
|
2269
|
+
declare class AdkServiceBinding {
|
|
2270
|
+
/** Static ADK kind marker — used by abapGit handler registry if needed. */
|
|
2271
|
+
static readonly kind: "ServiceBinding";
|
|
2272
|
+
readonly kind: "ServiceBinding";
|
|
2273
|
+
readonly name: string;
|
|
2274
|
+
protected readonly ctx: AdkContext;
|
|
2275
|
+
constructor(ctx: AdkContext, name: string);
|
|
2276
|
+
get objectUri(): string;
|
|
2277
|
+
/** Placeholder description — full metadata requires additional SAP fetch */
|
|
2278
|
+
get description(): string;
|
|
2279
|
+
private get contract();
|
|
2280
|
+
/**
|
|
2281
|
+
* Fetch the binding metadata document. SRVB has no source text;
|
|
2282
|
+
* `getSource()` returns an empty string for uniform CLI parity.
|
|
2283
|
+
*/
|
|
2284
|
+
getMetadata(): Promise<unknown>;
|
|
2285
|
+
getSource(): Promise<string>;
|
|
2286
|
+
lock(transport?: string): Promise<{
|
|
2287
|
+
handle: string;
|
|
2288
|
+
}>;
|
|
2289
|
+
unlock(lockHandle: string): Promise<void>;
|
|
2290
|
+
activate(): Promise<this>;
|
|
2291
|
+
/**
|
|
2292
|
+
* Publish (activate) the binding in the SAP Gateway.
|
|
2293
|
+
* POST {basePath}/{name}/publishedstates
|
|
2294
|
+
*/
|
|
2295
|
+
publish(): Promise<void>;
|
|
2296
|
+
/**
|
|
2297
|
+
* Unpublish (deactivate) the binding.
|
|
2298
|
+
* DELETE {basePath}/{name}/publishedstates
|
|
2299
|
+
*/
|
|
2300
|
+
unpublish(): Promise<void>;
|
|
2301
|
+
/**
|
|
2302
|
+
* Get a SRVB (validates it exists by fetching metadata).
|
|
2303
|
+
*/
|
|
2304
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkServiceBinding>;
|
|
2305
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
2306
|
+
/**
|
|
2307
|
+
* Create a new SRVB on SAP.
|
|
2308
|
+
*
|
|
2309
|
+
* POST /sap/bc/adt/businessservices/bindings?corrNr=...
|
|
2310
|
+
* Body matches the `srvb:serviceBinding` envelope.
|
|
2311
|
+
*/
|
|
2312
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
2313
|
+
transport?: string;
|
|
2314
|
+
}, ctx?: AdkContext): Promise<AdkServiceBinding>;
|
|
2315
|
+
static delete(name: string, options?: {
|
|
2316
|
+
transport?: string;
|
|
2317
|
+
lockHandle?: string;
|
|
2318
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
2319
|
+
static publish(name: string, ctx?: AdkContext): Promise<void>;
|
|
2320
|
+
static unpublish(name: string, ctx?: AdkContext): Promise<void>;
|
|
2321
|
+
}
|
|
2322
|
+
//#endregion
|
|
2323
|
+
//#region src/objects/cts/transport-import.d.ts
|
|
2324
|
+
interface TransportObjectData$1 {
|
|
2325
|
+
pgmid?: string;
|
|
2326
|
+
type?: string;
|
|
2327
|
+
name?: string;
|
|
2328
|
+
wbtype?: string;
|
|
2329
|
+
uri?: string;
|
|
2330
|
+
obj_desc?: string;
|
|
2331
|
+
obj_info?: string;
|
|
2332
|
+
lock_status?: string;
|
|
2333
|
+
/** Object function code (e.g. 'D' = deletion, 'K' = key, '' = modification) */
|
|
2334
|
+
obj_func?: string;
|
|
2335
|
+
}
|
|
2336
|
+
/**
|
|
2337
|
+
* Selector for filtering transport objects.
|
|
2338
|
+
*
|
|
2339
|
+
* All specified dimensions are ANDed together.
|
|
2340
|
+
* Use '*' for a wildcard that matches any non-empty value.
|
|
2341
|
+
*/
|
|
2342
|
+
interface TransportObjectSelector {
|
|
2343
|
+
/**
|
|
2344
|
+
* Filter by object function code.
|
|
2345
|
+
* 'D' = deletion only, 'K' = key only, '*' = any non-empty value, '' = empty (normal)
|
|
2346
|
+
*/
|
|
2347
|
+
objFunc?: string | string[];
|
|
2348
|
+
/**
|
|
2349
|
+
* Filter by program ID.
|
|
2350
|
+
* 'R3TR' = repository objects, 'LIMU' = sub-objects, '*' = any
|
|
2351
|
+
*/
|
|
2352
|
+
pgmid?: string | string[];
|
|
2353
|
+
/**
|
|
2354
|
+
* Filter by object type (e.g. 'CLAS', 'TABL', '*' = any)
|
|
2355
|
+
*/
|
|
2356
|
+
type?: string | string[];
|
|
2357
|
+
}
|
|
2358
|
+
interface TransportTaskData$1 {
|
|
2359
|
+
number?: string;
|
|
2360
|
+
owner?: string;
|
|
2361
|
+
desc?: string;
|
|
2362
|
+
status?: string;
|
|
2363
|
+
status_text?: string;
|
|
2364
|
+
abap_object?: TransportObjectData$1 | TransportObjectData$1[];
|
|
2365
|
+
}
|
|
2366
|
+
/**
|
|
2367
|
+
* Check if an object ref matches all dimensions of a {@link TransportObjectSelector}.
|
|
2368
|
+
*
|
|
2369
|
+
* Exported so that consumers (e.g. import service) can reuse the same logic
|
|
2370
|
+
* without duplicating it.
|
|
2371
|
+
*/
|
|
2372
|
+
declare function matchesSelector(obj: AdkTransportObjectRef, selector: TransportObjectSelector): boolean;
|
|
2373
|
+
/**
|
|
2374
|
+
* Transport object reference - lightweight wrapper
|
|
2375
|
+
*
|
|
2376
|
+
* Contains metadata about an object in the transport.
|
|
2377
|
+
* Call load() to get the full ADK object.
|
|
2378
|
+
*/
|
|
2379
|
+
declare class AdkTransportObjectRef {
|
|
2380
|
+
private readonly ctx;
|
|
2381
|
+
private readonly data;
|
|
2382
|
+
constructor(ctx: AdkContext, data: TransportObjectData$1);
|
|
2383
|
+
/** Program ID (R3TR, LIMU, etc.) */
|
|
2384
|
+
get pgmid(): string;
|
|
2385
|
+
/** Object type (CLAS, INTF, DOMA, etc.) */
|
|
2386
|
+
get type(): string;
|
|
2387
|
+
/** Object name */
|
|
2388
|
+
get name(): string;
|
|
2389
|
+
/** Workbench type (more specific type) */
|
|
2390
|
+
get wbtype(): string | undefined;
|
|
2391
|
+
/** Object URI for direct access */
|
|
2392
|
+
get uri(): string | undefined;
|
|
2393
|
+
/** Object description */
|
|
2394
|
+
get description(): string | undefined;
|
|
2395
|
+
/**
|
|
2396
|
+
* Object function code (SAP OBJFUNC).
|
|
2397
|
+
* 'D' = marked for deletion, 'K' = key entry, '' = regular modification.
|
|
2398
|
+
*/
|
|
2399
|
+
get objFunc(): string;
|
|
2400
|
+
/** Whether this object is marked for deletion (obj_func === 'D') */
|
|
2401
|
+
get isDeleted(): boolean;
|
|
2402
|
+
/** Full object key (PGMID/TYPE/NAME) */
|
|
2403
|
+
get key(): string;
|
|
2404
|
+
/**
|
|
2405
|
+
* Load the full ADK object
|
|
2406
|
+
*
|
|
2407
|
+
* Uses the ADK factory to create the appropriate object type
|
|
2408
|
+
* (AdkClass, AdkInterface, AdkPackage, etc.)
|
|
2409
|
+
*
|
|
2410
|
+
* @returns The loaded ADK object, or undefined if type not supported
|
|
2411
|
+
*/
|
|
2412
|
+
load(): Promise<unknown>;
|
|
2413
|
+
/** Raw data from API */
|
|
2414
|
+
get raw(): TransportObjectData$1;
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* Transport task reference
|
|
2418
|
+
*/
|
|
2419
|
+
declare class AdkTransportTaskRef {
|
|
2420
|
+
private readonly ctx;
|
|
2421
|
+
private readonly data;
|
|
2422
|
+
constructor(ctx: AdkContext, data: TransportTaskData$1);
|
|
2423
|
+
get number(): string;
|
|
2424
|
+
get owner(): string;
|
|
2425
|
+
get description(): string;
|
|
2426
|
+
get status(): string;
|
|
2427
|
+
get statusText(): string;
|
|
2428
|
+
/** Objects in this task */
|
|
2429
|
+
get objects(): AdkTransportObjectRef[];
|
|
2430
|
+
}
|
|
2431
|
+
/**
|
|
2432
|
+
* AdkTransport - Transport request for import operations
|
|
2433
|
+
*
|
|
2434
|
+
* Simple, focused API for importing transport objects:
|
|
2435
|
+
*
|
|
2436
|
+
* @example
|
|
2437
|
+
* ```typescript
|
|
2438
|
+
* const transport = await AdkTransport.get('DEVK900001');
|
|
2439
|
+
*
|
|
2440
|
+
* for (const objRef of transport.objects) {
|
|
2441
|
+
* console.log(`${objRef.type} ${objRef.name}`);
|
|
2442
|
+
* const adkObject = await objRef.load();
|
|
2443
|
+
* if (adkObject) {
|
|
2444
|
+
* // Serialize with plugin
|
|
2445
|
+
* await plugin.serialize(adkObject);
|
|
2446
|
+
* }
|
|
2447
|
+
* }
|
|
2448
|
+
* ```
|
|
2449
|
+
*/
|
|
2450
|
+
declare class AdkTransport {
|
|
2451
|
+
private readonly ctx;
|
|
2452
|
+
private readonly data;
|
|
2453
|
+
private _objects?;
|
|
2454
|
+
private _tasks?;
|
|
2455
|
+
private constructor();
|
|
2456
|
+
/** Transport number */
|
|
2457
|
+
get number(): string;
|
|
2458
|
+
/** Transport description */
|
|
2459
|
+
get description(): string;
|
|
2460
|
+
/** Transport owner */
|
|
2461
|
+
get owner(): string;
|
|
2462
|
+
/** Transport status (D=Modifiable, R=Released) */
|
|
2463
|
+
get status(): string;
|
|
2464
|
+
/** Transport status text */
|
|
2465
|
+
get statusText(): string;
|
|
2466
|
+
/** Transport target system */
|
|
2467
|
+
get target(): string;
|
|
2468
|
+
/** Object type (K=Request, T=Task) */
|
|
2469
|
+
get objectType(): string;
|
|
2470
|
+
/** Tasks belonging to this transport */
|
|
2471
|
+
get tasks(): AdkTransportTaskRef[];
|
|
2472
|
+
/**
|
|
2473
|
+
* All objects in this transport
|
|
2474
|
+
*
|
|
2475
|
+
* Collects objects from:
|
|
2476
|
+
* - Direct objects on request
|
|
2477
|
+
* - Objects from all tasks
|
|
2478
|
+
* - all_objects container (if present)
|
|
2479
|
+
*/
|
|
2480
|
+
get objects(): AdkTransportObjectRef[];
|
|
2481
|
+
private collectObjects;
|
|
2482
|
+
/**
|
|
2483
|
+
* Get objects filtered by type
|
|
2484
|
+
*
|
|
2485
|
+
* @param types - Object types to include (e.g., ['CLAS', 'INTF'])
|
|
2486
|
+
*/
|
|
2487
|
+
getObjectsByType(...types: string[]): AdkTransportObjectRef[];
|
|
2488
|
+
/**
|
|
2489
|
+
* Get objects filtered by a {@link TransportObjectSelector}.
|
|
2490
|
+
*
|
|
2491
|
+
* All dimensions specified in the selector are ANDed together.
|
|
2492
|
+
*
|
|
2493
|
+
* @example
|
|
2494
|
+
* ```typescript
|
|
2495
|
+
* // Get only deletion objects with pgmid=R3TR
|
|
2496
|
+
* const deleted = transport.getObjectsBySelector({ objFunc: 'D', pgmid: 'R3TR' });
|
|
2497
|
+
* ```
|
|
2498
|
+
*/
|
|
2499
|
+
getObjectsBySelector(selector: TransportObjectSelector): AdkTransportObjectRef[];
|
|
2500
|
+
/**
|
|
2501
|
+
* Convenience accessor for objects marked for deletion (obj_func === 'D').
|
|
2502
|
+
*
|
|
2503
|
+
* Equivalent to `getObjectsBySelector({ objFunc: 'D' })`.
|
|
2504
|
+
*/
|
|
2505
|
+
get deletionObjects(): AdkTransportObjectRef[];
|
|
2506
|
+
/**
|
|
2507
|
+
* Get unique object types in this transport
|
|
2508
|
+
*/
|
|
2509
|
+
getObjectTypes(): string[];
|
|
2510
|
+
/**
|
|
2511
|
+
* Get object count by type
|
|
2512
|
+
*/
|
|
2513
|
+
getObjectCountByType(): Record<string, number>;
|
|
2514
|
+
/** Raw API response (unwrapped) */
|
|
2515
|
+
get raw(): TransportData;
|
|
2516
|
+
/**
|
|
2517
|
+
* Get a transport by number
|
|
2518
|
+
*
|
|
2519
|
+
* @param number - Transport number (e.g., 'DEVK900001')
|
|
2520
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
2521
|
+
*
|
|
2522
|
+
* @example
|
|
2523
|
+
* ```typescript
|
|
2524
|
+
* const transport = await AdkTransport.get('DEVK900001');
|
|
2525
|
+
* console.log(`${transport.description} - ${transport.objects.length} objects`);
|
|
2526
|
+
* ```
|
|
2527
|
+
*/
|
|
2528
|
+
static get(number: string, ctx?: AdkContext): Promise<AdkTransport>;
|
|
2529
|
+
/**
|
|
2530
|
+
* Load multiple transports and merge their objects into a single view.
|
|
2531
|
+
*
|
|
2532
|
+
* De-duplication key is `pgmid/type/name`. When the same key appears in
|
|
2533
|
+
* multiple transports the **first** occurrence wins (first transport in the
|
|
2534
|
+
* `numbers` array). The source transport number is available via
|
|
2535
|
+
* `AdkTransportObjectRef.sourceTransport`.
|
|
2536
|
+
*
|
|
2537
|
+
* @param numbers - Transport numbers to load and merge
|
|
2538
|
+
* @param ctx - Optional ADK context
|
|
2539
|
+
*
|
|
2540
|
+
* @example
|
|
2541
|
+
* ```typescript
|
|
2542
|
+
* const merged = await AdkTransport.merge(['DEVK900001', 'DEVK900002']);
|
|
2543
|
+
* const deletions = merged.getObjectsBySelector({ objFunc: 'D' });
|
|
2544
|
+
* ```
|
|
2545
|
+
*/
|
|
2546
|
+
static merge(numbers: string[], ctx?: AdkContext): Promise<MergedTransportView>;
|
|
2547
|
+
}
|
|
2548
|
+
/**
|
|
2549
|
+
* Result of resolving transport objects (single or multi-TR).
|
|
2550
|
+
*
|
|
2551
|
+
* Returned by {@link resolveTransportObjects}.
|
|
2552
|
+
*/
|
|
2553
|
+
interface ResolvedTransportObjects {
|
|
2554
|
+
/** Deduplicated list of transport objects (first-win across TRs). */
|
|
2555
|
+
objects: AdkTransportObjectRef[];
|
|
2556
|
+
/** Maps each object key to the TR number it was sourced from. */
|
|
2557
|
+
sourceTransportMap: Map<string, string>;
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* Load and resolve objects from one or more transport numbers, with optional
|
|
2561
|
+
* selector-based filtering and deduplication across TRs.
|
|
2562
|
+
*
|
|
2563
|
+
* This is the shared logic used by both the CLI `cts tr objects` command and
|
|
2564
|
+
* the MCP `cts_transport_objects` tool — extracted here to avoid duplication.
|
|
2565
|
+
*
|
|
2566
|
+
* @param transportNumbers - Ordered list of TR numbers (first-win deduplication).
|
|
2567
|
+
* @param selector - Optional dimension filter (objFunc, pgmid, type).
|
|
2568
|
+
* @param ctx - Optional ADK context (uses global context if omitted).
|
|
2569
|
+
*/
|
|
2570
|
+
declare function resolveTransportObjects(transportNumbers: string[], selector: TransportObjectSelector, ctx?: AdkContext): Promise<ResolvedTransportObjects>;
|
|
2571
|
+
/**
|
|
2572
|
+
* Merged view of objects from multiple transports.
|
|
2573
|
+
*
|
|
2574
|
+
* De-duplicates by `pgmid/type/name`; first occurrence wins.
|
|
2575
|
+
*/
|
|
2576
|
+
declare class MergedTransportView {
|
|
2577
|
+
private readonly _objects;
|
|
2578
|
+
readonly transports: AdkTransport[];
|
|
2579
|
+
constructor(transports: AdkTransport[]);
|
|
2580
|
+
/** All objects across transports (deduplicated) */
|
|
2581
|
+
get objects(): AdkTransportObjectRef[];
|
|
2582
|
+
/** Objects matching a selector across all transports */
|
|
2583
|
+
getObjectsBySelector(selector: TransportObjectSelector): AdkTransportObjectRef[];
|
|
2584
|
+
/** Convenience: objects marked for deletion (obj_func === 'D') */
|
|
2585
|
+
get deletionObjects(): AdkTransportObjectRef[];
|
|
2586
|
+
/**
|
|
2587
|
+
* Load multiple transports and return a merged view.
|
|
2588
|
+
*
|
|
2589
|
+
* @param numbers - Transport numbers to load and merge
|
|
2590
|
+
* @param ctx - Optional ADK context
|
|
2591
|
+
*/
|
|
2592
|
+
static create(numbers: string[], ctx?: AdkContext): Promise<MergedTransportView>;
|
|
2593
|
+
}
|
|
2594
|
+
//#endregion
|
|
2595
|
+
//#region src/factory.d.ts
|
|
2596
|
+
/**
|
|
2597
|
+
* Extract ADT type and name from XML
|
|
2598
|
+
*
|
|
2599
|
+
* Relies on adtcore:type and adtcore:name attributes which are
|
|
2600
|
+
* the standard identifiers in ADT XML responses.
|
|
2601
|
+
*
|
|
2602
|
+
* @param xml - XML string from ADT response
|
|
2603
|
+
* @returns Extracted type and name, or undefined if not found
|
|
2604
|
+
*/
|
|
2605
|
+
declare function parseXmlIdentity(xml: string): {
|
|
2606
|
+
type: string;
|
|
2607
|
+
name: string;
|
|
2608
|
+
} | undefined;
|
|
2609
|
+
/**
|
|
2610
|
+
* Generic ADK object for unregistered types
|
|
2611
|
+
*
|
|
2612
|
+
* Provides core functionality (adtcore attributes, links)
|
|
2613
|
+
* without type-specific features.
|
|
2614
|
+
*/
|
|
2615
|
+
declare class AdkGenericObject {
|
|
2616
|
+
readonly adtType: string;
|
|
2617
|
+
readonly adtMainType: string;
|
|
2618
|
+
readonly adtSubType?: string;
|
|
2619
|
+
protected readonly ctx: AdkContext;
|
|
2620
|
+
protected _name: string;
|
|
2621
|
+
protected _data?: unknown;
|
|
2622
|
+
constructor(ctx: AdkContext, name: string, adtType: string);
|
|
2623
|
+
get name(): string;
|
|
2624
|
+
get type(): string;
|
|
2625
|
+
/** Check if data is loaded */
|
|
2626
|
+
get isLoaded(): boolean;
|
|
2627
|
+
/** Get raw data (if loaded) */
|
|
2628
|
+
get data(): unknown;
|
|
2629
|
+
/** Set data (for manual population) */
|
|
2630
|
+
setData(data: unknown): void;
|
|
2631
|
+
}
|
|
2632
|
+
/**
|
|
2633
|
+
* ADK Factory - Generic object creation
|
|
2634
|
+
*/
|
|
2635
|
+
interface AdkFactory {
|
|
2636
|
+
/** Context used by this factory */
|
|
2637
|
+
readonly ctx: AdkContext;
|
|
2638
|
+
/**
|
|
2639
|
+
* Get object by name and ADT type
|
|
2640
|
+
*
|
|
2641
|
+
* Supports both full types (DEVC/K) and main types (DEVC).
|
|
2642
|
+
* Returns deferred object - call load() to fetch data.
|
|
2643
|
+
*
|
|
2644
|
+
* @example
|
|
2645
|
+
* const pkg = factory.get('ZPACKAGE', 'DEVC/K');
|
|
2646
|
+
* await pkg.load();
|
|
2647
|
+
*
|
|
2648
|
+
* const cls = factory.get('ZCL_TEST', 'CLAS');
|
|
2649
|
+
* await cls.load();
|
|
2650
|
+
*/
|
|
2651
|
+
get(name: string, adtType: string): AdkObject | AdkGenericObject;
|
|
2652
|
+
/**
|
|
2653
|
+
* Get object with initial data (for deserialization)
|
|
2654
|
+
*
|
|
2655
|
+
* Creates object pre-populated with data - no load() needed.
|
|
2656
|
+
* Used when deserializing from files rather than loading from SAP.
|
|
2657
|
+
*
|
|
2658
|
+
* @example
|
|
2659
|
+
* const cls = factory.getWithData({ name: 'ZCL_TEST', description: 'Test' }, 'CLAS');
|
|
2660
|
+
* // cls.isLoaded is true, no need to call load()
|
|
2661
|
+
*/
|
|
2662
|
+
getWithData(data: Record<string, unknown>, adtType: string): AdkObject | AdkGenericObject;
|
|
2663
|
+
/**
|
|
2664
|
+
* Get object by ADK kind (type-safe)
|
|
2665
|
+
*
|
|
2666
|
+
* Returns correctly typed object based on kind.
|
|
2667
|
+
* TypeScript infers the concrete return type from the kind parameter.
|
|
2668
|
+
*
|
|
2669
|
+
* @example
|
|
2670
|
+
* import { Class, Interface } from '@abapify/adk';
|
|
2671
|
+
* const cls = factory.byKind(Class, 'ZCL_TEST'); // → AdkClass
|
|
2672
|
+
* const intf = factory.byKind(Interface, 'ZIF_TEST'); // → AdkInterface
|
|
2673
|
+
*/
|
|
2674
|
+
byKind<K extends AdkKind>(kind: K, name: string): AdkObjectForKind<K>;
|
|
2675
|
+
/**
|
|
2676
|
+
* Create object from XML response
|
|
2677
|
+
*
|
|
2678
|
+
* Parses XML to extract type and name, then constructs
|
|
2679
|
+
* the correct object type.
|
|
2680
|
+
*
|
|
2681
|
+
* @example
|
|
2682
|
+
* const xml = await client.fetch('/sap/bc/adt/oo/classes/ZCL_TEST');
|
|
2683
|
+
* const cls = factory.fromXml(xml);
|
|
2684
|
+
*/
|
|
2685
|
+
fromXml(xml: string): AdkObject | AdkGenericObject | undefined;
|
|
2686
|
+
/**
|
|
2687
|
+
* Create new object (for creation workflows)
|
|
2688
|
+
*
|
|
2689
|
+
* Returns deferred object without name - used when
|
|
2690
|
+
* creating new objects in SAP.
|
|
2691
|
+
*/
|
|
2692
|
+
create(adtType: string): AdkObject | AdkGenericObject;
|
|
2693
|
+
}
|
|
2694
|
+
/**
|
|
2695
|
+
* Create ADK factory
|
|
2696
|
+
*
|
|
2697
|
+
* @param ctx - ADK context with services
|
|
2698
|
+
* @returns Factory instance
|
|
2699
|
+
*/
|
|
2700
|
+
declare function createAdkFactory(ctx: AdkContext): AdkFactory;
|
|
2701
|
+
/**
|
|
2702
|
+
* Create ADK factory from ADT client
|
|
2703
|
+
*
|
|
2704
|
+
* Builds context from client and returns factory.
|
|
2705
|
+
* This is the main entry point for most users.
|
|
2706
|
+
*
|
|
2707
|
+
* @example
|
|
2708
|
+
* import { createAdtClient } from '@abapify/adt-client';
|
|
2709
|
+
* import { createAdk } from '@abapify/adk';
|
|
2710
|
+
*
|
|
2711
|
+
* const client = createAdtClient({ ... });
|
|
2712
|
+
* const adk = createAdk(client);
|
|
2713
|
+
*
|
|
2714
|
+
* const cls = adk.get('ZCL_TEST', 'CLAS');
|
|
2715
|
+
* await cls.load();
|
|
2716
|
+
*/
|
|
2717
|
+
declare function createAdk(client: AdtClient$1): AdkFactory;
|
|
2718
|
+
//#endregion
|
|
2719
|
+
//#region src/base/registry.d.ts
|
|
2720
|
+
/** Constructor signature for ADK objects */
|
|
2721
|
+
type AdkObjectConstructor<T extends AdkObject<AdkKind, any> = AdkObject<AdkKind, any>> = new (ctx: AdkContext, nameOrData: string | any) => T;
|
|
2722
|
+
/** How to transform object name for the URI path segment */
|
|
2723
|
+
type NameTransform = 'lowercase' | 'preserve';
|
|
2724
|
+
/** Registry entry with constructor and kind */
|
|
2725
|
+
interface RegistryEntry {
|
|
2726
|
+
readonly kind: AdkKind;
|
|
2727
|
+
readonly constructor: AdkObjectConstructor;
|
|
2728
|
+
/** ADT REST endpoint path segment (e.g., 'oo/classes', 'ddic/tabletypes') */
|
|
2729
|
+
readonly endpoint?: string;
|
|
2730
|
+
/** How to transform the object name in URIs (default: lowercase) */
|
|
2731
|
+
readonly nameTransform?: NameTransform;
|
|
2732
|
+
/** Optional name normalizer — e.g., strip SAPL prefix for FUGR */
|
|
2733
|
+
readonly normalizeName?: (name: string) => string;
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* Parse ADT type into components
|
|
2737
|
+
*
|
|
2738
|
+
* @example
|
|
2739
|
+
* parseAdtType("DEVC/K") // { full: "DEVC/K", main: "DEVC", sub: "K" }
|
|
2740
|
+
* parseAdtType("DEVC") // { full: "DEVC", main: "DEVC", sub: undefined }
|
|
2741
|
+
*/
|
|
2742
|
+
declare function parseAdtType(adtType: string): {
|
|
2743
|
+
full: string;
|
|
2744
|
+
main: string;
|
|
2745
|
+
sub?: string;
|
|
2746
|
+
};
|
|
2747
|
+
/**
|
|
2748
|
+
* Get main type from ADT type
|
|
2749
|
+
*
|
|
2750
|
+
* @example
|
|
2751
|
+
* getMainType("DEVC/K") // "DEVC"
|
|
2752
|
+
* getMainType("CLAS") // "CLAS"
|
|
2753
|
+
*/
|
|
2754
|
+
declare function getMainType(adtType: string): string;
|
|
2755
|
+
/** Options for registerObjectType */
|
|
2756
|
+
interface RegisterObjectTypeOptions {
|
|
2757
|
+
/** ADT REST endpoint path segment (e.g., 'oo/classes', 'ddic/tabletypes') */
|
|
2758
|
+
endpoint?: string;
|
|
2759
|
+
/** How to transform the object name in URIs (default: 'lowercase') */
|
|
2760
|
+
nameTransform?: NameTransform;
|
|
2761
|
+
/** Optional name normalizer — e.g., strip SAPL prefix for FUGR */
|
|
2762
|
+
normalizeName?: (name: string) => string;
|
|
2763
|
+
}
|
|
2764
|
+
/**
|
|
2765
|
+
* Register an ADK object type
|
|
2766
|
+
*
|
|
2767
|
+
* @param adtType - ADT type, either main (e.g., "CLAS") or full (e.g., "TABL/DS")
|
|
2768
|
+
* @param kind - ADK kind constant
|
|
2769
|
+
* @param constructor - Object constructor
|
|
2770
|
+
* @param options - Optional endpoint and name transform settings
|
|
2771
|
+
*/
|
|
2772
|
+
declare function registerObjectType(adtType: string, kind: AdkKind, constructor: AdkObjectConstructor, options?: RegisterObjectTypeOptions): void;
|
|
2773
|
+
/**
|
|
2774
|
+
* Resolve ADT type to registry entry
|
|
2775
|
+
*
|
|
2776
|
+
* Tries full type first (e.g., "TABL/DS"), then falls back to main type (e.g., "TABL").
|
|
2777
|
+
* This allows registering subtypes with different constructors/endpoints.
|
|
2778
|
+
*
|
|
2779
|
+
* @param adtType - Full or main ADT type (e.g., "DEVC/K" or "DEVC")
|
|
2780
|
+
* @returns Registry entry or undefined if not found
|
|
2781
|
+
*/
|
|
2782
|
+
declare function resolveType(adtType: string): RegistryEntry | undefined;
|
|
2783
|
+
/**
|
|
2784
|
+
* Resolve ADK kind to registry entry
|
|
2785
|
+
*
|
|
2786
|
+
* @param kind - ADK kind constant
|
|
2787
|
+
* @returns Registry entry or undefined if not found
|
|
2788
|
+
*/
|
|
2789
|
+
declare function resolveKind(kind: AdkKind): RegistryEntry | undefined;
|
|
2790
|
+
/**
|
|
2791
|
+
* Get ADK kind for ADT type
|
|
2792
|
+
*/
|
|
2793
|
+
declare function getKindForType(adtType: string): AdkKind | undefined;
|
|
2794
|
+
/**
|
|
2795
|
+
* Get ADT main type for ADK kind
|
|
2796
|
+
*/
|
|
2797
|
+
declare function getTypeForKind(kind: AdkKind): string | undefined;
|
|
2798
|
+
/**
|
|
2799
|
+
* Check if ADT type is registered
|
|
2800
|
+
*/
|
|
2801
|
+
declare function isTypeRegistered(adtType: string): boolean;
|
|
2802
|
+
/**
|
|
2803
|
+
* Get all registered ADT types
|
|
2804
|
+
*/
|
|
2805
|
+
declare function getRegisteredTypes(): string[];
|
|
2806
|
+
/**
|
|
2807
|
+
* Get all registered ADK kinds
|
|
2808
|
+
*/
|
|
2809
|
+
declare function getRegisteredKinds(): AdkKind[];
|
|
2810
|
+
/**
|
|
2811
|
+
* Get ADT REST endpoint for a type (e.g., 'oo/classes', 'ddic/tabletypes')
|
|
2812
|
+
* Checks exact type first (e.g., 'TABL/DS') before falling back to main type.
|
|
2813
|
+
*/
|
|
2814
|
+
declare function getEndpointForType(adtType: string): string | undefined;
|
|
2815
|
+
/**
|
|
2816
|
+
* Build the full ADT object URI for a given type and name.
|
|
2817
|
+
*
|
|
2818
|
+
* @example
|
|
2819
|
+
* getObjectUri('CLAS', 'ZCL_MY_CLASS') // '/sap/bc/adt/oo/classes/zcl_my_class'
|
|
2820
|
+
* getObjectUri('DEVC', 'ZPACKAGE') // '/sap/bc/adt/packages/ZPACKAGE'
|
|
2821
|
+
* getObjectUri('TTYP', 'ZAGE_TTYP_STRTAB') // '/sap/bc/adt/ddic/tabletypes/zage_ttyp_strtab'
|
|
2822
|
+
*/
|
|
2823
|
+
declare function getObjectUri(adtType: string, name: string): string | undefined;
|
|
2824
|
+
/**
|
|
2825
|
+
* Normalize an object name using type-specific rules.
|
|
2826
|
+
*
|
|
2827
|
+
* If `adtType` is provided, applies that type's normalizer only.
|
|
2828
|
+
* Otherwise, collects all possible normalized forms from every registered type.
|
|
2829
|
+
*
|
|
2830
|
+
* @returns Array of candidate names (always includes the original).
|
|
2831
|
+
*
|
|
2832
|
+
* @example
|
|
2833
|
+
* normalizeObjectName('SAPLZAGE_FUGR') // ['SAPLZAGE_FUGR', 'ZAGE_FUGR']
|
|
2834
|
+
* normalizeObjectName('SAPLZAGE_FUGR', 'FUGR') // ['ZAGE_FUGR']
|
|
2835
|
+
* normalizeObjectName('ZCLAS_TEST') // ['ZCLAS_TEST'] (no normalizer matches)
|
|
2836
|
+
*/
|
|
2837
|
+
declare function normalizeObjectName(name: string, adtType?: string): string[];
|
|
2838
|
+
/**
|
|
2839
|
+
* Extract the root object URI from a full (possibly sub-resource) URI.
|
|
2840
|
+
*
|
|
2841
|
+
* SAP locks must target the object root, not sub-resources like `/source/main`.
|
|
2842
|
+
* This function matches against registered endpoint prefixes and strips
|
|
2843
|
+
* everything after the object name segment.
|
|
2844
|
+
*
|
|
2845
|
+
* @returns The root object URI, or the original URI unchanged if no endpoint matches.
|
|
2846
|
+
*
|
|
2847
|
+
* @example
|
|
2848
|
+
* getObjectRootUri('/sap/bc/adt/functions/groups/zage_fugr/source/main')
|
|
2849
|
+
* // → '/sap/bc/adt/functions/groups/zage_fugr'
|
|
2850
|
+
* getObjectRootUri('/sap/bc/adt/oo/classes/zcl_test/includes/testclasses')
|
|
2851
|
+
* // → '/sap/bc/adt/oo/classes/zcl_test'
|
|
2852
|
+
* getObjectRootUri('/sap/bc/adt/oo/classes/zcl_test')
|
|
2853
|
+
* // → '/sap/bc/adt/oo/classes/zcl_test' (already root)
|
|
2854
|
+
*/
|
|
2855
|
+
declare function getObjectRootUri(uri: string): string;
|
|
2856
|
+
/**
|
|
2857
|
+
* Known ADT type to ADK kind mappings
|
|
2858
|
+
*
|
|
2859
|
+
* Repository Objects:
|
|
2860
|
+
* - DEVC → Package
|
|
2861
|
+
* - CLAS → Class
|
|
2862
|
+
* - INTF → Interface
|
|
2863
|
+
* - FUGR → FunctionGroup
|
|
2864
|
+
* - FUNC → FunctionModule
|
|
2865
|
+
* - PROG → Program
|
|
2866
|
+
* - INCL → Include
|
|
2867
|
+
*
|
|
2868
|
+
* Data Dictionary:
|
|
2869
|
+
* - TABL → Table
|
|
2870
|
+
* - STRU → Structure (actually TABL with different category)
|
|
2871
|
+
* - DTEL → DataElement
|
|
2872
|
+
* - DOMA → Domain
|
|
2873
|
+
* - TTYP → TableType
|
|
2874
|
+
*
|
|
2875
|
+
* Other:
|
|
2876
|
+
* - MSAG → MessageClass
|
|
2877
|
+
* - ENHS → EnhancementSpot
|
|
2878
|
+
*
|
|
2879
|
+
* CTS:
|
|
2880
|
+
* - (Transport requests/tasks use different identification)
|
|
2881
|
+
*/
|
|
2882
|
+
declare const ADT_TYPE_MAPPINGS: {
|
|
2883
|
+
readonly DEVC: "Package";
|
|
2884
|
+
readonly CLAS: "Class";
|
|
2885
|
+
readonly INTF: "Interface";
|
|
2886
|
+
readonly FUGR: "FunctionGroup";
|
|
2887
|
+
readonly FUNC: "FunctionModule";
|
|
2888
|
+
readonly PROG: "Program";
|
|
2889
|
+
readonly INCL: "Include";
|
|
2890
|
+
readonly TABL: "Table";
|
|
2891
|
+
readonly DTEL: "DataElement";
|
|
2892
|
+
readonly DOMA: "Domain";
|
|
2893
|
+
readonly TTYP: "TableType";
|
|
2894
|
+
readonly MSAG: "MessageClass";
|
|
2895
|
+
readonly ENHS: "EnhancementSpot";
|
|
2896
|
+
};
|
|
2897
|
+
//#endregion
|
|
2898
|
+
export { ADT_TYPE_MAPPINGS, type AbapClass, type AbapFunctionGroup, type AbapFunctionModule, type AbapInclude, type AbapInterface, type AbapObject, type AbapPackage, type AbapProgram, type ActivationResult, AdkBadi, AdkBehaviorDefinition, AdkClass, type AdkContext, type AdkContract, AdkDataElement, AdkDclSource, AdkDdlSource, AdkDomain, type AdkFactory, AdkFunctionGroup, AdkFunctionModule, AdkGenericObject, AdkInclude, AdkInterface, AdkKind, AdkMainObject, type AdkMainObjectData, AdkObject, type AdkObjectData, type AdkObjectForKind, AdkObjectSet, AdkPackage, AdkProgram, AdkServiceBinding, AdkServiceDefinition, AdkStructure, AdkTable, AdkTableType, AdkTransport, AdkTransportRequest as AdkTransportItem, AdkTransportRequest, AdkTransportObject, AdkTransportObjectRef, AdkTransportTask, AdkTransportTaskRef, type AdtClient, type AdtContracts, type AdtObjectReference, type ApplicationComponent, type AtomLink, type BulkActivateOptions, type BulkSaveOptions, type BulkSaveResult, Class, type ClassCategory, type ClassInclude, type ClassIncludeType, type ClassResponse, type ClassVisibility, type ClassXml, DataElement, type DataElementResponse, type DataElementXml, Domain, type DomainResponse, type DomainXml, EnhancementSpot, FunctionGroup, type FunctionGroupResponse, type FunctionGroupXml, FunctionModule, type FunctionModuleResponse, type FunctionModuleXml, Include, type IncludeResponse, type IncludeXml, Interface, type InterfaceResponse, type InterfaceXml, type LockEntry, type LockHandle, type LockRegistry, type LockService, type LockStore, MergedTransportView, MessageClass, type NameTransform, type ObjectReference, Package, type PackageAttributes, type PackageResponse, type PackageType, type PackageXml, Program, type ProgramResponse, type ProgramXml, type RegisterObjectTypeOptions, type ReleaseResult, type ResolvedTransportObjects, type SaveOptions, type SoftwareComponent, Structure, Table, TableType, type TableTypeResponse, type TableTypeXml, type TableXml, type TransportConfig, type TransportCreateOptions, type TransportData, type TransportGetResponse, type TransportGetResponse as TransportResponse, type TransportLayer, type TransportObject, type TransportObjectData, type TransportObjectSelector, TransportRequest, type TransportRequestData, type TransportStatus, type TransportTask, type TransportTaskData, type TransportType, type TransportUpdateOptions, clearConfigCache, createAdk, createAdkContract, createAdkFactory, createLockService, getEndpointForType, getGlobalContext, getKindForType, getMainType, getObjectRootUri, getObjectUri, getRegisteredKinds, getRegisteredTypes, getTypeForKind, initializeAdk, isAdkInitialized, isTypeRegistered, matchesSelector, normalizeObjectName, parseAdtType, parseXmlIdentity, registerObjectType, resetAdk, resolveKind, resolveTransportObjects, resolveType, tryGetGlobalContext };
|
|
2899
|
+
//# sourceMappingURL=index.d.mts.map
|