@aurigma/axios-backoffice-api-client 2.57.1 → 2.58.1

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.
@@ -342,6 +342,15 @@ export declare module BackOfficeApiClient {
342
342
  * @return Success
343
343
  */
344
344
  removeDocumentsConnections(id: number, tenantId?: number | null | undefined, body?: RemoveProductDocumentConnectionsDto | null | undefined): Promise<void>;
345
+ /**
346
+ * Set a thumbnail image for an existing product.
347
+ * @param id Product identifier.
348
+ * @param productVersionId (optional)
349
+ * @param tenantId (optional) Tenant identifier.
350
+ * @param file (optional)
351
+ * @return Success
352
+ */
353
+ setProductImage(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, file?: FileParameter | null | undefined): Promise<void>;
345
354
  /**
346
355
  * Returns all available product personalization workflows.
347
356
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
@@ -585,6 +594,16 @@ export declare module BackOfficeApiClient {
585
594
  */
586
595
  removeDocumentsConnections(id: number, tenantId?: number | null | undefined, body?: RemoveProductDocumentConnectionsDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
587
596
  protected processRemoveDocumentsConnections(response: AxiosResponse): Promise<void>;
597
+ /**
598
+ * Set a thumbnail image for an existing product.
599
+ * @param id Product identifier.
600
+ * @param productVersionId (optional)
601
+ * @param tenantId (optional) Tenant identifier.
602
+ * @param file (optional)
603
+ * @return Success
604
+ */
605
+ setProductImage(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, file?: FileParameter | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
606
+ protected processSetProductImage(response: AxiosResponse): Promise<void>;
588
607
  /**
589
608
  * Returns all available product personalization workflows.
590
609
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
@@ -1066,7 +1085,7 @@ export declare module BackOfficeApiClient {
1066
1085
  /** Product option creation operation parameters. */
1067
1086
  interface CreateProductOptionDto {
1068
1087
  /** Option title. */
1069
- title?: string | null;
1088
+ title: string;
1070
1089
  /** Option traits. */
1071
1090
  traits?: string[] | null;
1072
1091
  /** Product option values. */
@@ -1081,7 +1100,7 @@ export declare module BackOfficeApiClient {
1081
1100
  /** Product option creation operation parameters. */
1082
1101
  interface CreateProductDto {
1083
1102
  /** Product name. */
1084
- name?: string | null;
1103
+ name: string;
1085
1104
  /** Product description. */
1086
1105
  description?: string | null;
1087
1106
  /** Personalization workflow identifier. */
@@ -1144,6 +1163,8 @@ export declare module BackOfficeApiClient {
1144
1163
  isDefault?: boolean;
1145
1164
  /** Product option value identifying tag. */
1146
1165
  tag?: string | null;
1166
+ /** Product option value UID. */
1167
+ uid?: string | null;
1147
1168
  /** Product option value description for 'Simple' option type. */
1148
1169
  simpleOptionValue?: SimpleOptionValue | null;
1149
1170
  /** Product option value description. */
@@ -1173,6 +1194,8 @@ export declare module BackOfficeApiClient {
1173
1194
  sortIndex?: number;
1174
1195
  /** Product option identifying tag. */
1175
1196
  tag?: string | null;
1197
+ /** Product option UID. */
1198
+ uid?: string | null;
1176
1199
  /** Specifies if the option is used for design binding. */
1177
1200
  useForDesignBinding?: boolean;
1178
1201
  /** Specifies if the option is used for mockup binding. */
@@ -1436,10 +1459,10 @@ export declare module BackOfficeApiClient {
1436
1459
  }
1437
1460
  /** Product asset connection options description. */
1438
1461
  interface ProductAssetConnectionOptionsDto {
1439
- /** Product option identifier. */
1440
- optionId?: number;
1441
- /** Product option values identifiers. */
1442
- optionValueIds?: number[] | null;
1462
+ /** Product option UID. */
1463
+ optionUID?: string | null;
1464
+ /** Product option values UIDs. */
1465
+ optionValueUIDs?: string[] | null;
1443
1466
  }
1444
1467
  /** Product design connection description. */
1445
1468
  interface ProductDesignConnectionDto {
@@ -1512,6 +1512,13 @@ var BackOfficeApiClient;
1512
1512
  const _responseText = response.data;
1513
1513
  return Promise.resolve(null);
1514
1514
  }
1515
+ else if (status === 400) {
1516
+ const _responseText = response.data;
1517
+ let result400 = null;
1518
+ let resultData400 = _responseText;
1519
+ result400 = JSON.parse(resultData400);
1520
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1521
+ }
1515
1522
  else if (status === 404) {
1516
1523
  const _responseText = response.data;
1517
1524
  let result404 = null;
@@ -1592,6 +1599,13 @@ var BackOfficeApiClient;
1592
1599
  const _responseText = response.data;
1593
1600
  return Promise.resolve(null);
1594
1601
  }
1602
+ else if (status === 400) {
1603
+ const _responseText = response.data;
1604
+ let result400 = null;
1605
+ let resultData400 = _responseText;
1606
+ result400 = JSON.parse(resultData400);
1607
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1608
+ }
1595
1609
  else if (status === 404) {
1596
1610
  const _responseText = response.data;
1597
1611
  let result404 = null;
@@ -1672,6 +1686,13 @@ var BackOfficeApiClient;
1672
1686
  const _responseText = response.data;
1673
1687
  return Promise.resolve(null);
1674
1688
  }
1689
+ else if (status === 400) {
1690
+ const _responseText = response.data;
1691
+ let result400 = null;
1692
+ let resultData400 = _responseText;
1693
+ result400 = JSON.parse(resultData400);
1694
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1695
+ }
1675
1696
  else if (status === 404) {
1676
1697
  const _responseText = response.data;
1677
1698
  let result404 = null;
@@ -2261,6 +2282,96 @@ var BackOfficeApiClient;
2261
2282
  }
2262
2283
  return Promise.resolve(null);
2263
2284
  }
2285
+ /**
2286
+ * Set a thumbnail image for an existing product.
2287
+ * @param id Product identifier.
2288
+ * @param productVersionId (optional)
2289
+ * @param tenantId (optional) Tenant identifier.
2290
+ * @param file (optional)
2291
+ * @return Success
2292
+ */
2293
+ setProductImage(id, productVersionId, tenantId, file, cancelToken) {
2294
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-image?";
2295
+ if (id === undefined || id === null)
2296
+ throw new Error("The parameter 'id' must be defined.");
2297
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2298
+ if (productVersionId !== undefined && productVersionId !== null)
2299
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2300
+ if (tenantId !== undefined && tenantId !== null)
2301
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2302
+ url_ = url_.replace(/[?&]$/, "");
2303
+ const content_ = new FormData();
2304
+ if (file !== null && file !== undefined)
2305
+ content_.append("file", file.data, file.fileName ? file.fileName : "file");
2306
+ let options_ = {
2307
+ data: content_,
2308
+ method: "POST",
2309
+ url: url_,
2310
+ headers: {},
2311
+ cancelToken
2312
+ };
2313
+ return this.transformOptions(options_).then(transformedOptions_ => {
2314
+ return this.instance.request(transformedOptions_);
2315
+ }).catch((_error) => {
2316
+ if (isAxiosError(_error) && _error.response) {
2317
+ return _error.response;
2318
+ }
2319
+ else {
2320
+ throw _error;
2321
+ }
2322
+ }).then((_response) => {
2323
+ return this.transformResult(url_, _response, (_response) => this.processSetProductImage(_response));
2324
+ });
2325
+ }
2326
+ processSetProductImage(response) {
2327
+ const status = response.status;
2328
+ let _headers = {};
2329
+ if (response.headers && typeof response.headers === "object") {
2330
+ for (let k in response.headers) {
2331
+ if (response.headers.hasOwnProperty(k)) {
2332
+ _headers[k] = response.headers[k];
2333
+ }
2334
+ }
2335
+ }
2336
+ if (status === 200) {
2337
+ const _responseText = response.data;
2338
+ return Promise.resolve(null);
2339
+ }
2340
+ else if (status === 400) {
2341
+ const _responseText = response.data;
2342
+ let result400 = null;
2343
+ let resultData400 = _responseText;
2344
+ result400 = JSON.parse(resultData400);
2345
+ return throwException("Bad Request", status, _responseText, _headers, result400);
2346
+ }
2347
+ else if (status === 404) {
2348
+ const _responseText = response.data;
2349
+ let result404 = null;
2350
+ let resultData404 = _responseText;
2351
+ result404 = JSON.parse(resultData404);
2352
+ return throwException("Not Found", status, _responseText, _headers, result404);
2353
+ }
2354
+ else if (status === 409) {
2355
+ const _responseText = response.data;
2356
+ let result409 = null;
2357
+ let resultData409 = _responseText;
2358
+ result409 = JSON.parse(resultData409);
2359
+ return throwException("Conflict", status, _responseText, _headers, result409);
2360
+ }
2361
+ else if (status === 401) {
2362
+ const _responseText = response.data;
2363
+ return throwException("Unauthorized", status, _responseText, _headers);
2364
+ }
2365
+ else if (status === 403) {
2366
+ const _responseText = response.data;
2367
+ return throwException("Forbidden", status, _responseText, _headers);
2368
+ }
2369
+ else if (status !== 200 && status !== 204) {
2370
+ const _responseText = response.data;
2371
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2372
+ }
2373
+ return Promise.resolve(null);
2374
+ }
2264
2375
  /**
2265
2376
  * Returns all available product personalization workflows.
2266
2377
  * @param skip (optional) Defines page start offset from beginning of sorted result list.