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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Carlos Ivan Soto Perez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Sabre as LegacySabre } from './src/sabre';
|
|
2
|
+
export { ErrorResponse } from './src/interfaces';
|
|
3
|
+
export * from './src/daily-sales/interfaces/daily-sales-report-options.interface';
|
|
4
|
+
export * from './src/daily-sales/interfaces/daily-sales-summary-options.interface';
|
|
5
|
+
export * from './src/queue/interfaces/queue-access-options.interface';
|
|
6
|
+
export * from './src/queue/interfaces/queue-count.interface';
|
|
7
|
+
export * from './src/queue/interfaces/queue-ignore.interface';
|
|
8
|
+
export * from './src/queue/interfaces/queue-place-options.interface';
|
|
9
|
+
export * from './src/queue/interfaces/queue-remove.interface';
|
package/build/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Sabre as LegacySabre } from './src/sabre';
|
|
2
|
+
export * from './src/daily-sales/interfaces/daily-sales-report-options.interface';
|
|
3
|
+
export * from './src/daily-sales/interfaces/daily-sales-summary-options.interface';
|
|
4
|
+
export * from './src/queue/interfaces/queue-access-options.interface';
|
|
5
|
+
export * from './src/queue/interfaces/queue-count.interface';
|
|
6
|
+
export * from './src/queue/interfaces/queue-ignore.interface';
|
|
7
|
+
export * from './src/queue/interfaces/queue-place-options.interface';
|
|
8
|
+
export * from './src/queue/interfaces/queue-remove.interface';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sabre-legacy-client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Sabre Node.js SDK",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sabre",
|
|
7
|
+
"legacy",
|
|
8
|
+
"client",
|
|
9
|
+
"soap"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/CarlosIvanSoto/sabre-legacy-client#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/CarlosIvanSoto/sabre-legacy-client/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/CarlosIvanSoto/sabre-legacy-client.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "Carlos Ivan Soto <csoto_99@outlook.com>",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"main": "./build/index.js",
|
|
23
|
+
"types": "./build/index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"build/**",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "npx tsc",
|
|
30
|
+
"test": "jest",
|
|
31
|
+
"test:watch": "jest --watch"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/jest": "^29.5.14",
|
|
35
|
+
"@types/node": "^22.13.3",
|
|
36
|
+
"jest": "^29.7.0",
|
|
37
|
+
"ts-jest": "^29.2.5",
|
|
38
|
+
"ts-node": "^10.9.2",
|
|
39
|
+
"typescript": "^5.7.3"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"fast-xml-parser": "^4.5.1"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Sabre } from "../sabre";
|
|
2
|
+
export declare class Authentication {
|
|
3
|
+
private readonly sabre;
|
|
4
|
+
constructor(sabre: Sabre);
|
|
5
|
+
sessionCreate(): Promise<{
|
|
6
|
+
data: string | null;
|
|
7
|
+
error: import("../interfaces").ErrorResponse | null;
|
|
8
|
+
}>;
|
|
9
|
+
sessionClose(): Promise<{
|
|
10
|
+
data: unknown;
|
|
11
|
+
error: import("../interfaces").ErrorResponse | null;
|
|
12
|
+
}>;
|
|
13
|
+
ping(): Promise<{
|
|
14
|
+
data: unknown;
|
|
15
|
+
error: import("../interfaces").ErrorResponse | null;
|
|
16
|
+
}>;
|
|
17
|
+
tokenCreate(): Promise<{
|
|
18
|
+
data: string | null;
|
|
19
|
+
error: import("../interfaces").ErrorResponse | null;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ActionsRQ } from "../common/interfaces/actions.interface";
|
|
2
|
+
import { pingRequest, sessionCloseRequest, sessionCreateRequest, tokenCreateRequest } from "./requests";
|
|
3
|
+
export class Authentication {
|
|
4
|
+
sabre;
|
|
5
|
+
constructor(sabre) {
|
|
6
|
+
this.sabre = sabre;
|
|
7
|
+
}
|
|
8
|
+
async sessionCreate() {
|
|
9
|
+
this.sabre.setAction(ActionsRQ.SESSION_CREATE);
|
|
10
|
+
const response = await this.sabre.auth(sessionCreateRequest);
|
|
11
|
+
return response;
|
|
12
|
+
}
|
|
13
|
+
async sessionClose() {
|
|
14
|
+
this.sabre.setAction(ActionsRQ.SESSION_CLOSE);
|
|
15
|
+
const response = await this.sabre.post(sessionCloseRequest);
|
|
16
|
+
return response;
|
|
17
|
+
}
|
|
18
|
+
async ping() {
|
|
19
|
+
this.sabre.setAction(ActionsRQ.PING);
|
|
20
|
+
const response = await this.sabre.post(pingRequest);
|
|
21
|
+
return response;
|
|
22
|
+
}
|
|
23
|
+
async tokenCreate() {
|
|
24
|
+
this.sabre.setAction(ActionsRQ.TOKEN_CREATE);
|
|
25
|
+
const response = await this.sabre.auth(tokenCreateRequest);
|
|
26
|
+
return response;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './username-token.helper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './username-token.helper';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UsernameTokenOptions } from "../requests/interfaces/username-token-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* <UsernameToken>
|
|
4
|
+
* <Username>{{username}}</Username>
|
|
5
|
+
* <Password>{{password}}</Password>
|
|
6
|
+
* <Organization>{{pcc}}</Organization>
|
|
7
|
+
* <Domain>{{domain}}</Domain>
|
|
8
|
+
* <ClientId>{{clientId}}</ClientId>
|
|
9
|
+
* <ClientSecret>{{clientSecret}}</ClientSecret>
|
|
10
|
+
* </UsernameToken>
|
|
11
|
+
* @param options
|
|
12
|
+
* @returns string
|
|
13
|
+
*/
|
|
14
|
+
declare function usernameToken(options: UsernameTokenOptions): string;
|
|
15
|
+
export { usernameToken };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <UsernameToken>
|
|
3
|
+
* <Username>{{username}}</Username>
|
|
4
|
+
* <Password>{{password}}</Password>
|
|
5
|
+
* <Organization>{{pcc}}</Organization>
|
|
6
|
+
* <Domain>{{domain}}</Domain>
|
|
7
|
+
* <ClientId>{{clientId}}</ClientId>
|
|
8
|
+
* <ClientSecret>{{clientSecret}}</ClientSecret>
|
|
9
|
+
* </UsernameToken>
|
|
10
|
+
* @param options
|
|
11
|
+
* @returns string
|
|
12
|
+
*/
|
|
13
|
+
function usernameToken(options) {
|
|
14
|
+
const { username, password, pcc, domain } = options;
|
|
15
|
+
return `<UsernameToken><Username>${username}</Username><Password>${password}</Password><Organization>${pcc}</Organization><Domain>${domain}</Domain></UsernameToken>`;
|
|
16
|
+
}
|
|
17
|
+
export { usernameToken };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PingOptions } from "./interfaces/ping-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* {{header}}
|
|
4
|
+
*
|
|
5
|
+
* <OTA_PingRQ Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2003/05"/>
|
|
6
|
+
*
|
|
7
|
+
* {{footer}}
|
|
8
|
+
* @param payload PingOptions
|
|
9
|
+
* @returns string
|
|
10
|
+
*/
|
|
11
|
+
declare function pingRequest(payload: PingOptions): string;
|
|
12
|
+
export { pingRequest };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { request } from "../../common/helpers/request.helper";
|
|
2
|
+
import { ActionsRQ } from "../../common/interfaces/actions.interface";
|
|
3
|
+
/**
|
|
4
|
+
* {{header}}
|
|
5
|
+
*
|
|
6
|
+
* <OTA_PingRQ Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2003/05"/>
|
|
7
|
+
*
|
|
8
|
+
* {{footer}}
|
|
9
|
+
* @param payload PingOptions
|
|
10
|
+
* @returns string
|
|
11
|
+
*/
|
|
12
|
+
function pingRequest(payload) {
|
|
13
|
+
const body = '<OTA_PingRQ Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2003/05"/>';
|
|
14
|
+
return request({ body, action: ActionsRQ.PING, ...payload });
|
|
15
|
+
}
|
|
16
|
+
export { pingRequest };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SessionCloseOptions } from "./interfaces/session-close-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* {{header}}
|
|
4
|
+
*
|
|
5
|
+
* <SessionCloseRQ Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2002/11"/>
|
|
6
|
+
*
|
|
7
|
+
* {{footer}}
|
|
8
|
+
* @param payload SessionCloseOptions
|
|
9
|
+
* @returns string
|
|
10
|
+
*/
|
|
11
|
+
declare function sessionCloseRequest(payload: SessionCloseOptions): string;
|
|
12
|
+
export { sessionCloseRequest };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionsRQ } from './../../common/interfaces/actions.interface';
|
|
2
|
+
import { request } from "../../common/helpers/request.helper";
|
|
3
|
+
/**
|
|
4
|
+
* {{header}}
|
|
5
|
+
*
|
|
6
|
+
* <SessionCloseRQ Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2002/11"/>
|
|
7
|
+
*
|
|
8
|
+
* {{footer}}
|
|
9
|
+
* @param payload SessionCloseOptions
|
|
10
|
+
* @returns string
|
|
11
|
+
*/
|
|
12
|
+
function sessionCloseRequest(payload) {
|
|
13
|
+
const body = '<SessionCloseRQ Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2002/11"/>';
|
|
14
|
+
return request({ body, action: ActionsRQ.SESSION_CLOSE, ...payload });
|
|
15
|
+
}
|
|
16
|
+
export { sessionCloseRequest };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SessionCreateOptions } from "./interfaces/session-create-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* {{header = message + security ( usernameToken )}}
|
|
4
|
+
*
|
|
5
|
+
* <SessionCreateRQ returnContextID="true" Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2002/11"/>
|
|
6
|
+
*
|
|
7
|
+
* {{footer}}
|
|
8
|
+
* @param payload SessionCreateOptions
|
|
9
|
+
* @returns string
|
|
10
|
+
*/
|
|
11
|
+
declare function sessionCreateRequest(payload: SessionCreateOptions): string;
|
|
12
|
+
export { sessionCreateRequest };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ActionsRQ } from "../../common/interfaces/actions.interface";
|
|
2
|
+
import { messageHeader } from "../../common/helpers/message-header.helper";
|
|
3
|
+
import { security } from "../../common/helpers/security.helper";
|
|
4
|
+
import { soapEnv } from "../../common/helpers/soap-env.helper";
|
|
5
|
+
import { usernameToken } from "../helpers/username-token.helper";
|
|
6
|
+
/**
|
|
7
|
+
* {{header = message + security ( usernameToken )}}
|
|
8
|
+
*
|
|
9
|
+
* <SessionCreateRQ returnContextID="true" Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2002/11"/>
|
|
10
|
+
*
|
|
11
|
+
* {{footer}}
|
|
12
|
+
* @param payload SessionCreateOptions
|
|
13
|
+
* @returns string
|
|
14
|
+
*/
|
|
15
|
+
function sessionCreateRequest(payload) {
|
|
16
|
+
const { conversationId, authorization } = payload;
|
|
17
|
+
const message = messageHeader({
|
|
18
|
+
action: ActionsRQ.SESSION_CREATE,
|
|
19
|
+
conversationId: conversationId,
|
|
20
|
+
to: 'Sabre_API',
|
|
21
|
+
});
|
|
22
|
+
const header = message + security(usernameToken(authorization));
|
|
23
|
+
const body = '<SessionCreateRQ returnContextID="true" Version="1.0.0" xmlns="http://www.opentravel.org/OTA/2002/11"/>';
|
|
24
|
+
return soapEnv({ header, body });
|
|
25
|
+
}
|
|
26
|
+
export { sessionCreateRequest };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TokenCreateOptions } from "./interfaces/token-create-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* {{header}}
|
|
4
|
+
*
|
|
5
|
+
* <TokenCreateRQ Version="1.0.0" xmlns="http://webservices.sabre.com"/>
|
|
6
|
+
*
|
|
7
|
+
* {{footer}}
|
|
8
|
+
* @param payload TokenCreateOptions
|
|
9
|
+
* @returns string
|
|
10
|
+
*/
|
|
11
|
+
declare function tokenCreateRequest(payload: TokenCreateOptions): string;
|
|
12
|
+
export { tokenCreateRequest };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ActionsRQ } from "../../common/interfaces/actions.interface";
|
|
2
|
+
import { messageHeader } from "../../common/helpers/message-header.helper";
|
|
3
|
+
import { security } from "../../common/helpers/security.helper";
|
|
4
|
+
import { soapEnv } from "../../common/helpers/soap-env.helper";
|
|
5
|
+
import { usernameToken } from "../helpers/username-token.helper";
|
|
6
|
+
/**
|
|
7
|
+
* {{header}}
|
|
8
|
+
*
|
|
9
|
+
* <TokenCreateRQ Version="1.0.0" xmlns="http://webservices.sabre.com"/>
|
|
10
|
+
*
|
|
11
|
+
* {{footer}}
|
|
12
|
+
* @param payload TokenCreateOptions
|
|
13
|
+
* @returns string
|
|
14
|
+
*/
|
|
15
|
+
function tokenCreateRequest(payload) {
|
|
16
|
+
const { conversationId, authorization } = payload;
|
|
17
|
+
const message = messageHeader({
|
|
18
|
+
action: ActionsRQ.TOKEN_CREATE,
|
|
19
|
+
conversationId: conversationId,
|
|
20
|
+
to: 'Sabre_API',
|
|
21
|
+
});
|
|
22
|
+
const header = message + security(usernameToken(authorization));
|
|
23
|
+
const body = '<TokenCreateRQ Version="1.0.0" xmlns="http://webservices.sabre.com"/>';
|
|
24
|
+
return soapEnv({ header, body });
|
|
25
|
+
}
|
|
26
|
+
export { tokenCreateRequest };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const parseXML: <T>(xml: string) => T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { XMLParser } from "fast-xml-parser";
|
|
2
|
+
const options = {
|
|
3
|
+
textNodeName: "content",
|
|
4
|
+
attributeNamePrefix: "",
|
|
5
|
+
removeNSPrefix: true,
|
|
6
|
+
ignoreAttributes: [/^xmlns:/, /^eb:/, /^soap-env:/, /^xmlns/, /^Version/],
|
|
7
|
+
transformTagName: (tagName) => tagName[0].toLowerCase() + tagName.slice(1),
|
|
8
|
+
transformAttributeName: (attributeName) => attributeName[0].toLowerCase() + attributeName.slice(1)
|
|
9
|
+
};
|
|
10
|
+
// function parseXML<T>(xml: string): T {
|
|
11
|
+
// return new XMLParser(options).parse(xml)
|
|
12
|
+
// }
|
|
13
|
+
// export { parseXML }
|
|
14
|
+
export const parseXML = (() => {
|
|
15
|
+
const parser = new XMLParser(options);
|
|
16
|
+
return (xml) => parser.parse(xml);
|
|
17
|
+
})();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HeaderOptions } from "../interfaces/header-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* {{messageHeader({ action, conversationId }) + security(authorization)}}
|
|
5
|
+
*
|
|
6
|
+
* @param payload HeaderOptions
|
|
7
|
+
* @returns string
|
|
8
|
+
*/
|
|
9
|
+
declare function header(payload: HeaderOptions): string;
|
|
10
|
+
export { header };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { messageHeader } from "./message-header.helper";
|
|
2
|
+
import { security } from "./security.helper";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* {{messageHeader({ action, conversationId }) + security(authorization)}}
|
|
6
|
+
*
|
|
7
|
+
* @param payload HeaderOptions
|
|
8
|
+
* @returns string
|
|
9
|
+
*/
|
|
10
|
+
function header(payload) {
|
|
11
|
+
const { action, conversationId, authorization } = payload;
|
|
12
|
+
return messageHeader({ action, conversationId }) + security(authorization);
|
|
13
|
+
}
|
|
14
|
+
export { header };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MessageHeaderOptions } from "../interfaces/message-header-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* <MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
|
|
4
|
+
* <From>
|
|
5
|
+
* <PartyId>{{from}}</PartyId>
|
|
6
|
+
* </From>
|
|
7
|
+
* <To>
|
|
8
|
+
* <PartyId>{{to}}</PartyId>
|
|
9
|
+
* </To>
|
|
10
|
+
* <ConversationId>{{conversationId}}</ConversationId>
|
|
11
|
+
* <Action>{{action}}</Action>
|
|
12
|
+
* </MessageHeader>
|
|
13
|
+
* @param payload
|
|
14
|
+
* @returns string
|
|
15
|
+
*/
|
|
16
|
+
declare function messageHeader(payload: MessageHeaderOptions): string;
|
|
17
|
+
export { messageHeader };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
|
|
3
|
+
* <From>
|
|
4
|
+
* <PartyId>{{from}}</PartyId>
|
|
5
|
+
* </From>
|
|
6
|
+
* <To>
|
|
7
|
+
* <PartyId>{{to}}</PartyId>
|
|
8
|
+
* </To>
|
|
9
|
+
* <ConversationId>{{conversationId}}</ConversationId>
|
|
10
|
+
* <Action>{{action}}</Action>
|
|
11
|
+
* </MessageHeader>
|
|
12
|
+
* @param payload
|
|
13
|
+
* @returns string
|
|
14
|
+
*/
|
|
15
|
+
function messageHeader(payload) {
|
|
16
|
+
const { from = 'Agency', to = 'SWS', conversationId = '2021.01.DevStudio', action, } = payload;
|
|
17
|
+
return `<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader"><From><PartyId>${from}</PartyId></From><To><PartyId>${to}</PartyId></To><ConversationId>${conversationId}</ConversationId><Action>${action}</Action></MessageHeader>`;
|
|
18
|
+
}
|
|
19
|
+
export { messageHeader };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RequestOptions } from "../interfaces/request-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* {{header({ action, authorization })}}
|
|
4
|
+
*
|
|
5
|
+
* {{body}}
|
|
6
|
+
*
|
|
7
|
+
* {{footer}}
|
|
8
|
+
* @param payload
|
|
9
|
+
* @returns string
|
|
10
|
+
*/
|
|
11
|
+
declare function request(payload: RequestOptions): string;
|
|
12
|
+
export { request };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { header } from "./header.helper";
|
|
2
|
+
import { soapEnv } from "./soap-env.helper";
|
|
3
|
+
/**
|
|
4
|
+
* {{header({ action, authorization })}}
|
|
5
|
+
*
|
|
6
|
+
* {{body}}
|
|
7
|
+
*
|
|
8
|
+
* {{footer}}
|
|
9
|
+
* @param payload
|
|
10
|
+
* @returns string
|
|
11
|
+
*/
|
|
12
|
+
function request(payload) {
|
|
13
|
+
const { action, conversationId, authorization, body } = payload;
|
|
14
|
+
return soapEnv({
|
|
15
|
+
header: header({ action, conversationId, authorization }),
|
|
16
|
+
body
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export { request };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
|
|
3
|
+
* {{authorization}}
|
|
4
|
+
* </Security>
|
|
5
|
+
* @param authorization
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
function security(authorization) {
|
|
9
|
+
return `<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">${authorization}</Security>`;
|
|
10
|
+
}
|
|
11
|
+
export { security };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SoapEnvOptions } from "../interfaces/soap-env-options.interface";
|
|
2
|
+
/**
|
|
3
|
+
* <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
|
|
4
|
+
* <SOAP-ENV:Header>
|
|
5
|
+
* {{header}}
|
|
6
|
+
* </SOAP-ENV:Header>
|
|
7
|
+
* <SOAP-ENV:Body>
|
|
8
|
+
* {{body}}
|
|
9
|
+
* </SOAP-ENV:Body>
|
|
10
|
+
* </SOAP-ENV:Envelope>
|
|
11
|
+
* @param payload
|
|
12
|
+
* @returns string
|
|
13
|
+
*/
|
|
14
|
+
declare function soapEnv(payload: SoapEnvOptions): string;
|
|
15
|
+
export { soapEnv };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
|
|
3
|
+
* <SOAP-ENV:Header>
|
|
4
|
+
* {{header}}
|
|
5
|
+
* </SOAP-ENV:Header>
|
|
6
|
+
* <SOAP-ENV:Body>
|
|
7
|
+
* {{body}}
|
|
8
|
+
* </SOAP-ENV:Body>
|
|
9
|
+
* </SOAP-ENV:Envelope>
|
|
10
|
+
* @param payload
|
|
11
|
+
* @returns string
|
|
12
|
+
*/
|
|
13
|
+
function soapEnv(payload) {
|
|
14
|
+
const { header, body } = payload;
|
|
15
|
+
return `<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header>${header}</SOAP-ENV:Header><SOAP-ENV:Body>${body}</SOAP-ENV:Body></SOAP-ENV:Envelope>`;
|
|
16
|
+
}
|
|
17
|
+
export { soapEnv };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum ActionsRQ {
|
|
2
|
+
SESSION_CREATE = "SessionCreateRQ",
|
|
3
|
+
SESSION_CLOSE = "SessionCloseRQ",
|
|
4
|
+
TOKEN_CREATE = "TokenCreateRQ",
|
|
5
|
+
QUEUE_COUNT = "QueueCountLLSRQ",
|
|
6
|
+
QUEUE_ACCESS = "QueueAccessLLSRQ",
|
|
7
|
+
QUEUE_PLACE = "QueuePlaceLLSRQ",
|
|
8
|
+
AGENCY_REPORT = "TKT_TravelAgencyReportsRQ",
|
|
9
|
+
DAILY_SALES_REPORT = "DailySalesReportLLSRQ",
|
|
10
|
+
PING = "OTA_PingRQ",
|
|
11
|
+
ENCODE_DECODE = "EncodeDecodeLLSRQ"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ActionsRS {
|
|
14
|
+
SESSION_CLOSE = "SessionCloseRS",
|
|
15
|
+
QUEUE_ACCESS = "QueueAccessLLSRS"
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export var ActionsRQ;
|
|
2
|
+
(function (ActionsRQ) {
|
|
3
|
+
ActionsRQ["SESSION_CREATE"] = "SessionCreateRQ";
|
|
4
|
+
ActionsRQ["SESSION_CLOSE"] = "SessionCloseRQ";
|
|
5
|
+
ActionsRQ["TOKEN_CREATE"] = "TokenCreateRQ";
|
|
6
|
+
ActionsRQ["QUEUE_COUNT"] = "QueueCountLLSRQ";
|
|
7
|
+
ActionsRQ["QUEUE_ACCESS"] = "QueueAccessLLSRQ";
|
|
8
|
+
ActionsRQ["QUEUE_PLACE"] = "QueuePlaceLLSRQ";
|
|
9
|
+
ActionsRQ["AGENCY_REPORT"] = "TKT_TravelAgencyReportsRQ";
|
|
10
|
+
ActionsRQ["DAILY_SALES_REPORT"] = "DailySalesReportLLSRQ";
|
|
11
|
+
ActionsRQ["PING"] = "OTA_PingRQ";
|
|
12
|
+
ActionsRQ["ENCODE_DECODE"] = "EncodeDecodeLLSRQ";
|
|
13
|
+
})(ActionsRQ || (ActionsRQ = {}));
|
|
14
|
+
export var ActionsRS;
|
|
15
|
+
(function (ActionsRS) {
|
|
16
|
+
ActionsRS["SESSION_CLOSE"] = "SessionCloseRS";
|
|
17
|
+
ActionsRS["QUEUE_ACCESS"] = "QueueAccessLLSRS";
|
|
18
|
+
})(ActionsRS || (ActionsRS = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|