Comparing version 0.3.0 to 0.3.1
@@ -75,7 +75,7 @@ import { Customers, Notes, Payments, Reservations, Tasks, Tours } from './models'; | ||
*/ | ||
baseUrl: string | URL; | ||
baseUrl: string; | ||
/** | ||
* Authentication URL - Set this if different to baseUrl | ||
*/ | ||
authUrl?: string | URL | undefined; | ||
authUrl?: string | undefined; | ||
/** | ||
@@ -82,0 +82,0 @@ * Optional timeout |
@@ -15,3 +15,3 @@ import { APIGroup, LinkedObject } from "./common"; | ||
*/ | ||
ReturnUrl: string | URL; | ||
ReturnUrl: string; | ||
/** | ||
@@ -33,3 +33,3 @@ * ID of the customer contact to associate the payment with | ||
ReservationId: number; | ||
Url: string | URL; | ||
Url: string; | ||
Message: string; | ||
@@ -36,0 +36,0 @@ } |
@@ -236,3 +236,35 @@ import { Tasks } from "../models"; | ||
addPassenger(bookingId: string, passenger: AddPassengerRequest): Promise<Passenger>; | ||
/** | ||
* Assign passengers to services | ||
* | ||
* ````typescript | ||
* const assignments: ServiceAssignmentRequest = { | ||
* "Accommodations": [ | ||
* { | ||
* "ComponentId": idOfTheComponent, | ||
* "PassengerIds": [passenger_1, passenger_2, passenger_3] | ||
* } | ||
* ] | ||
* } | ||
* | ||
* try { | ||
* await client.reservations.assign(searchId, resultId, assignments) | ||
* } catch(error) { | ||
* console.error(`Unable to assign passengers: ${error.message}`) | ||
* } | ||
* ```` | ||
* | ||
* @param searchId Search result set ID | ||
* @param resultId Result/Departure ID | ||
* @param assignment Details of the services to be assigned | ||
*/ | ||
assign(searchId: string, resultId: string, assignment: ServiceAssignmentRequest): Promise<Record<string, any>>; | ||
/** | ||
* Add a service component to a reservation | ||
* | ||
* @param reservationId ID of the reservation to add the component to | ||
* @param componentId The ID of the component to add | ||
* @param parentComponentId If specified, the added component will be a child component of the component with this ID | ||
* @param replaceComponentId If specified, the added component will replace the component with this ID | ||
*/ | ||
addComponent(reservationId: string | number, componentId: string, parentComponentId?: number, replaceComponentId?: number): Promise<boolean>; | ||
@@ -244,2 +276,22 @@ /** | ||
* | ||
* @example | ||
* | ||
* ````typescript | ||
* | ||
* const updates: Array<TigerBay.Models.Reservations.ReservationUpdateOperation> = [ | ||
* { | ||
* "op": "replace", | ||
* "path": "/customerId", | ||
* "value": 4830 | ||
* }, | ||
* { | ||
* "op": "replace", | ||
* "path": "/ConditionsAccepted", | ||
* "value": true | ||
* } | ||
* ] | ||
* | ||
* await client.reservations.update(bookingId, updates) | ||
* ```` | ||
* | ||
* @param id ID of the booking to update | ||
@@ -246,0 +298,0 @@ * @param updates A collection of update operations to perform |
@@ -44,2 +44,26 @@ "use strict"; | ||
} | ||
/** | ||
* Assign passengers to services | ||
* | ||
* ````typescript | ||
* const assignments: ServiceAssignmentRequest = { | ||
* "Accommodations": [ | ||
* { | ||
* "ComponentId": idOfTheComponent, | ||
* "PassengerIds": [passenger_1, passenger_2, passenger_3] | ||
* } | ||
* ] | ||
* } | ||
* | ||
* try { | ||
* await client.reservations.assign(searchId, resultId, assignments) | ||
* } catch(error) { | ||
* console.error(`Unable to assign passengers: ${error.message}`) | ||
* } | ||
* ```` | ||
* | ||
* @param searchId Search result set ID | ||
* @param resultId Result/Departure ID | ||
* @param assignment Details of the services to be assigned | ||
*/ | ||
assign(searchId, resultId, assignment) { | ||
@@ -51,2 +75,10 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
/** | ||
* Add a service component to a reservation | ||
* | ||
* @param reservationId ID of the reservation to add the component to | ||
* @param componentId The ID of the component to add | ||
* @param parentComponentId If specified, the added component will be a child component of the component with this ID | ||
* @param replaceComponentId If specified, the added component will replace the component with this ID | ||
*/ | ||
addComponent(reservationId, componentId, parentComponentId, replaceComponentId) { | ||
@@ -61,3 +93,2 @@ return __awaiter(this, void 0, void 0, function* () { | ||
const rsp = yield this.axios.post(`/sales/reservations/${reservationId}/components`, req); | ||
console.log(rsp.data); | ||
} | ||
@@ -75,2 +106,22 @@ catch (err) { | ||
* | ||
* @example | ||
* | ||
* ````typescript | ||
* | ||
* const updates: Array<TigerBay.Models.Reservations.ReservationUpdateOperation> = [ | ||
* { | ||
* "op": "replace", | ||
* "path": "/customerId", | ||
* "value": 4830 | ||
* }, | ||
* { | ||
* "op": "replace", | ||
* "path": "/ConditionsAccepted", | ||
* "value": true | ||
* } | ||
* ] | ||
* | ||
* await client.reservations.update(bookingId, updates) | ||
* ```` | ||
* | ||
* @param id ID of the booking to update | ||
@@ -77,0 +128,0 @@ * @param updates A collection of update operations to perform |
@@ -6,2 +6,2 @@ /** | ||
*/ | ||
export declare const USER_AGENT = "tigerbay-js (+https://github.com/mrzen/tigerbay-js)"; | ||
export declare const USER_AGENT: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.USER_AGENT = void 0; | ||
const version_1 = require("./version"); | ||
/** | ||
@@ -9,3 +10,3 @@ * User-Agent header value | ||
*/ | ||
exports.USER_AGENT = "tigerbay-js (+https://github.com/mrzen/tigerbay-js)"; | ||
exports.USER_AGENT = `tigerbay-js (+https://github.com/mrzen/tigerbay-js v${version_1.VERSION})`; | ||
//# sourceMappingURL=user_agent.js.map |
{ | ||
"name": "tigerbay", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "API Client library for TigerBay", | ||
@@ -31,3 +31,3 @@ "main": "lib/client.js", | ||
"dependencies": { | ||
"axios": "^0.21.0", | ||
"axios": "^0.21.1", | ||
"qs": "^6.9.4" | ||
@@ -34,0 +34,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65096
38
1586
Updatedaxios@^0.21.1