trm-core
Version:
TRM (Transport Request Manager) Core
339 lines (338 loc) • 12.4 kB
JavaScript
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RFCSystemConnector = void 0;
const trm_commons_1 = require("trm-commons");
const client_1 = require("../client");
const SystemConnectorBase_1 = require("./SystemConnectorBase");
class RFCSystemConnector extends SystemConnectorBase_1.SystemConnectorBase {
constructor(_connection, _login, _traceDir, _globalNodeModulesPath) {
super();
this._connection = _connection;
this._login = _login;
this._traceDir = _traceDir;
this._globalNodeModulesPath = _globalNodeModulesPath;
this.supportedBulk = {
getTransportObjects: false,
getExistingObjects: false
};
this.isStateless = false;
this._login.user = this._login.user.toUpperCase();
this._lang = this._login.lang;
this._user = this._login.user;
if (!this._connection.saprouter) {
delete this._connection.saprouter;
}
this._client = new client_1.RFCClient(Object.assign(Object.assign({}, this._connection), this._login), this._lang[0], this._traceDir, this._globalNodeModulesPath);
}
getNewConnection() {
return new RFCSystemConnector(this._connection, this._login, this._traceDir, this._globalNodeModulesPath);
}
getSysname() {
return this.getDest();
}
getDest() {
return this._connection.dest;
}
getLangu(c) {
return this.getLogonLanguage(c);
}
getLogonLanguage(c = false) {
if (c) {
return this._lang[0];
}
else {
return this._lang;
}
}
readTable(tableName, fields, options) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.readTable(tableName, fields, options);
});
}
getTrmServerVersion() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getTrmServerVersion();
});
}
getTrmRestVersion() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getTrmRestVersion();
});
}
listDevclassObjects(devclass) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getDevclassObjects(devclass);
});
}
tdevcInterface(devclass, parentcl, rmParentCl, devlayer) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.tdevcInterface(devclass, parentcl, rmParentCl, devlayer);
});
}
getR3transInfo() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getR3transInfo();
});
}
getInstalledPackagesBackend(filter) {
return this._client.getInstalledPackagesBackend(filter);
}
getPackageDependenciesInternal(devclass, includeSubPackages, logId) {
return this._client.getPackageDependencies(devclass, includeSubPackages, logId);
}
getObjectDependenciesInternal(object, objName) {
return this._client.getObjectDependenciesInternal(object, objName);
}
getConnectionData() {
return this._connection;
}
getLogonUser() {
return this._user;
}
connect() {
return __awaiter(this, arguments, void 0, function* (silent = false) {
trm_commons_1.Logger.loading(`Connecting to ${this.getDest()}...`, silent);
try {
yield this._client.open();
trm_commons_1.Logger.success(`Connected to ${this.getDest()} as ${this._user}.`, silent);
}
catch (e) {
trm_commons_1.Logger.error(`Connection to ${this.getDest()} as ${this._user} failed.`, silent);
throw e;
}
});
}
closeConnection() {
return __awaiter(this, void 0, void 0, function* () {
yield this._client.close();
});
}
checkConnection() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.checkConnection();
});
}
ping() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.trmServerPing();
});
}
getFileSystem() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getFileSystem();
});
}
getDirTrans() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getDirTrans();
});
}
getBinaryFile(filePath) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getBinaryFile(filePath);
});
}
writeBinaryFile(filePath, binary) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.writeBinaryFile(filePath, binary);
});
}
createTocTransport(text, target) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.createTocTransport(text, target);
});
}
createWbTransport(text, target) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.createWbTransport(text, target);
});
}
createCustTransport(text, target) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.createCustTransport(text, target);
});
}
setTransportDoc(trkorr, doc) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.setTransportDoc(trkorr, doc);
});
}
removeComments(trkorr, object) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.removeComments(trkorr, object);
});
}
addToTransportRequest(trkorr, content, lock) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.addToTransportRequest(trkorr, content, lock);
});
}
repositoryEnvironment(objectType, objectName) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.repositoryEnvironment(objectType, objectName);
});
}
deleteTrkorr(trkorr) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.deleteTrkorr(trkorr);
});
}
releaseTrkorr(trkorr, lock, timeout) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.releaseTrkorr(trkorr, lock, timeout);
});
}
readTmsQueue(target) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.readTmsQueue(target);
});
}
createPackage(scompkdtln) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.createPackage(scompkdtln);
});
}
getDefaultTransportLayer() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getDefaultTransportLayer();
});
}
tadirInterface(tadir) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.tadirInterface(tadir);
});
}
dequeueTransport(trkorr) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.dequeueTransport(trkorr);
});
}
forwardTransport(trkorr, target, source, importAgain) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.forwardTransport(trkorr, target, source, importAgain);
});
}
importTransport(trkorr, system) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.importTransport(trkorr, system);
});
}
setInstallDevc(installDevc) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.setInstallDevc(installDevc);
});
}
getObjectsList() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getObjectsList();
});
}
renameTransportRequest(trkorr, as4text) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.renameTransportRequest(trkorr, as4text);
});
}
addTranslationToTr(trkorr, devclassFilter) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.addTranslationToTr(trkorr, devclassFilter);
});
}
trCopy(from, to, doc) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.trCopy(from, to, doc);
});
}
addNamespace(namespace, replicense, texts) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.addNamespace(namespace, replicense, texts);
});
}
getMessage(data) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getMessage(data);
});
}
deleteTmsTransport(trkorr, system) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.deleteTmsTransport(trkorr, system);
});
}
refreshTransportTmsTxt(trkorr) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.refreshTransportTmsTxt(trkorr);
});
}
getDotAbapgit(devclass) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getDotAbapgit(devclass);
});
}
getAbapgitSource(devclass) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getAbapgitSource(devclass);
});
}
executePostActivity(data, pre) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.executePostActivity(data, pre);
});
}
isServerApisAllowed() {
return __awaiter(this, void 0, void 0, function* () {
if (this._isServerApisAllowed === undefined) {
this._isServerApisAllowed = yield this._client.isServerApisAllowed();
}
return this._isServerApisAllowed;
});
}
changeTrOwner(trkorr, owner) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.changeTrOwner(trkorr, owner);
});
}
createLogPolling(event) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.createLogPolling(event);
});
}
deleteLogPolling(logID) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.deleteLogPolling(logID);
});
}
readLogPolling(logID) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.readLogPolling(logID);
});
}
getTransportImportStatus(trkorr, system) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getTransportImportStatus(trkorr, system);
});
}
getObjectsLocks(objects) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getObjectsLocks(objects);
});
}
updateTrmPackageData(data) {
return __awaiter(this, void 0, void 0, function* () {
return this._client.updateTrmPackageData(data);
});
}
getTransportTargets() {
return __awaiter(this, void 0, void 0, function* () {
return this._client.getTransportTargets();
});
}
}
exports.RFCSystemConnector = RFCSystemConnector;