@aurigma/axios-storefront-api-client 2.23.1 → 2.24.9

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.
@@ -378,6 +378,14 @@ export interface IProjectsApiClient {
378
378
  * @return Success
379
379
  */
380
380
  getProjectOrder(id: number, tenantId?: number | null | undefined): Promise<any>;
381
+ /**
382
+ * Attachs the specified data to the project's order in ecommerce system.
383
+ * @param id Project identifier.
384
+ * @param tenantId (optional) Tenant identifier.
385
+ * @param body (optional) A list of data items, which should be attached to project's order.
386
+ * @return Success
387
+ */
388
+ attachDataToProjectOrder(id: number, tenantId?: number | null | undefined, body?: OrderDataItemDto[] | null | undefined): Promise<void>;
381
389
  }
382
390
  export declare class ProjectsApiClient extends ApiClientBase implements IProjectsApiClient {
383
391
  private instance;
@@ -530,6 +538,15 @@ export declare class ProjectsApiClient extends ApiClientBase implements IProject
530
538
  */
531
539
  getProjectOrder(id: number, tenantId?: number | null | undefined, cancelToken?: CancelToken | undefined): Promise<any>;
532
540
  protected processGetProjectOrder(response: AxiosResponse): Promise<any>;
541
+ /**
542
+ * Attachs the specified data to the project's order in ecommerce system.
543
+ * @param id Project identifier.
544
+ * @param tenantId (optional) Tenant identifier.
545
+ * @param body (optional) A list of data items, which should be attached to project's order.
546
+ * @return Success
547
+ */
548
+ attachDataToProjectOrder(id: number, tenantId?: number | null | undefined, body?: OrderDataItemDto[] | null | undefined, cancelToken?: CancelToken | undefined): Promise<void>;
549
+ protected processAttachDataToProjectOrder(response: AxiosResponse): Promise<void>;
533
550
  }
534
551
  export interface IStorefrontsApiClient {
535
552
  /**
@@ -1106,6 +1123,20 @@ export interface ProjectProcessingResultsDto {
1106
1123
  /** Collection of project output file descriptions. */
1107
1124
  outputFileDetails?: ProjectOutputFileDetailsDto[] | null;
1108
1125
  }
1126
+ /** Available value types for order data item. */
1127
+ export declare enum OrderDataItemValueType {
1128
+ PlainText = "PlainText",
1129
+ CommaSeparatedList = "CommaSeparatedList",
1130
+ SerializedJson = "SerializedJson"
1131
+ }
1132
+ /** Dto class, containing information about project's order data item. */
1133
+ export interface OrderDataItemDto {
1134
+ /** Order data item key (eventuall order metadata field name). */
1135
+ key?: string | null;
1136
+ /** Order data item value. */
1137
+ value?: string | null;
1138
+ type?: OrderDataItemValueType;
1139
+ }
1109
1140
  /** Storefront types. */
1110
1141
  export declare enum StorefrontType {
1111
1142
  Custom = "Custom",
@@ -8,7 +8,7 @@
8
8
  //----------------------
9
9
  // ReSharper disable InconsistentNaming
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.ApiException = exports.StorefrontType = exports.ProjectProcessingStatus = exports.RenderHiResScenarioOutputFlipMode = exports.RenderHiResScenarioOutputColorSpace = exports.RenderHiResScenarioOutputFormat = exports.ProjectItemResourceType = exports.DatePeriod = exports.TenantInfoApiClient = exports.StorefrontUsersApiClient = exports.StorefrontsApiClient = exports.ProjectsApiClient = exports.ProductSpecificationsApiClient = exports.ProductReferencesApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
11
+ exports.ApiException = exports.StorefrontType = exports.OrderDataItemValueType = exports.ProjectProcessingStatus = exports.RenderHiResScenarioOutputFlipMode = exports.RenderHiResScenarioOutputColorSpace = exports.RenderHiResScenarioOutputFormat = exports.ProjectItemResourceType = exports.DatePeriod = exports.TenantInfoApiClient = exports.StorefrontUsersApiClient = exports.StorefrontsApiClient = exports.ProjectsApiClient = exports.ProductSpecificationsApiClient = exports.ProductReferencesApiClient = exports.BuildInfoApiClient = exports.ApiClientBase = exports.ApiClientConfiguration = void 0;
12
12
  const axios_1 = require("axios");
13
13
  class ApiClientConfiguration {
14
14
  apiUrl;
@@ -2206,6 +2206,79 @@ class ProjectsApiClient extends ApiClientBase {
2206
2206
  }
2207
2207
  return Promise.resolve(null);
2208
2208
  }
2209
+ /**
2210
+ * Attachs the specified data to the project's order in ecommerce system.
2211
+ * @param id Project identifier.
2212
+ * @param tenantId (optional) Tenant identifier.
2213
+ * @param body (optional) A list of data items, which should be attached to project's order.
2214
+ * @return Success
2215
+ */
2216
+ attachDataToProjectOrder(id, tenantId, body, cancelToken) {
2217
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order-data?";
2218
+ if (id === undefined || id === null)
2219
+ throw new Error("The parameter 'id' must be defined.");
2220
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2221
+ if (tenantId !== undefined && tenantId !== null)
2222
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2223
+ url_ = url_.replace(/[?&]$/, "");
2224
+ const content_ = JSON.stringify(body);
2225
+ let options_ = {
2226
+ data: content_,
2227
+ method: "POST",
2228
+ url: url_,
2229
+ headers: {
2230
+ "Content-Type": "application/json-patch+json",
2231
+ },
2232
+ cancelToken
2233
+ };
2234
+ return this.transformOptions(options_).then(transformedOptions_ => {
2235
+ return this.instance.request(transformedOptions_);
2236
+ }).catch((_error) => {
2237
+ if (isAxiosError(_error) && _error.response) {
2238
+ return _error.response;
2239
+ }
2240
+ else {
2241
+ throw _error;
2242
+ }
2243
+ }).then((_response) => {
2244
+ return this.transformResult(url_, _response, (_response) => this.processAttachDataToProjectOrder(_response));
2245
+ });
2246
+ }
2247
+ processAttachDataToProjectOrder(response) {
2248
+ const status = response.status;
2249
+ let _headers = {};
2250
+ if (response.headers && typeof response.headers === "object") {
2251
+ for (let k in response.headers) {
2252
+ if (response.headers.hasOwnProperty(k)) {
2253
+ _headers[k] = response.headers[k];
2254
+ }
2255
+ }
2256
+ }
2257
+ if (status === 204) {
2258
+ const _responseText = response.data;
2259
+ return Promise.resolve(null);
2260
+ }
2261
+ else if (status === 404) {
2262
+ const _responseText = response.data;
2263
+ let result404 = null;
2264
+ let resultData404 = _responseText;
2265
+ result404 = JSON.parse(resultData404);
2266
+ return throwException("Not Found", status, _responseText, _headers, result404);
2267
+ }
2268
+ else if (status === 401) {
2269
+ const _responseText = response.data;
2270
+ return throwException("Unauthorized", status, _responseText, _headers);
2271
+ }
2272
+ else if (status === 403) {
2273
+ const _responseText = response.data;
2274
+ return throwException("Forbidden", status, _responseText, _headers);
2275
+ }
2276
+ else if (status !== 200 && status !== 204) {
2277
+ const _responseText = response.data;
2278
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2279
+ }
2280
+ return Promise.resolve(null);
2281
+ }
2209
2282
  }
2210
2283
  exports.ProjectsApiClient = ProjectsApiClient;
2211
2284
  class StorefrontsApiClient extends ApiClientBase {
@@ -3103,6 +3176,13 @@ var ProjectProcessingStatus;
3103
3176
  ProjectProcessingStatus["Completed"] = "Completed";
3104
3177
  ProjectProcessingStatus["Failed"] = "Failed";
3105
3178
  })(ProjectProcessingStatus = exports.ProjectProcessingStatus || (exports.ProjectProcessingStatus = {}));
3179
+ /** Available value types for order data item. */
3180
+ var OrderDataItemValueType;
3181
+ (function (OrderDataItemValueType) {
3182
+ OrderDataItemValueType["PlainText"] = "PlainText";
3183
+ OrderDataItemValueType["CommaSeparatedList"] = "CommaSeparatedList";
3184
+ OrderDataItemValueType["SerializedJson"] = "SerializedJson";
3185
+ })(OrderDataItemValueType = exports.OrderDataItemValueType || (exports.OrderDataItemValueType = {}));
3106
3186
  /** Storefront types. */
3107
3187
  var StorefrontType;
3108
3188
  (function (StorefrontType) {