@qite/tide-client 1.1.15 → 1.1.17

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.
@@ -67,6 +67,7 @@ export declare const agents: (
67
67
  export declare const getAllotmentAvailability: (
68
68
  config: TideClientConfig,
69
69
  eventId: string,
70
+ productCode: string,
70
71
  signal?: AbortSignal | undefined
71
72
  ) => Promise<BookingPackageAvailability[]>;
72
73
  export declare const searchFlightPool: (
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@qite/tide-client",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "Frontend client for Tide",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
7
7
  "build": "rollup -c",
8
8
  "tsc": "tsc --noEmit",
9
9
  "format": "prettier --write .",
10
- "test": "jest"
10
+ "test": "jest",
11
+ "copy": "cpx \"**/*.*\" \"../travelworld.gatsby/node_modules/@qite/tide-client\""
11
12
  },
12
13
  "repository": {
13
14
  "type": "git",
@@ -52,5 +53,8 @@
52
53
  "testMatch": [
53
54
  "**/tests/**/*.test.ts"
54
55
  ]
56
+ },
57
+ "dependencies": {
58
+ "cpx": "^1.5.0"
55
59
  }
56
60
  }
package/src/utils/api.ts CHANGED
@@ -30,6 +30,7 @@ export const get = async (
30
30
  const response = await fetch(url, {
31
31
  method: "GET",
32
32
  headers: {
33
+ "Content-Type": "application/json",
33
34
  "Api-Key": apiKey,
34
35
  },
35
36
  credentials: "include",
@@ -145,9 +145,10 @@ export const agents = (
145
145
  export const getAllotmentAvailability = (
146
146
  config: TideClientConfig,
147
147
  eventId: string,
148
+ productCode: string,
148
149
  signal?: AbortSignal
149
150
  ): Promise<BookingPackageAvailability[]> => {
150
- const url = `${config.host}${ENDPOINT_AVAILABLE_ALLOTMENTS}/${eventId}`;
151
+ const url = `${config.host}${ENDPOINT_AVAILABLE_ALLOTMENTS}/${eventId}/${productCode}`;
151
152
  const apiKey = config.apiKey;
152
153
 
153
154
  return get(url, apiKey, signal, true);
@@ -4,7 +4,8 @@ import {
4
4
  PrintActionGroup,
5
5
  TideClientConfig,
6
6
  } from "../types";
7
- import { get, post } from "./common-client";
7
+ import { get } from "./common-client";
8
+ import { post } from "./api";
8
9
 
9
10
  const ENDPOINT = "/api/web/agent";
10
11
  const ENDPOINT_GET_PRINT_ACTIONS = `${ENDPOINT}/print-action`;
@@ -44,5 +45,5 @@ export const print = (
44
45
  const apiKey = config.apiKey;
45
46
  const body = JSON.stringify(request);
46
47
 
47
- return post(url, apiKey, body, signal, true);
48
+ return post(url, apiKey, body, signal);
48
49
  };