/** * WhereUsed handler using AdtClient utilities * Endpoint: /sap/bc/adt/repository/informationsystem/usageReferences * Uses getWhereUsedList for parsed results * * On legacy systems (BASIS < 7.50) createAdtClient() returns AdtClientLegacy, * whose utils skip the scope step and address DDIC objects through VIT URIs * (client library >= 3.15.0). * * BASIS < 7.40 (e.g. 7.31) has no repository information system resource at * all, so the search runs in SAP through ZMCP_ADT_DISPATCH action WHERE_USED * (cross-reference tables WBCROSSGT / CROSS / D010INC, DDIC usage DD03L / * DD04L) instead. */ import type { HandlerContext } from '../../../lib/handlers/interfaces'; export declare const SUPPORTED_WHERE_USED_TYPES = "class, interface, program, include, functiongroup, function_module, table, structure, dataelement, domain, view, tabletype (ECC), transaction (ECC), messageclass (ECC), package"; export declare const TOOL_DEFINITION: { readonly name: "GetWhereUsed"; readonly available_in: readonly ["onprem", "cloud", "legacy"]; readonly description: "[read-only] Find where-used references (cross-references, usages, dependencies) for ABAP objects — classes, interfaces, tables, data elements, programs, function modules, etc. Returns list of all referencing objects with their types and packages. On ECC a function module may be given by plain name (no GROUP|FM needed). Widely used SAP standard tables (e.g. VBAK) can take about 60 s and return thousands of references — use customer_only / package / max_results to shrink the answer (filtering happens after the SAP search, so it does not shorten the search time). Pass references[].object_identifier to GetUsageSnippets for line-level hits."; readonly inputSchema: { readonly type: "object"; readonly properties: { readonly object_name: { readonly type: "string"; readonly description: "Name of the ABAP object"; }; readonly object_type: { readonly type: "string"; readonly description: "Type of the ABAP object: class, interface, program, include, functiongroup, function_module, table, structure, dataelement, domain, view, tabletype (ECC), transaction (ECC), messageclass (ECC), package"; }; readonly enable_all_types: { readonly type: "boolean"; readonly description: "If true, searches in all available object types (Eclipse 'select all' behavior). Default: false (uses SAP default scope). Ignored on ECC (no scope resource)."; readonly default: false; }; readonly max_results: { readonly type: "number"; readonly description: "Optional cap on references[] after filtering. Omit or 0 = no cap. truncated=true when more were found."; }; readonly customer_only: { readonly type: "boolean"; readonly description: "Optional. Keep only customer objects: name starting with Z / Y, or package Z* / Y* / $*. Objects in /namespace/ (SAP industry solutions, partners, generated /1.../) are dropped; for a registered customer namespace use package: \"/ACME/*\" instead. Default: false."; readonly default: false; }; readonly package: { readonly type: "string"; readonly description: "Optional package filter on references[].package_name: exact name, or prefix with a trailing * (e.g. ZSD*)."; }; readonly timeout_ms: { readonly type: "number"; readonly description: "Optional request timeout in ms for the SAP search. Default: SAP_TIMEOUT_LONG (120 s) on ECC, SAP_TIMEOUT_DEFAULT (45 s) otherwise."; }; }; readonly required: readonly ["object_name", "object_type"]; }; }; interface WhereUsedArgs { object_name: string; object_type: string; enable_all_types?: boolean; max_results?: number; customer_only?: boolean; package?: string; timeout_ms?: number; } export interface WhereUsedReferenceOut { name: string; type: string; uri: string; package_name?: string; responsible?: string; usage_information?: string; object_identifier?: string; } /** * Customer namespace check used by customer_only: Z / Y object name, or Z / Y / $ package. * Names in a /namespace/ are not treated as customer objects: on ECC they are mostly SAP * industry solutions, partner add-ons or generated objects (/1BCDWB/ SmartForm modules). */ export declare function isCustomerReference(ref: { name?: string; package_name?: string; }): boolean; /** Package filter: exact (case-insensitive) or prefix with trailing '*'. */ export declare function matchesPackage(packageName: string | undefined, pattern: string): boolean; /** * Apply the optional filters and cap. With no option set the input list is * returned unchanged (same order, same entries). */ export declare function applyWhereUsedFilters(references: WhereUsedReferenceOut[], opts: { customer_only?: boolean; package?: string; max_results?: number; }): { references: WhereUsedReferenceOut[]; filtered_out: number; truncated: boolean; }; /** True on BASIS releases without /sap/bc/adt/repository/informationsystem. */ export declare function needsDispatchWhereUsed(): boolean; /** Add an actionable hint to well-known ADT where-used failures. */ export declare function whereUsedErrorHint(error: unknown): string | undefined; /** * Returns where-used references for ABAP objects using AdtClient utilities. * Uses getWhereUsedList for parsed structured results. */ export declare function handleGetWhereUsed(context: HandlerContext, args: WhereUsedArgs): Promise<{ isError: boolean; content: { type: string; json: { object_name: string; object_type: string; enable_all_types: boolean; total_references: number; result_description: string; references: WhereUsedReferenceOut[]; returned_references: number; truncated: boolean; filtered_out: number; notes: string[]; }; }[]; } | { isError: boolean; content: { type: string; text: string; }[]; }>; export {}; //# sourceMappingURL=handleGetWhereUsed.d.ts.map