Gathering detailed insights and metrics for mixvel-ndc-client
Gathering detailed insights and metrics for mixvel-ndc-client
npm install mixvel-ndc-client
Typescript
Module System
Node Version
NPM Version
74.9
Supply Chain
96.3
Quality
75.2
Maintenance
50
Vulnerability
99.3
License
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
351
Last Day
1
Last Week
1
Last Month
17
Last Year
89
Latest Version
1.3.1
Package Id
mixvel-ndc-client@1.3.1
Unpacked Size
433.09 kB
Size
70.70 kB
File Count
322
NPM Version
6.14.13
Node Version
14.17.1
Published on
Dec 14, 2023
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
54.5%
17
Compared to previous month
Last Year
-66%
89
Compared to previous year
This module facilitates the work with MixVel API. Currently, it supports XML request generation for basic operations like search, book, and ticket issuing.
To start using the module, install it via npm
1npm i mixvel-ndc-client
Currently, you can use the module for XML request generation. Here is the list of supported actions:
For every action listed above, you can generate a valid request containing XML body and endpoint, ready to send to the MixVel server.
At the moment, sending out requests and handling responses is out of the module's scope.
Each of the available methods returns a MixvelRequest
object looking like following:
1MixvelRequest = { 2 "headers": {}, // HTTP request headers 3 "body": string, // request payload, i.e. XML 4 "options": { 5 "method": "GET" | "POST", 6 "endpoint": string // relative endploing path, e.g. "api/order/Create" 7 } 8}
To add headers you may use addHeader
method:
1MixvelRequest.addHeader("Content-Type", "application/xml")
search
request. Provide a route (either one-way, return, or complex), travelers, and optionally service class and desired airlines.price
for any of these, using OfferID
and OfferItemID
list from the response.tickets issue
, cancel
or retrieve
requests.MOW LED return flight for 2 adults 1 child and 1 infant on lap
1getSearchRequest({ 2 travelers: [ 3 {ptc: 'ADULT', age: "30", id: "1"}, 4 {ptc: 'ADULT', age: "30", id: "2"}, 5 {ptc: 'CHILD', age: "5", id: "3"}, 6 {ptc: 'INFANT', age: "1", id: "4"}, 7 ], 8 originDestinations: [ 9 {from: "MOW", to: "LED", dateRangeEnd: new Date("2021-12-12"), dateRangeStart: new Date("2021-12-12")}, 10 {from: "LED", to: "MOW", dateRangeEnd: new Date("2021-12-15"), dateRangeStart: new Date("2021-12-15")} 11 ], 12 cabin: "ECONOMY", 13 preferredCarriers: null 14}) 15 .body // return XML payload ready to send
MOW LED one-way flight for 1 adult, business class, only SU flights
1getSearchRequest({ 2 travelers: [ 3 {ptc: 'ADULT', age: "30", id: "1"}, 4 ], 5 originDestinations: [ 6 {from: "MOW", to: "LED", dateRangeEnd: new Date("2021-12-12"), dateRangeStart: new Date("2021-12-12")}, 7 {from: "LED", to: "MOW", dateRangeEnd: new Date("2021-12-15"), dateRangeStart: new Date("2021-12-15")} 8 ], 9 cabin: "BUSINESS", 10 preferredCarriers: ["SU"] 11}) 12 .body // return XML payload ready to send
Having received an offer id and per passenger offer items, you may create a price request.
1getPriceRequest({ 2 offerId: 'SOME-OFFER', 3 offerItemIds: ['ADULT-OFFER-ITEM', 'CHILD-OFFER-ITEM'] 4})
Book an offer for 1 ADT RT
1getBookRequest({ 2 offerId: 'SOME-OFFER', 3 offerItemIds: [{id: 'OFFER-1', ptc: "ADULT"}], 4 passengers: [ 5 { 6 ptc: "ADULT", 7 personalInfo: { 8 firstName: 'Test', 9 middleName: 'Test', 10 lastName: 'Test', 11 gender: "M", 12 dob: new Date('1999-02-15'), 13 }, 14 identityDocument: { 15 type: "PASSPORT", 16 dateOfIssue: new Date('2015-02-15'), 17 dateOfExpiry: new Date('2025-02-15'), 18 issuingCountry: 'RU', 19 number: '12345' 20 }, 21 contacts: { 22 email: 'test@test.test', 23 phoneNumber: '89112311441' 24 } 25 } 26 ] 27})
To provide convenient request handling the module utilizes JSON for the request generation and converts JSON to XML document at the end of a generation process. Currently, conversion is handled by xml2js
module.
No vulnerabilities found.
No security vulnerabilities found.