@sap/subaccount-destination-service-provider
Version:
Provide service consumption of SAP subaccount services
27 lines • 1.95 kB
JavaScript
;
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 });
const service_provider_apis_1 = require("@sap/service-provider-apis");
const subaccountDestinationProviderRepository_1 = require("../../src/abap/providers/subaccountDestinationProviderRepository");
(() => __awaiter(void 0, void 0, void 0, function* () {
console.log("START ABAP TEST FLOW");
const subaccountRepository = new subaccountDestinationProviderRepository_1.SubaccountDestinationProviderRepository();
subaccountRepository.init();
const abapSystemsList = yield subaccountRepository.getSystems();
const abapSystem = abapSystemsList.find((system) => system.name === "ES5");
const services = yield abapSystem.getServices();
const service = services.find((service) => service.name === "/IWFND/SG_MED_CATALOG");
const metadata = yield abapSystem.getMetadata(service, service_provider_apis_1.EncodingMode.XML);
const filter = new service_provider_apis_1.Filter(new Map([])).append(service_provider_apis_1.ServiceRequestKey.TopRows, ["2"]);
const liveData = yield abapSystem.getJsonLiveData(service, service.getRelativeUrl(), "ServiceCollection", { filter });
console.log("END ABAP TEST FLOW");
}))();
//# sourceMappingURL=abapTestFlowService.js.map