swoop-common 2.2.134 → 2.2.136
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/dist/api/generated/core/services/CoreService.d.ts +9 -0
- package/dist/api/generated/core/services/CoreService.js +24 -0
- package/dist/api/generated/core/services/TripComparisonService.d.ts +9 -0
- package/dist/api/generated/core/services/TripComparisonService.js +24 -0
- package/dist/api/init.d.ts +2 -1
- package/dist/api/init.js +5 -0
- package/package.json +1 -1
|
@@ -347,6 +347,15 @@ export declare class CoreService {
|
|
|
347
347
|
* @throws ApiError
|
|
348
348
|
*/
|
|
349
349
|
tripComparisonDelete(uuid: TripComparisonItemId, enquiryId: InternalSwoopId): CancelablePromise<void>;
|
|
350
|
+
/**
|
|
351
|
+
* Reserve a Trip
|
|
352
|
+
* Sets the reserved flag to true on the trip at the specified index within the given TripComparisonItem. This is a server-to-server endpoint protected by an API key.
|
|
353
|
+
* @param uuid UUID of a trip comparison item
|
|
354
|
+
* @param tripIndex Zero-based index of the trip within the TripComparisonItem to reserve
|
|
355
|
+
* @returns DTOTripComparisonRead The updated trip comparison item after reserving the trip
|
|
356
|
+
* @throws ApiError
|
|
357
|
+
*/
|
|
358
|
+
reserveTrip(uuid: TripComparisonItemId, tripIndex: number): CancelablePromise<DTOTripComparisonRead>;
|
|
350
359
|
/**
|
|
351
360
|
* Get Trip Comparison (Public)
|
|
352
361
|
* Fetches a single trip comparison item by UUID. This is a public endpoint that doesn't require authentication.
|
|
@@ -801,6 +801,30 @@ export class CoreService {
|
|
|
801
801
|
},
|
|
802
802
|
});
|
|
803
803
|
}
|
|
804
|
+
/**
|
|
805
|
+
* Reserve a Trip
|
|
806
|
+
* Sets the reserved flag to true on the trip at the specified index within the given TripComparisonItem. This is a server-to-server endpoint protected by an API key.
|
|
807
|
+
* @param uuid UUID of a trip comparison item
|
|
808
|
+
* @param tripIndex Zero-based index of the trip within the TripComparisonItem to reserve
|
|
809
|
+
* @returns DTOTripComparisonRead The updated trip comparison item after reserving the trip
|
|
810
|
+
* @throws ApiError
|
|
811
|
+
*/
|
|
812
|
+
reserveTrip(uuid, tripIndex) {
|
|
813
|
+
return __request(OpenAPI, {
|
|
814
|
+
method: 'PATCH',
|
|
815
|
+
url: '/trip-comparison/{uuid}/trips/{tripIndex}/reserve',
|
|
816
|
+
path: {
|
|
817
|
+
'uuid': uuid,
|
|
818
|
+
'tripIndex': tripIndex,
|
|
819
|
+
},
|
|
820
|
+
errors: {
|
|
821
|
+
400: `If the tripIndex is not a valid non-negative integer`,
|
|
822
|
+
401: `When the API key is missing or invalid`,
|
|
823
|
+
404: `If the trip comparison item does not exist`,
|
|
824
|
+
500: `When an unexpected error occurs`,
|
|
825
|
+
},
|
|
826
|
+
});
|
|
827
|
+
}
|
|
804
828
|
/**
|
|
805
829
|
* Get Trip Comparison (Public)
|
|
806
830
|
* Fetches a single trip comparison item by UUID. This is a public endpoint that doesn't require authentication.
|
|
@@ -39,6 +39,15 @@ export declare class TripComparisonService {
|
|
|
39
39
|
* @throws ApiError
|
|
40
40
|
*/
|
|
41
41
|
static tripComparisonDelete(uuid: TripComparisonItemId, enquiryId: InternalSwoopId): CancelablePromise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Reserve a Trip
|
|
44
|
+
* Sets the reserved flag to true on the trip at the specified index within the given TripComparisonItem. This is a server-to-server endpoint protected by an API key.
|
|
45
|
+
* @param uuid UUID of a trip comparison item
|
|
46
|
+
* @param tripIndex Zero-based index of the trip within the TripComparisonItem to reserve
|
|
47
|
+
* @returns DTOTripComparisonRead The updated trip comparison item after reserving the trip
|
|
48
|
+
* @throws ApiError
|
|
49
|
+
*/
|
|
50
|
+
static reserveTrip(uuid: TripComparisonItemId, tripIndex: number): CancelablePromise<DTOTripComparisonRead>;
|
|
42
51
|
/**
|
|
43
52
|
* Get Trip Comparison (Public)
|
|
44
53
|
* Fetches a single trip comparison item by UUID. This is a public endpoint that doesn't require authentication.
|
|
@@ -94,6 +94,30 @@ export class TripComparisonService {
|
|
|
94
94
|
},
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Reserve a Trip
|
|
99
|
+
* Sets the reserved flag to true on the trip at the specified index within the given TripComparisonItem. This is a server-to-server endpoint protected by an API key.
|
|
100
|
+
* @param uuid UUID of a trip comparison item
|
|
101
|
+
* @param tripIndex Zero-based index of the trip within the TripComparisonItem to reserve
|
|
102
|
+
* @returns DTOTripComparisonRead The updated trip comparison item after reserving the trip
|
|
103
|
+
* @throws ApiError
|
|
104
|
+
*/
|
|
105
|
+
static reserveTrip(uuid, tripIndex) {
|
|
106
|
+
return __request(OpenAPI, {
|
|
107
|
+
method: 'PATCH',
|
|
108
|
+
url: '/trip-comparison/{uuid}/trips/{tripIndex}/reserve',
|
|
109
|
+
path: {
|
|
110
|
+
'uuid': uuid,
|
|
111
|
+
'tripIndex': tripIndex,
|
|
112
|
+
},
|
|
113
|
+
errors: {
|
|
114
|
+
400: `If the tripIndex is not a valid non-negative integer`,
|
|
115
|
+
401: `When the API key is missing or invalid`,
|
|
116
|
+
404: `If the trip comparison item does not exist`,
|
|
117
|
+
500: `When an unexpected error occurs`,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
97
121
|
/**
|
|
98
122
|
* Get Trip Comparison (Public)
|
|
99
123
|
* Fetches a single trip comparison item by UUID. This is a public endpoint that doesn't require authentication.
|
package/dist/api/init.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ export declare const InternalServices: {
|
|
|
7
7
|
export declare const init: (opts: {
|
|
8
8
|
coreServiceUrl: string;
|
|
9
9
|
swoopServiceForwardUrl: string;
|
|
10
|
-
token
|
|
10
|
+
token?: string | (() => Promise<string>);
|
|
11
|
+
headers?: Record<string, string> | (() => Promise<Record<string, string>>);
|
|
11
12
|
}) => {
|
|
12
13
|
SwoopService: Swoop.SwoopService;
|
|
13
14
|
CoreService: Core.CoreService;
|
package/dist/api/init.js
CHANGED
|
@@ -18,6 +18,11 @@ export const init = (opts) => {
|
|
|
18
18
|
// Token
|
|
19
19
|
Core.OpenAPI.TOKEN = opts.token;
|
|
20
20
|
Swoop.OpenAPI.TOKEN = opts.token;
|
|
21
|
+
// Custom headers
|
|
22
|
+
if (opts.headers) {
|
|
23
|
+
Core.OpenAPI.HEADERS = opts.headers;
|
|
24
|
+
Swoop.OpenAPI.HEADERS = opts.headers;
|
|
25
|
+
}
|
|
21
26
|
initalised = true;
|
|
22
27
|
return {
|
|
23
28
|
SwoopService: new Swoop.SwoopService(),
|