@qite/tide-client 1.0.44 → 1.0.47

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.
@@ -1,13 +1,22 @@
1
1
  import { BookingPackageAllotmentInfo } from "./booking-package-allotment-info";
2
2
  export interface BookingPackageItem {
3
+ accommodationCode: string;
4
+ airportCode?: string;
5
+ allotment: BookingPackageAllotmentInfo;
6
+ averagePricePerPerson: number;
3
7
  catalogueId: number;
4
8
  code: string;
9
+ fromDate: string;
10
+ latitude: number;
11
+ longitude: number;
5
12
  name: string;
13
+ outwardFlightCode?: string;
14
+ outwardFlightNumbers?: string[];
6
15
  price: number;
7
- averagePricePerPerson: number;
8
- type: number;
9
- fromDate: string;
10
- toDate: string;
16
+ regimeCode?: string;
17
+ returnFlightCode?: string;
18
+ returnFlightNumbers?: string[];
11
19
  tagIds: number[];
12
- allotment: BookingPackageAllotmentInfo;
20
+ toDate: string;
21
+ type: number;
13
22
  }
@@ -1,10 +1,10 @@
1
- export interface BookingPackageHotelOption {
2
- entryLineGuid: string;
3
- accommodationCode: string;
4
- accommodationName: string;
5
- regimeCode: string;
6
- regimeName: string;
7
- price: number;
8
- isSelected: boolean;
9
- roomIndex: number;
10
- }
1
+ export interface BookingPackageHotelOption {
2
+ entryLineGuid: string;
3
+ accommodationCode: string;
4
+ accommodationName: string;
5
+ regimeCode: string;
6
+ regimeName: string;
7
+ price: number;
8
+ isSelected: boolean;
9
+ roomIndex: number;
10
+ }
@@ -1,18 +1,19 @@
1
- import { BookingPackageHotelRoom } from "./booking-package-hotel-room";
2
- export interface BookingPackageHotel {
3
- name: string;
4
- productCode: string;
5
- isSelected: boolean;
6
- cheapestPrice: number;
7
- latitude: number;
8
- longitude: number;
9
- rooms: BookingPackageHotelRoom[];
10
- combinations: string[][];
11
- stars: string;
12
- rating: string;
13
- description: string;
14
- imageUrl: string;
15
- facilities: string;
16
- travelDurationToVenue: string;
17
- travelDurationToCenter: string;
18
- }
1
+ import { BookingPackageHotelRoom } from "./booking-package-hotel-room";
2
+ export interface BookingPackageHotel {
3
+ name: string;
4
+ productCode: string;
5
+ isSelected: boolean;
6
+ cheapestPrice: number;
7
+ hotelSupplier: number;
8
+ latitude: number;
9
+ longitude: number;
10
+ rooms: BookingPackageHotelRoom[];
11
+ combinations: string[][];
12
+ stars: string;
13
+ rating: string;
14
+ description: string;
15
+ imageUrl: string;
16
+ facilities: string;
17
+ travelDurationToVenue: string;
18
+ travelDurationToCenter: string;
19
+ }
@@ -1,39 +1,39 @@
1
- import { BookingOptionGroup } from "./booking-option-group";
2
- import { BookingOptionPax } from "./booking-option-pax";
3
- import { BookingOptionUnit } from "./booking-option-unit";
4
- import { BookingPackageFlight } from "./booking-package-flight";
5
- import { BookingPackageHotel } from "./booking-package-hotel";
6
- import { BookingPackageRequestRoom } from "./booking-package-request-room";
7
- import { BookingPackageRoom } from "./booking-package-room";
8
- import { PerBookingPackageOption } from "./per-booking-package-option";
9
- export interface BookingPackage {
10
- catalogueId: number;
11
- code: string;
12
- name: string;
13
- price: number;
14
- serviceType: number;
15
- tagIds: number[];
16
- countryName: string;
17
- regionName: string;
18
- oordName: string;
19
- locationName: string;
20
- unitCount: number;
21
- requestRooms: BookingPackageRequestRoom[];
22
- fromDate: string;
23
- toDate: string;
24
- startTime: string;
25
- endTime: string;
26
- outwardFlights: BookingPackageFlight[];
27
- returnFlights: BookingPackageFlight[];
28
- hotels: BookingPackageHotel[];
29
- allotmentTourCode: string;
30
- allotmentName: string;
31
- customAllotmentStatus: string;
32
- allotmentTagIds: number[];
33
- rooms: BookingPackageRoom[];
34
- groups: BookingOptionGroup<PerBookingPackageOption>[];
35
- optionUnits: BookingOptionUnit[];
36
- optionPax: BookingOptionPax[];
37
- transactionId: string;
38
- transactionExpiration: string;
39
- }
1
+ import { BookingOptionGroup } from "./booking-option-group";
2
+ import { BookingOptionPax } from "./booking-option-pax";
3
+ import { BookingOptionUnit } from "./booking-option-unit";
4
+ import { BookingPackageFlight } from "./booking-package-flight";
5
+ import { BookingPackageHotel } from "./booking-package-hotel";
6
+ import { BookingPackageRequestRoom } from "./booking-package-request-room";
7
+ import { BookingPackageRoom } from "./booking-package-room";
8
+ import { PerBookingPackageOption } from "./per-booking-package-option";
9
+ export interface BookingPackage {
10
+ catalogueId: number;
11
+ code: string;
12
+ name: string;
13
+ price: number;
14
+ serviceType: number;
15
+ tagIds: number[];
16
+ countryName: string;
17
+ regionName: string;
18
+ oordName: string;
19
+ locationName: string;
20
+ unitCount: number;
21
+ requestRooms: BookingPackageRequestRoom[];
22
+ fromDate: string;
23
+ toDate: string;
24
+ startTime: string;
25
+ endTime: string;
26
+ outwardFlights: BookingPackageFlight[];
27
+ returnFlights: BookingPackageFlight[];
28
+ hotels: BookingPackageHotel[];
29
+ allotmentTourCode: string;
30
+ allotmentName: string;
31
+ customAllotmentStatus: string;
32
+ allotmentTagIds: number[];
33
+ rooms: BookingPackageRoom[];
34
+ groups: BookingOptionGroup<PerBookingPackageOption>[];
35
+ optionUnits: BookingOptionUnit[];
36
+ optionPax: BookingOptionPax[];
37
+ transactionId: string;
38
+ transactionExpiration: string;
39
+ }
@@ -1,14 +1,14 @@
1
- import { AdditionalServices, FlightMetaDataLine } from ".";
2
- export interface FlightMetaData {
3
- flightLines: FlightMetaDataLine[];
4
- pnr: string;
5
- orderId: string;
6
- additionalServices: AdditionalServices;
7
- isLowCost: boolean;
8
- luggageIncluded: boolean;
9
- validatingAirlines: string;
10
- bagageAllowed: boolean;
11
- bagage: string;
12
- mealIncluded: boolean;
13
- meal: string;
14
- }
1
+ import { AdditionalServices, FlightMetaDataLine } from ".";
2
+ export interface FlightMetaData {
3
+ flightLines: FlightMetaDataLine[];
4
+ pnr: string;
5
+ orderId: string;
6
+ additionalServices: AdditionalServices;
7
+ isLowCost: boolean;
8
+ luggageIncluded: boolean;
9
+ validatingAirlines: string;
10
+ bagageAllowed: boolean;
11
+ bagage: string;
12
+ mealIncluded: boolean;
13
+ meal: string;
14
+ }
@@ -4,3 +4,8 @@ export declare const post: (
4
4
  body: string,
5
5
  signal?: AbortSignal | undefined
6
6
  ) => Promise<Response>;
7
+ export declare const get: (
8
+ url: string,
9
+ apiKey: string,
10
+ signal?: AbortSignal | undefined
11
+ ) => Promise<Response>;
@@ -0,0 +1,14 @@
1
+ import { TideClientConfig } from "../types";
2
+ /**
3
+ * api/web/file/feed
4
+ * fetch a xml from blob feed.
5
+ * @param config
6
+ * @param request
7
+ * @param signal
8
+ * @returns OK if succeeded.
9
+ */
10
+ export declare const contactForm: (
11
+ config: TideClientConfig,
12
+ request: string,
13
+ signal?: AbortSignal | undefined
14
+ ) => Promise<Response>;
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
- {
2
- "name": "@qite/tide-client",
3
- "version": "1.0.44",
4
- "description": "Frontend client for Tide",
5
- "main": "build/index.js",
6
- "scripts": {
7
- "build": "rollup -c",
8
- "tsc": "tsc --noEmit",
9
- "format": "prettier --write .",
10
- "test": "jest"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "git+ssh://git@bitbucket.org/qitegeneral/tide-client.git"
15
- },
16
- "keywords": [
17
- "tide",
18
- "client"
19
- ],
20
- "author": "Kristof Colpaert <kristof.colpaert@qite.be>",
21
- "license": "OBSD",
22
- "homepage": "https://bitbucket.org/qitegeneral/tide-client#readme",
23
- "devDependencies": {
24
- "@rollup/plugin-commonjs": "^19.0.0",
25
- "@rollup/plugin-node-resolve": "^13.0.0",
26
- "@types/jest": "^26.0.23",
27
- "@types/moment": "^2.13.0",
28
- "dotenv": "^9.0.2",
29
- "jest": "^26.6.3",
30
- "jest-fetch-mock": "^3.0.3",
31
- "momentjs": "^2.0.0",
32
- "prettier": "^2.3.0",
33
- "rollup": "^2.48.0",
34
- "rollup-plugin-typescript2": "^0.30.0",
35
- "ts-jest": "^26.5.6",
36
- "tslib": "^2.2.0",
37
- "typescript": "^4.2.4"
38
- },
39
- "jest": {
40
- "moduleFileExtensions": [
41
- "ts",
42
- "js"
43
- ],
44
- "transform": {
45
- "^.+\\.ts$": "ts-jest"
46
- },
47
- "globals": {
48
- "ts-jest": {
49
- "tsconfig": "tsconfig.json"
50
- }
51
- },
52
- "testMatch": [
53
- "**/tests/**/*.test.ts"
54
- ]
55
- }
56
- }
1
+ {
2
+ "name": "@qite/tide-client",
3
+ "version": "1.0.47",
4
+ "description": "Frontend client for Tide",
5
+ "main": "build/index.js",
6
+ "scripts": {
7
+ "build": "rollup -c",
8
+ "tsc": "tsc --noEmit",
9
+ "format": "prettier --write .",
10
+ "test": "jest"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+ssh://git@bitbucket.org/qitegeneral/tide-client.git"
15
+ },
16
+ "keywords": [
17
+ "tide",
18
+ "client"
19
+ ],
20
+ "author": "Kristof Colpaert <kristof.colpaert@qite.be>",
21
+ "license": "OBSD",
22
+ "homepage": "https://bitbucket.org/qitegeneral/tide-client#readme",
23
+ "devDependencies": {
24
+ "@rollup/plugin-commonjs": "^19.0.0",
25
+ "@rollup/plugin-node-resolve": "^13.0.0",
26
+ "@types/jest": "^26.0.23",
27
+ "@types/moment": "^2.13.0",
28
+ "dotenv": "^9.0.2",
29
+ "jest": "^26.6.3",
30
+ "jest-fetch-mock": "^3.0.3",
31
+ "momentjs": "^2.0.0",
32
+ "prettier": "^2.3.0",
33
+ "rollup": "^2.48.0",
34
+ "rollup-plugin-typescript2": "^0.30.0",
35
+ "ts-jest": "^26.5.6",
36
+ "tslib": "^2.2.0",
37
+ "typescript": "^4.2.4"
38
+ },
39
+ "jest": {
40
+ "moduleFileExtensions": [
41
+ "ts",
42
+ "js"
43
+ ],
44
+ "transform": {
45
+ "^.+\\.ts$": "ts-jest"
46
+ },
47
+ "globals": {
48
+ "ts-jest": {
49
+ "tsconfig": "tsconfig.json"
50
+ }
51
+ },
52
+ "testMatch": [
53
+ "**/tests/**/*.test.ts"
54
+ ]
55
+ }
56
+ }
@@ -1,15 +1,23 @@
1
1
  import { BookingPackageAllotmentInfo } from "./booking-package-allotment-info";
2
2
 
3
3
  export interface BookingPackageItem {
4
+ accommodationCode: string;
5
+ airportCode?: string;
6
+ allotment: BookingPackageAllotmentInfo;
7
+ averagePricePerPerson: number;
4
8
  catalogueId: number;
5
9
  code: string;
10
+ fromDate: string;
11
+ latitude: number;
12
+ longitude: number;
6
13
  name: string;
14
+ outwardFlightCode?: string;
15
+ outwardFlightNumbers?: string[];
7
16
  price: number;
8
- averagePricePerPerson: number;
9
- type: number;
10
- fromDate: string;
11
- toDate: string;
17
+ regimeCode?: string;
18
+ returnFlightCode?: string;
19
+ returnFlightNumbers?: string[];
12
20
  tagIds: number[];
13
-
14
- allotment: BookingPackageAllotmentInfo;
21
+ toDate: string;
22
+ type: number;
15
23
  }
@@ -1,10 +1,10 @@
1
- export interface BookingPackageHotelOption {
2
- entryLineGuid: string;
3
- accommodationCode: string;
4
- accommodationName: string;
5
- regimeCode: string;
6
- regimeName: string;
7
- price: number;
8
- isSelected: boolean;
9
- roomIndex: number;
10
- }
1
+ export interface BookingPackageHotelOption {
2
+ entryLineGuid: string;
3
+ accommodationCode: string;
4
+ accommodationName: string;
5
+ regimeCode: string;
6
+ regimeName: string;
7
+ price: number;
8
+ isSelected: boolean;
9
+ roomIndex: number;
10
+ }
@@ -1,23 +1,24 @@
1
- import { BookingPackageHotelRoom } from "./booking-package-hotel-room";
2
-
3
- export interface BookingPackageHotel {
4
- name: string;
5
- productCode: string;
6
- isSelected: boolean;
7
- cheapestPrice: number;
8
-
9
- latitude: number;
10
- longitude: number;
11
-
12
- rooms: BookingPackageHotelRoom[];
13
- combinations: string[][];
14
-
15
- stars: string;
16
- rating: string;
17
- description: string;
18
- imageUrl: string;
19
- facilities: string;
20
-
21
- travelDurationToVenue: string;
22
- travelDurationToCenter: string;
23
- }
1
+ import { BookingPackageHotelRoom } from "./booking-package-hotel-room";
2
+
3
+ export interface BookingPackageHotel {
4
+ name: string;
5
+ productCode: string;
6
+ isSelected: boolean;
7
+ cheapestPrice: number;
8
+ hotelSupplier: number;
9
+
10
+ latitude: number;
11
+ longitude: number;
12
+
13
+ rooms: BookingPackageHotelRoom[];
14
+ combinations: string[][];
15
+
16
+ stars: string;
17
+ rating: string;
18
+ description: string;
19
+ imageUrl: string;
20
+ facilities: string;
21
+
22
+ travelDurationToVenue: string;
23
+ travelDurationToCenter: string;
24
+ }
@@ -1,47 +1,47 @@
1
- import { BookingOptionGroup } from "./booking-option-group";
2
- import { BookingOptionPax } from "./booking-option-pax";
3
- import { BookingOptionUnit } from "./booking-option-unit";
4
- import { BookingPackageFlight } from "./booking-package-flight";
5
- import { BookingPackageHotel } from "./booking-package-hotel";
6
- import { BookingPackageRequestRoom } from "./booking-package-request-room";
7
- import { BookingPackageRoom } from "./booking-package-room";
8
- import { PerBookingPackageOption } from "./per-booking-package-option";
9
-
10
- export interface BookingPackage {
11
- catalogueId: number;
12
- code: string;
13
- name: string;
14
- price: number;
15
- serviceType: number;
16
- tagIds: number[];
17
-
18
- countryName: string;
19
- regionName: string;
20
- oordName: string;
21
- locationName: string;
22
-
23
- unitCount: number;
24
- requestRooms: BookingPackageRequestRoom[];
25
-
26
- fromDate: string;
27
- toDate: string;
28
- startTime: string;
29
- endTime: string;
30
-
31
- outwardFlights: BookingPackageFlight[];
32
- returnFlights: BookingPackageFlight[];
33
- hotels: BookingPackageHotel[];
34
-
35
- allotmentTourCode: string;
36
- allotmentName: string;
37
- customAllotmentStatus: string;
38
- allotmentTagIds: number[];
39
-
40
- rooms: BookingPackageRoom[];
41
- groups: BookingOptionGroup<PerBookingPackageOption>[];
42
- optionUnits: BookingOptionUnit[];
43
- optionPax: BookingOptionPax[];
44
-
45
- transactionId: string;
46
- transactionExpiration: string;
47
- }
1
+ import { BookingOptionGroup } from "./booking-option-group";
2
+ import { BookingOptionPax } from "./booking-option-pax";
3
+ import { BookingOptionUnit } from "./booking-option-unit";
4
+ import { BookingPackageFlight } from "./booking-package-flight";
5
+ import { BookingPackageHotel } from "./booking-package-hotel";
6
+ import { BookingPackageRequestRoom } from "./booking-package-request-room";
7
+ import { BookingPackageRoom } from "./booking-package-room";
8
+ import { PerBookingPackageOption } from "./per-booking-package-option";
9
+
10
+ export interface BookingPackage {
11
+ catalogueId: number;
12
+ code: string;
13
+ name: string;
14
+ price: number;
15
+ serviceType: number;
16
+ tagIds: number[];
17
+
18
+ countryName: string;
19
+ regionName: string;
20
+ oordName: string;
21
+ locationName: string;
22
+
23
+ unitCount: number;
24
+ requestRooms: BookingPackageRequestRoom[];
25
+
26
+ fromDate: string;
27
+ toDate: string;
28
+ startTime: string;
29
+ endTime: string;
30
+
31
+ outwardFlights: BookingPackageFlight[];
32
+ returnFlights: BookingPackageFlight[];
33
+ hotels: BookingPackageHotel[];
34
+
35
+ allotmentTourCode: string;
36
+ allotmentName: string;
37
+ customAllotmentStatus: string;
38
+ allotmentTagIds: number[];
39
+
40
+ rooms: BookingPackageRoom[];
41
+ groups: BookingOptionGroup<PerBookingPackageOption>[];
42
+ optionUnits: BookingOptionUnit[];
43
+ optionPax: BookingOptionPax[];
44
+
45
+ transactionId: string;
46
+ transactionExpiration: string;
47
+ }
@@ -1,15 +1,15 @@
1
- import { AdditionalServices, FlightMetaDataLine } from ".";
2
-
3
- export interface FlightMetaData {
4
- flightLines: FlightMetaDataLine[];
5
- pnr: string;
6
- orderId: string;
7
- additionalServices: AdditionalServices;
8
- isLowCost: boolean;
9
- luggageIncluded: boolean;
10
- validatingAirlines: string;
11
- bagageAllowed: boolean;
12
- bagage: string;
13
- mealIncluded: boolean;
14
- meal: string;
15
- }
1
+ import { AdditionalServices, FlightMetaDataLine } from ".";
2
+
3
+ export interface FlightMetaData {
4
+ flightLines: FlightMetaDataLine[];
5
+ pnr: string;
6
+ orderId: string;
7
+ additionalServices: AdditionalServices;
8
+ isLowCost: boolean;
9
+ luggageIncluded: boolean;
10
+ validatingAirlines: string;
11
+ bagageAllowed: boolean;
12
+ bagage: string;
13
+ mealIncluded: boolean;
14
+ meal: string;
15
+ }
package/src/utils/api.ts CHANGED
@@ -20,3 +20,23 @@ export const post = async (
20
20
 
21
21
  return response;
22
22
  };
23
+
24
+ export const get = async (
25
+ url: string,
26
+ apiKey: string,
27
+ signal?: AbortSignal
28
+ ): Promise<Response> => {
29
+ const response = await fetch(url, {
30
+ method: "GET",
31
+ headers: {
32
+ "Api-Key": apiKey,
33
+ },
34
+ signal,
35
+ });
36
+
37
+ if (!response.ok) {
38
+ throw new Error(response.statusText);
39
+ }
40
+
41
+ return response;
42
+ };
@@ -0,0 +1,24 @@
1
+ import { TideClientConfig } from "../types";
2
+ import { get } from "./api";
3
+
4
+ const ENDPOINT = "/api/web/file";
5
+ const ENDPOINT_FEED = `${ENDPOINT}/feed`;
6
+
7
+ /**
8
+ * api/web/file/feed
9
+ * fetch a xml from blob feed.
10
+ * @param config
11
+ * @param request
12
+ * @param signal
13
+ * @returns OK if succeeded.
14
+ */
15
+ export const contactForm = (
16
+ config: TideClientConfig,
17
+ request: string,
18
+ signal?: AbortSignal
19
+ ): Promise<Response> => {
20
+ const url = `${config.host}${ENDPOINT_FEED}/${request}`;
21
+ const apiKey = config.apiKey;
22
+
23
+ return get(url, apiKey, signal);
24
+ };