@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. */
@@ -174,6 +174,7 @@ export var BackOfficeApiClient;
174
174
  * @param productSpecificationId (optional) Customer's Canvas product specification filter.
175
175
  * @param productId (optional) Customer's Canvas product filter.
176
176
  * @param productLinkId (optional) Customer's Canvas product link filter.
177
+ * @param productBundleId (optional) Customer's Canvas product bundle filter.
177
178
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
178
179
  * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
179
180
  * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
@@ -184,7 +185,7 @@ export var BackOfficeApiClient;
184
185
  * @param tenantId (optional) Tenant identifier.
185
186
  * @return Success
186
187
  */
187
- getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
188
+ getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, productBundleId, skip, take, sorting, search, sku, tags, customFields, tenantId, cancelToken) {
188
189
  let url_ = this.baseUrl + "/api/backoffice/v1/product-references?";
189
190
  if (storefrontId === undefined || storefrontId === null)
190
191
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
@@ -198,6 +199,10 @@ export var BackOfficeApiClient;
198
199
  url_ += "productId=" + encodeURIComponent("" + productId) + "&";
199
200
  if (productLinkId !== undefined && productLinkId !== null)
200
201
  url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
202
+ if (productBundleId === null)
203
+ throw new Error("The parameter 'productBundleId' cannot be null.");
204
+ else if (productBundleId !== undefined)
205
+ url_ += "productBundleId=" + encodeURIComponent("" + productBundleId) + "&";
201
206
  if (skip !== undefined && skip !== null)
202
207
  url_ += "skip=" + encodeURIComponent("" + skip) + "&";
203
208
  if (take !== undefined && take !== null)
@@ -930,6 +935,90 @@ export var BackOfficeApiClient;
930
935
  }
931
936
  return Promise.resolve(null);
932
937
  }
938
+ /**
939
+ * Set product options and returns updated options list.
940
+ * @param id Product identifier.
941
+ * @param tenantId (optional) Tenant identifier.
942
+ * @param body (optional)
943
+ * @return Success
944
+ */
945
+ setProductOptions(id, tenantId, body, cancelToken) {
946
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/options?";
947
+ if (id === undefined || id === null)
948
+ throw new Error("The parameter 'id' must be defined.");
949
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
950
+ if (tenantId !== undefined && tenantId !== null)
951
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
952
+ url_ = url_.replace(/[?&]$/, "");
953
+ const content_ = JSON.stringify(body);
954
+ let options_ = {
955
+ data: content_,
956
+ method: "PUT",
957
+ url: url_,
958
+ headers: {
959
+ "Content-Type": "application/json",
960
+ "Accept": "application/json"
961
+ },
962
+ cancelToken
963
+ };
964
+ return this.transformOptions(options_).then(transformedOptions_ => {
965
+ return this.instance.request(transformedOptions_);
966
+ }).catch((_error) => {
967
+ if (isAxiosError(_error) && _error.response) {
968
+ return _error.response;
969
+ }
970
+ else {
971
+ throw _error;
972
+ }
973
+ }).then((_response) => {
974
+ return this.transformResult(url_, _response, (_response) => this.processSetProductOptions(_response));
975
+ });
976
+ }
977
+ processSetProductOptions(response) {
978
+ const status = response.status;
979
+ let _headers = {};
980
+ if (response.headers && typeof response.headers === "object") {
981
+ for (let k in response.headers) {
982
+ if (response.headers.hasOwnProperty(k)) {
983
+ _headers[k] = response.headers[k];
984
+ }
985
+ }
986
+ }
987
+ if (status === 200) {
988
+ const _responseText = response.data;
989
+ let result200 = null;
990
+ let resultData200 = _responseText;
991
+ result200 = JSON.parse(resultData200);
992
+ return Promise.resolve(result200);
993
+ }
994
+ else if (status === 404) {
995
+ const _responseText = response.data;
996
+ let result404 = null;
997
+ let resultData404 = _responseText;
998
+ result404 = JSON.parse(resultData404);
999
+ return throwException("Not Found", status, _responseText, _headers, result404);
1000
+ }
1001
+ else if (status === 409) {
1002
+ const _responseText = response.data;
1003
+ let result409 = null;
1004
+ let resultData409 = _responseText;
1005
+ result409 = JSON.parse(resultData409);
1006
+ return throwException("Conflict", status, _responseText, _headers, result409);
1007
+ }
1008
+ else if (status === 401) {
1009
+ const _responseText = response.data;
1010
+ return throwException("Unauthorized", status, _responseText, _headers);
1011
+ }
1012
+ else if (status === 403) {
1013
+ const _responseText = response.data;
1014
+ return throwException("Forbidden", status, _responseText, _headers);
1015
+ }
1016
+ else if (status !== 200 && status !== 204) {
1017
+ const _responseText = response.data;
1018
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1019
+ }
1020
+ return Promise.resolve(null);
1021
+ }
933
1022
  /**
934
1023
  * Returns a list of product variants.
935
1024
  * @param id Product identifier.
@@ -3872,6 +3961,7 @@ export var BackOfficeApiClient;
3872
3961
  ProductReferenceType["ProductSpecification"] = "ProductSpecification";
3873
3962
  ProductReferenceType["Product"] = "Product";
3874
3963
  ProductReferenceType["ProductLink"] = "ProductLink";
3964
+ ProductReferenceType["ProductBundle"] = "ProductBundle";
3875
3965
  })(ProductReferenceType = BackOfficeApiClient.ProductReferenceType || (BackOfficeApiClient.ProductReferenceType = {}));
3876
3966
  /** Conflict types. */
3877
3967
  let ConflictType;
@@ -3970,10 +4060,7 @@ export var BackOfficeApiClient;
3970
4060
  }
3971
4061
  BackOfficeApiClient.ApiException = ApiException;
3972
4062
  function throwException(message, status, response, headers, result) {
3973
- if (result !== null && result !== undefined)
3974
- throw result;
3975
- else
3976
- throw new ApiException(message, status, response, headers, null);
4063
+ throw new ApiException(message, status, response, headers, result);
3977
4064
  }
3978
4065
  function isAxiosError(obj) {
3979
4066
  return obj && obj.isAxiosError === true;