@seatmap-fyi/api-client 0.1.0-alpha.1 → 0.1.0-alpha.11

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