@abapify/adk 0.4.33 → 0.4.36
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/README.md +19 -60
- package/dist/index.d.mts +1169 -1185
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +123 -88
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
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
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, SourceVersionRef, TableResponse, TableTypeResponse, TransportGetResponse } from "@abapify/adt-client";
|
|
3
3
|
import { BasicObjectPropertiesResponse } from "@abapify/adt-contracts";
|
|
4
|
+
/**
|
|
5
|
+
* ADK v2 - Base Types
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base interface for all ABAP objects
|
|
9
|
+
*/
|
|
10
|
+
interface AbapObject {
|
|
11
|
+
readonly kind: string;
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly package: string;
|
|
14
|
+
readonly description: string;
|
|
15
|
+
/**
|
|
16
|
+
* ADT object type (e.g., 'DEVC/K', 'CLAS/OC')
|
|
17
|
+
*/
|
|
18
|
+
readonly type: string;
|
|
19
|
+
}
|
|
4
20
|
/**
|
|
5
21
|
* Extract the abapClass variant from ClassResponse union
|
|
6
22
|
* ClassResponse = { abapClass: ... } | { abapClassInclude: ... }
|
|
@@ -120,652 +136,544 @@ interface AdkContext {
|
|
|
120
136
|
readonly lockService?: LockService$1;
|
|
121
137
|
}
|
|
122
138
|
/**
|
|
123
|
-
*
|
|
124
|
-
* - 'update': PUT to existing object (default, fails if doesn't exist)
|
|
125
|
-
* - 'create': POST to create new object (skips POST if already exists, then updates)
|
|
126
|
-
* - 'upsert': Try PUT first, fall back to POST if 404
|
|
127
|
-
*/
|
|
128
|
-
type SaveMode = 'update' | 'create' | 'upsert';
|
|
129
|
-
/**
|
|
130
|
-
* Options for save operations
|
|
131
|
-
*/
|
|
132
|
-
interface SaveOptions {
|
|
133
|
-
/** Transport request for the change */
|
|
134
|
-
transport?: string;
|
|
135
|
-
/** Save as inactive (default: false) */
|
|
136
|
-
inactive?: boolean;
|
|
137
|
-
/** Save mode: 'update' (default), 'create', or 'upsert' */
|
|
138
|
-
mode?: SaveMode;
|
|
139
|
-
/**
|
|
140
|
-
* Retry only the immediate post-create LOCK when a backend keeps its
|
|
141
|
-
* generated CTS/editor lock briefly after accepting the skeleton POST.
|
|
142
|
-
*/
|
|
143
|
-
postCreateLockRetry?: {
|
|
144
|
-
/** Total LOCK attempts, including the first one. */
|
|
145
|
-
attempts: number;
|
|
146
|
-
/** Delay between conflicting LOCK attempts in milliseconds. */
|
|
147
|
-
delayMs: number;
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
type InternalSaveOptions = SaveOptions & {
|
|
151
|
-
postCreate?: boolean;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* SAP accepted the skeleton POST, but rejected the immediate follow-up lock.
|
|
155
|
-
*
|
|
156
|
-
* The object therefore exists in SAP, while the source or metadata supplied
|
|
157
|
-
* to the original save call has not yet been persisted. Callers must retry
|
|
158
|
-
* the same object with `mode: 'update'` after the CTS/editor lock is cleared;
|
|
159
|
-
* repeating `mode: 'create'` risks an "already exists" response.
|
|
160
|
-
*/
|
|
161
|
-
declare class AdkPostCreateLockError extends Error {
|
|
162
|
-
readonly objectUri: string;
|
|
163
|
-
readonly transport: string | undefined;
|
|
164
|
-
readonly code: "ADT_POST_CREATE_LOCKED";
|
|
165
|
-
readonly name = "AdkPostCreateLockError";
|
|
166
|
-
constructor(objectUri: string, transport: string | undefined, cause: unknown);
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Result of bulk activation
|
|
170
|
-
*/
|
|
171
|
-
interface ActivationResult {
|
|
172
|
-
/** Number of successfully activated objects */
|
|
173
|
-
success: number;
|
|
174
|
-
/** Number of objects that failed activation */
|
|
175
|
-
failed: number;
|
|
176
|
-
/** Activation messages (errors, warnings) */
|
|
177
|
-
messages: string[];
|
|
178
|
-
/** Raw response from SAP (for debugging) */
|
|
179
|
-
response?: string;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Atom link (from atom:link element)
|
|
183
|
-
* Used for HATEOAS-style navigation in ADT responses
|
|
139
|
+
* Class category (class:category attribute)
|
|
184
140
|
*/
|
|
185
|
-
|
|
186
|
-
href: string;
|
|
187
|
-
rel?: string;
|
|
188
|
-
type?: string;
|
|
189
|
-
title?: string;
|
|
190
|
-
etag?: string;
|
|
191
|
-
}
|
|
141
|
+
type ClassCategory = 'generalObjectType' | 'exceptionClass' | 'testClass' | 'exitClass' | 'areaClass' | 'factoryClass' | 'persistentClass' | 'bspClass' | 'staticTypedLcpClass' | 'behaviorPool' | 'rfcProxyClass' | 'entityEventHandler' | 'communicationConnectionClass' | 'others';
|
|
192
142
|
/**
|
|
193
|
-
*
|
|
143
|
+
* Class include type (class:includeType attribute)
|
|
194
144
|
*/
|
|
195
|
-
|
|
196
|
-
uri?: string;
|
|
197
|
-
name?: string;
|
|
198
|
-
type?: string;
|
|
199
|
-
description?: string;
|
|
200
|
-
packageName?: string;
|
|
201
|
-
}
|
|
145
|
+
type ClassIncludeType = 'main' | 'definitions' | 'implementations' | 'macros' | 'testclasses' | 'localtypes';
|
|
202
146
|
/**
|
|
203
|
-
*
|
|
204
|
-
* Matches XSD AdtObject type attributes and elements
|
|
147
|
+
* Class visibility (class:visibility attribute)
|
|
205
148
|
*/
|
|
206
|
-
|
|
207
|
-
name: string;
|
|
208
|
-
type: string;
|
|
209
|
-
description?: string;
|
|
210
|
-
changedBy?: string;
|
|
211
|
-
changedAt?: string | Date;
|
|
212
|
-
createdBy?: string;
|
|
213
|
-
createdAt?: string | Date;
|
|
214
|
-
version?: string;
|
|
215
|
-
language?: string;
|
|
216
|
-
descriptionTextLimit?: number;
|
|
217
|
-
links?: AtomLink[];
|
|
218
|
-
containerRef?: AdtObjectReference;
|
|
219
|
-
}
|
|
149
|
+
type ClassVisibility = 'public' | 'protected' | 'private';
|
|
220
150
|
/**
|
|
221
|
-
*
|
|
222
|
-
* Matches XSD AdtMainObject type
|
|
151
|
+
* Class include section
|
|
223
152
|
*/
|
|
224
|
-
interface
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
153
|
+
interface ClassInclude {
|
|
154
|
+
readonly includeType: ClassIncludeType;
|
|
155
|
+
readonly sourceUri: string;
|
|
156
|
+
readonly name: string;
|
|
157
|
+
readonly type: string;
|
|
158
|
+
readonly version: string;
|
|
159
|
+
readonly changedAt: Date;
|
|
160
|
+
readonly createdAt: Date;
|
|
161
|
+
readonly changedBy: string;
|
|
162
|
+
readonly createdBy: string;
|
|
230
163
|
}
|
|
231
164
|
/**
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
* All ADK objects (AdkPackage, AdkTransportRequest, etc.) extend this.
|
|
235
|
-
* Supports deferred loading - create with just a name, then call load().
|
|
236
|
-
*
|
|
237
|
-
* Note: Uses loose type constraint for D to allow schema-inferred types
|
|
238
|
-
* from contracts which may have different shapes. The getters safely
|
|
239
|
-
* handle missing properties with defaults.
|
|
165
|
+
* ABAP Class interface
|
|
240
166
|
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
167
|
+
* Plugins work with this interface - implementation is internal.
|
|
168
|
+
* Mirrors ADT class:abapClass structure.
|
|
243
169
|
*/
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
170
|
+
interface AbapClass extends AbapObject {
|
|
171
|
+
readonly kind: 'Class';
|
|
172
|
+
readonly responsible: string;
|
|
173
|
+
readonly masterLanguage: string;
|
|
174
|
+
readonly language: string;
|
|
175
|
+
readonly version: string;
|
|
176
|
+
readonly createdAt: Date;
|
|
177
|
+
readonly createdBy: string;
|
|
178
|
+
readonly changedAt: Date;
|
|
179
|
+
readonly changedBy: string;
|
|
180
|
+
readonly category: ClassCategory;
|
|
181
|
+
readonly final: boolean;
|
|
182
|
+
readonly abstract: boolean;
|
|
183
|
+
readonly visibility: ClassVisibility;
|
|
184
|
+
readonly sharedMemoryEnabled: boolean;
|
|
185
|
+
readonly modeled: boolean;
|
|
186
|
+
readonly fixPointArithmetic: boolean;
|
|
187
|
+
readonly activeUnicodeCheck: boolean;
|
|
188
|
+
readonly superClassRef?: AdtObjectReference;
|
|
189
|
+
readonly messageClassRef?: AdtObjectReference;
|
|
190
|
+
readonly packageRef?: AdtObjectReference;
|
|
191
|
+
readonly includes: ClassInclude[];
|
|
247
192
|
/**
|
|
248
|
-
*
|
|
249
|
-
* Example: `/sap/bc/adt/oo/classes/zcl_my_class`
|
|
193
|
+
* Get main source code (global definitions + implementations)
|
|
250
194
|
*/
|
|
251
|
-
|
|
195
|
+
getMainSource(): Promise<string>;
|
|
252
196
|
/**
|
|
253
|
-
*
|
|
254
|
-
* Example: `/sap/bc/adt/oo/classes`
|
|
255
|
-
* Default: derived from objectUri by removing the object name
|
|
197
|
+
* Get source code for a specific include
|
|
256
198
|
*/
|
|
257
|
-
|
|
258
|
-
protected ctx: AdkContext;
|
|
259
|
-
/** Public access to the ADT client for plugins and external code */
|
|
260
|
-
get client(): AdtClient;
|
|
261
|
-
protected _data?: D;
|
|
262
|
-
protected _name: string;
|
|
263
|
-
protected cache: Map<string, unknown>;
|
|
264
|
-
protected dirty: Set<string>;
|
|
265
|
-
protected _lockHandle?: LockHandle$1;
|
|
266
|
-
/** Set by save() when all pending changes are identical to SAP state */
|
|
267
|
-
_unchanged: boolean;
|
|
199
|
+
getIncludeSource(includeType: ClassIncludeType): Promise<string>;
|
|
268
200
|
/**
|
|
269
|
-
*
|
|
270
|
-
* @param ctx - ADK context
|
|
271
|
-
* @param dataOrName - Full data object OR just the object name for deferred loading
|
|
201
|
+
* Get definitions include source
|
|
272
202
|
*/
|
|
273
|
-
|
|
203
|
+
getDefinitions(): Promise<string>;
|
|
274
204
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* Used by AdkObjectSet to propagate lockService / lockStore
|
|
278
|
-
* to objects created by plugins that only have { client }.
|
|
279
|
-
* Keeps the original client reference intact.
|
|
205
|
+
* Get implementations include source
|
|
280
206
|
*/
|
|
281
|
-
|
|
207
|
+
getImplementations(): Promise<string>;
|
|
282
208
|
/**
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
* Default implementation uses crudContract.get() and unwraps with wrapperKey.
|
|
286
|
-
* Objects without crudContract must override this.
|
|
287
|
-
*
|
|
288
|
-
* @returns this (for chaining)
|
|
209
|
+
* Get test classes source
|
|
289
210
|
*/
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
211
|
+
getTestClasses(): Promise<string>;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Class data type - imported from contract
|
|
215
|
+
*
|
|
216
|
+
* The schema wraps everything in an 'abapClass' element, so we unwrap it here
|
|
217
|
+
* to provide a flat structure for ADK consumers.
|
|
218
|
+
*/
|
|
219
|
+
type ClassXml = ClassResponse['abapClass'];
|
|
220
|
+
declare class AdkClass extends AdkMainObject<typeof Class, ClassXml> {
|
|
221
|
+
static readonly kind: "Class";
|
|
222
|
+
readonly kind: "Class";
|
|
223
|
+
get objectUri(): string;
|
|
224
|
+
getMainSource(): Promise<string>;
|
|
225
|
+
getIncludeSource(includeType: ClassIncludeType): Promise<string>;
|
|
226
|
+
getDefinitions(): Promise<string>;
|
|
227
|
+
getImplementations(): Promise<string>;
|
|
228
|
+
getTestClasses(): Promise<string>;
|
|
293
229
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
230
|
+
* Save main source code
|
|
231
|
+
* Requires object to be locked first
|
|
296
232
|
*/
|
|
297
|
-
|
|
233
|
+
saveMainSource(source: string, options?: {
|
|
234
|
+
lockHandle?: string;
|
|
235
|
+
transport?: string;
|
|
236
|
+
}): Promise<void>;
|
|
298
237
|
/**
|
|
299
|
-
*
|
|
300
|
-
*
|
|
238
|
+
* Save include source code
|
|
239
|
+
* Requires object to be locked first
|
|
301
240
|
*/
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
get name(): string;
|
|
309
|
-
/** ADT object type (adtcore:type, e.g. 'RQRQ', 'DEVC/K') - requires load() */
|
|
310
|
-
get type(): string;
|
|
311
|
-
/** Description text (adtcore:description) */
|
|
312
|
-
get description(): string;
|
|
313
|
-
/** Version state (adtcore:version) - active, inactive, etc. */
|
|
314
|
-
get version(): string;
|
|
315
|
-
/** Current language (adtcore:language) */
|
|
316
|
-
get language(): string;
|
|
317
|
-
/** User who last modified (adtcore:changedBy) */
|
|
318
|
-
get changedBy(): string;
|
|
319
|
-
/** Last modification timestamp (adtcore:changedAt) */
|
|
320
|
-
get changedAt(): Date;
|
|
321
|
-
/** User who created (adtcore:createdBy) */
|
|
322
|
-
get createdBy(): string;
|
|
323
|
-
/** Creation timestamp (adtcore:createdAt) */
|
|
324
|
-
get createdAt(): Date;
|
|
325
|
-
/** All atom:link elements */
|
|
326
|
-
get links(): AtomLink[];
|
|
327
|
-
/** Find link by rel attribute */
|
|
328
|
-
getLink(rel: string): AtomLink | undefined;
|
|
329
|
-
/** Get link href by rel, or undefined */
|
|
330
|
-
getLinkHref(rel: string): string | undefined;
|
|
331
|
-
/** Container reference (adtcore:containerRef) */
|
|
332
|
-
get containerRef(): AdtObjectReference | undefined;
|
|
333
|
-
/** Check if object is currently locked */
|
|
334
|
-
get isLocked(): boolean;
|
|
335
|
-
/** Get current lock handle */
|
|
336
|
-
get lockHandle(): LockHandle$1 | undefined;
|
|
241
|
+
saveIncludeSource(includeType: ClassIncludeType, source: string, options?: {
|
|
242
|
+
lockHandle?: string;
|
|
243
|
+
transport?: string;
|
|
244
|
+
}): Promise<void>;
|
|
245
|
+
/** Save one pending source entry (main source or an include). */
|
|
246
|
+
private savePendingEntry;
|
|
337
247
|
/**
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* The lock response contains:
|
|
343
|
-
* - LOCK_HANDLE: Required for subsequent PUT/unlock operations
|
|
344
|
-
* - CORRNR: Transport request assigned to this object (use for PUT if no explicit transport)
|
|
345
|
-
* - CORRUSER: User who owns the transport
|
|
248
|
+
* Save all pending sources (set via _pendingSources)
|
|
249
|
+
* Used by export workflow after deserialization from abapGit
|
|
250
|
+
* Overrides base class method
|
|
346
251
|
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
252
|
+
* Note: unchanged detection is handled by checkPendingSourcesUnchanged()
|
|
253
|
+
* which runs BEFORE lock acquisition. By the time we reach here,
|
|
254
|
+
* at least one source differs — save them all.
|
|
349
255
|
*/
|
|
350
|
-
|
|
256
|
+
protected savePendingSources(options?: {
|
|
257
|
+
lockHandle?: string;
|
|
258
|
+
transport?: string;
|
|
259
|
+
}): Promise<void>;
|
|
351
260
|
/**
|
|
352
|
-
*
|
|
353
|
-
*
|
|
354
|
-
* Delegates to the lock service (single lock mechanism).
|
|
261
|
+
* Pre-lock comparison: check if all pending sources match SAP
|
|
262
|
+
* If identical, sets _unchanged = true so save() skips locking and PUT
|
|
355
263
|
*/
|
|
356
|
-
|
|
264
|
+
protected checkPendingSourcesUnchanged(): Promise<void>;
|
|
357
265
|
/**
|
|
358
|
-
*
|
|
266
|
+
* Check if object has pending sources to save
|
|
267
|
+
* Overrides base class method
|
|
359
268
|
*/
|
|
360
|
-
protected
|
|
269
|
+
protected hasPendingSources(): boolean;
|
|
361
270
|
/**
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
* Generic implementation that handles:
|
|
365
|
-
* - Lock/unlock lifecycle
|
|
366
|
-
* - Mode switching (create/update/upsert)
|
|
367
|
-
* - Error handling
|
|
368
|
-
*
|
|
369
|
-
* Subclasses implement `saveViaContract()` to provide the typed contract call.
|
|
370
|
-
*
|
|
371
|
-
* Modes:
|
|
372
|
-
* - 'update' (default): PUT to existing object
|
|
373
|
-
* - 'create': POST skeleton, then lock → PUT/source → unlock (Eclipse ADT pattern)
|
|
374
|
-
* - 'upsert': Check existence, create if needed, then update
|
|
375
|
-
*
|
|
376
|
-
* @param options - Save options
|
|
377
|
-
* @returns this (for chaining)
|
|
271
|
+
* Refresh cached ETags for all pending source endpoints after locking.
|
|
272
|
+
* Classes have multiple source URLs (main + includes) that all need fresh ETags.
|
|
378
273
|
*/
|
|
379
|
-
|
|
274
|
+
protected refreshETagsAfterLock(): Promise<void>;
|
|
275
|
+
protected get wrapperKey(): string;
|
|
276
|
+
protected get crudContract(): any;
|
|
277
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkClass>;
|
|
380
278
|
/**
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
* Contracts wrap data like { abapClass: ... } or { abapInterface: ... }.
|
|
384
|
-
* Subclasses that support save override this.
|
|
279
|
+
* Check if a class exists on SAP
|
|
385
280
|
*/
|
|
386
|
-
|
|
281
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
387
282
|
/**
|
|
388
|
-
*
|
|
283
|
+
* Create a new ABAP class on SAP
|
|
389
284
|
*
|
|
390
|
-
*
|
|
285
|
+
* @param name - Class name (e.g., 'ZCL_MY_CLASS')
|
|
286
|
+
* @param description - Short description
|
|
287
|
+
* @param packageName - Package to assign the class to
|
|
288
|
+
* @param options - Save options (transport)
|
|
289
|
+
* @param ctx - Optional ADK context
|
|
391
290
|
*/
|
|
392
|
-
|
|
291
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
292
|
+
transport?: string;
|
|
293
|
+
}, ctx?: AdkContext): Promise<AdkClass>;
|
|
393
294
|
/**
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
* Generic implementation using wrapperKey and crudContract.
|
|
397
|
-
* Objects that don't support save leave wrapperKey/crudContract undefined.
|
|
398
|
-
*
|
|
399
|
-
* For 'create' mode: POSTs skeleton data (minimal fields).
|
|
400
|
-
* For 'update' mode: PUTs full data (all fields except abapLanguageVersion).
|
|
295
|
+
* Delete an ABAP class from SAP
|
|
401
296
|
*
|
|
402
|
-
* @param
|
|
403
|
-
* @param options -
|
|
297
|
+
* @param name - Class name
|
|
298
|
+
* @param options - Delete options (transport)
|
|
299
|
+
* @param ctx - Optional ADK context
|
|
404
300
|
*/
|
|
405
|
-
|
|
301
|
+
static delete(name: string, options?: {
|
|
406
302
|
transport?: string;
|
|
407
303
|
lockHandle?: string;
|
|
408
|
-
}): Promise<void>;
|
|
304
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Interface data type - imported from contract
|
|
308
|
+
*
|
|
309
|
+
* The schema wraps everything in an 'abapInterface' element, so we unwrap it here
|
|
310
|
+
* to provide a flat structure for ADK consumers.
|
|
311
|
+
*/
|
|
312
|
+
type InterfaceXml = InterfaceResponse['abapInterface'];
|
|
313
|
+
/**
|
|
314
|
+
* ADK Interface object
|
|
315
|
+
*
|
|
316
|
+
* Inherits from AdkMainObject which provides:
|
|
317
|
+
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
318
|
+
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
319
|
+
*
|
|
320
|
+
* Access interface-specific properties via `data`:
|
|
321
|
+
* - data.modeled, data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck
|
|
322
|
+
*/
|
|
323
|
+
declare class AdkInterface extends AdkMainObject<typeof Interface, InterfaceXml> {
|
|
324
|
+
static readonly kind: "Interface";
|
|
325
|
+
readonly kind: "Interface";
|
|
326
|
+
get objectUri(): string;
|
|
327
|
+
getSource(): Promise<string>;
|
|
328
|
+
protected get wrapperKey(): string;
|
|
329
|
+
protected get crudContract(): any;
|
|
330
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkInterface>;
|
|
409
331
|
/**
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
* Returns only the minimal fields needed to create the object on SAP.
|
|
413
|
-
* SAP creates the object structure (includes, etc.) from these fields.
|
|
414
|
-
* Full metadata and source code are sent via PUT in the update step.
|
|
415
|
-
*
|
|
416
|
-
* Override in subclasses that need different skeleton fields.
|
|
332
|
+
* Check if an interface exists on SAP
|
|
417
333
|
*/
|
|
418
|
-
|
|
334
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
419
335
|
/**
|
|
420
|
-
*
|
|
336
|
+
* Create a new ABAP interface on SAP
|
|
421
337
|
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
338
|
+
* @param name - Interface name (e.g., 'ZIF_MY_INTERFACE')
|
|
339
|
+
* @param description - Short description
|
|
340
|
+
* @param packageName - Package to assign the interface to
|
|
341
|
+
* @param options - Save options (transport)
|
|
342
|
+
* @param ctx - Optional ADK context
|
|
426
343
|
*/
|
|
427
|
-
|
|
344
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
345
|
+
transport?: string;
|
|
346
|
+
}, ctx?: AdkContext): Promise<AdkInterface>;
|
|
428
347
|
/**
|
|
429
|
-
*
|
|
348
|
+
* Delete an ABAP interface from SAP
|
|
349
|
+
*
|
|
350
|
+
* @param name - Interface name
|
|
351
|
+
* @param options - Delete options (transport)
|
|
352
|
+
* @param ctx - Optional ADK context
|
|
430
353
|
*/
|
|
431
|
-
|
|
354
|
+
static delete(name: string, options?: {
|
|
355
|
+
transport?: string;
|
|
356
|
+
lockHandle?: string;
|
|
357
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Package type (pak:packageType attribute)
|
|
361
|
+
*/
|
|
362
|
+
type PackageType = 'development' | 'structure' | 'main';
|
|
363
|
+
/**
|
|
364
|
+
* Reference to another object (used for superPackage, etc.)
|
|
365
|
+
* Re-exported for backward compatibility
|
|
366
|
+
*/
|
|
367
|
+
type ObjectReference = AdtObjectReference;
|
|
368
|
+
/**
|
|
369
|
+
* Package attributes (pak:attributes element)
|
|
370
|
+
*/
|
|
371
|
+
interface PackageAttributes {
|
|
372
|
+
readonly packageType: PackageType;
|
|
373
|
+
readonly isEncapsulated: boolean;
|
|
374
|
+
readonly isAddingObjectsAllowed: boolean;
|
|
375
|
+
readonly recordChanges: boolean;
|
|
376
|
+
readonly languageVersion: string;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Application component info
|
|
380
|
+
*/
|
|
381
|
+
interface ApplicationComponent {
|
|
382
|
+
readonly name: string;
|
|
383
|
+
readonly description: string;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Software component info
|
|
387
|
+
*/
|
|
388
|
+
interface SoftwareComponent {
|
|
389
|
+
readonly name: string;
|
|
390
|
+
readonly description: string;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Transport layer info
|
|
394
|
+
*/
|
|
395
|
+
interface TransportLayer {
|
|
396
|
+
readonly name: string;
|
|
397
|
+
readonly description: string;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Transport configuration
|
|
401
|
+
*/
|
|
402
|
+
interface TransportConfig {
|
|
403
|
+
readonly softwareComponent?: SoftwareComponent;
|
|
404
|
+
readonly transportLayer?: TransportLayer;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* ABAP Package interface
|
|
408
|
+
*
|
|
409
|
+
* Plugins work with this interface - implementation is internal.
|
|
410
|
+
* Mirrors ADT pak:package structure.
|
|
411
|
+
*/
|
|
412
|
+
interface AbapPackage extends AbapObject {
|
|
413
|
+
readonly kind: 'Package';
|
|
414
|
+
readonly responsible: string;
|
|
415
|
+
readonly masterLanguage: string;
|
|
416
|
+
readonly language: string;
|
|
417
|
+
readonly version: string;
|
|
418
|
+
readonly createdAt: Date;
|
|
419
|
+
readonly createdBy: string;
|
|
420
|
+
readonly changedAt: Date;
|
|
421
|
+
readonly changedBy: string;
|
|
422
|
+
readonly attributes: PackageAttributes;
|
|
423
|
+
readonly superPackage?: AdtObjectReference;
|
|
424
|
+
readonly applicationComponent?: ApplicationComponent;
|
|
425
|
+
readonly transport?: TransportConfig;
|
|
432
426
|
/**
|
|
433
|
-
*
|
|
434
|
-
* long enough for the immediate follow-up LOCK to fail. This is distinct
|
|
435
|
-
* from an arbitrary edit conflict because this save invocation already
|
|
436
|
-
* created the skeleton successfully.
|
|
427
|
+
* Get direct subpackages
|
|
437
428
|
*/
|
|
438
|
-
|
|
429
|
+
getSubpackages(): Promise<AbapPackage[]>;
|
|
439
430
|
/**
|
|
440
|
-
*
|
|
441
|
-
* a short time. Retry only this known follow-up LOCK; no arbitrary update or
|
|
442
|
-
* source write is repeated, and each successful lock still uses the normal
|
|
443
|
-
* handle-backed save/unlock lifecycle.
|
|
431
|
+
* Get objects contained in this package (direct, not recursive)
|
|
444
432
|
*/
|
|
445
|
-
|
|
433
|
+
getObjects(): Promise<AbapObject[]>;
|
|
446
434
|
/**
|
|
447
|
-
*
|
|
448
|
-
* Extracted to avoid duplication in lock-catch and saveViaContract-catch paths.
|
|
435
|
+
* Get all objects recursively (includes subpackages)
|
|
449
436
|
*/
|
|
450
|
-
|
|
437
|
+
getAllObjects(): Promise<AbapObject[]>;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Package data type - inferred from packagesContract response
|
|
441
|
+
*
|
|
442
|
+
* The schema wraps everything in a 'package' element, so we unwrap it here
|
|
443
|
+
* to provide a flat structure for ADK consumers.
|
|
444
|
+
*/
|
|
445
|
+
type PackageXml = NonNullable<PackageResponse['package']>;
|
|
446
|
+
/**
|
|
447
|
+
* ADK Package object
|
|
448
|
+
*
|
|
449
|
+
* Inherits from AdkMainObject which provides:
|
|
450
|
+
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
451
|
+
* - AdkMainObject: packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
452
|
+
*
|
|
453
|
+
* Note: For packages, the parent package is stored in `superPackage` not `packageRef`.
|
|
454
|
+
* The `package` getter is overridden to return the super package name.
|
|
455
|
+
*/
|
|
456
|
+
declare class AdkPackage extends AdkMainObject<typeof Package, PackageXml> implements AbapPackage {
|
|
457
|
+
static readonly kind: "Package";
|
|
458
|
+
readonly kind: "Package";
|
|
459
|
+
get objectUri(): string;
|
|
460
|
+
get package(): string;
|
|
461
|
+
get attributes(): PackageAttributes;
|
|
462
|
+
get superPackage(): ObjectReference | undefined;
|
|
463
|
+
get applicationComponent(): ApplicationComponent | undefined;
|
|
464
|
+
get transport(): TransportConfig | undefined;
|
|
465
|
+
getSubpackages(): Promise<AbapPackage[]>;
|
|
466
|
+
getObjects(): Promise<AbapObject[]>;
|
|
467
|
+
getAllObjects(): Promise<AbapObject[]>;
|
|
468
|
+
load(): Promise<this>;
|
|
469
|
+
protected get wrapperKey(): "package";
|
|
470
|
+
protected get crudContract(): any;
|
|
451
471
|
/**
|
|
452
|
-
*
|
|
453
|
-
* is not supported for the current state.
|
|
472
|
+
* Get skeleton data for package creation (POST).
|
|
454
473
|
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Check if error is a 422 "already exists" from a POST create attempt
|
|
462
|
-
*/
|
|
463
|
-
protected isAlreadyExistsError(e: unknown): boolean;
|
|
464
|
-
/**
|
|
465
|
-
* Check if object has pending sources to save
|
|
466
|
-
* Subclasses with source code (classes, interfaces) override this
|
|
467
|
-
*/
|
|
468
|
-
protected hasPendingSources(): boolean;
|
|
469
|
-
/**
|
|
470
|
-
* Normalize source code for comparison.
|
|
471
|
-
* Trims trailing whitespace/newlines so minor formatting differences
|
|
472
|
-
* don't trigger unnecessary saves.
|
|
474
|
+
* SAP requires ALL elements in the Package xs:sequence, even if empty.
|
|
475
|
+
* The sequence order is: attributes, superPackage, extensionAlias, switch,
|
|
476
|
+
* applicationComponent, transport, translation, useAccesses,
|
|
477
|
+
* packageInterfaces, subPackages.
|
|
478
|
+
* Missing elements cause "System expected the element ..." 400 errors.
|
|
473
479
|
*/
|
|
474
|
-
protected
|
|
480
|
+
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
475
481
|
/**
|
|
476
|
-
*
|
|
477
|
-
* Sets _unchanged = true if nothing needs saving.
|
|
482
|
+
* Get a package by name
|
|
478
483
|
*
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
* AdkClass overrides this for multi-include logic.
|
|
484
|
+
* @param name - Package name (e.g., '$TMP', 'ZPACKAGE')
|
|
485
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
482
486
|
*/
|
|
483
|
-
|
|
487
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkPackage>;
|
|
484
488
|
/**
|
|
485
|
-
* Check if
|
|
489
|
+
* Check if a package exists on SAP
|
|
486
490
|
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
* version, etc.) that are ignored — only semantic fields matter.
|
|
491
|
+
* @param name - Package name
|
|
492
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
493
|
+
* @returns true if package exists, false otherwise
|
|
491
494
|
*/
|
|
492
|
-
|
|
495
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
493
496
|
/**
|
|
494
|
-
*
|
|
495
|
-
*
|
|
496
|
-
* SAP changes the object's internal version when a lock is acquired,
|
|
497
|
-
* which invalidates any cached ETags. Without refreshing, the next
|
|
498
|
-
* PUT sends a stale If-Match header and SAP returns HTTP 412.
|
|
497
|
+
* Create a new package on SAP
|
|
499
498
|
*
|
|
500
|
-
*
|
|
501
|
-
* For metadata-only objects: re-GET via crudContract.get()
|
|
499
|
+
* Builds an AdkPackage with the given data and saves it in 'create' mode.
|
|
502
500
|
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
501
|
+
* @param name - Package name (e.g., 'ZABAPGIT_EXAMPLES_CLAS')
|
|
502
|
+
* @param data - Package data (superPackage, attributes, transport, etc.)
|
|
503
|
+
* @param options - Save options (transport request)
|
|
504
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
505
505
|
*/
|
|
506
|
-
|
|
506
|
+
static create(name: string, data: Partial<PackageXml>, options?: {
|
|
507
|
+
transport?: string;
|
|
508
|
+
}, ctx?: AdkContext): Promise<AdkPackage>;
|
|
507
509
|
/**
|
|
508
|
-
*
|
|
510
|
+
* Delete an ABAP package from SAP
|
|
509
511
|
*
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
512
|
+
* @param name - Package name
|
|
513
|
+
* @param options - Delete options (transport, lockHandle)
|
|
514
|
+
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
513
515
|
*/
|
|
514
|
-
|
|
515
|
-
lockHandle?: string;
|
|
516
|
+
static delete(name: string, options?: {
|
|
516
517
|
transport?: string;
|
|
517
|
-
|
|
518
|
+
lockHandle?: string;
|
|
519
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Program data type - unwrap from root element
|
|
523
|
+
*
|
|
524
|
+
* The schema wraps everything in an 'abapProgram' element, so we unwrap it here
|
|
525
|
+
* to provide a flat structure for ADK consumers.
|
|
526
|
+
*/
|
|
527
|
+
type ProgramXml = ProgramResponse['abapProgram'];
|
|
528
|
+
/**
|
|
529
|
+
* ADK Program object
|
|
530
|
+
*
|
|
531
|
+
* Inherits from AdkMainObject which provides:
|
|
532
|
+
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
533
|
+
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
534
|
+
*
|
|
535
|
+
* Access program-specific properties via `data`:
|
|
536
|
+
* - data.programType, data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck
|
|
537
|
+
*/
|
|
538
|
+
declare class AdkProgram extends AdkMainObject<typeof Program, ProgramXml> {
|
|
539
|
+
static readonly kind: "Program";
|
|
540
|
+
readonly kind: "Program";
|
|
541
|
+
get objectUri(): string;
|
|
542
|
+
getSource(): Promise<string>;
|
|
543
|
+
protected get wrapperKey(): string;
|
|
544
|
+
protected get crudContract(): any;
|
|
545
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkProgram>;
|
|
518
546
|
/**
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
* Generic implementation for objects with source code (classes, includes, etc.)
|
|
522
|
-
* Subclasses should override if they need custom source handling.
|
|
523
|
-
*
|
|
524
|
-
* @param sourcePath - Relative path to source (e.g., '/source/main')
|
|
525
|
-
* @param content - Source code content
|
|
526
|
-
* @param options - Save options
|
|
547
|
+
* Check if a program exists on SAP
|
|
527
548
|
*/
|
|
528
|
-
|
|
549
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
529
550
|
/**
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
* Activates a single object. For bulk activation of multiple objects,
|
|
533
|
-
* use `AdkObjectSet.activateAll()`.
|
|
551
|
+
* Create a new ABAP program on SAP
|
|
534
552
|
*
|
|
535
|
-
* @
|
|
553
|
+
* @param name - Program name (e.g., 'ZMYPROGRAM')
|
|
554
|
+
* @param description - Short description
|
|
555
|
+
* @param packageName - Package to assign the program to
|
|
556
|
+
* @param options - Save options (transport)
|
|
557
|
+
* @param ctx - Optional ADK context
|
|
536
558
|
*/
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
/** Lazy compute a segment (sync) - computes only once, then cached */
|
|
541
|
-
protected cached<T>(key: string, compute: () => T): T;
|
|
542
|
-
/** Set a cached value directly (for local/generated data) */
|
|
543
|
-
protected set<T>(key: string, value: T): void;
|
|
544
|
-
/** Mark a segment as dirty (modified locally) */
|
|
545
|
-
protected markDirty(key: string): void;
|
|
546
|
-
/** Check if any segment (or specific segment) is dirty */
|
|
547
|
-
isDirty(segment?: string): boolean;
|
|
548
|
-
/** Clear cache for a segment (force reload on next access) */
|
|
549
|
-
protected invalidate(key: string): void;
|
|
559
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
560
|
+
transport?: string;
|
|
561
|
+
}, ctx?: AdkContext): Promise<AdkProgram>;
|
|
550
562
|
/**
|
|
551
|
-
*
|
|
552
|
-
* Delegates to the underlying ADT client's fetch.
|
|
563
|
+
* Delete an ABAP program from SAP
|
|
553
564
|
*
|
|
554
|
-
* @param
|
|
555
|
-
* @param
|
|
556
|
-
* @
|
|
565
|
+
* @param name - Program name
|
|
566
|
+
* @param options - Delete options (transport)
|
|
567
|
+
* @param ctx - Optional ADK context
|
|
557
568
|
*/
|
|
558
|
-
|
|
569
|
+
static delete(name: string, options?: {
|
|
570
|
+
transport?: string;
|
|
571
|
+
lockHandle?: string;
|
|
572
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
559
573
|
}
|
|
560
574
|
/**
|
|
561
|
-
*
|
|
575
|
+
* Include data type - unwrap from root element.
|
|
562
576
|
*
|
|
563
|
-
*
|
|
564
|
-
*
|
|
577
|
+
* The schema wraps everything in an 'abapInclude' element, so we unwrap
|
|
578
|
+
* it here to provide a flat structure for ADK consumers.
|
|
579
|
+
*/
|
|
580
|
+
type IncludeXml = IncludeResponse['abapInclude'];
|
|
581
|
+
/**
|
|
582
|
+
* ADK Include object
|
|
565
583
|
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
*
|
|
584
|
+
* Inherits from AdkMainObject which provides:
|
|
585
|
+
* - AdkObject: name, type, description, version, language, changedBy/At,
|
|
586
|
+
* createdBy/At, links
|
|
587
|
+
* - AdkMainObject: package, packageRef, responsible, masterLanguage,
|
|
588
|
+
* masterSystem, abapLanguageVersion
|
|
569
589
|
*
|
|
570
|
-
*
|
|
571
|
-
*
|
|
590
|
+
* Access include-specific properties via `data`:
|
|
591
|
+
* - data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck,
|
|
592
|
+
* data.contextRef (pointer to the main program)
|
|
572
593
|
*/
|
|
573
|
-
declare
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
get
|
|
577
|
-
|
|
578
|
-
get
|
|
579
|
-
|
|
580
|
-
get masterSystem(): string;
|
|
581
|
-
/** Master language (adtcore:masterLanguage) */
|
|
582
|
-
get masterLanguage(): string;
|
|
583
|
-
/** Responsible user (adtcore:responsible) */
|
|
584
|
-
get responsible(): string;
|
|
585
|
-
/** ABAP language version (adtcore:abapLanguageVersion) */
|
|
586
|
-
get abapLanguageVersion(): string;
|
|
594
|
+
declare class AdkInclude extends AdkMainObject<typeof Include, IncludeXml> {
|
|
595
|
+
static readonly kind: "Include";
|
|
596
|
+
readonly kind: "Include";
|
|
597
|
+
get objectUri(): string;
|
|
598
|
+
getSource(): Promise<string>;
|
|
599
|
+
protected get wrapperKey(): string;
|
|
600
|
+
protected get crudContract(): any;
|
|
587
601
|
/**
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
transport?: string;
|
|
595
|
-
}): Promise<void>;
|
|
596
|
-
}
|
|
597
|
-
/**
|
|
598
|
-
* Class category (class:category attribute)
|
|
599
|
-
*/
|
|
600
|
-
type ClassCategory = 'generalObjectType' | 'exceptionClass' | 'testClass' | 'exitClass' | 'areaClass' | 'factoryClass' | 'persistentClass' | 'bspClass' | 'staticTypedLcpClass' | 'behaviorPool' | 'rfcProxyClass' | 'entityEventHandler' | 'communicationConnectionClass' | 'others';
|
|
601
|
-
/**
|
|
602
|
-
* Class include type (class:includeType attribute)
|
|
603
|
-
*/
|
|
604
|
-
type ClassIncludeType = 'main' | 'definitions' | 'implementations' | 'macros' | 'testclasses' | 'localtypes';
|
|
605
|
-
/**
|
|
606
|
-
* Class visibility (class:visibility attribute)
|
|
607
|
-
*/
|
|
608
|
-
type ClassVisibility = 'public' | 'protected' | 'private';
|
|
609
|
-
/**
|
|
610
|
-
* Class include section
|
|
611
|
-
*/
|
|
612
|
-
interface ClassInclude {
|
|
613
|
-
readonly includeType: ClassIncludeType;
|
|
614
|
-
readonly sourceUri: string;
|
|
615
|
-
readonly name: string;
|
|
616
|
-
readonly type: string;
|
|
617
|
-
readonly version: string;
|
|
618
|
-
readonly changedAt: Date;
|
|
619
|
-
readonly createdAt: Date;
|
|
620
|
-
readonly changedBy: string;
|
|
621
|
-
readonly createdBy: string;
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* ABAP Class interface
|
|
625
|
-
*
|
|
626
|
-
* Plugins work with this interface - implementation is internal.
|
|
627
|
-
* Mirrors ADT class:abapClass structure.
|
|
628
|
-
*/
|
|
629
|
-
interface AbapClass extends AbapObject {
|
|
630
|
-
readonly kind: 'Class';
|
|
631
|
-
readonly responsible: string;
|
|
632
|
-
readonly masterLanguage: string;
|
|
633
|
-
readonly language: string;
|
|
634
|
-
readonly version: string;
|
|
635
|
-
readonly createdAt: Date;
|
|
636
|
-
readonly createdBy: string;
|
|
637
|
-
readonly changedAt: Date;
|
|
638
|
-
readonly changedBy: string;
|
|
639
|
-
readonly category: ClassCategory;
|
|
640
|
-
readonly final: boolean;
|
|
641
|
-
readonly abstract: boolean;
|
|
642
|
-
readonly visibility: ClassVisibility;
|
|
643
|
-
readonly sharedMemoryEnabled: boolean;
|
|
644
|
-
readonly modeled: boolean;
|
|
645
|
-
readonly fixPointArithmetic: boolean;
|
|
646
|
-
readonly activeUnicodeCheck: boolean;
|
|
647
|
-
readonly superClassRef?: AdtObjectReference;
|
|
648
|
-
readonly messageClassRef?: AdtObjectReference;
|
|
649
|
-
readonly packageRef?: AdtObjectReference;
|
|
650
|
-
readonly includes: ClassInclude[];
|
|
651
|
-
/**
|
|
652
|
-
* Get main source code (global definitions + implementations)
|
|
653
|
-
*/
|
|
654
|
-
getMainSource(): Promise<string>;
|
|
655
|
-
/**
|
|
656
|
-
* Get source code for a specific include
|
|
602
|
+
* Skeleton POST data for includes.
|
|
603
|
+
*
|
|
604
|
+
* Extends the base skeleton (name/type/description/packageRef) with
|
|
605
|
+
* `contextRef`, which sapcli's `sap.adt.Include(..., master=...)` serializes
|
|
606
|
+
* at creation time. Without this the include would be created detached
|
|
607
|
+
* from its main program.
|
|
657
608
|
*/
|
|
658
|
-
|
|
609
|
+
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
610
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkInclude>;
|
|
659
611
|
/**
|
|
660
|
-
*
|
|
612
|
+
* Check if an include exists on SAP
|
|
661
613
|
*/
|
|
662
|
-
|
|
614
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
663
615
|
/**
|
|
664
|
-
*
|
|
616
|
+
* Create a new ABAP include on SAP
|
|
617
|
+
*
|
|
618
|
+
* @param name - Include name (e.g., 'ZMY_INCLUDE')
|
|
619
|
+
* @param description - Short description
|
|
620
|
+
* @param packageName - Package to assign the include to
|
|
621
|
+
* @param options - Save options (transport, master program)
|
|
622
|
+
* @param ctx - Optional ADK context
|
|
665
623
|
*/
|
|
666
|
-
|
|
624
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
625
|
+
transport?: string;
|
|
626
|
+
master?: string;
|
|
627
|
+
}, ctx?: AdkContext): Promise<AdkInclude>;
|
|
667
628
|
/**
|
|
668
|
-
*
|
|
629
|
+
* Delete an ABAP include from SAP
|
|
630
|
+
*
|
|
631
|
+
* @param name - Include name
|
|
632
|
+
* @param options - Delete options (transport, lockHandle)
|
|
633
|
+
* @param ctx - Optional ADK context
|
|
669
634
|
*/
|
|
670
|
-
|
|
635
|
+
static delete(name: string, options?: {
|
|
636
|
+
transport?: string;
|
|
637
|
+
lockHandle?: string;
|
|
638
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
671
639
|
}
|
|
672
640
|
/**
|
|
673
|
-
*
|
|
641
|
+
* Function group data type - unwrap from root element
|
|
674
642
|
*
|
|
675
|
-
* The schema wraps everything in an '
|
|
643
|
+
* The schema wraps everything in an 'abapFunctionGroup' element, so we unwrap it here
|
|
676
644
|
* to provide a flat structure for ADK consumers.
|
|
677
645
|
*/
|
|
678
|
-
type
|
|
646
|
+
type FunctionGroupXml = FunctionGroupResponse['abapFunctionGroup'];
|
|
679
647
|
/**
|
|
680
|
-
* ADK
|
|
648
|
+
* ADK Function Group object
|
|
681
649
|
*
|
|
682
650
|
* Inherits from AdkMainObject which provides:
|
|
683
651
|
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
684
652
|
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
685
653
|
*
|
|
686
|
-
* Access
|
|
687
|
-
* - data.
|
|
688
|
-
* - data.sharedMemoryEnabled, data.modeled, data.fixPointArithmetic
|
|
689
|
-
* - data.superClassRef, data.messageClassRef, data.include
|
|
654
|
+
* Access function group-specific properties via `data`:
|
|
655
|
+
* - data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck
|
|
690
656
|
*/
|
|
691
|
-
declare class
|
|
692
|
-
static readonly kind: "
|
|
693
|
-
readonly kind: "
|
|
657
|
+
declare class AdkFunctionGroup extends AdkMainObject<typeof FunctionGroup, FunctionGroupXml> {
|
|
658
|
+
static readonly kind: "FunctionGroup";
|
|
659
|
+
readonly kind: "FunctionGroup";
|
|
694
660
|
get objectUri(): string;
|
|
695
|
-
|
|
696
|
-
getIncludeSource(includeType: ClassIncludeType): Promise<string>;
|
|
697
|
-
getDefinitions(): Promise<string>;
|
|
698
|
-
getImplementations(): Promise<string>;
|
|
699
|
-
getTestClasses(): Promise<string>;
|
|
700
|
-
/**
|
|
701
|
-
* Save main source code
|
|
702
|
-
* Requires object to be locked first
|
|
703
|
-
*/
|
|
704
|
-
saveMainSource(source: string, options?: {
|
|
705
|
-
lockHandle?: string;
|
|
706
|
-
transport?: string;
|
|
707
|
-
}): Promise<void>;
|
|
708
|
-
/**
|
|
709
|
-
* Save include source code
|
|
710
|
-
* Requires object to be locked first
|
|
711
|
-
*/
|
|
712
|
-
saveIncludeSource(includeType: ClassIncludeType, source: string, options?: {
|
|
713
|
-
lockHandle?: string;
|
|
714
|
-
transport?: string;
|
|
715
|
-
}): Promise<void>;
|
|
716
|
-
/**
|
|
717
|
-
* Save all pending sources (set via _pendingSources)
|
|
718
|
-
* Used by export workflow after deserialization from abapGit
|
|
719
|
-
* Overrides base class method
|
|
720
|
-
*
|
|
721
|
-
* Note: unchanged detection is handled by checkPendingSourcesUnchanged()
|
|
722
|
-
* which runs BEFORE lock acquisition. By the time we reach here,
|
|
723
|
-
* at least one source differs — save them all.
|
|
724
|
-
*/
|
|
725
|
-
protected savePendingSources(options?: {
|
|
726
|
-
lockHandle?: string;
|
|
727
|
-
transport?: string;
|
|
728
|
-
}): Promise<void>;
|
|
729
|
-
/**
|
|
730
|
-
* Pre-lock comparison: check if all pending sources match SAP
|
|
731
|
-
* If identical, sets _unchanged = true so save() skips locking and PUT
|
|
732
|
-
*/
|
|
733
|
-
protected checkPendingSourcesUnchanged(): Promise<void>;
|
|
734
|
-
/**
|
|
735
|
-
* Check if object has pending sources to save
|
|
736
|
-
* Overrides base class method
|
|
737
|
-
*/
|
|
738
|
-
protected hasPendingSources(): boolean;
|
|
739
|
-
/**
|
|
740
|
-
* Refresh cached ETags for all pending source endpoints after locking.
|
|
741
|
-
* Classes have multiple source URLs (main + includes) that all need fresh ETags.
|
|
742
|
-
*/
|
|
743
|
-
protected refreshETagsAfterLock(): Promise<void>;
|
|
661
|
+
getSource(): Promise<string>;
|
|
744
662
|
protected get wrapperKey(): string;
|
|
745
663
|
protected get crudContract(): any;
|
|
746
|
-
static get(name: string, ctx?: AdkContext): Promise<
|
|
664
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkFunctionGroup>;
|
|
747
665
|
/**
|
|
748
|
-
* Check if a
|
|
666
|
+
* Check if a function group exists on SAP
|
|
749
667
|
*/
|
|
750
668
|
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
751
669
|
/**
|
|
752
|
-
* Create a new ABAP
|
|
753
|
-
*
|
|
754
|
-
* @param name - Class name (e.g., 'ZCL_MY_CLASS')
|
|
755
|
-
* @param description - Short description
|
|
756
|
-
* @param packageName - Package to assign the class to
|
|
757
|
-
* @param options - Save options (transport)
|
|
758
|
-
* @param ctx - Optional ADK context
|
|
670
|
+
* Create a new ABAP function group on SAP
|
|
759
671
|
*/
|
|
760
672
|
static create(name: string, description: string, packageName: string, options?: {
|
|
761
673
|
transport?: string;
|
|
762
|
-
}, ctx?: AdkContext): Promise<
|
|
674
|
+
}, ctx?: AdkContext): Promise<AdkFunctionGroup>;
|
|
763
675
|
/**
|
|
764
|
-
* Delete an ABAP
|
|
765
|
-
*
|
|
766
|
-
* @param name - Class name
|
|
767
|
-
* @param options - Delete options (transport)
|
|
768
|
-
* @param ctx - Optional ADK context
|
|
676
|
+
* Delete an ABAP function group from SAP
|
|
769
677
|
*/
|
|
770
678
|
static delete(name: string, options?: {
|
|
771
679
|
transport?: string;
|
|
@@ -773,543 +681,154 @@ declare class AdkClass extends AdkMainObject<typeof Class, ClassXml> {
|
|
|
773
681
|
}, ctx?: AdkContext): Promise<void>;
|
|
774
682
|
}
|
|
775
683
|
/**
|
|
776
|
-
*
|
|
684
|
+
* Function module data type - unwrap from root element
|
|
777
685
|
*
|
|
778
|
-
* The schema wraps everything in an '
|
|
686
|
+
* The schema wraps everything in an 'abapFunctionModule' element, so we unwrap it here
|
|
779
687
|
* to provide a flat structure for ADK consumers.
|
|
780
688
|
*/
|
|
781
|
-
type
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
689
|
+
type FunctionModuleXml = FunctionModuleResponse['abapFunctionModule'];
|
|
690
|
+
declare class AdkFunctionModule extends AdkObject<typeof FunctionModule, FunctionModuleXml> {
|
|
691
|
+
static readonly kind: "FunctionModule";
|
|
692
|
+
readonly kind: "FunctionModule";
|
|
693
|
+
/** Parent function group name */
|
|
694
|
+
groupName: string;
|
|
695
|
+
/**
|
|
696
|
+
* Constructor supports two calling patterns:
|
|
697
|
+
*
|
|
698
|
+
* 1. Direct (3-arg): `new AdkFunctionModule(ctx, groupName, nameOrData)`
|
|
699
|
+
* Used by static factory method and when group name is known upfront.
|
|
700
|
+
*
|
|
701
|
+
* 2. Factory (2-arg): `new AdkFunctionModule(ctx, data)`
|
|
702
|
+
* Used by ADK factory's `getWithData()`. The groupName is extracted from
|
|
703
|
+
* `data._groupName` or `data.containerRef.name`.
|
|
704
|
+
*/
|
|
705
|
+
constructor(ctx: AdkContext, groupNameOrData: string | FunctionModuleXml, dataOrName?: FunctionModuleXml | string);
|
|
795
706
|
get objectUri(): string;
|
|
796
|
-
|
|
707
|
+
get collectionUri(): string;
|
|
797
708
|
protected get wrapperKey(): string;
|
|
798
709
|
protected get crudContract(): any;
|
|
799
|
-
static get(name: string, ctx?: AdkContext): Promise<AdkInterface>;
|
|
800
710
|
/**
|
|
801
|
-
*
|
|
711
|
+
* Load function module data from SAP
|
|
712
|
+
*
|
|
713
|
+
* Overrides base to pass groupName as first arg to contract.get()
|
|
802
714
|
*/
|
|
803
|
-
|
|
715
|
+
load(): Promise<this>;
|
|
804
716
|
/**
|
|
805
|
-
*
|
|
717
|
+
* Get skeleton data for FM creation (POST).
|
|
806
718
|
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
809
|
-
* @param packageName - Package to assign the interface to
|
|
810
|
-
* @param options - Save options (transport)
|
|
811
|
-
* @param ctx - Optional ADK context
|
|
719
|
+
* FMs only need name, type, description, and processing attributes.
|
|
720
|
+
* No packageRef — FMs inherit the package from their parent FUGR.
|
|
812
721
|
*/
|
|
813
|
-
|
|
814
|
-
transport?: string;
|
|
815
|
-
}, ctx?: AdkContext): Promise<AdkInterface>;
|
|
722
|
+
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
816
723
|
/**
|
|
817
|
-
*
|
|
724
|
+
* Execute the typed contract call for save
|
|
818
725
|
*
|
|
819
|
-
*
|
|
820
|
-
* @param options - Delete options (transport)
|
|
821
|
-
* @param ctx - Optional ADK context
|
|
726
|
+
* Overrides base to pass groupName to contract.put()/post()
|
|
822
727
|
*/
|
|
823
|
-
|
|
728
|
+
protected saveViaContract(mode: 'create' | 'update', options: {
|
|
824
729
|
transport?: string;
|
|
825
730
|
lockHandle?: string;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
/**
|
|
829
|
-
* Package type (pak:packageType attribute)
|
|
830
|
-
*/
|
|
831
|
-
type PackageType = 'development' | 'structure' | 'main';
|
|
832
|
-
/**
|
|
833
|
-
* Reference to another object (used for superPackage, etc.)
|
|
834
|
-
* Re-exported for backward compatibility
|
|
835
|
-
*/
|
|
836
|
-
type ObjectReference = AdtObjectReference;
|
|
837
|
-
/**
|
|
838
|
-
* Package attributes (pak:attributes element)
|
|
839
|
-
*/
|
|
840
|
-
interface PackageAttributes {
|
|
841
|
-
readonly packageType: PackageType;
|
|
842
|
-
readonly isEncapsulated: boolean;
|
|
843
|
-
readonly isAddingObjectsAllowed: boolean;
|
|
844
|
-
readonly recordChanges: boolean;
|
|
845
|
-
readonly languageVersion: string;
|
|
846
|
-
}
|
|
847
|
-
/**
|
|
848
|
-
* Application component info
|
|
849
|
-
*/
|
|
850
|
-
interface ApplicationComponent {
|
|
851
|
-
readonly name: string;
|
|
852
|
-
readonly description: string;
|
|
853
|
-
}
|
|
854
|
-
/**
|
|
855
|
-
* Software component info
|
|
856
|
-
*/
|
|
857
|
-
interface SoftwareComponent {
|
|
858
|
-
readonly name: string;
|
|
859
|
-
readonly description: string;
|
|
860
|
-
}
|
|
861
|
-
/**
|
|
862
|
-
* Transport layer info
|
|
863
|
-
*/
|
|
864
|
-
interface TransportLayer {
|
|
865
|
-
readonly name: string;
|
|
866
|
-
readonly description: string;
|
|
867
|
-
}
|
|
868
|
-
/**
|
|
869
|
-
* Transport configuration
|
|
870
|
-
*/
|
|
871
|
-
interface TransportConfig {
|
|
872
|
-
readonly softwareComponent?: SoftwareComponent;
|
|
873
|
-
readonly transportLayer?: TransportLayer;
|
|
874
|
-
}
|
|
875
|
-
/**
|
|
876
|
-
* ABAP Package interface
|
|
877
|
-
*
|
|
878
|
-
* Plugins work with this interface - implementation is internal.
|
|
879
|
-
* Mirrors ADT pak:package structure.
|
|
880
|
-
*/
|
|
881
|
-
interface AbapPackage extends AbapObject {
|
|
882
|
-
readonly kind: 'Package';
|
|
883
|
-
readonly responsible: string;
|
|
884
|
-
readonly masterLanguage: string;
|
|
885
|
-
readonly language: string;
|
|
886
|
-
readonly version: string;
|
|
887
|
-
readonly createdAt: Date;
|
|
888
|
-
readonly createdBy: string;
|
|
889
|
-
readonly changedAt: Date;
|
|
890
|
-
readonly changedBy: string;
|
|
891
|
-
readonly attributes: PackageAttributes;
|
|
892
|
-
readonly superPackage?: AdtObjectReference;
|
|
893
|
-
readonly applicationComponent?: ApplicationComponent;
|
|
894
|
-
readonly transport?: TransportConfig;
|
|
895
|
-
/**
|
|
896
|
-
* Get direct subpackages
|
|
897
|
-
*/
|
|
898
|
-
getSubpackages(): Promise<AbapPackage[]>;
|
|
899
|
-
/**
|
|
900
|
-
* Get objects contained in this package (direct, not recursive)
|
|
901
|
-
*/
|
|
902
|
-
getObjects(): Promise<AbapObject[]>;
|
|
731
|
+
}): Promise<void>;
|
|
903
732
|
/**
|
|
904
|
-
*
|
|
733
|
+
* Check if the function module exists on the SAP system.
|
|
734
|
+
*
|
|
735
|
+
* Overrides base to pass groupName to contract.get()
|
|
905
736
|
*/
|
|
906
|
-
|
|
907
|
-
}
|
|
908
|
-
/**
|
|
909
|
-
* Package data type - inferred from packagesContract response
|
|
910
|
-
*
|
|
911
|
-
* The schema wraps everything in a 'package' element, so we unwrap it here
|
|
912
|
-
* to provide a flat structure for ADK consumers.
|
|
913
|
-
*/
|
|
914
|
-
type PackageXml = NonNullable<PackageResponse['package']>;
|
|
915
|
-
/**
|
|
916
|
-
* ADK Package object
|
|
917
|
-
*
|
|
918
|
-
* Inherits from AdkMainObject which provides:
|
|
919
|
-
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
920
|
-
* - AdkMainObject: packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
921
|
-
*
|
|
922
|
-
* Note: For packages, the parent package is stored in `superPackage` not `packageRef`.
|
|
923
|
-
* The `package` getter is overridden to return the super package name.
|
|
924
|
-
*/
|
|
925
|
-
declare class AdkPackage extends AdkMainObject<typeof Package, PackageXml> implements AbapPackage {
|
|
926
|
-
static readonly kind: "Package";
|
|
927
|
-
readonly kind: "Package";
|
|
928
|
-
get objectUri(): string;
|
|
929
|
-
get package(): string;
|
|
930
|
-
get attributes(): PackageAttributes;
|
|
931
|
-
get superPackage(): ObjectReference | undefined;
|
|
932
|
-
get applicationComponent(): ApplicationComponent | undefined;
|
|
933
|
-
get transport(): TransportConfig | undefined;
|
|
934
|
-
getSubpackages(): Promise<AbapPackage[]>;
|
|
935
|
-
getObjects(): Promise<AbapObject[]>;
|
|
936
|
-
getAllObjects(): Promise<AbapObject[]>;
|
|
937
|
-
load(): Promise<this>;
|
|
938
|
-
protected get wrapperKey(): "package";
|
|
939
|
-
protected get crudContract(): any;
|
|
737
|
+
protected checkObjectExists(): Promise<boolean>;
|
|
940
738
|
/**
|
|
941
|
-
*
|
|
739
|
+
* Refresh cached ETags after acquiring a lock.
|
|
942
740
|
*
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
*
|
|
946
|
-
*
|
|
947
|
-
* Missing elements cause "System expected the element ..." 400 errors.
|
|
741
|
+
* FM's savePendingSources() does a metadata PUT first (to apply processingType),
|
|
742
|
+
* then a source PUT. Both need fresh ETags after locking.
|
|
743
|
+
* The contract uses groupName + name (potentially UPPERCASE), so we must
|
|
744
|
+
* refresh via the contract to match the same cache key.
|
|
948
745
|
*/
|
|
949
|
-
protected
|
|
746
|
+
protected refreshETagsAfterLock(): Promise<void>;
|
|
950
747
|
/**
|
|
951
|
-
*
|
|
748
|
+
* Strip the parameter comment block from FM source code.
|
|
952
749
|
*
|
|
953
|
-
*
|
|
954
|
-
*
|
|
750
|
+
* abapGit serializes FM source with a "Local Interface" comment block
|
|
751
|
+
* that describes IMPORTING/EXPORTING/CHANGING/TABLES/EXCEPTIONS.
|
|
752
|
+
* SAP ADT rejects this block when saving source — it manages the
|
|
753
|
+
* interface metadata separately. Strip it before sending.
|
|
754
|
+
*
|
|
755
|
+
* Pattern:
|
|
756
|
+
* ```
|
|
757
|
+
* *"----------------------------------------------------------------------
|
|
758
|
+
* *"*"Local Interface:
|
|
759
|
+
* *" IMPORTING ...
|
|
760
|
+
* *"----------------------------------------------------------------------
|
|
761
|
+
* ```
|
|
955
762
|
*/
|
|
956
|
-
|
|
763
|
+
private stripParameterCommentBlock;
|
|
957
764
|
/**
|
|
958
|
-
*
|
|
765
|
+
* Save pending source for function module.
|
|
959
766
|
*
|
|
960
|
-
*
|
|
961
|
-
*
|
|
962
|
-
*
|
|
767
|
+
* Overrides base to:
|
|
768
|
+
* 1. PUT metadata first (SAP ignores processingType and other attributes during POST)
|
|
769
|
+
* 2. Refresh source ETag (metadata PUT changes the object version)
|
|
770
|
+
* 3. Strip the parameter comment block that abapGit includes
|
|
771
|
+
* 4. Use the FM-specific source endpoint via groupName
|
|
963
772
|
*/
|
|
964
|
-
|
|
773
|
+
protected savePendingSources(options?: {
|
|
774
|
+
lockHandle?: string;
|
|
775
|
+
transport?: string;
|
|
776
|
+
}): Promise<void>;
|
|
965
777
|
/**
|
|
966
|
-
*
|
|
778
|
+
* Extract the body of a FUNCTION...ENDFUNCTION block.
|
|
967
779
|
*
|
|
968
|
-
*
|
|
780
|
+
* SAP reconstructs the FUNCTION header when returning source code:
|
|
781
|
+
* Local: `FUNCTION zage_fm.` (lowercase, period inline)
|
|
782
|
+
* SAP: `FUNCTION ZAGE_FM\n " template comment"\n.` (uppercase, period on own line)
|
|
969
783
|
*
|
|
970
|
-
*
|
|
971
|
-
*
|
|
972
|
-
*
|
|
973
|
-
* @param ctx - Optional ADK context (uses global context if not provided)
|
|
784
|
+
* The body between the header and ENDFUNCTION is identical, so we compare
|
|
785
|
+
* only that part. The header ends at the first period that terminates the
|
|
786
|
+
* FUNCTION statement (either inline `FUNCTION name.` or on a separate line `.`).
|
|
974
787
|
*/
|
|
975
|
-
|
|
976
|
-
transport?: string;
|
|
977
|
-
}, ctx?: AdkContext): Promise<AdkPackage>;
|
|
788
|
+
private extractFunctionBody;
|
|
978
789
|
/**
|
|
979
|
-
*
|
|
790
|
+
* Pre-lock comparison for FM source.
|
|
980
791
|
*
|
|
981
|
-
*
|
|
982
|
-
*
|
|
983
|
-
*
|
|
792
|
+
* Overrides base to:
|
|
793
|
+
* 1. Strip parameter comment block from local source
|
|
794
|
+
* 2. Extract only the function body (between FUNCTION header and ENDFUNCTION)
|
|
795
|
+
* from both local and SAP source, because SAP reconstructs the FUNCTION
|
|
796
|
+
* header with uppercase name and template comments.
|
|
984
797
|
*/
|
|
985
|
-
|
|
986
|
-
transport?: string;
|
|
987
|
-
lockHandle?: string;
|
|
988
|
-
}, ctx?: AdkContext): Promise<void>;
|
|
989
|
-
}
|
|
990
|
-
/**
|
|
991
|
-
* Program data type - unwrap from root element
|
|
992
|
-
*
|
|
993
|
-
* The schema wraps everything in an 'abapProgram' element, so we unwrap it here
|
|
994
|
-
* to provide a flat structure for ADK consumers.
|
|
995
|
-
*/
|
|
996
|
-
type ProgramXml = ProgramResponse['abapProgram'];
|
|
997
|
-
/**
|
|
998
|
-
* ADK Program object
|
|
999
|
-
*
|
|
1000
|
-
* Inherits from AdkMainObject which provides:
|
|
1001
|
-
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
1002
|
-
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
1003
|
-
*
|
|
1004
|
-
* Access program-specific properties via `data`:
|
|
1005
|
-
* - data.programType, data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck
|
|
1006
|
-
*/
|
|
1007
|
-
declare class AdkProgram extends AdkMainObject<typeof Program, ProgramXml> {
|
|
1008
|
-
static readonly kind: "Program";
|
|
1009
|
-
readonly kind: "Program";
|
|
1010
|
-
get objectUri(): string;
|
|
798
|
+
protected checkPendingSourcesUnchanged(): Promise<void>;
|
|
1011
799
|
getSource(): Promise<string>;
|
|
1012
|
-
protected get wrapperKey(): string;
|
|
1013
|
-
protected get crudContract(): any;
|
|
1014
|
-
static get(name: string, ctx?: AdkContext): Promise<AdkProgram>;
|
|
1015
800
|
/**
|
|
1016
|
-
*
|
|
801
|
+
* Get a function module by name
|
|
802
|
+
*
|
|
803
|
+
* @param groupName - Parent function group name
|
|
804
|
+
* @param name - Function module name
|
|
805
|
+
* @param ctx - Optional ADK context (uses global if not provided)
|
|
1017
806
|
*/
|
|
1018
|
-
static
|
|
807
|
+
static get(groupName: string, name: string, ctx?: AdkContext): Promise<AdkFunctionModule>;
|
|
1019
808
|
/**
|
|
1020
|
-
*
|
|
1021
|
-
*
|
|
1022
|
-
* @param name - Program name (e.g., 'ZMYPROGRAM')
|
|
1023
|
-
* @param description - Short description
|
|
1024
|
-
* @param packageName - Package to assign the program to
|
|
1025
|
-
* @param options - Save options (transport)
|
|
1026
|
-
* @param ctx - Optional ADK context
|
|
809
|
+
* Check if a function module exists on SAP
|
|
1027
810
|
*/
|
|
1028
|
-
static
|
|
811
|
+
static exists(groupName: string, name: string, ctx?: AdkContext): Promise<boolean>;
|
|
812
|
+
/**
|
|
813
|
+
* Create a new ABAP function module on SAP
|
|
814
|
+
*/
|
|
815
|
+
static create(groupName: string, name: string, description: string, options?: {
|
|
1029
816
|
transport?: string;
|
|
1030
|
-
|
|
817
|
+
processingType?: string;
|
|
818
|
+
}, ctx?: AdkContext): Promise<AdkFunctionModule>;
|
|
1031
819
|
/**
|
|
1032
|
-
* Delete
|
|
1033
|
-
*
|
|
1034
|
-
* @param name - Program name
|
|
1035
|
-
* @param options - Delete options (transport)
|
|
1036
|
-
* @param ctx - Optional ADK context
|
|
820
|
+
* Delete a function module from SAP
|
|
1037
821
|
*/
|
|
1038
|
-
static delete(name: string, options?: {
|
|
822
|
+
static delete(groupName: string, name: string, options?: {
|
|
1039
823
|
transport?: string;
|
|
1040
824
|
lockHandle?: string;
|
|
1041
825
|
}, ctx?: AdkContext): Promise<void>;
|
|
1042
826
|
}
|
|
1043
827
|
/**
|
|
1044
|
-
*
|
|
828
|
+
* Full response type from TransportService.get()
|
|
1045
829
|
*
|
|
1046
|
-
* The schema wraps everything in
|
|
1047
|
-
*
|
|
1048
|
-
*/
|
|
1049
|
-
type IncludeXml = IncludeResponse['abapInclude'];
|
|
1050
|
-
/**
|
|
1051
|
-
* ADK Include object
|
|
1052
|
-
*
|
|
1053
|
-
* Inherits from AdkMainObject which provides:
|
|
1054
|
-
* - AdkObject: name, type, description, version, language, changedBy/At,
|
|
1055
|
-
* createdBy/At, links
|
|
1056
|
-
* - AdkMainObject: package, packageRef, responsible, masterLanguage,
|
|
1057
|
-
* masterSystem, abapLanguageVersion
|
|
1058
|
-
*
|
|
1059
|
-
* Access include-specific properties via `data`:
|
|
1060
|
-
* - data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck,
|
|
1061
|
-
* data.contextRef (pointer to the main program)
|
|
1062
|
-
*/
|
|
1063
|
-
declare class AdkInclude extends AdkMainObject<typeof Include, IncludeXml> {
|
|
1064
|
-
static readonly kind: "Include";
|
|
1065
|
-
readonly kind: "Include";
|
|
1066
|
-
get objectUri(): string;
|
|
1067
|
-
getSource(): Promise<string>;
|
|
1068
|
-
protected get wrapperKey(): string;
|
|
1069
|
-
protected get crudContract(): any;
|
|
1070
|
-
/**
|
|
1071
|
-
* Skeleton POST data for includes.
|
|
1072
|
-
*
|
|
1073
|
-
* Extends the base skeleton (name/type/description/packageRef) with
|
|
1074
|
-
* `contextRef`, which sapcli's `sap.adt.Include(..., master=...)` serializes
|
|
1075
|
-
* at creation time. Without this the include would be created detached
|
|
1076
|
-
* from its main program.
|
|
1077
|
-
*/
|
|
1078
|
-
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
1079
|
-
static get(name: string, ctx?: AdkContext): Promise<AdkInclude>;
|
|
1080
|
-
/**
|
|
1081
|
-
* Check if an include exists on SAP
|
|
1082
|
-
*/
|
|
1083
|
-
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1084
|
-
/**
|
|
1085
|
-
* Create a new ABAP include on SAP
|
|
1086
|
-
*
|
|
1087
|
-
* @param name - Include name (e.g., 'ZMY_INCLUDE')
|
|
1088
|
-
* @param description - Short description
|
|
1089
|
-
* @param packageName - Package to assign the include to
|
|
1090
|
-
* @param options - Save options (transport, master program)
|
|
1091
|
-
* @param ctx - Optional ADK context
|
|
1092
|
-
*/
|
|
1093
|
-
static create(name: string, description: string, packageName: string, options?: {
|
|
1094
|
-
transport?: string;
|
|
1095
|
-
master?: string;
|
|
1096
|
-
}, ctx?: AdkContext): Promise<AdkInclude>;
|
|
1097
|
-
/**
|
|
1098
|
-
* Delete an ABAP include from SAP
|
|
1099
|
-
*
|
|
1100
|
-
* @param name - Include name
|
|
1101
|
-
* @param options - Delete options (transport, lockHandle)
|
|
1102
|
-
* @param ctx - Optional ADK context
|
|
1103
|
-
*/
|
|
1104
|
-
static delete(name: string, options?: {
|
|
1105
|
-
transport?: string;
|
|
1106
|
-
lockHandle?: string;
|
|
1107
|
-
}, ctx?: AdkContext): Promise<void>;
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Function group data type - unwrap from root element
|
|
1111
|
-
*
|
|
1112
|
-
* The schema wraps everything in an 'abapFunctionGroup' element, so we unwrap it here
|
|
1113
|
-
* to provide a flat structure for ADK consumers.
|
|
1114
|
-
*/
|
|
1115
|
-
type FunctionGroupXml = FunctionGroupResponse['abapFunctionGroup'];
|
|
1116
|
-
/**
|
|
1117
|
-
* ADK Function Group object
|
|
1118
|
-
*
|
|
1119
|
-
* Inherits from AdkMainObject which provides:
|
|
1120
|
-
* - AdkObject: name, type, description, version, language, changedBy/At, createdBy/At, links
|
|
1121
|
-
* - AdkMainObject: package, packageRef, responsible, masterLanguage, masterSystem, abapLanguageVersion
|
|
1122
|
-
*
|
|
1123
|
-
* Access function group-specific properties via `data`:
|
|
1124
|
-
* - data.sourceUri, data.fixPointArithmetic, data.activeUnicodeCheck
|
|
1125
|
-
*/
|
|
1126
|
-
declare class AdkFunctionGroup extends AdkMainObject<typeof FunctionGroup, FunctionGroupXml> {
|
|
1127
|
-
static readonly kind: "FunctionGroup";
|
|
1128
|
-
readonly kind: "FunctionGroup";
|
|
1129
|
-
get objectUri(): string;
|
|
1130
|
-
getSource(): Promise<string>;
|
|
1131
|
-
protected get wrapperKey(): string;
|
|
1132
|
-
protected get crudContract(): any;
|
|
1133
|
-
static get(name: string, ctx?: AdkContext): Promise<AdkFunctionGroup>;
|
|
1134
|
-
/**
|
|
1135
|
-
* Check if a function group exists on SAP
|
|
1136
|
-
*/
|
|
1137
|
-
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1138
|
-
/**
|
|
1139
|
-
* Create a new ABAP function group on SAP
|
|
1140
|
-
*/
|
|
1141
|
-
static create(name: string, description: string, packageName: string, options?: {
|
|
1142
|
-
transport?: string;
|
|
1143
|
-
}, ctx?: AdkContext): Promise<AdkFunctionGroup>;
|
|
1144
|
-
/**
|
|
1145
|
-
* Delete an ABAP function group from SAP
|
|
1146
|
-
*/
|
|
1147
|
-
static delete(name: string, options?: {
|
|
1148
|
-
transport?: string;
|
|
1149
|
-
lockHandle?: string;
|
|
1150
|
-
}, ctx?: AdkContext): Promise<void>;
|
|
1151
|
-
}
|
|
1152
|
-
/**
|
|
1153
|
-
* Function module data type - unwrap from root element
|
|
1154
|
-
*
|
|
1155
|
-
* The schema wraps everything in an 'abapFunctionModule' element, so we unwrap it here
|
|
1156
|
-
* to provide a flat structure for ADK consumers.
|
|
1157
|
-
*/
|
|
1158
|
-
type FunctionModuleXml = FunctionModuleResponse['abapFunctionModule'];
|
|
1159
|
-
/**
|
|
1160
|
-
* ADK Function Module object
|
|
1161
|
-
*
|
|
1162
|
-
* Function modules are child objects of function groups. Unlike main objects
|
|
1163
|
-
* (classes, interfaces, etc.), they don't have their own package reference.
|
|
1164
|
-
* All API operations require the parent group name in the URL path.
|
|
1165
|
-
*
|
|
1166
|
-
* Key differences from AdkMainObject:
|
|
1167
|
-
* - Requires `groupName` for URI construction and all CRUD operations
|
|
1168
|
-
* - Overrides lock/unlock/load/save to pass groupName to contract calls
|
|
1169
|
-
* - No packageRef (lives within parent function group's package)
|
|
1170
|
-
*/
|
|
1171
|
-
declare class AdkFunctionModule extends AdkObject<typeof FunctionModule, FunctionModuleXml> {
|
|
1172
|
-
static readonly kind: "FunctionModule";
|
|
1173
|
-
readonly kind: "FunctionModule";
|
|
1174
|
-
/** Parent function group name */
|
|
1175
|
-
groupName: string;
|
|
1176
|
-
/**
|
|
1177
|
-
* Constructor supports two calling patterns:
|
|
1178
|
-
*
|
|
1179
|
-
* 1. Direct (3-arg): `new AdkFunctionModule(ctx, groupName, nameOrData)`
|
|
1180
|
-
* Used by static factory method and when group name is known upfront.
|
|
1181
|
-
*
|
|
1182
|
-
* 2. Factory (2-arg): `new AdkFunctionModule(ctx, data)`
|
|
1183
|
-
* Used by ADK factory's `getWithData()`. The groupName is extracted from
|
|
1184
|
-
* `data._groupName` or `data.containerRef.name`.
|
|
1185
|
-
*/
|
|
1186
|
-
constructor(ctx: AdkContext, groupNameOrData: string | FunctionModuleXml, dataOrName?: FunctionModuleXml | string);
|
|
1187
|
-
get objectUri(): string;
|
|
1188
|
-
get collectionUri(): string;
|
|
1189
|
-
protected get wrapperKey(): string;
|
|
1190
|
-
protected get crudContract(): any;
|
|
1191
|
-
/**
|
|
1192
|
-
* Load function module data from SAP
|
|
1193
|
-
*
|
|
1194
|
-
* Overrides base to pass groupName as first arg to contract.get()
|
|
1195
|
-
*/
|
|
1196
|
-
load(): Promise<this>;
|
|
1197
|
-
/**
|
|
1198
|
-
* Get skeleton data for FM creation (POST).
|
|
1199
|
-
*
|
|
1200
|
-
* FMs only need name, type, description, and processing attributes.
|
|
1201
|
-
* No packageRef — FMs inherit the package from their parent FUGR.
|
|
1202
|
-
*/
|
|
1203
|
-
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
1204
|
-
/**
|
|
1205
|
-
* Execute the typed contract call for save
|
|
1206
|
-
*
|
|
1207
|
-
* Overrides base to pass groupName to contract.put()/post()
|
|
1208
|
-
*/
|
|
1209
|
-
protected saveViaContract(mode: 'create' | 'update', options: {
|
|
1210
|
-
transport?: string;
|
|
1211
|
-
lockHandle?: string;
|
|
1212
|
-
}): Promise<void>;
|
|
1213
|
-
/**
|
|
1214
|
-
* Check if the function module exists on the SAP system.
|
|
1215
|
-
*
|
|
1216
|
-
* Overrides base to pass groupName to contract.get()
|
|
1217
|
-
*/
|
|
1218
|
-
protected checkObjectExists(): Promise<boolean>;
|
|
1219
|
-
/**
|
|
1220
|
-
* Refresh cached ETags after acquiring a lock.
|
|
1221
|
-
*
|
|
1222
|
-
* FM's savePendingSources() does a metadata PUT first (to apply processingType),
|
|
1223
|
-
* then a source PUT. Both need fresh ETags after locking.
|
|
1224
|
-
* The contract uses groupName + name (potentially UPPERCASE), so we must
|
|
1225
|
-
* refresh via the contract to match the same cache key.
|
|
1226
|
-
*/
|
|
1227
|
-
protected refreshETagsAfterLock(): Promise<void>;
|
|
1228
|
-
/**
|
|
1229
|
-
* Strip the parameter comment block from FM source code.
|
|
1230
|
-
*
|
|
1231
|
-
* abapGit serializes FM source with a "Local Interface" comment block
|
|
1232
|
-
* that describes IMPORTING/EXPORTING/CHANGING/TABLES/EXCEPTIONS.
|
|
1233
|
-
* SAP ADT rejects this block when saving source — it manages the
|
|
1234
|
-
* interface metadata separately. Strip it before sending.
|
|
1235
|
-
*
|
|
1236
|
-
* Pattern:
|
|
1237
|
-
* ```
|
|
1238
|
-
* *"----------------------------------------------------------------------
|
|
1239
|
-
* *"*"Local Interface:
|
|
1240
|
-
* *" IMPORTING ...
|
|
1241
|
-
* *"----------------------------------------------------------------------
|
|
1242
|
-
* ```
|
|
1243
|
-
*/
|
|
1244
|
-
private stripParameterCommentBlock;
|
|
1245
|
-
/**
|
|
1246
|
-
* Save pending source for function module.
|
|
1247
|
-
*
|
|
1248
|
-
* Overrides base to:
|
|
1249
|
-
* 1. PUT metadata first (SAP ignores processingType and other attributes during POST)
|
|
1250
|
-
* 2. Refresh source ETag (metadata PUT changes the object version)
|
|
1251
|
-
* 3. Strip the parameter comment block that abapGit includes
|
|
1252
|
-
* 4. Use the FM-specific source endpoint via groupName
|
|
1253
|
-
*/
|
|
1254
|
-
protected savePendingSources(options?: {
|
|
1255
|
-
lockHandle?: string;
|
|
1256
|
-
transport?: string;
|
|
1257
|
-
}): Promise<void>;
|
|
1258
|
-
/**
|
|
1259
|
-
* Extract the body of a FUNCTION...ENDFUNCTION block.
|
|
1260
|
-
*
|
|
1261
|
-
* SAP reconstructs the FUNCTION header when returning source code:
|
|
1262
|
-
* Local: `FUNCTION zage_fm.` (lowercase, period inline)
|
|
1263
|
-
* SAP: `FUNCTION ZAGE_FM\n " template comment"\n.` (uppercase, period on own line)
|
|
1264
|
-
*
|
|
1265
|
-
* The body between the header and ENDFUNCTION is identical, so we compare
|
|
1266
|
-
* only that part. The header ends at the first period that terminates the
|
|
1267
|
-
* FUNCTION statement (either inline `FUNCTION name.` or on a separate line `.`).
|
|
1268
|
-
*/
|
|
1269
|
-
private extractFunctionBody;
|
|
1270
|
-
/**
|
|
1271
|
-
* Pre-lock comparison for FM source.
|
|
1272
|
-
*
|
|
1273
|
-
* Overrides base to:
|
|
1274
|
-
* 1. Strip parameter comment block from local source
|
|
1275
|
-
* 2. Extract only the function body (between FUNCTION header and ENDFUNCTION)
|
|
1276
|
-
* from both local and SAP source, because SAP reconstructs the FUNCTION
|
|
1277
|
-
* header with uppercase name and template comments.
|
|
1278
|
-
*/
|
|
1279
|
-
protected checkPendingSourcesUnchanged(): Promise<void>;
|
|
1280
|
-
getSource(): Promise<string>;
|
|
1281
|
-
/**
|
|
1282
|
-
* Get a function module by name
|
|
1283
|
-
*
|
|
1284
|
-
* @param groupName - Parent function group name
|
|
1285
|
-
* @param name - Function module name
|
|
1286
|
-
* @param ctx - Optional ADK context (uses global if not provided)
|
|
1287
|
-
*/
|
|
1288
|
-
static get(groupName: string, name: string, ctx?: AdkContext): Promise<AdkFunctionModule>;
|
|
1289
|
-
/**
|
|
1290
|
-
* Check if a function module exists on SAP
|
|
1291
|
-
*/
|
|
1292
|
-
static exists(groupName: string, name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1293
|
-
/**
|
|
1294
|
-
* Create a new ABAP function module on SAP
|
|
1295
|
-
*/
|
|
1296
|
-
static create(groupName: string, name: string, description: string, options?: {
|
|
1297
|
-
transport?: string;
|
|
1298
|
-
processingType?: string;
|
|
1299
|
-
}, ctx?: AdkContext): Promise<AdkFunctionModule>;
|
|
1300
|
-
/**
|
|
1301
|
-
* Delete a function module from SAP
|
|
1302
|
-
*/
|
|
1303
|
-
static delete(groupName: string, name: string, options?: {
|
|
1304
|
-
transport?: string;
|
|
1305
|
-
lockHandle?: string;
|
|
1306
|
-
}, ctx?: AdkContext): Promise<void>;
|
|
1307
|
-
}
|
|
1308
|
-
/**
|
|
1309
|
-
* Full response type from TransportService.get()
|
|
1310
|
-
*
|
|
1311
|
-
* The schema wraps everything in a 'root' element, so we unwrap it here
|
|
1312
|
-
* to provide a flat structure for ADK consumers.
|
|
830
|
+
* The schema wraps everything in a 'root' element, so we unwrap it here
|
|
831
|
+
* to provide a flat structure for ADK consumers.
|
|
1313
832
|
*/
|
|
1314
833
|
type TransportData = TransportGetResponse['root'];
|
|
1315
834
|
/** Request data from schema */
|
|
@@ -1322,8 +841,6 @@ type TransportObjectData = NonNullable<TransportTaskData['abap_object']> extends
|
|
|
1322
841
|
type TransportStatus = 'D' | 'R' | 'N';
|
|
1323
842
|
/** Transport type */
|
|
1324
843
|
type TransportType = 'K' | 'W' | 'T' | 'C';
|
|
1325
|
-
type TransportTask = TransportTaskData;
|
|
1326
|
-
type TransportObject = TransportObjectData;
|
|
1327
844
|
/**
|
|
1328
845
|
* Options for creating a transport
|
|
1329
846
|
*/
|
|
@@ -1933,181 +1450,643 @@ declare class AdkBehaviorDefinition extends AdkCrudSourceObject<BdefMetadata> {
|
|
|
1933
1450
|
static get(name: string, ctx?: AdkContext): Promise<AdkBehaviorDefinition>;
|
|
1934
1451
|
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1935
1452
|
/**
|
|
1936
|
-
* Create a new BDEF on SAP.
|
|
1937
|
-
*
|
|
1938
|
-
* POST /sap/bc/adt/bo/behaviordefinitions?corrNr=...
|
|
1939
|
-
* Body matches the `blue:blueSource` envelope (extends
|
|
1940
|
-
* abapsource:AbapSourceMainObject).
|
|
1453
|
+
* Create a new BDEF on SAP.
|
|
1454
|
+
*
|
|
1455
|
+
* POST /sap/bc/adt/bo/behaviordefinitions?corrNr=...
|
|
1456
|
+
* Body matches the `blue:blueSource` envelope (extends
|
|
1457
|
+
* abapsource:AbapSourceMainObject).
|
|
1458
|
+
*/
|
|
1459
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1460
|
+
transport?: string;
|
|
1461
|
+
}, ctx?: AdkContext): Promise<AdkBehaviorDefinition>;
|
|
1462
|
+
static delete(name: string, options?: {
|
|
1463
|
+
transport?: string;
|
|
1464
|
+
lockHandle?: string;
|
|
1465
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1466
|
+
}
|
|
1467
|
+
interface SrvdMetadata {
|
|
1468
|
+
srvdSource?: {
|
|
1469
|
+
description?: string;
|
|
1470
|
+
masterLanguage?: string;
|
|
1471
|
+
abapLanguageVersion?: string;
|
|
1472
|
+
packageRef?: {
|
|
1473
|
+
name?: string;
|
|
1474
|
+
};
|
|
1475
|
+
sourceOrigin?: string;
|
|
1476
|
+
srvdSourceType?: string;
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
declare class AdkServiceDefinition extends AdkCrudSourceObject<SrvdMetadata> {
|
|
1480
|
+
/** Static ADK kind marker — used by abapGit handler registry if needed. */
|
|
1481
|
+
static readonly kind: "ServiceDefinition";
|
|
1482
|
+
readonly kind: "ServiceDefinition";
|
|
1483
|
+
protected readonly objectType = "SRVD";
|
|
1484
|
+
protected readonly endpoint = "ddic/srvd/sources";
|
|
1485
|
+
protected get contract(): AdkCrudSourceContract;
|
|
1486
|
+
protected getMetadataKey(): 'srvdSource';
|
|
1487
|
+
get sourceOrigin(): string | undefined;
|
|
1488
|
+
get sourceType(): string | undefined;
|
|
1489
|
+
/**
|
|
1490
|
+
* Get a SRVD (validates it exists by fetching source).
|
|
1491
|
+
*/
|
|
1492
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkServiceDefinition>;
|
|
1493
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1494
|
+
/**
|
|
1495
|
+
* Create a new SRVD on SAP.
|
|
1496
|
+
*
|
|
1497
|
+
* POST /sap/bc/adt/ddic/srvd/sources?corrNr=...
|
|
1498
|
+
* Body matches the `srvd:source` envelope (extends
|
|
1499
|
+
* abapsource:AbapSourceMainObject).
|
|
1500
|
+
*/
|
|
1501
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1502
|
+
transport?: string;
|
|
1503
|
+
}, ctx?: AdkContext): Promise<AdkServiceDefinition>;
|
|
1504
|
+
static delete(name: string, options?: {
|
|
1505
|
+
transport?: string;
|
|
1506
|
+
lockHandle?: string;
|
|
1507
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1508
|
+
}
|
|
1509
|
+
declare class AdkServiceBinding {
|
|
1510
|
+
/** Static ADK kind marker — used by abapGit handler registry if needed. */
|
|
1511
|
+
static readonly kind: "ServiceBinding";
|
|
1512
|
+
readonly kind: "ServiceBinding";
|
|
1513
|
+
readonly name: string;
|
|
1514
|
+
protected readonly ctx: AdkContext;
|
|
1515
|
+
constructor(ctx: AdkContext, nameOrData: string | Record<string, unknown>);
|
|
1516
|
+
get objectUri(): string;
|
|
1517
|
+
/** Placeholder description — full metadata requires additional SAP fetch */
|
|
1518
|
+
get description(): string;
|
|
1519
|
+
private get contract();
|
|
1520
|
+
/**
|
|
1521
|
+
* Fetch the binding metadata document. SRVB has no source text;
|
|
1522
|
+
* `getSource()` returns an empty string for uniform CLI parity.
|
|
1523
|
+
*/
|
|
1524
|
+
getMetadata(): Promise<unknown>;
|
|
1525
|
+
getSource(): Promise<string>;
|
|
1526
|
+
load(): Promise<this>;
|
|
1527
|
+
lock(transport?: string): Promise<{
|
|
1528
|
+
handle: string;
|
|
1529
|
+
}>;
|
|
1530
|
+
unlock(lockHandle: string): Promise<void>;
|
|
1531
|
+
activate(): Promise<this>;
|
|
1532
|
+
/**
|
|
1533
|
+
* Publish (activate) the binding in the SAP Gateway.
|
|
1534
|
+
* POST {basePath}/{name}/publishedstates
|
|
1535
|
+
*/
|
|
1536
|
+
publish(): Promise<void>;
|
|
1537
|
+
/**
|
|
1538
|
+
* Unpublish (deactivate) the binding.
|
|
1539
|
+
* DELETE {basePath}/{name}/publishedstates
|
|
1540
|
+
*/
|
|
1541
|
+
unpublish(): Promise<void>;
|
|
1542
|
+
/**
|
|
1543
|
+
* Get a SRVB (validates it exists by fetching metadata).
|
|
1544
|
+
*/
|
|
1545
|
+
static get(name: string, ctx?: AdkContext): Promise<AdkServiceBinding>;
|
|
1546
|
+
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1547
|
+
/**
|
|
1548
|
+
* Create a new SRVB on SAP.
|
|
1549
|
+
*
|
|
1550
|
+
* POST /sap/bc/adt/businessservices/bindings?corrNr=...
|
|
1551
|
+
* Body matches the `srvb:serviceBinding` envelope.
|
|
1552
|
+
*/
|
|
1553
|
+
static create(name: string, description: string, packageName: string, options?: {
|
|
1554
|
+
transport?: string;
|
|
1555
|
+
}, ctx?: AdkContext): Promise<AdkServiceBinding>;
|
|
1556
|
+
static delete(name: string, options?: {
|
|
1557
|
+
transport?: string;
|
|
1558
|
+
lockHandle?: string;
|
|
1559
|
+
}, ctx?: AdkContext): Promise<void>;
|
|
1560
|
+
static publish(name: string, ctx?: AdkContext): Promise<void>;
|
|
1561
|
+
static unpublish(name: string, ctx?: AdkContext): Promise<void>;
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* ADK Object Kinds
|
|
1565
|
+
*
|
|
1566
|
+
* Central registry of all ADK object types.
|
|
1567
|
+
* Import specific kinds for type-safe usage:
|
|
1568
|
+
*
|
|
1569
|
+
* @example
|
|
1570
|
+
* import { TransportRequest } from '../base/kinds';
|
|
1571
|
+
* class AdkTransportRequest extends AdkObject<typeof TransportRequest> { ... }
|
|
1572
|
+
*/
|
|
1573
|
+
declare const TransportRequest: "TransportRequest";
|
|
1574
|
+
declare const TransportTask: "TransportTask";
|
|
1575
|
+
declare const Package: "Package";
|
|
1576
|
+
declare const Class: "Class";
|
|
1577
|
+
declare const Interface: "Interface";
|
|
1578
|
+
declare const FunctionGroup: "FunctionGroup";
|
|
1579
|
+
declare const FunctionModule: "FunctionModule";
|
|
1580
|
+
declare const Program: "Program";
|
|
1581
|
+
declare const Include: "Include";
|
|
1582
|
+
declare const Table: "Table";
|
|
1583
|
+
declare const Structure: "Structure";
|
|
1584
|
+
declare const DataElement: "DataElement";
|
|
1585
|
+
declare const Domain: "Domain";
|
|
1586
|
+
declare const TableType: "TableType";
|
|
1587
|
+
declare const DdlSource: "DdlSource";
|
|
1588
|
+
declare const DclSource: "DclSource";
|
|
1589
|
+
declare const DdlExtension: "DdlExtension";
|
|
1590
|
+
declare const CdsAspect: "CdsAspect";
|
|
1591
|
+
declare const CdsType: "CdsType";
|
|
1592
|
+
declare const ScalarFunctionDefinition: "ScalarFunctionDefinition";
|
|
1593
|
+
declare const ScalarFunctionImplementation: "ScalarFunctionImplementation";
|
|
1594
|
+
declare const EntityBuffer: "EntityBuffer";
|
|
1595
|
+
declare const DynamicCache: "DynamicCache";
|
|
1596
|
+
declare const TuningIndex: "TuningIndex";
|
|
1597
|
+
declare const StaticCache: "StaticCache";
|
|
1598
|
+
declare const ExternalSchema: "ExternalSchema";
|
|
1599
|
+
declare const BehaviorDefinition: "BehaviorDefinition";
|
|
1600
|
+
declare const ServiceDefinition: "ServiceDefinition";
|
|
1601
|
+
declare const ServiceBinding: "ServiceBinding";
|
|
1602
|
+
declare const MessageClass: "MessageClass";
|
|
1603
|
+
declare const EnhancementSpot: "EnhancementSpot";
|
|
1604
|
+
/** Union type of all ADK kinds */
|
|
1605
|
+
type AdkKind = typeof TransportRequest | typeof TransportTask | 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 DdlSource | typeof DclSource | typeof DdlExtension | typeof CdsAspect | typeof CdsType | typeof ScalarFunctionDefinition | typeof ScalarFunctionImplementation | typeof EntityBuffer | typeof DynamicCache | typeof TuningIndex | typeof StaticCache | typeof ExternalSchema | typeof BehaviorDefinition | typeof ServiceDefinition | typeof ServiceBinding | typeof MessageClass | typeof EnhancementSpot;
|
|
1606
|
+
/**
|
|
1607
|
+
* Maps ADK kind to concrete object type
|
|
1608
|
+
*
|
|
1609
|
+
* Enables type-safe factory methods:
|
|
1610
|
+
* ```ts
|
|
1611
|
+
* const cls = factory.byKind(Class, 'ZCL_TEST'); // → AdkClass
|
|
1612
|
+
* const intf = factory.byKind(Interface, 'ZIF'); // → AdkInterface
|
|
1613
|
+
* ```
|
|
1614
|
+
*/
|
|
1615
|
+
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 ? 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 : K extends typeof DdlSource ? AdkDdlSource : K extends typeof DclSource ? AdkDclSource : K extends typeof DdlExtension ? AdkDdlExtension : K extends typeof CdsAspect ? AdkCdsAspect : K extends typeof CdsType ? AdkCdsType : K extends typeof ScalarFunctionDefinition ? AdkScalarFunctionDefinition : K extends typeof ScalarFunctionImplementation ? AdkScalarFunctionImplementation : K extends typeof EntityBuffer ? AdkEntityBuffer : K extends typeof DynamicCache ? AdkDynamicCache : K extends typeof TuningIndex ? AdkTuningIndex : K extends typeof StaticCache ? AdkStaticCache : K extends typeof ExternalSchema ? AdkExternalSchema : K extends typeof BehaviorDefinition ? AdkBehaviorDefinition : K extends typeof ServiceDefinition ? AdkServiceDefinition : K extends typeof ServiceBinding ? AdkServiceBinding : AdkObject;
|
|
1616
|
+
/**
|
|
1617
|
+
* Save mode for create/update operations
|
|
1618
|
+
* - 'update': PUT to existing object (default, fails if doesn't exist)
|
|
1619
|
+
* - 'create': POST to create new object (skips POST if already exists, then updates)
|
|
1620
|
+
* - 'upsert': Try PUT first, fall back to POST if 404
|
|
1621
|
+
*/
|
|
1622
|
+
type SaveMode = 'update' | 'create' | 'upsert';
|
|
1623
|
+
/**
|
|
1624
|
+
* Options for save operations
|
|
1625
|
+
*/
|
|
1626
|
+
interface SaveOptions {
|
|
1627
|
+
/** Transport request for the change */
|
|
1628
|
+
transport?: string;
|
|
1629
|
+
/** Save as inactive (default: false) */
|
|
1630
|
+
inactive?: boolean;
|
|
1631
|
+
/** Save mode: 'update' (default), 'create', or 'upsert' */
|
|
1632
|
+
mode?: SaveMode;
|
|
1633
|
+
/**
|
|
1634
|
+
* Retry only the immediate post-create LOCK when a backend keeps its
|
|
1635
|
+
* generated CTS/editor lock briefly after accepting the skeleton POST.
|
|
1636
|
+
*/
|
|
1637
|
+
postCreateLockRetry?: {
|
|
1638
|
+
/** Total LOCK attempts, including the first one. */
|
|
1639
|
+
attempts: number;
|
|
1640
|
+
/** Delay between conflicting LOCK attempts in milliseconds. */
|
|
1641
|
+
delayMs: number;
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
type InternalSaveOptions = SaveOptions & {
|
|
1645
|
+
postCreate?: boolean;
|
|
1646
|
+
};
|
|
1647
|
+
/**
|
|
1648
|
+
* SAP accepted the skeleton POST, but rejected the immediate follow-up lock.
|
|
1649
|
+
*
|
|
1650
|
+
* The object therefore exists in SAP, while the source or metadata supplied
|
|
1651
|
+
* to the original save call has not yet been persisted. Callers must retry
|
|
1652
|
+
* the same object with `mode: 'update'` after the CTS/editor lock is cleared;
|
|
1653
|
+
* repeating `mode: 'create'` risks an "already exists" response.
|
|
1654
|
+
*/
|
|
1655
|
+
declare class AdkPostCreateLockError extends Error {
|
|
1656
|
+
readonly objectUri: string;
|
|
1657
|
+
readonly transport: string | undefined;
|
|
1658
|
+
readonly code: "ADT_POST_CREATE_LOCKED";
|
|
1659
|
+
readonly name = "AdkPostCreateLockError";
|
|
1660
|
+
constructor(objectUri: string, transport: string | undefined, cause: unknown);
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Result of bulk activation
|
|
1664
|
+
*/
|
|
1665
|
+
interface ActivationResult {
|
|
1666
|
+
/** Number of successfully activated objects */
|
|
1667
|
+
success: number;
|
|
1668
|
+
/** Number of objects that failed activation */
|
|
1669
|
+
failed: number;
|
|
1670
|
+
/** Activation messages (errors, warnings) */
|
|
1671
|
+
messages: string[];
|
|
1672
|
+
/** Raw response from SAP (for debugging) */
|
|
1673
|
+
response?: string;
|
|
1674
|
+
}
|
|
1675
|
+
/**
|
|
1676
|
+
* Atom link (from atom:link element)
|
|
1677
|
+
* Used for HATEOAS-style navigation in ADT responses
|
|
1678
|
+
*/
|
|
1679
|
+
interface AtomLink {
|
|
1680
|
+
href: string;
|
|
1681
|
+
rel?: string;
|
|
1682
|
+
type?: string;
|
|
1683
|
+
title?: string;
|
|
1684
|
+
etag?: string;
|
|
1685
|
+
}
|
|
1686
|
+
/**
|
|
1687
|
+
* ADT object reference (adtcore:objectReference)
|
|
1688
|
+
*/
|
|
1689
|
+
interface AdtObjectReference {
|
|
1690
|
+
uri?: string;
|
|
1691
|
+
name?: string;
|
|
1692
|
+
type?: string;
|
|
1693
|
+
description?: string;
|
|
1694
|
+
packageName?: string;
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* Base data contract for all ADK objects
|
|
1698
|
+
* Matches XSD AdtObject type attributes and elements
|
|
1699
|
+
*/
|
|
1700
|
+
interface AdkObjectData {
|
|
1701
|
+
name: string;
|
|
1702
|
+
type: string;
|
|
1703
|
+
description?: string;
|
|
1704
|
+
changedBy?: string;
|
|
1705
|
+
changedAt?: string | Date;
|
|
1706
|
+
createdBy?: string;
|
|
1707
|
+
createdAt?: string | Date;
|
|
1708
|
+
version?: string;
|
|
1709
|
+
language?: string;
|
|
1710
|
+
descriptionTextLimit?: number;
|
|
1711
|
+
links?: AtomLink[];
|
|
1712
|
+
containerRef?: AdtObjectReference;
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* Main object data contract (extends AdtObject)
|
|
1716
|
+
* Matches XSD AdtMainObject type
|
|
1717
|
+
*/
|
|
1718
|
+
interface AdkMainObjectData extends AdkObjectData {
|
|
1719
|
+
packageRef?: AdtObjectReference;
|
|
1720
|
+
masterSystem?: string;
|
|
1721
|
+
masterLanguage?: string;
|
|
1722
|
+
responsible?: string;
|
|
1723
|
+
abapLanguageVersion?: string;
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* Base class for all ADK objects
|
|
1727
|
+
*
|
|
1728
|
+
* All ADK objects (AdkPackage, AdkTransportRequest, etc.) extend this.
|
|
1729
|
+
* Supports deferred loading - create with just a name, then call load().
|
|
1730
|
+
*
|
|
1731
|
+
* Note: Uses loose type constraint for D to allow schema-inferred types
|
|
1732
|
+
* from contracts which may have different shapes. The getters safely
|
|
1733
|
+
* handle missing properties with defaults.
|
|
1734
|
+
*
|
|
1735
|
+
* @typeParam K - The object kind (from AdkKind)
|
|
1736
|
+
* @typeParam D - The internal data type (typically schema-inferred from contract)
|
|
1737
|
+
*/
|
|
1738
|
+
declare abstract class AdkObject<K extends AdkKind = AdkKind, D = any> {
|
|
1739
|
+
/** Object kind identifier */
|
|
1740
|
+
abstract readonly kind: K;
|
|
1741
|
+
/**
|
|
1742
|
+
* ADT object URI - base path for all operations.
|
|
1743
|
+
* Example: `/sap/bc/adt/oo/classes/zcl_my_class`
|
|
1744
|
+
*/
|
|
1745
|
+
abstract get objectUri(): string;
|
|
1746
|
+
/**
|
|
1747
|
+
* ADT collection URI - base path for creating new objects.
|
|
1748
|
+
* Example: `/sap/bc/adt/oo/classes`
|
|
1749
|
+
* Default: derived from objectUri by removing the object name
|
|
1750
|
+
*/
|
|
1751
|
+
get collectionUri(): string;
|
|
1752
|
+
protected ctx: AdkContext;
|
|
1753
|
+
/** Public access to the ADT client for plugins and external code */
|
|
1754
|
+
get client(): AdtClient;
|
|
1755
|
+
protected _data?: D;
|
|
1756
|
+
protected _name: string;
|
|
1757
|
+
protected cache: Map<string, unknown>;
|
|
1758
|
+
protected dirty: Set<string>;
|
|
1759
|
+
protected _lockHandle?: LockHandle$1;
|
|
1760
|
+
/** Set by save() when all pending changes are identical to SAP state */
|
|
1761
|
+
_unchanged: boolean;
|
|
1762
|
+
/**
|
|
1763
|
+
* Create ADK object
|
|
1764
|
+
* @param ctx - ADK context
|
|
1765
|
+
* @param dataOrName - Full data object OR just the object name for deferred loading
|
|
1766
|
+
*/
|
|
1767
|
+
constructor(ctx: AdkContext, dataOrName: D | string | Record<string, unknown>);
|
|
1768
|
+
/**
|
|
1769
|
+
* Adopt a richer context (merge services into existing context).
|
|
1770
|
+
*
|
|
1771
|
+
* Used by AdkObjectSet to propagate lockService / lockStore
|
|
1772
|
+
* to objects created by plugins that only have { client }.
|
|
1773
|
+
* Keeps the original client reference intact.
|
|
1774
|
+
*/
|
|
1775
|
+
adoptContext(ctx: AdkContext): void;
|
|
1776
|
+
/**
|
|
1777
|
+
* Load object data from SAP
|
|
1778
|
+
*
|
|
1779
|
+
* Default implementation uses crudContract.get() and unwraps with wrapperKey.
|
|
1780
|
+
* Objects without crudContract must override this.
|
|
1781
|
+
*
|
|
1782
|
+
* @returns this (for chaining)
|
|
1783
|
+
*/
|
|
1784
|
+
load(): Promise<this>;
|
|
1785
|
+
/** Whether data has been loaded */
|
|
1786
|
+
get isLoaded(): boolean;
|
|
1787
|
+
/**
|
|
1788
|
+
* Get data - auto-loads if not already loaded
|
|
1789
|
+
* @returns Promise that resolves to the data
|
|
1790
|
+
*/
|
|
1791
|
+
data(): Promise<D>;
|
|
1792
|
+
/**
|
|
1793
|
+
* Get data synchronously - throws if not loaded
|
|
1794
|
+
* Use when you know data is already loaded
|
|
1795
|
+
*/
|
|
1796
|
+
get dataSync(): D;
|
|
1797
|
+
/** Set data (for subclasses to use after loading) */
|
|
1798
|
+
protected setData(data: D): void;
|
|
1799
|
+
/** Helper to access data with AdkObjectData properties */
|
|
1800
|
+
private get coreData();
|
|
1801
|
+
/** ADT object name (adtcore:name) - available even before load() */
|
|
1802
|
+
get name(): string;
|
|
1803
|
+
/** ADT object type (adtcore:type, e.g. 'RQRQ', 'DEVC/K') - requires load() */
|
|
1804
|
+
get type(): string;
|
|
1805
|
+
/** Description text (adtcore:description) */
|
|
1806
|
+
get description(): string;
|
|
1807
|
+
/** Version state (adtcore:version) - active, inactive, etc. */
|
|
1808
|
+
get version(): string;
|
|
1809
|
+
/** Current language (adtcore:language) */
|
|
1810
|
+
get language(): string;
|
|
1811
|
+
/** User who last modified (adtcore:changedBy) */
|
|
1812
|
+
get changedBy(): string;
|
|
1813
|
+
/** Last modification timestamp (adtcore:changedAt) */
|
|
1814
|
+
get changedAt(): Date;
|
|
1815
|
+
/** User who created (adtcore:createdBy) */
|
|
1816
|
+
get createdBy(): string;
|
|
1817
|
+
/** Creation timestamp (adtcore:createdAt) */
|
|
1818
|
+
get createdAt(): Date;
|
|
1819
|
+
/** All atom:link elements */
|
|
1820
|
+
get links(): AtomLink[];
|
|
1821
|
+
/** Find link by rel attribute */
|
|
1822
|
+
getLink(rel: string): AtomLink | undefined;
|
|
1823
|
+
/** Get link href by rel, or undefined */
|
|
1824
|
+
getLinkHref(rel: string): string | undefined;
|
|
1825
|
+
/** Container reference (adtcore:containerRef) */
|
|
1826
|
+
get containerRef(): AdtObjectReference | undefined;
|
|
1827
|
+
/** Check if object is currently locked */
|
|
1828
|
+
get isLocked(): boolean;
|
|
1829
|
+
/** Get current lock handle */
|
|
1830
|
+
get lockHandle(): LockHandle$1 | undefined;
|
|
1831
|
+
/**
|
|
1832
|
+
* Lock the object for modification
|
|
1833
|
+
*
|
|
1834
|
+
* Delegates to the lock service (single lock mechanism).
|
|
1835
|
+
*
|
|
1836
|
+
* The lock response contains:
|
|
1837
|
+
* - LOCK_HANDLE: Required for subsequent PUT/unlock operations
|
|
1838
|
+
* - CORRNR: Transport request assigned to this object (use for PUT if no explicit transport)
|
|
1839
|
+
* - CORRUSER: User who owns the transport
|
|
1840
|
+
*
|
|
1841
|
+
* @param transport - Optional transport request to use for locking.
|
|
1842
|
+
* Required when object is already in a transport.
|
|
1843
|
+
*/
|
|
1844
|
+
lock(transport?: string): Promise<LockHandle$1>;
|
|
1845
|
+
/**
|
|
1846
|
+
* Unlock the object
|
|
1847
|
+
*
|
|
1848
|
+
* Delegates to the lock service (single lock mechanism).
|
|
1849
|
+
*/
|
|
1850
|
+
unlock(): Promise<void>;
|
|
1851
|
+
/**
|
|
1852
|
+
* Set lock handle (for subclasses that need custom lock logic)
|
|
1853
|
+
*/
|
|
1854
|
+
protected setLockHandle(handle: LockHandle$1 | undefined): void;
|
|
1855
|
+
/**
|
|
1856
|
+
* Save the object to SAP
|
|
1857
|
+
*
|
|
1858
|
+
* Generic implementation that handles:
|
|
1859
|
+
* - Lock/unlock lifecycle
|
|
1860
|
+
* - Mode switching (create/update/upsert)
|
|
1861
|
+
* - Error handling
|
|
1862
|
+
*
|
|
1863
|
+
* Subclasses implement `saveViaContract()` to provide the typed contract call.
|
|
1864
|
+
*
|
|
1865
|
+
* Modes:
|
|
1866
|
+
* - 'update' (default): PUT to existing object
|
|
1867
|
+
* - 'create': POST skeleton, then lock → PUT/source → unlock (Eclipse ADT pattern)
|
|
1868
|
+
* - 'upsert': Check existence, create if needed, then update
|
|
1869
|
+
*
|
|
1870
|
+
* @param options - Save options
|
|
1871
|
+
* @returns this (for chaining)
|
|
1872
|
+
*/
|
|
1873
|
+
save(options?: InternalSaveOptions): Promise<this>;
|
|
1874
|
+
/**
|
|
1875
|
+
* Wrapper key for the data in contract requests/responses
|
|
1876
|
+
*
|
|
1877
|
+
* Contracts wrap data like { abapClass: ... } or { abapInterface: ... }.
|
|
1878
|
+
* Subclasses that support save override this.
|
|
1879
|
+
*/
|
|
1880
|
+
protected get wrapperKey(): string | undefined;
|
|
1881
|
+
/**
|
|
1882
|
+
* CRUD contract for this object type
|
|
1883
|
+
*
|
|
1884
|
+
* Subclasses that support save override this to return their contract.
|
|
1885
|
+
*/
|
|
1886
|
+
protected get crudContract(): any;
|
|
1887
|
+
/**
|
|
1888
|
+
* Execute the typed contract call for save
|
|
1889
|
+
*
|
|
1890
|
+
* Generic implementation using wrapperKey and crudContract.
|
|
1891
|
+
* Objects that don't support save leave wrapperKey/crudContract undefined.
|
|
1892
|
+
*
|
|
1893
|
+
* For 'create' mode: POSTs skeleton data (minimal fields).
|
|
1894
|
+
* For 'update' mode: PUTs full data (all fields except abapLanguageVersion).
|
|
1895
|
+
*
|
|
1896
|
+
* @param mode - 'create' (POST skeleton) or 'update' (PUT full)
|
|
1897
|
+
* @param options - Contract options (transport, lockHandle)
|
|
1898
|
+
*/
|
|
1899
|
+
protected saveViaContract(mode: 'create' | 'update', options: {
|
|
1900
|
+
transport?: string;
|
|
1901
|
+
lockHandle?: string;
|
|
1902
|
+
}): Promise<void>;
|
|
1903
|
+
/**
|
|
1904
|
+
* Get skeleton data for object creation (POST).
|
|
1905
|
+
*
|
|
1906
|
+
* Returns only the minimal fields needed to create the object on SAP.
|
|
1907
|
+
* SAP creates the object structure (includes, etc.) from these fields.
|
|
1908
|
+
* Full metadata and source code are sent via PUT in the update step.
|
|
1909
|
+
*
|
|
1910
|
+
* Override in subclasses that need different skeleton fields.
|
|
1911
|
+
*/
|
|
1912
|
+
protected getSkeletonData(): Promise<Record<string, unknown>>;
|
|
1913
|
+
/**
|
|
1914
|
+
* Check if the object exists on the SAP system.
|
|
1915
|
+
*
|
|
1916
|
+
* Used by upsert mode to decide between update and create paths upfront.
|
|
1917
|
+
* On BTP, locking a non-existent DDIC object creates a draft that persists
|
|
1918
|
+
* even after unlock, blocking subsequent POST (create) attempts. Checking
|
|
1919
|
+
* existence first with GET avoids this problem entirely.
|
|
1920
|
+
*/
|
|
1921
|
+
protected checkObjectExists(): Promise<boolean>;
|
|
1922
|
+
/**
|
|
1923
|
+
* Check if error is a 404 Not Found
|
|
1924
|
+
*/
|
|
1925
|
+
protected isNotFoundError(e: unknown): boolean;
|
|
1926
|
+
/**
|
|
1927
|
+
* Some CTS backends can retain the lock created by a successful object POST
|
|
1928
|
+
* long enough for the immediate follow-up LOCK to fail. This is distinct
|
|
1929
|
+
* from an arbitrary edit conflict because this save invocation already
|
|
1930
|
+
* created the skeleton successfully.
|
|
1931
|
+
*/
|
|
1932
|
+
private isPostCreateLockConflict;
|
|
1933
|
+
/**
|
|
1934
|
+
* Some backends retain the lock implicitly created by a successful POST for
|
|
1935
|
+
* a short time. Retry only this known follow-up LOCK; no arbitrary update or
|
|
1936
|
+
* source write is repeated, and each successful lock still uses the normal
|
|
1937
|
+
* handle-backed save/unlock lifecycle.
|
|
1938
|
+
*/
|
|
1939
|
+
private lockAfterCreate;
|
|
1940
|
+
/**
|
|
1941
|
+
* Upsert fallback: try POST (create), treat 422 "already exists" as unchanged.
|
|
1942
|
+
* Extracted to avoid duplication in lock-catch and saveViaContract-catch paths.
|
|
1943
|
+
*/
|
|
1944
|
+
private fallbackToCreate;
|
|
1945
|
+
/**
|
|
1946
|
+
* Check if error suggests the object doesn't exist or the operation
|
|
1947
|
+
* is not supported for the current state.
|
|
1948
|
+
*
|
|
1949
|
+
* Some SAP DDIC endpoints (TABL, TTYP) return 405 Method Not Allowed
|
|
1950
|
+
* instead of 404 when attempting to lock or PUT a non-existent object.
|
|
1951
|
+
* In upsert mode, both should trigger a fallback to POST (create).
|
|
1952
|
+
*/
|
|
1953
|
+
protected shouldFallbackToCreate(e: unknown): boolean;
|
|
1954
|
+
/**
|
|
1955
|
+
* Check if error is a 422 "already exists" from a POST create attempt
|
|
1956
|
+
*/
|
|
1957
|
+
protected isAlreadyExistsError(e: unknown): boolean;
|
|
1958
|
+
/**
|
|
1959
|
+
* Check if object has pending sources to save
|
|
1960
|
+
* Subclasses with source code (classes, interfaces) override this
|
|
1961
|
+
*/
|
|
1962
|
+
protected hasPendingSources(): boolean;
|
|
1963
|
+
/**
|
|
1964
|
+
* Normalize source code for comparison.
|
|
1965
|
+
* Trims trailing whitespace/newlines so minor formatting differences
|
|
1966
|
+
* don't trigger unnecessary saves.
|
|
1941
1967
|
*/
|
|
1942
|
-
|
|
1943
|
-
transport?: string;
|
|
1944
|
-
}, ctx?: AdkContext): Promise<AdkBehaviorDefinition>;
|
|
1945
|
-
static delete(name: string, options?: {
|
|
1946
|
-
transport?: string;
|
|
1947
|
-
lockHandle?: string;
|
|
1948
|
-
}, ctx?: AdkContext): Promise<void>;
|
|
1949
|
-
}
|
|
1950
|
-
interface SrvdMetadata {
|
|
1951
|
-
srvdSource?: {
|
|
1952
|
-
description?: string;
|
|
1953
|
-
masterLanguage?: string;
|
|
1954
|
-
abapLanguageVersion?: string;
|
|
1955
|
-
packageRef?: {
|
|
1956
|
-
name?: string;
|
|
1957
|
-
};
|
|
1958
|
-
sourceOrigin?: string;
|
|
1959
|
-
srvdSourceType?: string;
|
|
1960
|
-
};
|
|
1961
|
-
}
|
|
1962
|
-
declare class AdkServiceDefinition extends AdkCrudSourceObject<SrvdMetadata> {
|
|
1963
|
-
/** Static ADK kind marker — used by abapGit handler registry if needed. */
|
|
1964
|
-
static readonly kind: "ServiceDefinition";
|
|
1965
|
-
readonly kind: "ServiceDefinition";
|
|
1966
|
-
protected readonly objectType = "SRVD";
|
|
1967
|
-
protected readonly endpoint = "ddic/srvd/sources";
|
|
1968
|
-
protected get contract(): AdkCrudSourceContract;
|
|
1969
|
-
protected getMetadataKey(): 'srvdSource';
|
|
1970
|
-
get sourceOrigin(): string | undefined;
|
|
1971
|
-
get sourceType(): string | undefined;
|
|
1968
|
+
protected normalizeSource(source: string): string;
|
|
1972
1969
|
/**
|
|
1973
|
-
*
|
|
1970
|
+
* Check if pending sources are unchanged vs SAP (pre-lock comparison).
|
|
1971
|
+
* Sets _unchanged = true if nothing needs saving.
|
|
1972
|
+
*
|
|
1973
|
+
* Default handles single-source objects (_pendingSource) by fetching
|
|
1974
|
+
* GET {objectUri}/source/main and comparing.
|
|
1975
|
+
* AdkClass overrides this for multi-include logic.
|
|
1974
1976
|
*/
|
|
1975
|
-
|
|
1976
|
-
static exists(name: string, ctx?: AdkContext): Promise<boolean>;
|
|
1977
|
+
protected checkPendingSourcesUnchanged(): Promise<void>;
|
|
1977
1978
|
/**
|
|
1978
|
-
*
|
|
1979
|
+
* Check if metadata-only objects are unchanged on SAP.
|
|
1979
1980
|
*
|
|
1980
|
-
*
|
|
1981
|
-
*
|
|
1982
|
-
*
|
|
1981
|
+
* For objects without source code (DDIC types like DOMA, DTEL, TABL, TTYP),
|
|
1982
|
+
* fetches the current SAP state and compares only the fields present in
|
|
1983
|
+
* the local data. SAP returns extra volatile fields (timestamps, links,
|
|
1984
|
+
* version, etc.) that are ignored — only semantic fields matter.
|
|
1983
1985
|
*/
|
|
1984
|
-
|
|
1985
|
-
transport?: string;
|
|
1986
|
-
}, ctx?: AdkContext): Promise<AdkServiceDefinition>;
|
|
1987
|
-
static delete(name: string, options?: {
|
|
1988
|
-
transport?: string;
|
|
1989
|
-
lockHandle?: string;
|
|
1990
|
-
}, ctx?: AdkContext): Promise<void>;
|
|
1991
|
-
}
|
|
1992
|
-
declare class AdkServiceBinding {
|
|
1993
|
-
/** Static ADK kind marker — used by abapGit handler registry if needed. */
|
|
1994
|
-
static readonly kind: "ServiceBinding";
|
|
1995
|
-
readonly kind: "ServiceBinding";
|
|
1996
|
-
readonly name: string;
|
|
1997
|
-
protected readonly ctx: AdkContext;
|
|
1998
|
-
constructor(ctx: AdkContext, nameOrData: string | Record<string, unknown>);
|
|
1999
|
-
get objectUri(): string;
|
|
2000
|
-
/** Placeholder description — full metadata requires additional SAP fetch */
|
|
2001
|
-
get description(): string;
|
|
2002
|
-
private get contract();
|
|
1986
|
+
protected checkMetadataUnchanged(): Promise<void>;
|
|
2003
1987
|
/**
|
|
2004
|
-
*
|
|
2005
|
-
*
|
|
1988
|
+
* Refresh cached ETags after acquiring a lock.
|
|
1989
|
+
*
|
|
1990
|
+
* SAP changes the object's internal version when a lock is acquired,
|
|
1991
|
+
* which invalidates any cached ETags. Without refreshing, the next
|
|
1992
|
+
* PUT sends a stale If-Match header and SAP returns HTTP 412.
|
|
1993
|
+
*
|
|
1994
|
+
* For objects with pending sources: re-GET {objectUri}/source/main
|
|
1995
|
+
* For metadata-only objects: re-GET via crudContract.get()
|
|
1996
|
+
*
|
|
1997
|
+
* Subclasses with multiple source endpoints (e.g., AdkClass with includes)
|
|
1998
|
+
* should override this to refresh all relevant endpoints.
|
|
2006
1999
|
*/
|
|
2007
|
-
|
|
2008
|
-
getSource(): Promise<string>;
|
|
2009
|
-
load(): Promise<this>;
|
|
2010
|
-
lock(transport?: string): Promise<{
|
|
2011
|
-
handle: string;
|
|
2012
|
-
}>;
|
|
2013
|
-
unlock(lockHandle: string): Promise<void>;
|
|
2014
|
-
activate(): Promise<this>;
|
|
2000
|
+
protected refreshETagsAfterLock(): Promise<void>;
|
|
2015
2001
|
/**
|
|
2016
|
-
*
|
|
2017
|
-
*
|
|
2002
|
+
* Save pending sources to SAP.
|
|
2003
|
+
*
|
|
2004
|
+
* Default handles single-source objects (_pendingSource) by PUTting
|
|
2005
|
+
* to {objectUri}/source/main.
|
|
2006
|
+
* AdkClass overrides this for multi-include logic.
|
|
2018
2007
|
*/
|
|
2019
|
-
|
|
2008
|
+
protected savePendingSources(options?: {
|
|
2009
|
+
lockHandle?: string;
|
|
2010
|
+
transport?: string;
|
|
2011
|
+
}): Promise<void>;
|
|
2020
2012
|
/**
|
|
2021
|
-
*
|
|
2022
|
-
*
|
|
2013
|
+
* Set source content for a source-based object
|
|
2014
|
+
*
|
|
2015
|
+
* Generic implementation for objects with source code (classes, includes, etc.)
|
|
2016
|
+
* Subclasses should override if they need custom source handling.
|
|
2017
|
+
*
|
|
2018
|
+
* @param sourcePath - Relative path to source (e.g., '/source/main')
|
|
2019
|
+
* @param content - Source code content
|
|
2020
|
+
* @param options - Save options
|
|
2023
2021
|
*/
|
|
2024
|
-
|
|
2022
|
+
setSource(sourcePath: string, content: string, options?: SaveOptions): Promise<void>;
|
|
2025
2023
|
/**
|
|
2026
|
-
*
|
|
2024
|
+
* Activate this object
|
|
2025
|
+
*
|
|
2026
|
+
* Activates a single object. For bulk activation of multiple objects,
|
|
2027
|
+
* use `AdkObjectSet.activateAll()`.
|
|
2028
|
+
*
|
|
2029
|
+
* @returns this (for chaining)
|
|
2027
2030
|
*/
|
|
2028
|
-
|
|
2029
|
-
|
|
2031
|
+
activate(): Promise<this>;
|
|
2032
|
+
/** Lazy load a segment (async) - fetches only once, then cached */
|
|
2033
|
+
protected lazy<T>(key: string, loader: () => Promise<T>): Promise<T>;
|
|
2034
|
+
/** Lazy compute a segment (sync) - computes only once, then cached */
|
|
2035
|
+
protected cached<T>(key: string, compute: () => T): T;
|
|
2036
|
+
/** Set a cached value directly (for local/generated data) */
|
|
2037
|
+
protected set<T>(key: string, value: T): void;
|
|
2038
|
+
/** Mark a segment as dirty (modified locally) */
|
|
2039
|
+
protected markDirty(key: string): void;
|
|
2040
|
+
/** Check if any segment (or specific segment) is dirty */
|
|
2041
|
+
isDirty(segment?: string): boolean;
|
|
2042
|
+
/** Clear cache for a segment (force reload on next access) */
|
|
2043
|
+
protected invalidate(key: string): void;
|
|
2030
2044
|
/**
|
|
2031
|
-
*
|
|
2045
|
+
* Fetch a text resource from an ADT endpoint.
|
|
2046
|
+
* Delegates to the underlying ADT client's fetch.
|
|
2032
2047
|
*
|
|
2033
|
-
*
|
|
2034
|
-
*
|
|
2048
|
+
* @param url - ADT endpoint path (e.g., '/sap/bc/adt/ddic/dataelements/spras')
|
|
2049
|
+
* @param headers - Optional HTTP headers (defaults to no Accept header, letting server choose)
|
|
2050
|
+
* @returns Response content as text, or undefined if 404
|
|
2035
2051
|
*/
|
|
2036
|
-
|
|
2037
|
-
transport?: string;
|
|
2038
|
-
}, ctx?: AdkContext): Promise<AdkServiceBinding>;
|
|
2039
|
-
static delete(name: string, options?: {
|
|
2040
|
-
transport?: string;
|
|
2041
|
-
lockHandle?: string;
|
|
2042
|
-
}, ctx?: AdkContext): Promise<void>;
|
|
2043
|
-
static publish(name: string, ctx?: AdkContext): Promise<void>;
|
|
2044
|
-
static unpublish(name: string, ctx?: AdkContext): Promise<void>;
|
|
2052
|
+
fetchText(url: string, headers?: Record<string, string>): Promise<string | undefined>;
|
|
2045
2053
|
}
|
|
2046
2054
|
/**
|
|
2047
|
-
*
|
|
2055
|
+
* Base class for main development objects (AdtMainObject)
|
|
2048
2056
|
*
|
|
2049
|
-
*
|
|
2050
|
-
*
|
|
2057
|
+
* Extends AdkObject with package reference, responsible user, and master language.
|
|
2058
|
+
* Used for repository objects like classes, interfaces, packages, etc.
|
|
2051
2059
|
*
|
|
2052
|
-
*
|
|
2053
|
-
*
|
|
2054
|
-
*
|
|
2055
|
-
*/
|
|
2056
|
-
declare const TransportRequest: "TransportRequest";
|
|
2057
|
-
declare const TransportTask$1: "TransportTask";
|
|
2058
|
-
declare const Package: "Package";
|
|
2059
|
-
declare const Class: "Class";
|
|
2060
|
-
declare const Interface: "Interface";
|
|
2061
|
-
declare const FunctionGroup: "FunctionGroup";
|
|
2062
|
-
declare const FunctionModule: "FunctionModule";
|
|
2063
|
-
declare const Program: "Program";
|
|
2064
|
-
declare const Include: "Include";
|
|
2065
|
-
declare const Table: "Table";
|
|
2066
|
-
declare const Structure: "Structure";
|
|
2067
|
-
declare const DataElement: "DataElement";
|
|
2068
|
-
declare const Domain: "Domain";
|
|
2069
|
-
declare const TableType: "TableType";
|
|
2070
|
-
declare const DdlSource: "DdlSource";
|
|
2071
|
-
declare const DclSource: "DclSource";
|
|
2072
|
-
declare const DdlExtension: "DdlExtension";
|
|
2073
|
-
declare const CdsAspect: "CdsAspect";
|
|
2074
|
-
declare const CdsType: "CdsType";
|
|
2075
|
-
declare const ScalarFunctionDefinition: "ScalarFunctionDefinition";
|
|
2076
|
-
declare const ScalarFunctionImplementation: "ScalarFunctionImplementation";
|
|
2077
|
-
declare const EntityBuffer: "EntityBuffer";
|
|
2078
|
-
declare const DynamicCache: "DynamicCache";
|
|
2079
|
-
declare const TuningIndex: "TuningIndex";
|
|
2080
|
-
declare const StaticCache: "StaticCache";
|
|
2081
|
-
declare const ExternalSchema: "ExternalSchema";
|
|
2082
|
-
declare const BehaviorDefinition: "BehaviorDefinition";
|
|
2083
|
-
declare const ServiceDefinition: "ServiceDefinition";
|
|
2084
|
-
declare const ServiceBinding: "ServiceBinding";
|
|
2085
|
-
declare const MessageClass: "MessageClass";
|
|
2086
|
-
declare const EnhancementSpot: "EnhancementSpot";
|
|
2087
|
-
/** Union type of all ADK kinds */
|
|
2088
|
-
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 DdlSource | typeof DclSource | typeof DdlExtension | typeof CdsAspect | typeof CdsType | typeof ScalarFunctionDefinition | typeof ScalarFunctionImplementation | typeof EntityBuffer | typeof DynamicCache | typeof TuningIndex | typeof StaticCache | typeof ExternalSchema | typeof BehaviorDefinition | typeof ServiceDefinition | typeof ServiceBinding | typeof MessageClass | typeof EnhancementSpot;
|
|
2089
|
-
/**
|
|
2090
|
-
* Maps ADK kind to concrete object type
|
|
2060
|
+
* Note: Uses type assertions internally because schema-inferred types from
|
|
2061
|
+
* contracts may have different shapes than AdkMainObjectData. The getters
|
|
2062
|
+
* safely handle missing properties with defaults.
|
|
2091
2063
|
*
|
|
2092
|
-
*
|
|
2093
|
-
*
|
|
2094
|
-
* const cls = factory.byKind(Class, 'ZCL_TEST'); // → AdkClass
|
|
2095
|
-
* const intf = factory.byKind(Interface, 'ZIF'); // → AdkInterface
|
|
2096
|
-
* ```
|
|
2097
|
-
*/
|
|
2098
|
-
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 : K extends typeof DdlSource ? AdkDdlSource : K extends typeof DclSource ? AdkDclSource : K extends typeof DdlExtension ? AdkDdlExtension : K extends typeof CdsAspect ? AdkCdsAspect : K extends typeof CdsType ? AdkCdsType : K extends typeof ScalarFunctionDefinition ? AdkScalarFunctionDefinition : K extends typeof ScalarFunctionImplementation ? AdkScalarFunctionImplementation : K extends typeof EntityBuffer ? AdkEntityBuffer : K extends typeof DynamicCache ? AdkDynamicCache : K extends typeof TuningIndex ? AdkTuningIndex : K extends typeof StaticCache ? AdkStaticCache : K extends typeof ExternalSchema ? AdkExternalSchema : K extends typeof BehaviorDefinition ? AdkBehaviorDefinition : K extends typeof ServiceDefinition ? AdkServiceDefinition : K extends typeof ServiceBinding ? AdkServiceBinding : AdkObject;
|
|
2099
|
-
/**
|
|
2100
|
-
* Base interface for all ABAP objects
|
|
2064
|
+
* @typeParam K - The object kind (from AdkKind)
|
|
2065
|
+
* @typeParam D - The internal data type (typically schema-inferred from contract)
|
|
2101
2066
|
*/
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2067
|
+
declare abstract class AdkMainObject<K extends AdkKind = AdkKind, D = any> extends AdkObject<K, D> {
|
|
2068
|
+
private get mainData();
|
|
2069
|
+
/** Package reference (adtcore:packageRef) */
|
|
2070
|
+
get packageRef(): AdtObjectReference | undefined;
|
|
2071
|
+
/** Package name (convenience getter) */
|
|
2072
|
+
get package(): string;
|
|
2073
|
+
/** Master system (adtcore:masterSystem) */
|
|
2074
|
+
get masterSystem(): string;
|
|
2075
|
+
/** Master language (adtcore:masterLanguage) */
|
|
2076
|
+
get masterLanguage(): string;
|
|
2077
|
+
/** Responsible user (adtcore:responsible) */
|
|
2078
|
+
get responsible(): string;
|
|
2079
|
+
/** ABAP language version (adtcore:abapLanguageVersion) */
|
|
2080
|
+
get abapLanguageVersion(): string;
|
|
2107
2081
|
/**
|
|
2108
|
-
*
|
|
2082
|
+
* Save main source code to SAP.
|
|
2083
|
+
* Requires the object to be locked before calling.
|
|
2084
|
+
* Subclasses may override to add additional behavior (e.g. cache invalidation).
|
|
2109
2085
|
*/
|
|
2110
|
-
|
|
2086
|
+
saveMainSource(source: string, options?: {
|
|
2087
|
+
lockHandle?: string;
|
|
2088
|
+
transport?: string;
|
|
2089
|
+
}): Promise<void>;
|
|
2111
2090
|
}
|
|
2112
2091
|
/**
|
|
2113
2092
|
* Result of bulk save operation
|
|
@@ -2218,6 +2197,13 @@ declare class AdkObjectSet {
|
|
|
2218
2197
|
* @returns Activation result with success/failure counts
|
|
2219
2198
|
*/
|
|
2220
2199
|
activateAll(options?: BulkActivateOptions): Promise<ActivationResult>;
|
|
2200
|
+
/**
|
|
2201
|
+
* Step 2b: Retry deferred sources after activation.
|
|
2202
|
+
*
|
|
2203
|
+
* Some includes (e.g., testclasses) may not exist until activation creates
|
|
2204
|
+
* them. Failures are folded back into `saveResult` counts.
|
|
2205
|
+
*/
|
|
2206
|
+
private retryDeferredSources;
|
|
2221
2207
|
/**
|
|
2222
2208
|
* Save all objects as inactive, then bulk activate, then unlock
|
|
2223
2209
|
*
|
|
@@ -2535,18 +2521,14 @@ declare abstract class AdkClassicBadiBase {
|
|
|
2535
2521
|
abstract get kind(): string;
|
|
2536
2522
|
abstract get objectUri(): string;
|
|
2537
2523
|
abstract getMetadata(): Promise<BasicObjectPropertiesResponse>;
|
|
2538
|
-
static get<T extends AdkClassicBadiBase>(this: {
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
ctx: AdkContext;
|
|
2547
|
-
name: string;
|
|
2548
|
-
}): T;
|
|
2549
|
-
}, input: ClassicBadiInput): Promise<boolean>;
|
|
2524
|
+
static get<T extends AdkClassicBadiBase>(this: new (input: {
|
|
2525
|
+
ctx: AdkContext;
|
|
2526
|
+
name: string;
|
|
2527
|
+
}) => T, input: ClassicBadiInput): Promise<T>;
|
|
2528
|
+
static exists<T extends AdkClassicBadiBase>(this: new (input: {
|
|
2529
|
+
ctx: AdkContext;
|
|
2530
|
+
name: string;
|
|
2531
|
+
}) => T, input: ClassicBadiInput): Promise<boolean>;
|
|
2550
2532
|
}
|
|
2551
2533
|
declare class AdkClassicBadiDefinition extends AdkClassicBadiBase {
|
|
2552
2534
|
readonly kind: "ClassicBadiDefinition";
|
|
@@ -3172,6 +3154,8 @@ declare class AdkGenericObject {
|
|
|
3172
3154
|
/** Set data (for manual population) */
|
|
3173
3155
|
setData(data: unknown): void;
|
|
3174
3156
|
}
|
|
3157
|
+
/** Any object produced by the factory */
|
|
3158
|
+
type AnyAdkObject = AdkObject | AdkGenericObject | AdkRegistrable;
|
|
3175
3159
|
/**
|
|
3176
3160
|
* ADK Factory - Generic object creation
|
|
3177
3161
|
*/
|
|
@@ -3191,7 +3175,7 @@ interface AdkFactory {
|
|
|
3191
3175
|
* const cls = factory.get('ZCL_TEST', 'CLAS');
|
|
3192
3176
|
* await cls.load();
|
|
3193
3177
|
*/
|
|
3194
|
-
get(name: string, adtType: string):
|
|
3178
|
+
get(name: string, adtType: string): AnyAdkObject;
|
|
3195
3179
|
/**
|
|
3196
3180
|
* Get object with initial data (for deserialization)
|
|
3197
3181
|
*
|
|
@@ -3202,7 +3186,7 @@ interface AdkFactory {
|
|
|
3202
3186
|
* const cls = factory.getWithData({ name: 'ZCL_TEST', description: 'Test' }, 'CLAS');
|
|
3203
3187
|
* // cls.isLoaded is true, no need to call load()
|
|
3204
3188
|
*/
|
|
3205
|
-
getWithData(data: Record<string, unknown>, adtType: string):
|
|
3189
|
+
getWithData(data: Record<string, unknown>, adtType: string): AnyAdkObject;
|
|
3206
3190
|
/**
|
|
3207
3191
|
* Get object by ADK kind (type-safe)
|
|
3208
3192
|
*
|
|
@@ -3225,14 +3209,14 @@ interface AdkFactory {
|
|
|
3225
3209
|
* const xml = await client.fetch('/sap/bc/adt/oo/classes/ZCL_TEST');
|
|
3226
3210
|
* const cls = factory.fromXml(xml);
|
|
3227
3211
|
*/
|
|
3228
|
-
fromXml(xml: string):
|
|
3212
|
+
fromXml(xml: string): AnyAdkObject | undefined;
|
|
3229
3213
|
/**
|
|
3230
3214
|
* Create new object (for creation workflows)
|
|
3231
3215
|
*
|
|
3232
3216
|
* Returns deferred object without name - used when
|
|
3233
3217
|
* creating new objects in SAP.
|
|
3234
3218
|
*/
|
|
3235
|
-
create(adtType: string):
|
|
3219
|
+
create(adtType: string): AnyAdkObject;
|
|
3236
3220
|
}
|
|
3237
3221
|
/**
|
|
3238
3222
|
* Create ADK factory
|
|
@@ -3258,5 +3242,5 @@ declare function createAdkFactory(ctx: AdkContext): AdkFactory;
|
|
|
3258
3242
|
* await cls.load();
|
|
3259
3243
|
*/
|
|
3260
3244
|
declare function createAdk(client: AdtClient$1): AdkFactory;
|
|
3261
|
-
export { ADT_TYPE_MAPPINGS, type AbapClass, type AbapFunctionGroup, type AbapFunctionModule, type AbapInclude, type AbapInterface, type AbapObject, type AbapPackage, type AbapProgram, type ActivationResult, AdkBadi, AdkBehaviorDefinition, AdkCdsAspect, AdkCdsType, AdkClass, AdkClassicBadiDefinition, AdkClassicBadiImplementation, type AdkContext, type AdkContract, AdkDataElement, AdkDclSource, AdkDdlExtension, AdkDdlSource, AdkDomain, AdkDynamicCache, AdkEntityBuffer, AdkExternalSchema, type AdkFactory, AdkFunctionGroup, AdkFunctionModule, AdkGenericObject, AdkInclude, AdkInterface, AdkKind, AdkMainObject, type AdkMainObjectData, AdkObject, type AdkObjectData, AdkObjectForKind, AdkObjectSet, AdkPackage, AdkPostCreateLockError, AdkProgram, AdkScalarFunctionDefinition, AdkScalarFunctionImplementation, AdkServiceBinding, AdkServiceDefinition, AdkStaticCache, AdkStructure, AdkTable, AdkTableType, AdkTransport, AdkTransportRequest as AdkTransportItem, AdkTransportRequest, AdkTransportObject, AdkTransportObjectRef, AdkTransportTask, AdkTransportTaskRef, AdkTuningIndex, type AdtClient, type AdtContracts, type AdtObjectReference, type ApplicationComponent, type AtomLink, BehaviorDefinition, type BuildTransportSourceManifestOptions, type BulkActivateOptions, type BulkSaveOptions, type BulkSaveResult, CdsAspect, CdsType, Class, type ClassCategory, type ClassInclude, type ClassIncludeType, type ClassResponse, type ClassVisibility, type ClassXml, DataElement, type DataElementResponse, type DataElementXml, DclSource, DdlExtension, DdlSource, Domain, type DomainResponse, type DomainXml, DynamicCache, EnhancementSpot, EntityBuffer, ExternalSchema, FunctionGroup, type FunctionGroupResponse, type FunctionGroupXml, FunctionModule, type FunctionModuleResponse, type FunctionModuleXml, Include, type IncludeResponse, type IncludeXml, Interface, type InterfaceResponse, type InterfaceXml, type ListObjectSourceVersionsOptions, type LockEntry, type LockHandle, type LockRegistry, type LockService, type LockStore, MergedTransportView, MessageClass, type NameTransform, type ObjectReference, ObjectSourceHistoryError, type ObjectSourceHistoryErrorCode, type ObjectSourceHistoryIdentity, type ObjectSourceVersionsComponent, type ObjectSourceVersionsResult, Package, type PackageAttributes, type PackageResponse, type PackageType, type PackageXml, Program, type ProgramResponse, type ProgramXml, type RegisterObjectTypeOptions, type ReleaseResult, type ResolvedTransportObjects, type SaveOptions, ScalarFunctionDefinition, ScalarFunctionImplementation, ServiceBinding, ServiceDefinition, type SoftwareComponent, type SourceHistoryDiagnostic, type SourceHistoryDiagnosticCode, StaticCache, Structure, Table, TableType, type TableTypeResponse, type TableTypeXml, type TableXml, type TransportConfig, type TransportCreateOptions, type TransportData, type TransportGetResponse, type TransportGetResponse as TransportResponse, type TransportInventoryResolution, type TransportLayer, type
|
|
3245
|
+
export { ADT_TYPE_MAPPINGS, type AbapClass, type AbapFunctionGroup, type AbapFunctionModule, type AbapInclude, type AbapInterface, type AbapObject, type AbapPackage, type AbapProgram, type ActivationResult, AdkBadi, AdkBehaviorDefinition, AdkCdsAspect, AdkCdsType, AdkClass, AdkClassicBadiDefinition, AdkClassicBadiImplementation, type AdkContext, type AdkContract, AdkDataElement, AdkDclSource, AdkDdlExtension, AdkDdlSource, AdkDomain, AdkDynamicCache, AdkEntityBuffer, AdkExternalSchema, type AdkFactory, AdkFunctionGroup, AdkFunctionModule, AdkGenericObject, AdkInclude, AdkInterface, AdkKind, AdkMainObject, type AdkMainObjectData, AdkObject, type AdkObjectData, AdkObjectForKind, AdkObjectSet, AdkPackage, AdkPostCreateLockError, AdkProgram, AdkScalarFunctionDefinition, AdkScalarFunctionImplementation, AdkServiceBinding, AdkServiceDefinition, AdkStaticCache, AdkStructure, AdkTable, AdkTableType, AdkTransport, AdkTransportRequest as AdkTransportItem, AdkTransportRequest, AdkTransportObject, AdkTransportObjectRef, AdkTransportTask, AdkTransportTaskRef, AdkTuningIndex, type AdtClient, type AdtContracts, type AdtObjectReference, type ApplicationComponent, type AtomLink, BehaviorDefinition, type BuildTransportSourceManifestOptions, type BulkActivateOptions, type BulkSaveOptions, type BulkSaveResult, CdsAspect, CdsType, Class, type ClassCategory, type ClassInclude, type ClassIncludeType, type ClassResponse, type ClassVisibility, type ClassXml, DataElement, type DataElementResponse, type DataElementXml, DclSource, DdlExtension, DdlSource, Domain, type DomainResponse, type DomainXml, DynamicCache, EnhancementSpot, EntityBuffer, ExternalSchema, FunctionGroup, type FunctionGroupResponse, type FunctionGroupXml, FunctionModule, type FunctionModuleResponse, type FunctionModuleXml, Include, type IncludeResponse, type IncludeXml, Interface, type InterfaceResponse, type InterfaceXml, type ListObjectSourceVersionsOptions, type LockEntry, type LockHandle, type LockRegistry, type LockService, type LockStore, MergedTransportView, MessageClass, type NameTransform, type ObjectReference, ObjectSourceHistoryError, type ObjectSourceHistoryErrorCode, type ObjectSourceHistoryIdentity, type ObjectSourceVersionsComponent, type ObjectSourceVersionsResult, Package, type PackageAttributes, type PackageResponse, type PackageType, type PackageXml, Program, type ProgramResponse, type ProgramXml, type RegisterObjectTypeOptions, type ReleaseResult, type ResolvedTransportObjects, type SaveOptions, ScalarFunctionDefinition, ScalarFunctionImplementation, ServiceBinding, ServiceDefinition, type SoftwareComponent, type SourceHistoryDiagnostic, type SourceHistoryDiagnosticCode, StaticCache, Structure, Table, TableType, type TableTypeResponse, type TableTypeXml, type TableXml, type TransportConfig, type TransportCreateOptions, type TransportData, type TransportGetResponse, type TransportGetResponse as TransportResponse, type TransportInventoryResolution, type TransportLayer, type TransportObjectData, type TransportObjectOwnerReference, type TransportObjectSelector, TransportRequest, type TransportRequestData, type TransportSourceChangeKind, type TransportSourceDiagnostic, type TransportSourceManifest, type TransportSourceManifestComponent, type TransportSourceManifestEntry, type TransportSourceManifestObject, type TransportSourceVersionSelection, type TransportStatus, TransportTask, type TransportTaskData, type TransportType, type TransportUpdateOptions, TuningIndex, buildTransportSourceManifest, clearConfigCache, createAdk, createAdkContract, createAdkFactory, createLockService, getEndpointForType, getGlobalContext, getKindForType, getMainType, getObjectRootUri, getObjectUri, getRegisteredKinds, getRegisteredTypes, getTypeForKind, initializeAdk, isAdkInitialized, isTypeRegistered, listObjectSourceVersions, matchesSelector, normalizeObjectName, parseAdtType, parseXmlIdentity, registerObjectType, resetAdk, resolveClassComponentOwnerName, resolveKind, resolveTransportObjects, resolveType, selectTransportSourceVersions, tryGetGlobalContext };
|
|
3262
3246
|
//# sourceMappingURL=index.d.mts.map
|