UNPKG

@dgac/nmb2b-client

Version:

EUROCONTROL Network Manager B2B SOAP client

40 lines (38 loc) 1.82 kB
import { prepareSecurity } from "../security.js"; import { getWSDLPath } from "../constants.js"; import { deserializer } from "../utils/transformers/index.js"; import { prepareRetrieveFlight } from "./retrieveFlight.js"; import { prepareQueryFlightsByAirspace } from "./queryFlightsByAirspace.js"; import { prepareQueryFlightPlans } from "./queryFlightPlans.js"; import { prepareQueryFlightsByTrafficVolume } from "./queryFlightsByTrafficVolume.js"; import { prepareQueryFlightsByMeasure } from "./queryFlightsByMeasure.js"; import { prepareQueryFlightsByAerodrome } from "./queryFlightsByAerodrome.js"; import { prepareQueryFlightsByAerodromeSet } from "./queryFlightsByAerodromeSet.js"; import { prepareQueryFlightsByAircraftOperator } from "./queryFlightsByAircraftOperator.js"; import { createClientAsync } from "soap"; //#region src/Flight/index.ts async function getFlightClient(config) { const WSDL = getWSDLPath({ service: "FlightServices", flavour: config.flavour, XSD_PATH: config.XSD_PATH }); const security = prepareSecurity(config); const client = await createClientAsync(WSDL, { customDeserializer: deserializer }); client.setSecurity(security); return { __soapClient: client, config, retrieveFlight: prepareRetrieveFlight(client), queryFlightsByAirspace: prepareQueryFlightsByAirspace(client), queryFlightPlans: prepareQueryFlightPlans(client), queryFlightsByTrafficVolume: prepareQueryFlightsByTrafficVolume(client), queryFlightsByMeasure: prepareQueryFlightsByMeasure(client), queryFlightsByAerodrome: prepareQueryFlightsByAerodrome(client), queryFlightsByAerodromeSet: prepareQueryFlightsByAerodromeSet(client), queryFlightsByAircraftOperator: prepareQueryFlightsByAircraftOperator(client) }; } //#endregion export { getFlightClient }; //# sourceMappingURL=index.js.map