@qite/tide-client 1.1.30 → 1.1.32

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.
Files changed (59) hide show
  1. package/build/index.js +94 -58
  2. package/build/index.js.map +1 -1
  3. package/build/types/company/agent/agent-invoice-item.d.ts +9 -0
  4. package/build/types/company/agent/entry-totals.d.ts +7 -0
  5. package/build/types/company/agent/index.d.ts +2 -0
  6. package/build/types/company/index.d.ts +1 -0
  7. package/build/types/enums/data-type.d.ts +1 -0
  8. package/build/types/offer/booking-v2/request/booking-package-book-request.d.ts +4 -0
  9. package/build/types/offer/booking-v2/request/booking-package-customer-request.d.ts +4 -0
  10. package/build/types/offer/booking-v2/request/index.d.ts +2 -1
  11. package/build/types/offer/booking-v2/response/booking-price-details.d.ts +4 -0
  12. package/build/types/offer/booking-v2/response/booking-room-status-option.d.ts +5 -0
  13. package/build/types/offer/booking-v2/response/booking-room-status.d.ts +5 -0
  14. package/build/types/offer/booking-v2/response/booking-validity-line.d.ts +4 -0
  15. package/build/types/offer/booking-v2/response/index.d.ts +1 -0
  16. package/build/types/offer/booking-v2/shared/airline-booking-package-option.d.ts +2 -0
  17. package/build/types/offer/booking-v2/shared/airport-booking-package-option.d.ts +2 -0
  18. package/build/types/offer/booking-v2/shared/booking-airline-group.d.ts +6 -0
  19. package/build/types/offer/booking-v2/shared/booking-airport-group.d.ts +6 -0
  20. package/build/types/offer/booking-v2/shared/booking-option-pax.d.ts +6 -0
  21. package/build/types/offer/booking-v2/shared/booking-option-unit.d.ts +6 -0
  22. package/build/types/offer/booking-v2/shared/booking-package-availability.d.ts +1 -0
  23. package/build/types/offer/booking-v2/shared/booking-package-option.d.ts +7 -0
  24. package/build/types/offer/booking-v2/shared/index.d.ts +8 -4
  25. package/build/types/tide-client-config.d.ts +1 -0
  26. package/build/utils/api.d.ts +4 -4
  27. package/build/utils/common-client.d.ts +3 -2
  28. package/build/utils/web-agent-client.d.ts +13 -3
  29. package/package.json +6 -2
  30. package/src/services/odata.service.ts +14 -3
  31. package/src/types/company/agent/agent-invoice-item.ts +9 -0
  32. package/src/types/company/agent/entry-totals.ts +7 -0
  33. package/src/types/company/agent/index.ts +2 -0
  34. package/src/types/company/index.ts +1 -0
  35. package/src/types/enums/data-type.ts +1 -0
  36. package/src/types/offer/booking-v2/request/booking-package-book-request.ts +4 -0
  37. package/src/types/offer/booking-v2/request/booking-package-customer-request.ts +4 -0
  38. package/src/types/offer/booking-v2/request/index.ts +2 -1
  39. package/src/types/offer/booking-v2/shared/airline-booking-package-option.ts +3 -0
  40. package/src/types/offer/booking-v2/shared/airport-booking-package-option.ts +3 -0
  41. package/src/types/offer/booking-v2/shared/booking-airline-group.ts +7 -0
  42. package/src/types/offer/booking-v2/shared/booking-airport-group.ts +7 -0
  43. package/src/types/offer/booking-v2/shared/booking-option-pax.ts +6 -0
  44. package/src/types/offer/booking-v2/shared/booking-option-unit.ts +6 -0
  45. package/src/types/offer/booking-v2/shared/booking-package-availability.ts +1 -0
  46. package/src/types/offer/booking-v2/shared/booking-package-option.ts +7 -0
  47. package/src/types/offer/booking-v2/shared/index.ts +8 -4
  48. package/src/types/tide-client-config.ts +1 -0
  49. package/src/utils/api.ts +6 -6
  50. package/src/utils/booking-client.ts +13 -13
  51. package/src/utils/booking-v2-client.ts +14 -14
  52. package/src/utils/common-client.ts +12 -4
  53. package/src/utils/member-client.ts +5 -5
  54. package/src/utils/mollie-client.ts +1 -1
  55. package/src/utils/search-client.ts +1 -1
  56. package/src/utils/web-agent-client.ts +47 -11
  57. package/src/utils/web-client.ts +2 -2
  58. package/src/utils/web-contact-client.ts +2 -2
  59. package/src/utils/web-file.ts +1 -1
@@ -45,7 +45,7 @@ export const getAvailableProducts = (
45
45
  const apiKey = config.apiKey;
46
46
  const body = JSON.stringify(request);
47
47
 
48
- return post(url, apiKey, body, signal);
48
+ return post(url, apiKey, body, config.token, signal);
49
49
  };
50
50
 
51
51
  /**
@@ -64,7 +64,7 @@ export const searchPackages = (
64
64
  const apiKey = config.apiKey;
65
65
  const body = JSON.stringify(request);
66
66
 
67
- return post(url, apiKey, body, signal);
67
+ return post(url, apiKey, body, config.token, signal);
68
68
  };
69
69
 
70
70
  /**
@@ -83,7 +83,7 @@ export const getPackagePriceDetails = (
83
83
  const apiKey = config.apiKey;
84
84
  const body = JSON.stringify(request);
85
85
 
86
- return post(url, apiKey, body, signal);
86
+ return post(url, apiKey, body, config.token, signal);
87
87
  };
88
88
 
89
89
  /**
@@ -106,7 +106,7 @@ export const createOffer = (
106
106
  const apiKey = config.apiKey;
107
107
  const body = JSON.stringify(request);
108
108
 
109
- return post(url, apiKey, body, signal);
109
+ return post(url, apiKey, body, config.token, signal);
110
110
  };
111
111
 
112
112
  /**
@@ -129,7 +129,7 @@ export const createOfferWithShortResponse = (
129
129
  const apiKey = config.apiKey;
130
130
  const body = JSON.stringify(request, replacer);
131
131
 
132
- return post(url, apiKey, body, signal);
132
+ return post(url, apiKey, body, config.token, signal);
133
133
  };
134
134
 
135
135
  /**
@@ -152,7 +152,7 @@ export const createEntry = (
152
152
  const apiKey = config.apiKey;
153
153
  const body = JSON.stringify(request, replacer);
154
154
 
155
- return post(url, apiKey, body, signal);
155
+ return post(url, apiKey, body, config.token, signal);
156
156
  };
157
157
 
158
158
  /**
@@ -175,7 +175,7 @@ export const createEntryWithShortResponse = (
175
175
  const apiKey = config.apiKey;
176
176
  const body = JSON.stringify(request, replacer);
177
177
 
178
- return post(url, apiKey, body, signal);
178
+ return post(url, apiKey, body, config.token, signal);
179
179
  };
180
180
 
181
181
  /**
@@ -198,7 +198,7 @@ export const createPackageOffer = (
198
198
  const apiKey = config.apiKey;
199
199
  const body = JSON.stringify(request, replacer);
200
200
 
201
- return post(url, apiKey, body, signal);
201
+ return post(url, apiKey, body, config.token, signal);
202
202
  };
203
203
 
204
204
  /**
@@ -221,7 +221,7 @@ export const createPackageOfferWithShortResponse = (
221
221
  const apiKey = config.apiKey;
222
222
  const body = JSON.stringify(request, replacer);
223
223
 
224
- return post(url, apiKey, body, signal);
224
+ return post(url, apiKey, body, config.token, signal);
225
225
  };
226
226
 
227
227
  /**
@@ -244,7 +244,7 @@ export const createPackageEntry = (
244
244
  const apiKey = config.apiKey;
245
245
  const body = JSON.stringify(request, replacer);
246
246
 
247
- return post(url, apiKey, body, signal);
247
+ return post(url, apiKey, body, config.token, signal);
248
248
  };
249
249
 
250
250
  /**
@@ -267,7 +267,7 @@ export const createPackageEntryWithShortResponse = (
267
267
  const apiKey = config.apiKey;
268
268
  const body = JSON.stringify(request, replacer);
269
269
 
270
- return post(url, apiKey, body, signal);
270
+ return post(url, apiKey, body, config.token, signal);
271
271
  };
272
272
 
273
273
  /**
@@ -287,7 +287,7 @@ export const getBasePrices = (
287
287
  const apiKey = config.apiKey;
288
288
  const body = JSON.stringify(request, replacer);
289
289
 
290
- return post(url, apiKey, body, signal);
290
+ return post(url, apiKey, body, config.token, signal);
291
291
  };
292
292
 
293
293
  /**
@@ -306,5 +306,5 @@ export const getBasePricesFromDate = (
306
306
  const apiKey = config.apiKey;
307
307
  const body = JSON.stringify(request, replacer);
308
308
 
309
- return post(url, apiKey, body, signal);
309
+ return post(url, apiKey, body, config.token, signal);
310
310
  };
@@ -51,7 +51,7 @@ export const readPackageSearchList = (
51
51
  const apiKey = config.apiKey;
52
52
  const body = JSON.stringify(request);
53
53
 
54
- return post(url, apiKey, body, signal);
54
+ return post(url, apiKey, body, config.token, signal);
55
55
  };
56
56
 
57
57
  // PACKAGE SEARCH
@@ -64,7 +64,7 @@ export const search = (
64
64
  const apiKey = config.apiKey;
65
65
  const body = JSON.stringify(request);
66
66
 
67
- return post(url, apiKey, body, signal, true);
67
+ return post(url, apiKey, body, config.token, signal, true);
68
68
  };
69
69
 
70
70
  export const details = (
@@ -77,7 +77,7 @@ export const details = (
77
77
  const apiKey = config.apiKey;
78
78
  const body = JSON.stringify(request);
79
79
 
80
- return post(url, apiKey, body, signal, true, languageCode);
80
+ return post(url, apiKey, body, config.token, signal, true, languageCode);
81
81
  };
82
82
 
83
83
  export const validateVoucher = (
@@ -89,7 +89,7 @@ export const validateVoucher = (
89
89
  const apiKey = config.apiKey;
90
90
  const body = JSON.stringify(request);
91
91
 
92
- return post(url, apiKey, body, signal, true);
92
+ return post(url, apiKey, body, config.token, signal, true);
93
93
  };
94
94
 
95
95
  export const alternateHotels = (
@@ -100,7 +100,7 @@ export const alternateHotels = (
100
100
  const url = `${config.host}${ENDPOINT_DETAILS}/${transactionId}${ENDPOINT_ALTERNATE_HOTELS}`;
101
101
  const apiKey = config.apiKey;
102
102
 
103
- return get(url, apiKey, signal, true);
103
+ return get(url, apiKey, config.token, signal, true);
104
104
  };
105
105
 
106
106
  export const alternateFlights = (
@@ -111,7 +111,7 @@ export const alternateFlights = (
111
111
  const url = `${config.host}${ENDPOINT_DETAILS}/${transactionId}${ENDPOINT_ALTERNATE_FLIGHTS}`;
112
112
  const apiKey = config.apiKey;
113
113
 
114
- return get(url, apiKey, signal, true);
114
+ return get(url, apiKey, config.token, signal, true);
115
115
  };
116
116
 
117
117
  export const priceDetails = (
@@ -124,7 +124,7 @@ export const priceDetails = (
124
124
  const apiKey = config.apiKey;
125
125
  const body = JSON.stringify(request);
126
126
 
127
- return post(url, apiKey, body, signal, true, languageCode);
127
+ return post(url, apiKey, body, config.token, signal, true, languageCode);
128
128
  };
129
129
 
130
130
  export const book = (
@@ -137,7 +137,7 @@ export const book = (
137
137
  const apiKey = config.apiKey;
138
138
  const body = JSON.stringify(request);
139
139
 
140
- return post(url, apiKey, body, signal, true, languageCode);
140
+ return post(url, apiKey, body, config.token, signal, true, languageCode);
141
141
  };
142
142
 
143
143
  export const update = (
@@ -149,7 +149,7 @@ export const update = (
149
149
  const apiKey = config.apiKey;
150
150
  const body = JSON.stringify(request);
151
151
 
152
- return post(url, apiKey, body, signal, true);
152
+ return post(url, apiKey, body, config.token, signal, true);
153
153
  };
154
154
 
155
155
  export const agents = (
@@ -159,7 +159,7 @@ export const agents = (
159
159
  const url = `${config.host}${ENDPOINT_AGENTS}`;
160
160
  const apiKey = config.apiKey;
161
161
 
162
- return get(url, apiKey, signal, true);
162
+ return get(url, apiKey, config.token, signal, true);
163
163
  };
164
164
 
165
165
  export const getAllotmentAvailability = (
@@ -171,7 +171,7 @@ export const getAllotmentAvailability = (
171
171
  const url = `${config.host}${ENDPOINT_AVAILABLE_ALLOTMENTS}/${eventId}/${productCode}`;
172
172
  const apiKey = config.apiKey;
173
173
 
174
- return get(url, apiKey, signal, true);
174
+ return get(url, apiKey, config.token, signal, true);
175
175
  };
176
176
 
177
177
  export const searchFlightPool = (
@@ -183,7 +183,7 @@ export const searchFlightPool = (
183
183
  const apiKey = config.apiKey;
184
184
  const body = JSON.stringify(request);
185
185
 
186
- return post(url, apiKey, body, signal, true);
186
+ return post(url, apiKey, body, config.token, signal, true);
187
187
  };
188
188
 
189
189
  export const bookableDates = (
@@ -195,7 +195,7 @@ export const bookableDates = (
195
195
  const apiKey = config.apiKey;
196
196
  const body = JSON.stringify(request);
197
197
 
198
- return post(url, apiKey, body, signal, true);
198
+ return post(url, apiKey, body, config.token, signal, true);
199
199
  };
200
200
 
201
201
  export const tourCodes = (
@@ -207,5 +207,5 @@ export const tourCodes = (
207
207
  const apiKey = config.apiKey;
208
208
  const body = JSON.stringify(request);
209
209
 
210
- return post(url, apiKey, body, signal, true);
210
+ return post(url, apiKey, body, config.token, signal, true);
211
211
  };
@@ -5,11 +5,19 @@ export const post = async <T>(
5
5
  url: string,
6
6
  apiKey: string,
7
7
  body: string,
8
+ token?: string,
8
9
  signal?: AbortSignal,
9
10
  skipReviver?: boolean,
10
11
  languageCode?: string
11
12
  ): Promise<T> => {
12
- const response = await apiPost(url, apiKey, body, signal, languageCode);
13
+ const response = await apiPost(
14
+ url,
15
+ apiKey,
16
+ body,
17
+ token,
18
+ signal,
19
+ languageCode
20
+ );
13
21
  const responseBody = await response.text();
14
22
 
15
23
  const result: T = skipReviver
@@ -21,11 +29,11 @@ export const post = async <T>(
21
29
  export const get = async <T>(
22
30
  url: string,
23
31
  apiKey: string,
32
+ token?: string,
24
33
  signal?: AbortSignal,
25
- skipReviver?: boolean,
26
- token?: string
34
+ skipReviver?: boolean
27
35
  ): Promise<T> => {
28
- const response = await apiGet(url, apiKey, signal, token);
36
+ const response = await apiGet(url, apiKey, token, signal);
29
37
  const responseBody = await response.text();
30
38
 
31
39
  const result: T = skipReviver
@@ -25,7 +25,7 @@ export const login = (
25
25
  const apiKey = config.apiKey;
26
26
  const body = JSON.stringify(request);
27
27
 
28
- return post(url, apiKey, body, signal);
28
+ return post(url, apiKey, body, config.token, signal);
29
29
  };
30
30
 
31
31
  export const logout = (
@@ -36,7 +36,7 @@ export const logout = (
36
36
  const apiKey = config.apiKey;
37
37
  const body = "";
38
38
 
39
- return apiPost(url, apiKey, body, signal);
39
+ return apiPost(url, apiKey, body, config.token, signal);
40
40
  };
41
41
 
42
42
  export const confirm = (
@@ -48,7 +48,7 @@ export const confirm = (
48
48
  const apiKey = config.apiKey;
49
49
  const body = JSON.stringify(request);
50
50
 
51
- return apiPost(url, apiKey, body, signal);
51
+ return apiPost(url, apiKey, body, config.token, signal);
52
52
  };
53
53
 
54
54
  export const forgotPassword = (
@@ -60,7 +60,7 @@ export const forgotPassword = (
60
60
  const apiKey = config.apiKey;
61
61
  const body = JSON.stringify(request);
62
62
 
63
- return apiPost(url, apiKey, body, signal);
63
+ return apiPost(url, apiKey, body, config.token, signal);
64
64
  };
65
65
 
66
66
  export const resetPassword = (
@@ -72,5 +72,5 @@ export const resetPassword = (
72
72
  const apiKey = config.apiKey;
73
73
  const body = JSON.stringify(request);
74
74
 
75
- return apiPost(url, apiKey, body, signal);
75
+ return apiPost(url, apiKey, body, config.token, signal);
76
76
  };
@@ -23,5 +23,5 @@ export const getMolliePayment = (
23
23
  const apiKey = config.apiKey;
24
24
  const body = JSON.stringify(request);
25
25
 
26
- return post(url, apiKey, body, signal);
26
+ return post(url, apiKey, body, config.token, signal);
27
27
  };
@@ -18,5 +18,5 @@ export const getCountries = (
18
18
  const url = `${config.host}${ENDPOINT_COUNTRIES}`;
19
19
  const apiKey = config.apiKey;
20
20
 
21
- return get(url, apiKey, signal, true);
21
+ return get(url, apiKey, config.token, signal, true);
22
22
  };
@@ -1,17 +1,19 @@
1
+ import { createParams } from "../services/odata.service";
1
2
  import {
3
+ AgentInvoiceItem,
2
4
  AgentPrintAction,
3
5
  AgentPrintActionRequest,
4
6
  CustomEntryStatusItem,
5
7
  DossierViewResult,
8
+ EntryTotals,
6
9
  FilterItem,
7
10
  NumberStringPair,
8
11
  PageResult,
9
12
  PrintActionGroup,
10
13
  TideClientConfig,
11
14
  } from "../types";
12
- import { get } from "./common-client";
13
15
  import { post } from "./api";
14
- import { createParams } from "../services/odata.service";
16
+ import { get } from "./common-client";
15
17
 
16
18
  const ENDPOINT = "/api/web/agent";
17
19
  const ENDPOINT_GET_PRINT_ACTIONS = `${ENDPOINT}/print-action`;
@@ -34,7 +36,7 @@ export const getPrintActions = (
34
36
  const url = `${config.host}${ENDPOINT_GET_PRINT_ACTIONS}/${printActionGroup}`;
35
37
  const apiKey = config.apiKey;
36
38
 
37
- return get<AgentPrintAction[]>(url, apiKey, signal, true);
39
+ return get<AgentPrintAction[]>(url, apiKey, config.token, signal, true);
38
40
  };
39
41
 
40
42
  /**
@@ -47,27 +49,61 @@ export const getPrintActions = (
47
49
  export const print = (
48
50
  config: TideClientConfig,
49
51
  request: AgentPrintActionRequest,
50
- signal?: AbortSignal,
51
- token?: string
52
+ signal?: AbortSignal
52
53
  ): Promise<Response> => {
53
54
  const url = `${config.host}${ENDPOINT_PRINT}`;
54
55
  const apiKey = config.apiKey;
55
56
  const body = JSON.stringify(request);
56
57
 
57
- return post(url, apiKey, body, signal, undefined, token);
58
+ return post(url, apiKey, body, config.token, signal, undefined);
58
59
  };
59
60
 
60
61
  export const getEntryList = (
61
62
  config: TideClientConfig,
62
63
  filterItem: FilterItem,
63
- token?: string,
64
64
  signal?: AbortSignal
65
65
  ): Promise<PageResult<DossierViewResult>> => {
66
66
  const params = createParams(filterItem, false);
67
- const url = `${config.host}${ENDPOINT}/entry-list?${params}`;
67
+ const url = `${config.host}${ENDPOINT}/entry/list?${params}`;
68
+ const apiKey = config.apiKey;
69
+
70
+ return get<PageResult<DossierViewResult>>(
71
+ url,
72
+ apiKey,
73
+ config.token,
74
+ signal,
75
+ true
76
+ );
77
+ };
78
+
79
+ export const getEntryTotals = (
80
+ config: TideClientConfig,
81
+ filterItem: FilterItem,
82
+ signal?: AbortSignal
83
+ ): Promise<EntryTotals> => {
84
+ const params = createParams(filterItem, false);
85
+ const url = `${config.host}${ENDPOINT}/entry/total?${params}`;
86
+ const apiKey = config.apiKey;
87
+
88
+ return get<EntryTotals>(url, apiKey, config.token, signal, true);
89
+ };
90
+
91
+ export const getInvoiceList = (
92
+ config: TideClientConfig,
93
+ filterItem: FilterItem,
94
+ signal?: AbortSignal
95
+ ): Promise<PageResult<AgentInvoiceItem>> => {
96
+ const params = createParams(filterItem, false);
97
+ const url = `${config.host}${ENDPOINT}/invoice/list?${params}`;
68
98
  const apiKey = config.apiKey;
69
99
 
70
- return get<PageResult<DossierViewResult>>(url, apiKey, signal, true, token);
100
+ return get<PageResult<AgentInvoiceItem>>(
101
+ url,
102
+ apiKey,
103
+ config.token,
104
+ signal,
105
+ true
106
+ );
71
107
  };
72
108
 
73
109
  export const getCustomEntryStatus = (
@@ -77,7 +113,7 @@ export const getCustomEntryStatus = (
77
113
  const url = `${config.host}${ENDPOINT_CUSTOM_ENTRY_STATUS}`;
78
114
  const apiKey = config.apiKey;
79
115
 
80
- return get<CustomEntryStatusItem[]>(url, apiKey, signal, true);
116
+ return get<CustomEntryStatusItem[]>(url, apiKey, config.token, signal, true);
81
117
  };
82
118
 
83
119
  export const getEntryStatus = (
@@ -87,5 +123,5 @@ export const getEntryStatus = (
87
123
  const url = `${config.host}${ENDPOINT_ENUM_ENTRY_STATUS}`;
88
124
  const apiKey = config.apiKey;
89
125
 
90
- return get<NumberStringPair[]>(url, apiKey, signal, true);
126
+ return get<NumberStringPair[]>(url, apiKey, config.token, signal, true);
91
127
  };
@@ -25,7 +25,7 @@ export const createCrmContact = (
25
25
  const apiKey = config.apiKey;
26
26
  const body = JSON.stringify(request);
27
27
 
28
- return post(url, apiKey, body, signal);
28
+ return post(url, apiKey, body, config.token, signal);
29
29
  };
30
30
 
31
31
  /**
@@ -42,5 +42,5 @@ export const getAffiliates = (
42
42
  const url = `${config.host}${ENDPOINT_CREATE_AFFILIATES}`;
43
43
  const apiKey = config.apiKey;
44
44
 
45
- return get(url, apiKey, signal, true);
45
+ return get(url, apiKey, config.token, signal, true);
46
46
  };
@@ -27,7 +27,7 @@ export const contactForm = (
27
27
  const apiKey = config.apiKey;
28
28
  const body = JSON.stringify(request);
29
29
 
30
- return post(url, apiKey, body, signal);
30
+ return post(url, apiKey, body, config.token, signal);
31
31
  };
32
32
 
33
33
  export const contactHasTag = (
@@ -39,5 +39,5 @@ export const contactHasTag = (
39
39
  const apiKey = config.apiKey;
40
40
  const body = JSON.stringify(request);
41
41
 
42
- return post(url, apiKey, body, signal);
42
+ return post(url, apiKey, body, config.token, signal);
43
43
  };
@@ -20,5 +20,5 @@ export const feedXml = (
20
20
  const url = `${config.host}${ENDPOINT_FEED}/${request}`;
21
21
  const apiKey = config.apiKey;
22
22
 
23
- return get(url, apiKey, signal);
23
+ return get(url, apiKey, config.token, signal);
24
24
  };