1.16.5 • Published 2 months ago

uapi-json v1.16.5

Weekly downloads
11,720
License
MIT
Repository
github
Last release
2 months ago

Description

Build Status Coverage NPM Tag

Best Travelport Universal API wrapper ever :airplane: :mountain_railway: :hotel:

Wrapper for Travelport Universal API. Read official docs for more information.

Travelport Universal API offers an array of travel content for air, hotel, car, and rail, including ancillaries (optional services). It also provides functionality to build complete traveler, agency, branch, and account profiles.

This package provides JSON/Promises interface for SOAP calls. Requires uAPI credentials to run.

Contents

Installation

Install package with npm install --save uapi-json.

Basic usage

This package exports an object with three service constructors.

const uAPI = require('uapi-json');

const AirService = uAPI.createAirService(settings);
const HotelService = uAPI.createHotelService(settings);
const UtilsService = uAPI.createUtilsService(settings);
const TerminalService = uAPI.createTerminalService(settings);

It also exports a set of error classes that help to check errors against them

const uAPI = require('uapi-json');

const settings = { auth: {username: 'USERNAME', password: 'PASSWORD', region: 'REGION'}};
const AirService = uAPI.createAirService(settings);

AirService.importPNR().catch((err) => {
  if (err instanceof uAPI.errors.Common.ValidationError) {
    console.log('Validation error occured');
  }
  if (err instanceof uAPI.errors.Request.RequestValidationError) {
    console.log('Validation error occured in request');
  }
  if (err instanceof uAPI.errors.Request.RequestValidationError.ParamsMissing) {
    console.log('Params are missing for request');
  }
});

As the node-errors-helpers library used for error generating, we strongly recommend you to take a look at it. It also has several useful helpers to handle errors.

Settings

uAPI

Settings object

ParamTypeDefaultDescription
authObject <username, password, targetBranch, emulatePcc, region, provider>-See auth description below.
debugNumber0Can be 0, 1, or 2.
productionBooleantrueProduction variable is connected with production and pre-production environment. Can be true for production and false for pre-production. For more information read docs.
timeoutNumber-Optional. Used for TerminalService only. See TerminalService
autoCloseBooleanOptional. Used only in TerminalService. Defines if service should make closeSession request.
optionsObject{}Optional. User for all services to all additional options like custom log function, etc. See options description bellow.

Additional options

logFunction - set custom logging function that should match next shape (...args) => {}. Will receive all requests and responses from uapi/terminal.

Auth object

ParamTypeDefaultDescription
 usernameString-User name identifier, provided by Travelport.
passwordString-Password for current username, provided by Travelport.
targetBranchString-Branch, provided by Travelport.
regionStringemeaOptional. Used to select region.
emulatePccString/BooleanFalseOptional. A PCC on behalf of which transactions are executed in Air, Hotels, Utils. This PCC needs to have set SVCB field in the AAT profile. Define a PCC if you have a service bureau and want to execute transactions on behalf of some of its PCCs. Follow this documentation to take a detailew view of the emulatePcc for the Terminal.
providerString1GOptional. Obtains data directly from specific provider. Be aware, the default provider is 1G, we never tested any other providers, use this option at your own risk.

There are 3 types of debug mode:

  • debug=0 - disabled any logs.
  • debug=1 - logging only request params, request xml and error if it's occurred.
  • debug=2 - same as 1 but also logging all response xml (due to lot of text to log).
  • debug=3 - logs everything.

Services

See the following services pages to take a detailed view

Contributing

Please visit CONTRIBUTING.md

1.16.5

2 months ago

1.16.4

2 months ago

1.16.3

3 months ago

1.16.2

5 months ago

1.16.1

7 months ago

1.16.0

11 months ago

1.14.9

1 year ago

1.14.8

1 year ago

1.14.7

1 year ago

1.14.6

1 year ago

1.15.0

1 year ago

1.15.1

1 year ago

1.14.10

1 year ago

1.14.11

1 year ago

1.14.5

1 year ago

1.14.4

1 year ago

1.14.3

2 years ago

1.14.2

2 years ago

1.14.0

2 years ago

1.13.2

2 years ago

1.13.1

2 years ago

1.13.4

2 years ago

1.13.3

2 years ago

1.12.3

2 years ago

1.12.2

2 years ago

1.12.1

2 years ago

1.12.5

2 years ago

1.12.4

2 years ago

1.13.0

2 years ago

1.12.0

2 years ago

1.10.5

2 years ago

1.10.4

2 years ago

1.10.3

2 years ago

1.10.8

2 years ago

1.10.7

2 years ago

1.10.6

2 years ago

1.11.0

2 years ago

1.10.2

2 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.9.8

3 years ago

1.9.7

3 years ago

1.9.6

3 years ago

1.9.5

3 years ago

1.9.4

3 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.20.4

6 years ago

0.20.3

6 years ago

0.20.2

6 years ago

0.20.1

6 years ago

0.20.0

6 years ago

0.19.2

6 years ago

0.19.1

6 years ago

0.19.0

6 years ago

0.18.7

6 years ago

0.18.6

6 years ago

0.18.5

6 years ago

0.18.4

6 years ago

0.18.3

6 years ago

0.18.2

6 years ago

0.18.1

6 years ago

0.18.0

6 years ago

0.17.0

6 years ago

0.16.4

6 years ago

0.16.3

6 years ago

0.16.2

6 years ago

0.16.1

6 years ago

0.16.0

7 years ago

0.15.7

7 years ago

0.15.6

7 years ago

0.15.5

7 years ago

0.15.4

7 years ago

0.15.3

7 years ago

0.15.2

7 years ago

0.15.1

7 years ago

0.15.0

7 years ago

0.14.6

7 years ago

0.14.5

7 years ago

0.14.4

7 years ago

0.14.3

7 years ago

0.14.2

7 years ago

0.14.1

7 years ago

0.14.0

7 years ago

0.13.0

7 years ago

0.12.3

7 years ago

0.12.2

7 years ago

0.12.1

7 years ago

0.12.0

7 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.0

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.8

7 years ago

0.8.7

7 years ago

0.8.6

7 years ago

0.8.5

7 years ago

0.8.4

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.7

7 years ago

0.5.6

7 years ago

0.5.5

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.4

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago