Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function fetchTmpObj(objName) { // eslint-disable-line no-unused-vars
const client = create();
const nodes = await client.nodeContents('DEVC/K', '$TMP');
const node = nodes.nodes.find(i => i.OBJECT_NAME === objName);
const structure = await client.objectStructure(node.OBJECT_URI);
const mainInclude = ADTClient.mainInclude(structure);
const code = await client.getObjectSource(mainInclude);
// console.log(structure, mainInclude);
console.log(code);
}
public async getChildren(
client: ADTClient
): Promise {
if (this.isLeaf()) throw FileSystemError.FileNotADirectory(this.vsName)
if (!this.structure) await this.loadMetadata(client)
if (!this.structure) throw FileSystemError.FileNotFound(this.vsName)
const ns: NodeStructureMapped = {
categories: new Map(),
objectTypes: new Map(),
nodes: []
}
const main = this.selfLeafNode()
main.OBJECT_URI = ADTClient.mainInclude(this.structure)
const sources = ADTClient.classIncludes(this.structure)
this.structure.includes.forEach(i => {
const node = {
EXPANDABLE: "",
OBJECT_NAME: this.name + "." + i["class:includeType"],
OBJECT_TYPE: i["adtcore:type"],
OBJECT_URI: sources.get(i["class:includeType"] as classIncludes) || "",
OBJECT_VIT_URI: "",
TECH_NAME: i["class:includeType"] // bit of a hack, used to match include metadata
}
if (node.OBJECT_URI) {
if (i["abapsource:sourceUri"] === "source/main") ns.nodes.unshift(node)
else ns.nodes.push(node)
}
})
public getContentsUri(): string {
if (!this.structure) throw FileSystemError.FileNotFound(this.path)
const include = ADTClient.mainInclude(this.structure)
return include
}