@sokol111/ecommerce-image-service-api 1.0.0
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.d.ts +1325 -0
- package/dist/api.js +1095 -0
- package/dist/base.d.ts +66 -0
- package/dist/base.js +60 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +149 -0
- package/dist/configuration.d.ts +91 -0
- package/dist/configuration.js +40 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +15 -0
- package/package.json +31 -0
package/dist/api.js
ADDED
|
@@ -0,0 +1,1095 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
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.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import globalAxios from 'axios';
|
|
24
|
+
// Some imports not used depending on template conditions
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { BASE_PATH, BaseAPI, operationServerMap } from './base';
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @export
|
|
32
|
+
* @enum {string}
|
|
33
|
+
*/
|
|
34
|
+
export const ImageRole = {
|
|
35
|
+
Main: 'main',
|
|
36
|
+
Gallery: 'gallery',
|
|
37
|
+
Other: 'other'
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @export
|
|
42
|
+
* @enum {string}
|
|
43
|
+
*/
|
|
44
|
+
export const ImageStatus = {
|
|
45
|
+
Pending: 'pending',
|
|
46
|
+
Uploaded: 'uploaded',
|
|
47
|
+
Processing: 'processing',
|
|
48
|
+
Ready: 'ready',
|
|
49
|
+
Failed: 'failed',
|
|
50
|
+
Deleted: 'deleted'
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @export
|
|
55
|
+
* @enum {string}
|
|
56
|
+
*/
|
|
57
|
+
export const OwnerType = {
|
|
58
|
+
ProductDraft: 'productDraft',
|
|
59
|
+
Product: 'product',
|
|
60
|
+
User: 'user'
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* DeliveryApi - axios parameter creator
|
|
64
|
+
* @export
|
|
65
|
+
*/
|
|
66
|
+
export const DeliveryApiAxiosParamCreator = function (configuration) {
|
|
67
|
+
return {
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @summary Generate a signed imgproxy URL for delivery with requested params
|
|
71
|
+
* @param {string} id
|
|
72
|
+
* @param {string} [variant]
|
|
73
|
+
* @param {number} [w]
|
|
74
|
+
* @param {number} [h]
|
|
75
|
+
* @param {GetDeliveryUrlFitEnum} [fit]
|
|
76
|
+
* @param {GetDeliveryUrlFormatEnum} [format]
|
|
77
|
+
* @param {number} [quality]
|
|
78
|
+
* @param {number} [dpr]
|
|
79
|
+
* @param {number} [ttlSeconds]
|
|
80
|
+
* @param {*} [options] Override http request option.
|
|
81
|
+
* @throws {RequiredError}
|
|
82
|
+
*/
|
|
83
|
+
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 = {}) {
|
|
84
|
+
// verify required parameter 'id' is not null or undefined
|
|
85
|
+
assertParamExists('getDeliveryUrl', 'id', id);
|
|
86
|
+
const localVarPath = `/images/{id}/url`
|
|
87
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
88
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
89
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
90
|
+
let baseOptions;
|
|
91
|
+
if (configuration) {
|
|
92
|
+
baseOptions = configuration.baseOptions;
|
|
93
|
+
}
|
|
94
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
95
|
+
const localVarHeaderParameter = {};
|
|
96
|
+
const localVarQueryParameter = {};
|
|
97
|
+
if (variant !== undefined) {
|
|
98
|
+
localVarQueryParameter['variant'] = variant;
|
|
99
|
+
}
|
|
100
|
+
if (w !== undefined) {
|
|
101
|
+
localVarQueryParameter['w'] = w;
|
|
102
|
+
}
|
|
103
|
+
if (h !== undefined) {
|
|
104
|
+
localVarQueryParameter['h'] = h;
|
|
105
|
+
}
|
|
106
|
+
if (fit !== undefined) {
|
|
107
|
+
localVarQueryParameter['fit'] = fit;
|
|
108
|
+
}
|
|
109
|
+
if (format !== undefined) {
|
|
110
|
+
localVarQueryParameter['format'] = format;
|
|
111
|
+
}
|
|
112
|
+
if (quality !== undefined) {
|
|
113
|
+
localVarQueryParameter['quality'] = quality;
|
|
114
|
+
}
|
|
115
|
+
if (dpr !== undefined) {
|
|
116
|
+
localVarQueryParameter['dpr'] = dpr;
|
|
117
|
+
}
|
|
118
|
+
if (ttlSeconds !== undefined) {
|
|
119
|
+
localVarQueryParameter['ttlSeconds'] = ttlSeconds;
|
|
120
|
+
}
|
|
121
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
122
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
123
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
124
|
+
return {
|
|
125
|
+
url: toPathString(localVarUrlObj),
|
|
126
|
+
options: localVarRequestOptions,
|
|
127
|
+
};
|
|
128
|
+
}),
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* DeliveryApi - functional programming interface
|
|
133
|
+
* @export
|
|
134
|
+
*/
|
|
135
|
+
export const DeliveryApiFp = function (configuration) {
|
|
136
|
+
const localVarAxiosParamCreator = DeliveryApiAxiosParamCreator(configuration);
|
|
137
|
+
return {
|
|
138
|
+
/**
|
|
139
|
+
*
|
|
140
|
+
* @summary Generate a signed imgproxy URL for delivery with requested params
|
|
141
|
+
* @param {string} id
|
|
142
|
+
* @param {string} [variant]
|
|
143
|
+
* @param {number} [w]
|
|
144
|
+
* @param {number} [h]
|
|
145
|
+
* @param {GetDeliveryUrlFitEnum} [fit]
|
|
146
|
+
* @param {GetDeliveryUrlFormatEnum} [format]
|
|
147
|
+
* @param {number} [quality]
|
|
148
|
+
* @param {number} [dpr]
|
|
149
|
+
* @param {number} [ttlSeconds]
|
|
150
|
+
* @param {*} [options] Override http request option.
|
|
151
|
+
* @throws {RequiredError}
|
|
152
|
+
*/
|
|
153
|
+
getDeliveryUrl(id, variant, w, h, fit, format, quality, dpr, ttlSeconds, options) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
var _a, _b, _c;
|
|
156
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDeliveryUrl(id, variant, w, h, fit, format, quality, dpr, ttlSeconds, options);
|
|
157
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
158
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['DeliveryApi.getDeliveryUrl']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
159
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* DeliveryApi - factory interface
|
|
166
|
+
* @export
|
|
167
|
+
*/
|
|
168
|
+
export const DeliveryApiFactory = function (configuration, basePath, axios) {
|
|
169
|
+
const localVarFp = DeliveryApiFp(configuration);
|
|
170
|
+
return {
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
* @summary Generate a signed imgproxy URL for delivery with requested params
|
|
174
|
+
* @param {DeliveryApiGetDeliveryUrlRequest} requestParameters Request parameters.
|
|
175
|
+
* @param {*} [options] Override http request option.
|
|
176
|
+
* @throws {RequiredError}
|
|
177
|
+
*/
|
|
178
|
+
getDeliveryUrl(requestParameters, options) {
|
|
179
|
+
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));
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* DeliveryApi - object-oriented interface
|
|
185
|
+
* @export
|
|
186
|
+
* @class DeliveryApi
|
|
187
|
+
* @extends {BaseAPI}
|
|
188
|
+
*/
|
|
189
|
+
export class DeliveryApi extends BaseAPI {
|
|
190
|
+
/**
|
|
191
|
+
*
|
|
192
|
+
* @summary Generate a signed imgproxy URL for delivery with requested params
|
|
193
|
+
* @param {DeliveryApiGetDeliveryUrlRequest} requestParameters Request parameters.
|
|
194
|
+
* @param {*} [options] Override http request option.
|
|
195
|
+
* @throws {RequiredError}
|
|
196
|
+
* @memberof DeliveryApi
|
|
197
|
+
*/
|
|
198
|
+
getDeliveryUrl(requestParameters, options) {
|
|
199
|
+
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));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @export
|
|
204
|
+
*/
|
|
205
|
+
export const GetDeliveryUrlFitEnum = {
|
|
206
|
+
Cover: 'cover',
|
|
207
|
+
Contain: 'contain',
|
|
208
|
+
Fill: 'fill',
|
|
209
|
+
Inside: 'inside',
|
|
210
|
+
Outside: 'outside'
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* @export
|
|
214
|
+
*/
|
|
215
|
+
export const GetDeliveryUrlFormatEnum = {
|
|
216
|
+
Original: 'original',
|
|
217
|
+
Webp: 'webp',
|
|
218
|
+
Avif: 'avif',
|
|
219
|
+
Jpeg: 'jpeg',
|
|
220
|
+
Png: 'png'
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* HealthApi - axios parameter creator
|
|
224
|
+
* @export
|
|
225
|
+
*/
|
|
226
|
+
export const HealthApiAxiosParamCreator = function (configuration) {
|
|
227
|
+
return {
|
|
228
|
+
/**
|
|
229
|
+
*
|
|
230
|
+
* @summary Health check
|
|
231
|
+
* @param {*} [options] Override http request option.
|
|
232
|
+
* @throws {RequiredError}
|
|
233
|
+
*/
|
|
234
|
+
healthz: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
|
|
235
|
+
const localVarPath = `/healthz`;
|
|
236
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
237
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
238
|
+
let baseOptions;
|
|
239
|
+
if (configuration) {
|
|
240
|
+
baseOptions = configuration.baseOptions;
|
|
241
|
+
}
|
|
242
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
243
|
+
const localVarHeaderParameter = {};
|
|
244
|
+
const localVarQueryParameter = {};
|
|
245
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
246
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
247
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
248
|
+
return {
|
|
249
|
+
url: toPathString(localVarUrlObj),
|
|
250
|
+
options: localVarRequestOptions,
|
|
251
|
+
};
|
|
252
|
+
}),
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* HealthApi - functional programming interface
|
|
257
|
+
* @export
|
|
258
|
+
*/
|
|
259
|
+
export const HealthApiFp = function (configuration) {
|
|
260
|
+
const localVarAxiosParamCreator = HealthApiAxiosParamCreator(configuration);
|
|
261
|
+
return {
|
|
262
|
+
/**
|
|
263
|
+
*
|
|
264
|
+
* @summary Health check
|
|
265
|
+
* @param {*} [options] Override http request option.
|
|
266
|
+
* @throws {RequiredError}
|
|
267
|
+
*/
|
|
268
|
+
healthz(options) {
|
|
269
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
+
var _a, _b, _c;
|
|
271
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.healthz(options);
|
|
272
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
273
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['HealthApi.healthz']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
274
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
275
|
+
});
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* HealthApi - factory interface
|
|
281
|
+
* @export
|
|
282
|
+
*/
|
|
283
|
+
export const HealthApiFactory = function (configuration, basePath, axios) {
|
|
284
|
+
const localVarFp = HealthApiFp(configuration);
|
|
285
|
+
return {
|
|
286
|
+
/**
|
|
287
|
+
*
|
|
288
|
+
* @summary Health check
|
|
289
|
+
* @param {*} [options] Override http request option.
|
|
290
|
+
* @throws {RequiredError}
|
|
291
|
+
*/
|
|
292
|
+
healthz(options) {
|
|
293
|
+
return localVarFp.healthz(options).then((request) => request(axios, basePath));
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* HealthApi - object-oriented interface
|
|
299
|
+
* @export
|
|
300
|
+
* @class HealthApi
|
|
301
|
+
* @extends {BaseAPI}
|
|
302
|
+
*/
|
|
303
|
+
export class HealthApi extends BaseAPI {
|
|
304
|
+
/**
|
|
305
|
+
*
|
|
306
|
+
* @summary Health check
|
|
307
|
+
* @param {*} [options] Override http request option.
|
|
308
|
+
* @throws {RequiredError}
|
|
309
|
+
* @memberof HealthApi
|
|
310
|
+
*/
|
|
311
|
+
healthz(options) {
|
|
312
|
+
return HealthApiFp(this.configuration).healthz(options).then((request) => request(this.axios, this.basePath));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* ImagesApi - axios parameter creator
|
|
317
|
+
* @export
|
|
318
|
+
*/
|
|
319
|
+
export const ImagesApiAxiosParamCreator = function (configuration) {
|
|
320
|
+
return {
|
|
321
|
+
/**
|
|
322
|
+
*
|
|
323
|
+
* @summary Confirm upload (HEAD against S3), persist metadata
|
|
324
|
+
* @param {ConfirmRequest} confirmRequest
|
|
325
|
+
* @param {string} [idempotencyKey] Idempotency key for safe retries.
|
|
326
|
+
* @param {*} [options] Override http request option.
|
|
327
|
+
* @throws {RequiredError}
|
|
328
|
+
*/
|
|
329
|
+
confirmUpload: (confirmRequest_1, idempotencyKey_1, ...args_1) => __awaiter(this, [confirmRequest_1, idempotencyKey_1, ...args_1], void 0, function* (confirmRequest, idempotencyKey, options = {}) {
|
|
330
|
+
// verify required parameter 'confirmRequest' is not null or undefined
|
|
331
|
+
assertParamExists('confirmUpload', 'confirmRequest', confirmRequest);
|
|
332
|
+
const localVarPath = `/images/confirm`;
|
|
333
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
334
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
335
|
+
let baseOptions;
|
|
336
|
+
if (configuration) {
|
|
337
|
+
baseOptions = configuration.baseOptions;
|
|
338
|
+
}
|
|
339
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
340
|
+
const localVarHeaderParameter = {};
|
|
341
|
+
const localVarQueryParameter = {};
|
|
342
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
343
|
+
if (idempotencyKey != null) {
|
|
344
|
+
localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
|
|
345
|
+
}
|
|
346
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
347
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
348
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
349
|
+
localVarRequestOptions.data = serializeDataIfNeeded(confirmRequest, localVarRequestOptions, configuration);
|
|
350
|
+
return {
|
|
351
|
+
url: toPathString(localVarUrlObj),
|
|
352
|
+
options: localVarRequestOptions,
|
|
353
|
+
};
|
|
354
|
+
}),
|
|
355
|
+
/**
|
|
356
|
+
*
|
|
357
|
+
* @summary Delete image (soft or hard, per policy)
|
|
358
|
+
* @param {string} id
|
|
359
|
+
* @param {boolean} [hard]
|
|
360
|
+
* @param {*} [options] Override http request option.
|
|
361
|
+
* @throws {RequiredError}
|
|
362
|
+
*/
|
|
363
|
+
deleteImage: (id_1, hard_1, ...args_1) => __awaiter(this, [id_1, hard_1, ...args_1], void 0, function* (id, hard, options = {}) {
|
|
364
|
+
// verify required parameter 'id' is not null or undefined
|
|
365
|
+
assertParamExists('deleteImage', 'id', id);
|
|
366
|
+
const localVarPath = `/images/{id}`
|
|
367
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
368
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
369
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
370
|
+
let baseOptions;
|
|
371
|
+
if (configuration) {
|
|
372
|
+
baseOptions = configuration.baseOptions;
|
|
373
|
+
}
|
|
374
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
375
|
+
const localVarHeaderParameter = {};
|
|
376
|
+
const localVarQueryParameter = {};
|
|
377
|
+
if (hard !== undefined) {
|
|
378
|
+
localVarQueryParameter['hard'] = hard;
|
|
379
|
+
}
|
|
380
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
381
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
382
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
383
|
+
return {
|
|
384
|
+
url: toPathString(localVarUrlObj),
|
|
385
|
+
options: localVarRequestOptions,
|
|
386
|
+
};
|
|
387
|
+
}),
|
|
388
|
+
/**
|
|
389
|
+
*
|
|
390
|
+
* @summary Get image metadata
|
|
391
|
+
* @param {string} id
|
|
392
|
+
* @param {*} [options] Override http request option.
|
|
393
|
+
* @throws {RequiredError}
|
|
394
|
+
*/
|
|
395
|
+
getImage: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) {
|
|
396
|
+
// verify required parameter 'id' is not null or undefined
|
|
397
|
+
assertParamExists('getImage', 'id', id);
|
|
398
|
+
const localVarPath = `/images/{id}`
|
|
399
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
400
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
401
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
402
|
+
let baseOptions;
|
|
403
|
+
if (configuration) {
|
|
404
|
+
baseOptions = configuration.baseOptions;
|
|
405
|
+
}
|
|
406
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
407
|
+
const localVarHeaderParameter = {};
|
|
408
|
+
const localVarQueryParameter = {};
|
|
409
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
410
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
411
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
412
|
+
return {
|
|
413
|
+
url: toPathString(localVarUrlObj),
|
|
414
|
+
options: localVarRequestOptions,
|
|
415
|
+
};
|
|
416
|
+
}),
|
|
417
|
+
/**
|
|
418
|
+
*
|
|
419
|
+
* @summary List/search images by owner/filters
|
|
420
|
+
* @param {OwnerType} [ownerType]
|
|
421
|
+
* @param {string} [ownerId]
|
|
422
|
+
* @param {ImageStatus} [status]
|
|
423
|
+
* @param {number} [page]
|
|
424
|
+
* @param {number} [pageSize]
|
|
425
|
+
* @param {*} [options] Override http request option.
|
|
426
|
+
* @throws {RequiredError}
|
|
427
|
+
*/
|
|
428
|
+
listImages: (ownerType_1, ownerId_1, status_1, page_1, pageSize_1, ...args_1) => __awaiter(this, [ownerType_1, ownerId_1, status_1, page_1, pageSize_1, ...args_1], void 0, function* (ownerType, ownerId, status, page, pageSize, options = {}) {
|
|
429
|
+
const localVarPath = `/images`;
|
|
430
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
431
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
432
|
+
let baseOptions;
|
|
433
|
+
if (configuration) {
|
|
434
|
+
baseOptions = configuration.baseOptions;
|
|
435
|
+
}
|
|
436
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
437
|
+
const localVarHeaderParameter = {};
|
|
438
|
+
const localVarQueryParameter = {};
|
|
439
|
+
if (ownerType !== undefined) {
|
|
440
|
+
localVarQueryParameter['ownerType'] = ownerType;
|
|
441
|
+
}
|
|
442
|
+
if (ownerId !== undefined) {
|
|
443
|
+
localVarQueryParameter['ownerId'] = ownerId;
|
|
444
|
+
}
|
|
445
|
+
if (status !== undefined) {
|
|
446
|
+
localVarQueryParameter['status'] = status;
|
|
447
|
+
}
|
|
448
|
+
if (page !== undefined) {
|
|
449
|
+
localVarQueryParameter['page'] = page;
|
|
450
|
+
}
|
|
451
|
+
if (pageSize !== undefined) {
|
|
452
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
453
|
+
}
|
|
454
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
455
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
456
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
457
|
+
return {
|
|
458
|
+
url: toPathString(localVarUrlObj),
|
|
459
|
+
options: localVarRequestOptions,
|
|
460
|
+
};
|
|
461
|
+
}),
|
|
462
|
+
/**
|
|
463
|
+
*
|
|
464
|
+
* @summary Update image metadata (alt, role, order)
|
|
465
|
+
* @param {string} id
|
|
466
|
+
* @param {ImagePatch} imagePatch
|
|
467
|
+
* @param {*} [options] Override http request option.
|
|
468
|
+
* @throws {RequiredError}
|
|
469
|
+
*/
|
|
470
|
+
updateImage: (id_1, imagePatch_1, ...args_1) => __awaiter(this, [id_1, imagePatch_1, ...args_1], void 0, function* (id, imagePatch, options = {}) {
|
|
471
|
+
// verify required parameter 'id' is not null or undefined
|
|
472
|
+
assertParamExists('updateImage', 'id', id);
|
|
473
|
+
// verify required parameter 'imagePatch' is not null or undefined
|
|
474
|
+
assertParamExists('updateImage', 'imagePatch', imagePatch);
|
|
475
|
+
const localVarPath = `/images/{id}`
|
|
476
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
477
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
478
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
479
|
+
let baseOptions;
|
|
480
|
+
if (configuration) {
|
|
481
|
+
baseOptions = configuration.baseOptions;
|
|
482
|
+
}
|
|
483
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
484
|
+
const localVarHeaderParameter = {};
|
|
485
|
+
const localVarQueryParameter = {};
|
|
486
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
487
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
488
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
489
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
490
|
+
localVarRequestOptions.data = serializeDataIfNeeded(imagePatch, localVarRequestOptions, configuration);
|
|
491
|
+
return {
|
|
492
|
+
url: toPathString(localVarUrlObj),
|
|
493
|
+
options: localVarRequestOptions,
|
|
494
|
+
};
|
|
495
|
+
}),
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* ImagesApi - functional programming interface
|
|
500
|
+
* @export
|
|
501
|
+
*/
|
|
502
|
+
export const ImagesApiFp = function (configuration) {
|
|
503
|
+
const localVarAxiosParamCreator = ImagesApiAxiosParamCreator(configuration);
|
|
504
|
+
return {
|
|
505
|
+
/**
|
|
506
|
+
*
|
|
507
|
+
* @summary Confirm upload (HEAD against S3), persist metadata
|
|
508
|
+
* @param {ConfirmRequest} confirmRequest
|
|
509
|
+
* @param {string} [idempotencyKey] Idempotency key for safe retries.
|
|
510
|
+
* @param {*} [options] Override http request option.
|
|
511
|
+
* @throws {RequiredError}
|
|
512
|
+
*/
|
|
513
|
+
confirmUpload(confirmRequest, idempotencyKey, options) {
|
|
514
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
515
|
+
var _a, _b, _c;
|
|
516
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.confirmUpload(confirmRequest, idempotencyKey, options);
|
|
517
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
518
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.confirmUpload']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
519
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
520
|
+
});
|
|
521
|
+
},
|
|
522
|
+
/**
|
|
523
|
+
*
|
|
524
|
+
* @summary Delete image (soft or hard, per policy)
|
|
525
|
+
* @param {string} id
|
|
526
|
+
* @param {boolean} [hard]
|
|
527
|
+
* @param {*} [options] Override http request option.
|
|
528
|
+
* @throws {RequiredError}
|
|
529
|
+
*/
|
|
530
|
+
deleteImage(id, hard, options) {
|
|
531
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
532
|
+
var _a, _b, _c;
|
|
533
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteImage(id, hard, options);
|
|
534
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
535
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.deleteImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
536
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
537
|
+
});
|
|
538
|
+
},
|
|
539
|
+
/**
|
|
540
|
+
*
|
|
541
|
+
* @summary Get image metadata
|
|
542
|
+
* @param {string} id
|
|
543
|
+
* @param {*} [options] Override http request option.
|
|
544
|
+
* @throws {RequiredError}
|
|
545
|
+
*/
|
|
546
|
+
getImage(id, options) {
|
|
547
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
548
|
+
var _a, _b, _c;
|
|
549
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getImage(id, options);
|
|
550
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
551
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.getImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
552
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
553
|
+
});
|
|
554
|
+
},
|
|
555
|
+
/**
|
|
556
|
+
*
|
|
557
|
+
* @summary List/search images by owner/filters
|
|
558
|
+
* @param {OwnerType} [ownerType]
|
|
559
|
+
* @param {string} [ownerId]
|
|
560
|
+
* @param {ImageStatus} [status]
|
|
561
|
+
* @param {number} [page]
|
|
562
|
+
* @param {number} [pageSize]
|
|
563
|
+
* @param {*} [options] Override http request option.
|
|
564
|
+
* @throws {RequiredError}
|
|
565
|
+
*/
|
|
566
|
+
listImages(ownerType, ownerId, status, page, pageSize, options) {
|
|
567
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
568
|
+
var _a, _b, _c;
|
|
569
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listImages(ownerType, ownerId, status, page, pageSize, options);
|
|
570
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
571
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.listImages']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
572
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
573
|
+
});
|
|
574
|
+
},
|
|
575
|
+
/**
|
|
576
|
+
*
|
|
577
|
+
* @summary Update image metadata (alt, role, order)
|
|
578
|
+
* @param {string} id
|
|
579
|
+
* @param {ImagePatch} imagePatch
|
|
580
|
+
* @param {*} [options] Override http request option.
|
|
581
|
+
* @throws {RequiredError}
|
|
582
|
+
*/
|
|
583
|
+
updateImage(id, imagePatch, options) {
|
|
584
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
585
|
+
var _a, _b, _c;
|
|
586
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateImage(id, imagePatch, options);
|
|
587
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
588
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['ImagesApi.updateImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
589
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
590
|
+
});
|
|
591
|
+
},
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
/**
|
|
595
|
+
* ImagesApi - factory interface
|
|
596
|
+
* @export
|
|
597
|
+
*/
|
|
598
|
+
export const ImagesApiFactory = function (configuration, basePath, axios) {
|
|
599
|
+
const localVarFp = ImagesApiFp(configuration);
|
|
600
|
+
return {
|
|
601
|
+
/**
|
|
602
|
+
*
|
|
603
|
+
* @summary Confirm upload (HEAD against S3), persist metadata
|
|
604
|
+
* @param {ImagesApiConfirmUploadRequest} requestParameters Request parameters.
|
|
605
|
+
* @param {*} [options] Override http request option.
|
|
606
|
+
* @throws {RequiredError}
|
|
607
|
+
*/
|
|
608
|
+
confirmUpload(requestParameters, options) {
|
|
609
|
+
return localVarFp.confirmUpload(requestParameters.confirmRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath));
|
|
610
|
+
},
|
|
611
|
+
/**
|
|
612
|
+
*
|
|
613
|
+
* @summary Delete image (soft or hard, per policy)
|
|
614
|
+
* @param {ImagesApiDeleteImageRequest} requestParameters Request parameters.
|
|
615
|
+
* @param {*} [options] Override http request option.
|
|
616
|
+
* @throws {RequiredError}
|
|
617
|
+
*/
|
|
618
|
+
deleteImage(requestParameters, options) {
|
|
619
|
+
return localVarFp.deleteImage(requestParameters.id, requestParameters.hard, options).then((request) => request(axios, basePath));
|
|
620
|
+
},
|
|
621
|
+
/**
|
|
622
|
+
*
|
|
623
|
+
* @summary Get image metadata
|
|
624
|
+
* @param {ImagesApiGetImageRequest} requestParameters Request parameters.
|
|
625
|
+
* @param {*} [options] Override http request option.
|
|
626
|
+
* @throws {RequiredError}
|
|
627
|
+
*/
|
|
628
|
+
getImage(requestParameters, options) {
|
|
629
|
+
return localVarFp.getImage(requestParameters.id, options).then((request) => request(axios, basePath));
|
|
630
|
+
},
|
|
631
|
+
/**
|
|
632
|
+
*
|
|
633
|
+
* @summary List/search images by owner/filters
|
|
634
|
+
* @param {ImagesApiListImagesRequest} requestParameters Request parameters.
|
|
635
|
+
* @param {*} [options] Override http request option.
|
|
636
|
+
* @throws {RequiredError}
|
|
637
|
+
*/
|
|
638
|
+
listImages(requestParameters = {}, options) {
|
|
639
|
+
return localVarFp.listImages(requestParameters.ownerType, requestParameters.ownerId, requestParameters.status, requestParameters.page, requestParameters.pageSize, options).then((request) => request(axios, basePath));
|
|
640
|
+
},
|
|
641
|
+
/**
|
|
642
|
+
*
|
|
643
|
+
* @summary Update image metadata (alt, role, order)
|
|
644
|
+
* @param {ImagesApiUpdateImageRequest} requestParameters Request parameters.
|
|
645
|
+
* @param {*} [options] Override http request option.
|
|
646
|
+
* @throws {RequiredError}
|
|
647
|
+
*/
|
|
648
|
+
updateImage(requestParameters, options) {
|
|
649
|
+
return localVarFp.updateImage(requestParameters.id, requestParameters.imagePatch, options).then((request) => request(axios, basePath));
|
|
650
|
+
},
|
|
651
|
+
};
|
|
652
|
+
};
|
|
653
|
+
/**
|
|
654
|
+
* ImagesApi - object-oriented interface
|
|
655
|
+
* @export
|
|
656
|
+
* @class ImagesApi
|
|
657
|
+
* @extends {BaseAPI}
|
|
658
|
+
*/
|
|
659
|
+
export class ImagesApi extends BaseAPI {
|
|
660
|
+
/**
|
|
661
|
+
*
|
|
662
|
+
* @summary Confirm upload (HEAD against S3), persist metadata
|
|
663
|
+
* @param {ImagesApiConfirmUploadRequest} requestParameters Request parameters.
|
|
664
|
+
* @param {*} [options] Override http request option.
|
|
665
|
+
* @throws {RequiredError}
|
|
666
|
+
* @memberof ImagesApi
|
|
667
|
+
*/
|
|
668
|
+
confirmUpload(requestParameters, options) {
|
|
669
|
+
return ImagesApiFp(this.configuration).confirmUpload(requestParameters.confirmRequest, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
*
|
|
673
|
+
* @summary Delete image (soft or hard, per policy)
|
|
674
|
+
* @param {ImagesApiDeleteImageRequest} requestParameters Request parameters.
|
|
675
|
+
* @param {*} [options] Override http request option.
|
|
676
|
+
* @throws {RequiredError}
|
|
677
|
+
* @memberof ImagesApi
|
|
678
|
+
*/
|
|
679
|
+
deleteImage(requestParameters, options) {
|
|
680
|
+
return ImagesApiFp(this.configuration).deleteImage(requestParameters.id, requestParameters.hard, options).then((request) => request(this.axios, this.basePath));
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
*
|
|
684
|
+
* @summary Get image metadata
|
|
685
|
+
* @param {ImagesApiGetImageRequest} requestParameters Request parameters.
|
|
686
|
+
* @param {*} [options] Override http request option.
|
|
687
|
+
* @throws {RequiredError}
|
|
688
|
+
* @memberof ImagesApi
|
|
689
|
+
*/
|
|
690
|
+
getImage(requestParameters, options) {
|
|
691
|
+
return ImagesApiFp(this.configuration).getImage(requestParameters.id, options).then((request) => request(this.axios, this.basePath));
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
*
|
|
695
|
+
* @summary List/search images by owner/filters
|
|
696
|
+
* @param {ImagesApiListImagesRequest} requestParameters Request parameters.
|
|
697
|
+
* @param {*} [options] Override http request option.
|
|
698
|
+
* @throws {RequiredError}
|
|
699
|
+
* @memberof ImagesApi
|
|
700
|
+
*/
|
|
701
|
+
listImages(requestParameters = {}, options) {
|
|
702
|
+
return ImagesApiFp(this.configuration).listImages(requestParameters.ownerType, requestParameters.ownerId, requestParameters.status, requestParameters.page, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
*
|
|
706
|
+
* @summary Update image metadata (alt, role, order)
|
|
707
|
+
* @param {ImagesApiUpdateImageRequest} requestParameters Request parameters.
|
|
708
|
+
* @param {*} [options] Override http request option.
|
|
709
|
+
* @throws {RequiredError}
|
|
710
|
+
* @memberof ImagesApi
|
|
711
|
+
*/
|
|
712
|
+
updateImage(requestParameters, options) {
|
|
713
|
+
return ImagesApiFp(this.configuration).updateImage(requestParameters.id, requestParameters.imagePatch, options).then((request) => request(this.axios, this.basePath));
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* InternalApi - axios parameter creator
|
|
718
|
+
* @export
|
|
719
|
+
*/
|
|
720
|
+
export const InternalApiAxiosParamCreator = function (configuration) {
|
|
721
|
+
return {
|
|
722
|
+
/**
|
|
723
|
+
*
|
|
724
|
+
* @summary Trigger (or retry) variant generation for an image
|
|
725
|
+
* @param {ProcessImageRequest} processImageRequest
|
|
726
|
+
* @param {*} [options] Override http request option.
|
|
727
|
+
* @throws {RequiredError}
|
|
728
|
+
*/
|
|
729
|
+
processImage: (processImageRequest_1, ...args_1) => __awaiter(this, [processImageRequest_1, ...args_1], void 0, function* (processImageRequest, options = {}) {
|
|
730
|
+
// verify required parameter 'processImageRequest' is not null or undefined
|
|
731
|
+
assertParamExists('processImage', 'processImageRequest', processImageRequest);
|
|
732
|
+
const localVarPath = `/internal/images/process`;
|
|
733
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
734
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
735
|
+
let baseOptions;
|
|
736
|
+
if (configuration) {
|
|
737
|
+
baseOptions = configuration.baseOptions;
|
|
738
|
+
}
|
|
739
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
740
|
+
const localVarHeaderParameter = {};
|
|
741
|
+
const localVarQueryParameter = {};
|
|
742
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
743
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
744
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
745
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
746
|
+
localVarRequestOptions.data = serializeDataIfNeeded(processImageRequest, localVarRequestOptions, configuration);
|
|
747
|
+
return {
|
|
748
|
+
url: toPathString(localVarUrlObj),
|
|
749
|
+
options: localVarRequestOptions,
|
|
750
|
+
};
|
|
751
|
+
}),
|
|
752
|
+
/**
|
|
753
|
+
*
|
|
754
|
+
* @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
|
|
755
|
+
* @param {{ [key: string]: any; }} requestBody
|
|
756
|
+
* @param {*} [options] Override http request option.
|
|
757
|
+
* @throws {RequiredError}
|
|
758
|
+
*/
|
|
759
|
+
s3Webhook: (requestBody_1, ...args_1) => __awaiter(this, [requestBody_1, ...args_1], void 0, function* (requestBody, options = {}) {
|
|
760
|
+
// verify required parameter 'requestBody' is not null or undefined
|
|
761
|
+
assertParamExists('s3Webhook', 'requestBody', requestBody);
|
|
762
|
+
const localVarPath = `/internal/webhook/s3`;
|
|
763
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
764
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
765
|
+
let baseOptions;
|
|
766
|
+
if (configuration) {
|
|
767
|
+
baseOptions = configuration.baseOptions;
|
|
768
|
+
}
|
|
769
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
770
|
+
const localVarHeaderParameter = {};
|
|
771
|
+
const localVarQueryParameter = {};
|
|
772
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
773
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
774
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
775
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
776
|
+
localVarRequestOptions.data = serializeDataIfNeeded(requestBody, localVarRequestOptions, configuration);
|
|
777
|
+
return {
|
|
778
|
+
url: toPathString(localVarUrlObj),
|
|
779
|
+
options: localVarRequestOptions,
|
|
780
|
+
};
|
|
781
|
+
}),
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
/**
|
|
785
|
+
* InternalApi - functional programming interface
|
|
786
|
+
* @export
|
|
787
|
+
*/
|
|
788
|
+
export const InternalApiFp = function (configuration) {
|
|
789
|
+
const localVarAxiosParamCreator = InternalApiAxiosParamCreator(configuration);
|
|
790
|
+
return {
|
|
791
|
+
/**
|
|
792
|
+
*
|
|
793
|
+
* @summary Trigger (or retry) variant generation for an image
|
|
794
|
+
* @param {ProcessImageRequest} processImageRequest
|
|
795
|
+
* @param {*} [options] Override http request option.
|
|
796
|
+
* @throws {RequiredError}
|
|
797
|
+
*/
|
|
798
|
+
processImage(processImageRequest, options) {
|
|
799
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
800
|
+
var _a, _b, _c;
|
|
801
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.processImage(processImageRequest, options);
|
|
802
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
803
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InternalApi.processImage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
804
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
805
|
+
});
|
|
806
|
+
},
|
|
807
|
+
/**
|
|
808
|
+
*
|
|
809
|
+
* @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
|
|
810
|
+
* @param {{ [key: string]: any; }} requestBody
|
|
811
|
+
* @param {*} [options] Override http request option.
|
|
812
|
+
* @throws {RequiredError}
|
|
813
|
+
*/
|
|
814
|
+
s3Webhook(requestBody, options) {
|
|
815
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
816
|
+
var _a, _b, _c;
|
|
817
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.s3Webhook(requestBody, options);
|
|
818
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
819
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InternalApi.s3Webhook']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
820
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
821
|
+
});
|
|
822
|
+
},
|
|
823
|
+
};
|
|
824
|
+
};
|
|
825
|
+
/**
|
|
826
|
+
* InternalApi - factory interface
|
|
827
|
+
* @export
|
|
828
|
+
*/
|
|
829
|
+
export const InternalApiFactory = function (configuration, basePath, axios) {
|
|
830
|
+
const localVarFp = InternalApiFp(configuration);
|
|
831
|
+
return {
|
|
832
|
+
/**
|
|
833
|
+
*
|
|
834
|
+
* @summary Trigger (or retry) variant generation for an image
|
|
835
|
+
* @param {InternalApiProcessImageRequest} requestParameters Request parameters.
|
|
836
|
+
* @param {*} [options] Override http request option.
|
|
837
|
+
* @throws {RequiredError}
|
|
838
|
+
*/
|
|
839
|
+
processImage(requestParameters, options) {
|
|
840
|
+
return localVarFp.processImage(requestParameters.processImageRequest, options).then((request) => request(axios, basePath));
|
|
841
|
+
},
|
|
842
|
+
/**
|
|
843
|
+
*
|
|
844
|
+
* @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
|
|
845
|
+
* @param {InternalApiS3WebhookRequest} requestParameters Request parameters.
|
|
846
|
+
* @param {*} [options] Override http request option.
|
|
847
|
+
* @throws {RequiredError}
|
|
848
|
+
*/
|
|
849
|
+
s3Webhook(requestParameters, options) {
|
|
850
|
+
return localVarFp.s3Webhook(requestParameters.requestBody, options).then((request) => request(axios, basePath));
|
|
851
|
+
},
|
|
852
|
+
};
|
|
853
|
+
};
|
|
854
|
+
/**
|
|
855
|
+
* InternalApi - object-oriented interface
|
|
856
|
+
* @export
|
|
857
|
+
* @class InternalApi
|
|
858
|
+
* @extends {BaseAPI}
|
|
859
|
+
*/
|
|
860
|
+
export class InternalApi extends BaseAPI {
|
|
861
|
+
/**
|
|
862
|
+
*
|
|
863
|
+
* @summary Trigger (or retry) variant generation for an image
|
|
864
|
+
* @param {InternalApiProcessImageRequest} requestParameters Request parameters.
|
|
865
|
+
* @param {*} [options] Override http request option.
|
|
866
|
+
* @throws {RequiredError}
|
|
867
|
+
* @memberof InternalApi
|
|
868
|
+
*/
|
|
869
|
+
processImage(requestParameters, options) {
|
|
870
|
+
return InternalApiFp(this.configuration).processImage(requestParameters.processImageRequest, options).then((request) => request(this.axios, this.basePath));
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
*
|
|
874
|
+
* @summary MinIO/S3 event webhook (ObjectCreated/Delete) for auto-confirm/triggers
|
|
875
|
+
* @param {InternalApiS3WebhookRequest} requestParameters Request parameters.
|
|
876
|
+
* @param {*} [options] Override http request option.
|
|
877
|
+
* @throws {RequiredError}
|
|
878
|
+
* @memberof InternalApi
|
|
879
|
+
*/
|
|
880
|
+
s3Webhook(requestParameters, options) {
|
|
881
|
+
return InternalApiFp(this.configuration).s3Webhook(requestParameters.requestBody, options).then((request) => request(this.axios, this.basePath));
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* LinkingApi - axios parameter creator
|
|
886
|
+
* @export
|
|
887
|
+
*/
|
|
888
|
+
export const LinkingApiAxiosParamCreator = function (configuration) {
|
|
889
|
+
return {
|
|
890
|
+
/**
|
|
891
|
+
*
|
|
892
|
+
* @summary Promote images from a product draft to a final product
|
|
893
|
+
* @param {PromoteRequest} promoteRequest
|
|
894
|
+
* @param {string} [idempotencyKey]
|
|
895
|
+
* @param {*} [options] Override http request option.
|
|
896
|
+
* @throws {RequiredError}
|
|
897
|
+
*/
|
|
898
|
+
promoteImages: (promoteRequest_1, idempotencyKey_1, ...args_1) => __awaiter(this, [promoteRequest_1, idempotencyKey_1, ...args_1], void 0, function* (promoteRequest, idempotencyKey, options = {}) {
|
|
899
|
+
// verify required parameter 'promoteRequest' is not null or undefined
|
|
900
|
+
assertParamExists('promoteImages', 'promoteRequest', promoteRequest);
|
|
901
|
+
const localVarPath = `/images/promote`;
|
|
902
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
903
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
904
|
+
let baseOptions;
|
|
905
|
+
if (configuration) {
|
|
906
|
+
baseOptions = configuration.baseOptions;
|
|
907
|
+
}
|
|
908
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
909
|
+
const localVarHeaderParameter = {};
|
|
910
|
+
const localVarQueryParameter = {};
|
|
911
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
912
|
+
if (idempotencyKey != null) {
|
|
913
|
+
localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
|
|
914
|
+
}
|
|
915
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
916
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
917
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
918
|
+
localVarRequestOptions.data = serializeDataIfNeeded(promoteRequest, localVarRequestOptions, configuration);
|
|
919
|
+
return {
|
|
920
|
+
url: toPathString(localVarUrlObj),
|
|
921
|
+
options: localVarRequestOptions,
|
|
922
|
+
};
|
|
923
|
+
}),
|
|
924
|
+
};
|
|
925
|
+
};
|
|
926
|
+
/**
|
|
927
|
+
* LinkingApi - functional programming interface
|
|
928
|
+
* @export
|
|
929
|
+
*/
|
|
930
|
+
export const LinkingApiFp = function (configuration) {
|
|
931
|
+
const localVarAxiosParamCreator = LinkingApiAxiosParamCreator(configuration);
|
|
932
|
+
return {
|
|
933
|
+
/**
|
|
934
|
+
*
|
|
935
|
+
* @summary Promote images from a product draft to a final product
|
|
936
|
+
* @param {PromoteRequest} promoteRequest
|
|
937
|
+
* @param {string} [idempotencyKey]
|
|
938
|
+
* @param {*} [options] Override http request option.
|
|
939
|
+
* @throws {RequiredError}
|
|
940
|
+
*/
|
|
941
|
+
promoteImages(promoteRequest, idempotencyKey, options) {
|
|
942
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
943
|
+
var _a, _b, _c;
|
|
944
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.promoteImages(promoteRequest, idempotencyKey, options);
|
|
945
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
946
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['LinkingApi.promoteImages']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
947
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
948
|
+
});
|
|
949
|
+
},
|
|
950
|
+
};
|
|
951
|
+
};
|
|
952
|
+
/**
|
|
953
|
+
* LinkingApi - factory interface
|
|
954
|
+
* @export
|
|
955
|
+
*/
|
|
956
|
+
export const LinkingApiFactory = function (configuration, basePath, axios) {
|
|
957
|
+
const localVarFp = LinkingApiFp(configuration);
|
|
958
|
+
return {
|
|
959
|
+
/**
|
|
960
|
+
*
|
|
961
|
+
* @summary Promote images from a product draft to a final product
|
|
962
|
+
* @param {LinkingApiPromoteImagesRequest} requestParameters Request parameters.
|
|
963
|
+
* @param {*} [options] Override http request option.
|
|
964
|
+
* @throws {RequiredError}
|
|
965
|
+
*/
|
|
966
|
+
promoteImages(requestParameters, options) {
|
|
967
|
+
return localVarFp.promoteImages(requestParameters.promoteRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath));
|
|
968
|
+
},
|
|
969
|
+
};
|
|
970
|
+
};
|
|
971
|
+
/**
|
|
972
|
+
* LinkingApi - object-oriented interface
|
|
973
|
+
* @export
|
|
974
|
+
* @class LinkingApi
|
|
975
|
+
* @extends {BaseAPI}
|
|
976
|
+
*/
|
|
977
|
+
export class LinkingApi extends BaseAPI {
|
|
978
|
+
/**
|
|
979
|
+
*
|
|
980
|
+
* @summary Promote images from a product draft to a final product
|
|
981
|
+
* @param {LinkingApiPromoteImagesRequest} requestParameters Request parameters.
|
|
982
|
+
* @param {*} [options] Override http request option.
|
|
983
|
+
* @throws {RequiredError}
|
|
984
|
+
* @memberof LinkingApi
|
|
985
|
+
*/
|
|
986
|
+
promoteImages(requestParameters, options) {
|
|
987
|
+
return LinkingApiFp(this.configuration).promoteImages(requestParameters.promoteRequest, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* PresignApi - axios parameter creator
|
|
992
|
+
* @export
|
|
993
|
+
*/
|
|
994
|
+
export const PresignApiAxiosParamCreator = function (configuration) {
|
|
995
|
+
return {
|
|
996
|
+
/**
|
|
997
|
+
*
|
|
998
|
+
* @summary Create a presigned PUT URL for uploading an image to MinIO/S3
|
|
999
|
+
* @param {PresignRequest} presignRequest
|
|
1000
|
+
* @param {string} [idempotencyKey] Idempotency key for safe retries.
|
|
1001
|
+
* @param {*} [options] Override http request option.
|
|
1002
|
+
* @throws {RequiredError}
|
|
1003
|
+
*/
|
|
1004
|
+
createPresign: (presignRequest_1, idempotencyKey_1, ...args_1) => __awaiter(this, [presignRequest_1, idempotencyKey_1, ...args_1], void 0, function* (presignRequest, idempotencyKey, options = {}) {
|
|
1005
|
+
// verify required parameter 'presignRequest' is not null or undefined
|
|
1006
|
+
assertParamExists('createPresign', 'presignRequest', presignRequest);
|
|
1007
|
+
const localVarPath = `/images/presign`;
|
|
1008
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1009
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1010
|
+
let baseOptions;
|
|
1011
|
+
if (configuration) {
|
|
1012
|
+
baseOptions = configuration.baseOptions;
|
|
1013
|
+
}
|
|
1014
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
1015
|
+
const localVarHeaderParameter = {};
|
|
1016
|
+
const localVarQueryParameter = {};
|
|
1017
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
1018
|
+
if (idempotencyKey != null) {
|
|
1019
|
+
localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
|
|
1020
|
+
}
|
|
1021
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1022
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1023
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1024
|
+
localVarRequestOptions.data = serializeDataIfNeeded(presignRequest, localVarRequestOptions, configuration);
|
|
1025
|
+
return {
|
|
1026
|
+
url: toPathString(localVarUrlObj),
|
|
1027
|
+
options: localVarRequestOptions,
|
|
1028
|
+
};
|
|
1029
|
+
}),
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
/**
|
|
1033
|
+
* PresignApi - functional programming interface
|
|
1034
|
+
* @export
|
|
1035
|
+
*/
|
|
1036
|
+
export const PresignApiFp = function (configuration) {
|
|
1037
|
+
const localVarAxiosParamCreator = PresignApiAxiosParamCreator(configuration);
|
|
1038
|
+
return {
|
|
1039
|
+
/**
|
|
1040
|
+
*
|
|
1041
|
+
* @summary Create a presigned PUT URL for uploading an image to MinIO/S3
|
|
1042
|
+
* @param {PresignRequest} presignRequest
|
|
1043
|
+
* @param {string} [idempotencyKey] Idempotency key for safe retries.
|
|
1044
|
+
* @param {*} [options] Override http request option.
|
|
1045
|
+
* @throws {RequiredError}
|
|
1046
|
+
*/
|
|
1047
|
+
createPresign(presignRequest, idempotencyKey, options) {
|
|
1048
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1049
|
+
var _a, _b, _c;
|
|
1050
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createPresign(presignRequest, idempotencyKey, options);
|
|
1051
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
1052
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['PresignApi.createPresign']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
1053
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1054
|
+
});
|
|
1055
|
+
},
|
|
1056
|
+
};
|
|
1057
|
+
};
|
|
1058
|
+
/**
|
|
1059
|
+
* PresignApi - factory interface
|
|
1060
|
+
* @export
|
|
1061
|
+
*/
|
|
1062
|
+
export const PresignApiFactory = function (configuration, basePath, axios) {
|
|
1063
|
+
const localVarFp = PresignApiFp(configuration);
|
|
1064
|
+
return {
|
|
1065
|
+
/**
|
|
1066
|
+
*
|
|
1067
|
+
* @summary Create a presigned PUT URL for uploading an image to MinIO/S3
|
|
1068
|
+
* @param {PresignApiCreatePresignRequest} requestParameters Request parameters.
|
|
1069
|
+
* @param {*} [options] Override http request option.
|
|
1070
|
+
* @throws {RequiredError}
|
|
1071
|
+
*/
|
|
1072
|
+
createPresign(requestParameters, options) {
|
|
1073
|
+
return localVarFp.createPresign(requestParameters.presignRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath));
|
|
1074
|
+
},
|
|
1075
|
+
};
|
|
1076
|
+
};
|
|
1077
|
+
/**
|
|
1078
|
+
* PresignApi - object-oriented interface
|
|
1079
|
+
* @export
|
|
1080
|
+
* @class PresignApi
|
|
1081
|
+
* @extends {BaseAPI}
|
|
1082
|
+
*/
|
|
1083
|
+
export class PresignApi extends BaseAPI {
|
|
1084
|
+
/**
|
|
1085
|
+
*
|
|
1086
|
+
* @summary Create a presigned PUT URL for uploading an image to MinIO/S3
|
|
1087
|
+
* @param {PresignApiCreatePresignRequest} requestParameters Request parameters.
|
|
1088
|
+
* @param {*} [options] Override http request option.
|
|
1089
|
+
* @throws {RequiredError}
|
|
1090
|
+
* @memberof PresignApi
|
|
1091
|
+
*/
|
|
1092
|
+
createPresign(requestParameters, options) {
|
|
1093
|
+
return PresignApiFp(this.configuration).createPresign(requestParameters.presignRequest, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
|
|
1094
|
+
}
|
|
1095
|
+
}
|