1- import { createUtilsService , createHotelService , createAirService , createTerminalService , errors } from ' uapi-json' ;
1+ import { createAirService , createHotelService , createTerminalService , createUtilsService , errors } from " uapi-json" ;
22
33const settings = {
4- auth : { username : ' USERNAME' , password : ' PASSWORD' , region : ' REGION' , targetBranch : ' TARGETBRANCH' } ,
4+ auth : { username : " USERNAME" , password : " PASSWORD" , region : " REGION" , targetBranch : " TARGETBRANCH" } ,
55} ;
66const airService = createAirService ( settings ) ;
77
88airService
99 . shop ( {
1010 legs : [
1111 {
12- from : ' LWO' ,
13- to : ' JKT' ,
14- departureDate : ' 2018-07-18' ,
12+ from : " LWO" ,
13+ to : " JKT" ,
14+ departureDate : " 2018-07-18" ,
1515 } ,
1616 {
17- from : ' JKT' ,
18- to : ' IEV' ,
19- departureDate : ' 2018-07-21' ,
17+ from : " JKT" ,
18+ to : " IEV" ,
19+ departureDate : " 2018-07-21" ,
2020 } ,
2121 ] ,
2222 passengers : {
@@ -25,27 +25,27 @@ airService
2525CNN:1,
2626INF: 1,
2727INS: 1, //infant with a seat
28- */
28+ */
2929 } ,
30- cabins : [ ' Economy' ] , // ['Business'],
31- requestId : ' 4e2fd1f8-2221-4b6c-bb6e-cf05c367cf60' ,
30+ cabins : [ " Economy" ] , // ['Business'],
31+ requestId : " 4e2fd1f8-2221-4b6c-bb6e-cf05c367cf60" ,
3232 maxJourneyTime : 300 ,
3333 maxSolutions : 200 ,
3434 pricing : {
35- currency : ' USD' ,
35+ currency : " USD" ,
3636 eTicketability : true ,
3737 } ,
3838 allowDirectAccess : false ,
3939 } )
4040 . catch ( ( err : unknown ) => {
4141 if ( err instanceof errors . Common . ValidationError ) {
42- ( ' Validation error occurred' ) ;
42+ " Validation error occurred" ;
4343 }
4444 if ( err instanceof errors . Request . RequestValidationError ) {
45- ( ' Validation error occurred in request' ) ;
45+ " Validation error occurred in request" ;
4646 }
4747 if ( err instanceof errors . Request . RequestValidationError . ParamsMissing ) {
48- ( ' Params are missing for request' ) ;
48+ " Params are missing for request" ;
4949 }
5050 } ) ;
5151
@@ -54,31 +54,31 @@ const utilService = createUtilsService(settings);
5454utilService
5555 . currencyConvert ( {
5656 currencies : [
57- { from : ' EUR' , to : ' USD' } ,
58- { from : ' UAH' , to : ' USD' } ,
57+ { from : " EUR" , to : " USD" } ,
58+ { from : " UAH" , to : " USD" } ,
5959 ] ,
6060 } )
6161 . catch ( ( err : unknown ) => {
6262 if ( err instanceof errors . Common . ValidationError ) {
63- ( ' Validation error occurred' ) ;
63+ " Validation error occurred" ;
6464 }
6565 if ( err instanceof errors . Request . RequestValidationError ) {
66- ( ' Validation error occurred in request' ) ;
66+ " Validation error occurred in request" ;
6767 }
6868 if ( err instanceof errors . Request . RequestValidationError . ParamsMissing ) {
69- ( ' Params are missing for request' ) ;
69+ " Params are missing for request" ;
7070 }
7171 } ) ;
7272
7373const hotelService = createHotelService ( settings ) ;
7474
7575hotelService
7676 . search ( {
77- location : ' RUAACL' ,
77+ location : " RUAACL" ,
7878 // location: 'IEV', use for IATA codes search
79- startDate : ' 2022-02-22' ,
80- endDate : ' 2022-02-22' ,
81- currency : ' USD' ,
79+ startDate : " 2022-02-22" ,
80+ endDate : " 2022-02-22" ,
81+ currency : " USD" ,
8282 MaxWait : 30000 ,
8383 MaxProperties : 9999 ,
8484 rooms : [
@@ -95,28 +95,28 @@ hotelService
9595 } )
9696 . catch ( ( err : unknown ) => {
9797 if ( err instanceof errors . Common . ValidationError ) {
98- ( ' Validation error occurred' ) ;
98+ " Validation error occurred" ;
9999 }
100100 if ( err instanceof errors . Request . RequestValidationError ) {
101- ( ' Validation error occurred in request' ) ;
101+ " Validation error occurred in request" ;
102102 }
103103 if ( err instanceof errors . Request . RequestValidationError . ParamsMissing ) {
104- ( ' Params are missing for request' ) ;
104+ " Params are missing for request" ;
105105 }
106106 } ) ;
107107
108108const terminalService = createTerminalService ( settings ) ;
109109
110110terminalService
111- . executeCommand ( ' command' , ( screens : string [ ] ) => true )
111+ . executeCommand ( " command" , ( screens : string [ ] ) => true )
112112 . catch ( ( err : unknown ) => {
113113 if ( err instanceof errors . Common . ValidationError ) {
114- ( ' Validation error occurred' ) ;
114+ " Validation error occurred" ;
115115 }
116116 if ( err instanceof errors . Request . RequestValidationError ) {
117- ( ' Validation error occurred in request' ) ;
117+ " Validation error occurred in request" ;
118118 }
119119 if ( err instanceof errors . Request . RequestValidationError . ParamsMissing ) {
120- ( ' Params are missing for request' ) ;
120+ " Params are missing for request" ;
121121 }
122122 } ) ;
0 commit comments