@seatmap-fyi/api-client 0.1.0-alpha.2 → 0.1.0-alpha.28

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/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";
@@ -20,6 +21,13 @@ export var EmbedContextDtoCapabilitiesItem;
20
21
  (function (EmbedContextDtoCapabilitiesItem) {
21
22
  EmbedContextDtoCapabilitiesItem["map:view"] = "map:view";
22
23
  })(EmbedContextDtoCapabilitiesItem || (EmbedContextDtoCapabilitiesItem = {}));
24
+ export var MapPreviewState;
25
+ (function (MapPreviewState) {
26
+ MapPreviewState["pending"] = "pending";
27
+ MapPreviewState["ready"] = "ready";
28
+ MapPreviewState["empty"] = "empty";
29
+ MapPreviewState["unavailable"] = "unavailable";
30
+ })(MapPreviewState || (MapPreviewState = {}));
23
31
  export var MapLifecycle;
24
32
  (function (MapLifecycle) {
25
33
  MapLifecycle["active"] = "active";
@@ -27,6 +35,10 @@ export var MapLifecycle;
27
35
  MapLifecycle["trashed"] = "trashed";
28
36
  MapLifecycle["deleted"] = "deleted";
29
37
  })(MapLifecycle || (MapLifecycle = {}));
38
+ export var MapEditorStateDtoVersion;
39
+ (function (MapEditorStateDtoVersion) {
40
+ MapEditorStateDtoVersion[MapEditorStateDtoVersion["NUMBER_1"] = 1] = "NUMBER_1";
41
+ })(MapEditorStateDtoVersion || (MapEditorStateDtoVersion = {}));
30
42
  export var MutationStatus;
31
43
  (function (MutationStatus) {
32
44
  MutationStatus["completed"] = "completed";
@@ -45,6 +57,47 @@ export var MapOperation;
45
57
  MapOperation["restoreTrash"] = "restoreTrash";
46
58
  MapOperation["restoreRevision"] = "restoreRevision";
47
59
  })(MapOperation || (MapOperation = {}));
60
+ export var PrepareArtworkUploadDtoMimeType;
61
+ (function (PrepareArtworkUploadDtoMimeType) {
62
+ PrepareArtworkUploadDtoMimeType["image/png"] = "image/png";
63
+ PrepareArtworkUploadDtoMimeType["image/jpeg"] = "image/jpeg";
64
+ PrepareArtworkUploadDtoMimeType["image/webp"] = "image/webp";
65
+ PrepareArtworkUploadDtoMimeType["image/svg+xml"] = "image/svg+xml";
66
+ })(PrepareArtworkUploadDtoMimeType || (PrepareArtworkUploadDtoMimeType = {}));
67
+ export var ArtworkUploadState;
68
+ (function (ArtworkUploadState) {
69
+ ArtworkUploadState["prepared"] = "prepared";
70
+ ArtworkUploadState["receiving"] = "receiving";
71
+ ArtworkUploadState["uploaded"] = "uploaded";
72
+ ArtworkUploadState["validating"] = "validating";
73
+ ArtworkUploadState["ready"] = "ready";
74
+ ArtworkUploadState["review-required"] = "review-required";
75
+ ArtworkUploadState["failed"] = "failed";
76
+ ArtworkUploadState["cancelled"] = "cancelled";
77
+ })(ArtworkUploadState || (ArtworkUploadState = {}));
78
+ export var ArtworkFailureCode;
79
+ (function (ArtworkFailureCode) {
80
+ ArtworkFailureCode["ARTWORK_DIGEST"] = "ARTWORK_DIGEST";
81
+ ArtworkFailureCode["ARTWORK_SVG_ACTIVE"] = "ARTWORK_SVG_ACTIVE";
82
+ ArtworkFailureCode["ARTWORK_SVG_INVALID"] = "ARTWORK_SVG_INVALID";
83
+ ArtworkFailureCode["ARTWORK_SVG_COMPLEX"] = "ARTWORK_SVG_COMPLEX";
84
+ ArtworkFailureCode["ARTWORK_FILE_LIMIT"] = "ARTWORK_FILE_LIMIT";
85
+ ArtworkFailureCode["ARTWORK_TYPE"] = "ARTWORK_TYPE";
86
+ ArtworkFailureCode["ARTWORK_PIXEL_LIMIT"] = "ARTWORK_PIXEL_LIMIT";
87
+ ArtworkFailureCode["ARTWORK_DECODE"] = "ARTWORK_DECODE";
88
+ ArtworkFailureCode["ARTWORK_TRANSFER"] = "ARTWORK_TRANSFER";
89
+ ArtworkFailureCode["ARTWORK_EXPIRED"] = "ARTWORK_EXPIRED";
90
+ ArtworkFailureCode["ARTWORK_VALIDATION_FAILED"] = "ARTWORK_VALIDATION_FAILED";
91
+ })(ArtworkFailureCode || (ArtworkFailureCode = {}));
92
+ export var ArtworkState;
93
+ (function (ArtworkState) {
94
+ ArtworkState["pending"] = "pending";
95
+ ArtworkState["ready"] = "ready";
96
+ ArtworkState["review-required"] = "review-required";
97
+ ArtworkState["failed"] = "failed";
98
+ ArtworkState["deleting"] = "deleting";
99
+ ArtworkState["deleted"] = "deleted";
100
+ })(ArtworkState || (ArtworkState = {}));
48
101
  export var ListMapsLifecycle;
49
102
  (function (ListMapsLifecycle) {
50
103
  ListMapsLifecycle["active"] = "active";
@@ -52,348 +105,620 @@ export var ListMapsLifecycle;
52
105
  ListMapsLifecycle["trashed"] = "trashed";
53
106
  ListMapsLifecycle["deleted"] = "deleted";
54
107
  })(ListMapsLifecycle || (ListMapsLifecycle = {}));
55
- import { createApiFetcher } from "./transport.js";
108
+ export var ListMapsSort;
109
+ (function (ListMapsSort) {
110
+ ListMapsSort["created-oldest"] = "created-oldest";
111
+ ListMapsSort["recently-edited"] = "recently-edited";
112
+ ListMapsSort["name-asc"] = "name-asc";
113
+ ListMapsSort["most-seats"] = "most-seats";
114
+ })(ListMapsSort || (ListMapsSort = {}));
115
+ import { prepareRequestOptions } from "./transport.js";
56
116
  export class HealthClient {
57
- fetchApi;
58
- constructor(configuration) {
59
- this.fetchApi = createApiFetcher(configuration);
117
+ configuration;
118
+ basePath;
119
+ operations;
120
+ constructor(configuration, basePath, axiosInstance = axios) {
121
+ this.configuration = configuration;
122
+ this.basePath = basePath;
123
+ this.operations = getSeatmapApi(axiosInstance);
60
124
  }
61
- getLiveness(options) {
62
- return getLiveness(options, this.fetchApi);
125
+ async getLiveness(options) {
126
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
127
+ return this.operations.getLiveness(requestOptions);
63
128
  }
64
129
  }
65
130
  export class AuthenticationClient {
66
- fetchApi;
131
+ configuration;
67
132
  basePath;
68
- constructor(configuration) {
69
- this.basePath = configuration.basePath;
70
- this.fetchApi = createApiFetcher(configuration);
133
+ operations;
134
+ constructor(configuration, basePath, axiosInstance = axios) {
135
+ this.configuration = configuration;
136
+ this.basePath = basePath;
137
+ this.operations = getSeatmapApi(axiosInstance);
71
138
  }
72
- getIntegrationContext(options) {
73
- return getIntegrationContext(options, this.fetchApi);
139
+ async getIntegrationContext(options) {
140
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
141
+ return this.operations.getIntegrationContext(requestOptions);
74
142
  }
75
- startLogin(params, options) {
76
- return startLogin(params, options, this.fetchApi);
143
+ async startLogin(params, options) {
144
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
145
+ return this.operations.startLogin(params, requestOptions);
77
146
  }
78
- completeLogin(options) {
79
- return completeLogin(options, this.fetchApi);
147
+ async completeLogin(options) {
148
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
149
+ return this.operations.completeLogin(requestOptions);
80
150
  }
81
- logoutProvider(options) {
82
- return logoutProvider(options, this.fetchApi);
151
+ async logoutProvider(options) {
152
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
153
+ return this.operations.logoutProvider(requestOptions);
83
154
  }
84
- getAuthoringSession(options) {
85
- return getAuthoringSession(options, this.fetchApi);
155
+ async getAuthoringSession(options) {
156
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
157
+ return this.operations.getAuthoringSession(requestOptions);
86
158
  }
87
- revokeAuthoringSession(options) {
88
- return revokeAuthoringSession(options, this.fetchApi);
159
+ async revokeAuthoringSession(options) {
160
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "DELETE");
161
+ return this.operations.revokeAuthoringSession(requestOptions);
89
162
  }
90
- getEmbedContext(mapId, options) {
91
- return getEmbedContext(mapId, options, this.fetchApi);
163
+ async getEmbedContext(mapId, options) {
164
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
165
+ return this.operations.getEmbedContext(mapId, requestOptions);
92
166
  }
93
167
  startLoginHref(params) {
94
- return new URL(getStartLoginUrl(params), this.basePath).href;
168
+ return new URL(this.operations.getStartLoginUrl(params), this.basePath ?? this.configuration.basePath).href;
95
169
  }
96
170
  logoutProviderHref() {
97
- return new URL(getLogoutProviderUrl(), this.basePath).href;
171
+ return new URL(this.operations.getLogoutProviderUrl(), this.basePath ?? this.configuration.basePath).href;
98
172
  }
99
173
  }
100
174
  export class MapsClient {
101
- fetchApi;
102
- constructor(configuration) {
103
- this.fetchApi = createApiFetcher(configuration);
175
+ configuration;
176
+ basePath;
177
+ operations;
178
+ constructor(configuration, basePath, axiosInstance = axios) {
179
+ this.configuration = configuration;
180
+ this.basePath = basePath;
181
+ this.operations = getSeatmapApi(axiosInstance);
182
+ }
183
+ async listMaps(workspaceId, params, options) {
184
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
185
+ return this.operations.listMaps(workspaceId, params, requestOptions);
186
+ }
187
+ async createMap(workspaceId, createMapDto, options) {
188
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST", createMapDto);
189
+ return this.operations.createMap(workspaceId, requestOptions.data instanceof ArrayBuffer ? requestOptions.data : createMapDto, requestOptions);
104
190
  }
105
- listMaps(workspaceId, params, options) {
106
- return listMaps(workspaceId, params, options, this.fetchApi);
191
+ async getMapPreview(workspaceId, mapId, params, options) {
192
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
193
+ return this.operations.getMapPreview(workspaceId, mapId, params, requestOptions);
107
194
  }
108
- createMap(workspaceId, createMapDto, options) {
109
- return createMap(workspaceId, createMapDto, options, this.fetchApi);
195
+ async getMutationStatus(workspaceId, operationId, options) {
196
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
197
+ return this.operations.getMutationStatus(workspaceId, operationId, requestOptions);
110
198
  }
111
- getMutationStatus(workspaceId, operationId, options) {
112
- return getMutationStatus(workspaceId, operationId, options, this.fetchApi);
199
+ async resolveMapLink(workspaceId, editorCode, options) {
200
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
201
+ return this.operations.resolveMapLink(workspaceId, editorCode, requestOptions);
113
202
  }
114
- getMap(workspaceId, mapId, options) {
115
- return getMap(workspaceId, mapId, options, this.fetchApi);
203
+ async getMapLink(workspaceId, mapId, options) {
204
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
205
+ return this.operations.getMapLink(workspaceId, mapId, requestOptions);
116
206
  }
117
- saveMap(workspaceId, mapId, saveMapDto, options) {
118
- return saveMap(workspaceId, mapId, saveMapDto, options, this.fetchApi);
207
+ async getMap(workspaceId, mapId, options) {
208
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
209
+ return this.operations.getMap(workspaceId, mapId, requestOptions);
119
210
  }
120
- changeMap(workspaceId, mapId, mapActionDto, options) {
121
- return changeMap(workspaceId, mapId, mapActionDto, options, this.fetchApi);
211
+ async saveMap(workspaceId, mapId, saveMapDto, options) {
212
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "PUT", saveMapDto);
213
+ return this.operations.saveMap(workspaceId, mapId, requestOptions.data instanceof ArrayBuffer ? requestOptions.data : saveMapDto, requestOptions);
122
214
  }
123
- listMapRevisions(workspaceId, mapId, options) {
124
- return listMapRevisions(workspaceId, mapId, options, this.fetchApi);
215
+ async changeMap(workspaceId, mapId, mapActionDto, options) {
216
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST", mapActionDto);
217
+ return this.operations.changeMap(workspaceId, mapId, requestOptions.data instanceof ArrayBuffer ? requestOptions.data : mapActionDto, requestOptions);
125
218
  }
126
- getMapRevision(workspaceId, mapId, revision, options) {
127
- return getMapRevision(workspaceId, mapId, revision, options, this.fetchApi);
219
+ async listMapRevisions(workspaceId, mapId, options) {
220
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
221
+ return this.operations.listMapRevisions(workspaceId, mapId, requestOptions);
222
+ }
223
+ async getMapRevision(workspaceId, mapId, revision, options) {
224
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
225
+ return this.operations.getMapRevision(workspaceId, mapId, revision, requestOptions);
128
226
  }
129
227
  }
130
- const getGetLivenessUrl = () => {
131
- return `/health/live`;
132
- };
133
- const getLiveness = async (options, fetchFn) => {
134
- const res = await (fetchFn ?? fetch)(getGetLivenessUrl(), {
135
- ...options,
136
- method: "GET",
137
- });
138
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
139
- const data = body ? JSON.parse(body) : {};
140
- return data;
141
- };
142
- const getGetIntegrationContextUrl = () => {
143
- return `/v1/auth/integration`;
144
- };
145
- const getIntegrationContext = async (options, fetchFn) => {
146
- const res = await (fetchFn ?? fetch)(getGetIntegrationContextUrl(), {
147
- ...options,
148
- method: "GET",
149
- });
150
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
151
- const data = body ? JSON.parse(body) : {};
152
- return data;
153
- };
154
- const getStartLoginUrl = (params) => {
155
- const normalizedParams = new URLSearchParams();
156
- Object.entries(params || {}).forEach(([key, value]) => {
157
- if (value !== undefined) {
158
- normalizedParams.append(key, value === null ? "null" : String(value));
159
- }
160
- });
161
- const stringifiedParams = normalizedParams.toString();
162
- return stringifiedParams.length > 0
163
- ? `/v1/auth/login?${stringifiedParams}`
164
- : `/v1/auth/login`;
165
- };
166
- const startLogin = async (params, options, fetchFn) => {
167
- const res = await (fetchFn ?? fetch)(getStartLoginUrl(params), {
168
- ...options,
169
- method: "GET",
170
- });
171
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
172
- const data = body ? JSON.parse(body) : {};
173
- return data;
174
- };
175
- const getCompleteLoginUrl = () => {
176
- return `/v1/auth/callback`;
177
- };
178
- const completeLogin = async (options, fetchFn) => {
179
- const res = await (fetchFn ?? fetch)(getCompleteLoginUrl(), {
180
- ...options,
181
- method: "GET",
182
- });
183
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
184
- const data = body ? JSON.parse(body) : {};
185
- return data;
186
- };
187
- const getLogoutProviderUrl = () => {
188
- return `/v1/auth/logout/provider`;
189
- };
190
- const logoutProvider = async (options, fetchFn) => {
191
- const res = await (fetchFn ?? fetch)(getLogoutProviderUrl(), {
192
- ...options,
193
- method: "GET",
194
- });
195
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
196
- const data = body ? JSON.parse(body) : {};
197
- return data;
198
- };
199
- const getGetAuthoringSessionUrl = () => {
200
- return `/v1/auth/authoring/session`;
201
- };
202
- const getAuthoringSession = async (options, fetchFn) => {
203
- const res = await (fetchFn ?? fetch)(getGetAuthoringSessionUrl(), {
204
- ...options,
205
- method: "GET",
206
- });
207
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
208
- const data = body ? JSON.parse(body) : {};
209
- return data;
210
- };
211
- const getRevokeAuthoringSessionUrl = () => {
212
- return `/v1/auth/authoring/session`;
213
- };
214
- const revokeAuthoringSession = async (options, fetchFn) => {
215
- const res = await (fetchFn ?? fetch)(getRevokeAuthoringSessionUrl(), {
216
- ...options,
217
- method: "DELETE",
218
- });
219
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
220
- const data = body ? JSON.parse(body) : undefined;
221
- return data;
222
- };
223
- const getGetEmbedContextUrl = (mapId) => {
224
- return `/v1/auth/embed/${encodeURIComponent(String(mapId))}`;
225
- };
226
- const getEmbedContext = async (mapId, options, fetchFn) => {
227
- const res = await (fetchFn ?? fetch)(getGetEmbedContextUrl(mapId), {
228
- ...options,
229
- method: "GET",
230
- });
231
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
232
- const data = body ? JSON.parse(body) : {};
233
- return data;
234
- };
235
- const getListMapsUrl = (workspaceId, params) => {
236
- const normalizedParams = new URLSearchParams();
237
- Object.entries(params || {}).forEach(([key, value]) => {
238
- if (value !== undefined) {
239
- normalizedParams.append(key, value === null ? "null" : String(value));
240
- }
241
- });
242
- const stringifiedParams = normalizedParams.toString();
243
- return stringifiedParams.length > 0
244
- ? `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps?${stringifiedParams}`
245
- : `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps`;
246
- };
247
- const listMaps = async (workspaceId, params, options, fetchFn) => {
248
- const res = await (fetchFn ?? fetch)(getListMapsUrl(workspaceId, params), {
249
- ...options,
250
- method: "GET",
251
- });
252
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
253
- const data = body ? JSON.parse(body) : {};
254
- return data;
255
- };
256
- const getCreateMapUrl = (workspaceId) => {
257
- return `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps`;
258
- };
259
- const createMap = async (workspaceId, createMapDto, options, fetchFn) => {
260
- const getHeaders = (h) => {
261
- if (!h)
262
- return {};
263
- if (h instanceof Headers)
264
- return Object.fromEntries(h.entries());
265
- if (Symbol.iterator in h) {
266
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
267
- }
268
- const headers = {};
269
- for (const [name, value] of Object.entries(h)) {
270
- if (value !== undefined)
271
- headers[name] = value;
272
- }
273
- return headers;
274
- };
275
- const res = await (fetchFn ?? fetch)(getCreateMapUrl(workspaceId), {
276
- ...options,
277
- method: "POST",
278
- headers: {
279
- "Content-Type": "application/json",
280
- ...getHeaders(options?.headers),
281
- },
282
- body: JSON.stringify(createMapDto),
283
- });
284
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
285
- const data = body ? JSON.parse(body) : {};
286
- return data;
287
- };
288
- const getGetMutationStatusUrl = (workspaceId, operationId) => {
289
- return `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps/operations/${encodeURIComponent(String(operationId))}`;
290
- };
291
- const getMutationStatus = async (workspaceId, operationId, options, fetchFn) => {
292
- const res = await (fetchFn ?? fetch)(getGetMutationStatusUrl(workspaceId, operationId), {
293
- ...options,
294
- method: "GET",
295
- });
296
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
297
- const data = body ? JSON.parse(body) : {};
298
- return data;
299
- };
300
- const getGetMapUrl = (workspaceId, mapId) => {
301
- return `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps/${encodeURIComponent(String(mapId))}`;
302
- };
303
- const getMap = async (workspaceId, mapId, options, fetchFn) => {
304
- const res = await (fetchFn ?? fetch)(getGetMapUrl(workspaceId, mapId), {
305
- ...options,
306
- method: "GET",
307
- });
308
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
309
- const data = body ? JSON.parse(body) : {};
310
- return data;
311
- };
312
- const getSaveMapUrl = (workspaceId, mapId) => {
313
- return `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps/${encodeURIComponent(String(mapId))}/draft`;
314
- };
315
- const saveMap = async (workspaceId, mapId, saveMapDto, options, fetchFn) => {
316
- const getHeaders = (h) => {
317
- if (!h)
318
- return {};
319
- if (h instanceof Headers)
320
- return Object.fromEntries(h.entries());
321
- if (Symbol.iterator in h) {
322
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
323
- }
324
- const headers = {};
325
- for (const [name, value] of Object.entries(h)) {
326
- if (value !== undefined)
327
- headers[name] = value;
328
- }
329
- return headers;
330
- };
331
- const res = await (fetchFn ?? fetch)(getSaveMapUrl(workspaceId, mapId), {
332
- ...options,
333
- method: "PUT",
334
- headers: {
335
- "Content-Type": "application/json",
336
- ...getHeaders(options?.headers),
337
- },
338
- body: JSON.stringify(saveMapDto),
339
- });
340
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
341
- const data = body ? JSON.parse(body) : {};
342
- return data;
343
- };
344
- const getChangeMapUrl = (workspaceId, mapId) => {
345
- return `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps/${encodeURIComponent(String(mapId))}/actions`;
346
- };
347
- const changeMap = async (workspaceId, mapId, mapActionDto, options, fetchFn) => {
348
- const getHeaders = (h) => {
349
- if (!h)
350
- return {};
351
- if (h instanceof Headers)
352
- return Object.fromEntries(h.entries());
353
- if (Symbol.iterator in h) {
354
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
355
- }
356
- const headers = {};
357
- for (const [name, value] of Object.entries(h)) {
358
- if (value !== undefined)
359
- headers[name] = value;
360
- }
361
- return headers;
362
- };
363
- const res = await (fetchFn ?? fetch)(getChangeMapUrl(workspaceId, mapId), {
364
- ...options,
365
- method: "POST",
366
- headers: {
367
- "Content-Type": "application/json",
368
- ...getHeaders(options?.headers),
369
- },
370
- body: JSON.stringify(mapActionDto),
371
- });
372
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
373
- const data = body ? JSON.parse(body) : {};
374
- return data;
375
- };
376
- const getListMapRevisionsUrl = (workspaceId, mapId) => {
377
- return `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps/${encodeURIComponent(String(mapId))}/revisions`;
378
- };
379
- const listMapRevisions = async (workspaceId, mapId, options, fetchFn) => {
380
- const res = await (fetchFn ?? fetch)(getListMapRevisionsUrl(workspaceId, mapId), {
381
- ...options,
382
- method: "GET",
383
- });
384
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
385
- const data = body ? JSON.parse(body) : {};
386
- return data;
387
- };
388
- const getGetMapRevisionUrl = (workspaceId, mapId, revision) => {
389
- return `/v1/workspaces/${encodeURIComponent(String(workspaceId))}/maps/${encodeURIComponent(String(mapId))}/revisions/${encodeURIComponent(String(revision))}`;
390
- };
391
- const getMapRevision = async (workspaceId, mapId, revision, options, fetchFn) => {
392
- const res = await (fetchFn ?? fetch)(getGetMapRevisionUrl(workspaceId, mapId, revision), {
393
- ...options,
394
- method: "GET",
395
- });
396
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
397
- const data = body ? JSON.parse(body) : {};
398
- return data;
228
+ export class ArtworkClient {
229
+ configuration;
230
+ basePath;
231
+ operations;
232
+ constructor(configuration, basePath, axiosInstance = axios) {
233
+ this.configuration = configuration;
234
+ this.basePath = basePath;
235
+ this.operations = getSeatmapApi(axiosInstance);
236
+ }
237
+ async getArtworkLimits(workspaceId, options) {
238
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
239
+ return this.operations.getArtworkLimits(workspaceId, requestOptions);
240
+ }
241
+ async prepareArtworkUpload(workspaceId, prepareArtworkUploadDto, options) {
242
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST", prepareArtworkUploadDto);
243
+ return this.operations.prepareArtworkUpload(workspaceId, requestOptions.data instanceof ArrayBuffer ? requestOptions.data : prepareArtworkUploadDto, requestOptions);
244
+ }
245
+ async getArtworkUpload(workspaceId, uploadId, options) {
246
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "GET");
247
+ return this.operations.getArtworkUpload(workspaceId, uploadId, requestOptions);
248
+ }
249
+ async uploadArtworkContent(workspaceId, uploadId, uploadArtworkContentBody, options) {
250
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "PUT", uploadArtworkContentBody);
251
+ return this.operations.uploadArtworkContent(workspaceId, uploadId, requestOptions.data instanceof ArrayBuffer ? requestOptions.data : uploadArtworkContentBody, requestOptions);
252
+ }
253
+ async completeArtworkUpload(workspaceId, uploadId, options) {
254
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST");
255
+ return this.operations.completeArtworkUpload(workspaceId, uploadId, requestOptions);
256
+ }
257
+ async cancelArtworkUpload(workspaceId, uploadId, options) {
258
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST");
259
+ return this.operations.cancelArtworkUpload(workspaceId, uploadId, requestOptions);
260
+ }
261
+ async retryArtworkUpload(workspaceId, uploadId, retryArtworkUploadDto, options) {
262
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST", retryArtworkUploadDto);
263
+ return this.operations.retryArtworkUpload(workspaceId, uploadId, requestOptions.data instanceof ArrayBuffer ? requestOptions.data : retryArtworkUploadDto, requestOptions);
264
+ }
265
+ async getArtworkResources(workspaceId, artworkBatchDto, options) {
266
+ const requestOptions = await prepareRequestOptions(this.configuration, this.basePath, options, "POST", artworkBatchDto);
267
+ return this.operations.getArtworkResources(workspaceId, requestOptions.data instanceof ArrayBuffer ? requestOptions.data : artworkBatchDto, requestOptions);
268
+ }
269
+ }
270
+ const getSeatmapApi = (axiosInstance = axios) => {
271
+ const getLiveness = (options) => {
272
+ return axiosInstance.get(`/health`, options);
273
+ };
274
+ const getGetLivenessUrl = () => {
275
+ return axiosInstance
276
+ .create({
277
+ baseURL: "",
278
+ params: null,
279
+ })
280
+ .getUri({
281
+ url: `/health`,
282
+ baseURL: "",
283
+ });
284
+ };
285
+ const getIntegrationContext = (options) => {
286
+ return axiosInstance.get(`/auth/integration`, options);
287
+ };
288
+ const getGetIntegrationContextUrl = () => {
289
+ return axiosInstance
290
+ .create({
291
+ baseURL: "",
292
+ params: null,
293
+ })
294
+ .getUri({
295
+ url: `/auth/integration`,
296
+ baseURL: "",
297
+ });
298
+ };
299
+ const startLogin = (params, options) => {
300
+ return axiosInstance.get(`/auth/login`, {
301
+ ...options,
302
+ params: { ...params, ...options?.params },
303
+ });
304
+ };
305
+ const getStartLoginUrl = (params) => {
306
+ return axiosInstance
307
+ .create({
308
+ baseURL: "",
309
+ params: null,
310
+ })
311
+ .getUri({
312
+ url: `/auth/login`,
313
+ baseURL: "",
314
+ params,
315
+ });
316
+ };
317
+ const completeLogin = (options) => {
318
+ return axiosInstance.get(`/auth/callback`, options);
319
+ };
320
+ const getCompleteLoginUrl = () => {
321
+ return axiosInstance
322
+ .create({
323
+ baseURL: "",
324
+ params: null,
325
+ })
326
+ .getUri({
327
+ url: `/auth/callback`,
328
+ baseURL: "",
329
+ });
330
+ };
331
+ const logoutProvider = (options) => {
332
+ return axiosInstance.get(`/auth/logout/provider`, options);
333
+ };
334
+ const getLogoutProviderUrl = () => {
335
+ return axiosInstance
336
+ .create({
337
+ baseURL: "",
338
+ params: null,
339
+ })
340
+ .getUri({
341
+ url: `/auth/logout/provider`,
342
+ baseURL: "",
343
+ });
344
+ };
345
+ const getAuthoringSession = (options) => {
346
+ return axiosInstance.get(`/auth/authoring/session`, options);
347
+ };
348
+ const getGetAuthoringSessionUrl = () => {
349
+ return axiosInstance
350
+ .create({
351
+ baseURL: "",
352
+ params: null,
353
+ })
354
+ .getUri({
355
+ url: `/auth/authoring/session`,
356
+ baseURL: "",
357
+ });
358
+ };
359
+ const revokeAuthoringSession = (options) => {
360
+ return axiosInstance.delete(`/auth/authoring/session`, options);
361
+ };
362
+ const getRevokeAuthoringSessionUrl = () => {
363
+ return axiosInstance
364
+ .create({
365
+ baseURL: "",
366
+ params: null,
367
+ })
368
+ .getUri({
369
+ url: `/auth/authoring/session`,
370
+ baseURL: "",
371
+ });
372
+ };
373
+ const getEmbedContext = (mapId, options) => {
374
+ return axiosInstance.get(`/auth/embed/${encodeURIComponent(mapId)}`, options);
375
+ };
376
+ const getGetEmbedContextUrl = (mapId) => {
377
+ return axiosInstance
378
+ .create({
379
+ baseURL: "",
380
+ params: null,
381
+ })
382
+ .getUri({
383
+ url: `/auth/embed/${encodeURIComponent(mapId)}`,
384
+ baseURL: "",
385
+ });
386
+ };
387
+ const listMaps = (workspaceId, params, options) => {
388
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps`, {
389
+ ...options,
390
+ params: { ...params, ...options?.params },
391
+ });
392
+ };
393
+ const getListMapsUrl = (workspaceId, params) => {
394
+ return axiosInstance
395
+ .create({
396
+ baseURL: "",
397
+ params: null,
398
+ })
399
+ .getUri({
400
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps`,
401
+ baseURL: "",
402
+ params,
403
+ });
404
+ };
405
+ const createMap = (workspaceId, createMapDto, options) => {
406
+ return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/maps`, createMapDto, options);
407
+ };
408
+ const getCreateMapUrl = (workspaceId) => {
409
+ return axiosInstance
410
+ .create({
411
+ baseURL: "",
412
+ params: null,
413
+ })
414
+ .getUri({
415
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps`,
416
+ baseURL: "",
417
+ });
418
+ };
419
+ const getMapPreview = (workspaceId, mapId, params, options) => {
420
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/preview`, {
421
+ responseType: "blob",
422
+ ...options,
423
+ params: { ...params, ...options?.params },
424
+ });
425
+ };
426
+ const getGetMapPreviewUrl = (workspaceId, mapId, params) => {
427
+ return axiosInstance
428
+ .create({
429
+ baseURL: "",
430
+ params: null,
431
+ })
432
+ .getUri({
433
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/preview`,
434
+ baseURL: "",
435
+ params,
436
+ });
437
+ };
438
+ const getMutationStatus = (workspaceId, operationId, options) => {
439
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/operations/${encodeURIComponent(operationId)}`, options);
440
+ };
441
+ const getGetMutationStatusUrl = (workspaceId, operationId) => {
442
+ return axiosInstance
443
+ .create({
444
+ baseURL: "",
445
+ params: null,
446
+ })
447
+ .getUri({
448
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/operations/${encodeURIComponent(operationId)}`,
449
+ baseURL: "",
450
+ });
451
+ };
452
+ /**
453
+ * @summary Resolve a permanent map code within an authorized workspace
454
+ */
455
+ const resolveMapLink = (workspaceId, editorCode, options) => {
456
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/links/${encodeURIComponent(editorCode)}`, options);
457
+ };
458
+ const getResolveMapLinkUrl = (workspaceId, editorCode) => {
459
+ return axiosInstance
460
+ .create({
461
+ baseURL: "",
462
+ params: null,
463
+ })
464
+ .getUri({
465
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/links/${encodeURIComponent(editorCode)}`,
466
+ baseURL: "",
467
+ });
468
+ };
469
+ /**
470
+ * @summary Get a map's permanent editor link
471
+ */
472
+ const getMapLink = (workspaceId, mapId, options) => {
473
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/link`, options);
474
+ };
475
+ const getGetMapLinkUrl = (workspaceId, mapId) => {
476
+ return axiosInstance
477
+ .create({
478
+ baseURL: "",
479
+ params: null,
480
+ })
481
+ .getUri({
482
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/link`,
483
+ baseURL: "",
484
+ });
485
+ };
486
+ const getMap = (workspaceId, mapId, options) => {
487
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}`, options);
488
+ };
489
+ const getGetMapUrl = (workspaceId, mapId) => {
490
+ return axiosInstance
491
+ .create({
492
+ baseURL: "",
493
+ params: null,
494
+ })
495
+ .getUri({
496
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}`,
497
+ baseURL: "",
498
+ });
499
+ };
500
+ const saveMap = (workspaceId, mapId, saveMapDto, options) => {
501
+ return axiosInstance.put(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/draft`, saveMapDto, options);
502
+ };
503
+ const getSaveMapUrl = (workspaceId, mapId) => {
504
+ return axiosInstance
505
+ .create({
506
+ baseURL: "",
507
+ params: null,
508
+ })
509
+ .getUri({
510
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/draft`,
511
+ baseURL: "",
512
+ });
513
+ };
514
+ const changeMap = (workspaceId, mapId, mapActionDto, options) => {
515
+ return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/actions`, mapActionDto, options);
516
+ };
517
+ const getChangeMapUrl = (workspaceId, mapId) => {
518
+ return axiosInstance
519
+ .create({
520
+ baseURL: "",
521
+ params: null,
522
+ })
523
+ .getUri({
524
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/actions`,
525
+ baseURL: "",
526
+ });
527
+ };
528
+ const listMapRevisions = (workspaceId, mapId, options) => {
529
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/revisions`, options);
530
+ };
531
+ const getListMapRevisionsUrl = (workspaceId, mapId) => {
532
+ return axiosInstance
533
+ .create({
534
+ baseURL: "",
535
+ params: null,
536
+ })
537
+ .getUri({
538
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/revisions`,
539
+ baseURL: "",
540
+ });
541
+ };
542
+ const getMapRevision = (workspaceId, mapId, revision, options) => {
543
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/revisions/${encodeURIComponent(revision)}`, options);
544
+ };
545
+ const getGetMapRevisionUrl = (workspaceId, mapId, revision) => {
546
+ return axiosInstance
547
+ .create({
548
+ baseURL: "",
549
+ params: null,
550
+ })
551
+ .getUri({
552
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/maps/${encodeURIComponent(mapId)}/revisions/${encodeURIComponent(revision)}`,
553
+ baseURL: "",
554
+ });
555
+ };
556
+ const getArtworkLimits = (workspaceId, options) => {
557
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/artwork/limits`, options);
558
+ };
559
+ const getGetArtworkLimitsUrl = (workspaceId) => {
560
+ return axiosInstance
561
+ .create({
562
+ baseURL: "",
563
+ params: null,
564
+ })
565
+ .getUri({
566
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/artwork/limits`,
567
+ baseURL: "",
568
+ });
569
+ };
570
+ const prepareArtworkUpload = (workspaceId, prepareArtworkUploadDto, options) => {
571
+ return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads`, prepareArtworkUploadDto, options);
572
+ };
573
+ const getPrepareArtworkUploadUrl = (workspaceId) => {
574
+ return axiosInstance
575
+ .create({
576
+ baseURL: "",
577
+ params: null,
578
+ })
579
+ .getUri({
580
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads`,
581
+ baseURL: "",
582
+ });
583
+ };
584
+ const getArtworkUpload = (workspaceId, uploadId, options) => {
585
+ return axiosInstance.get(`/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}`, options);
586
+ };
587
+ const getGetArtworkUploadUrl = (workspaceId, uploadId) => {
588
+ return axiosInstance
589
+ .create({
590
+ baseURL: "",
591
+ params: null,
592
+ })
593
+ .getUri({
594
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}`,
595
+ baseURL: "",
596
+ });
597
+ };
598
+ const uploadArtworkContent = (workspaceId, uploadId, uploadArtworkContentBody, options) => {
599
+ return axiosInstance.put(`/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}/content`, uploadArtworkContentBody, options);
600
+ };
601
+ const getUploadArtworkContentUrl = (workspaceId, uploadId) => {
602
+ return axiosInstance
603
+ .create({
604
+ baseURL: "",
605
+ params: null,
606
+ })
607
+ .getUri({
608
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}/content`,
609
+ baseURL: "",
610
+ });
611
+ };
612
+ const completeArtworkUpload = (workspaceId, uploadId, options) => {
613
+ return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}/complete`, undefined, options);
614
+ };
615
+ const getCompleteArtworkUploadUrl = (workspaceId, uploadId) => {
616
+ return axiosInstance
617
+ .create({
618
+ baseURL: "",
619
+ params: null,
620
+ })
621
+ .getUri({
622
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}/complete`,
623
+ baseURL: "",
624
+ });
625
+ };
626
+ const cancelArtworkUpload = (workspaceId, uploadId, options) => {
627
+ return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}/cancel`, undefined, options);
628
+ };
629
+ const getCancelArtworkUploadUrl = (workspaceId, uploadId) => {
630
+ return axiosInstance
631
+ .create({
632
+ baseURL: "",
633
+ params: null,
634
+ })
635
+ .getUri({
636
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}/cancel`,
637
+ baseURL: "",
638
+ });
639
+ };
640
+ const retryArtworkUpload = (workspaceId, uploadId, retryArtworkUploadDto, options) => {
641
+ return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}/retry`, retryArtworkUploadDto, options);
642
+ };
643
+ const getRetryArtworkUploadUrl = (workspaceId, uploadId) => {
644
+ return axiosInstance
645
+ .create({
646
+ baseURL: "",
647
+ params: null,
648
+ })
649
+ .getUri({
650
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/artwork/uploads/${encodeURIComponent(uploadId)}/retry`,
651
+ baseURL: "",
652
+ });
653
+ };
654
+ const getArtworkResources = (workspaceId, artworkBatchDto, options) => {
655
+ return axiosInstance.post(`/workspaces/${encodeURIComponent(workspaceId)}/artwork/resources`, artworkBatchDto, options);
656
+ };
657
+ const getGetArtworkResourcesUrl = (workspaceId) => {
658
+ return axiosInstance
659
+ .create({
660
+ baseURL: "",
661
+ params: null,
662
+ })
663
+ .getUri({
664
+ url: `/workspaces/${encodeURIComponent(workspaceId)}/artwork/resources`,
665
+ baseURL: "",
666
+ });
667
+ };
668
+ return {
669
+ getLiveness,
670
+ getIntegrationContext,
671
+ startLogin,
672
+ completeLogin,
673
+ logoutProvider,
674
+ getAuthoringSession,
675
+ revokeAuthoringSession,
676
+ getEmbedContext,
677
+ listMaps,
678
+ createMap,
679
+ getMapPreview,
680
+ getMutationStatus,
681
+ resolveMapLink,
682
+ getMapLink,
683
+ getMap,
684
+ saveMap,
685
+ changeMap,
686
+ listMapRevisions,
687
+ getMapRevision,
688
+ getArtworkLimits,
689
+ prepareArtworkUpload,
690
+ getArtworkUpload,
691
+ uploadArtworkContent,
692
+ completeArtworkUpload,
693
+ cancelArtworkUpload,
694
+ retryArtworkUpload,
695
+ getArtworkResources,
696
+ getGetLivenessUrl,
697
+ getGetIntegrationContextUrl,
698
+ getStartLoginUrl,
699
+ getCompleteLoginUrl,
700
+ getLogoutProviderUrl,
701
+ getGetAuthoringSessionUrl,
702
+ getRevokeAuthoringSessionUrl,
703
+ getGetEmbedContextUrl,
704
+ getListMapsUrl,
705
+ getCreateMapUrl,
706
+ getGetMapPreviewUrl,
707
+ getGetMutationStatusUrl,
708
+ getResolveMapLinkUrl,
709
+ getGetMapLinkUrl,
710
+ getGetMapUrl,
711
+ getSaveMapUrl,
712
+ getChangeMapUrl,
713
+ getListMapRevisionsUrl,
714
+ getGetMapRevisionUrl,
715
+ getGetArtworkLimitsUrl,
716
+ getPrepareArtworkUploadUrl,
717
+ getGetArtworkUploadUrl,
718
+ getUploadArtworkContentUrl,
719
+ getCompleteArtworkUploadUrl,
720
+ getCancelArtworkUploadUrl,
721
+ getRetryArtworkUploadUrl,
722
+ getGetArtworkResourcesUrl,
723
+ };
399
724
  };