@seatmap-fyi/api-client 0.1.0-alpha.3 → 0.1.0-alpha.5
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/configuration.d.ts +6 -10
- package/dist/configuration.js +3 -8
- package/dist/generated.d.ts +53 -34
- package/dist/generated.js +345 -314
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/transport.d.ts +2 -1
- package/dist/transport.js +24 -63
- package/package.json +4 -1
- package/dist/errors/api-error.d.ts +0 -5
- package/dist/errors/api-error.js +0 -10
package/dist/configuration.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from "axios";
|
|
1
2
|
export interface ConfigurationParameters {
|
|
2
|
-
readonly basePath
|
|
3
|
-
readonly
|
|
4
|
-
readonly credentials?: RequestCredentials;
|
|
3
|
+
readonly basePath?: string | undefined;
|
|
4
|
+
readonly baseOptions?: AxiosRequestConfig;
|
|
5
5
|
readonly compressRequests?: boolean;
|
|
6
|
-
readonly mapError?: (cause: unknown) => Promise<Error>;
|
|
7
6
|
}
|
|
8
7
|
export declare class Configuration {
|
|
9
|
-
readonly basePath: string;
|
|
10
|
-
readonly
|
|
11
|
-
readonly credentials: RequestCredentials | undefined;
|
|
8
|
+
readonly basePath: string | undefined;
|
|
9
|
+
readonly baseOptions: AxiosRequestConfig | undefined;
|
|
12
10
|
readonly compressRequests: boolean;
|
|
13
|
-
|
|
14
|
-
csrfToken: string | undefined;
|
|
15
|
-
constructor(parameters: ConfigurationParameters);
|
|
11
|
+
constructor(parameters?: ConfigurationParameters);
|
|
16
12
|
}
|
package/dist/configuration.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
export class Configuration {
|
|
2
2
|
basePath;
|
|
3
|
-
|
|
4
|
-
credentials;
|
|
3
|
+
baseOptions;
|
|
5
4
|
compressRequests;
|
|
6
|
-
|
|
7
|
-
csrfToken;
|
|
8
|
-
constructor(parameters) {
|
|
5
|
+
constructor(parameters = {}) {
|
|
9
6
|
this.basePath = parameters.basePath;
|
|
10
|
-
this.
|
|
11
|
-
this.credentials = parameters.credentials;
|
|
7
|
+
this.baseOptions = parameters.baseOptions;
|
|
12
8
|
this.compressRequests = parameters.compressRequests ?? false;
|
|
13
|
-
this.mapError = parameters.mapError;
|
|
14
9
|
}
|
|
15
10
|
}
|
package/dist/generated.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
|
|
1
2
|
export interface DocumentErrorIssueDto {
|
|
2
3
|
code: string;
|
|
3
4
|
message: string;
|
|
4
5
|
}
|
|
5
|
-
export interface
|
|
6
|
+
export interface HttpErrorDataDto {
|
|
7
|
+
/**
|
|
8
|
+
* Request-validation messages.
|
|
9
|
+
* @maxItems 50
|
|
10
|
+
*/
|
|
11
|
+
errors?: string[];
|
|
12
|
+
/** HTTP error category, independent of domain code. */
|
|
13
|
+
errorName: string;
|
|
14
|
+
/** Exception type; development only. */
|
|
15
|
+
error?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Bounded exception stack trace; development only.
|
|
18
|
+
* @maxLength 16384
|
|
19
|
+
*/
|
|
20
|
+
stackTrace?: string;
|
|
6
21
|
/**
|
|
7
22
|
* Rate-limit retry delay in seconds; also returned in Retry-After.
|
|
8
23
|
* @minimum 1
|
|
@@ -13,16 +28,15 @@ export interface HttpErrorDto {
|
|
|
13
28
|
* @maxItems 50
|
|
14
29
|
*/
|
|
15
30
|
issues?: DocumentErrorIssueDto[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
error?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface HttpErrorDto {
|
|
33
|
+
/** Stable domain code, or HTTP category such as InternalServerError. */
|
|
34
|
+
code: string;
|
|
35
|
+
/** @maxLength 4096 */
|
|
36
|
+
message: string;
|
|
37
|
+
data: HttpErrorDataDto;
|
|
38
|
+
/** Server-generated request ID for log correlation. */
|
|
39
|
+
traceId: string;
|
|
26
40
|
}
|
|
27
41
|
export interface HealthResponseDto {
|
|
28
42
|
status: string;
|
|
@@ -2346,33 +2360,38 @@ export declare enum ListMapsLifecycle {
|
|
|
2346
2360
|
}
|
|
2347
2361
|
import type { Configuration } from "./configuration.js";
|
|
2348
2362
|
export declare class HealthClient {
|
|
2349
|
-
private readonly
|
|
2350
|
-
|
|
2351
|
-
|
|
2363
|
+
private readonly configuration;
|
|
2364
|
+
private readonly basePath?;
|
|
2365
|
+
private readonly operations;
|
|
2366
|
+
constructor(configuration: Configuration, basePath?: string | undefined, axiosInstance?: AxiosInstance);
|
|
2367
|
+
getLiveness(options?: AxiosRequestConfig): Promise<AxiosResponse<HealthResponseDto>>;
|
|
2352
2368
|
}
|
|
2353
2369
|
export declare class AuthenticationClient {
|
|
2354
|
-
private readonly
|
|
2355
|
-
private readonly basePath
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2370
|
+
private readonly configuration;
|
|
2371
|
+
private readonly basePath?;
|
|
2372
|
+
private readonly operations;
|
|
2373
|
+
constructor(configuration: Configuration, basePath?: string | undefined, axiosInstance?: AxiosInstance);
|
|
2374
|
+
getIntegrationContext(options?: AxiosRequestConfig): Promise<AxiosResponse<AccountContextDto>>;
|
|
2375
|
+
startLogin(params: StartLoginParams, options?: AxiosRequestConfig): Promise<AxiosResponse<unknown>>;
|
|
2376
|
+
completeLogin(options?: AxiosRequestConfig): Promise<AxiosResponse<unknown>>;
|
|
2377
|
+
logoutProvider(options?: AxiosRequestConfig): Promise<AxiosResponse<unknown>>;
|
|
2378
|
+
getAuthoringSession(options?: AxiosRequestConfig): Promise<AxiosResponse<AuthoringSessionContextDto>>;
|
|
2379
|
+
revokeAuthoringSession(options?: AxiosRequestConfig): Promise<AxiosResponse<void>>;
|
|
2380
|
+
getEmbedContext(mapId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<EmbedContextDto>>;
|
|
2364
2381
|
startLoginHref(params: StartLoginParams): string;
|
|
2365
2382
|
logoutProviderHref(): string;
|
|
2366
2383
|
}
|
|
2367
2384
|
export declare class MapsClient {
|
|
2368
|
-
private readonly
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2385
|
+
private readonly configuration;
|
|
2386
|
+
private readonly basePath?;
|
|
2387
|
+
private readonly operations;
|
|
2388
|
+
constructor(configuration: Configuration, basePath?: string | undefined, axiosInstance?: AxiosInstance);
|
|
2389
|
+
listMaps(workspaceId: string, params?: ListMapsParams, options?: AxiosRequestConfig): Promise<AxiosResponse<MapListDto>>;
|
|
2390
|
+
createMap(workspaceId: string, createMapDto: CreateMapDto, options?: AxiosRequestConfig): Promise<AxiosResponse<MapAcknowledgementDto>>;
|
|
2391
|
+
getMutationStatus(workspaceId: string, operationId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<MutationStatusDto>>;
|
|
2392
|
+
getMap(workspaceId: string, mapId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<MapResponseDto>>;
|
|
2393
|
+
saveMap(workspaceId: string, mapId: string, saveMapDto: SaveMapDto, options?: AxiosRequestConfig): Promise<AxiosResponse<MapAcknowledgementDto>>;
|
|
2394
|
+
changeMap(workspaceId: string, mapId: string, mapActionDto: MapActionDto, options?: AxiosRequestConfig): Promise<AxiosResponse<MapAcknowledgementDto>>;
|
|
2395
|
+
listMapRevisions(workspaceId: string, mapId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<MapRevisionDto[]>>;
|
|
2396
|
+
getMapRevision(workspaceId: string, mapId: string, revision: number, options?: AxiosRequestConfig): Promise<AxiosResponse<MapContentDto>>;
|
|
2378
2397
|
}
|
package/dist/generated.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import axios from "axios";
|
|
1
2
|
export var Capability;
|
|
2
3
|
(function (Capability) {
|
|
3
4
|
Capability["MAPS_READ"] = "maps:read";
|
|
@@ -52,348 +53,378 @@ export var ListMapsLifecycle;
|
|
|
52
53
|
ListMapsLifecycle["trashed"] = "trashed";
|
|
53
54
|
ListMapsLifecycle["deleted"] = "deleted";
|
|
54
55
|
})(ListMapsLifecycle || (ListMapsLifecycle = {}));
|
|
55
|
-
import {
|
|
56
|
+
import { prepareRequestOptions } from "./transport.js";
|
|
56
57
|
export class HealthClient {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
configuration;
|
|
59
|
+
basePath;
|
|
60
|
+
operations;
|
|
61
|
+
constructor(configuration, basePath, axiosInstance = axios) {
|
|
62
|
+
this.configuration = configuration;
|
|
63
|
+
this.basePath = basePath;
|
|
64
|
+
this.operations = getSeatmapApi(axiosInstance);
|
|
60
65
|
}
|
|
61
|
-
getLiveness(options) {
|
|
62
|
-
|
|
66
|
+
async getLiveness(options) {
|
|
67
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
68
|
+
return this.operations.getLiveness(requestOptions);
|
|
63
69
|
}
|
|
64
70
|
}
|
|
65
71
|
export class AuthenticationClient {
|
|
66
|
-
|
|
72
|
+
configuration;
|
|
67
73
|
basePath;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.
|
|
74
|
+
operations;
|
|
75
|
+
constructor(configuration, basePath, axiosInstance = axios) {
|
|
76
|
+
this.configuration = configuration;
|
|
77
|
+
this.basePath = basePath;
|
|
78
|
+
this.operations = getSeatmapApi(axiosInstance);
|
|
71
79
|
}
|
|
72
|
-
getIntegrationContext(options) {
|
|
73
|
-
|
|
80
|
+
async getIntegrationContext(options) {
|
|
81
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
82
|
+
return this.operations.getIntegrationContext(requestOptions);
|
|
74
83
|
}
|
|
75
|
-
startLogin(params, options) {
|
|
76
|
-
|
|
84
|
+
async startLogin(params, options) {
|
|
85
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
86
|
+
return this.operations.startLogin(params, requestOptions);
|
|
77
87
|
}
|
|
78
|
-
completeLogin(options) {
|
|
79
|
-
|
|
88
|
+
async completeLogin(options) {
|
|
89
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
90
|
+
return this.operations.completeLogin(requestOptions);
|
|
80
91
|
}
|
|
81
|
-
logoutProvider(options) {
|
|
82
|
-
|
|
92
|
+
async logoutProvider(options) {
|
|
93
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
94
|
+
return this.operations.logoutProvider(requestOptions);
|
|
83
95
|
}
|
|
84
|
-
getAuthoringSession(options) {
|
|
85
|
-
|
|
96
|
+
async getAuthoringSession(options) {
|
|
97
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
98
|
+
return this.operations.getAuthoringSession(requestOptions);
|
|
86
99
|
}
|
|
87
|
-
revokeAuthoringSession(options) {
|
|
88
|
-
|
|
100
|
+
async revokeAuthoringSession(options) {
|
|
101
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "DELETE");
|
|
102
|
+
return this.operations.revokeAuthoringSession(requestOptions);
|
|
89
103
|
}
|
|
90
|
-
getEmbedContext(mapId, options) {
|
|
91
|
-
|
|
104
|
+
async getEmbedContext(mapId, options) {
|
|
105
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
106
|
+
return this.operations.getEmbedContext(mapId, requestOptions);
|
|
92
107
|
}
|
|
93
108
|
startLoginHref(params) {
|
|
94
|
-
return new URL(getStartLoginUrl(params), this.basePath).href;
|
|
109
|
+
return new URL(this.operations.getStartLoginUrl(params), this.basePath ?? this.configuration.basePath).href;
|
|
95
110
|
}
|
|
96
111
|
logoutProviderHref() {
|
|
97
|
-
return new URL(getLogoutProviderUrl(), this.basePath).href;
|
|
112
|
+
return new URL(this.operations.getLogoutProviderUrl(), this.basePath ?? this.configuration.basePath).href;
|
|
98
113
|
}
|
|
99
114
|
}
|
|
100
115
|
export class MapsClient {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
116
|
+
configuration;
|
|
117
|
+
basePath;
|
|
118
|
+
operations;
|
|
119
|
+
constructor(configuration, basePath, axiosInstance = axios) {
|
|
120
|
+
this.configuration = configuration;
|
|
121
|
+
this.basePath = basePath;
|
|
122
|
+
this.operations = getSeatmapApi(axiosInstance);
|
|
104
123
|
}
|
|
105
|
-
listMaps(workspaceId, params, options) {
|
|
106
|
-
|
|
124
|
+
async listMaps(workspaceId, params, options) {
|
|
125
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
126
|
+
return this.operations.listMaps(workspaceId, params, requestOptions);
|
|
107
127
|
}
|
|
108
|
-
createMap(workspaceId, createMapDto, options) {
|
|
109
|
-
|
|
128
|
+
async createMap(workspaceId, createMapDto, options) {
|
|
129
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST", createMapDto);
|
|
130
|
+
return this.operations.createMap(workspaceId, requestOptions.data instanceof ArrayBuffer
|
|
131
|
+
? requestOptions.data
|
|
132
|
+
: createMapDto, requestOptions);
|
|
110
133
|
}
|
|
111
|
-
getMutationStatus(workspaceId, operationId, options) {
|
|
112
|
-
|
|
134
|
+
async getMutationStatus(workspaceId, operationId, options) {
|
|
135
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
136
|
+
return this.operations.getMutationStatus(workspaceId, operationId, requestOptions);
|
|
113
137
|
}
|
|
114
|
-
getMap(workspaceId, mapId, options) {
|
|
115
|
-
|
|
138
|
+
async getMap(workspaceId, mapId, options) {
|
|
139
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
140
|
+
return this.operations.getMap(workspaceId, mapId, requestOptions);
|
|
116
141
|
}
|
|
117
|
-
saveMap(workspaceId, mapId, saveMapDto, options) {
|
|
118
|
-
|
|
142
|
+
async saveMap(workspaceId, mapId, saveMapDto, options) {
|
|
143
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "PUT", saveMapDto);
|
|
144
|
+
return this.operations.saveMap(workspaceId, mapId, requestOptions.data instanceof ArrayBuffer
|
|
145
|
+
? requestOptions.data
|
|
146
|
+
: saveMapDto, requestOptions);
|
|
119
147
|
}
|
|
120
|
-
changeMap(workspaceId, mapId, mapActionDto, options) {
|
|
121
|
-
|
|
148
|
+
async changeMap(workspaceId, mapId, mapActionDto, options) {
|
|
149
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST", mapActionDto);
|
|
150
|
+
return this.operations.changeMap(workspaceId, mapId, requestOptions.data instanceof ArrayBuffer
|
|
151
|
+
? requestOptions.data
|
|
152
|
+
: mapActionDto, requestOptions);
|
|
122
153
|
}
|
|
123
|
-
listMapRevisions(workspaceId, mapId, options) {
|
|
124
|
-
|
|
154
|
+
async listMapRevisions(workspaceId, mapId, options) {
|
|
155
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
156
|
+
return this.operations.listMapRevisions(workspaceId, mapId, requestOptions);
|
|
125
157
|
}
|
|
126
|
-
getMapRevision(workspaceId, mapId, revision, options) {
|
|
127
|
-
|
|
158
|
+
async getMapRevision(workspaceId, mapId, revision, options) {
|
|
159
|
+
const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
|
|
160
|
+
return this.operations.getMapRevision(workspaceId, mapId, revision, requestOptions);
|
|
128
161
|
}
|
|
129
162
|
}
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
145
|
-
const getIntegrationContext =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
};
|
|
247
|
-
const listMaps =
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
const data = body ? JSON.parse(body) : {};
|
|
398
|
-
return data;
|
|
163
|
+
const getSeatmapApi = (axiosInstance = axios) => {
|
|
164
|
+
const getLiveness = (options) => {
|
|
165
|
+
return axiosInstance.get(`/health`, options);
|
|
166
|
+
};
|
|
167
|
+
const getGetLivenessUrl = () => {
|
|
168
|
+
return axiosInstance
|
|
169
|
+
.create({
|
|
170
|
+
baseURL: "",
|
|
171
|
+
params: null,
|
|
172
|
+
})
|
|
173
|
+
.getUri({
|
|
174
|
+
url: `/health`,
|
|
175
|
+
baseURL: "",
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
const getIntegrationContext = (options) => {
|
|
179
|
+
return axiosInstance.get(`/auth/integration`, options);
|
|
180
|
+
};
|
|
181
|
+
const getGetIntegrationContextUrl = () => {
|
|
182
|
+
return axiosInstance
|
|
183
|
+
.create({
|
|
184
|
+
baseURL: "",
|
|
185
|
+
params: null,
|
|
186
|
+
})
|
|
187
|
+
.getUri({
|
|
188
|
+
url: `/auth/integration`,
|
|
189
|
+
baseURL: "",
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
const startLogin = (params, options) => {
|
|
193
|
+
return axiosInstance.get(`/auth/login`, {
|
|
194
|
+
...options,
|
|
195
|
+
params: { ...params, ...options?.params },
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const getStartLoginUrl = (params) => {
|
|
199
|
+
return axiosInstance
|
|
200
|
+
.create({
|
|
201
|
+
baseURL: "",
|
|
202
|
+
params: null,
|
|
203
|
+
})
|
|
204
|
+
.getUri({
|
|
205
|
+
url: `/auth/login`,
|
|
206
|
+
baseURL: "",
|
|
207
|
+
params,
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
const completeLogin = (options) => {
|
|
211
|
+
return axiosInstance.get(`/auth/callback`, options);
|
|
212
|
+
};
|
|
213
|
+
const getCompleteLoginUrl = () => {
|
|
214
|
+
return axiosInstance
|
|
215
|
+
.create({
|
|
216
|
+
baseURL: "",
|
|
217
|
+
params: null,
|
|
218
|
+
})
|
|
219
|
+
.getUri({
|
|
220
|
+
url: `/auth/callback`,
|
|
221
|
+
baseURL: "",
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
const logoutProvider = (options) => {
|
|
225
|
+
return axiosInstance.get(`/auth/logout/provider`, options);
|
|
226
|
+
};
|
|
227
|
+
const getLogoutProviderUrl = () => {
|
|
228
|
+
return axiosInstance
|
|
229
|
+
.create({
|
|
230
|
+
baseURL: "",
|
|
231
|
+
params: null,
|
|
232
|
+
})
|
|
233
|
+
.getUri({
|
|
234
|
+
url: `/auth/logout/provider`,
|
|
235
|
+
baseURL: "",
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
const getAuthoringSession = (options) => {
|
|
239
|
+
return axiosInstance.get(`/auth/authoring/session`, options);
|
|
240
|
+
};
|
|
241
|
+
const getGetAuthoringSessionUrl = () => {
|
|
242
|
+
return axiosInstance
|
|
243
|
+
.create({
|
|
244
|
+
baseURL: "",
|
|
245
|
+
params: null,
|
|
246
|
+
})
|
|
247
|
+
.getUri({
|
|
248
|
+
url: `/auth/authoring/session`,
|
|
249
|
+
baseURL: "",
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
const revokeAuthoringSession = (options) => {
|
|
253
|
+
return axiosInstance.delete(`/auth/authoring/session`, options);
|
|
254
|
+
};
|
|
255
|
+
const getRevokeAuthoringSessionUrl = () => {
|
|
256
|
+
return axiosInstance
|
|
257
|
+
.create({
|
|
258
|
+
baseURL: "",
|
|
259
|
+
params: null,
|
|
260
|
+
})
|
|
261
|
+
.getUri({
|
|
262
|
+
url: `/auth/authoring/session`,
|
|
263
|
+
baseURL: "",
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
const getEmbedContext = (mapId, options) => {
|
|
267
|
+
return axiosInstance.get(`/auth/embed/${encodeURIComponent(mapId)}`, options);
|
|
268
|
+
};
|
|
269
|
+
const getGetEmbedContextUrl = (mapId) => {
|
|
270
|
+
return axiosInstance
|
|
271
|
+
.create({
|
|
272
|
+
baseURL: "",
|
|
273
|
+
params: null,
|
|
274
|
+
})
|
|
275
|
+
.getUri({
|
|
276
|
+
url: `/auth/embed/${encodeURIComponent(mapId)}`,
|
|
277
|
+
baseURL: "",
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
const listMaps = (workspaceId, params, options) => {
|
|
281
|
+
return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps`, {
|
|
282
|
+
...options,
|
|
283
|
+
params: { ...params, ...options?.params },
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
const getListMapsUrl = (workspaceId, params) => {
|
|
287
|
+
return axiosInstance
|
|
288
|
+
.create({
|
|
289
|
+
baseURL: "",
|
|
290
|
+
params: null,
|
|
291
|
+
})
|
|
292
|
+
.getUri({
|
|
293
|
+
url: `/workspaces/${encodeURIComponent(workspaceId)}/maps`,
|
|
294
|
+
baseURL: "",
|
|
295
|
+
params,
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
const createMap = (workspaceId, createMapDto, options) => {
|
|
299
|
+
return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/maps`, createMapDto, options);
|
|
300
|
+
};
|
|
301
|
+
const getCreateMapUrl = (workspaceId) => {
|
|
302
|
+
return axiosInstance
|
|
303
|
+
.create({
|
|
304
|
+
baseURL: "",
|
|
305
|
+
params: null,
|
|
306
|
+
})
|
|
307
|
+
.getUri({
|
|
308
|
+
url: `/workspaces/${encodeURIComponent(workspaceId)}/maps`,
|
|
309
|
+
baseURL: "",
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
const getMutationStatus = (workspaceId, operationId, options) => {
|
|
313
|
+
return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/operations/${encodeURIComponent(operationId)}`, options);
|
|
314
|
+
};
|
|
315
|
+
const getGetMutationStatusUrl = (workspaceId, operationId) => {
|
|
316
|
+
return axiosInstance
|
|
317
|
+
.create({
|
|
318
|
+
baseURL: "",
|
|
319
|
+
params: null,
|
|
320
|
+
})
|
|
321
|
+
.getUri({
|
|
322
|
+
url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/operations/${encodeURIComponent(operationId)}`,
|
|
323
|
+
baseURL: "",
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
const getMap = (workspaceId, mapId, options) => {
|
|
327
|
+
return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}`, options);
|
|
328
|
+
};
|
|
329
|
+
const getGetMapUrl = (workspaceId, mapId) => {
|
|
330
|
+
return axiosInstance
|
|
331
|
+
.create({
|
|
332
|
+
baseURL: "",
|
|
333
|
+
params: null,
|
|
334
|
+
})
|
|
335
|
+
.getUri({
|
|
336
|
+
url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}`,
|
|
337
|
+
baseURL: "",
|
|
338
|
+
});
|
|
339
|
+
};
|
|
340
|
+
const saveMap = (workspaceId, mapId, saveMapDto, options) => {
|
|
341
|
+
return axiosInstance.put(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/draft`, saveMapDto, options);
|
|
342
|
+
};
|
|
343
|
+
const getSaveMapUrl = (workspaceId, mapId) => {
|
|
344
|
+
return axiosInstance
|
|
345
|
+
.create({
|
|
346
|
+
baseURL: "",
|
|
347
|
+
params: null,
|
|
348
|
+
})
|
|
349
|
+
.getUri({
|
|
350
|
+
url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/draft`,
|
|
351
|
+
baseURL: "",
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
const changeMap = (workspaceId, mapId, mapActionDto, options) => {
|
|
355
|
+
return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/actions`, mapActionDto, options);
|
|
356
|
+
};
|
|
357
|
+
const getChangeMapUrl = (workspaceId, mapId) => {
|
|
358
|
+
return axiosInstance
|
|
359
|
+
.create({
|
|
360
|
+
baseURL: "",
|
|
361
|
+
params: null,
|
|
362
|
+
})
|
|
363
|
+
.getUri({
|
|
364
|
+
url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/actions`,
|
|
365
|
+
baseURL: "",
|
|
366
|
+
});
|
|
367
|
+
};
|
|
368
|
+
const listMapRevisions = (workspaceId, mapId, options) => {
|
|
369
|
+
return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/revisions`, options);
|
|
370
|
+
};
|
|
371
|
+
const getListMapRevisionsUrl = (workspaceId, mapId) => {
|
|
372
|
+
return axiosInstance
|
|
373
|
+
.create({
|
|
374
|
+
baseURL: "",
|
|
375
|
+
params: null,
|
|
376
|
+
})
|
|
377
|
+
.getUri({
|
|
378
|
+
url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/revisions`,
|
|
379
|
+
baseURL: "",
|
|
380
|
+
});
|
|
381
|
+
};
|
|
382
|
+
const getMapRevision = (workspaceId, mapId, revision, options) => {
|
|
383
|
+
return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/revisions/${encodeURIComponent(revision)}`, options);
|
|
384
|
+
};
|
|
385
|
+
const getGetMapRevisionUrl = (workspaceId, mapId, revision) => {
|
|
386
|
+
return axiosInstance
|
|
387
|
+
.create({
|
|
388
|
+
baseURL: "",
|
|
389
|
+
params: null,
|
|
390
|
+
})
|
|
391
|
+
.getUri({
|
|
392
|
+
url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/revisions/${encodeURIComponent(revision)}`,
|
|
393
|
+
baseURL: "",
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
return {
|
|
397
|
+
getLiveness,
|
|
398
|
+
getIntegrationContext,
|
|
399
|
+
startLogin,
|
|
400
|
+
completeLogin,
|
|
401
|
+
logoutProvider,
|
|
402
|
+
getAuthoringSession,
|
|
403
|
+
revokeAuthoringSession,
|
|
404
|
+
getEmbedContext,
|
|
405
|
+
listMaps,
|
|
406
|
+
createMap,
|
|
407
|
+
getMutationStatus,
|
|
408
|
+
getMap,
|
|
409
|
+
saveMap,
|
|
410
|
+
changeMap,
|
|
411
|
+
listMapRevisions,
|
|
412
|
+
getMapRevision,
|
|
413
|
+
getGetLivenessUrl,
|
|
414
|
+
getGetIntegrationContextUrl,
|
|
415
|
+
getStartLoginUrl,
|
|
416
|
+
getCompleteLoginUrl,
|
|
417
|
+
getLogoutProviderUrl,
|
|
418
|
+
getGetAuthoringSessionUrl,
|
|
419
|
+
getRevokeAuthoringSessionUrl,
|
|
420
|
+
getGetEmbedContextUrl,
|
|
421
|
+
getListMapsUrl,
|
|
422
|
+
getCreateMapUrl,
|
|
423
|
+
getGetMutationStatusUrl,
|
|
424
|
+
getGetMapUrl,
|
|
425
|
+
getSaveMapUrl,
|
|
426
|
+
getChangeMapUrl,
|
|
427
|
+
getListMapRevisionsUrl,
|
|
428
|
+
getGetMapRevisionUrl,
|
|
429
|
+
};
|
|
399
430
|
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/transport.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from "axios";
|
|
1
2
|
import type { Configuration } from "./configuration.js";
|
|
2
|
-
export declare function
|
|
3
|
+
export declare function prepareRequestOptions(configuration: Configuration, basePath: string | undefined, options: AxiosRequestConfig | undefined, method: string, body?: unknown): Promise<AxiosRequestConfig<unknown>>;
|
package/dist/transport.js
CHANGED
|
@@ -1,70 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mergeConfig } from "axios";
|
|
2
2
|
const clientContract = "1";
|
|
3
3
|
const requestCompressionThreshold = 64 * 1024;
|
|
4
|
-
export function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
headers.set("X-CSRF-Token", configuration.csrfToken);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
let body = options?.body;
|
|
17
|
-
if (configuration.compressRequests &&
|
|
18
|
-
typeof body === "string" &&
|
|
19
|
-
body.length >= requestCompressionThreshold &&
|
|
20
|
-
!headers.has("Content-Encoding") &&
|
|
21
|
-
typeof CompressionStream !== "undefined") {
|
|
22
|
-
body = await new Response(new Blob([body]).stream().pipeThrough(new CompressionStream("gzip"))).arrayBuffer();
|
|
23
|
-
headers.set("Content-Encoding", "gzip");
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
const response = await configuration.fetchApi(typeof input === "string" ? new URL(input, baseUrl) : input, {
|
|
27
|
-
...options,
|
|
28
|
-
...(body !== undefined ? { body } : {}),
|
|
29
|
-
headers,
|
|
30
|
-
...(configuration.credentials
|
|
31
|
-
? { credentials: configuration.credentials }
|
|
32
|
-
: {}),
|
|
33
|
-
});
|
|
34
|
-
if (response.status === 401) {
|
|
35
|
-
configuration.csrfToken = undefined;
|
|
36
|
-
}
|
|
37
|
-
if (!response.ok && response.status !== 304) {
|
|
38
|
-
throw new ApiError(response);
|
|
39
|
-
}
|
|
40
|
-
return response;
|
|
41
|
-
}
|
|
42
|
-
catch (cause) {
|
|
43
|
-
if (cause instanceof Error && cause.name === "AbortError") {
|
|
44
|
-
throw cause;
|
|
45
|
-
}
|
|
46
|
-
if (configuration.mapError) {
|
|
47
|
-
throw await configuration.mapError(cause);
|
|
48
|
-
}
|
|
49
|
-
throw cause;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function normalizeHeaders(source) {
|
|
54
|
-
let entries;
|
|
55
|
-
if (source instanceof Headers) {
|
|
56
|
-
entries = source.entries();
|
|
4
|
+
export async function prepareRequestOptions(configuration, basePath, options, method, body) {
|
|
5
|
+
const prepared = mergeConfig(configuration.baseOptions ?? {}, options ?? {});
|
|
6
|
+
const headers = { ...prepared.headers };
|
|
7
|
+
if (!["GET", "HEAD", "OPTIONS"].includes(method)) {
|
|
8
|
+
headers["X-Seatmap-Contract"] = clientContract;
|
|
9
|
+
}
|
|
10
|
+
const configuredBasePath = basePath ?? configuration.basePath;
|
|
11
|
+
if (configuredBasePath !== undefined) {
|
|
12
|
+
prepared.baseURL = configuredBasePath;
|
|
57
13
|
}
|
|
58
|
-
|
|
59
|
-
|
|
14
|
+
prepared.headers = headers;
|
|
15
|
+
if (prepared.validateStatus === undefined) {
|
|
16
|
+
prepared.validateStatus = (status) => (status >= 200 && status < 300) || status === 304;
|
|
60
17
|
}
|
|
61
|
-
|
|
62
|
-
|
|
18
|
+
if (!configuration.compressRequests ||
|
|
19
|
+
body === undefined ||
|
|
20
|
+
Object.keys(headers).some((name) => name.toLowerCase() === "content-encoding")) {
|
|
21
|
+
return prepared;
|
|
63
22
|
}
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
23
|
+
const serialized = JSON.stringify(options?.data ?? body);
|
|
24
|
+
if (serialized.length < requestCompressionThreshold ||
|
|
25
|
+
typeof CompressionStream === "undefined") {
|
|
26
|
+
return prepared;
|
|
68
27
|
}
|
|
69
|
-
|
|
28
|
+
prepared.data = await new Response(new Blob([serialized]).stream().pipeThrough(new CompressionStream("gzip"))).arrayBuffer();
|
|
29
|
+
headers["Content-Encoding"] = "gzip";
|
|
30
|
+
return prepared;
|
|
70
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seatmap-fyi/api-client",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -18,5 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"axios": "1.20.0"
|
|
21
24
|
}
|
|
22
25
|
}
|
package/dist/errors/api-error.js
DELETED