node-r3trans
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -6,1 +6,2 @@ export * from "./R3trans"; | ||
export * from "./Structure"; | ||
export * from "./ReleaseLogStep"; |
@@ -22,1 +22,3 @@ "use strict"; | ||
__exportStar(require("./Structure"), exports); | ||
__exportStar(require("./ReleaseLogStep"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -214,1 +214,2 @@ "use strict"; | ||
exports.R3trans = R3trans; | ||
//# sourceMappingURL=R3trans.js.map |
@@ -56,1 +56,2 @@ "use strict"; | ||
exports.R3transFile = R3transFile; | ||
//# sourceMappingURL=R3transFile.js.map |
import { Structure } from "./Structure"; | ||
import { ReleaseLogStep } from "./ReleaseLogStep"; | ||
export declare class R3transLogParser { | ||
@@ -18,2 +19,7 @@ private _log; | ||
getTableEntries(tableName?: string): Promise<any>; | ||
getReleaseLog(): Promise<ReleaseLogStep[]>; | ||
static parseExitCode(exitCode: 0 | 4 | 8 | 12 | 16): { | ||
type: 'SUCCESS' | 'ERROR' | 'WARNING'; | ||
value: string; | ||
}; | ||
} |
@@ -246,3 +246,96 @@ "use strict"; | ||
} | ||
getReleaseLog() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield new Promise((res, rej) => { | ||
var returnObject = []; | ||
var stepBreaker = false; | ||
var currentStep; | ||
const stream = this._getStream(); | ||
const rl = readline.createInterface({ | ||
input: stream, | ||
crlfDelay: Infinity | ||
}); | ||
rl.on('line', (line) => { | ||
if (stepBreaker) { | ||
const stepMatch = /^\d{1}\s*(ETP\d{3})\s*(.*)/gi.exec(line); | ||
if (stepMatch) { | ||
currentStep = { | ||
id: stepMatch[1], | ||
name: stepMatch[2], | ||
endDateTime: null, | ||
exitCode: null, | ||
log: null | ||
}; | ||
} | ||
} | ||
if (/^\d{1}\s*ETP199X/gi.test(line)) { | ||
stepBreaker = true; | ||
} | ||
else { | ||
stepBreaker = false; | ||
if (/^\d{1}\s*ETP199/gi.test(line)) { | ||
if (currentStep) { | ||
returnObject.push(currentStep); | ||
} | ||
} | ||
else { | ||
if (currentStep) { | ||
const logMatch = /^\d{1}\s*\w{3}\d{3}\s(.*)/gi.exec(line); | ||
if (logMatch) { | ||
var aLog = []; | ||
if (currentStep.log) { | ||
aLog.push(currentStep.log); | ||
} | ||
aLog.push(logMatch[1]); | ||
currentStep.log = aLog.join('\n'); | ||
} | ||
if (/^\d{1}\s*ETP110/gi.test(line)) { | ||
const dateTimeMatch = /^\d{1}\sETP110\s*.*:\s*"(\d*)"/gi.exec(line); | ||
if (dateTimeMatch) { | ||
currentStep.endDateTime = parseInt(dateTimeMatch[1]); | ||
} | ||
} | ||
if (/^\d{1}\s*ETP111/gi.test(line)) { | ||
const exitCodeMatch = /^\d{1}\sETP111\s*.*:\s*"(\d*)"/gi.exec(line); | ||
if (exitCodeMatch) { | ||
currentStep.exitCode = parseInt(exitCodeMatch[1]); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
rl.on('close', () => { | ||
res(returnObject); | ||
}); | ||
}); | ||
}); | ||
} | ||
static parseExitCode(exitCode) { | ||
var sType = `ERROR`; | ||
var sExitCode = `Return code not set by R3trans itself but point to errors, such as segmentation faults.`; | ||
switch (exitCode) { | ||
case 0: | ||
sExitCode = 'No errors or problems have occurred.'; | ||
sType = 'SUCCESS'; | ||
case 4: | ||
sExitCode = 'Warnings have occurred but they can be ignored.'; | ||
sType = 'WARNING'; | ||
case 8: | ||
sExitCode = 'Transport could not be completed. Problems occurred with certain objects.'; | ||
sType = 'ERROR'; | ||
case 12: | ||
sExitCode = 'Fatal errors have occurred, such as errors while reading or writing a file or unexpected errors within the database interface, in particular database problems.'; | ||
sType = 'ERROR'; | ||
case 16: | ||
sExitCode = 'Situations have occurred that are normally not allowed.'; | ||
sType = 'ERROR'; | ||
} | ||
return { | ||
type: sType, | ||
value: sExitCode | ||
}; | ||
} | ||
} | ||
exports.R3transLogParser = R3transLogParser; | ||
//# sourceMappingURL=R3transLogParser.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=R3transOptions.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=Structure.js.map |
{ | ||
"name": "node-r3trans", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "NodeJs wrapper for SAP R3trans program", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46101
24
704