swoop-common 2.1.65 → 2.1.67

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,4 +1,5 @@
1
+ import type { EnquiryId } from './EnquiryId';
1
2
  /**
2
3
  * Enquiry Id
3
4
  */
4
- export type enquiryIdParam = string;
5
+ export type enquiryIdParam = EnquiryId;
@@ -1,4 +1,5 @@
1
+ import type { EnquiryId } from './EnquiryId';
1
2
  /**
2
3
  * Enquiry Id
3
4
  */
4
- export type enquiryIdParam = string;
5
+ export type enquiryIdParam = EnquiryId;
@@ -1,4 +1,5 @@
1
1
  import type { Branches } from '../models/Branches';
2
+ import type { BranchTag } from '../models/BranchTag';
2
3
  import type { DTOItineraryCreate } from '../models/DTOItineraryCreate';
3
4
  import type { DTOItineraryRead } from '../models/DTOItineraryRead';
4
5
  import type { DTOItineraryUpdate } from '../models/DTOItineraryUpdate';
@@ -6,6 +7,7 @@ import type { DTORegionCreate } from '../models/DTORegionCreate';
6
7
  import type { DTORegionRead } from '../models/DTORegionRead';
7
8
  import type { DTOSnapshotCreate } from '../models/DTOSnapshotCreate';
8
9
  import type { DTOSnapshotRead } from '../models/DTOSnapshotRead';
10
+ import type { EnquiryId } from '../models/EnquiryId';
9
11
  import type { ItineraryId } from '../models/ItineraryId';
10
12
  import type { Pagination } from '../models/Pagination';
11
13
  import type { SnapshotId } from '../models/SnapshotId';
@@ -35,7 +37,7 @@ export declare class ItineraryService {
35
37
  * @returns any The list of all snapshots given the parameters used
36
38
  * @throws ApiError
37
39
  */
38
- snapshotList(enquiryId: string): CancelablePromise<{
40
+ snapshotList(enquiryId: EnquiryId): CancelablePromise<{
39
41
  snapshots?: Array<DTOSnapshotRead>;
40
42
  }>;
41
43
  /**
@@ -75,7 +77,7 @@ export declare class ItineraryService {
75
77
  * @returns any The tree list view of all itineraries given the parameters used
76
78
  * @throws ApiError
77
79
  */
78
- itineraryList(enquiryId: string): CancelablePromise<{
80
+ itineraryList(enquiryId: EnquiryId): CancelablePromise<{
79
81
  tree?: Array<Branches>;
80
82
  }>;
81
83
  /**
@@ -83,10 +85,14 @@ export declare class ItineraryService {
83
85
  * Creates a new itinerary on an Enquiry
84
86
  * @param enquiryId Enquiry Id
85
87
  * @param requestBody
86
- * @returns DTOItineraryRead When a itinerary is created
88
+ * @returns any When a itinerary is created
87
89
  * @throws ApiError
88
90
  */
89
- itineraryCreate(enquiryId: string, requestBody: DTOItineraryCreate): CancelablePromise<DTOItineraryRead>;
91
+ itineraryCreate(enquiryId: EnquiryId, requestBody: DTOItineraryCreate): CancelablePromise<{
92
+ itinerary?: DTOItineraryRead;
93
+ tag?: BranchTag;
94
+ enquiryId?: EnquiryId;
95
+ }>;
90
96
  /**
91
97
  * Get Itinerary
92
98
  * Get itinerary via ID
@@ -96,7 +102,7 @@ export declare class ItineraryService {
96
102
  * @returns any The corresponding itinerary that matches the enquiry id, tag, and version
97
103
  * @throws ApiError
98
104
  */
99
- itineraryGet(enquiryId: string, tag: string, version: string): CancelablePromise<any>;
105
+ itineraryGet(enquiryId: EnquiryId, tag: string, version: string): CancelablePromise<any>;
100
106
  /**
101
107
  * Update Itinerary as New Revision
102
108
  * Updates an itinerary as a new revision on the latest version of a branch
@@ -106,17 +112,21 @@ export declare class ItineraryService {
106
112
  * @returns DTOItineraryRead When a new revision is created successfully
107
113
  * @throws ApiError
108
114
  */
109
- itineraryUpdateAsNewRevision(enquiryId: string, tag: string, requestBody: DTOItineraryUpdate): CancelablePromise<DTOItineraryRead>;
115
+ itineraryUpdateAsNewRevision(enquiryId: EnquiryId, tag: string, requestBody: DTOItineraryUpdate): CancelablePromise<DTOItineraryRead>;
110
116
  /**
111
117
  * Fork an Itinerary
112
118
  * this will create a new sub branch off the corresponding itinerary (enquiry id/tag/version)
113
119
  * @param enquiryId Enquiry Id
114
120
  * @param tag the branch tag
115
121
  * @param version the version of a branch
116
- * @returns DTOItineraryRead When the fork was successful
122
+ * @returns any When the fork was successful
117
123
  * @throws ApiError
118
124
  */
119
- forkItinerary(enquiryId: string, tag: string, version: string): CancelablePromise<DTOItineraryRead>;
125
+ forkItinerary(enquiryId: EnquiryId, tag: string, version: string): CancelablePromise<{
126
+ itinerary?: DTOItineraryRead;
127
+ tag?: BranchTag;
128
+ enquiryId?: EnquiryId;
129
+ }>;
120
130
  /**
121
131
  * Promote an Itinerary
122
132
  * This will take itinerary that matches the enquiry id, tag, and version to create a new revision on the head of it's parent branch. This will delete the old sub branch that is being promoted as will exist as the new main head of its parent. Promotions of any tag will always promote into the main branch.
@@ -126,15 +136,17 @@ export declare class ItineraryService {
126
136
  * @returns DTOItineraryRead The new head of the parent branch
127
137
  * @throws ApiError
128
138
  */
129
- promoteItinerary(enquiryId: string, tag: string, version: string): CancelablePromise<DTOItineraryRead>;
139
+ promoteItinerary(enquiryId: EnquiryId, tag: string, version: string): CancelablePromise<DTOItineraryRead>;
130
140
  /**
131
- * Sync Itinerary
132
- * Sync an itinerary with swoop
133
- * @param itineraryId Itinerary id
134
- * @returns DTOItineraryRead When an itinerary has been posted to pub/sub successfully
141
+ * Fake Sync Itinerary
142
+ * Fakes an error when syncing itinerary
143
+ * @param enquiryId Enquiry Id
144
+ * @param tag the branch tag
145
+ * @param version the version of a branch
146
+ * @returns void
135
147
  * @throws ApiError
136
148
  */
137
- syncItinerary(itineraryId: ItineraryId): CancelablePromise<DTOItineraryRead>;
149
+ fakeSyncItinerary(enquiryId: EnquiryId, tag: string, version: string): CancelablePromise<void>;
138
150
  /**
139
151
  * List Regions
140
152
  * List all regions
@@ -41,6 +41,7 @@ export class ItineraryService {
41
41
  errors: {
42
42
  400: `If the payload is malformed`,
43
43
  401: `Unauthorized - Missing or invalid Authorization header`,
44
+ 404: `If the entity does not exists`,
44
45
  500: `When an internal server error occurs when creating a snapshot entity`,
45
46
  503: `Service Unavailable - The server is temporarily unable to handle the request`,
46
47
  },
@@ -57,7 +58,7 @@ export class ItineraryService {
57
58
  return __request(OpenAPI, {
58
59
  method: 'GET',
59
60
  url: '/snapshot/view/{enquiryId}',
60
- query: {
61
+ path: {
61
62
  'enquiryId': enquiryId,
62
63
  },
63
64
  errors: {
@@ -83,9 +84,10 @@ export class ItineraryService {
83
84
  'snapshotId': snapshotId,
84
85
  },
85
86
  errors: {
87
+ 400: `If the payload is malformed`,
86
88
  401: `Unauthorized - Missing or invalid Authorization header`,
87
89
  404: `If the snapshot does not exist`,
88
- 503: `Service Unavailable - The server is temporarily unable to handle the request`,
90
+ 500: `When an internal server error occurs when reading snapshot`,
89
91
  },
90
92
  });
91
93
  }
@@ -106,6 +108,7 @@ export class ItineraryService {
106
108
  errors: {
107
109
  400: `When the snapshot doesn't exist in the first place, or when a before hook fails before deleting the item`,
108
110
  401: `Unauthorized - Missing or invalid Authorization header`,
111
+ 404: `If the snapshot to delete to does not exist`,
109
112
  500: `When the snapshot fails to delete due to an internal server error`,
110
113
  503: `Service Unavailable - The server is temporarily unable to handle the request`,
111
114
  },
@@ -128,7 +131,7 @@ export class ItineraryService {
128
131
  errors: {
129
132
  400: `If the payload is malformed`,
130
133
  401: `Unauthorized - Missing or invalid Authorization header`,
131
- 404: `If the snapshot or itinerary to restore to does not exist`,
134
+ 404: `If the entity does not exists`,
132
135
  500: `When the snapshot fails to restore due to an internal server error`,
133
136
  503: `Service Unavailable - The server is temporarily unable to handle the request`,
134
137
  },
@@ -145,7 +148,7 @@ export class ItineraryService {
145
148
  return __request(OpenAPI, {
146
149
  method: 'GET',
147
150
  url: '/itinerary/{enquiryId}/tree',
148
- query: {
151
+ path: {
149
152
  'enquiryId': enquiryId,
150
153
  },
151
154
  errors: {
@@ -161,14 +164,14 @@ export class ItineraryService {
161
164
  * Creates a new itinerary on an Enquiry
162
165
  * @param enquiryId Enquiry Id
163
166
  * @param requestBody
164
- * @returns DTOItineraryRead When a itinerary is created
167
+ * @returns any When a itinerary is created
165
168
  * @throws ApiError
166
169
  */
167
170
  itineraryCreate(enquiryId, requestBody) {
168
171
  return __request(OpenAPI, {
169
172
  method: 'POST',
170
173
  url: '/itinerary/create/{enquiryId}',
171
- query: {
174
+ path: {
172
175
  'enquiryId': enquiryId,
173
176
  },
174
177
  body: requestBody,
@@ -194,12 +197,13 @@ export class ItineraryService {
194
197
  return __request(OpenAPI, {
195
198
  method: 'GET',
196
199
  url: '/itinerary/{enquiryId}/{tag}/{version}',
197
- query: {
200
+ path: {
198
201
  'enquiryId': enquiryId,
199
202
  'tag': tag,
200
203
  'version': version,
201
204
  },
202
205
  errors: {
206
+ 400: `If the payload is malformed`,
203
207
  401: `Unauthorized - Missing or invalid Authorization header`,
204
208
  404: `If the itinerary does not exist as it does not match the enquiry id, tag, and version`,
205
209
  503: `Service Unavailable - The server is temporarily unable to handle the request`,
@@ -219,7 +223,7 @@ export class ItineraryService {
219
223
  return __request(OpenAPI, {
220
224
  method: 'PUT',
221
225
  url: '/itinerary/{enquiryId}/{tag}',
222
- query: {
226
+ path: {
223
227
  'enquiryId': enquiryId,
224
228
  'tag': tag,
225
229
  },
@@ -239,14 +243,14 @@ export class ItineraryService {
239
243
  * @param enquiryId Enquiry Id
240
244
  * @param tag the branch tag
241
245
  * @param version the version of a branch
242
- * @returns DTOItineraryRead When the fork was successful
246
+ * @returns any When the fork was successful
243
247
  * @throws ApiError
244
248
  */
245
249
  forkItinerary(enquiryId, tag, version) {
246
250
  return __request(OpenAPI, {
247
251
  method: 'POST',
248
252
  url: '/itinerary/fork/{enquiryId}/{tag}/{version}',
249
- query: {
253
+ path: {
250
254
  'enquiryId': enquiryId,
251
255
  'tag': tag,
252
256
  'version': version,
@@ -272,7 +276,7 @@ export class ItineraryService {
272
276
  return __request(OpenAPI, {
273
277
  method: 'POST',
274
278
  url: '/itinerary/promote/{enquiryId}/{tag}/{version}',
275
- query: {
279
+ path: {
276
280
  'enquiryId': enquiryId,
277
281
  'tag': tag,
278
282
  'version': version,
@@ -286,25 +290,27 @@ export class ItineraryService {
286
290
  });
287
291
  }
288
292
  /**
289
- * Sync Itinerary
290
- * Sync an itinerary with swoop
291
- * @param itineraryId Itinerary id
292
- * @returns DTOItineraryRead When an itinerary has been posted to pub/sub successfully
293
+ * Fake Sync Itinerary
294
+ * Fakes an error when syncing itinerary
295
+ * @param enquiryId Enquiry Id
296
+ * @param tag the branch tag
297
+ * @param version the version of a branch
298
+ * @returns void
293
299
  * @throws ApiError
294
300
  */
295
- syncItinerary(itineraryId) {
301
+ fakeSyncItinerary(enquiryId, tag, version) {
296
302
  return __request(OpenAPI, {
297
303
  method: 'POST',
298
- url: '/sync/{itineraryId}',
304
+ url: '/itinerary/fake/sync/{enquiryId}/{tag}/{version}',
299
305
  path: {
300
- 'itineraryId': itineraryId,
306
+ 'enquiryId': enquiryId,
307
+ 'tag': tag,
308
+ 'version': version,
301
309
  },
302
310
  errors: {
303
- 400: `When the itinerary to sync does not exist`,
311
+ 400: `The faked error`,
304
312
  401: `Unauthorized - Missing or invalid Authorization header`,
305
- 404: `Related entity not found`,
306
313
  500: `When an internal server error occurs whilst syncing`,
307
- 503: `Service Unavailable - The server is temporarily unable to handle the request`,
308
314
  },
309
315
  });
310
316
  }
@@ -1,6 +1,7 @@
1
1
  import type { DTOItineraryRead } from '../models/DTOItineraryRead';
2
2
  import type { DTOSnapshotCreate } from '../models/DTOSnapshotCreate';
3
3
  import type { DTOSnapshotRead } from '../models/DTOSnapshotRead';
4
+ import type { EnquiryId } from '../models/EnquiryId';
4
5
  import type { SnapshotId } from '../models/SnapshotId';
5
6
  import type { CancelablePromise } from '../core/CancelablePromise';
6
7
  export declare class SnapshotService {
@@ -19,7 +20,7 @@ export declare class SnapshotService {
19
20
  * @returns any The list of all snapshots given the parameters used
20
21
  * @throws ApiError
21
22
  */
22
- static snapshotList(enquiryId: string): CancelablePromise<{
23
+ static snapshotList(enquiryId: EnquiryId): CancelablePromise<{
23
24
  snapshots?: Array<DTOSnapshotRead>;
24
25
  }>;
25
26
  /**
@@ -17,6 +17,7 @@ export class SnapshotService {
17
17
  errors: {
18
18
  400: `If the payload is malformed`,
19
19
  401: `Unauthorized - Missing or invalid Authorization header`,
20
+ 404: `If the entity does not exists`,
20
21
  500: `When an internal server error occurs when creating a snapshot entity`,
21
22
  503: `Service Unavailable - The server is temporarily unable to handle the request`,
22
23
  },
@@ -33,7 +34,7 @@ export class SnapshotService {
33
34
  return __request(OpenAPI, {
34
35
  method: 'GET',
35
36
  url: '/snapshot/view/{enquiryId}',
36
- query: {
37
+ path: {
37
38
  'enquiryId': enquiryId,
38
39
  },
39
40
  errors: {
@@ -59,9 +60,10 @@ export class SnapshotService {
59
60
  'snapshotId': snapshotId,
60
61
  },
61
62
  errors: {
63
+ 400: `If the payload is malformed`,
62
64
  401: `Unauthorized - Missing or invalid Authorization header`,
63
65
  404: `If the snapshot does not exist`,
64
- 503: `Service Unavailable - The server is temporarily unable to handle the request`,
66
+ 500: `When an internal server error occurs when reading snapshot`,
65
67
  },
66
68
  });
67
69
  }
@@ -82,6 +84,7 @@ export class SnapshotService {
82
84
  errors: {
83
85
  400: `When the snapshot doesn't exist in the first place, or when a before hook fails before deleting the item`,
84
86
  401: `Unauthorized - Missing or invalid Authorization header`,
87
+ 404: `If the snapshot to delete to does not exist`,
85
88
  500: `When the snapshot fails to delete due to an internal server error`,
86
89
  503: `Service Unavailable - The server is temporarily unable to handle the request`,
87
90
  },
@@ -104,7 +107,7 @@ export class SnapshotService {
104
107
  errors: {
105
108
  400: `If the payload is malformed`,
106
109
  401: `Unauthorized - Missing or invalid Authorization header`,
107
- 404: `If the snapshot or itinerary to restore to does not exist`,
110
+ 404: `If the entity does not exists`,
108
111
  500: `When the snapshot fails to restore due to an internal server error`,
109
112
  503: `Service Unavailable - The server is temporarily unable to handle the request`,
110
113
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.1.65",
3
+ "version": "2.1.67",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {