@sokol111/ecommerce-image-service-api 1.0.2 → 1.0.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/api.js CHANGED
@@ -2,9 +2,9 @@
2
2
  /* eslint-disable */
3
3
  /**
4
4
  * Image Service API
5
- * API for image management in an e-commerce system using the **Draft → Promote** pattern. Responsibilities: - Generate presigned URLs for direct PUT uploads to MinIO/S3. - Confirm uploads and persist image metadata to the database. - Promote/attach images from a product draft to a final product. - Read/update/delete image metadata. - Generate signed delivery URLs for imgproxy. Notes: - No authentication is configured yet (public API for now). Add auth later when ready. - Idempotency is supported via the `Idempotency-Key` header for POST/DELETE operations.
5
+ * API for managing images
6
6
  *
7
- * The version of the OpenAPI document: 1.0.2
7
+ * The version of the OpenAPI document: 1.0.5
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -72,183 +72,52 @@ export const PresignRequestContentTypeEnum = {
72
72
  ImageAvif: 'image/avif'
73
73
  };
74
74
  /**
75
- * DeliveryApi - axios parameter creator
75
+ * DefaultApi - axios parameter creator
76
76
  * @export
77
77
  */
78
- export const DeliveryApiAxiosParamCreator = function (configuration) {
78
+ export const DefaultApiAxiosParamCreator = function (configuration) {
79
79
  return {
80
80
  /**
81
81
  *
82
- * @summary Generate a signed imgproxy URL for delivery with requested params
83
- * @param {string} id
84
- * @param {string} [variant]
85
- * @param {number} [w]
86
- * @param {number} [h]
87
- * @param {GetDeliveryUrlFitEnum} [fit]
88
- * @param {GetDeliveryUrlFormatEnum} [format]
89
- * @param {number} [quality]
90
- * @param {number} [dpr]
91
- * @param {number} [ttlSeconds]
82
+ * @summary Confirm upload (HEAD against S3), persist metadata
83
+ * @param {ConfirmRequest} confirmRequest
92
84
  * @param {*} [options] Override http request option.
93
85
  * @throws {RequiredError}
94
86
  */
95
- getDeliveryUrl: (id_1, variant_1, w_1, h_1, fit_1, format_1, quality_1, dpr_1, ttlSeconds_1, ...args_1) => __awaiter(this, [id_1, variant_1, w_1, h_1, fit_1, format_1, quality_1, dpr_1, ttlSeconds_1, ...args_1], void 0, function* (id, variant, w, h, fit, format, quality, dpr, ttlSeconds, options = {}) {
96
- // verify required parameter 'id' is not null or undefined
97
- assertParamExists('getDeliveryUrl', 'id', id);
98
- const localVarPath = `/images/{id}/url`
99
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
87
+ confirmUpload: (confirmRequest_1, ...args_1) => __awaiter(this, [confirmRequest_1, ...args_1], void 0, function* (confirmRequest, options = {}) {
88
+ // verify required parameter 'confirmRequest' is not null or undefined
89
+ assertParamExists('confirmUpload', 'confirmRequest', confirmRequest);
90
+ const localVarPath = `/images/confirm`;
100
91
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
101
92
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
102
93
  let baseOptions;
103
94
  if (configuration) {
104
95
  baseOptions = configuration.baseOptions;
105
96
  }
106
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
97
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
107
98
  const localVarHeaderParameter = {};
108
99
  const localVarQueryParameter = {};
109
- if (variant !== undefined) {
110
- localVarQueryParameter['variant'] = variant;
111
- }
112
- if (w !== undefined) {
113
- localVarQueryParameter['w'] = w;
114
- }
115
- if (h !== undefined) {
116
- localVarQueryParameter['h'] = h;
117
- }
118
- if (fit !== undefined) {
119
- localVarQueryParameter['fit'] = fit;
120
- }
121
- if (format !== undefined) {
122
- localVarQueryParameter['format'] = format;
123
- }
124
- if (quality !== undefined) {
125
- localVarQueryParameter['quality'] = quality;
126
- }
127
- if (dpr !== undefined) {
128
- localVarQueryParameter['dpr'] = dpr;
129
- }
130
- if (ttlSeconds !== undefined) {
131
- localVarQueryParameter['ttlSeconds'] = ttlSeconds;
132
- }
100
+ localVarHeaderParameter['Content-Type'] = 'application/json';
133
101
  setSearchParams(localVarUrlObj, localVarQueryParameter);
134
102
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
135
103
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
104
+ localVarRequestOptions.data = serializeDataIfNeeded(confirmRequest, localVarRequestOptions, configuration);
136
105
  return {
137
106
  url: toPathString(localVarUrlObj),
138
107
  options: localVarRequestOptions,
139
108
  };
140
109
  }),
141
- };
142
- };
143
- /**
144
- * DeliveryApi - functional programming interface
145
- * @export
146
- */
147
- export const DeliveryApiFp = function (configuration) {
148
- const localVarAxiosParamCreator = DeliveryApiAxiosParamCreator(configuration);
149
- return {
150
- /**
151
- *
152
- * @summary Generate a signed imgproxy URL for delivery with requested params
153
- * @param {string} id
154
- * @param {string} [variant]
155
- * @param {number} [w]
156
- * @param {number} [h]
157
- * @param {GetDeliveryUrlFitEnum} [fit]
158
- * @param {GetDeliveryUrlFormatEnum} [format]
159
- * @param {number} [quality]
160
- * @param {number} [dpr]
161
- * @param {number} [ttlSeconds]
162
- * @param {*} [options] Override http request option.
163
- * @throws {RequiredError}
164
- */
165
- getDeliveryUrl(id, variant, w, h, fit, format, quality, dpr, ttlSeconds, options) {
166
- return __awaiter(this, void 0, void 0, function* () {
167
- var _a, _b, _c;
168
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDeliveryUrl(id, variant, w, h, fit, format, quality, dpr, ttlSeconds, options);
169
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
170
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DeliveryApi.getDeliveryUrl']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
171
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
172
- });
173
- },
174
- };
175
- };
176
- /**
177
- * DeliveryApi - factory interface
178
- * @export
179
- */
180
- export const DeliveryApiFactory = function (configuration, basePath, axios) {
181
- const localVarFp = DeliveryApiFp(configuration);
182
- return {
183
- /**
184
- *
185
- * @summary Generate a signed imgproxy URL for delivery with requested params
186
- * @param {DeliveryApiGetDeliveryUrlRequest} requestParameters Request parameters.
187
- * @param {*} [options] Override http request option.
188
- * @throws {RequiredError}
189
- */
190
- getDeliveryUrl(requestParameters, options) {
191
- return localVarFp.getDeliveryUrl(requestParameters.id, requestParameters.variant, requestParameters.w, requestParameters.h, requestParameters.fit, requestParameters.format, requestParameters.quality, requestParameters.dpr, requestParameters.ttlSeconds, options).then((request) => request(axios, basePath));
192
- },
193
- };
194
- };
195
- /**
196
- * DeliveryApi - object-oriented interface
197
- * @export
198
- * @class DeliveryApi
199
- * @extends {BaseAPI}
200
- */
201
- export class DeliveryApi extends BaseAPI {
202
- /**
203
- *
204
- * @summary Generate a signed imgproxy URL for delivery with requested params
205
- * @param {DeliveryApiGetDeliveryUrlRequest} requestParameters Request parameters.
206
- * @param {*} [options] Override http request option.
207
- * @throws {RequiredError}
208
- * @memberof DeliveryApi
209
- */
210
- getDeliveryUrl(requestParameters, options) {
211
- return DeliveryApiFp(this.configuration).getDeliveryUrl(requestParameters.id, requestParameters.variant, requestParameters.w, requestParameters.h, requestParameters.fit, requestParameters.format, requestParameters.quality, requestParameters.dpr, requestParameters.ttlSeconds, options).then((request) => request(this.axios, this.basePath));
212
- }
213
- }
214
- /**
215
- * @export
216
- */
217
- export const GetDeliveryUrlFitEnum = {
218
- Cover: 'cover',
219
- Contain: 'contain',
220
- Fill: 'fill',
221
- Inside: 'inside',
222
- Outside: 'outside'
223
- };
224
- /**
225
- * @export
226
- */
227
- export const GetDeliveryUrlFormatEnum = {
228
- Original: 'original',
229
- Webp: 'webp',
230
- Avif: 'avif',
231
- Jpeg: 'jpeg',
232
- Png: 'png'
233
- };
234
- /**
235
- * ImagesApi - axios parameter creator
236
- * @export
237
- */
238
- export const ImagesApiAxiosParamCreator = function (configuration) {
239
- return {
240
110
  /**
241
111
  *
242
- * @summary Confirm upload (HEAD against S3), persist metadata
243
- * @param {ConfirmRequest} confirmRequest
244
- * @param {string} [idempotencyKey] Idempotency key for safe retries.
112
+ * @summary Create a presigned PUT URL for uploading an image to MinIO/S3
113
+ * @param {PresignRequest} presignRequest
245
114
  * @param {*} [options] Override http request option.
246
115
  * @throws {RequiredError}
247
116
  */
248
- confirmUpload: (confirmRequest_1, idempotencyKey_1, ...args_1) => __awaiter(this, [confirmRequest_1, idempotencyKey_1, ...args_1], void 0, function* (confirmRequest, idempotencyKey, options = {}) {
249
- // verify required parameter 'confirmRequest' is not null or undefined
250
- assertParamExists('confirmUpload', 'confirmRequest', confirmRequest);
251
- const localVarPath = `/images/confirm`;
117
+ createPresign: (presignRequest_1, ...args_1) => __awaiter(this, [presignRequest_1, ...args_1], void 0, function* (presignRequest, options = {}) {
118
+ // verify required parameter 'presignRequest' is not null or undefined
119
+ assertParamExists('createPresign', 'presignRequest', presignRequest);
120
+ const localVarPath = `/images/presign`;
252
121
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
253
122
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
254
123
  let baseOptions;
@@ -259,13 +128,10 @@ export const ImagesApiAxiosParamCreator = function (configuration) {
259
128
  const localVarHeaderParameter = {};
260
129
  const localVarQueryParameter = {};
261
130
  localVarHeaderParameter['Content-Type'] = 'application/json';
262
- if (idempotencyKey != null) {
263
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
264
- }
265
131
  setSearchParams(localVarUrlObj, localVarQueryParameter);
266
132
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
267
133
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
268
- localVarRequestOptions.data = serializeDataIfNeeded(confirmRequest, localVarRequestOptions, configuration);
134
+ localVarRequestOptions.data = serializeDataIfNeeded(presignRequest, localVarRequestOptions, configuration);
269
135
  return {
270
136
  url: toPathString(localVarUrlObj),
271
137
  options: localVarRequestOptions,
@@ -304,6 +170,67 @@ export const ImagesApiAxiosParamCreator = function (configuration) {
304
170
  options: localVarRequestOptions,
305
171
  };
306
172
  }),
173
+ /**
174
+ *
175
+ * @summary Generate a signed imgproxy URL for delivery with requested params
176
+ * @param {string} id
177
+ * @param {string} [variant]
178
+ * @param {number} [w]
179
+ * @param {number} [h]
180
+ * @param {GetDeliveryUrlFitEnum} [fit]
181
+ * @param {GetDeliveryUrlFormatEnum} [format]
182
+ * @param {number} [quality]
183
+ * @param {number} [dpr]
184
+ * @param {number} [ttlSeconds]
185
+ * @param {*} [options] Override http request option.
186
+ * @throws {RequiredError}
187
+ */
188
+ getDeliveryUrl: (id_1, variant_1, w_1, h_1, fit_1, format_1, quality_1, dpr_1, ttlSeconds_1, ...args_1) => __awaiter(this, [id_1, variant_1, w_1, h_1, fit_1, format_1, quality_1, dpr_1, ttlSeconds_1, ...args_1], void 0, function* (id, variant, w, h, fit, format, quality, dpr, ttlSeconds, options = {}) {
189
+ // verify required parameter 'id' is not null or undefined
190
+ assertParamExists('getDeliveryUrl', 'id', id);
191
+ const localVarPath = `/images/{id}/url`
192
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
193
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
194
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
195
+ let baseOptions;
196
+ if (configuration) {
197
+ baseOptions = configuration.baseOptions;
198
+ }
199
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
200
+ const localVarHeaderParameter = {};
201
+ const localVarQueryParameter = {};
202
+ if (variant !== undefined) {
203
+ localVarQueryParameter['variant'] = variant;
204
+ }
205
+ if (w !== undefined) {
206
+ localVarQueryParameter['w'] = w;
207
+ }
208
+ if (h !== undefined) {
209
+ localVarQueryParameter['h'] = h;
210
+ }
211
+ if (fit !== undefined) {
212
+ localVarQueryParameter['fit'] = fit;
213
+ }
214
+ if (format !== undefined) {
215
+ localVarQueryParameter['format'] = format;
216
+ }
217
+ if (quality !== undefined) {
218
+ localVarQueryParameter['quality'] = quality;
219
+ }
220
+ if (dpr !== undefined) {
221
+ localVarQueryParameter['dpr'] = dpr;
222
+ }
223
+ if (ttlSeconds !== undefined) {
224
+ localVarQueryParameter['ttlSeconds'] = ttlSeconds;
225
+ }
226
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
227
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
228
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
229
+ return {
230
+ url: toPathString(localVarUrlObj),
231
+ options: localVarRequestOptions,
232
+ };
233
+ }),
307
234
  /**
308
235
  *
309
236
  * @summary Get image metadata
@@ -380,80 +307,209 @@ export const ImagesApiAxiosParamCreator = function (configuration) {
380
307
  }),
381
308
  /**
382
309
  *
383
- * @summary Update image metadata (alt, role, order)
384
- * @param {string} id
385
- * @param {ImagePatch} imagePatch
310
+ * @summary Trigger (or retry) variant generation for an image
311
+ * @param {ProcessImageRequest} processImageRequest
386
312
  * @param {*} [options] Override http request option.
387
313
  * @throws {RequiredError}
388
314
  */
389
- updateImage: (id_1, imagePatch_1, ...args_1) => __awaiter(this, [id_1, imagePatch_1, ...args_1], void 0, function* (id, imagePatch, options = {}) {
390
- // verify required parameter 'id' is not null or undefined
391
- assertParamExists('updateImage', 'id', id);
392
- // verify required parameter 'imagePatch' is not null or undefined
393
- assertParamExists('updateImage', 'imagePatch', imagePatch);
394
- const localVarPath = `/images/{id}`
395
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
315
+ processImage: (processImageRequest_1, ...args_1) => __awaiter(this, [processImageRequest_1, ...args_1], void 0, function* (processImageRequest, options = {}) {
316
+ // verify required parameter 'processImageRequest' is not null or undefined
317
+ assertParamExists('processImage', 'processImageRequest', processImageRequest);
318
+ const localVarPath = `/internal/images/process`;
396
319
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
397
320
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
398
321
  let baseOptions;
399
322
  if (configuration) {
400
323
  baseOptions = configuration.baseOptions;
401
324
  }
402
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
325
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
403
326
  const localVarHeaderParameter = {};
404
327
  const localVarQueryParameter = {};
405
328
  localVarHeaderParameter['Content-Type'] = 'application/json';
406
329
  setSearchParams(localVarUrlObj, localVarQueryParameter);
407
330
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
408
331
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
409
- localVarRequestOptions.data = serializeDataIfNeeded(imagePatch, localVarRequestOptions, configuration);
332
+ localVarRequestOptions.data = serializeDataIfNeeded(processImageRequest, localVarRequestOptions, configuration);
410
333
  return {
411
334
  url: toPathString(localVarUrlObj),
412
335
  options: localVarRequestOptions,
413
336
  };
414
337
  }),
415
- };
416
- };
417
- /**
418
- * ImagesApi - functional programming interface
419
- * @export
420
- */
421
- export const ImagesApiFp = function (configuration) {
422
- const localVarAxiosParamCreator = ImagesApiAxiosParamCreator(configuration);
423
- return {
424
- /**
425
- *
426
- * @summary Confirm upload (HEAD against S3), persist metadata
427
- * @param {ConfirmRequest} confirmRequest
428
- * @param {string} [idempotencyKey] Idempotency key for safe retries.
429
- * @param {*} [options] Override http request option.
430
- * @throws {RequiredError}
431
- */
432
- confirmUpload(confirmRequest, idempotencyKey, options) {
433
- return __awaiter(this, void 0, void 0, function* () {
434
- var _a, _b, _c;
435
- const localVarAxiosArgs = yield localVarAxiosParamCreator.confirmUpload(confirmRequest, idempotencyKey, options);
436
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
437
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.confirmUpload']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
438
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
439
- });
440
- },
441
338
  /**
442
339
  *
443
- * @summary Delete image (soft or hard, per policy)
444
- * @param {string} id
445
- * @param {boolean} [hard]
340
+ * @summary Promote images from a product draft to a final product
341
+ * @param {PromoteRequest} promoteRequest
446
342
  * @param {*} [options] Override http request option.
447
343
  * @throws {RequiredError}
448
344
  */
449
- deleteImage(id, hard, options) {
450
- return __awaiter(this, void 0, void 0, function* () {
451
- var _a, _b, _c;
452
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteImage(id, hard, options);
453
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
454
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.deleteImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
455
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
456
- });
345
+ promoteImages: (promoteRequest_1, ...args_1) => __awaiter(this, [promoteRequest_1, ...args_1], void 0, function* (promoteRequest, options = {}) {
346
+ // verify required parameter 'promoteRequest' is not null or undefined
347
+ assertParamExists('promoteImages', 'promoteRequest', promoteRequest);
348
+ const localVarPath = `/images/promote`;
349
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
350
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
351
+ let baseOptions;
352
+ if (configuration) {
353
+ baseOptions = configuration.baseOptions;
354
+ }
355
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
356
+ const localVarHeaderParameter = {};
357
+ const localVarQueryParameter = {};
358
+ localVarHeaderParameter['Content-Type'] = 'application/json';
359
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
360
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
361
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
362
+ localVarRequestOptions.data = serializeDataIfNeeded(promoteRequest, localVarRequestOptions, configuration);
363
+ return {
364
+ url: toPathString(localVarUrlObj),
365
+ options: localVarRequestOptions,
366
+ };
367
+ }),
368
+ /**
369
+ *
370
+ * @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
371
+ * @param {{ [key: string]: any; }} requestBody
372
+ * @param {*} [options] Override http request option.
373
+ * @throws {RequiredError}
374
+ */
375
+ s3Webhook: (requestBody_1, ...args_1) => __awaiter(this, [requestBody_1, ...args_1], void 0, function* (requestBody, options = {}) {
376
+ // verify required parameter 'requestBody' is not null or undefined
377
+ assertParamExists('s3Webhook', 'requestBody', requestBody);
378
+ const localVarPath = `/internal/webhook/s3`;
379
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
380
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
381
+ let baseOptions;
382
+ if (configuration) {
383
+ baseOptions = configuration.baseOptions;
384
+ }
385
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
386
+ const localVarHeaderParameter = {};
387
+ const localVarQueryParameter = {};
388
+ localVarHeaderParameter['Content-Type'] = 'application/json';
389
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
390
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
391
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
392
+ localVarRequestOptions.data = serializeDataIfNeeded(requestBody, localVarRequestOptions, configuration);
393
+ return {
394
+ url: toPathString(localVarUrlObj),
395
+ options: localVarRequestOptions,
396
+ };
397
+ }),
398
+ /**
399
+ *
400
+ * @summary Update image metadata (alt, role, order)
401
+ * @param {string} id
402
+ * @param {ImagePatch} imagePatch
403
+ * @param {*} [options] Override http request option.
404
+ * @throws {RequiredError}
405
+ */
406
+ updateImage: (id_1, imagePatch_1, ...args_1) => __awaiter(this, [id_1, imagePatch_1, ...args_1], void 0, function* (id, imagePatch, options = {}) {
407
+ // verify required parameter 'id' is not null or undefined
408
+ assertParamExists('updateImage', 'id', id);
409
+ // verify required parameter 'imagePatch' is not null or undefined
410
+ assertParamExists('updateImage', 'imagePatch', imagePatch);
411
+ const localVarPath = `/images/{id}`
412
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
413
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
414
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
415
+ let baseOptions;
416
+ if (configuration) {
417
+ baseOptions = configuration.baseOptions;
418
+ }
419
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
420
+ const localVarHeaderParameter = {};
421
+ const localVarQueryParameter = {};
422
+ localVarHeaderParameter['Content-Type'] = 'application/json';
423
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
424
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
425
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
426
+ localVarRequestOptions.data = serializeDataIfNeeded(imagePatch, localVarRequestOptions, configuration);
427
+ return {
428
+ url: toPathString(localVarUrlObj),
429
+ options: localVarRequestOptions,
430
+ };
431
+ }),
432
+ };
433
+ };
434
+ /**
435
+ * DefaultApi - functional programming interface
436
+ * @export
437
+ */
438
+ export const DefaultApiFp = function (configuration) {
439
+ const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration);
440
+ return {
441
+ /**
442
+ *
443
+ * @summary Confirm upload (HEAD against S3), persist metadata
444
+ * @param {ConfirmRequest} confirmRequest
445
+ * @param {*} [options] Override http request option.
446
+ * @throws {RequiredError}
447
+ */
448
+ confirmUpload(confirmRequest, options) {
449
+ return __awaiter(this, void 0, void 0, function* () {
450
+ var _a, _b, _c;
451
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.confirmUpload(confirmRequest, options);
452
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
453
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.confirmUpload']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
454
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
455
+ });
456
+ },
457
+ /**
458
+ *
459
+ * @summary Create a presigned PUT URL for uploading an image to MinIO/S3
460
+ * @param {PresignRequest} presignRequest
461
+ * @param {*} [options] Override http request option.
462
+ * @throws {RequiredError}
463
+ */
464
+ createPresign(presignRequest, options) {
465
+ return __awaiter(this, void 0, void 0, function* () {
466
+ var _a, _b, _c;
467
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createPresign(presignRequest, options);
468
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
469
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.createPresign']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
470
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
471
+ });
472
+ },
473
+ /**
474
+ *
475
+ * @summary Delete image (soft or hard, per policy)
476
+ * @param {string} id
477
+ * @param {boolean} [hard]
478
+ * @param {*} [options] Override http request option.
479
+ * @throws {RequiredError}
480
+ */
481
+ deleteImage(id, hard, options) {
482
+ return __awaiter(this, void 0, void 0, function* () {
483
+ var _a, _b, _c;
484
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteImage(id, hard, options);
485
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
486
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.deleteImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
487
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
488
+ });
489
+ },
490
+ /**
491
+ *
492
+ * @summary Generate a signed imgproxy URL for delivery with requested params
493
+ * @param {string} id
494
+ * @param {string} [variant]
495
+ * @param {number} [w]
496
+ * @param {number} [h]
497
+ * @param {GetDeliveryUrlFitEnum} [fit]
498
+ * @param {GetDeliveryUrlFormatEnum} [format]
499
+ * @param {number} [quality]
500
+ * @param {number} [dpr]
501
+ * @param {number} [ttlSeconds]
502
+ * @param {*} [options] Override http request option.
503
+ * @throws {RequiredError}
504
+ */
505
+ getDeliveryUrl(id, variant, w, h, fit, format, quality, dpr, ttlSeconds, options) {
506
+ return __awaiter(this, void 0, void 0, function* () {
507
+ var _a, _b, _c;
508
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getDeliveryUrl(id, variant, w, h, fit, format, quality, dpr, ttlSeconds, options);
509
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
510
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.getDeliveryUrl']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
511
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
512
+ });
457
513
  },
458
514
  /**
459
515
  *
@@ -467,7 +523,7 @@ export const ImagesApiFp = function (configuration) {
467
523
  var _a, _b, _c;
468
524
  const localVarAxiosArgs = yield localVarAxiosParamCreator.getImage(id, options);
469
525
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
470
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.getImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
526
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.getImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
471
527
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
472
528
  });
473
529
  },
@@ -487,7 +543,55 @@ export const ImagesApiFp = function (configuration) {
487
543
  var _a, _b, _c;
488
544
  const localVarAxiosArgs = yield localVarAxiosParamCreator.listImages(ownerType, ownerId, status, page, pageSize, options);
489
545
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
490
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.listImages']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
546
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.listImages']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
547
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
548
+ });
549
+ },
550
+ /**
551
+ *
552
+ * @summary Trigger (or retry) variant generation for an image
553
+ * @param {ProcessImageRequest} processImageRequest
554
+ * @param {*} [options] Override http request option.
555
+ * @throws {RequiredError}
556
+ */
557
+ processImage(processImageRequest, options) {
558
+ return __awaiter(this, void 0, void 0, function* () {
559
+ var _a, _b, _c;
560
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.processImage(processImageRequest, options);
561
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
562
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.processImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
563
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
564
+ });
565
+ },
566
+ /**
567
+ *
568
+ * @summary Promote images from a product draft to a final product
569
+ * @param {PromoteRequest} promoteRequest
570
+ * @param {*} [options] Override http request option.
571
+ * @throws {RequiredError}
572
+ */
573
+ promoteImages(promoteRequest, options) {
574
+ return __awaiter(this, void 0, void 0, function* () {
575
+ var _a, _b, _c;
576
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.promoteImages(promoteRequest, options);
577
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
578
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.promoteImages']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
579
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
580
+ });
581
+ },
582
+ /**
583
+ *
584
+ * @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
585
+ * @param {{ [key: string]: any; }} requestBody
586
+ * @param {*} [options] Override http request option.
587
+ * @throws {RequiredError}
588
+ */
589
+ s3Webhook(requestBody, options) {
590
+ return __awaiter(this, void 0, void 0, function* () {
591
+ var _a, _b, _c;
592
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.s3Webhook(requestBody, options);
593
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
594
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.s3Webhook']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
491
595
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
492
596
  });
493
597
  },
@@ -504,43 +608,63 @@ export const ImagesApiFp = function (configuration) {
504
608
  var _a, _b, _c;
505
609
  const localVarAxiosArgs = yield localVarAxiosParamCreator.updateImage(id, imagePatch, options);
506
610
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
507
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.updateImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
611
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DefaultApi.updateImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
508
612
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
509
613
  });
510
614
  },
511
615
  };
512
616
  };
513
617
  /**
514
- * ImagesApi - factory interface
618
+ * DefaultApi - factory interface
515
619
  * @export
516
620
  */
517
- export const ImagesApiFactory = function (configuration, basePath, axios) {
518
- const localVarFp = ImagesApiFp(configuration);
621
+ export const DefaultApiFactory = function (configuration, basePath, axios) {
622
+ const localVarFp = DefaultApiFp(configuration);
519
623
  return {
520
624
  /**
521
625
  *
522
626
  * @summary Confirm upload (HEAD against S3), persist metadata
523
- * @param {ImagesApiConfirmUploadRequest} requestParameters Request parameters.
627
+ * @param {DefaultApiConfirmUploadRequest} requestParameters Request parameters.
524
628
  * @param {*} [options] Override http request option.
525
629
  * @throws {RequiredError}
526
630
  */
527
631
  confirmUpload(requestParameters, options) {
528
- return localVarFp.confirmUpload(requestParameters.confirmRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath));
632
+ return localVarFp.confirmUpload(requestParameters.confirmRequest, options).then((request) => request(axios, basePath));
633
+ },
634
+ /**
635
+ *
636
+ * @summary Create a presigned PUT URL for uploading an image to MinIO/S3
637
+ * @param {DefaultApiCreatePresignRequest} requestParameters Request parameters.
638
+ * @param {*} [options] Override http request option.
639
+ * @throws {RequiredError}
640
+ */
641
+ createPresign(requestParameters, options) {
642
+ return localVarFp.createPresign(requestParameters.presignRequest, options).then((request) => request(axios, basePath));
529
643
  },
530
644
  /**
531
645
  *
532
646
  * @summary Delete image (soft or hard, per policy)
533
- * @param {ImagesApiDeleteImageRequest} requestParameters Request parameters.
647
+ * @param {DefaultApiDeleteImageRequest} requestParameters Request parameters.
534
648
  * @param {*} [options] Override http request option.
535
649
  * @throws {RequiredError}
536
650
  */
537
651
  deleteImage(requestParameters, options) {
538
652
  return localVarFp.deleteImage(requestParameters.id, requestParameters.hard, options).then((request) => request(axios, basePath));
539
653
  },
654
+ /**
655
+ *
656
+ * @summary Generate a signed imgproxy URL for delivery with requested params
657
+ * @param {DefaultApiGetDeliveryUrlRequest} requestParameters Request parameters.
658
+ * @param {*} [options] Override http request option.
659
+ * @throws {RequiredError}
660
+ */
661
+ getDeliveryUrl(requestParameters, options) {
662
+ return localVarFp.getDeliveryUrl(requestParameters.id, requestParameters.variant, requestParameters.w, requestParameters.h, requestParameters.fit, requestParameters.format, requestParameters.quality, requestParameters.dpr, requestParameters.ttlSeconds, options).then((request) => request(axios, basePath));
663
+ },
540
664
  /**
541
665
  *
542
666
  * @summary Get image metadata
543
- * @param {ImagesApiGetImageRequest} requestParameters Request parameters.
667
+ * @param {DefaultApiGetImageRequest} requestParameters Request parameters.
544
668
  * @param {*} [options] Override http request option.
545
669
  * @throws {RequiredError}
546
670
  */
@@ -550,17 +674,47 @@ export const ImagesApiFactory = function (configuration, basePath, axios) {
550
674
  /**
551
675
  *
552
676
  * @summary List/search images by owner/filters
553
- * @param {ImagesApiListImagesRequest} requestParameters Request parameters.
677
+ * @param {DefaultApiListImagesRequest} requestParameters Request parameters.
554
678
  * @param {*} [options] Override http request option.
555
679
  * @throws {RequiredError}
556
680
  */
557
681
  listImages(requestParameters = {}, options) {
558
682
  return localVarFp.listImages(requestParameters.ownerType, requestParameters.ownerId, requestParameters.status, requestParameters.page, requestParameters.pageSize, options).then((request) => request(axios, basePath));
559
683
  },
684
+ /**
685
+ *
686
+ * @summary Trigger (or retry) variant generation for an image
687
+ * @param {DefaultApiProcessImageRequest} requestParameters Request parameters.
688
+ * @param {*} [options] Override http request option.
689
+ * @throws {RequiredError}
690
+ */
691
+ processImage(requestParameters, options) {
692
+ return localVarFp.processImage(requestParameters.processImageRequest, options).then((request) => request(axios, basePath));
693
+ },
694
+ /**
695
+ *
696
+ * @summary Promote images from a product draft to a final product
697
+ * @param {DefaultApiPromoteImagesRequest} requestParameters Request parameters.
698
+ * @param {*} [options] Override http request option.
699
+ * @throws {RequiredError}
700
+ */
701
+ promoteImages(requestParameters, options) {
702
+ return localVarFp.promoteImages(requestParameters.promoteRequest, options).then((request) => request(axios, basePath));
703
+ },
704
+ /**
705
+ *
706
+ * @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
707
+ * @param {DefaultApiS3WebhookRequest} requestParameters Request parameters.
708
+ * @param {*} [options] Override http request option.
709
+ * @throws {RequiredError}
710
+ */
711
+ s3Webhook(requestParameters, options) {
712
+ return localVarFp.s3Webhook(requestParameters.requestBody, options).then((request) => request(axios, basePath));
713
+ },
560
714
  /**
561
715
  *
562
716
  * @summary Update image metadata (alt, role, order)
563
- * @param {ImagesApiUpdateImageRequest} requestParameters Request parameters.
717
+ * @param {DefaultApiUpdateImageRequest} requestParameters Request parameters.
564
718
  * @param {*} [options] Override http request option.
565
719
  * @throws {RequiredError}
566
720
  */
@@ -570,445 +724,140 @@ export const ImagesApiFactory = function (configuration, basePath, axios) {
570
724
  };
571
725
  };
572
726
  /**
573
- * ImagesApi - object-oriented interface
727
+ * DefaultApi - object-oriented interface
574
728
  * @export
575
- * @class ImagesApi
729
+ * @class DefaultApi
576
730
  * @extends {BaseAPI}
577
731
  */
578
- export class ImagesApi extends BaseAPI {
732
+ export class DefaultApi extends BaseAPI {
579
733
  /**
580
734
  *
581
735
  * @summary Confirm upload (HEAD against S3), persist metadata
582
- * @param {ImagesApiConfirmUploadRequest} requestParameters Request parameters.
736
+ * @param {DefaultApiConfirmUploadRequest} requestParameters Request parameters.
583
737
  * @param {*} [options] Override http request option.
584
738
  * @throws {RequiredError}
585
- * @memberof ImagesApi
739
+ * @memberof DefaultApi
586
740
  */
587
741
  confirmUpload(requestParameters, options) {
588
- return ImagesApiFp(this.configuration).confirmUpload(requestParameters.confirmRequest, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
742
+ return DefaultApiFp(this.configuration).confirmUpload(requestParameters.confirmRequest, options).then((request) => request(this.axios, this.basePath));
589
743
  }
590
744
  /**
591
745
  *
592
- * @summary Delete image (soft or hard, per policy)
593
- * @param {ImagesApiDeleteImageRequest} requestParameters Request parameters.
746
+ * @summary Create a presigned PUT URL for uploading an image to MinIO/S3
747
+ * @param {DefaultApiCreatePresignRequest} requestParameters Request parameters.
594
748
  * @param {*} [options] Override http request option.
595
749
  * @throws {RequiredError}
596
- * @memberof ImagesApi
750
+ * @memberof DefaultApi
597
751
  */
598
- deleteImage(requestParameters, options) {
599
- return ImagesApiFp(this.configuration).deleteImage(requestParameters.id, requestParameters.hard, options).then((request) => request(this.axios, this.basePath));
752
+ createPresign(requestParameters, options) {
753
+ return DefaultApiFp(this.configuration).createPresign(requestParameters.presignRequest, options).then((request) => request(this.axios, this.basePath));
600
754
  }
601
755
  /**
602
756
  *
603
- * @summary Get image metadata
604
- * @param {ImagesApiGetImageRequest} requestParameters Request parameters.
757
+ * @summary Delete image (soft or hard, per policy)
758
+ * @param {DefaultApiDeleteImageRequest} requestParameters Request parameters.
605
759
  * @param {*} [options] Override http request option.
606
760
  * @throws {RequiredError}
607
- * @memberof ImagesApi
761
+ * @memberof DefaultApi
608
762
  */
609
- getImage(requestParameters, options) {
610
- return ImagesApiFp(this.configuration).getImage(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
763
+ deleteImage(requestParameters, options) {
764
+ return DefaultApiFp(this.configuration).deleteImage(requestParameters.id, requestParameters.hard, options).then((request) => request(this.axios, this.basePath));
611
765
  }
612
766
  /**
613
767
  *
614
- * @summary List/search images by owner/filters
615
- * @param {ImagesApiListImagesRequest} requestParameters Request parameters.
768
+ * @summary Generate a signed imgproxy URL for delivery with requested params
769
+ * @param {DefaultApiGetDeliveryUrlRequest} requestParameters Request parameters.
616
770
  * @param {*} [options] Override http request option.
617
771
  * @throws {RequiredError}
618
- * @memberof ImagesApi
772
+ * @memberof DefaultApi
619
773
  */
620
- listImages(requestParameters = {}, options) {
621
- return ImagesApiFp(this.configuration).listImages(requestParameters.ownerType, requestParameters.ownerId, requestParameters.status, requestParameters.page, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
774
+ getDeliveryUrl(requestParameters, options) {
775
+ return DefaultApiFp(this.configuration).getDeliveryUrl(requestParameters.id, requestParameters.variant, requestParameters.w, requestParameters.h, requestParameters.fit, requestParameters.format, requestParameters.quality, requestParameters.dpr, requestParameters.ttlSeconds, options).then((request) => request(this.axios, this.basePath));
622
776
  }
623
777
  /**
624
778
  *
625
- * @summary Update image metadata (alt, role, order)
626
- * @param {ImagesApiUpdateImageRequest} requestParameters Request parameters.
779
+ * @summary Get image metadata
780
+ * @param {DefaultApiGetImageRequest} requestParameters Request parameters.
627
781
  * @param {*} [options] Override http request option.
628
782
  * @throws {RequiredError}
629
- * @memberof ImagesApi
783
+ * @memberof DefaultApi
630
784
  */
631
- updateImage(requestParameters, options) {
632
- return ImagesApiFp(this.configuration).updateImage(requestParameters.id, requestParameters.imagePatch, options).then((request) => request(this.axios, this.basePath));
785
+ getImage(requestParameters, options) {
786
+ return DefaultApiFp(this.configuration).getImage(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
787
+ }
788
+ /**
789
+ *
790
+ * @summary List/search images by owner/filters
791
+ * @param {DefaultApiListImagesRequest} requestParameters Request parameters.
792
+ * @param {*} [options] Override http request option.
793
+ * @throws {RequiredError}
794
+ * @memberof DefaultApi
795
+ */
796
+ listImages(requestParameters = {}, options) {
797
+ return DefaultApiFp(this.configuration).listImages(requestParameters.ownerType, requestParameters.ownerId, requestParameters.status, requestParameters.page, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
633
798
  }
634
- }
635
- /**
636
- * InternalApi - axios parameter creator
637
- * @export
638
- */
639
- export const InternalApiAxiosParamCreator = function (configuration) {
640
- return {
641
- /**
642
- *
643
- * @summary Trigger (or retry) variant generation for an image
644
- * @param {ProcessImageRequest} processImageRequest
645
- * @param {*} [options] Override http request option.
646
- * @throws {RequiredError}
647
- */
648
- processImage: (processImageRequest_1, ...args_1) => __awaiter(this, [processImageRequest_1, ...args_1], void 0, function* (processImageRequest, options = {}) {
649
- // verify required parameter 'processImageRequest' is not null or undefined
650
- assertParamExists('processImage', 'processImageRequest', processImageRequest);
651
- const localVarPath = `/internal/images/process`;
652
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
653
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
654
- let baseOptions;
655
- if (configuration) {
656
- baseOptions = configuration.baseOptions;
657
- }
658
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
659
- const localVarHeaderParameter = {};
660
- const localVarQueryParameter = {};
661
- localVarHeaderParameter['Content-Type'] = 'application/json';
662
- setSearchParams(localVarUrlObj, localVarQueryParameter);
663
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
664
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
665
- localVarRequestOptions.data = serializeDataIfNeeded(processImageRequest, localVarRequestOptions, configuration);
666
- return {
667
- url: toPathString(localVarUrlObj),
668
- options: localVarRequestOptions,
669
- };
670
- }),
671
- /**
672
- *
673
- * @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
674
- * @param {{ [key: string]: any; }} requestBody
675
- * @param {*} [options] Override http request option.
676
- * @throws {RequiredError}
677
- */
678
- s3Webhook: (requestBody_1, ...args_1) => __awaiter(this, [requestBody_1, ...args_1], void 0, function* (requestBody, options = {}) {
679
- // verify required parameter 'requestBody' is not null or undefined
680
- assertParamExists('s3Webhook', 'requestBody', requestBody);
681
- const localVarPath = `/internal/webhook/s3`;
682
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
683
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
684
- let baseOptions;
685
- if (configuration) {
686
- baseOptions = configuration.baseOptions;
687
- }
688
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
689
- const localVarHeaderParameter = {};
690
- const localVarQueryParameter = {};
691
- localVarHeaderParameter['Content-Type'] = 'application/json';
692
- setSearchParams(localVarUrlObj, localVarQueryParameter);
693
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
694
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
695
- localVarRequestOptions.data = serializeDataIfNeeded(requestBody, localVarRequestOptions, configuration);
696
- return {
697
- url: toPathString(localVarUrlObj),
698
- options: localVarRequestOptions,
699
- };
700
- }),
701
- };
702
- };
703
- /**
704
- * InternalApi - functional programming interface
705
- * @export
706
- */
707
- export const InternalApiFp = function (configuration) {
708
- const localVarAxiosParamCreator = InternalApiAxiosParamCreator(configuration);
709
- return {
710
- /**
711
- *
712
- * @summary Trigger (or retry) variant generation for an image
713
- * @param {ProcessImageRequest} processImageRequest
714
- * @param {*} [options] Override http request option.
715
- * @throws {RequiredError}
716
- */
717
- processImage(processImageRequest, options) {
718
- return __awaiter(this, void 0, void 0, function* () {
719
- var _a, _b, _c;
720
- const localVarAxiosArgs = yield localVarAxiosParamCreator.processImage(processImageRequest, options);
721
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
722
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InternalApi.processImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
723
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
724
- });
725
- },
726
- /**
727
- *
728
- * @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
729
- * @param {{ [key: string]: any; }} requestBody
730
- * @param {*} [options] Override http request option.
731
- * @throws {RequiredError}
732
- */
733
- s3Webhook(requestBody, options) {
734
- return __awaiter(this, void 0, void 0, function* () {
735
- var _a, _b, _c;
736
- const localVarAxiosArgs = yield localVarAxiosParamCreator.s3Webhook(requestBody, options);
737
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
738
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InternalApi.s3Webhook']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
739
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
740
- });
741
- },
742
- };
743
- };
744
- /**
745
- * InternalApi - factory interface
746
- * @export
747
- */
748
- export const InternalApiFactory = function (configuration, basePath, axios) {
749
- const localVarFp = InternalApiFp(configuration);
750
- return {
751
- /**
752
- *
753
- * @summary Trigger (or retry) variant generation for an image
754
- * @param {InternalApiProcessImageRequest} requestParameters Request parameters.
755
- * @param {*} [options] Override http request option.
756
- * @throws {RequiredError}
757
- */
758
- processImage(requestParameters, options) {
759
- return localVarFp.processImage(requestParameters.processImageRequest, options).then((request) => request(axios, basePath));
760
- },
761
- /**
762
- *
763
- * @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
764
- * @param {InternalApiS3WebhookRequest} requestParameters Request parameters.
765
- * @param {*} [options] Override http request option.
766
- * @throws {RequiredError}
767
- */
768
- s3Webhook(requestParameters, options) {
769
- return localVarFp.s3Webhook(requestParameters.requestBody, options).then((request) => request(axios, basePath));
770
- },
771
- };
772
- };
773
- /**
774
- * InternalApi - object-oriented interface
775
- * @export
776
- * @class InternalApi
777
- * @extends {BaseAPI}
778
- */
779
- export class InternalApi extends BaseAPI {
780
799
  /**
781
800
  *
782
801
  * @summary Trigger (or retry) variant generation for an image
783
- * @param {InternalApiProcessImageRequest} requestParameters Request parameters.
802
+ * @param {DefaultApiProcessImageRequest} requestParameters Request parameters.
784
803
  * @param {*} [options] Override http request option.
785
804
  * @throws {RequiredError}
786
- * @memberof InternalApi
805
+ * @memberof DefaultApi
787
806
  */
788
807
  processImage(requestParameters, options) {
789
- return InternalApiFp(this.configuration).processImage(requestParameters.processImageRequest, options).then((request) => request(this.axios, this.basePath));
808
+ return DefaultApiFp(this.configuration).processImage(requestParameters.processImageRequest, options).then((request) => request(this.axios, this.basePath));
809
+ }
810
+ /**
811
+ *
812
+ * @summary Promote images from a product draft to a final product
813
+ * @param {DefaultApiPromoteImagesRequest} requestParameters Request parameters.
814
+ * @param {*} [options] Override http request option.
815
+ * @throws {RequiredError}
816
+ * @memberof DefaultApi
817
+ */
818
+ promoteImages(requestParameters, options) {
819
+ return DefaultApiFp(this.configuration).promoteImages(requestParameters.promoteRequest, options).then((request) => request(this.axios, this.basePath));
790
820
  }
791
821
  /**
792
822
  *
793
823
  * @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
794
- * @param {InternalApiS3WebhookRequest} requestParameters Request parameters.
824
+ * @param {DefaultApiS3WebhookRequest} requestParameters Request parameters.
795
825
  * @param {*} [options] Override http request option.
796
826
  * @throws {RequiredError}
797
- * @memberof InternalApi
827
+ * @memberof DefaultApi
798
828
  */
799
829
  s3Webhook(requestParameters, options) {
800
- return InternalApiFp(this.configuration).s3Webhook(requestParameters.requestBody, options).then((request) => request(this.axios, this.basePath));
830
+ return DefaultApiFp(this.configuration).s3Webhook(requestParameters.requestBody, options).then((request) => request(this.axios, this.basePath));
801
831
  }
802
- }
803
- /**
804
- * LinkingApi - axios parameter creator
805
- * @export
806
- */
807
- export const LinkingApiAxiosParamCreator = function (configuration) {
808
- return {
809
- /**
810
- *
811
- * @summary Promote images from a product draft to a final product
812
- * @param {PromoteRequest} promoteRequest
813
- * @param {string} [idempotencyKey]
814
- * @param {*} [options] Override http request option.
815
- * @throws {RequiredError}
816
- */
817
- promoteImages: (promoteRequest_1, idempotencyKey_1, ...args_1) => __awaiter(this, [promoteRequest_1, idempotencyKey_1, ...args_1], void 0, function* (promoteRequest, idempotencyKey, options = {}) {
818
- // verify required parameter 'promoteRequest' is not null or undefined
819
- assertParamExists('promoteImages', 'promoteRequest', promoteRequest);
820
- const localVarPath = `/images/promote`;
821
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
822
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
823
- let baseOptions;
824
- if (configuration) {
825
- baseOptions = configuration.baseOptions;
826
- }
827
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
828
- const localVarHeaderParameter = {};
829
- const localVarQueryParameter = {};
830
- localVarHeaderParameter['Content-Type'] = 'application/json';
831
- if (idempotencyKey != null) {
832
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
833
- }
834
- setSearchParams(localVarUrlObj, localVarQueryParameter);
835
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
836
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
837
- localVarRequestOptions.data = serializeDataIfNeeded(promoteRequest, localVarRequestOptions, configuration);
838
- return {
839
- url: toPathString(localVarUrlObj),
840
- options: localVarRequestOptions,
841
- };
842
- }),
843
- };
844
- };
845
- /**
846
- * LinkingApi - functional programming interface
847
- * @export
848
- */
849
- export const LinkingApiFp = function (configuration) {
850
- const localVarAxiosParamCreator = LinkingApiAxiosParamCreator(configuration);
851
- return {
852
- /**
853
- *
854
- * @summary Promote images from a product draft to a final product
855
- * @param {PromoteRequest} promoteRequest
856
- * @param {string} [idempotencyKey]
857
- * @param {*} [options] Override http request option.
858
- * @throws {RequiredError}
859
- */
860
- promoteImages(promoteRequest, idempotencyKey, options) {
861
- return __awaiter(this, void 0, void 0, function* () {
862
- var _a, _b, _c;
863
- const localVarAxiosArgs = yield localVarAxiosParamCreator.promoteImages(promoteRequest, idempotencyKey, options);
864
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
865
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['LinkingApi.promoteImages']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
866
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
867
- });
868
- },
869
- };
870
- };
871
- /**
872
- * LinkingApi - factory interface
873
- * @export
874
- */
875
- export const LinkingApiFactory = function (configuration, basePath, axios) {
876
- const localVarFp = LinkingApiFp(configuration);
877
- return {
878
- /**
879
- *
880
- * @summary Promote images from a product draft to a final product
881
- * @param {LinkingApiPromoteImagesRequest} requestParameters Request parameters.
882
- * @param {*} [options] Override http request option.
883
- * @throws {RequiredError}
884
- */
885
- promoteImages(requestParameters, options) {
886
- return localVarFp.promoteImages(requestParameters.promoteRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath));
887
- },
888
- };
889
- };
890
- /**
891
- * LinkingApi - object-oriented interface
892
- * @export
893
- * @class LinkingApi
894
- * @extends {BaseAPI}
895
- */
896
- export class LinkingApi extends BaseAPI {
897
832
  /**
898
833
  *
899
- * @summary Promote images from a product draft to a final product
900
- * @param {LinkingApiPromoteImagesRequest} requestParameters Request parameters.
834
+ * @summary Update image metadata (alt, role, order)
835
+ * @param {DefaultApiUpdateImageRequest} requestParameters Request parameters.
901
836
  * @param {*} [options] Override http request option.
902
837
  * @throws {RequiredError}
903
- * @memberof LinkingApi
838
+ * @memberof DefaultApi
904
839
  */
905
- promoteImages(requestParameters, options) {
906
- return LinkingApiFp(this.configuration).promoteImages(requestParameters.promoteRequest, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
840
+ updateImage(requestParameters, options) {
841
+ return DefaultApiFp(this.configuration).updateImage(requestParameters.id, requestParameters.imagePatch, options).then((request) => request(this.axios, this.basePath));
907
842
  }
908
843
  }
909
844
  /**
910
- * PresignApi - axios parameter creator
911
- * @export
912
- */
913
- export const PresignApiAxiosParamCreator = function (configuration) {
914
- return {
915
- /**
916
- *
917
- * @summary Create a presigned PUT URL for uploading an image to MinIO/S3
918
- * @param {PresignRequest} presignRequest
919
- * @param {string} [idempotencyKey] Idempotency key for safe retries.
920
- * @param {*} [options] Override http request option.
921
- * @throws {RequiredError}
922
- */
923
- createPresign: (presignRequest_1, idempotencyKey_1, ...args_1) => __awaiter(this, [presignRequest_1, idempotencyKey_1, ...args_1], void 0, function* (presignRequest, idempotencyKey, options = {}) {
924
- // verify required parameter 'presignRequest' is not null or undefined
925
- assertParamExists('createPresign', 'presignRequest', presignRequest);
926
- const localVarPath = `/images/presign`;
927
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
928
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
929
- let baseOptions;
930
- if (configuration) {
931
- baseOptions = configuration.baseOptions;
932
- }
933
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
934
- const localVarHeaderParameter = {};
935
- const localVarQueryParameter = {};
936
- localVarHeaderParameter['Content-Type'] = 'application/json';
937
- if (idempotencyKey != null) {
938
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
939
- }
940
- setSearchParams(localVarUrlObj, localVarQueryParameter);
941
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
942
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
943
- localVarRequestOptions.data = serializeDataIfNeeded(presignRequest, localVarRequestOptions, configuration);
944
- return {
945
- url: toPathString(localVarUrlObj),
946
- options: localVarRequestOptions,
947
- };
948
- }),
949
- };
950
- };
951
- /**
952
- * PresignApi - functional programming interface
953
845
  * @export
954
846
  */
955
- export const PresignApiFp = function (configuration) {
956
- const localVarAxiosParamCreator = PresignApiAxiosParamCreator(configuration);
957
- return {
958
- /**
959
- *
960
- * @summary Create a presigned PUT URL for uploading an image to MinIO/S3
961
- * @param {PresignRequest} presignRequest
962
- * @param {string} [idempotencyKey] Idempotency key for safe retries.
963
- * @param {*} [options] Override http request option.
964
- * @throws {RequiredError}
965
- */
966
- createPresign(presignRequest, idempotencyKey, options) {
967
- return __awaiter(this, void 0, void 0, function* () {
968
- var _a, _b, _c;
969
- const localVarAxiosArgs = yield localVarAxiosParamCreator.createPresign(presignRequest, idempotencyKey, options);
970
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
971
- const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PresignApi.createPresign']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
972
- return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
973
- });
974
- },
975
- };
847
+ export const GetDeliveryUrlFitEnum = {
848
+ Cover: 'cover',
849
+ Contain: 'contain',
850
+ Fill: 'fill',
851
+ Inside: 'inside',
852
+ Outside: 'outside'
976
853
  };
977
854
  /**
978
- * PresignApi - factory interface
979
855
  * @export
980
856
  */
981
- export const PresignApiFactory = function (configuration, basePath, axios) {
982
- const localVarFp = PresignApiFp(configuration);
983
- return {
984
- /**
985
- *
986
- * @summary Create a presigned PUT URL for uploading an image to MinIO/S3
987
- * @param {PresignApiCreatePresignRequest} requestParameters Request parameters.
988
- * @param {*} [options] Override http request option.
989
- * @throws {RequiredError}
990
- */
991
- createPresign(requestParameters, options) {
992
- return localVarFp.createPresign(requestParameters.presignRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath));
993
- },
994
- };
857
+ export const GetDeliveryUrlFormatEnum = {
858
+ Original: 'original',
859
+ Webp: 'webp',
860
+ Avif: 'avif',
861
+ Jpeg: 'jpeg',
862
+ Png: 'png'
995
863
  };
996
- /**
997
- * PresignApi - object-oriented interface
998
- * @export
999
- * @class PresignApi
1000
- * @extends {BaseAPI}
1001
- */
1002
- export class PresignApi extends BaseAPI {
1003
- /**
1004
- *
1005
- * @summary Create a presigned PUT URL for uploading an image to MinIO/S3
1006
- * @param {PresignApiCreatePresignRequest} requestParameters Request parameters.
1007
- * @param {*} [options] Override http request option.
1008
- * @throws {RequiredError}
1009
- * @memberof PresignApi
1010
- */
1011
- createPresign(requestParameters, options) {
1012
- return PresignApiFp(this.configuration).createPresign(requestParameters.presignRequest, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
1013
- }
1014
- }