UNPKG

abap-adt-api

Version:

Interface to Abap Developer Tools webservice

290 lines 20 kB
import { AdtHTTP, ClientOptions, session_types, BearerFetcher, HttpClient } from "./AdtHTTP"; import { AbapClassStructure, AbapObjectStructure, ActivationResult, AdtCompatibilityGraph, AdtCoreDiscoveryResult, AdtDiscoveryResult, AdtLock, BindingServiceResult, ClassComponent, classIncludes, CompletionElementInfo, CompletionProposal, CreatableTypeIds, DdicElement, DdicObjectReference, DebugAttach, DebugBreakpoint, DebugBreakpointError, DebugChildVariablesInfo, Debuggee, DebuggerScope, DebuggingMode, DebugListenerError, DebugSettings, DebugStackInfo, DebugStep, DebugVariable, DefinitionLocation, Delta, DumpsFeed, Feed, FixProposal, FragmentLocation, GitExternalInfo, GitRemoteInfo, GitRepo, GitStaging, HierarchyNode, InactiveObject, InactiveObjectRecord, MainInclude, NewObjectOptions, NodeParents, NodeStructure, ObjectSourceOptions, ObjectType, ObjectTypeDescriptor, PackageValueHelpResult, PackageValueHelpType, PathStep, PrettyPrinterSettings, PrettyPrinterStyle, QueryResult, RegistrationInfo, Revision, RenameRefactoring, RenameRefactoringProposal, SearchResult, ServiceBinding, SyntaxCheckResult, SystemUser, TransportAddUserResponse, TransportConfiguration, TransportConfigurationEntry, TransportInfo, TransportOwnerResponse, TransportReleaseReport, TransportsOfUser, UnitTestClass, UsageReference, UsageReferenceSnippet, ValidateOptions, ValidationResult, AtcWorkList, AtcProposal, TraceStatementOptions, TraceParameters, TracesCreationConfig, UnitTestRunFlags, ObjectVersion, Range, ExtractMethodProposal, GenericRefactoring } from "./api"; export declare function createSSLConfig(allowUnauthorized: boolean, ca?: string): ClientOptions; export declare class ADTClient { private discovery?; private fetcher?; get httpClient(): AdtHTTP; static mainInclude(object: AbapObjectStructure, withDefault?: boolean): string; static classIncludes(clas: AbapClassStructure): Map<classIncludes, string>; get id(): number; private h; private pClone?; private options; /** * Create an ADT client * * @argument baseUrlOrClient Base url, i.e. http://vhcalnplci.local:8000 * @argument username SAP logon user * @argument password Password * @argument client Login client (optional) * @argument language Language key (optional) */ constructor(baseUrlOrClient: string | HttpClient, username: string, password: string | BearerFetcher, client?: string, language?: string, options?: ClientOptions); private createHttp; private get pIsClone(); private set pIsClone(value); private wrapFetcher; get statelessClone(): ADTClient; get stateful(): session_types; set stateful(stateful: session_types); get loggedin(): boolean; get isStateful(): boolean; get csrfToken(): string; get baseUrl(): string; get client(): string; get language(): string; get username(): string; private get password(); /** * Logs on an ADT server. parameters provided on creation */ login(): Promise<any>; /** * Logs out current user, clearing cookies * NOTE: you won't be able to login again with this client * * @memberof ADTClient */ logout(): Promise<void>; dropSession(): Promise<void>; get sessionID(): "" | string[]; nodeContents(parent_type: NodeParents, parent_name?: string, user_name?: string, parent_tech_name?: string, rebuild_tree?: boolean, parentnodes?: number[]): Promise<NodeStructure>; reentranceTicket(): Promise<string>; transportInfo(objSourceUrl: string, devClass?: string, operation?: string): Promise<TransportInfo>; createTransport(objSourceUrl: string, REQUEST_TEXT: string, DEVCLASS: string, transportLayer?: string): Promise<string>; objectStructure(objectUrl: string, version?: ObjectVersion): Promise<AbapObjectStructure>; activate(object: InactiveObject | InactiveObject[], preauditRequested?: boolean): Promise<ActivationResult>; activate(objectName: string, objectUrl: string, mainInclude?: string, preauditRequested?: boolean): Promise<ActivationResult>; inactiveObjects(): Promise<InactiveObjectRecord[]>; mainPrograms(includeUrl: string): Promise<MainInclude[]>; lock(objectUrl: string, accessMode?: string): Promise<AdtLock>; unLock(objectUrl: string, lockHandle: string): Promise<string>; /** * Retrieves a resource content (i.e. a program's source code) * * @param objectSourceUrl Resource URL * @param gitUser Username, only used for abapGit objects * @param gitPassword password, only used for abapGit objects */ getObjectSource(objectSourceUrl: string, options?: ObjectSourceOptions): Promise<string>; setObjectSource(objectSourceUrl: string, source: string, lockHandle: string, transport?: string): Promise<void>; /** * Search object by name pattern * * @param {string} query case sensitive in older systems, no wildcard added * @param {string} [objType] if passed, only the first part is used i.e. PROG rather than PROG/P * @param {number} [max=100] max number of results * @returns * @memberof ADTClient */ searchObject(query: string, objType?: string, max?: number): Promise<SearchResult[]>; findObjectPath(objectUrl: string): Promise<PathStep[]>; validateNewObject(options: ValidateOptions): Promise<ValidationResult>; createObject(objtype: CreatableTypeIds, name: string, parentName: string, description: string, parentPath: string, responsible?: string, transport?: string): Promise<void>; createObject(options: NewObjectOptions): Promise<void>; featureDetails(title: string): Promise<AdtDiscoveryResult | undefined>; collectionFeatureDetails(url: string): Promise<AdtDiscoveryResult | undefined>; findCollectionByUrl(url: string): Promise<{ discoveryResult: AdtDiscoveryResult; collection: { href: string; templateLinks: { rel: string; template: string; title?: string | undefined; type?: string | undefined; }[]; title?: string | undefined; }; } | undefined>; hasTransportConfig: () => Promise<boolean>; createTestInclude(clas: string, lockHandle: string, transport?: string): Promise<void>; objectRegistrationInfo(objectUrl: string): Promise<RegistrationInfo>; deleteObject(objectUrl: string, lockHandle: string, transport?: string): Promise<void>; loadTypes(): Promise<ObjectType[]>; adtDiscovery(): Promise<AdtDiscoveryResult[]>; adtCoreDiscovery(): Promise<AdtCoreDiscoveryResult[]>; adtCompatibiliyGraph(): Promise<AdtCompatibilityGraph>; syntaxCheckTypes(): Promise<Map<string, string[]>>; syntaxCheck(cdsUrl: string): Promise<SyntaxCheckResult[]>; syntaxCheck(url: string, mainUrl: string, content: string, mainProgram?: string, version?: string): Promise<SyntaxCheckResult[]>; codeCompletion(sourceUrl: string, source: string, line: number, column: number): Promise<CompletionProposal[]>; codeCompletionFull(sourceUrl: string, source: string, line: number, column: number, patternKey: string): Promise<string>; runClass(className: string): Promise<string>; /** * Read code completion elements * Will fail on older systems where this returns HTML fragments rather than XML * * @param {string} sourceUrl * @param {string} source * @param {number} line * @param {number} column * @returns * @memberof ADTClient */ codeCompletionElement(sourceUrl: string, source: string, line: number, column: number): Promise<string | CompletionElementInfo>; findDefinition(url: string, source: string, line: number, startCol: number, endCol: number, implementation?: boolean, mainProgram?: string): Promise<DefinitionLocation>; usageReferences(url: string, line?: number, column?: number): Promise<UsageReference[]>; usageReferenceSnippets(references: UsageReference[]): Promise<UsageReferenceSnippet[]>; fixProposals(url: string, source: string, line: number, column: number): Promise<FixProposal[]>; fixEdits(proposal: FixProposal, source: string): Promise<Delta[]>; unitTestRun(url: string, flags?: UnitTestRunFlags): Promise<UnitTestClass[]>; unitTestEvaluation(clas: UnitTestClass, flags?: UnitTestRunFlags): Promise<import("./api").UnitTestMethod[]>; unitTestOccurrenceMarkers(url: string, source: string): Promise<{ kind: string; keepsResult: boolean; location: { uri: string; query: { [x: string]: string; } | undefined; range: { start: { line: number; column: number; }; end: { line: number; column: number; }; }; hashparms: { [x: string]: string; } | undefined; }; }[]>; classComponents(url: string): Promise<ClassComponent>; fragmentMappings(url: string, type: string, name: string): Promise<FragmentLocation>; objectTypes(): Promise<ObjectTypeDescriptor[]>; prettyPrinterSetting(): Promise<PrettyPrinterSettings>; setPrettyPrinterSetting(indent: boolean, style: PrettyPrinterStyle): Promise<string>; prettyPrinter(source: string): Promise<string>; typeHierarchy(url: string, body: string, line: number, offset: number, superTypes?: boolean): Promise<HierarchyNode[]>; transportConfigurations(): Promise<TransportConfigurationEntry[]>; getTransportConfiguration(url: string): Promise<TransportConfiguration>; setTransportsConfig(uri: string, etag: string, config: TransportConfiguration): Promise<TransportConfiguration>; createTransportsConfig(): Promise<TransportConfiguration>; userTransports(user: string, targets?: boolean): Promise<TransportsOfUser>; transportsByConfig(configUri: string, targets?: boolean): Promise<TransportsOfUser>; transportDelete(transportNumber: string): Promise<void>; transportRelease(transportNumber: string, ignoreLocks?: boolean, IgnoreATC?: boolean): Promise<TransportReleaseReport[]>; transportSetOwner(transportNumber: string, targetuser: string): Promise<TransportOwnerResponse>; transportAddUser(transportNumber: string, user: string): Promise<TransportAddUserResponse>; systemUsers(): Promise<SystemUser[]>; transportReference(pgmid: string, obj_wbtype: string, obj_name: string, tr_number?: string): Promise<string>; revisions(objectUrl: string | AbapObjectStructure, clsInclude?: classIncludes): Promise<Revision[]>; abapDocumentation(objectUri: string, body: string, line: number, column: number, language?: string): Promise<string>; packageSearchHelp(type: PackageValueHelpType, name?: string): Promise<PackageValueHelpResult[]>; gitRepos(): Promise<GitRepo[]>; gitExternalRepoInfo(repourl: string, user?: string, password?: string): Promise<GitExternalInfo>; gitCreateRepo(packageName: string, repourl: string, branch?: string, transport?: string, user?: string, password?: string): Promise<void[]>; gitPullRepo(repoId: string, branch?: string, transport?: string, user?: string, password?: string): Promise<void[]>; gitUnlinkRepo(repoId: string): Promise<void>; stageRepo(repo: GitRepo, user?: string, password?: string): Promise<GitStaging>; pushRepo(repo: GitRepo, staging: GitStaging, user?: string, password?: string): Promise<void>; checkRepo(repo: GitRepo, user?: string, password?: string): Promise<void>; /** * @deprecated since 1.2.1, duplicate of gitExternalRepoInfo */ remoteRepoInfo(repo: GitRepo, user?: string, password?: string): Promise<GitRemoteInfo>; switchRepoBranch(repo: GitRepo, branch: string, create?: boolean, user?: string, password?: string): Promise<void>; annotationDefinitions(): Promise<string>; ddicElement(path: string | string[], getTargetForAssociation?: boolean, getExtensionViews?: boolean, getSecondaryObjects?: boolean): Promise<DdicElement>; ddicRepositoryAccess(path: string | string[]): Promise<DdicObjectReference[]>; publishServiceBinding(name: string, version: string): Promise<{ severity: string; shortText: string; longText: string; }>; unPublishServiceBinding(name: string, version: string): Promise<{ severity: string; shortText: string; longText: string; }>; /** Reads table data - usually returns one line more than requested */ tableContents(ddicEntityName: string, rowNumber?: number, decode?: boolean, sqlQuery?: string): Promise<QueryResult>; /** Runs a given SQL query on the target */ runQuery(sqlQuery: string, rowNumber?: number, decode?: boolean): Promise<QueryResult>; bindingDetails(binding: ServiceBinding, index?: number): Promise<BindingServiceResult>; feeds(): Promise<Feed[]>; dumps(query?: string): Promise<DumpsFeed>; debuggerListeners(debuggingMode: "user", terminalId: string, ideId: string, user: string, checkConflict?: boolean): Promise<DebugListenerError | undefined>; debuggerListeners(debuggingMode: DebuggingMode, terminalId: string, ideId: string, user?: string, checkConflict?: boolean): Promise<DebugListenerError | undefined>; /** * Listens for debugging events * **WARNING** this usually only returns when a breakpoint is hit, a timeout is reached or another client terminated it * On timeout/termination it will return undefined, and the client will decide whether to launch it again after prompting the user * * @param {string} debuggingMode - break on any user activity or just on the current terminal * @param {string} terminalId - the terminal ID - a GUID generated the first time any debugger is ran on the current machine * in Windows is stored in registry key Software\SAP\ABAP Debugging * in other systems in file ~/.SAP/ABAPDebugging/terminalId * @param {string} ideId - the IDE ID - UI5 hash of the IDE's workspace root * @param {string} user - the user to break for. Mandatory in user mode * * @returns either an error, if another client is listening, or the details of the object being debugged. Can take hours to return */ debuggerListen(debuggingMode: "user", terminalId: string, ideId: string, user: string, checkConflict?: boolean, isNotifiedOnConflict?: boolean): Promise<DebugListenerError | Debuggee | undefined>; debuggerListen(debuggingMode: DebuggingMode, terminalId: string, ideId: string, user?: string, checkConflict?: boolean, isNotifiedOnConflict?: boolean): Promise<DebugListenerError | Debuggee | undefined>; /** * Stop a debug listener (could be this client or another) * @param {string} debuggingMode - break on any user activity or just on the current terminal * @param {string} terminalId - the terminal ID - a GUID generated the first time any debugger is ran on the current machine * in Windows is stored in registry key Software\SAP\ABAP Debugging * in other systems in file ~/.SAP/ABAPDebugging/terminalId * @param {string} ideId - the IDE ID - UI5 hash of the IDE's workspace root * @param {string} user - the user to break for. Mandatory in user mode */ debuggerDeleteListener(debuggingMode: "user", terminalId: string, ideId: string, user: string): Promise<void>; debuggerDeleteListener(debuggingMode: DebuggingMode, terminalId: string, ideId: string, user?: string): Promise<void>; debuggerSetBreakpoints(debuggingMode: "user", terminalId: string, ideId: string, clientId: string, breakpoints: (string | DebugBreakpoint)[], user: string, scope?: DebuggerScope, systemDebugging?: boolean, deactivated?: boolean, syncScupeUrl?: string): Promise<(DebugBreakpoint | DebugBreakpointError)[]>; debuggerSetBreakpoints(debuggingMode: DebuggingMode, terminalId: string, ideId: string, clientId: string, breakpoints: (string | DebugBreakpoint)[], user?: string, scope?: DebuggerScope, systemDebugging?: boolean, deactivated?: boolean, syncScupeUrl?: string): Promise<(DebugBreakpoint | DebugBreakpointError)[]>; debuggerDeleteBreakpoints(breakpoint: DebugBreakpoint, debuggingMode: "user", terminalId: string, ideId: string, requestUser: string, scope?: DebuggerScope): Promise<void>; debuggerDeleteBreakpoints(breakpoint: DebugBreakpoint, debuggingMode: DebuggingMode, terminalId: string, ideId: string, requestUser?: string): Promise<void>; debuggerAttach(debuggingMode: "user", debuggeeId: string, user: string, dynproDebugging?: boolean): Promise<DebugAttach>; debuggerAttach(debuggingMode: DebuggingMode, debuggeeId: string, user?: string, dynproDebugging?: boolean): Promise<DebugAttach>; debuggerSaveSettings(settings: Partial<DebugSettings>): Promise<DebugSettings>; debuggerStackTrace(semanticURIs?: boolean): Promise<DebugStackInfo>; debuggerVariables(parents: string[]): Promise<DebugVariable[]>; debuggerChildVariables(parent?: string[]): Promise<DebugChildVariablesInfo>; debuggerStep(steptype: "stepRunToLine" | "stepJumpToLine", url: string): Promise<DebugStep>; debuggerStep(steptype: "stepInto" | "stepOver" | "stepReturn" | "stepContinue" | "terminateDebuggee"): Promise<DebugStep>; /** * Go to stack entry * * @param urlOrPosition The stack entry stackUri in newer systems, the stack id in older ones that return a DebugStackSimple */ debuggerGoToStack(urlOrPosition: number | string): Promise<void>; debuggerSetVariableValue(variableName: string, value: string): Promise<string>; renameEvaluate(uri: string, line: number, startColumn: number, endColumn: number): Promise<RenameRefactoringProposal>; renamePreview(renameRefactoring: RenameRefactoringProposal, transport?: string): Promise<RenameRefactoring>; renameExecute(refactoring: RenameRefactoring): Promise<RenameRefactoring>; atcCustomizing(): Promise<import("./api").AtcCustomizing>; atcCheckVariant(variant: string): Promise<string>; createAtcRun(variant: string, mainUrl: string, maxResults?: number): Promise<import("./api").AtcRunResult>; atcWorklists(runResultId: string): Promise<AtcWorkList>; atcWorklists(runResultId: string, timestamp: number, usedObjectSet: string, includeExempted?: boolean): Promise<AtcWorkList>; atcUsers(): Promise<import("./api").AtcUser[]>; atcExemptProposal(markerId: string): Promise<AtcProposal | import("./api").AtcProposalMessage>; atcRequestExemption(proposal: AtcProposal): Promise<import("./api").AtcProposalMessage>; isProposalMessage: import("io-ts").Is<{ type: string; message: string; }>; atcContactUri(findingUri: string): Promise<string>; atcChangeContact(itemUri: string, userId: string): Promise<void>; tracesList(user?: string): Promise<import("./api").TraceResults>; tracesListRequests(user?: string): Promise<import("./api").TraceRequestList>; tracesHitList(id: string, withSystemEvents?: boolean): Promise<import("./api").TraceHitList>; tracesDbAccess(id: string, withSystemEvents?: boolean): Promise<import("./api").TraceDBAccessResponse>; tracesStatements(id: string, options?: TraceStatementOptions): Promise<import("./api").TraceStatementResponse>; tracesSetParameters(parameters: TraceParameters): Promise<string>; tracesCreateConfiguration(config: TracesCreationConfig): Promise<import("./api").TraceRequestList>; tracesDeleteConfiguration(id: string): Promise<void>; tracesDelete(id: string): Promise<void>; extractMethodEvaluate(uri: string, range: Range): Promise<ExtractMethodProposal>; extractMethodPreview(proposal: ExtractMethodProposal): Promise<GenericRefactoring>; extractMethodExecute(refactoring: GenericRefactoring): Promise<GenericRefactoring>; } //# sourceMappingURL=AdtClient.d.ts.map