@aurigma/axios-backoffice-api-client 2.59.1 → 2.62.12

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.
@@ -53,6 +53,7 @@ export declare module BackOfficeApiClient {
53
53
  * @param productSpecificationId (optional) Customer's Canvas product specification filter.
54
54
  * @param productId (optional) Customer's Canvas product filter.
55
55
  * @param productLinkId (optional) Customer's Canvas product link filter.
56
+ * @param productBundleId (optional) Customer's Canvas product bundle filter.
56
57
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
57
58
  * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
58
59
  * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
@@ -63,7 +64,7 @@ export declare module BackOfficeApiClient {
63
64
  * @param tenantId (optional) Tenant identifier.
64
65
  * @return Success
65
66
  */
66
- getAll(storefrontId: number, productReference?: string | null | undefined, productSpecificationId?: number | null | undefined, productId?: number | null | undefined, productLinkId?: number | null | undefined, skip?: number | null | undefined, take?: number | null | undefined, sorting?: string | null | undefined, search?: string | null | undefined, sku?: string | null | undefined, tags?: string[] | null | undefined, customFields?: string | null | undefined, tenantId?: number | null | undefined): Promise<PagedOfProductReferenceDto>;
67
+ getAll(storefrontId: number, productReference?: string | null | undefined, productSpecificationId?: number | null | undefined, productId?: number | null | undefined, productLinkId?: number | null | undefined, productBundleId?: number | undefined, skip?: number | null | undefined, take?: number | null | undefined, sorting?: string | null | undefined, search?: string | null | undefined, sku?: string | null | undefined, tags?: string[] | null | undefined, customFields?: string | null | undefined, tenantId?: number | null | undefined): Promise<PagedOfProductReferenceDto>;
67
68
  /**
68
69
  * Creates a new storefront product reference.
69
70
  * @param storefrontId Storefront identifier.
@@ -102,6 +103,7 @@ export declare module BackOfficeApiClient {
102
103
  * @param productSpecificationId (optional) Customer's Canvas product specification filter.
103
104
  * @param productId (optional) Customer's Canvas product filter.
104
105
  * @param productLinkId (optional) Customer's Canvas product link filter.
106
+ * @param productBundleId (optional) Customer's Canvas product bundle filter.
105
107
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
106
108
  * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
107
109
  * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
@@ -112,7 +114,7 @@ export declare module BackOfficeApiClient {
112
114
  * @param tenantId (optional) Tenant identifier.
113
115
  * @return Success
114
116
  */
115
- getAll(storefrontId: number, productReference?: string | null | undefined, productSpecificationId?: number | null | undefined, productId?: number | null | undefined, productLinkId?: number | null | undefined, skip?: number | null | undefined, take?: number | null | undefined, sorting?: string | null | undefined, search?: string | null | undefined, sku?: string | null | undefined, tags?: string[] | null | undefined, customFields?: string | null | undefined, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<PagedOfProductReferenceDto>;
117
+ getAll(storefrontId: number, productReference?: string | null | undefined, productSpecificationId?: number | null | undefined, productId?: number | null | undefined, productLinkId?: number | null | undefined, productBundleId?: number | undefined, skip?: number | null | undefined, take?: number | null | undefined, sorting?: string | null | undefined, search?: string | null | undefined, sku?: string | null | undefined, tags?: string[] | null | undefined, customFields?: string | null | undefined, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<PagedOfProductReferenceDto>;
116
118
  protected processGetAll(response: AxiosResponse): Promise<PagedOfProductReferenceDto>;
117
119
  /**
118
120
  * Creates a new storefront product reference.
@@ -186,6 +188,14 @@ export declare module BackOfficeApiClient {
186
188
  * @return Success
187
189
  */
188
190
  getProductOptions(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined): Promise<PagedOfProductOptionDto>;
191
+ /**
192
+ * Set product options and returns updated options list.
193
+ * @param id Product identifier.
194
+ * @param tenantId (optional) Tenant identifier.
195
+ * @param body (optional)
196
+ * @return Success
197
+ */
198
+ setProductOptions(id: number, tenantId?: number | null | undefined, body?: SetProductOptionsDto | null | undefined): Promise<PagedOfProductOptionDto>;
189
199
  /**
190
200
  * Returns a list of product variants.
191
201
  * @param id Product identifier.
@@ -423,6 +433,15 @@ export declare module BackOfficeApiClient {
423
433
  */
424
434
  getProductOptions(id: number, productVersionId?: number | null | undefined, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<PagedOfProductOptionDto>;
425
435
  protected processGetProductOptions(response: AxiosResponse): Promise<PagedOfProductOptionDto>;
436
+ /**
437
+ * Set product options and returns updated options list.
438
+ * @param id Product identifier.
439
+ * @param tenantId (optional) Tenant identifier.
440
+ * @param body (optional)
441
+ * @return Success
442
+ */
443
+ setProductOptions(id: number, tenantId?: number | null | undefined, body?: SetProductOptionsDto | null | undefined, cancelToken?: CancelToken | undefined): Promise<PagedOfProductOptionDto>;
444
+ protected processSetProductOptions(response: AxiosResponse): Promise<PagedOfProductOptionDto>;
426
445
  /**
427
446
  * Returns a list of product variants.
428
447
  * @param id Product identifier.
@@ -938,7 +957,8 @@ export declare module BackOfficeApiClient {
938
957
  enum ProductReferenceType {
939
958
  ProductSpecification = "ProductSpecification",
940
959
  Product = "Product",
941
- ProductLink = "ProductLink"
960
+ ProductLink = "ProductLink",
961
+ ProductBundle = "ProductBundle"
942
962
  }
943
963
  /** DTO class, containing information about storefront product reference. */
944
964
  interface ProductReferenceDto {
@@ -956,6 +976,8 @@ export declare module BackOfficeApiClient {
956
976
  productVersionId?: number;
957
977
  /** Customer's Canvas product link identifier. */
958
978
  productLinkId?: number;
979
+ /** Customer's Canvas product bundle identifier. */
980
+ productBundleId?: number;
959
981
  /** Storefront identifier. */
960
982
  storefrontId?: number;
961
983
  /** Tenant identifier. */
@@ -996,6 +1018,8 @@ export declare module BackOfficeApiClient {
996
1018
  productId?: number | null;
997
1019
  /** Customer's Canvas product link identifier. */
998
1020
  productLinkId?: number | null;
1021
+ /** Customer's Canvas product bundle identifier. */
1022
+ productBundleId?: number | null;
999
1023
  }
1000
1024
  interface ProblemDetails {
1001
1025
  type?: string | null;
@@ -1018,6 +1042,8 @@ export declare module BackOfficeApiClient {
1018
1042
  productId?: number;
1019
1043
  /** Customer's Canvas product link identifier. */
1020
1044
  productLinkId?: number;
1045
+ /** Customer's Canvas product bundle identifier. */
1046
+ productBundleId?: number;
1021
1047
  /** Storefront identifier. */
1022
1048
  storefrontId?: number;
1023
1049
  }
@@ -1218,6 +1244,47 @@ export declare module BackOfficeApiClient {
1218
1244
  total?: number;
1219
1245
  items?: ProductOptionDto[] | null;
1220
1246
  }
1247
+ /** Product option value create or update operation parameters. */
1248
+ interface SetProductOptionValueDto {
1249
+ /** Product option value UID. */
1250
+ uid?: string | null;
1251
+ /** Product option value description. */
1252
+ description?: string | null;
1253
+ /** Product option value sort index. */
1254
+ sortIndex?: number;
1255
+ /** Indicates if product option value is used as a default value. */
1256
+ isDefault?: boolean;
1257
+ /** Product option value. */
1258
+ value?: string | null;
1259
+ /** Product option value colors. */
1260
+ colors?: string[] | null;
1261
+ }
1262
+ /** Product option create or update operation parameters. */
1263
+ interface SetProductOptionDto {
1264
+ /** Product option UID. */
1265
+ uid?: string | null;
1266
+ /** Product option title. */
1267
+ title?: string | null;
1268
+ /** Product option description. */
1269
+ description?: string | null;
1270
+ /** Product option tooltip. */
1271
+ tooltip?: string | null;
1272
+ /** Product option sort index. */
1273
+ sortIndex?: number;
1274
+ /** Specifies if the option is used for design binding. */
1275
+ useForDesignBinding?: boolean;
1276
+ /** Specifies if the option is used for mockup binding. */
1277
+ useForMockupBinding?: boolean;
1278
+ /** Specifies if the option is used for document binding. */
1279
+ useForDocumentBinding?: boolean;
1280
+ /** A list of product option values. */
1281
+ values?: SetProductOptionValueDto[] | null;
1282
+ }
1283
+ /** Product options setting operation parameters. */
1284
+ interface SetProductOptionsDto {
1285
+ /** Product options create or update parameters. */
1286
+ options?: SetProductOptionDto[] | null;
1287
+ }
1221
1288
  /** Dto class, containing information about a product variant option. */
1222
1289
  interface ProductVariantOptionDto {
1223
1290
  /** Product option identifier. */
@@ -177,6 +177,7 @@ var BackOfficeApiClient;
177
177
  * @param productSpecificationId (optional) Customer's Canvas product specification filter.
178
178
  * @param productId (optional) Customer's Canvas product filter.
179
179
  * @param productLinkId (optional) Customer's Canvas product link filter.
180
+ * @param productBundleId (optional) Customer's Canvas product bundle filter.
180
181
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
181
182
  * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
182
183
  * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
@@ -187,7 +188,7 @@ var BackOfficeApiClient;
187
188
  * @param tenantId (optional) Tenant identifier.
188
189
  * @return Success
189
190
  */
190
- getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
191
+ getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, productBundleId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
191
192
  let url_ = this.baseUrl + "/api/backoffice/v1/product-references?";
192
193
  if (storefrontId === undefined || storefrontId === null)
193
194
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
@@ -201,6 +202,10 @@ var BackOfficeApiClient;
201
202
  url_ += "productId=" + encodeURIComponent("" + productId) + "&";
202
203
  if (productLinkId !== undefined && productLinkId !== null)
203
204
  url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
205
+ if (productBundleId === null)
206
+ throw new Error("The parameter 'productBundleId' cannot be null.");
207
+ else if (productBundleId !== undefined)
208
+ url_ += "productBundleId=" + encodeURIComponent("" + productBundleId) + "&";
204
209
  if (skip !== undefined && skip !== null)
205
210
  url_ += "skip=" + encodeURIComponent("" + skip) + "&";
206
211
  if (take !== undefined && take !== null)
@@ -933,6 +938,90 @@ var BackOfficeApiClient;
933
938
  }
934
939
  return Promise.resolve(null);
935
940
  }
941
+ /**
942
+ * Set product options and returns updated options list.
943
+ * @param id Product identifier.
944
+ * @param tenantId (optional) Tenant identifier.
945
+ * @param body (optional)
946
+ * @return Success
947
+ */
948
+ setProductOptions(id, tenantId, body, cancelToken) {
949
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/options?";
950
+ if (id === undefined || id === null)
951
+ throw new Error("The parameter 'id' must be defined.");
952
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
953
+ if (tenantId !== undefined && tenantId !== null)
954
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
955
+ url_ = url_.replace(/[?&]$/, "");
956
+ const content_ = JSON.stringify(body);
957
+ let options_ = {
958
+ data: content_,
959
+ method: "PUT",
960
+ url: url_,
961
+ headers: {
962
+ "Content-Type": "application/json",
963
+ "Accept": "application/json"
964
+ },
965
+ cancelToken
966
+ };
967
+ return this.transformOptions(options_).then(transformedOptions_ => {
968
+ return this.instance.request(transformedOptions_);
969
+ }).catch((_error) => {
970
+ if (isAxiosError(_error) && _error.response) {
971
+ return _error.response;
972
+ }
973
+ else {
974
+ throw _error;
975
+ }
976
+ }).then((_response) => {
977
+ return this.transformResult(url_, _response, (_response) => this.processSetProductOptions(_response));
978
+ });
979
+ }
980
+ processSetProductOptions(response) {
981
+ const status = response.status;
982
+ let _headers = {};
983
+ if (response.headers && typeof response.headers === "object") {
984
+ for (let k in response.headers) {
985
+ if (response.headers.hasOwnProperty(k)) {
986
+ _headers[k] = response.headers[k];
987
+ }
988
+ }
989
+ }
990
+ if (status === 200) {
991
+ const _responseText = response.data;
992
+ let result200 = null;
993
+ let resultData200 = _responseText;
994
+ result200 = JSON.parse(resultData200);
995
+ return Promise.resolve(result200);
996
+ }
997
+ else if (status === 404) {
998
+ const _responseText = response.data;
999
+ let result404 = null;
1000
+ let resultData404 = _responseText;
1001
+ result404 = JSON.parse(resultData404);
1002
+ return throwException("Not Found", status, _responseText, _headers, result404);
1003
+ }
1004
+ else if (status === 409) {
1005
+ const _responseText = response.data;
1006
+ let result409 = null;
1007
+ let resultData409 = _responseText;
1008
+ result409 = JSON.parse(resultData409);
1009
+ return throwException("Conflict", status, _responseText, _headers, result409);
1010
+ }
1011
+ else if (status === 401) {
1012
+ const _responseText = response.data;
1013
+ return throwException("Unauthorized", status, _responseText, _headers);
1014
+ }
1015
+ else if (status === 403) {
1016
+ const _responseText = response.data;
1017
+ return throwException("Forbidden", status, _responseText, _headers);
1018
+ }
1019
+ else if (status !== 200 && status !== 204) {
1020
+ const _responseText = response.data;
1021
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1022
+ }
1023
+ return Promise.resolve(null);
1024
+ }
936
1025
  /**
937
1026
  * Returns a list of product variants.
938
1027
  * @param id Product identifier.
@@ -3875,6 +3964,7 @@ var BackOfficeApiClient;
3875
3964
  ProductReferenceType["ProductSpecification"] = "ProductSpecification";
3876
3965
  ProductReferenceType["Product"] = "Product";
3877
3966
  ProductReferenceType["ProductLink"] = "ProductLink";
3967
+ ProductReferenceType["ProductBundle"] = "ProductBundle";
3878
3968
  })(ProductReferenceType = BackOfficeApiClient.ProductReferenceType || (BackOfficeApiClient.ProductReferenceType = {}));
3879
3969
  /** Conflict types. */
3880
3970
  let ConflictType;
@@ -3973,10 +4063,7 @@ var BackOfficeApiClient;
3973
4063
  }
3974
4064
  BackOfficeApiClient.ApiException = ApiException;
3975
4065
  function throwException(message, status, response, headers, result) {
3976
- if (result !== null && result !== undefined)
3977
- throw result;
3978
- else
3979
- throw new ApiException(message, status, response, headers, null);
4066
+ throw new ApiException(message, status, response, headers, result);
3980
4067
  }
3981
4068
  function isAxiosError(obj) {
3982
4069
  return obj && obj.isAxiosError === true;