UNPKG

@sap/subaccount-destination-service-provider

Version:

Provide service consumption of SAP subaccount services

30 lines 2.04 kB
"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 }); 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 === "UIA_NO_DEV"); const services = yield abapSystem.getServices(); const service = services.find((service) => service.name === "SRVB_V2_UI_PUB_WITH_TR"); 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(), "New_EntitySet_Name", { filter, }); const annotations = yield abapSystem.getAnnotations(service); console.log("END ABAP TEST FLOW"); }))(); //# sourceMappingURL=abapTestFlowService.js.map