sabre-legacy-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/build/index.d.ts +9 -0
- package/build/index.js +8 -0
- package/build/package.json +44 -0
- package/build/src/authentication/authentication..d.ts +21 -0
- package/build/src/authentication/authentication..js +28 -0
- package/build/src/authentication/helpers/index.d.ts +1 -0
- package/build/src/authentication/helpers/index.js +1 -0
- package/build/src/authentication/helpers/username-token.helper.d.ts +15 -0
- package/build/src/authentication/helpers/username-token.helper.js +17 -0
- package/build/src/authentication/requests/index.d.ts +4 -0
- package/build/src/authentication/requests/index.js +4 -0
- package/build/src/authentication/requests/interfaces/ping-options.interface.d.ts +3 -0
- package/build/src/authentication/requests/interfaces/ping-options.interface.js +1 -0
- package/build/src/authentication/requests/interfaces/session-close-options.interface.d.ts +3 -0
- package/build/src/authentication/requests/interfaces/session-close-options.interface.js +1 -0
- package/build/src/authentication/requests/interfaces/session-create-options.interface.d.ts +5 -0
- package/build/src/authentication/requests/interfaces/session-create-options.interface.js +1 -0
- package/build/src/authentication/requests/interfaces/token-create-options.interface.d.ts +3 -0
- package/build/src/authentication/requests/interfaces/token-create-options.interface.js +1 -0
- package/build/src/authentication/requests/interfaces/username-token-options.interface.d.ts +8 -0
- package/build/src/authentication/requests/interfaces/username-token-options.interface.js +1 -0
- package/build/src/authentication/requests/ping.request.d.ts +12 -0
- package/build/src/authentication/requests/ping.request.js +16 -0
- package/build/src/authentication/requests/session-close.request.d.ts +12 -0
- package/build/src/authentication/requests/session-close.request.js +16 -0
- package/build/src/authentication/requests/session-create.request.d.ts +12 -0
- package/build/src/authentication/requests/session-create.request.js +26 -0
- package/build/src/authentication/requests/token-create.request.d.ts +12 -0
- package/build/src/authentication/requests/token-create.request.js +26 -0
- package/build/src/common/config/xml-parser.config.d.ts +1 -0
- package/build/src/common/config/xml-parser.config.js +17 -0
- package/build/src/common/helpers/header.helper.d.ts +10 -0
- package/build/src/common/helpers/header.helper.js +14 -0
- package/build/src/common/helpers/message-header.helper.d.ts +17 -0
- package/build/src/common/helpers/message-header.helper.js +19 -0
- package/build/src/common/helpers/request.helper.d.ts +12 -0
- package/build/src/common/helpers/request.helper.js +19 -0
- package/build/src/common/helpers/security.helper.d.ts +9 -0
- package/build/src/common/helpers/security.helper.js +11 -0
- package/build/src/common/helpers/soap-env.helper.d.ts +15 -0
- package/build/src/common/helpers/soap-env.helper.js +17 -0
- package/build/src/common/interfaces/actions.interface.d.ts +16 -0
- package/build/src/common/interfaces/actions.interface.js +18 -0
- package/build/src/common/interfaces/application-results.interface.d.ts +12 -0
- package/build/src/common/interfaces/application-results.interface.js +1 -0
- package/build/src/common/interfaces/header-options.interface.d.ts +5 -0
- package/build/src/common/interfaces/header-options.interface.js +1 -0
- package/build/src/common/interfaces/headers-request-options.interface.d.ts +4 -0
- package/build/src/common/interfaces/headers-request-options.interface.js +1 -0
- package/build/src/common/interfaces/index.d.ts +8 -0
- package/build/src/common/interfaces/index.js +8 -0
- package/build/src/common/interfaces/message-header-options.interface.d.ts +7 -0
- package/build/src/common/interfaces/message-header-options.interface.js +1 -0
- package/build/src/common/interfaces/post-options.interface.d.ts +5 -0
- package/build/src/common/interfaces/post-options.interface.js +1 -0
- package/build/src/common/interfaces/request-options.interface.d.ts +4 -0
- package/build/src/common/interfaces/request-options.interface.js +1 -0
- package/build/src/common/interfaces/soap-env-options.interface.d.ts +4 -0
- package/build/src/common/interfaces/soap-env-options.interface.js +1 -0
- package/build/src/common/utils/get-sub-string.d.ts +1 -0
- package/build/src/common/utils/get-sub-string.js +11 -0
- package/build/src/config.d.ts +5 -0
- package/build/src/config.js +18 -0
- package/build/src/daily-sales/common/interfaces/cupon-type.enum.d.ts +7 -0
- package/build/src/daily-sales/common/interfaces/cupon-type.enum.js +6 -0
- package/build/src/daily-sales/common/interfaces/document-type.enum.d.ts +9 -0
- package/build/src/daily-sales/common/interfaces/document-type.enum.js +8 -0
- package/build/src/daily-sales/common/interfaces/index.d.ts +5 -0
- package/build/src/daily-sales/common/interfaces/index.js +5 -0
- package/build/src/daily-sales/common/interfaces/selection-criteria.interface.d.ts +13 -0
- package/build/src/daily-sales/common/interfaces/selection-criteria.interface.js +1 -0
- package/build/src/daily-sales/common/interfaces/settlement-type.enum.d.ts +7 -0
- package/build/src/daily-sales/common/interfaces/settlement-type.enum.js +6 -0
- package/build/src/daily-sales/common/interfaces/transaction-type.enum.d.ts +8 -0
- package/build/src/daily-sales/common/interfaces/transaction-type.enum.js +7 -0
- package/build/src/daily-sales/common/requests/interfaces/report-options.interface.d.ts +7 -0
- package/build/src/daily-sales/common/requests/interfaces/report-options.interface.js +1 -0
- package/build/src/daily-sales/common/requests/interfaces/summary-options.interface.d.ts +15 -0
- package/build/src/daily-sales/common/requests/interfaces/summary-options.interface.js +1 -0
- package/build/src/daily-sales/common/requests/report.request.d.ts +10 -0
- package/build/src/daily-sales/common/requests/report.request.js +17 -0
- package/build/src/daily-sales/common/requests/summary.request.d.ts +15 -0
- package/build/src/daily-sales/common/requests/summary.request.js +24 -0
- package/build/src/daily-sales/common/utils/parse-summary-options-to-selection-criteria.d.ts +4 -0
- package/build/src/daily-sales/common/utils/parse-summary-options-to-selection-criteria.js +16 -0
- package/build/src/daily-sales/common/utils/parse-summary-options-to-xml.d.ts +3 -0
- package/build/src/daily-sales/common/utils/parse-summary-options-to-xml.js +8 -0
- package/build/src/daily-sales/common/utils/parse-summary-options-to-xml.spec.d.ts +1 -0
- package/build/src/daily-sales/common/utils/parse-summary-options-to-xml.spec.js +30 -0
- package/build/src/daily-sales/common/utils/parse-xml-to-daily-sales-report.d.ts +2 -0
- package/build/src/daily-sales/common/utils/parse-xml-to-daily-sales-report.js +5 -0
- package/build/src/daily-sales/common/utils/parse-xml-to-daily-sales-report.spec.d.ts +1 -0
- package/build/src/daily-sales/common/utils/parse-xml-to-daily-sales-report.spec.js +56 -0
- package/build/src/daily-sales/common/utils/parse-xml-to-daily-sales-summary.d.ts +2 -0
- package/build/src/daily-sales/common/utils/parse-xml-to-daily-sales-summary.js +5 -0
- package/build/src/daily-sales/common/utils/parse-xml-to-daily-sales-summary.spec.d.ts +1 -0
- package/build/src/daily-sales/common/utils/parse-xml-to-daily-sales-summary.spec.js +61 -0
- package/build/src/daily-sales/daily-sales.d.ts +9 -0
- package/build/src/daily-sales/daily-sales.js +41 -0
- package/build/src/daily-sales/interfaces/daily-sales-report-options.interface.d.ts +63 -0
- package/build/src/daily-sales/interfaces/daily-sales-report-options.interface.js +1 -0
- package/build/src/daily-sales/interfaces/daily-sales-summary-options.interface.d.ts +107 -0
- package/build/src/daily-sales/interfaces/daily-sales-summary-options.interface.js +1 -0
- package/build/src/interfaces.d.ts +24 -0
- package/build/src/interfaces.js +17 -0
- package/build/src/queue/common/helpers/interfaces/navigation-actions.interface.d.ts +5 -0
- package/build/src/queue/common/helpers/interfaces/navigation-actions.interface.js +6 -0
- package/build/src/queue/common/helpers/interfaces/queue-identifier-options.interface.d.ts +6 -0
- package/build/src/queue/common/helpers/interfaces/queue-identifier-options.interface.js +1 -0
- package/build/src/queue/common/helpers/navigation-action.helper.d.ts +3 -0
- package/build/src/queue/common/helpers/navigation-action.helper.js +7 -0
- package/build/src/queue/common/helpers/queue-access.helper.d.ts +9 -0
- package/build/src/queue/common/helpers/queue-access.helper.js +11 -0
- package/build/src/queue/common/helpers/queue-count.helper.d.ts +10 -0
- package/build/src/queue/common/helpers/queue-count.helper.js +12 -0
- package/build/src/queue/common/helpers/queue-identifier.helper.d.ts +18 -0
- package/build/src/queue/common/helpers/queue-identifier.helper.js +23 -0
- package/build/src/queue/common/helpers/queue-place.helper.d.ts +10 -0
- package/build/src/queue/common/helpers/queue-place.helper.js +12 -0
- package/build/src/queue/common/interfaces/index.d.ts +2 -0
- package/build/src/queue/common/interfaces/index.js +2 -0
- package/build/src/queue/common/interfaces/notification.interface.d.ts +5 -0
- package/build/src/queue/common/interfaces/notification.interface.js +1 -0
- package/build/src/queue/common/interfaces/warning.interface.d.ts +4 -0
- package/build/src/queue/common/interfaces/warning.interface.js +1 -0
- package/build/src/queue/common/requests/access-list.request.d.ts +12 -0
- package/build/src/queue/common/requests/access-list.request.js +22 -0
- package/build/src/queue/common/requests/access.request.d.ts +12 -0
- package/build/src/queue/common/requests/access.request.js +22 -0
- package/build/src/queue/common/requests/count.request.d.ts +12 -0
- package/build/src/queue/common/requests/count.request.js +25 -0
- package/build/src/queue/common/requests/exit.request.d.ts +12 -0
- package/build/src/queue/common/requests/exit.request.js +19 -0
- package/build/src/queue/common/requests/ignore.request.d.ts +12 -0
- package/build/src/queue/common/requests/ignore.request.js +19 -0
- package/build/src/queue/common/requests/index.d.ts +7 -0
- package/build/src/queue/common/requests/index.js +7 -0
- package/build/src/queue/common/requests/interfaces/access-options.interface.d.ts +5 -0
- package/build/src/queue/common/requests/interfaces/access-options.interface.js +1 -0
- package/build/src/queue/common/requests/interfaces/count-options.interface.d.ts +4 -0
- package/build/src/queue/common/requests/interfaces/count-options.interface.js +1 -0
- package/build/src/queue/common/requests/interfaces/exit-options.interface.d.ts +3 -0
- package/build/src/queue/common/requests/interfaces/exit-options.interface.js +1 -0
- package/build/src/queue/common/requests/interfaces/ignore-options.interface.d.ts +3 -0
- package/build/src/queue/common/requests/interfaces/ignore-options.interface.js +1 -0
- package/build/src/queue/common/requests/interfaces/place-options.inferface.d.ts +3 -0
- package/build/src/queue/common/requests/interfaces/place-options.inferface.js +1 -0
- package/build/src/queue/common/requests/interfaces/remove-options.interface.d.ts +3 -0
- package/build/src/queue/common/requests/interfaces/remove-options.interface.js +1 -0
- package/build/src/queue/common/requests/place.request.d.ts +12 -0
- package/build/src/queue/common/requests/place.request.js +20 -0
- package/build/src/queue/common/requests/remove.request.d.ts +12 -0
- package/build/src/queue/common/requests/remove.request.js +19 -0
- package/build/src/queue/common/utils/find-booking-id.d.ts +2 -0
- package/build/src/queue/common/utils/find-booking-id.js +10 -0
- package/build/src/queue/common/utils/find-booking-id.spec.d.ts +1 -0
- package/build/src/queue/common/utils/find-booking-id.spec.js +9 -0
- package/build/src/queue/common/utils/format-queue-response.d.ts +3 -0
- package/build/src/queue/common/utils/format-queue-response.js +12 -0
- package/build/src/queue/common/utils/index.d.ts +5 -0
- package/build/src/queue/common/utils/index.js +5 -0
- package/build/src/queue/common/utils/interfaces/booking-text.interface.d.ts +3 -0
- package/build/src/queue/common/utils/interfaces/booking-text.interface.js +1 -0
- package/build/src/queue/common/utils/interfaces/format-queue-options.interface.d.ts +11 -0
- package/build/src/queue/common/utils/interfaces/format-queue-options.interface.js +1 -0
- package/build/src/queue/common/utils/interfaces/index.d.ts +6 -0
- package/build/src/queue/common/utils/interfaces/index.js +6 -0
- package/build/src/queue/common/utils/interfaces/queue-access.interface.d.ts +21 -0
- package/build/src/queue/common/utils/interfaces/queue-access.interface.js +1 -0
- package/build/src/queue/common/utils/interfaces/queue-count.interface.d.ts +23 -0
- package/build/src/queue/common/utils/interfaces/queue-count.interface.js +1 -0
- package/build/src/queue/common/utils/interfaces/queue-place.interface.d.ts +8 -0
- package/build/src/queue/common/utils/interfaces/queue-place.interface.js +1 -0
- package/build/src/queue/common/utils/interfaces/warnings-notifications-options.interface.d.ts +5 -0
- package/build/src/queue/common/utils/interfaces/warnings-notifications-options.interface.js +1 -0
- package/build/src/queue/common/utils/parse-paragraph-to-warnings.d.ts +4 -0
- package/build/src/queue/common/utils/parse-paragraph-to-warnings.js +12 -0
- package/build/src/queue/common/utils/parse-warnings-to-notifications.d.ts +6 -0
- package/build/src/queue/common/utils/parse-warnings-to-notifications.js +4 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-access.d.ts +2 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-access.js +6 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-access.spec.d.ts +1 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-access.spec.js +135 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-count.d.ts +2 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-count.js +6 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-count.spec.d.ts +1 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-count.spec.js +67 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-place.d.ts +2 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-place.js +5 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-place.spec.d.ts +1 -0
- package/build/src/queue/common/utils/parse-xml-to-queue-place.spec.js +88 -0
- package/build/src/queue/interfaces/index.d.ts +5 -0
- package/build/src/queue/interfaces/index.js +5 -0
- package/build/src/queue/interfaces/queue-access-options.interface.d.ts +7 -0
- package/build/src/queue/interfaces/queue-access-options.interface.js +1 -0
- package/build/src/queue/interfaces/queue-count.interface.d.ts +3 -0
- package/build/src/queue/interfaces/queue-count.interface.js +1 -0
- package/build/src/queue/interfaces/queue-ignore.interface.d.ts +3 -0
- package/build/src/queue/interfaces/queue-ignore.interface.js +1 -0
- package/build/src/queue/interfaces/queue-place-options.interface.d.ts +6 -0
- package/build/src/queue/interfaces/queue-place-options.interface.js +1 -0
- package/build/src/queue/interfaces/queue-remove.interface.d.ts +3 -0
- package/build/src/queue/interfaces/queue-remove.interface.js +1 -0
- package/build/src/queue/queue.d.ts +13 -0
- package/build/src/queue/queue.js +101 -0
- package/build/src/sabre.d.ts +31 -0
- package/build/src/sabre.js +141 -0
- package/package.json +44 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PlaceOptions } from "./interfaces/place-options.inferface";
|
|
2
|
+
/**
|
|
3
|
+
* {{header}}
|
|
4
|
+
*
|
|
5
|
+
* {{queuePlace(queueInfo)}}
|
|
6
|
+
*
|
|
7
|
+
* {{footer}}
|
|
8
|
+
* @param options PlaceOptions
|
|
9
|
+
* @returns string
|
|
10
|
+
*/
|
|
11
|
+
declare function placeRequest(options: PlaceOptions): string;
|
|
12
|
+
export { placeRequest };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { request } from "../../../common/helpers/request.helper";
|
|
2
|
+
import { ActionsRQ } from "../../../common/interfaces/actions.interface";
|
|
3
|
+
import { queueIdentifier } from "../helpers/queue-identifier.helper";
|
|
4
|
+
import { queuePlace } from "../helpers/queue-place.helper";
|
|
5
|
+
/**
|
|
6
|
+
* {{header}}
|
|
7
|
+
*
|
|
8
|
+
* {{queuePlace(queueInfo)}}
|
|
9
|
+
*
|
|
10
|
+
* {{footer}}
|
|
11
|
+
* @param options PlaceOptions
|
|
12
|
+
* @returns string
|
|
13
|
+
*/
|
|
14
|
+
function placeRequest(options) {
|
|
15
|
+
const { number, pcc, authorization, conversationId } = options;
|
|
16
|
+
const queueInfo = queueIdentifier({ number, code: 11, pcc });
|
|
17
|
+
const body = queuePlace(queueInfo);
|
|
18
|
+
return request({ body, authorization, conversationId, action: ActionsRQ.QUEUE_PLACE });
|
|
19
|
+
}
|
|
20
|
+
export { placeRequest };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RemoveOptions } from "./interfaces/remove-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* {{header}}
|
|
4
|
+
*
|
|
5
|
+
* {{navigationAction(action)}}
|
|
6
|
+
*
|
|
7
|
+
* {{footer}}
|
|
8
|
+
* @param options RemoveOptions
|
|
9
|
+
* @returns string
|
|
10
|
+
*/
|
|
11
|
+
declare function removeRequest(options: RemoveOptions): string;
|
|
12
|
+
export { removeRequest };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { request } from "../../../common/helpers/request.helper";
|
|
2
|
+
import { ActionsRQ } from "../../../common/interfaces/actions.interface";
|
|
3
|
+
import { navigationAction } from "../../common/helpers/navigation-action.helper";
|
|
4
|
+
import { NavigationAction } from "../../common/helpers/interfaces/navigation-actions.interface";
|
|
5
|
+
/**
|
|
6
|
+
* {{header}}
|
|
7
|
+
*
|
|
8
|
+
* {{navigationAction(action)}}
|
|
9
|
+
*
|
|
10
|
+
* {{footer}}
|
|
11
|
+
* @param options RemoveOptions
|
|
12
|
+
* @returns string
|
|
13
|
+
*/
|
|
14
|
+
function removeRequest(options) {
|
|
15
|
+
const { authorization, conversationId } = options;
|
|
16
|
+
const body = navigationAction(NavigationAction.IGNORE);
|
|
17
|
+
return request({ authorization, conversationId, body, action: ActionsRQ.QUEUE_ACCESS });
|
|
18
|
+
}
|
|
19
|
+
export { removeRequest };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function findBookingId(text) {
|
|
2
|
+
if (!text)
|
|
3
|
+
throw new Error('Missing text.');
|
|
4
|
+
const BOOKING_ID_REGEX = /[*]A{1}\w{2}[\s\S]+([A-Z0-9]{6})/g;
|
|
5
|
+
const found = BOOKING_ID_REGEX.exec(text);
|
|
6
|
+
if (!found)
|
|
7
|
+
throw new Error('booking id not found');
|
|
8
|
+
return found[1];
|
|
9
|
+
}
|
|
10
|
+
export { findBookingId };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { findBookingId } from "./find-booking-id";
|
|
2
|
+
describe('Find Booking Id', () => {
|
|
3
|
+
it('should handle booking id', () => {
|
|
4
|
+
const payload = '8AYC.8AYC*AEH 1829/04JUN24 FXIDVU H';
|
|
5
|
+
const response = findBookingId(payload);
|
|
6
|
+
// console.dir(response, { depth: null })
|
|
7
|
+
expect(response).toEqual('FXIDVU');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { parseParagraphToWarnings } from "./parse-paragraph-to-warnings";
|
|
2
|
+
import { parseWarningsToNotifications } from "./parse-warnings-to-notifications";
|
|
3
|
+
function formatQueueResponse(payload) {
|
|
4
|
+
const { paragraph, queue, bookingId, } = payload;
|
|
5
|
+
const warnings = parseParagraphToWarnings(paragraph);
|
|
6
|
+
const notifications = parseWarningsToNotifications({ queue, warnings });
|
|
7
|
+
return {
|
|
8
|
+
bookingId,
|
|
9
|
+
notifications
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export { formatQueueResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Notification } from "../../interfaces";
|
|
2
|
+
import { BookingText } from "./booking-text.interface";
|
|
3
|
+
export interface FormatQueueOptions {
|
|
4
|
+
queue: string;
|
|
5
|
+
paragraph: BookingText;
|
|
6
|
+
bookingId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FormatQueueResponse {
|
|
9
|
+
bookingId: string;
|
|
10
|
+
notifications: Array<Notification>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './booking-text.interface';
|
|
2
|
+
export * from './queue-access.interface';
|
|
3
|
+
export * from './queue-count.interface';
|
|
4
|
+
export * from './queue-place.interface';
|
|
5
|
+
export * from './format-queue-options.interface';
|
|
6
|
+
export * from './warnings-notifications-options.interface';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './booking-text.interface';
|
|
2
|
+
export * from './queue-access.interface';
|
|
3
|
+
export * from './queue-count.interface';
|
|
4
|
+
export * from './queue-place.interface';
|
|
5
|
+
export * from './format-queue-options.interface';
|
|
6
|
+
export * from './warnings-notifications-options.interface';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApplicationResults } from "../../../../common/interfaces";
|
|
2
|
+
import { BookingText } from "./booking-text.interface";
|
|
3
|
+
export interface QueueAccessResponseSuccess {
|
|
4
|
+
queueAccessRS: QueueAccessRS;
|
|
5
|
+
}
|
|
6
|
+
export interface QueueAccessRS {
|
|
7
|
+
applicationResults: ApplicationResults;
|
|
8
|
+
line: {
|
|
9
|
+
dateTime: string;
|
|
10
|
+
pOS: {
|
|
11
|
+
source: {
|
|
12
|
+
agentSine: string;
|
|
13
|
+
pseudoCityCode: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
uniqueID: {
|
|
17
|
+
iD: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
paragraph: BookingText;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ApplicationResults } from "../../../../common/interfaces";
|
|
2
|
+
export interface QueueCountResponseSuccess {
|
|
3
|
+
queueCountRS: QueueCountRS;
|
|
4
|
+
}
|
|
5
|
+
export interface QueueCountRS {
|
|
6
|
+
applicationResults: ApplicationResults;
|
|
7
|
+
queueInfo: QueueInfo;
|
|
8
|
+
total: QueueTotal[];
|
|
9
|
+
}
|
|
10
|
+
interface QueueInfo {
|
|
11
|
+
queueIdentifier: QueueIdentifier[];
|
|
12
|
+
dateTime: string;
|
|
13
|
+
pseudoCityCode: string;
|
|
14
|
+
}
|
|
15
|
+
interface QueueIdentifier {
|
|
16
|
+
count: string;
|
|
17
|
+
number: string;
|
|
18
|
+
}
|
|
19
|
+
interface QueueTotal {
|
|
20
|
+
count: string;
|
|
21
|
+
type: 'MESSAGE' | 'SPECIALS' | 'PNRS';
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function parseParagraphToWarnings(payload) {
|
|
2
|
+
const LIMIT_NOTIFICATIONS = 5;
|
|
3
|
+
const WARNING_REGEX = /\d{3}\s{2}.+/g;
|
|
4
|
+
return payload.text
|
|
5
|
+
.slice(0, LIMIT_NOTIFICATIONS)
|
|
6
|
+
.filter(text => text.match(WARNING_REGEX))
|
|
7
|
+
.map(warningInLine => {
|
|
8
|
+
const [code, message] = warningInLine.split(' ');
|
|
9
|
+
return { code, message };
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export { parseParagraphToWarnings };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { parseWarningsNotificationsOptions } from "./interfaces";
|
|
2
|
+
declare function parseWarningsToNotifications(payload: parseWarningsNotificationsOptions): {
|
|
3
|
+
queue: string;
|
|
4
|
+
warning: import("../interfaces").Warning;
|
|
5
|
+
}[];
|
|
6
|
+
export { parseWarningsToNotifications };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { parseXMLToQueueAccess } from "./parse-xml-to-queue-access";
|
|
2
|
+
describe('Parse XML Queue Access', () => {
|
|
3
|
+
it('should handle response body', () => {
|
|
4
|
+
const bodyPayload = '<QueueAccessRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01" Version="2.1.0"><stl:ApplicationResults status="Complete"><stl:Success timeStamp="2025-02-17T21:00:26Z"/></stl:ApplicationResults><Line><DateTime>2024-05-15T13:24</DateTime><POS><Source AgentSine="A41" PseudoCityCode="8AYC"/></POS><UniqueID ID="AHDPHV"/></Line><Paragraph><Text>011 SEE REMARKS</Text><Text>1.1CALLAUVILLAR/PAUL MR 2.1VILLARVENEGAS/MARIACRISTINA MRS</Text><Text>TKT/TIME LIMIT</Text><Text>1.T-29OCT-8AYC*A41</Text><Text>PHONES</Text><Text>1.TRC871 7222911-A</Text><Text>2.TRC52-871-7221797-B</Text><Text>3.TRC871 7222911-A</Text><Text>PASSENGER EMAIL DATA EXISTS *PE TO DISPLAY ALL</Text><Text>CUSTOMER NUMBER - 421003</Text><Text>INVOICED</Text><Text>ADDRESS</Text><Text>CORPORATIVO GALES SA DE CV</Text><Text>CALZADA PROLONGACION COLON 37</Text><Text>COL. LOS ANGELES</Text><Text>TORREON, COA C.P. 27140</Text><Text>PRICE QUOTE RECORD EXISTS - SYSTEM/MANUAL</Text><Text>TRAVEL POLICY -</Text><Text>¤ AGENCY POLICY</Text><Text>FREQUENT TRAVELER DATA EXISTS *FF TO DISPLAY ALL</Text><Text>PROFILE,POLICY,AND/OR PREFERENCE INDEX DATA EXIST</Text><Text>*PI TO DISPLAY ALL</Text><Text>AA FACTS</Text><Text>1.SSR OTHS 1S PLS ADV TKT BY 17MAY 1324 TRC OR PNR WILL BE CN</Text><Text>L</Text><Text>2.SSR OTHS 1S IF FARE RULE TL DIFFERS FROM AUTO TL</Text><Text>3.SSR OTHS 1S MOST RESTRICTIVE TL WILL APPLY</Text><Text>4.SSR OTHS 1S PAX TRAVELLING THROUGH MX A TRANSIT VISA IS REQ</Text><Text>UIRED</Text><Text>5.SSR OTHS 1S SEE TIMATIC FOR MORE DETAILS</Text><Text>6.OSI 1S *** PREV TIME FOR AM 107I 08FEB TRCMEX 123P 310P</Text><Text>7.OSI 1S *** PREV TIME FOR AM 106I 12FEB MEXTRC 345P 533P</Text><Text>8.SSR OTHS 1S SYNCH MISMATCH OR SUBJECT TO DEBIT MEMO</Text><Text>9.SSR OTHS 1S VCR MISMATCH DETECTED RESOLVE BY 30OCT24 1134TR</Text><Text>C</Text><Text>10.SSR OTHS 1S 1393708855051 COUP1 FLT 107 VS 105 CLS I VS D D</Text><Text>EP 08FEB</Text><Text>11.SSR OTHS 1S VS03FEB SEG1</Text><Text>12.SSR OTHS 1S 1393708855052 COUP1 FLT 107 VS 105 CLS I VS D</Text><Text>13.SSR OTHS 1S DEP08FEB VS 03FEB SEG1</Text><Text>14.SSR OTHS 1S PLS ADV TKT BY 31OCT 1134 TRC OR PNR WILL BE CN</Text><Text>L</Text><Text>15.OSI 1S *** PREV TIME FOR AM 382D 03FEB MEXSJD 110P 240P</Text><Text>16.OSI 1S *** PREV TIME FOR AM 385I 10FEB SJDMEX 333P 655P</Text><Text>17.OSI 1S *** PREV TIME FOR AM 106I 12FEB MEXTRC 410P 603P</Text><Text>GENERAL FACTS</Text><Text>1.OSI YY IATA 86507153 CORPORATIVO GALES PCC 8AYC</Text><Text>2.OSI YY IATA 86507153 CORPORATIVO GALES PCC 8AYC</Text><Text>9.SSR CTCE AM HK1/PAULCALLAU//HOTMAIL.COM</Text><Text>REMARKS</Text><Text>1.NO OLVIDE REVISAR SUS DOCUMENTOS ANTES DE SU VIAJE</Text><Text>2.SU PASAPORTE DEBE TENER UNA VALIDEZ DE POR LO MENOS</Text><Text>3.6 MESES ADICIONALES A SU FECHA DE REGRESO</Text><Text>4.EN CASO DE QUE NO VAYA A VIAJAR, EN LA FECHA SENALADA</Text><Text>5.ES NECESARIO INFORMAR A LA AEROLINEA PARA NO PERDER</Text><Text>6.EL VALOR DE SU BOLETO</Text><Text>7.**LE SUGERIMOS HACER CHECK IN 24 HRS ANTES DE SU SALIDA**</Text><Text>8.EN VUELOS NACIONALES FAVOR DE PRESENTARSE 2 HRS ANTES</Text><Text>9.EN VUELOS INTERNACIONALES FAVOR DE PRESENTARSE 3 HRS</Text><Text>10.ANTES, PRESENTARSE CON IDENTIFICACION OFICIAL</Text><Text>11.EN CORPORATIVO GALES AGRADECEMOS SU PREFERENCIA</Text><Text>12.GRACIAS</Text><Text>13./ZULOAGA 424 LOS ANGELES</Text><Text>14./27140 TORROEN CA</Text><Text>15./MX</Text><Text>16..AG-41</Text><Text>17..AC06SRA TITINA</Text><Text>18.NO OLVIDE REVISAR SUS DOCUMENTOS ANTES DE SU VIAJE</Text><Text>19.SU PASAPORTE DEBE TENER UNA VALIDEZ DE POR LO MENOS</Text><Text>20.6 MESES ADICIONALES A SU FECHA DE REGRESO</Text><Text>21.EN CASO DE QUE NO VAYA A VIAJAR, EN LA FECHA SENALADA</Text><Text>22.ES NECESARIO INFORMAR A LA AEROLINEA PARA NO PERDER</Text><Text>23.EL VALOR DE SU BOLETO</Text><Text>24.**LE SUGERIMOS HACER CHECK IN 24 HRS ANTES DE SU SALIDA**</Text><Text>25.EN VUELOS NACIONALES FAVOR DE PRESENTARSE 2 HRS ANTES</Text><Text>26.EN VUELOS INTERNACIONALES FAVOR DE PRESENTARSE 3 HRS</Text><Text>27.ANTES, PRESENTARSE CON IDENTIFICACION OFICIAL</Text><Text>28.EN CORPORATIVO GALES AGRADECEMOS SU PREFERENCIA</Text><Text>29.GRACIAS</Text><Text>30..CS01-CXSTPV-500-1552</Text><Text>31..MP-PUE</Text><Text>32..UCFDI-S01</Text><Text>33..REGFISREC-616</Text><Text>34.H-AUTH-SNTR/VI1552/15MAY/01951715797795977256</Text><Text>35.H- AUTH-APV/095744/00/MXN19348</Text><Text>36.H- AUTH-CSC NOT SUPPLIED/</Text><Text>37.H- AUTH-AVS NOT SUPPLIED/</Text><Text>38.XXTAW8AYC17MAY110/0400A/</Text><Text>39.H-AUTH-SNTR/VI1552/29OCT/01031730244854873291</Text><Text>40.H- AUTH-APV/041642/00/MXN2862</Text><Text>41.H- AUTH-CSC NOT SUPPLIED/</Text><Text>42.H- AUTH-AVS NOT SUPPLIED/</Text><Text>44.H-AEBT/1393488840744/8AYC*A41/8AYC*A41</Text><Text>45.H-AUTH-SNTR/VI1552/29OCT/01921730244920432549</Text><Text>46.H- AUTH-APV/052114/00/MXN2862</Text><Text>47.H- AUTH-CSC NOT SUPPLIED/</Text><Text>48.H- AUTH-AVS NOT SUPPLIED/</Text><Text>50.H-AEBT/1393488840745/8AYC*A41/8AYC*A41</Text><Text>ACCOUNTING DATA</Text><Text>1. AM3708855051/ 72/ 7162/ 34/D1146/D1332/ONE</Text><Text>/CCVI4915736003281552 1.1CALLAUVILLAR PAUL MR/1/D/E</Text><Text>2. AM3708855052/ 72/ 7162/ 34/D1146/D1332/ONE</Text><Text>/CCVI4915736003281552 2.1VILLARVENEGAS MARIACRISTINA M/1/</Text><Text>D/E</Text><Text>3. AM3488840744/ 20/ 2030/ 0/D325/D507/ONE/C</Text><Text>CVI4915736003281552 1.1CALLAUVILLAR PAUL /1/D/E-13937088</Text><Text>55051/12</Text><Text>4. AM3488840745/ 20/ 2030/ 0/D325/D507/ONE/C</Text><Text>CVI4915736003281552 2.1VILLARVENEGAS MARI/1/D/E-13937088</Text><Text>55052/12</Text><Text>RECEIVED FROM - SRA TITINA/BM</Text><Text>8AYC.8AYC*A41 1324/15MAY24 AHDPHV H</Text></Paragraph></QueueAccessRS>';
|
|
5
|
+
const response = parseXMLToQueueAccess(bodyPayload);
|
|
6
|
+
// console.dir(queueCountSuccessResponse, { depth: null })
|
|
7
|
+
expect(response).toEqual({
|
|
8
|
+
applicationResults: {
|
|
9
|
+
success: { timeStamp: '2025-02-17T21:00:26Z' },
|
|
10
|
+
status: 'Complete'
|
|
11
|
+
},
|
|
12
|
+
line: {
|
|
13
|
+
dateTime: '2024-05-15T13:24',
|
|
14
|
+
pOS: { source: { agentSine: 'A41', pseudoCityCode: '8AYC' } },
|
|
15
|
+
uniqueID: { iD: 'AHDPHV' }
|
|
16
|
+
},
|
|
17
|
+
paragraph: {
|
|
18
|
+
text: [
|
|
19
|
+
'011 SEE REMARKS',
|
|
20
|
+
'1.1CALLAUVILLAR/PAUL MR 2.1VILLARVENEGAS/MARIACRISTINA MRS',
|
|
21
|
+
'TKT/TIME LIMIT',
|
|
22
|
+
'1.T-29OCT-8AYC*A41',
|
|
23
|
+
'PHONES',
|
|
24
|
+
'1.TRC871 7222911-A',
|
|
25
|
+
'2.TRC52-871-7221797-B',
|
|
26
|
+
'3.TRC871 7222911-A',
|
|
27
|
+
'PASSENGER EMAIL DATA EXISTS *PE TO DISPLAY ALL',
|
|
28
|
+
'CUSTOMER NUMBER - 421003',
|
|
29
|
+
'INVOICED',
|
|
30
|
+
'ADDRESS',
|
|
31
|
+
'CORPORATIVO GALES SA DE CV',
|
|
32
|
+
'CALZADA PROLONGACION COLON 37',
|
|
33
|
+
'COL. LOS ANGELES',
|
|
34
|
+
'TORREON, COA C.P. 27140',
|
|
35
|
+
'PRICE QUOTE RECORD EXISTS - SYSTEM/MANUAL',
|
|
36
|
+
'TRAVEL POLICY -',
|
|
37
|
+
'¤ AGENCY POLICY',
|
|
38
|
+
'FREQUENT TRAVELER DATA EXISTS *FF TO DISPLAY ALL',
|
|
39
|
+
'PROFILE,POLICY,AND/OR PREFERENCE INDEX DATA EXIST',
|
|
40
|
+
'*PI TO DISPLAY ALL',
|
|
41
|
+
'AA FACTS',
|
|
42
|
+
'1.SSR OTHS 1S PLS ADV TKT BY 17MAY 1324 TRC OR PNR WILL BE CN',
|
|
43
|
+
'L',
|
|
44
|
+
'2.SSR OTHS 1S IF FARE RULE TL DIFFERS FROM AUTO TL',
|
|
45
|
+
'3.SSR OTHS 1S MOST RESTRICTIVE TL WILL APPLY',
|
|
46
|
+
'4.SSR OTHS 1S PAX TRAVELLING THROUGH MX A TRANSIT VISA IS REQ',
|
|
47
|
+
'UIRED',
|
|
48
|
+
'5.SSR OTHS 1S SEE TIMATIC FOR MORE DETAILS',
|
|
49
|
+
'6.OSI 1S *** PREV TIME FOR AM 107I 08FEB TRCMEX 123P 310P',
|
|
50
|
+
'7.OSI 1S *** PREV TIME FOR AM 106I 12FEB MEXTRC 345P 533P',
|
|
51
|
+
'8.SSR OTHS 1S SYNCH MISMATCH OR SUBJECT TO DEBIT MEMO',
|
|
52
|
+
'9.SSR OTHS 1S VCR MISMATCH DETECTED RESOLVE BY 30OCT24 1134TR',
|
|
53
|
+
'C',
|
|
54
|
+
'10.SSR OTHS 1S 1393708855051 COUP1 FLT 107 VS 105 CLS I VS D D',
|
|
55
|
+
'EP 08FEB',
|
|
56
|
+
'11.SSR OTHS 1S VS03FEB SEG1',
|
|
57
|
+
'12.SSR OTHS 1S 1393708855052 COUP1 FLT 107 VS 105 CLS I VS D',
|
|
58
|
+
'13.SSR OTHS 1S DEP08FEB VS 03FEB SEG1',
|
|
59
|
+
'14.SSR OTHS 1S PLS ADV TKT BY 31OCT 1134 TRC OR PNR WILL BE CN',
|
|
60
|
+
'L',
|
|
61
|
+
'15.OSI 1S *** PREV TIME FOR AM 382D 03FEB MEXSJD 110P 240P',
|
|
62
|
+
'16.OSI 1S *** PREV TIME FOR AM 385I 10FEB SJDMEX 333P 655P',
|
|
63
|
+
'17.OSI 1S *** PREV TIME FOR AM 106I 12FEB MEXTRC 410P 603P',
|
|
64
|
+
'GENERAL FACTS',
|
|
65
|
+
'1.OSI YY IATA 86507153 CORPORATIVO GALES PCC 8AYC',
|
|
66
|
+
'2.OSI YY IATA 86507153 CORPORATIVO GALES PCC 8AYC',
|
|
67
|
+
'9.SSR CTCE AM HK1/PAULCALLAU//HOTMAIL.COM',
|
|
68
|
+
'REMARKS',
|
|
69
|
+
'1.NO OLVIDE REVISAR SUS DOCUMENTOS ANTES DE SU VIAJE',
|
|
70
|
+
'2.SU PASAPORTE DEBE TENER UNA VALIDEZ DE POR LO MENOS',
|
|
71
|
+
'3.6 MESES ADICIONALES A SU FECHA DE REGRESO',
|
|
72
|
+
'4.EN CASO DE QUE NO VAYA A VIAJAR, EN LA FECHA SENALADA',
|
|
73
|
+
'5.ES NECESARIO INFORMAR A LA AEROLINEA PARA NO PERDER',
|
|
74
|
+
'6.EL VALOR DE SU BOLETO',
|
|
75
|
+
'7.**LE SUGERIMOS HACER CHECK IN 24 HRS ANTES DE SU SALIDA**',
|
|
76
|
+
'8.EN VUELOS NACIONALES FAVOR DE PRESENTARSE 2 HRS ANTES',
|
|
77
|
+
'9.EN VUELOS INTERNACIONALES FAVOR DE PRESENTARSE 3 HRS',
|
|
78
|
+
'10.ANTES, PRESENTARSE CON IDENTIFICACION OFICIAL',
|
|
79
|
+
'11.EN CORPORATIVO GALES AGRADECEMOS SU PREFERENCIA',
|
|
80
|
+
'12.GRACIAS',
|
|
81
|
+
'13./ZULOAGA 424 LOS ANGELES',
|
|
82
|
+
'14./27140 TORROEN CA',
|
|
83
|
+
'15./MX',
|
|
84
|
+
'16..AG-41',
|
|
85
|
+
'17..AC06SRA TITINA',
|
|
86
|
+
'18.NO OLVIDE REVISAR SUS DOCUMENTOS ANTES DE SU VIAJE',
|
|
87
|
+
'19.SU PASAPORTE DEBE TENER UNA VALIDEZ DE POR LO MENOS',
|
|
88
|
+
'20.6 MESES ADICIONALES A SU FECHA DE REGRESO',
|
|
89
|
+
'21.EN CASO DE QUE NO VAYA A VIAJAR, EN LA FECHA SENALADA',
|
|
90
|
+
'22.ES NECESARIO INFORMAR A LA AEROLINEA PARA NO PERDER',
|
|
91
|
+
'23.EL VALOR DE SU BOLETO',
|
|
92
|
+
'24.**LE SUGERIMOS HACER CHECK IN 24 HRS ANTES DE SU SALIDA**',
|
|
93
|
+
'25.EN VUELOS NACIONALES FAVOR DE PRESENTARSE 2 HRS ANTES',
|
|
94
|
+
'26.EN VUELOS INTERNACIONALES FAVOR DE PRESENTARSE 3 HRS',
|
|
95
|
+
'27.ANTES, PRESENTARSE CON IDENTIFICACION OFICIAL',
|
|
96
|
+
'28.EN CORPORATIVO GALES AGRADECEMOS SU PREFERENCIA',
|
|
97
|
+
'29.GRACIAS',
|
|
98
|
+
'30..CS01-CXSTPV-500-1552',
|
|
99
|
+
'31..MP-PUE',
|
|
100
|
+
'32..UCFDI-S01',
|
|
101
|
+
'33..REGFISREC-616',
|
|
102
|
+
'34.H-AUTH-SNTR/VI1552/15MAY/01951715797795977256',
|
|
103
|
+
'35.H- AUTH-APV/095744/00/MXN19348',
|
|
104
|
+
'36.H- AUTH-CSC NOT SUPPLIED/',
|
|
105
|
+
'37.H- AUTH-AVS NOT SUPPLIED/',
|
|
106
|
+
'38.XXTAW8AYC17MAY110/0400A/',
|
|
107
|
+
'39.H-AUTH-SNTR/VI1552/29OCT/01031730244854873291',
|
|
108
|
+
'40.H- AUTH-APV/041642/00/MXN2862',
|
|
109
|
+
'41.H- AUTH-CSC NOT SUPPLIED/',
|
|
110
|
+
'42.H- AUTH-AVS NOT SUPPLIED/',
|
|
111
|
+
'44.H-AEBT/1393488840744/8AYC*A41/8AYC*A41',
|
|
112
|
+
'45.H-AUTH-SNTR/VI1552/29OCT/01921730244920432549',
|
|
113
|
+
'46.H- AUTH-APV/052114/00/MXN2862',
|
|
114
|
+
'47.H- AUTH-CSC NOT SUPPLIED/',
|
|
115
|
+
'48.H- AUTH-AVS NOT SUPPLIED/',
|
|
116
|
+
'50.H-AEBT/1393488840745/8AYC*A41/8AYC*A41',
|
|
117
|
+
'ACCOUNTING DATA',
|
|
118
|
+
"1. AM3708855051/ 72/ 7162/ 34/D1146/D1332/ONE",
|
|
119
|
+
"/CCVI4915736003281552 1.1CALLAUVILLAR PAUL MR/1/D/E",
|
|
120
|
+
"2. AM3708855052/ 72/ 7162/ 34/D1146/D1332/ONE",
|
|
121
|
+
"/CCVI4915736003281552 2.1VILLARVENEGAS MARIACRISTINA M/1/",
|
|
122
|
+
"D/E",
|
|
123
|
+
"3. AM3488840744/ 20/ 2030/ 0/D325/D507/ONE/C",
|
|
124
|
+
"CVI4915736003281552 1.1CALLAUVILLAR PAUL /1/D/E-13937088",
|
|
125
|
+
"55051/12",
|
|
126
|
+
"4. AM3488840745/ 20/ 2030/ 0/D325/D507/ONE/C",
|
|
127
|
+
"CVI4915736003281552 2.1VILLARVENEGAS MARI/1/D/E-13937088",
|
|
128
|
+
"55052/12",
|
|
129
|
+
"RECEIVED FROM - SRA TITINA/BM",
|
|
130
|
+
"8AYC.8AYC*A41 1324/15MAY24 AHDPHV H"
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { parseXMLToQueueCount } from "./parse-xml-to-queue-count";
|
|
2
|
+
describe('Parse XML Queue Count', () => {
|
|
3
|
+
it('should handle minimal response body', () => {
|
|
4
|
+
const bodyPayload = '<QueueCountRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01" Version="2.2.1"><stl:ApplicationResults status="Complete"><stl:Success timeStamp="2025-02-17T19:54:14Z"/></stl:ApplicationResults><QueueInfo DateTime="02-17T13:54" PseudoCityCode="H8GI"><QueueIdentifier Count="6" Number="S"/><QueueIdentifier Count="1" Number="305"/></QueueInfo><Totals Count="6" Type="MESSAGES"/><Totals Count="0" Type="SPECIALS"/><Totals Count="1" Type="PNRS"/></QueueCountRS>';
|
|
5
|
+
const queueCountSuccessResponse = parseXMLToQueueCount(bodyPayload);
|
|
6
|
+
// console.dir(queueCountSuccessResponse, { depth: null })
|
|
7
|
+
expect(queueCountSuccessResponse).toEqual({
|
|
8
|
+
applicationResults: {
|
|
9
|
+
success: { timeStamp: '2025-02-17T19:54:14Z' },
|
|
10
|
+
status: 'Complete'
|
|
11
|
+
},
|
|
12
|
+
queueInfo: {
|
|
13
|
+
queueIdentifier: [{ count: '6', number: 'S' }, { count: '1', number: '305' }],
|
|
14
|
+
dateTime: '02-17T13:54',
|
|
15
|
+
pseudoCityCode: 'H8GI'
|
|
16
|
+
},
|
|
17
|
+
totals: [
|
|
18
|
+
{ count: '6', type: 'MESSAGES' },
|
|
19
|
+
{ count: '0', type: 'SPECIALS' },
|
|
20
|
+
{ count: '1', type: 'PNRS' }
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
it('should handle response body', () => {
|
|
25
|
+
const bodyPayload = '<QueueCountRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01" Version="2.2.1"><stl:ApplicationResults status="Complete"><stl:Success timeStamp="2025-02-16T17:29:06Z"/></stl:ApplicationResults><QueueInfo DateTime="02-16T11:29" PseudoCityCode="8AYC"><QueueIdentifier Count="185" Number="S"/><QueueIdentifier Count="647" Number="115"/><QueueIdentifier Count="14" Number="0"/><QueueIdentifier Count="197" Number="116"/><QueueIdentifier Count="46" Number="1"/><QueueIdentifier Count="166" Number="118"/><QueueIdentifier Count="4" Number="6"/><QueueIdentifier Count="795" Number="120"/><QueueIdentifier Count="17" Number="7"/><QueueIdentifier Count="72" Number="195"/><QueueIdentifier Count="18" Number="9"/><QueueIdentifier Count="1" Number="13"/><QueueIdentifier Count="4" Number="20"/><QueueIdentifier Count="8" Number="25"/><QueueIdentifier Count="1486" Number="100"/><QueueIdentifier Count="296" Number="101"/><QueueIdentifier Count="10" Number="102"/><QueueIdentifier Count="17" Number="103"/><QueueIdentifier Count="2" Number="104"/><QueueIdentifier Count="1" Number="107"/><QueueIdentifier Count="32" Number="108"/><QueueIdentifier Count="32" Number="110"/></QueueInfo><Totals Count="185" Type="MESSAGES"/><Totals Count="0" Type="SPECIALS"/><Totals Count="3865" Type="PNRS"/></QueueCountRS>';
|
|
26
|
+
const queueCountSuccessResponse = parseXMLToQueueCount(bodyPayload);
|
|
27
|
+
expect(queueCountSuccessResponse).toEqual({
|
|
28
|
+
applicationResults: {
|
|
29
|
+
success: { timeStamp: '2025-02-16T17:29:06Z' },
|
|
30
|
+
status: 'Complete'
|
|
31
|
+
},
|
|
32
|
+
queueInfo: {
|
|
33
|
+
queueIdentifier: [
|
|
34
|
+
{ count: '185', number: 'S' },
|
|
35
|
+
{ count: '647', number: '115' },
|
|
36
|
+
{ count: '14', number: '0' },
|
|
37
|
+
{ count: '197', number: '116' },
|
|
38
|
+
{ count: '46', number: '1' },
|
|
39
|
+
{ count: '166', number: '118' },
|
|
40
|
+
{ count: '4', number: '6' },
|
|
41
|
+
{ count: '795', number: '120' },
|
|
42
|
+
{ count: '17', number: '7' },
|
|
43
|
+
{ count: '72', number: '195' },
|
|
44
|
+
{ count: '18', number: '9' },
|
|
45
|
+
{ count: '1', number: '13' },
|
|
46
|
+
{ count: '4', number: '20' },
|
|
47
|
+
{ count: '8', number: '25' },
|
|
48
|
+
{ count: '1486', number: '100' },
|
|
49
|
+
{ count: '296', number: '101' },
|
|
50
|
+
{ count: '10', number: '102' },
|
|
51
|
+
{ count: '17', number: '103' },
|
|
52
|
+
{ count: '2', number: '104' },
|
|
53
|
+
{ count: '1', number: '107' },
|
|
54
|
+
{ count: '32', number: '108' },
|
|
55
|
+
{ count: '32', number: '110' }
|
|
56
|
+
],
|
|
57
|
+
dateTime: '02-16T11:29',
|
|
58
|
+
pseudoCityCode: '8AYC'
|
|
59
|
+
},
|
|
60
|
+
totals: [
|
|
61
|
+
{ count: '185', type: 'MESSAGES' },
|
|
62
|
+
{ count: '0', type: 'SPECIALS' },
|
|
63
|
+
{ count: '3865', type: 'PNRS' }
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|