@aurigma/ng-backoffice-api-client 2.54.43
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/README.md +79 -0
- package/aurigma-ng-backoffice-api-client.d.ts +4 -0
- package/aurigma-ng-backoffice-api-client.metadata.json +1 -0
- package/bundles/aurigma-ng-backoffice-api-client.umd.js +5377 -0
- package/bundles/aurigma-ng-backoffice-api-client.umd.js.map +1 -0
- package/bundles/aurigma-ng-backoffice-api-client.umd.min.js +2 -0
- package/bundles/aurigma-ng-backoffice-api-client.umd.min.js.map +1 -0
- package/esm2015/aurigma-ng-backoffice-api-client.js +5 -0
- package/esm2015/lib/backoffice-api-client.js +4211 -0
- package/esm2015/lib/backoffice.module.js +35 -0
- package/esm2015/public-api.js +6 -0
- package/fesm2015/aurigma-ng-backoffice-api-client.js +4245 -0
- package/fesm2015/aurigma-ng-backoffice-api-client.js.map +1 -0
- package/lib/backoffice-api-client.d.ts +1904 -0
- package/lib/backoffice.module.d.ts +6 -0
- package/package.json +31 -0
- package/public-api.d.ts +2 -0
|
@@ -0,0 +1,4245 @@
|
|
|
1
|
+
import { InjectionToken, ɵɵdefineInjectable, ɵɵinject, Injectable, Inject, Optional, NgModule } from '@angular/core';
|
|
2
|
+
import { __awaiter } from 'tslib';
|
|
3
|
+
import { mergeMap, catchError } from 'rxjs/operators';
|
|
4
|
+
import { from, throwError, Observable, of } from 'rxjs';
|
|
5
|
+
import { HttpHeaders, HttpResponseBase, HttpResponse, HttpClient } from '@angular/common/http';
|
|
6
|
+
|
|
7
|
+
const API_BASE_URL = new InjectionToken('API_BASE_URL');
|
|
8
|
+
class ApiClientConfiguration {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.apiKey = 'ApiKey';
|
|
11
|
+
this.authorizationToken = null;
|
|
12
|
+
}
|
|
13
|
+
getAuthorizationToken() {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () { return this.authorizationToken; });
|
|
15
|
+
}
|
|
16
|
+
;
|
|
17
|
+
setAuthorizationToken(token) { this.authorizationToken = token; }
|
|
18
|
+
;
|
|
19
|
+
}
|
|
20
|
+
class ApiClientBase {
|
|
21
|
+
constructor(configuration) {
|
|
22
|
+
this.configuration = configuration;
|
|
23
|
+
}
|
|
24
|
+
transformOptions(options) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const token = yield this.configuration.getAuthorizationToken();
|
|
27
|
+
if (token != null) {
|
|
28
|
+
options.headers = options.headers.append("authorization", "Bearer " + token);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
options.headers = options.headers.append("X-API-Key", this.configuration.apiKey);
|
|
32
|
+
}
|
|
33
|
+
//options = { ...options, transformResponse: (res) => res, responseType: 'json' };
|
|
34
|
+
return options;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
getBaseUrl(defultUrl) {
|
|
38
|
+
return this.configuration.apiUrl;
|
|
39
|
+
}
|
|
40
|
+
transformResult(url, res, cb) {
|
|
41
|
+
return cb(res);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
class BuildInfoApiClient extends ApiClientBase {
|
|
45
|
+
constructor(configuration, http, baseUrl) {
|
|
46
|
+
super(configuration);
|
|
47
|
+
this.jsonParseReviver = undefined;
|
|
48
|
+
this.http = http;
|
|
49
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Returns assembly build info.
|
|
53
|
+
* @return Success
|
|
54
|
+
*/
|
|
55
|
+
headInfo() {
|
|
56
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/info";
|
|
57
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
58
|
+
let options_ = {
|
|
59
|
+
observe: "response",
|
|
60
|
+
responseType: "blob",
|
|
61
|
+
headers: new HttpHeaders({})
|
|
62
|
+
};
|
|
63
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
64
|
+
return this.http.request("head", url_, transformedOptions_);
|
|
65
|
+
})).pipe(mergeMap((response_) => {
|
|
66
|
+
return this.transformResult(url_, response_, (r) => this.processHeadInfo(r));
|
|
67
|
+
})).pipe(catchError((response_) => {
|
|
68
|
+
if (response_ instanceof HttpResponseBase) {
|
|
69
|
+
try {
|
|
70
|
+
return this.transformResult(url_, response_, (r) => this.processHeadInfo(r));
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
return throwError(e);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else
|
|
77
|
+
return throwError(response_);
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
processHeadInfo(response) {
|
|
81
|
+
const status = response.status;
|
|
82
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
83
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
84
|
+
let _headers = {};
|
|
85
|
+
if (response.headers) {
|
|
86
|
+
for (let key of response.headers.keys()) {
|
|
87
|
+
_headers[key] = response.headers.get(key);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (status === 200) {
|
|
91
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
92
|
+
return of(null);
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
else if (status !== 200 && status !== 204) {
|
|
96
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
97
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
return of(null);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns assembly build info.
|
|
104
|
+
* @return Success
|
|
105
|
+
*/
|
|
106
|
+
getInfo() {
|
|
107
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/info";
|
|
108
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
109
|
+
let options_ = {
|
|
110
|
+
observe: "response",
|
|
111
|
+
responseType: "blob",
|
|
112
|
+
headers: new HttpHeaders({
|
|
113
|
+
"Accept": "application/json"
|
|
114
|
+
})
|
|
115
|
+
};
|
|
116
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
117
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
118
|
+
})).pipe(mergeMap((response_) => {
|
|
119
|
+
return this.transformResult(url_, response_, (r) => this.processGetInfo(r));
|
|
120
|
+
})).pipe(catchError((response_) => {
|
|
121
|
+
if (response_ instanceof HttpResponseBase) {
|
|
122
|
+
try {
|
|
123
|
+
return this.transformResult(url_, response_, (r) => this.processGetInfo(r));
|
|
124
|
+
}
|
|
125
|
+
catch (e) {
|
|
126
|
+
return throwError(e);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else
|
|
130
|
+
return throwError(response_);
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
processGetInfo(response) {
|
|
134
|
+
const status = response.status;
|
|
135
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
136
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
137
|
+
let _headers = {};
|
|
138
|
+
if (response.headers) {
|
|
139
|
+
for (let key of response.headers.keys()) {
|
|
140
|
+
_headers[key] = response.headers.get(key);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (status === 200) {
|
|
144
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
145
|
+
let result200 = null;
|
|
146
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
147
|
+
return of(result200);
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
else if (status !== 200 && status !== 204) {
|
|
151
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
152
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
return of(null);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
BuildInfoApiClient.ɵprov = ɵɵdefineInjectable({ factory: function BuildInfoApiClient_Factory() { return new BuildInfoApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: BuildInfoApiClient, providedIn: "root" });
|
|
159
|
+
BuildInfoApiClient.decorators = [
|
|
160
|
+
{ type: Injectable, args: [{
|
|
161
|
+
providedIn: 'root'
|
|
162
|
+
},] }
|
|
163
|
+
];
|
|
164
|
+
BuildInfoApiClient.ctorParameters = () => [
|
|
165
|
+
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
166
|
+
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
167
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
168
|
+
];
|
|
169
|
+
class ProductReferencesManagementApiClient extends ApiClientBase {
|
|
170
|
+
constructor(configuration, http, baseUrl) {
|
|
171
|
+
super(configuration);
|
|
172
|
+
this.jsonParseReviver = undefined;
|
|
173
|
+
this.http = http;
|
|
174
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Returns all storefront product references relevant to the specified query parameters.
|
|
178
|
+
* @param storefrontId Storefront identifier.
|
|
179
|
+
* @param productReference (optional) Product reference filter.
|
|
180
|
+
Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
|
|
181
|
+
* @param productSpecificationId (optional) Customer's Canvas product specification filter.
|
|
182
|
+
* @param productId (optional) Customer's Canvas product filter.
|
|
183
|
+
* @param productLinkId (optional) Customer's Canvas product link filter.
|
|
184
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
185
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
186
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
187
|
+
* @param search (optional) Search string for partial match.
|
|
188
|
+
* @param sku (optional) SKU filter.
|
|
189
|
+
* @param tags (optional) List of tags that product should have.
|
|
190
|
+
* @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
|
|
191
|
+
* @param tenantId (optional) Tenant identifier.
|
|
192
|
+
* @return Success
|
|
193
|
+
*/
|
|
194
|
+
getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
|
|
195
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/product-references?";
|
|
196
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
197
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
198
|
+
else
|
|
199
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
200
|
+
if (productReference !== undefined && productReference !== null)
|
|
201
|
+
url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
|
|
202
|
+
if (productSpecificationId !== undefined && productSpecificationId !== null)
|
|
203
|
+
url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
|
|
204
|
+
if (productId !== undefined && productId !== null)
|
|
205
|
+
url_ += "productId=" + encodeURIComponent("" + productId) + "&";
|
|
206
|
+
if (productLinkId !== undefined && productLinkId !== null)
|
|
207
|
+
url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
|
|
208
|
+
if (skip !== undefined && skip !== null)
|
|
209
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
210
|
+
if (take !== undefined && take !== null)
|
|
211
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
212
|
+
if (sorting !== undefined && sorting !== null)
|
|
213
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
214
|
+
if (search !== undefined && search !== null)
|
|
215
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
216
|
+
if (sku !== undefined && sku !== null)
|
|
217
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
218
|
+
if (tags !== undefined && tags !== null)
|
|
219
|
+
tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
|
|
220
|
+
if (customFields !== undefined && customFields !== null)
|
|
221
|
+
url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
|
|
222
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
223
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
224
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
225
|
+
let options_ = {
|
|
226
|
+
observe: "response",
|
|
227
|
+
responseType: "blob",
|
|
228
|
+
headers: new HttpHeaders({
|
|
229
|
+
"Accept": "application/json"
|
|
230
|
+
})
|
|
231
|
+
};
|
|
232
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
233
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
234
|
+
})).pipe(mergeMap((response_) => {
|
|
235
|
+
return this.transformResult(url_, response_, (r) => this.processGetAll(r));
|
|
236
|
+
})).pipe(catchError((response_) => {
|
|
237
|
+
if (response_ instanceof HttpResponseBase) {
|
|
238
|
+
try {
|
|
239
|
+
return this.transformResult(url_, response_, (r) => this.processGetAll(r));
|
|
240
|
+
}
|
|
241
|
+
catch (e) {
|
|
242
|
+
return throwError(e);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else
|
|
246
|
+
return throwError(response_);
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
processGetAll(response) {
|
|
250
|
+
const status = response.status;
|
|
251
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
252
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
253
|
+
let _headers = {};
|
|
254
|
+
if (response.headers) {
|
|
255
|
+
for (let key of response.headers.keys()) {
|
|
256
|
+
_headers[key] = response.headers.get(key);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (status === 200) {
|
|
260
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
261
|
+
let result200 = null;
|
|
262
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
263
|
+
return of(result200);
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
266
|
+
else if (status === 409) {
|
|
267
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
268
|
+
let result409 = null;
|
|
269
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
270
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
273
|
+
else if (status === 401) {
|
|
274
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
275
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
276
|
+
}));
|
|
277
|
+
}
|
|
278
|
+
else if (status === 403) {
|
|
279
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
280
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
281
|
+
}));
|
|
282
|
+
}
|
|
283
|
+
else if (status !== 200 && status !== 204) {
|
|
284
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
285
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
286
|
+
}));
|
|
287
|
+
}
|
|
288
|
+
return of(null);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Creates a new storefront product reference.
|
|
292
|
+
* @param storefrontId Storefront identifier.
|
|
293
|
+
* @param tenantId (optional) Tenant identifier.
|
|
294
|
+
* @param body (optional) Create operation parameters.
|
|
295
|
+
* @return Success
|
|
296
|
+
*/
|
|
297
|
+
create(storefrontId, tenantId, body) {
|
|
298
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/product-references?";
|
|
299
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
300
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
301
|
+
else
|
|
302
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
303
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
304
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
305
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
306
|
+
const content_ = JSON.stringify(body);
|
|
307
|
+
let options_ = {
|
|
308
|
+
body: content_,
|
|
309
|
+
observe: "response",
|
|
310
|
+
responseType: "blob",
|
|
311
|
+
headers: new HttpHeaders({
|
|
312
|
+
"Content-Type": "application/json",
|
|
313
|
+
"Accept": "application/json"
|
|
314
|
+
})
|
|
315
|
+
};
|
|
316
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
317
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
318
|
+
})).pipe(mergeMap((response_) => {
|
|
319
|
+
return this.transformResult(url_, response_, (r) => this.processCreate(r));
|
|
320
|
+
})).pipe(catchError((response_) => {
|
|
321
|
+
if (response_ instanceof HttpResponseBase) {
|
|
322
|
+
try {
|
|
323
|
+
return this.transformResult(url_, response_, (r) => this.processCreate(r));
|
|
324
|
+
}
|
|
325
|
+
catch (e) {
|
|
326
|
+
return throwError(e);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
else
|
|
330
|
+
return throwError(response_);
|
|
331
|
+
}));
|
|
332
|
+
}
|
|
333
|
+
processCreate(response) {
|
|
334
|
+
const status = response.status;
|
|
335
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
336
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
337
|
+
let _headers = {};
|
|
338
|
+
if (response.headers) {
|
|
339
|
+
for (let key of response.headers.keys()) {
|
|
340
|
+
_headers[key] = response.headers.get(key);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (status === 201) {
|
|
344
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
345
|
+
let result201 = null;
|
|
346
|
+
result201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
347
|
+
return of(result201);
|
|
348
|
+
}));
|
|
349
|
+
}
|
|
350
|
+
else if (status === 404) {
|
|
351
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
352
|
+
let result404 = null;
|
|
353
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
354
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
355
|
+
}));
|
|
356
|
+
}
|
|
357
|
+
else if (status === 409) {
|
|
358
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
359
|
+
let result409 = null;
|
|
360
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
361
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
362
|
+
}));
|
|
363
|
+
}
|
|
364
|
+
else if (status === 401) {
|
|
365
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
366
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
367
|
+
}));
|
|
368
|
+
}
|
|
369
|
+
else if (status === 403) {
|
|
370
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
371
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
372
|
+
}));
|
|
373
|
+
}
|
|
374
|
+
else if (status !== 200 && status !== 204) {
|
|
375
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
376
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
377
|
+
}));
|
|
378
|
+
}
|
|
379
|
+
return of(null);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Returns a storefront product reference.
|
|
383
|
+
* @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
|
|
384
|
+
* @param storefrontId Storefront identifier.
|
|
385
|
+
* @param tenantId (optional) Tenant identifier.
|
|
386
|
+
* @return Success
|
|
387
|
+
*/
|
|
388
|
+
get(reference, storefrontId, tenantId) {
|
|
389
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/product-references/{reference}?";
|
|
390
|
+
if (reference === undefined || reference === null)
|
|
391
|
+
throw new Error("The parameter 'reference' must be defined.");
|
|
392
|
+
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
393
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
394
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
395
|
+
else
|
|
396
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
397
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
398
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
399
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
400
|
+
let options_ = {
|
|
401
|
+
observe: "response",
|
|
402
|
+
responseType: "blob",
|
|
403
|
+
headers: new HttpHeaders({
|
|
404
|
+
"Accept": "application/json"
|
|
405
|
+
})
|
|
406
|
+
};
|
|
407
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
408
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
409
|
+
})).pipe(mergeMap((response_) => {
|
|
410
|
+
return this.transformResult(url_, response_, (r) => this.processGet(r));
|
|
411
|
+
})).pipe(catchError((response_) => {
|
|
412
|
+
if (response_ instanceof HttpResponseBase) {
|
|
413
|
+
try {
|
|
414
|
+
return this.transformResult(url_, response_, (r) => this.processGet(r));
|
|
415
|
+
}
|
|
416
|
+
catch (e) {
|
|
417
|
+
return throwError(e);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
else
|
|
421
|
+
return throwError(response_);
|
|
422
|
+
}));
|
|
423
|
+
}
|
|
424
|
+
processGet(response) {
|
|
425
|
+
const status = response.status;
|
|
426
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
427
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
428
|
+
let _headers = {};
|
|
429
|
+
if (response.headers) {
|
|
430
|
+
for (let key of response.headers.keys()) {
|
|
431
|
+
_headers[key] = response.headers.get(key);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
if (status === 200) {
|
|
435
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
436
|
+
let result200 = null;
|
|
437
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
438
|
+
return of(result200);
|
|
439
|
+
}));
|
|
440
|
+
}
|
|
441
|
+
else if (status === 409) {
|
|
442
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
443
|
+
let result409 = null;
|
|
444
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
445
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
446
|
+
}));
|
|
447
|
+
}
|
|
448
|
+
else if (status === 404) {
|
|
449
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
450
|
+
let result404 = null;
|
|
451
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
452
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
453
|
+
}));
|
|
454
|
+
}
|
|
455
|
+
else if (status === 401) {
|
|
456
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
457
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
458
|
+
}));
|
|
459
|
+
}
|
|
460
|
+
else if (status === 403) {
|
|
461
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
462
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
463
|
+
}));
|
|
464
|
+
}
|
|
465
|
+
else if (status !== 200 && status !== 204) {
|
|
466
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
467
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
468
|
+
}));
|
|
469
|
+
}
|
|
470
|
+
return of(null);
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Deletes the storefront product reference.
|
|
474
|
+
* @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
|
|
475
|
+
* @param storefrontId Storefront identifier.
|
|
476
|
+
* @param tenantId (optional) Tenant identifier.
|
|
477
|
+
* @return Success
|
|
478
|
+
*/
|
|
479
|
+
delete(reference, storefrontId, tenantId) {
|
|
480
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/product-references/{reference}?";
|
|
481
|
+
if (reference === undefined || reference === null)
|
|
482
|
+
throw new Error("The parameter 'reference' must be defined.");
|
|
483
|
+
url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
|
|
484
|
+
if (storefrontId === undefined || storefrontId === null)
|
|
485
|
+
throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
|
|
486
|
+
else
|
|
487
|
+
url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
|
|
488
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
489
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
490
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
491
|
+
let options_ = {
|
|
492
|
+
observe: "response",
|
|
493
|
+
responseType: "blob",
|
|
494
|
+
headers: new HttpHeaders({
|
|
495
|
+
"Accept": "application/json"
|
|
496
|
+
})
|
|
497
|
+
};
|
|
498
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
499
|
+
return this.http.request("delete", url_, transformedOptions_);
|
|
500
|
+
})).pipe(mergeMap((response_) => {
|
|
501
|
+
return this.transformResult(url_, response_, (r) => this.processDelete(r));
|
|
502
|
+
})).pipe(catchError((response_) => {
|
|
503
|
+
if (response_ instanceof HttpResponseBase) {
|
|
504
|
+
try {
|
|
505
|
+
return this.transformResult(url_, response_, (r) => this.processDelete(r));
|
|
506
|
+
}
|
|
507
|
+
catch (e) {
|
|
508
|
+
return throwError(e);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
else
|
|
512
|
+
return throwError(response_);
|
|
513
|
+
}));
|
|
514
|
+
}
|
|
515
|
+
processDelete(response) {
|
|
516
|
+
const status = response.status;
|
|
517
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
518
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
519
|
+
let _headers = {};
|
|
520
|
+
if (response.headers) {
|
|
521
|
+
for (let key of response.headers.keys()) {
|
|
522
|
+
_headers[key] = response.headers.get(key);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (status === 200) {
|
|
526
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
527
|
+
let result200 = null;
|
|
528
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
529
|
+
return of(result200);
|
|
530
|
+
}));
|
|
531
|
+
}
|
|
532
|
+
else if (status === 404) {
|
|
533
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
534
|
+
let result404 = null;
|
|
535
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
536
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
537
|
+
}));
|
|
538
|
+
}
|
|
539
|
+
else if (status === 409) {
|
|
540
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
541
|
+
let result409 = null;
|
|
542
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
543
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
544
|
+
}));
|
|
545
|
+
}
|
|
546
|
+
else if (status === 401) {
|
|
547
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
548
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
549
|
+
}));
|
|
550
|
+
}
|
|
551
|
+
else if (status === 403) {
|
|
552
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
553
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
554
|
+
}));
|
|
555
|
+
}
|
|
556
|
+
else if (status !== 200 && status !== 204) {
|
|
557
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
558
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
559
|
+
}));
|
|
560
|
+
}
|
|
561
|
+
return of(null);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
ProductReferencesManagementApiClient.ɵprov = ɵɵdefineInjectable({ factory: function ProductReferencesManagementApiClient_Factory() { return new ProductReferencesManagementApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: ProductReferencesManagementApiClient, providedIn: "root" });
|
|
565
|
+
ProductReferencesManagementApiClient.decorators = [
|
|
566
|
+
{ type: Injectable, args: [{
|
|
567
|
+
providedIn: 'root'
|
|
568
|
+
},] }
|
|
569
|
+
];
|
|
570
|
+
ProductReferencesManagementApiClient.ctorParameters = () => [
|
|
571
|
+
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
572
|
+
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
573
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
574
|
+
];
|
|
575
|
+
class ProductsManagementApiClient extends ApiClientBase {
|
|
576
|
+
constructor(configuration, http, baseUrl) {
|
|
577
|
+
super(configuration);
|
|
578
|
+
this.jsonParseReviver = undefined;
|
|
579
|
+
this.http = http;
|
|
580
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Returns all products, relevant to the specified query parameters.
|
|
584
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
585
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
586
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
587
|
+
* @param search (optional) Search string for partial match.
|
|
588
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
589
|
+
* @param tags (optional) List of tags that product should have.
|
|
590
|
+
* @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
|
|
591
|
+
* @param tenantId (optional) Tenant identifier.
|
|
592
|
+
* @return Success
|
|
593
|
+
*/
|
|
594
|
+
getAllProducts(skip, take, sorting, search, sku, tags, customFields, tenantId) {
|
|
595
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products?";
|
|
596
|
+
if (skip !== undefined && skip !== null)
|
|
597
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
598
|
+
if (take !== undefined && take !== null)
|
|
599
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
600
|
+
if (sorting !== undefined && sorting !== null)
|
|
601
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
602
|
+
if (search !== undefined && search !== null)
|
|
603
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
604
|
+
if (sku !== undefined && sku !== null)
|
|
605
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
606
|
+
if (tags !== undefined && tags !== null)
|
|
607
|
+
tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
|
|
608
|
+
if (customFields !== undefined && customFields !== null)
|
|
609
|
+
url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
|
|
610
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
611
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
612
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
613
|
+
let options_ = {
|
|
614
|
+
observe: "response",
|
|
615
|
+
responseType: "blob",
|
|
616
|
+
headers: new HttpHeaders({
|
|
617
|
+
"Accept": "application/json"
|
|
618
|
+
})
|
|
619
|
+
};
|
|
620
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
621
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
622
|
+
})).pipe(mergeMap((response_) => {
|
|
623
|
+
return this.transformResult(url_, response_, (r) => this.processGetAllProducts(r));
|
|
624
|
+
})).pipe(catchError((response_) => {
|
|
625
|
+
if (response_ instanceof HttpResponseBase) {
|
|
626
|
+
try {
|
|
627
|
+
return this.transformResult(url_, response_, (r) => this.processGetAllProducts(r));
|
|
628
|
+
}
|
|
629
|
+
catch (e) {
|
|
630
|
+
return throwError(e);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
else
|
|
634
|
+
return throwError(response_);
|
|
635
|
+
}));
|
|
636
|
+
}
|
|
637
|
+
processGetAllProducts(response) {
|
|
638
|
+
const status = response.status;
|
|
639
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
640
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
641
|
+
let _headers = {};
|
|
642
|
+
if (response.headers) {
|
|
643
|
+
for (let key of response.headers.keys()) {
|
|
644
|
+
_headers[key] = response.headers.get(key);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if (status === 200) {
|
|
648
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
649
|
+
let result200 = null;
|
|
650
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
651
|
+
return of(result200);
|
|
652
|
+
}));
|
|
653
|
+
}
|
|
654
|
+
else if (status === 401) {
|
|
655
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
656
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
657
|
+
}));
|
|
658
|
+
}
|
|
659
|
+
else if (status === 403) {
|
|
660
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
661
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
662
|
+
}));
|
|
663
|
+
}
|
|
664
|
+
else if (status !== 200 && status !== 204) {
|
|
665
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
666
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
667
|
+
}));
|
|
668
|
+
}
|
|
669
|
+
return of(null);
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Creates a new product and returns its description.
|
|
673
|
+
* @param tenantId (optional) Tenant identifier.
|
|
674
|
+
* @param body (optional)
|
|
675
|
+
* @return Success
|
|
676
|
+
*/
|
|
677
|
+
createProduct(tenantId, body) {
|
|
678
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products?";
|
|
679
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
680
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
681
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
682
|
+
const content_ = JSON.stringify(body);
|
|
683
|
+
let options_ = {
|
|
684
|
+
body: content_,
|
|
685
|
+
observe: "response",
|
|
686
|
+
responseType: "blob",
|
|
687
|
+
headers: new HttpHeaders({
|
|
688
|
+
"Content-Type": "application/json",
|
|
689
|
+
"Accept": "application/json"
|
|
690
|
+
})
|
|
691
|
+
};
|
|
692
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
693
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
694
|
+
})).pipe(mergeMap((response_) => {
|
|
695
|
+
return this.transformResult(url_, response_, (r) => this.processCreateProduct(r));
|
|
696
|
+
})).pipe(catchError((response_) => {
|
|
697
|
+
if (response_ instanceof HttpResponseBase) {
|
|
698
|
+
try {
|
|
699
|
+
return this.transformResult(url_, response_, (r) => this.processCreateProduct(r));
|
|
700
|
+
}
|
|
701
|
+
catch (e) {
|
|
702
|
+
return throwError(e);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
else
|
|
706
|
+
return throwError(response_);
|
|
707
|
+
}));
|
|
708
|
+
}
|
|
709
|
+
processCreateProduct(response) {
|
|
710
|
+
const status = response.status;
|
|
711
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
712
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
713
|
+
let _headers = {};
|
|
714
|
+
if (response.headers) {
|
|
715
|
+
for (let key of response.headers.keys()) {
|
|
716
|
+
_headers[key] = response.headers.get(key);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
if (status === 200) {
|
|
720
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
721
|
+
let result200 = null;
|
|
722
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
723
|
+
return of(result200);
|
|
724
|
+
}));
|
|
725
|
+
}
|
|
726
|
+
else if (status === 401) {
|
|
727
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
728
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
729
|
+
}));
|
|
730
|
+
}
|
|
731
|
+
else if (status === 403) {
|
|
732
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
733
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
734
|
+
}));
|
|
735
|
+
}
|
|
736
|
+
else if (status !== 200 && status !== 204) {
|
|
737
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
738
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
739
|
+
}));
|
|
740
|
+
}
|
|
741
|
+
return of(null);
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Returns a product by its identifier.
|
|
745
|
+
* @param id Product identifier.
|
|
746
|
+
* @param productVersionId (optional) Product version identifier.
|
|
747
|
+
* @param tenantId (optional) Tenant identifier.
|
|
748
|
+
* @return Success
|
|
749
|
+
*/
|
|
750
|
+
getProduct(id, productVersionId, tenantId) {
|
|
751
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}?";
|
|
752
|
+
if (id === undefined || id === null)
|
|
753
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
754
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
755
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
756
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
757
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
758
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
759
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
760
|
+
let options_ = {
|
|
761
|
+
observe: "response",
|
|
762
|
+
responseType: "blob",
|
|
763
|
+
headers: new HttpHeaders({
|
|
764
|
+
"Accept": "application/json"
|
|
765
|
+
})
|
|
766
|
+
};
|
|
767
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
768
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
769
|
+
})).pipe(mergeMap((response_) => {
|
|
770
|
+
return this.transformResult(url_, response_, (r) => this.processGetProduct(r));
|
|
771
|
+
})).pipe(catchError((response_) => {
|
|
772
|
+
if (response_ instanceof HttpResponseBase) {
|
|
773
|
+
try {
|
|
774
|
+
return this.transformResult(url_, response_, (r) => this.processGetProduct(r));
|
|
775
|
+
}
|
|
776
|
+
catch (e) {
|
|
777
|
+
return throwError(e);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
else
|
|
781
|
+
return throwError(response_);
|
|
782
|
+
}));
|
|
783
|
+
}
|
|
784
|
+
processGetProduct(response) {
|
|
785
|
+
const status = response.status;
|
|
786
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
787
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
788
|
+
let _headers = {};
|
|
789
|
+
if (response.headers) {
|
|
790
|
+
for (let key of response.headers.keys()) {
|
|
791
|
+
_headers[key] = response.headers.get(key);
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
if (status === 200) {
|
|
795
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
796
|
+
let result200 = null;
|
|
797
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
798
|
+
return of(result200);
|
|
799
|
+
}));
|
|
800
|
+
}
|
|
801
|
+
else if (status === 404) {
|
|
802
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
803
|
+
let result404 = null;
|
|
804
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
805
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
806
|
+
}));
|
|
807
|
+
}
|
|
808
|
+
else if (status === 409) {
|
|
809
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
810
|
+
let result409 = null;
|
|
811
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
812
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
813
|
+
}));
|
|
814
|
+
}
|
|
815
|
+
else if (status === 401) {
|
|
816
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
817
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
818
|
+
}));
|
|
819
|
+
}
|
|
820
|
+
else if (status === 403) {
|
|
821
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
822
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
823
|
+
}));
|
|
824
|
+
}
|
|
825
|
+
else if (status !== 200 && status !== 204) {
|
|
826
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
827
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
828
|
+
}));
|
|
829
|
+
}
|
|
830
|
+
return of(null);
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Deletes a product by its identifier.
|
|
834
|
+
* @param id Product identifier.
|
|
835
|
+
* @param tenantId (optional) Tenant identifier.
|
|
836
|
+
* @return Success
|
|
837
|
+
*/
|
|
838
|
+
deleteProduct(id, tenantId) {
|
|
839
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}?";
|
|
840
|
+
if (id === undefined || id === null)
|
|
841
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
842
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
843
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
844
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
845
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
846
|
+
let options_ = {
|
|
847
|
+
observe: "response",
|
|
848
|
+
responseType: "blob",
|
|
849
|
+
headers: new HttpHeaders({})
|
|
850
|
+
};
|
|
851
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
852
|
+
return this.http.request("delete", url_, transformedOptions_);
|
|
853
|
+
})).pipe(mergeMap((response_) => {
|
|
854
|
+
return this.transformResult(url_, response_, (r) => this.processDeleteProduct(r));
|
|
855
|
+
})).pipe(catchError((response_) => {
|
|
856
|
+
if (response_ instanceof HttpResponseBase) {
|
|
857
|
+
try {
|
|
858
|
+
return this.transformResult(url_, response_, (r) => this.processDeleteProduct(r));
|
|
859
|
+
}
|
|
860
|
+
catch (e) {
|
|
861
|
+
return throwError(e);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
else
|
|
865
|
+
return throwError(response_);
|
|
866
|
+
}));
|
|
867
|
+
}
|
|
868
|
+
processDeleteProduct(response) {
|
|
869
|
+
const status = response.status;
|
|
870
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
871
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
872
|
+
let _headers = {};
|
|
873
|
+
if (response.headers) {
|
|
874
|
+
for (let key of response.headers.keys()) {
|
|
875
|
+
_headers[key] = response.headers.get(key);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
if (status === 200) {
|
|
879
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
880
|
+
return of(null);
|
|
881
|
+
}));
|
|
882
|
+
}
|
|
883
|
+
else if (status === 404) {
|
|
884
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
885
|
+
let result404 = null;
|
|
886
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
887
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
888
|
+
}));
|
|
889
|
+
}
|
|
890
|
+
else if (status === 409) {
|
|
891
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
892
|
+
let result409 = null;
|
|
893
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
894
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
895
|
+
}));
|
|
896
|
+
}
|
|
897
|
+
else if (status === 401) {
|
|
898
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
899
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
900
|
+
}));
|
|
901
|
+
}
|
|
902
|
+
else if (status === 403) {
|
|
903
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
904
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
905
|
+
}));
|
|
906
|
+
}
|
|
907
|
+
else if (status !== 200 && status !== 204) {
|
|
908
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
909
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
910
|
+
}));
|
|
911
|
+
}
|
|
912
|
+
return of(null);
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Returns a list of product options.
|
|
916
|
+
* @param id Product identifier.
|
|
917
|
+
* @param productVersionId (optional) Product version identifier.
|
|
918
|
+
* @param tenantId (optional) Tenant identifier.
|
|
919
|
+
* @return Success
|
|
920
|
+
*/
|
|
921
|
+
getProductOptions(id, productVersionId, tenantId) {
|
|
922
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/options?";
|
|
923
|
+
if (id === undefined || id === null)
|
|
924
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
925
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
926
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
927
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
928
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
929
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
930
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
931
|
+
let options_ = {
|
|
932
|
+
observe: "response",
|
|
933
|
+
responseType: "blob",
|
|
934
|
+
headers: new HttpHeaders({
|
|
935
|
+
"Accept": "application/json"
|
|
936
|
+
})
|
|
937
|
+
};
|
|
938
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
939
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
940
|
+
})).pipe(mergeMap((response_) => {
|
|
941
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductOptions(r));
|
|
942
|
+
})).pipe(catchError((response_) => {
|
|
943
|
+
if (response_ instanceof HttpResponseBase) {
|
|
944
|
+
try {
|
|
945
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductOptions(r));
|
|
946
|
+
}
|
|
947
|
+
catch (e) {
|
|
948
|
+
return throwError(e);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
else
|
|
952
|
+
return throwError(response_);
|
|
953
|
+
}));
|
|
954
|
+
}
|
|
955
|
+
processGetProductOptions(response) {
|
|
956
|
+
const status = response.status;
|
|
957
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
958
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
959
|
+
let _headers = {};
|
|
960
|
+
if (response.headers) {
|
|
961
|
+
for (let key of response.headers.keys()) {
|
|
962
|
+
_headers[key] = response.headers.get(key);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
if (status === 200) {
|
|
966
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
967
|
+
let result200 = null;
|
|
968
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
969
|
+
return of(result200);
|
|
970
|
+
}));
|
|
971
|
+
}
|
|
972
|
+
else if (status === 404) {
|
|
973
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
974
|
+
let result404 = null;
|
|
975
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
976
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
977
|
+
}));
|
|
978
|
+
}
|
|
979
|
+
else if (status === 409) {
|
|
980
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
981
|
+
let result409 = null;
|
|
982
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
983
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
984
|
+
}));
|
|
985
|
+
}
|
|
986
|
+
else if (status === 401) {
|
|
987
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
988
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
989
|
+
}));
|
|
990
|
+
}
|
|
991
|
+
else if (status === 403) {
|
|
992
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
993
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
994
|
+
}));
|
|
995
|
+
}
|
|
996
|
+
else if (status !== 200 && status !== 204) {
|
|
997
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
998
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
999
|
+
}));
|
|
1000
|
+
}
|
|
1001
|
+
return of(null);
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Returns a list of product variants.
|
|
1005
|
+
* @param id Product identifier.
|
|
1006
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1007
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
1008
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
1009
|
+
* @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
|
|
1010
|
+
* @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
|
|
1011
|
+
* @param takeAvailableOnly (optional) Defines special filter for available product variants.
|
|
1012
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
1013
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1014
|
+
* @return Success
|
|
1015
|
+
*/
|
|
1016
|
+
getProductVariants(id, productVersionId, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
|
|
1017
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variants?";
|
|
1018
|
+
if (id === undefined || id === null)
|
|
1019
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1020
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1021
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1022
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1023
|
+
if (skip !== undefined && skip !== null)
|
|
1024
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1025
|
+
if (take !== undefined && take !== null)
|
|
1026
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1027
|
+
if (options !== undefined && options !== null)
|
|
1028
|
+
url_ += "options=" + encodeURIComponent("" + options) + "&";
|
|
1029
|
+
if (productFilterId !== undefined && productFilterId !== null)
|
|
1030
|
+
url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
|
|
1031
|
+
if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
|
|
1032
|
+
url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
|
|
1033
|
+
if (sku !== undefined && sku !== null)
|
|
1034
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
1035
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1036
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1037
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1038
|
+
let options_ = {
|
|
1039
|
+
observe: "response",
|
|
1040
|
+
responseType: "blob",
|
|
1041
|
+
headers: new HttpHeaders({
|
|
1042
|
+
"Accept": "application/json"
|
|
1043
|
+
})
|
|
1044
|
+
};
|
|
1045
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1046
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
1047
|
+
})).pipe(mergeMap((response_) => {
|
|
1048
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariants(r));
|
|
1049
|
+
})).pipe(catchError((response_) => {
|
|
1050
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1051
|
+
try {
|
|
1052
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariants(r));
|
|
1053
|
+
}
|
|
1054
|
+
catch (e) {
|
|
1055
|
+
return throwError(e);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
else
|
|
1059
|
+
return throwError(response_);
|
|
1060
|
+
}));
|
|
1061
|
+
}
|
|
1062
|
+
processGetProductVariants(response) {
|
|
1063
|
+
const status = response.status;
|
|
1064
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1065
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1066
|
+
let _headers = {};
|
|
1067
|
+
if (response.headers) {
|
|
1068
|
+
for (let key of response.headers.keys()) {
|
|
1069
|
+
_headers[key] = response.headers.get(key);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
if (status === 200) {
|
|
1073
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1074
|
+
let result200 = null;
|
|
1075
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1076
|
+
return of(result200);
|
|
1077
|
+
}));
|
|
1078
|
+
}
|
|
1079
|
+
else if (status === 404) {
|
|
1080
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1081
|
+
let result404 = null;
|
|
1082
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1083
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1084
|
+
}));
|
|
1085
|
+
}
|
|
1086
|
+
else if (status === 409) {
|
|
1087
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1088
|
+
let result409 = null;
|
|
1089
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1090
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1091
|
+
}));
|
|
1092
|
+
}
|
|
1093
|
+
else if (status === 401) {
|
|
1094
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1095
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1096
|
+
}));
|
|
1097
|
+
}
|
|
1098
|
+
else if (status === 403) {
|
|
1099
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1100
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1101
|
+
}));
|
|
1102
|
+
}
|
|
1103
|
+
else if (status !== 200 && status !== 204) {
|
|
1104
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1105
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1106
|
+
}));
|
|
1107
|
+
}
|
|
1108
|
+
return of(null);
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Returns a product variant.
|
|
1112
|
+
* @param id Product identifier.
|
|
1113
|
+
* @param productVariantId Product variant identifier.
|
|
1114
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1115
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1116
|
+
* @return Success
|
|
1117
|
+
*/
|
|
1118
|
+
getProductVariant(id, productVariantId, productVersionId, tenantId) {
|
|
1119
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variants/{productVariantId}?";
|
|
1120
|
+
if (id === undefined || id === null)
|
|
1121
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1122
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1123
|
+
if (productVariantId === undefined || productVariantId === null)
|
|
1124
|
+
throw new Error("The parameter 'productVariantId' must be defined.");
|
|
1125
|
+
url_ = url_.replace("{productVariantId}", encodeURIComponent("" + productVariantId));
|
|
1126
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1127
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1128
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1129
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1130
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1131
|
+
let options_ = {
|
|
1132
|
+
observe: "response",
|
|
1133
|
+
responseType: "blob",
|
|
1134
|
+
headers: new HttpHeaders({
|
|
1135
|
+
"Accept": "application/json"
|
|
1136
|
+
})
|
|
1137
|
+
};
|
|
1138
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1139
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
1140
|
+
})).pipe(mergeMap((response_) => {
|
|
1141
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariant(r));
|
|
1142
|
+
})).pipe(catchError((response_) => {
|
|
1143
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1144
|
+
try {
|
|
1145
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariant(r));
|
|
1146
|
+
}
|
|
1147
|
+
catch (e) {
|
|
1148
|
+
return throwError(e);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
else
|
|
1152
|
+
return throwError(response_);
|
|
1153
|
+
}));
|
|
1154
|
+
}
|
|
1155
|
+
processGetProductVariant(response) {
|
|
1156
|
+
const status = response.status;
|
|
1157
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1158
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1159
|
+
let _headers = {};
|
|
1160
|
+
if (response.headers) {
|
|
1161
|
+
for (let key of response.headers.keys()) {
|
|
1162
|
+
_headers[key] = response.headers.get(key);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
if (status === 200) {
|
|
1166
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1167
|
+
let result200 = null;
|
|
1168
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1169
|
+
return of(result200);
|
|
1170
|
+
}));
|
|
1171
|
+
}
|
|
1172
|
+
else if (status === 404) {
|
|
1173
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1174
|
+
let result404 = null;
|
|
1175
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1176
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1177
|
+
}));
|
|
1178
|
+
}
|
|
1179
|
+
else if (status === 409) {
|
|
1180
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1181
|
+
let result409 = null;
|
|
1182
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1183
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1184
|
+
}));
|
|
1185
|
+
}
|
|
1186
|
+
else if (status === 401) {
|
|
1187
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1188
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1189
|
+
}));
|
|
1190
|
+
}
|
|
1191
|
+
else if (status === 403) {
|
|
1192
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1193
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1194
|
+
}));
|
|
1195
|
+
}
|
|
1196
|
+
else if (status !== 200 && status !== 204) {
|
|
1197
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1198
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1199
|
+
}));
|
|
1200
|
+
}
|
|
1201
|
+
return of(null);
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Returns a list of product variant designs.
|
|
1205
|
+
* @param id Product identifier.
|
|
1206
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1207
|
+
* @param productVariantId (optional) Product variant identifier.
|
|
1208
|
+
* @param search (optional) Search string for design name partial match.
|
|
1209
|
+
* @param designCustomFields (optional) Custom attributes dictionary filter for designs. For example: {"public":"true","name":"my item"}
|
|
1210
|
+
* @param designPath (optional) Path filter for designs. Subfolders included by default.
|
|
1211
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
1212
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
1213
|
+
* @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
|
|
1214
|
+
* @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
|
|
1215
|
+
* @param takeAvailableOnly (optional) Defines special filter for available product variants.
|
|
1216
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
1217
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1218
|
+
* @return Success
|
|
1219
|
+
*/
|
|
1220
|
+
getProductVariantDesigns(id, productVersionId, productVariantId, search, designCustomFields, designPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
|
|
1221
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variant-designs?";
|
|
1222
|
+
if (id === undefined || id === null)
|
|
1223
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1224
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1225
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1226
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1227
|
+
if (productVariantId !== undefined && productVariantId !== null)
|
|
1228
|
+
url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
|
|
1229
|
+
if (search !== undefined && search !== null)
|
|
1230
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
1231
|
+
if (designCustomFields !== undefined && designCustomFields !== null)
|
|
1232
|
+
url_ += "designCustomFields=" + encodeURIComponent("" + designCustomFields) + "&";
|
|
1233
|
+
if (designPath !== undefined && designPath !== null)
|
|
1234
|
+
url_ += "designPath=" + encodeURIComponent("" + designPath) + "&";
|
|
1235
|
+
if (skip !== undefined && skip !== null)
|
|
1236
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1237
|
+
if (take !== undefined && take !== null)
|
|
1238
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1239
|
+
if (options !== undefined && options !== null)
|
|
1240
|
+
url_ += "options=" + encodeURIComponent("" + options) + "&";
|
|
1241
|
+
if (productFilterId !== undefined && productFilterId !== null)
|
|
1242
|
+
url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
|
|
1243
|
+
if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
|
|
1244
|
+
url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
|
|
1245
|
+
if (sku !== undefined && sku !== null)
|
|
1246
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
1247
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1248
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1249
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1250
|
+
let options_ = {
|
|
1251
|
+
observe: "response",
|
|
1252
|
+
responseType: "blob",
|
|
1253
|
+
headers: new HttpHeaders({
|
|
1254
|
+
"Accept": "application/json"
|
|
1255
|
+
})
|
|
1256
|
+
};
|
|
1257
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1258
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
1259
|
+
})).pipe(mergeMap((response_) => {
|
|
1260
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariantDesigns(r));
|
|
1261
|
+
})).pipe(catchError((response_) => {
|
|
1262
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1263
|
+
try {
|
|
1264
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariantDesigns(r));
|
|
1265
|
+
}
|
|
1266
|
+
catch (e) {
|
|
1267
|
+
return throwError(e);
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
else
|
|
1271
|
+
return throwError(response_);
|
|
1272
|
+
}));
|
|
1273
|
+
}
|
|
1274
|
+
processGetProductVariantDesigns(response) {
|
|
1275
|
+
const status = response.status;
|
|
1276
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1277
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1278
|
+
let _headers = {};
|
|
1279
|
+
if (response.headers) {
|
|
1280
|
+
for (let key of response.headers.keys()) {
|
|
1281
|
+
_headers[key] = response.headers.get(key);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
if (status === 200) {
|
|
1285
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1286
|
+
let result200 = null;
|
|
1287
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1288
|
+
return of(result200);
|
|
1289
|
+
}));
|
|
1290
|
+
}
|
|
1291
|
+
else if (status === 404) {
|
|
1292
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1293
|
+
let result404 = null;
|
|
1294
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1295
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1296
|
+
}));
|
|
1297
|
+
}
|
|
1298
|
+
else if (status === 409) {
|
|
1299
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1300
|
+
let result409 = null;
|
|
1301
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1302
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1303
|
+
}));
|
|
1304
|
+
}
|
|
1305
|
+
else if (status === 401) {
|
|
1306
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1307
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1308
|
+
}));
|
|
1309
|
+
}
|
|
1310
|
+
else if (status === 403) {
|
|
1311
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1312
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1313
|
+
}));
|
|
1314
|
+
}
|
|
1315
|
+
else if (status !== 200 && status !== 204) {
|
|
1316
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1317
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1318
|
+
}));
|
|
1319
|
+
}
|
|
1320
|
+
return of(null);
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Returns a list of product variant mockups.
|
|
1324
|
+
* @param id Product identifier.
|
|
1325
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1326
|
+
* @param productVariantId (optional) Product variant identifier.
|
|
1327
|
+
* @param search (optional) Search string for design name partial match.
|
|
1328
|
+
* @param mockupCustomFields (optional) Custom attributes dictionary filter for mockups. For example: {"public":"true","name":"my item"}
|
|
1329
|
+
* @param mockupPath (optional) Path filter for mockups. Subfolders included by default.
|
|
1330
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
1331
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
1332
|
+
* @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
|
|
1333
|
+
* @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
|
|
1334
|
+
* @param takeAvailableOnly (optional) Defines special filter for available product variants.
|
|
1335
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
1336
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1337
|
+
* @return Success
|
|
1338
|
+
*/
|
|
1339
|
+
getProductVariantMockups(id, productVersionId, productVariantId, search, mockupCustomFields, mockupPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
|
|
1340
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variant-mockups?";
|
|
1341
|
+
if (id === undefined || id === null)
|
|
1342
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1343
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1344
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1345
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1346
|
+
if (productVariantId !== undefined && productVariantId !== null)
|
|
1347
|
+
url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
|
|
1348
|
+
if (search !== undefined && search !== null)
|
|
1349
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
1350
|
+
if (mockupCustomFields !== undefined && mockupCustomFields !== null)
|
|
1351
|
+
url_ += "mockupCustomFields=" + encodeURIComponent("" + mockupCustomFields) + "&";
|
|
1352
|
+
if (mockupPath !== undefined && mockupPath !== null)
|
|
1353
|
+
url_ += "mockupPath=" + encodeURIComponent("" + mockupPath) + "&";
|
|
1354
|
+
if (skip !== undefined && skip !== null)
|
|
1355
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1356
|
+
if (take !== undefined && take !== null)
|
|
1357
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1358
|
+
if (options !== undefined && options !== null)
|
|
1359
|
+
url_ += "options=" + encodeURIComponent("" + options) + "&";
|
|
1360
|
+
if (productFilterId !== undefined && productFilterId !== null)
|
|
1361
|
+
url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
|
|
1362
|
+
if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
|
|
1363
|
+
url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
|
|
1364
|
+
if (sku !== undefined && sku !== null)
|
|
1365
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
1366
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1367
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1368
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1369
|
+
let options_ = {
|
|
1370
|
+
observe: "response",
|
|
1371
|
+
responseType: "blob",
|
|
1372
|
+
headers: new HttpHeaders({
|
|
1373
|
+
"Accept": "application/json"
|
|
1374
|
+
})
|
|
1375
|
+
};
|
|
1376
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1377
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
1378
|
+
})).pipe(mergeMap((response_) => {
|
|
1379
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariantMockups(r));
|
|
1380
|
+
})).pipe(catchError((response_) => {
|
|
1381
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1382
|
+
try {
|
|
1383
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariantMockups(r));
|
|
1384
|
+
}
|
|
1385
|
+
catch (e) {
|
|
1386
|
+
return throwError(e);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
else
|
|
1390
|
+
return throwError(response_);
|
|
1391
|
+
}));
|
|
1392
|
+
}
|
|
1393
|
+
processGetProductVariantMockups(response) {
|
|
1394
|
+
const status = response.status;
|
|
1395
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1396
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1397
|
+
let _headers = {};
|
|
1398
|
+
if (response.headers) {
|
|
1399
|
+
for (let key of response.headers.keys()) {
|
|
1400
|
+
_headers[key] = response.headers.get(key);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
if (status === 200) {
|
|
1404
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1405
|
+
let result200 = null;
|
|
1406
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1407
|
+
return of(result200);
|
|
1408
|
+
}));
|
|
1409
|
+
}
|
|
1410
|
+
else if (status === 404) {
|
|
1411
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1412
|
+
let result404 = null;
|
|
1413
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1414
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1415
|
+
}));
|
|
1416
|
+
}
|
|
1417
|
+
else if (status === 409) {
|
|
1418
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1419
|
+
let result409 = null;
|
|
1420
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1421
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1422
|
+
}));
|
|
1423
|
+
}
|
|
1424
|
+
else if (status === 401) {
|
|
1425
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1426
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1427
|
+
}));
|
|
1428
|
+
}
|
|
1429
|
+
else if (status === 403) {
|
|
1430
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1431
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1432
|
+
}));
|
|
1433
|
+
}
|
|
1434
|
+
else if (status !== 200 && status !== 204) {
|
|
1435
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1436
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1437
|
+
}));
|
|
1438
|
+
}
|
|
1439
|
+
return of(null);
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Returns a list of product variant documents.
|
|
1443
|
+
* @param id Product identifier.
|
|
1444
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1445
|
+
* @param productVariantId (optional) Product variant identifier.
|
|
1446
|
+
* @param search (optional) Search string for document name partial match.
|
|
1447
|
+
* @param documentCustomFields (optional) Custom attributes dictionary filter for documents. For example: {"public":"true","name":"my item"}
|
|
1448
|
+
* @param documentPath (optional) Path filter for documents. Subfolders included by default.
|
|
1449
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
1450
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
1451
|
+
* @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
|
|
1452
|
+
* @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
|
|
1453
|
+
* @param takeAvailableOnly (optional) Defines special filter for available product variants.
|
|
1454
|
+
* @param sku (optional) SKU of linked ecommerce product.
|
|
1455
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1456
|
+
* @return Success
|
|
1457
|
+
*/
|
|
1458
|
+
getProductVariantDocuments(id, productVersionId, productVariantId, search, documentCustomFields, documentPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
|
|
1459
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/variant-documents?";
|
|
1460
|
+
if (id === undefined || id === null)
|
|
1461
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1462
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1463
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1464
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1465
|
+
if (productVariantId !== undefined && productVariantId !== null)
|
|
1466
|
+
url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
|
|
1467
|
+
if (search !== undefined && search !== null)
|
|
1468
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
1469
|
+
if (documentCustomFields !== undefined && documentCustomFields !== null)
|
|
1470
|
+
url_ += "documentCustomFields=" + encodeURIComponent("" + documentCustomFields) + "&";
|
|
1471
|
+
if (documentPath !== undefined && documentPath !== null)
|
|
1472
|
+
url_ += "documentPath=" + encodeURIComponent("" + documentPath) + "&";
|
|
1473
|
+
if (skip !== undefined && skip !== null)
|
|
1474
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
1475
|
+
if (take !== undefined && take !== null)
|
|
1476
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
1477
|
+
if (options !== undefined && options !== null)
|
|
1478
|
+
url_ += "options=" + encodeURIComponent("" + options) + "&";
|
|
1479
|
+
if (productFilterId !== undefined && productFilterId !== null)
|
|
1480
|
+
url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
|
|
1481
|
+
if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
|
|
1482
|
+
url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
|
|
1483
|
+
if (sku !== undefined && sku !== null)
|
|
1484
|
+
url_ += "sku=" + encodeURIComponent("" + sku) + "&";
|
|
1485
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1486
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1487
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1488
|
+
let options_ = {
|
|
1489
|
+
observe: "response",
|
|
1490
|
+
responseType: "blob",
|
|
1491
|
+
headers: new HttpHeaders({
|
|
1492
|
+
"Accept": "application/json"
|
|
1493
|
+
})
|
|
1494
|
+
};
|
|
1495
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1496
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
1497
|
+
})).pipe(mergeMap((response_) => {
|
|
1498
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariantDocuments(r));
|
|
1499
|
+
})).pipe(catchError((response_) => {
|
|
1500
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1501
|
+
try {
|
|
1502
|
+
return this.transformResult(url_, response_, (r) => this.processGetProductVariantDocuments(r));
|
|
1503
|
+
}
|
|
1504
|
+
catch (e) {
|
|
1505
|
+
return throwError(e);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
else
|
|
1509
|
+
return throwError(response_);
|
|
1510
|
+
}));
|
|
1511
|
+
}
|
|
1512
|
+
processGetProductVariantDocuments(response) {
|
|
1513
|
+
const status = response.status;
|
|
1514
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1515
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1516
|
+
let _headers = {};
|
|
1517
|
+
if (response.headers) {
|
|
1518
|
+
for (let key of response.headers.keys()) {
|
|
1519
|
+
_headers[key] = response.headers.get(key);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
if (status === 200) {
|
|
1523
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1524
|
+
let result200 = null;
|
|
1525
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1526
|
+
return of(result200);
|
|
1527
|
+
}));
|
|
1528
|
+
}
|
|
1529
|
+
else if (status === 404) {
|
|
1530
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1531
|
+
let result404 = null;
|
|
1532
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1533
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1534
|
+
}));
|
|
1535
|
+
}
|
|
1536
|
+
else if (status === 409) {
|
|
1537
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1538
|
+
let result409 = null;
|
|
1539
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1540
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1541
|
+
}));
|
|
1542
|
+
}
|
|
1543
|
+
else if (status === 401) {
|
|
1544
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1545
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1546
|
+
}));
|
|
1547
|
+
}
|
|
1548
|
+
else if (status === 403) {
|
|
1549
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1550
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1551
|
+
}));
|
|
1552
|
+
}
|
|
1553
|
+
else if (status !== 200 && status !== 204) {
|
|
1554
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1555
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1556
|
+
}));
|
|
1557
|
+
}
|
|
1558
|
+
return of(null);
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* Set product variants price. Variants identifiers will be changed.
|
|
1562
|
+
* @param id Product identifier.
|
|
1563
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1564
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1565
|
+
* @param body (optional) Set product variants price operation parameters.
|
|
1566
|
+
* @return Success
|
|
1567
|
+
*/
|
|
1568
|
+
setProductVariantPrice(id, productVersionId, tenantId, body) {
|
|
1569
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-price?";
|
|
1570
|
+
if (id === undefined || id === null)
|
|
1571
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1572
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1573
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1574
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1575
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1576
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1577
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1578
|
+
const content_ = JSON.stringify(body);
|
|
1579
|
+
let options_ = {
|
|
1580
|
+
body: content_,
|
|
1581
|
+
observe: "response",
|
|
1582
|
+
responseType: "blob",
|
|
1583
|
+
headers: new HttpHeaders({
|
|
1584
|
+
"Content-Type": "application/json",
|
|
1585
|
+
})
|
|
1586
|
+
};
|
|
1587
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1588
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
1589
|
+
})).pipe(mergeMap((response_) => {
|
|
1590
|
+
return this.transformResult(url_, response_, (r) => this.processSetProductVariantPrice(r));
|
|
1591
|
+
})).pipe(catchError((response_) => {
|
|
1592
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1593
|
+
try {
|
|
1594
|
+
return this.transformResult(url_, response_, (r) => this.processSetProductVariantPrice(r));
|
|
1595
|
+
}
|
|
1596
|
+
catch (e) {
|
|
1597
|
+
return throwError(e);
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
else
|
|
1601
|
+
return throwError(response_);
|
|
1602
|
+
}));
|
|
1603
|
+
}
|
|
1604
|
+
processSetProductVariantPrice(response) {
|
|
1605
|
+
const status = response.status;
|
|
1606
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1607
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1608
|
+
let _headers = {};
|
|
1609
|
+
if (response.headers) {
|
|
1610
|
+
for (let key of response.headers.keys()) {
|
|
1611
|
+
_headers[key] = response.headers.get(key);
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
if (status === 200) {
|
|
1615
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1616
|
+
return of(null);
|
|
1617
|
+
}));
|
|
1618
|
+
}
|
|
1619
|
+
else if (status === 404) {
|
|
1620
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1621
|
+
let result404 = null;
|
|
1622
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1623
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1624
|
+
}));
|
|
1625
|
+
}
|
|
1626
|
+
else if (status === 409) {
|
|
1627
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1628
|
+
let result409 = null;
|
|
1629
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1630
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1631
|
+
}));
|
|
1632
|
+
}
|
|
1633
|
+
else if (status === 401) {
|
|
1634
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1635
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1636
|
+
}));
|
|
1637
|
+
}
|
|
1638
|
+
else if (status === 403) {
|
|
1639
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1640
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1641
|
+
}));
|
|
1642
|
+
}
|
|
1643
|
+
else if (status !== 200 && status !== 204) {
|
|
1644
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1645
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1646
|
+
}));
|
|
1647
|
+
}
|
|
1648
|
+
return of(null);
|
|
1649
|
+
}
|
|
1650
|
+
/**
|
|
1651
|
+
* Set product variants availability. Variants identifiers will be changed.
|
|
1652
|
+
* @param id Product identifier.
|
|
1653
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1654
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1655
|
+
* @param body (optional) Set product variants availability operation parameters.
|
|
1656
|
+
* @return Success
|
|
1657
|
+
*/
|
|
1658
|
+
setProductVariantAvailability(id, productVersionId, tenantId, body) {
|
|
1659
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-availability?";
|
|
1660
|
+
if (id === undefined || id === null)
|
|
1661
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1662
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1663
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1664
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1665
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1666
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1667
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1668
|
+
const content_ = JSON.stringify(body);
|
|
1669
|
+
let options_ = {
|
|
1670
|
+
body: content_,
|
|
1671
|
+
observe: "response",
|
|
1672
|
+
responseType: "blob",
|
|
1673
|
+
headers: new HttpHeaders({
|
|
1674
|
+
"Content-Type": "application/json",
|
|
1675
|
+
})
|
|
1676
|
+
};
|
|
1677
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1678
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
1679
|
+
})).pipe(mergeMap((response_) => {
|
|
1680
|
+
return this.transformResult(url_, response_, (r) => this.processSetProductVariantAvailability(r));
|
|
1681
|
+
})).pipe(catchError((response_) => {
|
|
1682
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1683
|
+
try {
|
|
1684
|
+
return this.transformResult(url_, response_, (r) => this.processSetProductVariantAvailability(r));
|
|
1685
|
+
}
|
|
1686
|
+
catch (e) {
|
|
1687
|
+
return throwError(e);
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
else
|
|
1691
|
+
return throwError(response_);
|
|
1692
|
+
}));
|
|
1693
|
+
}
|
|
1694
|
+
processSetProductVariantAvailability(response) {
|
|
1695
|
+
const status = response.status;
|
|
1696
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1697
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1698
|
+
let _headers = {};
|
|
1699
|
+
if (response.headers) {
|
|
1700
|
+
for (let key of response.headers.keys()) {
|
|
1701
|
+
_headers[key] = response.headers.get(key);
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
if (status === 200) {
|
|
1705
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1706
|
+
return of(null);
|
|
1707
|
+
}));
|
|
1708
|
+
}
|
|
1709
|
+
else if (status === 404) {
|
|
1710
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1711
|
+
let result404 = null;
|
|
1712
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1713
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1714
|
+
}));
|
|
1715
|
+
}
|
|
1716
|
+
else if (status === 409) {
|
|
1717
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1718
|
+
let result409 = null;
|
|
1719
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1720
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1721
|
+
}));
|
|
1722
|
+
}
|
|
1723
|
+
else if (status === 401) {
|
|
1724
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1725
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1726
|
+
}));
|
|
1727
|
+
}
|
|
1728
|
+
else if (status === 403) {
|
|
1729
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1730
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1731
|
+
}));
|
|
1732
|
+
}
|
|
1733
|
+
else if (status !== 200 && status !== 204) {
|
|
1734
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1735
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1736
|
+
}));
|
|
1737
|
+
}
|
|
1738
|
+
return of(null);
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* Set product variants SKU. Variants identifiers will be changed.
|
|
1742
|
+
* @param id Product identifier.
|
|
1743
|
+
* @param productVersionId (optional) Product version identifier.
|
|
1744
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1745
|
+
* @param body (optional) Set product variants SKU operation parameters.
|
|
1746
|
+
* @return Success
|
|
1747
|
+
*/
|
|
1748
|
+
setProductVariantSku(id, productVersionId, tenantId, body) {
|
|
1749
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-sku?";
|
|
1750
|
+
if (id === undefined || id === null)
|
|
1751
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1752
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1753
|
+
if (productVersionId !== undefined && productVersionId !== null)
|
|
1754
|
+
url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
|
|
1755
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1756
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1757
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1758
|
+
const content_ = JSON.stringify(body);
|
|
1759
|
+
let options_ = {
|
|
1760
|
+
body: content_,
|
|
1761
|
+
observe: "response",
|
|
1762
|
+
responseType: "blob",
|
|
1763
|
+
headers: new HttpHeaders({
|
|
1764
|
+
"Content-Type": "application/json",
|
|
1765
|
+
})
|
|
1766
|
+
};
|
|
1767
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1768
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
1769
|
+
})).pipe(mergeMap((response_) => {
|
|
1770
|
+
return this.transformResult(url_, response_, (r) => this.processSetProductVariantSku(r));
|
|
1771
|
+
})).pipe(catchError((response_) => {
|
|
1772
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1773
|
+
try {
|
|
1774
|
+
return this.transformResult(url_, response_, (r) => this.processSetProductVariantSku(r));
|
|
1775
|
+
}
|
|
1776
|
+
catch (e) {
|
|
1777
|
+
return throwError(e);
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
else
|
|
1781
|
+
return throwError(response_);
|
|
1782
|
+
}));
|
|
1783
|
+
}
|
|
1784
|
+
processSetProductVariantSku(response) {
|
|
1785
|
+
const status = response.status;
|
|
1786
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1787
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1788
|
+
let _headers = {};
|
|
1789
|
+
if (response.headers) {
|
|
1790
|
+
for (let key of response.headers.keys()) {
|
|
1791
|
+
_headers[key] = response.headers.get(key);
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
if (status === 200) {
|
|
1795
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1796
|
+
return of(null);
|
|
1797
|
+
}));
|
|
1798
|
+
}
|
|
1799
|
+
else if (status === 404) {
|
|
1800
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1801
|
+
let result404 = null;
|
|
1802
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1803
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1804
|
+
}));
|
|
1805
|
+
}
|
|
1806
|
+
else if (status === 409) {
|
|
1807
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1808
|
+
let result409 = null;
|
|
1809
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1810
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1811
|
+
}));
|
|
1812
|
+
}
|
|
1813
|
+
else if (status === 401) {
|
|
1814
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1815
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1816
|
+
}));
|
|
1817
|
+
}
|
|
1818
|
+
else if (status === 403) {
|
|
1819
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1820
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1821
|
+
}));
|
|
1822
|
+
}
|
|
1823
|
+
else if (status !== 200 && status !== 204) {
|
|
1824
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1825
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1826
|
+
}));
|
|
1827
|
+
}
|
|
1828
|
+
return of(null);
|
|
1829
|
+
}
|
|
1830
|
+
/**
|
|
1831
|
+
* Imports products from a specific CSV file and returns a list of imported products descriptions.
|
|
1832
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1833
|
+
* @param file (optional)
|
|
1834
|
+
* @return Success
|
|
1835
|
+
*/
|
|
1836
|
+
importProducts(tenantId, file) {
|
|
1837
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/import?";
|
|
1838
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1839
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1840
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1841
|
+
const content_ = new FormData();
|
|
1842
|
+
if (file !== null && file !== undefined)
|
|
1843
|
+
content_.append("file", file.data, file.fileName ? file.fileName : "file");
|
|
1844
|
+
let options_ = {
|
|
1845
|
+
body: content_,
|
|
1846
|
+
observe: "response",
|
|
1847
|
+
responseType: "blob",
|
|
1848
|
+
headers: new HttpHeaders({
|
|
1849
|
+
"Accept": "application/json"
|
|
1850
|
+
})
|
|
1851
|
+
};
|
|
1852
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1853
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
1854
|
+
})).pipe(mergeMap((response_) => {
|
|
1855
|
+
return this.transformResult(url_, response_, (r) => this.processImportProducts(r));
|
|
1856
|
+
})).pipe(catchError((response_) => {
|
|
1857
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1858
|
+
try {
|
|
1859
|
+
return this.transformResult(url_, response_, (r) => this.processImportProducts(r));
|
|
1860
|
+
}
|
|
1861
|
+
catch (e) {
|
|
1862
|
+
return throwError(e);
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
else
|
|
1866
|
+
return throwError(response_);
|
|
1867
|
+
}));
|
|
1868
|
+
}
|
|
1869
|
+
processImportProducts(response) {
|
|
1870
|
+
const status = response.status;
|
|
1871
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1872
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1873
|
+
let _headers = {};
|
|
1874
|
+
if (response.headers) {
|
|
1875
|
+
for (let key of response.headers.keys()) {
|
|
1876
|
+
_headers[key] = response.headers.get(key);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
if (status === 200) {
|
|
1880
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1881
|
+
let result200 = null;
|
|
1882
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1883
|
+
return of(result200);
|
|
1884
|
+
}));
|
|
1885
|
+
}
|
|
1886
|
+
else if (status === 400) {
|
|
1887
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1888
|
+
let result400 = null;
|
|
1889
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1890
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
1891
|
+
}));
|
|
1892
|
+
}
|
|
1893
|
+
else if (status === 409) {
|
|
1894
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1895
|
+
let result409 = null;
|
|
1896
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1897
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1898
|
+
}));
|
|
1899
|
+
}
|
|
1900
|
+
else if (status === 401) {
|
|
1901
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1902
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1903
|
+
}));
|
|
1904
|
+
}
|
|
1905
|
+
else if (status === 403) {
|
|
1906
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1907
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1908
|
+
}));
|
|
1909
|
+
}
|
|
1910
|
+
else if (status !== 200 && status !== 204) {
|
|
1911
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1912
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1913
|
+
}));
|
|
1914
|
+
}
|
|
1915
|
+
return of(null);
|
|
1916
|
+
}
|
|
1917
|
+
/**
|
|
1918
|
+
* Creates new designs connections for a specified product.
|
|
1919
|
+
* @param id Product identifier.
|
|
1920
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1921
|
+
* @param body (optional) Product designs connections creation parameters.
|
|
1922
|
+
* @return Success
|
|
1923
|
+
*/
|
|
1924
|
+
createDesignsConnections(id, tenantId, body) {
|
|
1925
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/design-connections?";
|
|
1926
|
+
if (id === undefined || id === null)
|
|
1927
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1928
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1929
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1930
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1931
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1932
|
+
const content_ = JSON.stringify(body);
|
|
1933
|
+
let options_ = {
|
|
1934
|
+
body: content_,
|
|
1935
|
+
observe: "response",
|
|
1936
|
+
responseType: "blob",
|
|
1937
|
+
headers: new HttpHeaders({
|
|
1938
|
+
"Content-Type": "application/json",
|
|
1939
|
+
})
|
|
1940
|
+
};
|
|
1941
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1942
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
1943
|
+
})).pipe(mergeMap((response_) => {
|
|
1944
|
+
return this.transformResult(url_, response_, (r) => this.processCreateDesignsConnections(r));
|
|
1945
|
+
})).pipe(catchError((response_) => {
|
|
1946
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1947
|
+
try {
|
|
1948
|
+
return this.transformResult(url_, response_, (r) => this.processCreateDesignsConnections(r));
|
|
1949
|
+
}
|
|
1950
|
+
catch (e) {
|
|
1951
|
+
return throwError(e);
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
else
|
|
1955
|
+
return throwError(response_);
|
|
1956
|
+
}));
|
|
1957
|
+
}
|
|
1958
|
+
processCreateDesignsConnections(response) {
|
|
1959
|
+
const status = response.status;
|
|
1960
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1961
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1962
|
+
let _headers = {};
|
|
1963
|
+
if (response.headers) {
|
|
1964
|
+
for (let key of response.headers.keys()) {
|
|
1965
|
+
_headers[key] = response.headers.get(key);
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
if (status === 200) {
|
|
1969
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1970
|
+
return of(null);
|
|
1971
|
+
}));
|
|
1972
|
+
}
|
|
1973
|
+
else if (status === 404) {
|
|
1974
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1975
|
+
let result404 = null;
|
|
1976
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1977
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1978
|
+
}));
|
|
1979
|
+
}
|
|
1980
|
+
else if (status === 409) {
|
|
1981
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1982
|
+
let result409 = null;
|
|
1983
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1984
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
1985
|
+
}));
|
|
1986
|
+
}
|
|
1987
|
+
else if (status === 401) {
|
|
1988
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1989
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1990
|
+
}));
|
|
1991
|
+
}
|
|
1992
|
+
else if (status === 403) {
|
|
1993
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1994
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1995
|
+
}));
|
|
1996
|
+
}
|
|
1997
|
+
else if (status !== 200 && status !== 204) {
|
|
1998
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1999
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2000
|
+
}));
|
|
2001
|
+
}
|
|
2002
|
+
return of(null);
|
|
2003
|
+
}
|
|
2004
|
+
/**
|
|
2005
|
+
* Removes designs connections for a specified product.
|
|
2006
|
+
* @param id Product identifier.
|
|
2007
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2008
|
+
* @param body (optional) Product designs connections creation parameters.
|
|
2009
|
+
* @return Success
|
|
2010
|
+
*/
|
|
2011
|
+
removeDesignsConnections(id, tenantId, body) {
|
|
2012
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/design-connections?";
|
|
2013
|
+
if (id === undefined || id === null)
|
|
2014
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2015
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2016
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2017
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2018
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2019
|
+
const content_ = JSON.stringify(body);
|
|
2020
|
+
let options_ = {
|
|
2021
|
+
body: content_,
|
|
2022
|
+
observe: "response",
|
|
2023
|
+
responseType: "blob",
|
|
2024
|
+
headers: new HttpHeaders({
|
|
2025
|
+
"Content-Type": "application/json",
|
|
2026
|
+
})
|
|
2027
|
+
};
|
|
2028
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2029
|
+
return this.http.request("delete", url_, transformedOptions_);
|
|
2030
|
+
})).pipe(mergeMap((response_) => {
|
|
2031
|
+
return this.transformResult(url_, response_, (r) => this.processRemoveDesignsConnections(r));
|
|
2032
|
+
})).pipe(catchError((response_) => {
|
|
2033
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2034
|
+
try {
|
|
2035
|
+
return this.transformResult(url_, response_, (r) => this.processRemoveDesignsConnections(r));
|
|
2036
|
+
}
|
|
2037
|
+
catch (e) {
|
|
2038
|
+
return throwError(e);
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
else
|
|
2042
|
+
return throwError(response_);
|
|
2043
|
+
}));
|
|
2044
|
+
}
|
|
2045
|
+
processRemoveDesignsConnections(response) {
|
|
2046
|
+
const status = response.status;
|
|
2047
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2048
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2049
|
+
let _headers = {};
|
|
2050
|
+
if (response.headers) {
|
|
2051
|
+
for (let key of response.headers.keys()) {
|
|
2052
|
+
_headers[key] = response.headers.get(key);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
if (status === 200) {
|
|
2056
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2057
|
+
return of(null);
|
|
2058
|
+
}));
|
|
2059
|
+
}
|
|
2060
|
+
else if (status === 404) {
|
|
2061
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2062
|
+
let result404 = null;
|
|
2063
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2064
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2065
|
+
}));
|
|
2066
|
+
}
|
|
2067
|
+
else if (status === 409) {
|
|
2068
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2069
|
+
let result409 = null;
|
|
2070
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2071
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2072
|
+
}));
|
|
2073
|
+
}
|
|
2074
|
+
else if (status === 401) {
|
|
2075
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2076
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2077
|
+
}));
|
|
2078
|
+
}
|
|
2079
|
+
else if (status === 403) {
|
|
2080
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2081
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2082
|
+
}));
|
|
2083
|
+
}
|
|
2084
|
+
else if (status !== 200 && status !== 204) {
|
|
2085
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2086
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2087
|
+
}));
|
|
2088
|
+
}
|
|
2089
|
+
return of(null);
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Creates new mockups connections for a specified product.
|
|
2093
|
+
* @param id Product identifier.
|
|
2094
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2095
|
+
* @param body (optional) Product mockups connections creation parameters.
|
|
2096
|
+
* @return Success
|
|
2097
|
+
*/
|
|
2098
|
+
createMockupsConnections(id, tenantId, body) {
|
|
2099
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/mockup-connections?";
|
|
2100
|
+
if (id === undefined || id === null)
|
|
2101
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2102
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2103
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2104
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2105
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2106
|
+
const content_ = JSON.stringify(body);
|
|
2107
|
+
let options_ = {
|
|
2108
|
+
body: content_,
|
|
2109
|
+
observe: "response",
|
|
2110
|
+
responseType: "blob",
|
|
2111
|
+
headers: new HttpHeaders({
|
|
2112
|
+
"Content-Type": "application/json",
|
|
2113
|
+
})
|
|
2114
|
+
};
|
|
2115
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2116
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2117
|
+
})).pipe(mergeMap((response_) => {
|
|
2118
|
+
return this.transformResult(url_, response_, (r) => this.processCreateMockupsConnections(r));
|
|
2119
|
+
})).pipe(catchError((response_) => {
|
|
2120
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2121
|
+
try {
|
|
2122
|
+
return this.transformResult(url_, response_, (r) => this.processCreateMockupsConnections(r));
|
|
2123
|
+
}
|
|
2124
|
+
catch (e) {
|
|
2125
|
+
return throwError(e);
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
else
|
|
2129
|
+
return throwError(response_);
|
|
2130
|
+
}));
|
|
2131
|
+
}
|
|
2132
|
+
processCreateMockupsConnections(response) {
|
|
2133
|
+
const status = response.status;
|
|
2134
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2135
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2136
|
+
let _headers = {};
|
|
2137
|
+
if (response.headers) {
|
|
2138
|
+
for (let key of response.headers.keys()) {
|
|
2139
|
+
_headers[key] = response.headers.get(key);
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
if (status === 200) {
|
|
2143
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2144
|
+
return of(null);
|
|
2145
|
+
}));
|
|
2146
|
+
}
|
|
2147
|
+
else if (status === 404) {
|
|
2148
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2149
|
+
let result404 = null;
|
|
2150
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2151
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2152
|
+
}));
|
|
2153
|
+
}
|
|
2154
|
+
else if (status === 409) {
|
|
2155
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2156
|
+
let result409 = null;
|
|
2157
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2158
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2159
|
+
}));
|
|
2160
|
+
}
|
|
2161
|
+
else if (status === 401) {
|
|
2162
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2163
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2164
|
+
}));
|
|
2165
|
+
}
|
|
2166
|
+
else if (status === 403) {
|
|
2167
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2168
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2169
|
+
}));
|
|
2170
|
+
}
|
|
2171
|
+
else if (status !== 200 && status !== 204) {
|
|
2172
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2173
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2174
|
+
}));
|
|
2175
|
+
}
|
|
2176
|
+
return of(null);
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* Removes mockups connections for a specified product.
|
|
2180
|
+
* @param id Product identifier.
|
|
2181
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2182
|
+
* @param body (optional) Product mockups connections creation parameters.
|
|
2183
|
+
* @return Success
|
|
2184
|
+
*/
|
|
2185
|
+
removeMockupsConnections(id, tenantId, body) {
|
|
2186
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/mockup-connections?";
|
|
2187
|
+
if (id === undefined || id === null)
|
|
2188
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2189
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2190
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2191
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2192
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2193
|
+
const content_ = JSON.stringify(body);
|
|
2194
|
+
let options_ = {
|
|
2195
|
+
body: content_,
|
|
2196
|
+
observe: "response",
|
|
2197
|
+
responseType: "blob",
|
|
2198
|
+
headers: new HttpHeaders({
|
|
2199
|
+
"Content-Type": "application/json",
|
|
2200
|
+
})
|
|
2201
|
+
};
|
|
2202
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2203
|
+
return this.http.request("delete", url_, transformedOptions_);
|
|
2204
|
+
})).pipe(mergeMap((response_) => {
|
|
2205
|
+
return this.transformResult(url_, response_, (r) => this.processRemoveMockupsConnections(r));
|
|
2206
|
+
})).pipe(catchError((response_) => {
|
|
2207
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2208
|
+
try {
|
|
2209
|
+
return this.transformResult(url_, response_, (r) => this.processRemoveMockupsConnections(r));
|
|
2210
|
+
}
|
|
2211
|
+
catch (e) {
|
|
2212
|
+
return throwError(e);
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
else
|
|
2216
|
+
return throwError(response_);
|
|
2217
|
+
}));
|
|
2218
|
+
}
|
|
2219
|
+
processRemoveMockupsConnections(response) {
|
|
2220
|
+
const status = response.status;
|
|
2221
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2222
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2223
|
+
let _headers = {};
|
|
2224
|
+
if (response.headers) {
|
|
2225
|
+
for (let key of response.headers.keys()) {
|
|
2226
|
+
_headers[key] = response.headers.get(key);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
if (status === 200) {
|
|
2230
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2231
|
+
return of(null);
|
|
2232
|
+
}));
|
|
2233
|
+
}
|
|
2234
|
+
else if (status === 404) {
|
|
2235
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2236
|
+
let result404 = null;
|
|
2237
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2238
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2239
|
+
}));
|
|
2240
|
+
}
|
|
2241
|
+
else if (status === 409) {
|
|
2242
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2243
|
+
let result409 = null;
|
|
2244
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2245
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2246
|
+
}));
|
|
2247
|
+
}
|
|
2248
|
+
else if (status === 401) {
|
|
2249
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2250
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2251
|
+
}));
|
|
2252
|
+
}
|
|
2253
|
+
else if (status === 403) {
|
|
2254
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2255
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2256
|
+
}));
|
|
2257
|
+
}
|
|
2258
|
+
else if (status !== 200 && status !== 204) {
|
|
2259
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2260
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2261
|
+
}));
|
|
2262
|
+
}
|
|
2263
|
+
return of(null);
|
|
2264
|
+
}
|
|
2265
|
+
/**
|
|
2266
|
+
* Creates new documents connections for a specified product.
|
|
2267
|
+
* @param id Product identifier.
|
|
2268
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2269
|
+
* @param body (optional) Product documents connections creation parameters.
|
|
2270
|
+
* @return Success
|
|
2271
|
+
*/
|
|
2272
|
+
createDocumentsConnections(id, tenantId, body) {
|
|
2273
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/document-connections?";
|
|
2274
|
+
if (id === undefined || id === null)
|
|
2275
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2276
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2277
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2278
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2279
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2280
|
+
const content_ = JSON.stringify(body);
|
|
2281
|
+
let options_ = {
|
|
2282
|
+
body: content_,
|
|
2283
|
+
observe: "response",
|
|
2284
|
+
responseType: "blob",
|
|
2285
|
+
headers: new HttpHeaders({
|
|
2286
|
+
"Content-Type": "application/json",
|
|
2287
|
+
})
|
|
2288
|
+
};
|
|
2289
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2290
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2291
|
+
})).pipe(mergeMap((response_) => {
|
|
2292
|
+
return this.transformResult(url_, response_, (r) => this.processCreateDocumentsConnections(r));
|
|
2293
|
+
})).pipe(catchError((response_) => {
|
|
2294
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2295
|
+
try {
|
|
2296
|
+
return this.transformResult(url_, response_, (r) => this.processCreateDocumentsConnections(r));
|
|
2297
|
+
}
|
|
2298
|
+
catch (e) {
|
|
2299
|
+
return throwError(e);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
else
|
|
2303
|
+
return throwError(response_);
|
|
2304
|
+
}));
|
|
2305
|
+
}
|
|
2306
|
+
processCreateDocumentsConnections(response) {
|
|
2307
|
+
const status = response.status;
|
|
2308
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2309
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2310
|
+
let _headers = {};
|
|
2311
|
+
if (response.headers) {
|
|
2312
|
+
for (let key of response.headers.keys()) {
|
|
2313
|
+
_headers[key] = response.headers.get(key);
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
if (status === 200) {
|
|
2317
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2318
|
+
return of(null);
|
|
2319
|
+
}));
|
|
2320
|
+
}
|
|
2321
|
+
else if (status === 404) {
|
|
2322
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2323
|
+
let result404 = null;
|
|
2324
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2325
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2326
|
+
}));
|
|
2327
|
+
}
|
|
2328
|
+
else if (status === 409) {
|
|
2329
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2330
|
+
let result409 = null;
|
|
2331
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2332
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2333
|
+
}));
|
|
2334
|
+
}
|
|
2335
|
+
else if (status === 401) {
|
|
2336
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2337
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2338
|
+
}));
|
|
2339
|
+
}
|
|
2340
|
+
else if (status === 403) {
|
|
2341
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2342
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2343
|
+
}));
|
|
2344
|
+
}
|
|
2345
|
+
else if (status !== 200 && status !== 204) {
|
|
2346
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2347
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2348
|
+
}));
|
|
2349
|
+
}
|
|
2350
|
+
return of(null);
|
|
2351
|
+
}
|
|
2352
|
+
/**
|
|
2353
|
+
* Removes documents connections for a specified product.
|
|
2354
|
+
* @param id Product identifier.
|
|
2355
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2356
|
+
* @param body (optional) Product documents connections creation parameters.
|
|
2357
|
+
* @return Success
|
|
2358
|
+
*/
|
|
2359
|
+
removeDocumentsConnections(id, tenantId, body) {
|
|
2360
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/document-connections?";
|
|
2361
|
+
if (id === undefined || id === null)
|
|
2362
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2363
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2364
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2365
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2366
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2367
|
+
const content_ = JSON.stringify(body);
|
|
2368
|
+
let options_ = {
|
|
2369
|
+
body: content_,
|
|
2370
|
+
observe: "response",
|
|
2371
|
+
responseType: "blob",
|
|
2372
|
+
headers: new HttpHeaders({
|
|
2373
|
+
"Content-Type": "application/json",
|
|
2374
|
+
})
|
|
2375
|
+
};
|
|
2376
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2377
|
+
return this.http.request("delete", url_, transformedOptions_);
|
|
2378
|
+
})).pipe(mergeMap((response_) => {
|
|
2379
|
+
return this.transformResult(url_, response_, (r) => this.processRemoveDocumentsConnections(r));
|
|
2380
|
+
})).pipe(catchError((response_) => {
|
|
2381
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2382
|
+
try {
|
|
2383
|
+
return this.transformResult(url_, response_, (r) => this.processRemoveDocumentsConnections(r));
|
|
2384
|
+
}
|
|
2385
|
+
catch (e) {
|
|
2386
|
+
return throwError(e);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
else
|
|
2390
|
+
return throwError(response_);
|
|
2391
|
+
}));
|
|
2392
|
+
}
|
|
2393
|
+
processRemoveDocumentsConnections(response) {
|
|
2394
|
+
const status = response.status;
|
|
2395
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2396
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2397
|
+
let _headers = {};
|
|
2398
|
+
if (response.headers) {
|
|
2399
|
+
for (let key of response.headers.keys()) {
|
|
2400
|
+
_headers[key] = response.headers.get(key);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
if (status === 200) {
|
|
2404
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2405
|
+
return of(null);
|
|
2406
|
+
}));
|
|
2407
|
+
}
|
|
2408
|
+
else if (status === 404) {
|
|
2409
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2410
|
+
let result404 = null;
|
|
2411
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2412
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2413
|
+
}));
|
|
2414
|
+
}
|
|
2415
|
+
else if (status === 409) {
|
|
2416
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2417
|
+
let result409 = null;
|
|
2418
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2419
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2420
|
+
}));
|
|
2421
|
+
}
|
|
2422
|
+
else if (status === 401) {
|
|
2423
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2424
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2425
|
+
}));
|
|
2426
|
+
}
|
|
2427
|
+
else if (status === 403) {
|
|
2428
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2429
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2430
|
+
}));
|
|
2431
|
+
}
|
|
2432
|
+
else if (status !== 200 && status !== 204) {
|
|
2433
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2434
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2435
|
+
}));
|
|
2436
|
+
}
|
|
2437
|
+
return of(null);
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* Returns all available product personalization workflows.
|
|
2441
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
2442
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
2443
|
+
* @param search (optional) Search string for partial by personalization workflow name.
|
|
2444
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2445
|
+
* @return Success
|
|
2446
|
+
*/
|
|
2447
|
+
getAvailablePersonalizationWorkflows(skip, take, search, tenantId) {
|
|
2448
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/available-workflows?";
|
|
2449
|
+
if (skip !== undefined && skip !== null)
|
|
2450
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2451
|
+
if (take !== undefined && take !== null)
|
|
2452
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2453
|
+
if (search !== undefined && search !== null)
|
|
2454
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2455
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2456
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2457
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2458
|
+
let options_ = {
|
|
2459
|
+
observe: "response",
|
|
2460
|
+
responseType: "blob",
|
|
2461
|
+
headers: new HttpHeaders({
|
|
2462
|
+
"Accept": "application/json"
|
|
2463
|
+
})
|
|
2464
|
+
};
|
|
2465
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2466
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2467
|
+
})).pipe(mergeMap((response_) => {
|
|
2468
|
+
return this.transformResult(url_, response_, (r) => this.processGetAvailablePersonalizationWorkflows(r));
|
|
2469
|
+
})).pipe(catchError((response_) => {
|
|
2470
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2471
|
+
try {
|
|
2472
|
+
return this.transformResult(url_, response_, (r) => this.processGetAvailablePersonalizationWorkflows(r));
|
|
2473
|
+
}
|
|
2474
|
+
catch (e) {
|
|
2475
|
+
return throwError(e);
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
else
|
|
2479
|
+
return throwError(response_);
|
|
2480
|
+
}));
|
|
2481
|
+
}
|
|
2482
|
+
processGetAvailablePersonalizationWorkflows(response) {
|
|
2483
|
+
const status = response.status;
|
|
2484
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2485
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2486
|
+
let _headers = {};
|
|
2487
|
+
if (response.headers) {
|
|
2488
|
+
for (let key of response.headers.keys()) {
|
|
2489
|
+
_headers[key] = response.headers.get(key);
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
if (status === 200) {
|
|
2493
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2494
|
+
let result200 = null;
|
|
2495
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2496
|
+
return of(result200);
|
|
2497
|
+
}));
|
|
2498
|
+
}
|
|
2499
|
+
else if (status === 401) {
|
|
2500
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2501
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2502
|
+
}));
|
|
2503
|
+
}
|
|
2504
|
+
else if (status === 403) {
|
|
2505
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2506
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2507
|
+
}));
|
|
2508
|
+
}
|
|
2509
|
+
else if (status !== 200 && status !== 204) {
|
|
2510
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2511
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2512
|
+
}));
|
|
2513
|
+
}
|
|
2514
|
+
return of(null);
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* Returns all available product processing pipelines.
|
|
2518
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
2519
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
2520
|
+
* @param search (optional) Search string for partial by processing pipeline name.
|
|
2521
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2522
|
+
* @return Success
|
|
2523
|
+
*/
|
|
2524
|
+
getAvailableProcessingPipelines(skip, take, search, tenantId) {
|
|
2525
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/products/available-pipelines?";
|
|
2526
|
+
if (skip !== undefined && skip !== null)
|
|
2527
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2528
|
+
if (take !== undefined && take !== null)
|
|
2529
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2530
|
+
if (search !== undefined && search !== null)
|
|
2531
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2532
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2533
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2534
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2535
|
+
let options_ = {
|
|
2536
|
+
observe: "response",
|
|
2537
|
+
responseType: "blob",
|
|
2538
|
+
headers: new HttpHeaders({
|
|
2539
|
+
"Accept": "application/json"
|
|
2540
|
+
})
|
|
2541
|
+
};
|
|
2542
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2543
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2544
|
+
})).pipe(mergeMap((response_) => {
|
|
2545
|
+
return this.transformResult(url_, response_, (r) => this.processGetAvailableProcessingPipelines(r));
|
|
2546
|
+
})).pipe(catchError((response_) => {
|
|
2547
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2548
|
+
try {
|
|
2549
|
+
return this.transformResult(url_, response_, (r) => this.processGetAvailableProcessingPipelines(r));
|
|
2550
|
+
}
|
|
2551
|
+
catch (e) {
|
|
2552
|
+
return throwError(e);
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
else
|
|
2556
|
+
return throwError(response_);
|
|
2557
|
+
}));
|
|
2558
|
+
}
|
|
2559
|
+
processGetAvailableProcessingPipelines(response) {
|
|
2560
|
+
const status = response.status;
|
|
2561
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2562
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2563
|
+
let _headers = {};
|
|
2564
|
+
if (response.headers) {
|
|
2565
|
+
for (let key of response.headers.keys()) {
|
|
2566
|
+
_headers[key] = response.headers.get(key);
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
if (status === 200) {
|
|
2570
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2571
|
+
let result200 = null;
|
|
2572
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2573
|
+
return of(result200);
|
|
2574
|
+
}));
|
|
2575
|
+
}
|
|
2576
|
+
else if (status === 401) {
|
|
2577
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2578
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2579
|
+
}));
|
|
2580
|
+
}
|
|
2581
|
+
else if (status === 403) {
|
|
2582
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2583
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2584
|
+
}));
|
|
2585
|
+
}
|
|
2586
|
+
else if (status !== 200 && status !== 204) {
|
|
2587
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2588
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2589
|
+
}));
|
|
2590
|
+
}
|
|
2591
|
+
return of(null);
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
ProductsManagementApiClient.ɵprov = ɵɵdefineInjectable({ factory: function ProductsManagementApiClient_Factory() { return new ProductsManagementApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: ProductsManagementApiClient, providedIn: "root" });
|
|
2595
|
+
ProductsManagementApiClient.decorators = [
|
|
2596
|
+
{ type: Injectable, args: [{
|
|
2597
|
+
providedIn: 'root'
|
|
2598
|
+
},] }
|
|
2599
|
+
];
|
|
2600
|
+
ProductsManagementApiClient.ctorParameters = () => [
|
|
2601
|
+
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
2602
|
+
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
2603
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
2604
|
+
];
|
|
2605
|
+
class StorefrontsManagementApiClient extends ApiClientBase {
|
|
2606
|
+
constructor(configuration, http, baseUrl) {
|
|
2607
|
+
super(configuration);
|
|
2608
|
+
this.jsonParseReviver = undefined;
|
|
2609
|
+
this.http = http;
|
|
2610
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
2611
|
+
}
|
|
2612
|
+
/**
|
|
2613
|
+
* Returns all storefronts, relevant to the specified query parameters.
|
|
2614
|
+
* @param types (optional) Storefront type filter.
|
|
2615
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
2616
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
2617
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
2618
|
+
* @param search (optional) Search string for partial match.
|
|
2619
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2620
|
+
* @return Success
|
|
2621
|
+
*/
|
|
2622
|
+
getAll(types, skip, take, sorting, search, tenantId) {
|
|
2623
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts?";
|
|
2624
|
+
if (types !== undefined && types !== null)
|
|
2625
|
+
types && types.forEach(item => { url_ += "types=" + encodeURIComponent("" + item) + "&"; });
|
|
2626
|
+
if (skip !== undefined && skip !== null)
|
|
2627
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
2628
|
+
if (take !== undefined && take !== null)
|
|
2629
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
2630
|
+
if (sorting !== undefined && sorting !== null)
|
|
2631
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
2632
|
+
if (search !== undefined && search !== null)
|
|
2633
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
2634
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2635
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2636
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2637
|
+
let options_ = {
|
|
2638
|
+
observe: "response",
|
|
2639
|
+
responseType: "blob",
|
|
2640
|
+
headers: new HttpHeaders({
|
|
2641
|
+
"Accept": "application/json"
|
|
2642
|
+
})
|
|
2643
|
+
};
|
|
2644
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2645
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2646
|
+
})).pipe(mergeMap((response_) => {
|
|
2647
|
+
return this.transformResult(url_, response_, (r) => this.processGetAll(r));
|
|
2648
|
+
})).pipe(catchError((response_) => {
|
|
2649
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2650
|
+
try {
|
|
2651
|
+
return this.transformResult(url_, response_, (r) => this.processGetAll(r));
|
|
2652
|
+
}
|
|
2653
|
+
catch (e) {
|
|
2654
|
+
return throwError(e);
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
else
|
|
2658
|
+
return throwError(response_);
|
|
2659
|
+
}));
|
|
2660
|
+
}
|
|
2661
|
+
processGetAll(response) {
|
|
2662
|
+
const status = response.status;
|
|
2663
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2664
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2665
|
+
let _headers = {};
|
|
2666
|
+
if (response.headers) {
|
|
2667
|
+
for (let key of response.headers.keys()) {
|
|
2668
|
+
_headers[key] = response.headers.get(key);
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
if (status === 200) {
|
|
2672
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2673
|
+
let result200 = null;
|
|
2674
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2675
|
+
return of(result200);
|
|
2676
|
+
}));
|
|
2677
|
+
}
|
|
2678
|
+
else if (status === 401) {
|
|
2679
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2680
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2681
|
+
}));
|
|
2682
|
+
}
|
|
2683
|
+
else if (status === 403) {
|
|
2684
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2685
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2686
|
+
}));
|
|
2687
|
+
}
|
|
2688
|
+
else if (status !== 200 && status !== 204) {
|
|
2689
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2690
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2691
|
+
}));
|
|
2692
|
+
}
|
|
2693
|
+
return of(null);
|
|
2694
|
+
}
|
|
2695
|
+
/**
|
|
2696
|
+
* Returns a storefront by identifier.
|
|
2697
|
+
* @param id Storefront identifier.
|
|
2698
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2699
|
+
* @return Success
|
|
2700
|
+
*/
|
|
2701
|
+
get(id, tenantId) {
|
|
2702
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/{id}?";
|
|
2703
|
+
if (id === undefined || id === null)
|
|
2704
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2705
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2706
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2707
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2708
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2709
|
+
let options_ = {
|
|
2710
|
+
observe: "response",
|
|
2711
|
+
responseType: "blob",
|
|
2712
|
+
headers: new HttpHeaders({
|
|
2713
|
+
"Accept": "application/json"
|
|
2714
|
+
})
|
|
2715
|
+
};
|
|
2716
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2717
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2718
|
+
})).pipe(mergeMap((response_) => {
|
|
2719
|
+
return this.transformResult(url_, response_, (r) => this.processGet(r));
|
|
2720
|
+
})).pipe(catchError((response_) => {
|
|
2721
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2722
|
+
try {
|
|
2723
|
+
return this.transformResult(url_, response_, (r) => this.processGet(r));
|
|
2724
|
+
}
|
|
2725
|
+
catch (e) {
|
|
2726
|
+
return throwError(e);
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
else
|
|
2730
|
+
return throwError(response_);
|
|
2731
|
+
}));
|
|
2732
|
+
}
|
|
2733
|
+
processGet(response) {
|
|
2734
|
+
const status = response.status;
|
|
2735
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2736
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2737
|
+
let _headers = {};
|
|
2738
|
+
if (response.headers) {
|
|
2739
|
+
for (let key of response.headers.keys()) {
|
|
2740
|
+
_headers[key] = response.headers.get(key);
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
if (status === 200) {
|
|
2744
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2745
|
+
let result200 = null;
|
|
2746
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2747
|
+
return of(result200);
|
|
2748
|
+
}));
|
|
2749
|
+
}
|
|
2750
|
+
else if (status === 404) {
|
|
2751
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2752
|
+
let result404 = null;
|
|
2753
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2754
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2755
|
+
}));
|
|
2756
|
+
}
|
|
2757
|
+
else if (status === 401) {
|
|
2758
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2759
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2760
|
+
}));
|
|
2761
|
+
}
|
|
2762
|
+
else if (status === 403) {
|
|
2763
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2764
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2765
|
+
}));
|
|
2766
|
+
}
|
|
2767
|
+
else if (status !== 200 && status !== 204) {
|
|
2768
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2769
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2770
|
+
}));
|
|
2771
|
+
}
|
|
2772
|
+
return of(null);
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* Deletes an existing storefront by its identifier.
|
|
2776
|
+
* @param id Storefront identifier.
|
|
2777
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2778
|
+
* @return Success
|
|
2779
|
+
*/
|
|
2780
|
+
delete(id, tenantId) {
|
|
2781
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/{id}?";
|
|
2782
|
+
if (id === undefined || id === null)
|
|
2783
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2784
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2785
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2786
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2787
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2788
|
+
let options_ = {
|
|
2789
|
+
observe: "response",
|
|
2790
|
+
responseType: "blob",
|
|
2791
|
+
headers: new HttpHeaders({
|
|
2792
|
+
"Accept": "application/json"
|
|
2793
|
+
})
|
|
2794
|
+
};
|
|
2795
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2796
|
+
return this.http.request("delete", url_, transformedOptions_);
|
|
2797
|
+
})).pipe(mergeMap((response_) => {
|
|
2798
|
+
return this.transformResult(url_, response_, (r) => this.processDelete(r));
|
|
2799
|
+
})).pipe(catchError((response_) => {
|
|
2800
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2801
|
+
try {
|
|
2802
|
+
return this.transformResult(url_, response_, (r) => this.processDelete(r));
|
|
2803
|
+
}
|
|
2804
|
+
catch (e) {
|
|
2805
|
+
return throwError(e);
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
else
|
|
2809
|
+
return throwError(response_);
|
|
2810
|
+
}));
|
|
2811
|
+
}
|
|
2812
|
+
processDelete(response) {
|
|
2813
|
+
const status = response.status;
|
|
2814
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2815
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2816
|
+
let _headers = {};
|
|
2817
|
+
if (response.headers) {
|
|
2818
|
+
for (let key of response.headers.keys()) {
|
|
2819
|
+
_headers[key] = response.headers.get(key);
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
if (status === 200) {
|
|
2823
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2824
|
+
let result200 = null;
|
|
2825
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2826
|
+
return of(result200);
|
|
2827
|
+
}));
|
|
2828
|
+
}
|
|
2829
|
+
else if (status === 404) {
|
|
2830
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2831
|
+
let result404 = null;
|
|
2832
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2833
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2834
|
+
}));
|
|
2835
|
+
}
|
|
2836
|
+
else if (status === 401) {
|
|
2837
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2838
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2839
|
+
}));
|
|
2840
|
+
}
|
|
2841
|
+
else if (status === 403) {
|
|
2842
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2843
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2844
|
+
}));
|
|
2845
|
+
}
|
|
2846
|
+
else if (status !== 200 && status !== 204) {
|
|
2847
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2848
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2849
|
+
}));
|
|
2850
|
+
}
|
|
2851
|
+
return of(null);
|
|
2852
|
+
}
|
|
2853
|
+
/**
|
|
2854
|
+
* Creates new custom storefront.
|
|
2855
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2856
|
+
* @param body (optional) Custom storefront creation model.
|
|
2857
|
+
* @return Success
|
|
2858
|
+
*/
|
|
2859
|
+
createCustomStorefront(tenantId, body) {
|
|
2860
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/custom?";
|
|
2861
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2862
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2863
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2864
|
+
const content_ = JSON.stringify(body);
|
|
2865
|
+
let options_ = {
|
|
2866
|
+
body: content_,
|
|
2867
|
+
observe: "response",
|
|
2868
|
+
responseType: "blob",
|
|
2869
|
+
headers: new HttpHeaders({
|
|
2870
|
+
"Content-Type": "application/json",
|
|
2871
|
+
"Accept": "application/json"
|
|
2872
|
+
})
|
|
2873
|
+
};
|
|
2874
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2875
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
2876
|
+
})).pipe(mergeMap((response_) => {
|
|
2877
|
+
return this.transformResult(url_, response_, (r) => this.processCreateCustomStorefront(r));
|
|
2878
|
+
})).pipe(catchError((response_) => {
|
|
2879
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2880
|
+
try {
|
|
2881
|
+
return this.transformResult(url_, response_, (r) => this.processCreateCustomStorefront(r));
|
|
2882
|
+
}
|
|
2883
|
+
catch (e) {
|
|
2884
|
+
return throwError(e);
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
else
|
|
2888
|
+
return throwError(response_);
|
|
2889
|
+
}));
|
|
2890
|
+
}
|
|
2891
|
+
processCreateCustomStorefront(response) {
|
|
2892
|
+
const status = response.status;
|
|
2893
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2894
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2895
|
+
let _headers = {};
|
|
2896
|
+
if (response.headers) {
|
|
2897
|
+
for (let key of response.headers.keys()) {
|
|
2898
|
+
_headers[key] = response.headers.get(key);
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
if (status === 200) {
|
|
2902
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2903
|
+
let result200 = null;
|
|
2904
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2905
|
+
return of(result200);
|
|
2906
|
+
}));
|
|
2907
|
+
}
|
|
2908
|
+
else if (status === 400) {
|
|
2909
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2910
|
+
let result400 = null;
|
|
2911
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2912
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
2913
|
+
}));
|
|
2914
|
+
}
|
|
2915
|
+
else if (status === 409) {
|
|
2916
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2917
|
+
let result409 = null;
|
|
2918
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2919
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
2920
|
+
}));
|
|
2921
|
+
}
|
|
2922
|
+
else if (status === 401) {
|
|
2923
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2924
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
2925
|
+
}));
|
|
2926
|
+
}
|
|
2927
|
+
else if (status === 403) {
|
|
2928
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2929
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2930
|
+
}));
|
|
2931
|
+
}
|
|
2932
|
+
else if (status !== 200 && status !== 204) {
|
|
2933
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2934
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
2935
|
+
}));
|
|
2936
|
+
}
|
|
2937
|
+
return of(null);
|
|
2938
|
+
}
|
|
2939
|
+
/**
|
|
2940
|
+
* Returns extended information about custom storefront.
|
|
2941
|
+
* @param id Storefront identifier.
|
|
2942
|
+
* @param tenantId (optional) Tenant identifier.
|
|
2943
|
+
* @return Success
|
|
2944
|
+
*/
|
|
2945
|
+
getCustomStorefront(id, tenantId) {
|
|
2946
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/custom/{id}?";
|
|
2947
|
+
if (id === undefined || id === null)
|
|
2948
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
2949
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
2950
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
2951
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
2952
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
2953
|
+
let options_ = {
|
|
2954
|
+
observe: "response",
|
|
2955
|
+
responseType: "blob",
|
|
2956
|
+
headers: new HttpHeaders({
|
|
2957
|
+
"Accept": "application/json"
|
|
2958
|
+
})
|
|
2959
|
+
};
|
|
2960
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
2961
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
2962
|
+
})).pipe(mergeMap((response_) => {
|
|
2963
|
+
return this.transformResult(url_, response_, (r) => this.processGetCustomStorefront(r));
|
|
2964
|
+
})).pipe(catchError((response_) => {
|
|
2965
|
+
if (response_ instanceof HttpResponseBase) {
|
|
2966
|
+
try {
|
|
2967
|
+
return this.transformResult(url_, response_, (r) => this.processGetCustomStorefront(r));
|
|
2968
|
+
}
|
|
2969
|
+
catch (e) {
|
|
2970
|
+
return throwError(e);
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
else
|
|
2974
|
+
return throwError(response_);
|
|
2975
|
+
}));
|
|
2976
|
+
}
|
|
2977
|
+
processGetCustomStorefront(response) {
|
|
2978
|
+
const status = response.status;
|
|
2979
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
2980
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
2981
|
+
let _headers = {};
|
|
2982
|
+
if (response.headers) {
|
|
2983
|
+
for (let key of response.headers.keys()) {
|
|
2984
|
+
_headers[key] = response.headers.get(key);
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
if (status === 200) {
|
|
2988
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2989
|
+
let result200 = null;
|
|
2990
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2991
|
+
return of(result200);
|
|
2992
|
+
}));
|
|
2993
|
+
}
|
|
2994
|
+
else if (status === 404) {
|
|
2995
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
2996
|
+
let result404 = null;
|
|
2997
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
2998
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
2999
|
+
}));
|
|
3000
|
+
}
|
|
3001
|
+
else if (status === 401) {
|
|
3002
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3003
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3004
|
+
}));
|
|
3005
|
+
}
|
|
3006
|
+
else if (status === 403) {
|
|
3007
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3008
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3009
|
+
}));
|
|
3010
|
+
}
|
|
3011
|
+
else if (status !== 200 && status !== 204) {
|
|
3012
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3013
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3014
|
+
}));
|
|
3015
|
+
}
|
|
3016
|
+
return of(null);
|
|
3017
|
+
}
|
|
3018
|
+
/**
|
|
3019
|
+
* Creates new NopCommerce storefront.
|
|
3020
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3021
|
+
* @param body (optional) NopCommerce storefront creation model.
|
|
3022
|
+
* @return Success
|
|
3023
|
+
*/
|
|
3024
|
+
createNopCommerceStorefront(tenantId, body) {
|
|
3025
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/nopcommerce?";
|
|
3026
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3027
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3028
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3029
|
+
const content_ = JSON.stringify(body);
|
|
3030
|
+
let options_ = {
|
|
3031
|
+
body: content_,
|
|
3032
|
+
observe: "response",
|
|
3033
|
+
responseType: "blob",
|
|
3034
|
+
headers: new HttpHeaders({
|
|
3035
|
+
"Content-Type": "application/json",
|
|
3036
|
+
"Accept": "application/json"
|
|
3037
|
+
})
|
|
3038
|
+
};
|
|
3039
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3040
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3041
|
+
})).pipe(mergeMap((response_) => {
|
|
3042
|
+
return this.transformResult(url_, response_, (r) => this.processCreateNopCommerceStorefront(r));
|
|
3043
|
+
})).pipe(catchError((response_) => {
|
|
3044
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3045
|
+
try {
|
|
3046
|
+
return this.transformResult(url_, response_, (r) => this.processCreateNopCommerceStorefront(r));
|
|
3047
|
+
}
|
|
3048
|
+
catch (e) {
|
|
3049
|
+
return throwError(e);
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
else
|
|
3053
|
+
return throwError(response_);
|
|
3054
|
+
}));
|
|
3055
|
+
}
|
|
3056
|
+
processCreateNopCommerceStorefront(response) {
|
|
3057
|
+
const status = response.status;
|
|
3058
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3059
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3060
|
+
let _headers = {};
|
|
3061
|
+
if (response.headers) {
|
|
3062
|
+
for (let key of response.headers.keys()) {
|
|
3063
|
+
_headers[key] = response.headers.get(key);
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
if (status === 200) {
|
|
3067
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3068
|
+
let result200 = null;
|
|
3069
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3070
|
+
return of(result200);
|
|
3071
|
+
}));
|
|
3072
|
+
}
|
|
3073
|
+
else if (status === 400) {
|
|
3074
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3075
|
+
let result400 = null;
|
|
3076
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3077
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3078
|
+
}));
|
|
3079
|
+
}
|
|
3080
|
+
else if (status === 409) {
|
|
3081
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3082
|
+
let result409 = null;
|
|
3083
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3084
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3085
|
+
}));
|
|
3086
|
+
}
|
|
3087
|
+
else if (status === 401) {
|
|
3088
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3089
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3090
|
+
}));
|
|
3091
|
+
}
|
|
3092
|
+
else if (status === 403) {
|
|
3093
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3094
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3095
|
+
}));
|
|
3096
|
+
}
|
|
3097
|
+
else if (status !== 200 && status !== 204) {
|
|
3098
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3099
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3100
|
+
}));
|
|
3101
|
+
}
|
|
3102
|
+
return of(null);
|
|
3103
|
+
}
|
|
3104
|
+
/**
|
|
3105
|
+
* Returns extended information about NopCommerce storefront.
|
|
3106
|
+
* @param id Storefront identifier.
|
|
3107
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3108
|
+
* @return Success
|
|
3109
|
+
*/
|
|
3110
|
+
getNopCommerceStorefront(id, tenantId) {
|
|
3111
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/nopcommerce/{id}?";
|
|
3112
|
+
if (id === undefined || id === null)
|
|
3113
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3114
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3115
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3116
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3117
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3118
|
+
let options_ = {
|
|
3119
|
+
observe: "response",
|
|
3120
|
+
responseType: "blob",
|
|
3121
|
+
headers: new HttpHeaders({
|
|
3122
|
+
"Accept": "application/json"
|
|
3123
|
+
})
|
|
3124
|
+
};
|
|
3125
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3126
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
3127
|
+
})).pipe(mergeMap((response_) => {
|
|
3128
|
+
return this.transformResult(url_, response_, (r) => this.processGetNopCommerceStorefront(r));
|
|
3129
|
+
})).pipe(catchError((response_) => {
|
|
3130
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3131
|
+
try {
|
|
3132
|
+
return this.transformResult(url_, response_, (r) => this.processGetNopCommerceStorefront(r));
|
|
3133
|
+
}
|
|
3134
|
+
catch (e) {
|
|
3135
|
+
return throwError(e);
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
else
|
|
3139
|
+
return throwError(response_);
|
|
3140
|
+
}));
|
|
3141
|
+
}
|
|
3142
|
+
processGetNopCommerceStorefront(response) {
|
|
3143
|
+
const status = response.status;
|
|
3144
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3145
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3146
|
+
let _headers = {};
|
|
3147
|
+
if (response.headers) {
|
|
3148
|
+
for (let key of response.headers.keys()) {
|
|
3149
|
+
_headers[key] = response.headers.get(key);
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
if (status === 200) {
|
|
3153
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3154
|
+
let result200 = null;
|
|
3155
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3156
|
+
return of(result200);
|
|
3157
|
+
}));
|
|
3158
|
+
}
|
|
3159
|
+
else if (status === 404) {
|
|
3160
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3161
|
+
let result404 = null;
|
|
3162
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3163
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3164
|
+
}));
|
|
3165
|
+
}
|
|
3166
|
+
else if (status === 401) {
|
|
3167
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3168
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3169
|
+
}));
|
|
3170
|
+
}
|
|
3171
|
+
else if (status === 403) {
|
|
3172
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3173
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3174
|
+
}));
|
|
3175
|
+
}
|
|
3176
|
+
else if (status !== 200 && status !== 204) {
|
|
3177
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3178
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3179
|
+
}));
|
|
3180
|
+
}
|
|
3181
|
+
return of(null);
|
|
3182
|
+
}
|
|
3183
|
+
/**
|
|
3184
|
+
* Creates new WooCommerce storefront.
|
|
3185
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3186
|
+
* @param body (optional) WooCommerce storefront creation model.
|
|
3187
|
+
* @return Success
|
|
3188
|
+
*/
|
|
3189
|
+
createWooCommerceStorefront(tenantId, body) {
|
|
3190
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/woocommerce?";
|
|
3191
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3192
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3193
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3194
|
+
const content_ = JSON.stringify(body);
|
|
3195
|
+
let options_ = {
|
|
3196
|
+
body: content_,
|
|
3197
|
+
observe: "response",
|
|
3198
|
+
responseType: "blob",
|
|
3199
|
+
headers: new HttpHeaders({
|
|
3200
|
+
"Content-Type": "application/json",
|
|
3201
|
+
"Accept": "application/json"
|
|
3202
|
+
})
|
|
3203
|
+
};
|
|
3204
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3205
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3206
|
+
})).pipe(mergeMap((response_) => {
|
|
3207
|
+
return this.transformResult(url_, response_, (r) => this.processCreateWooCommerceStorefront(r));
|
|
3208
|
+
})).pipe(catchError((response_) => {
|
|
3209
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3210
|
+
try {
|
|
3211
|
+
return this.transformResult(url_, response_, (r) => this.processCreateWooCommerceStorefront(r));
|
|
3212
|
+
}
|
|
3213
|
+
catch (e) {
|
|
3214
|
+
return throwError(e);
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
else
|
|
3218
|
+
return throwError(response_);
|
|
3219
|
+
}));
|
|
3220
|
+
}
|
|
3221
|
+
processCreateWooCommerceStorefront(response) {
|
|
3222
|
+
const status = response.status;
|
|
3223
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3224
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3225
|
+
let _headers = {};
|
|
3226
|
+
if (response.headers) {
|
|
3227
|
+
for (let key of response.headers.keys()) {
|
|
3228
|
+
_headers[key] = response.headers.get(key);
|
|
3229
|
+
}
|
|
3230
|
+
}
|
|
3231
|
+
if (status === 200) {
|
|
3232
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3233
|
+
let result200 = null;
|
|
3234
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3235
|
+
return of(result200);
|
|
3236
|
+
}));
|
|
3237
|
+
}
|
|
3238
|
+
else if (status === 400) {
|
|
3239
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3240
|
+
let result400 = null;
|
|
3241
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3242
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3243
|
+
}));
|
|
3244
|
+
}
|
|
3245
|
+
else if (status === 409) {
|
|
3246
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3247
|
+
let result409 = null;
|
|
3248
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3249
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3250
|
+
}));
|
|
3251
|
+
}
|
|
3252
|
+
else if (status === 401) {
|
|
3253
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3254
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3255
|
+
}));
|
|
3256
|
+
}
|
|
3257
|
+
else if (status === 403) {
|
|
3258
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3259
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3260
|
+
}));
|
|
3261
|
+
}
|
|
3262
|
+
else if (status !== 200 && status !== 204) {
|
|
3263
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3264
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3265
|
+
}));
|
|
3266
|
+
}
|
|
3267
|
+
return of(null);
|
|
3268
|
+
}
|
|
3269
|
+
/**
|
|
3270
|
+
* Returns extended information about WooCommerce storefront.
|
|
3271
|
+
* @param id Storefront identifier.
|
|
3272
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3273
|
+
* @return Success
|
|
3274
|
+
*/
|
|
3275
|
+
getWooCommerceStorefront(id, tenantId) {
|
|
3276
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/woocommerce/{id}?";
|
|
3277
|
+
if (id === undefined || id === null)
|
|
3278
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3279
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3280
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3281
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3282
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3283
|
+
let options_ = {
|
|
3284
|
+
observe: "response",
|
|
3285
|
+
responseType: "blob",
|
|
3286
|
+
headers: new HttpHeaders({
|
|
3287
|
+
"Accept": "application/json"
|
|
3288
|
+
})
|
|
3289
|
+
};
|
|
3290
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3291
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
3292
|
+
})).pipe(mergeMap((response_) => {
|
|
3293
|
+
return this.transformResult(url_, response_, (r) => this.processGetWooCommerceStorefront(r));
|
|
3294
|
+
})).pipe(catchError((response_) => {
|
|
3295
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3296
|
+
try {
|
|
3297
|
+
return this.transformResult(url_, response_, (r) => this.processGetWooCommerceStorefront(r));
|
|
3298
|
+
}
|
|
3299
|
+
catch (e) {
|
|
3300
|
+
return throwError(e);
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
else
|
|
3304
|
+
return throwError(response_);
|
|
3305
|
+
}));
|
|
3306
|
+
}
|
|
3307
|
+
processGetWooCommerceStorefront(response) {
|
|
3308
|
+
const status = response.status;
|
|
3309
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3310
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3311
|
+
let _headers = {};
|
|
3312
|
+
if (response.headers) {
|
|
3313
|
+
for (let key of response.headers.keys()) {
|
|
3314
|
+
_headers[key] = response.headers.get(key);
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
if (status === 200) {
|
|
3318
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3319
|
+
let result200 = null;
|
|
3320
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3321
|
+
return of(result200);
|
|
3322
|
+
}));
|
|
3323
|
+
}
|
|
3324
|
+
else if (status === 404) {
|
|
3325
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3326
|
+
let result404 = null;
|
|
3327
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3328
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3329
|
+
}));
|
|
3330
|
+
}
|
|
3331
|
+
else if (status === 401) {
|
|
3332
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3333
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3334
|
+
}));
|
|
3335
|
+
}
|
|
3336
|
+
else if (status === 403) {
|
|
3337
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3338
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3339
|
+
}));
|
|
3340
|
+
}
|
|
3341
|
+
else if (status !== 200 && status !== 204) {
|
|
3342
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3343
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3344
|
+
}));
|
|
3345
|
+
}
|
|
3346
|
+
return of(null);
|
|
3347
|
+
}
|
|
3348
|
+
/**
|
|
3349
|
+
* Creates new Magento storefront.
|
|
3350
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3351
|
+
* @param body (optional) Magento storefront creation model.
|
|
3352
|
+
* @return Success
|
|
3353
|
+
*/
|
|
3354
|
+
createMagentoStorefront(tenantId, body) {
|
|
3355
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/magento?";
|
|
3356
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3357
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3358
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3359
|
+
const content_ = JSON.stringify(body);
|
|
3360
|
+
let options_ = {
|
|
3361
|
+
body: content_,
|
|
3362
|
+
observe: "response",
|
|
3363
|
+
responseType: "blob",
|
|
3364
|
+
headers: new HttpHeaders({
|
|
3365
|
+
"Content-Type": "application/json",
|
|
3366
|
+
"Accept": "application/json"
|
|
3367
|
+
})
|
|
3368
|
+
};
|
|
3369
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3370
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3371
|
+
})).pipe(mergeMap((response_) => {
|
|
3372
|
+
return this.transformResult(url_, response_, (r) => this.processCreateMagentoStorefront(r));
|
|
3373
|
+
})).pipe(catchError((response_) => {
|
|
3374
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3375
|
+
try {
|
|
3376
|
+
return this.transformResult(url_, response_, (r) => this.processCreateMagentoStorefront(r));
|
|
3377
|
+
}
|
|
3378
|
+
catch (e) {
|
|
3379
|
+
return throwError(e);
|
|
3380
|
+
}
|
|
3381
|
+
}
|
|
3382
|
+
else
|
|
3383
|
+
return throwError(response_);
|
|
3384
|
+
}));
|
|
3385
|
+
}
|
|
3386
|
+
processCreateMagentoStorefront(response) {
|
|
3387
|
+
const status = response.status;
|
|
3388
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3389
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3390
|
+
let _headers = {};
|
|
3391
|
+
if (response.headers) {
|
|
3392
|
+
for (let key of response.headers.keys()) {
|
|
3393
|
+
_headers[key] = response.headers.get(key);
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
if (status === 200) {
|
|
3397
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3398
|
+
let result200 = null;
|
|
3399
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3400
|
+
return of(result200);
|
|
3401
|
+
}));
|
|
3402
|
+
}
|
|
3403
|
+
else if (status === 400) {
|
|
3404
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3405
|
+
let result400 = null;
|
|
3406
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3407
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3408
|
+
}));
|
|
3409
|
+
}
|
|
3410
|
+
else if (status === 409) {
|
|
3411
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3412
|
+
let result409 = null;
|
|
3413
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3414
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3415
|
+
}));
|
|
3416
|
+
}
|
|
3417
|
+
else if (status === 401) {
|
|
3418
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3419
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3420
|
+
}));
|
|
3421
|
+
}
|
|
3422
|
+
else if (status === 403) {
|
|
3423
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3424
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3425
|
+
}));
|
|
3426
|
+
}
|
|
3427
|
+
else if (status !== 200 && status !== 204) {
|
|
3428
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3429
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3430
|
+
}));
|
|
3431
|
+
}
|
|
3432
|
+
return of(null);
|
|
3433
|
+
}
|
|
3434
|
+
/**
|
|
3435
|
+
* Returns extended information about Magento storefront.
|
|
3436
|
+
* @param id Storefront identifier.
|
|
3437
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3438
|
+
* @return Success
|
|
3439
|
+
*/
|
|
3440
|
+
getMagentoStorefront(id, tenantId) {
|
|
3441
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/magento/{id}?";
|
|
3442
|
+
if (id === undefined || id === null)
|
|
3443
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3444
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3445
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3446
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3447
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3448
|
+
let options_ = {
|
|
3449
|
+
observe: "response",
|
|
3450
|
+
responseType: "blob",
|
|
3451
|
+
headers: new HttpHeaders({
|
|
3452
|
+
"Accept": "application/json"
|
|
3453
|
+
})
|
|
3454
|
+
};
|
|
3455
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3456
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
3457
|
+
})).pipe(mergeMap((response_) => {
|
|
3458
|
+
return this.transformResult(url_, response_, (r) => this.processGetMagentoStorefront(r));
|
|
3459
|
+
})).pipe(catchError((response_) => {
|
|
3460
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3461
|
+
try {
|
|
3462
|
+
return this.transformResult(url_, response_, (r) => this.processGetMagentoStorefront(r));
|
|
3463
|
+
}
|
|
3464
|
+
catch (e) {
|
|
3465
|
+
return throwError(e);
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
else
|
|
3469
|
+
return throwError(response_);
|
|
3470
|
+
}));
|
|
3471
|
+
}
|
|
3472
|
+
processGetMagentoStorefront(response) {
|
|
3473
|
+
const status = response.status;
|
|
3474
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3475
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3476
|
+
let _headers = {};
|
|
3477
|
+
if (response.headers) {
|
|
3478
|
+
for (let key of response.headers.keys()) {
|
|
3479
|
+
_headers[key] = response.headers.get(key);
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
if (status === 200) {
|
|
3483
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3484
|
+
let result200 = null;
|
|
3485
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3486
|
+
return of(result200);
|
|
3487
|
+
}));
|
|
3488
|
+
}
|
|
3489
|
+
else if (status === 404) {
|
|
3490
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3491
|
+
let result404 = null;
|
|
3492
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3493
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3494
|
+
}));
|
|
3495
|
+
}
|
|
3496
|
+
else if (status === 401) {
|
|
3497
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3498
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3499
|
+
}));
|
|
3500
|
+
}
|
|
3501
|
+
else if (status === 403) {
|
|
3502
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3503
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3504
|
+
}));
|
|
3505
|
+
}
|
|
3506
|
+
else if (status !== 200 && status !== 204) {
|
|
3507
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3508
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3509
|
+
}));
|
|
3510
|
+
}
|
|
3511
|
+
return of(null);
|
|
3512
|
+
}
|
|
3513
|
+
/**
|
|
3514
|
+
* Creates new BigCommerce storefront.
|
|
3515
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3516
|
+
* @param body (optional) BigCommerce storefront creation model.
|
|
3517
|
+
* @return Success
|
|
3518
|
+
*/
|
|
3519
|
+
createBigCommerceStorefront(tenantId, body) {
|
|
3520
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/bigcommerce?";
|
|
3521
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3522
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3523
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3524
|
+
const content_ = JSON.stringify(body);
|
|
3525
|
+
let options_ = {
|
|
3526
|
+
body: content_,
|
|
3527
|
+
observe: "response",
|
|
3528
|
+
responseType: "blob",
|
|
3529
|
+
headers: new HttpHeaders({
|
|
3530
|
+
"Content-Type": "application/json",
|
|
3531
|
+
"Accept": "application/json"
|
|
3532
|
+
})
|
|
3533
|
+
};
|
|
3534
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3535
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3536
|
+
})).pipe(mergeMap((response_) => {
|
|
3537
|
+
return this.transformResult(url_, response_, (r) => this.processCreateBigCommerceStorefront(r));
|
|
3538
|
+
})).pipe(catchError((response_) => {
|
|
3539
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3540
|
+
try {
|
|
3541
|
+
return this.transformResult(url_, response_, (r) => this.processCreateBigCommerceStorefront(r));
|
|
3542
|
+
}
|
|
3543
|
+
catch (e) {
|
|
3544
|
+
return throwError(e);
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
else
|
|
3548
|
+
return throwError(response_);
|
|
3549
|
+
}));
|
|
3550
|
+
}
|
|
3551
|
+
processCreateBigCommerceStorefront(response) {
|
|
3552
|
+
const status = response.status;
|
|
3553
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3554
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3555
|
+
let _headers = {};
|
|
3556
|
+
if (response.headers) {
|
|
3557
|
+
for (let key of response.headers.keys()) {
|
|
3558
|
+
_headers[key] = response.headers.get(key);
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
if (status === 200) {
|
|
3562
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3563
|
+
let result200 = null;
|
|
3564
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3565
|
+
return of(result200);
|
|
3566
|
+
}));
|
|
3567
|
+
}
|
|
3568
|
+
else if (status === 400) {
|
|
3569
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3570
|
+
let result400 = null;
|
|
3571
|
+
result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3572
|
+
return throwException("Bad Request", status, _responseText, _headers, result400);
|
|
3573
|
+
}));
|
|
3574
|
+
}
|
|
3575
|
+
else if (status === 409) {
|
|
3576
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3577
|
+
let result409 = null;
|
|
3578
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3579
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3580
|
+
}));
|
|
3581
|
+
}
|
|
3582
|
+
else if (status === 401) {
|
|
3583
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3584
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3585
|
+
}));
|
|
3586
|
+
}
|
|
3587
|
+
else if (status === 403) {
|
|
3588
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3589
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3590
|
+
}));
|
|
3591
|
+
}
|
|
3592
|
+
else if (status !== 200 && status !== 204) {
|
|
3593
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3594
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3595
|
+
}));
|
|
3596
|
+
}
|
|
3597
|
+
return of(null);
|
|
3598
|
+
}
|
|
3599
|
+
/**
|
|
3600
|
+
* Returns extended information about BigCommerce storefront.
|
|
3601
|
+
* @param id Storefront identifier.
|
|
3602
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3603
|
+
* @return Success
|
|
3604
|
+
*/
|
|
3605
|
+
getBigCommerceStorefront(id, tenantId) {
|
|
3606
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/storefronts/bigcommerce/{id}?";
|
|
3607
|
+
if (id === undefined || id === null)
|
|
3608
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3609
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3610
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3611
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3612
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3613
|
+
let options_ = {
|
|
3614
|
+
observe: "response",
|
|
3615
|
+
responseType: "blob",
|
|
3616
|
+
headers: new HttpHeaders({
|
|
3617
|
+
"Accept": "application/json"
|
|
3618
|
+
})
|
|
3619
|
+
};
|
|
3620
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3621
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
3622
|
+
})).pipe(mergeMap((response_) => {
|
|
3623
|
+
return this.transformResult(url_, response_, (r) => this.processGetBigCommerceStorefront(r));
|
|
3624
|
+
})).pipe(catchError((response_) => {
|
|
3625
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3626
|
+
try {
|
|
3627
|
+
return this.transformResult(url_, response_, (r) => this.processGetBigCommerceStorefront(r));
|
|
3628
|
+
}
|
|
3629
|
+
catch (e) {
|
|
3630
|
+
return throwError(e);
|
|
3631
|
+
}
|
|
3632
|
+
}
|
|
3633
|
+
else
|
|
3634
|
+
return throwError(response_);
|
|
3635
|
+
}));
|
|
3636
|
+
}
|
|
3637
|
+
processGetBigCommerceStorefront(response) {
|
|
3638
|
+
const status = response.status;
|
|
3639
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3640
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3641
|
+
let _headers = {};
|
|
3642
|
+
if (response.headers) {
|
|
3643
|
+
for (let key of response.headers.keys()) {
|
|
3644
|
+
_headers[key] = response.headers.get(key);
|
|
3645
|
+
}
|
|
3646
|
+
}
|
|
3647
|
+
if (status === 200) {
|
|
3648
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3649
|
+
let result200 = null;
|
|
3650
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3651
|
+
return of(result200);
|
|
3652
|
+
}));
|
|
3653
|
+
}
|
|
3654
|
+
else if (status === 404) {
|
|
3655
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3656
|
+
let result404 = null;
|
|
3657
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3658
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3659
|
+
}));
|
|
3660
|
+
}
|
|
3661
|
+
else if (status === 401) {
|
|
3662
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3663
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3664
|
+
}));
|
|
3665
|
+
}
|
|
3666
|
+
else if (status === 403) {
|
|
3667
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3668
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3669
|
+
}));
|
|
3670
|
+
}
|
|
3671
|
+
else if (status !== 200 && status !== 204) {
|
|
3672
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3673
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3674
|
+
}));
|
|
3675
|
+
}
|
|
3676
|
+
return of(null);
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
StorefrontsManagementApiClient.ɵprov = ɵɵdefineInjectable({ factory: function StorefrontsManagementApiClient_Factory() { return new StorefrontsManagementApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: StorefrontsManagementApiClient, providedIn: "root" });
|
|
3680
|
+
StorefrontsManagementApiClient.decorators = [
|
|
3681
|
+
{ type: Injectable, args: [{
|
|
3682
|
+
providedIn: 'root'
|
|
3683
|
+
},] }
|
|
3684
|
+
];
|
|
3685
|
+
StorefrontsManagementApiClient.ctorParameters = () => [
|
|
3686
|
+
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
3687
|
+
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
3688
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
3689
|
+
];
|
|
3690
|
+
class UsersManagementApiClient extends ApiClientBase {
|
|
3691
|
+
constructor(configuration, http, baseUrl) {
|
|
3692
|
+
super(configuration);
|
|
3693
|
+
this.jsonParseReviver = undefined;
|
|
3694
|
+
this.http = http;
|
|
3695
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
|
|
3696
|
+
}
|
|
3697
|
+
/**
|
|
3698
|
+
* Returns a tenant users list.
|
|
3699
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3700
|
+
* @return Success
|
|
3701
|
+
*/
|
|
3702
|
+
getAll(tenantId) {
|
|
3703
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users?";
|
|
3704
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3705
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3706
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3707
|
+
let options_ = {
|
|
3708
|
+
observe: "response",
|
|
3709
|
+
responseType: "blob",
|
|
3710
|
+
headers: new HttpHeaders({
|
|
3711
|
+
"Accept": "application/json"
|
|
3712
|
+
})
|
|
3713
|
+
};
|
|
3714
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3715
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
3716
|
+
})).pipe(mergeMap((response_) => {
|
|
3717
|
+
return this.transformResult(url_, response_, (r) => this.processGetAll(r));
|
|
3718
|
+
})).pipe(catchError((response_) => {
|
|
3719
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3720
|
+
try {
|
|
3721
|
+
return this.transformResult(url_, response_, (r) => this.processGetAll(r));
|
|
3722
|
+
}
|
|
3723
|
+
catch (e) {
|
|
3724
|
+
return throwError(e);
|
|
3725
|
+
}
|
|
3726
|
+
}
|
|
3727
|
+
else
|
|
3728
|
+
return throwError(response_);
|
|
3729
|
+
}));
|
|
3730
|
+
}
|
|
3731
|
+
processGetAll(response) {
|
|
3732
|
+
const status = response.status;
|
|
3733
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3734
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3735
|
+
let _headers = {};
|
|
3736
|
+
if (response.headers) {
|
|
3737
|
+
for (let key of response.headers.keys()) {
|
|
3738
|
+
_headers[key] = response.headers.get(key);
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
if (status === 200) {
|
|
3742
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3743
|
+
let result200 = null;
|
|
3744
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3745
|
+
return of(result200);
|
|
3746
|
+
}));
|
|
3747
|
+
}
|
|
3748
|
+
else if (status === 401) {
|
|
3749
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3750
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3751
|
+
}));
|
|
3752
|
+
}
|
|
3753
|
+
else if (status === 403) {
|
|
3754
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3755
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3756
|
+
}));
|
|
3757
|
+
}
|
|
3758
|
+
else if (status !== 200 && status !== 204) {
|
|
3759
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3760
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3761
|
+
}));
|
|
3762
|
+
}
|
|
3763
|
+
return of(null);
|
|
3764
|
+
}
|
|
3765
|
+
/**
|
|
3766
|
+
* Creates a new tenant user.
|
|
3767
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3768
|
+
* @param body (optional) User creation model.
|
|
3769
|
+
* @return Success
|
|
3770
|
+
*/
|
|
3771
|
+
create(tenantId, body) {
|
|
3772
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users?";
|
|
3773
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3774
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3775
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3776
|
+
const content_ = JSON.stringify(body);
|
|
3777
|
+
let options_ = {
|
|
3778
|
+
body: content_,
|
|
3779
|
+
observe: "response",
|
|
3780
|
+
responseType: "blob",
|
|
3781
|
+
headers: new HttpHeaders({
|
|
3782
|
+
"Content-Type": "application/json",
|
|
3783
|
+
"Accept": "application/json"
|
|
3784
|
+
})
|
|
3785
|
+
};
|
|
3786
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3787
|
+
return this.http.request("post", url_, transformedOptions_);
|
|
3788
|
+
})).pipe(mergeMap((response_) => {
|
|
3789
|
+
return this.transformResult(url_, response_, (r) => this.processCreate(r));
|
|
3790
|
+
})).pipe(catchError((response_) => {
|
|
3791
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3792
|
+
try {
|
|
3793
|
+
return this.transformResult(url_, response_, (r) => this.processCreate(r));
|
|
3794
|
+
}
|
|
3795
|
+
catch (e) {
|
|
3796
|
+
return throwError(e);
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3799
|
+
else
|
|
3800
|
+
return throwError(response_);
|
|
3801
|
+
}));
|
|
3802
|
+
}
|
|
3803
|
+
processCreate(response) {
|
|
3804
|
+
const status = response.status;
|
|
3805
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3806
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3807
|
+
let _headers = {};
|
|
3808
|
+
if (response.headers) {
|
|
3809
|
+
for (let key of response.headers.keys()) {
|
|
3810
|
+
_headers[key] = response.headers.get(key);
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
if (status === 200) {
|
|
3814
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3815
|
+
let result200 = null;
|
|
3816
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3817
|
+
return of(result200);
|
|
3818
|
+
}));
|
|
3819
|
+
}
|
|
3820
|
+
else if (status === 409) {
|
|
3821
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3822
|
+
let result409 = null;
|
|
3823
|
+
result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3824
|
+
return throwException("Conflict", status, _responseText, _headers, result409);
|
|
3825
|
+
}));
|
|
3826
|
+
}
|
|
3827
|
+
else if (status === 401) {
|
|
3828
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3829
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3830
|
+
}));
|
|
3831
|
+
}
|
|
3832
|
+
else if (status === 403) {
|
|
3833
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3834
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3835
|
+
}));
|
|
3836
|
+
}
|
|
3837
|
+
else if (status !== 200 && status !== 204) {
|
|
3838
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3839
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3840
|
+
}));
|
|
3841
|
+
}
|
|
3842
|
+
return of(null);
|
|
3843
|
+
}
|
|
3844
|
+
/**
|
|
3845
|
+
* Returns a tenant user by user identifier.
|
|
3846
|
+
* @param id User identifier.
|
|
3847
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3848
|
+
* @return Success
|
|
3849
|
+
*/
|
|
3850
|
+
get(id, tenantId) {
|
|
3851
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users/{id}?";
|
|
3852
|
+
if (id === undefined || id === null)
|
|
3853
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3854
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3855
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3856
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3857
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3858
|
+
let options_ = {
|
|
3859
|
+
observe: "response",
|
|
3860
|
+
responseType: "blob",
|
|
3861
|
+
headers: new HttpHeaders({
|
|
3862
|
+
"Accept": "application/json"
|
|
3863
|
+
})
|
|
3864
|
+
};
|
|
3865
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3866
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
3867
|
+
})).pipe(mergeMap((response_) => {
|
|
3868
|
+
return this.transformResult(url_, response_, (r) => this.processGet(r));
|
|
3869
|
+
})).pipe(catchError((response_) => {
|
|
3870
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3871
|
+
try {
|
|
3872
|
+
return this.transformResult(url_, response_, (r) => this.processGet(r));
|
|
3873
|
+
}
|
|
3874
|
+
catch (e) {
|
|
3875
|
+
return throwError(e);
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
else
|
|
3879
|
+
return throwError(response_);
|
|
3880
|
+
}));
|
|
3881
|
+
}
|
|
3882
|
+
processGet(response) {
|
|
3883
|
+
const status = response.status;
|
|
3884
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3885
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3886
|
+
let _headers = {};
|
|
3887
|
+
if (response.headers) {
|
|
3888
|
+
for (let key of response.headers.keys()) {
|
|
3889
|
+
_headers[key] = response.headers.get(key);
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
if (status === 200) {
|
|
3893
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3894
|
+
let result200 = null;
|
|
3895
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3896
|
+
return of(result200);
|
|
3897
|
+
}));
|
|
3898
|
+
}
|
|
3899
|
+
else if (status === 404) {
|
|
3900
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3901
|
+
let result404 = null;
|
|
3902
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
3903
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
3904
|
+
}));
|
|
3905
|
+
}
|
|
3906
|
+
else if (status === 401) {
|
|
3907
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3908
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3909
|
+
}));
|
|
3910
|
+
}
|
|
3911
|
+
else if (status === 403) {
|
|
3912
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3913
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3914
|
+
}));
|
|
3915
|
+
}
|
|
3916
|
+
else if (status !== 200 && status !== 204) {
|
|
3917
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3918
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3919
|
+
}));
|
|
3920
|
+
}
|
|
3921
|
+
return of(null);
|
|
3922
|
+
}
|
|
3923
|
+
/**
|
|
3924
|
+
* Deletes an existing tenant user.
|
|
3925
|
+
* @param id User identifier.
|
|
3926
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3927
|
+
* @return Success
|
|
3928
|
+
*/
|
|
3929
|
+
delete(id, tenantId) {
|
|
3930
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users/{id}?";
|
|
3931
|
+
if (id === undefined || id === null)
|
|
3932
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
3933
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
3934
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
3935
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
3936
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
3937
|
+
let options_ = {
|
|
3938
|
+
observe: "response",
|
|
3939
|
+
responseType: "blob",
|
|
3940
|
+
headers: new HttpHeaders({})
|
|
3941
|
+
};
|
|
3942
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
3943
|
+
return this.http.request("delete", url_, transformedOptions_);
|
|
3944
|
+
})).pipe(mergeMap((response_) => {
|
|
3945
|
+
return this.transformResult(url_, response_, (r) => this.processDelete(r));
|
|
3946
|
+
})).pipe(catchError((response_) => {
|
|
3947
|
+
if (response_ instanceof HttpResponseBase) {
|
|
3948
|
+
try {
|
|
3949
|
+
return this.transformResult(url_, response_, (r) => this.processDelete(r));
|
|
3950
|
+
}
|
|
3951
|
+
catch (e) {
|
|
3952
|
+
return throwError(e);
|
|
3953
|
+
}
|
|
3954
|
+
}
|
|
3955
|
+
else
|
|
3956
|
+
return throwError(response_);
|
|
3957
|
+
}));
|
|
3958
|
+
}
|
|
3959
|
+
processDelete(response) {
|
|
3960
|
+
const status = response.status;
|
|
3961
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
3962
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
3963
|
+
let _headers = {};
|
|
3964
|
+
if (response.headers) {
|
|
3965
|
+
for (let key of response.headers.keys()) {
|
|
3966
|
+
_headers[key] = response.headers.get(key);
|
|
3967
|
+
}
|
|
3968
|
+
}
|
|
3969
|
+
if (status === 200) {
|
|
3970
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3971
|
+
return of(null);
|
|
3972
|
+
}));
|
|
3973
|
+
}
|
|
3974
|
+
else if (status === 401) {
|
|
3975
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3976
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
3977
|
+
}));
|
|
3978
|
+
}
|
|
3979
|
+
else if (status === 403) {
|
|
3980
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3981
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
3982
|
+
}));
|
|
3983
|
+
}
|
|
3984
|
+
else if (status !== 200 && status !== 204) {
|
|
3985
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
3986
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
3987
|
+
}));
|
|
3988
|
+
}
|
|
3989
|
+
return of(null);
|
|
3990
|
+
}
|
|
3991
|
+
/**
|
|
3992
|
+
* Returns all tenant user roles, relevant to the specified query parameters.
|
|
3993
|
+
* @param search (optional) Search string for partial match.
|
|
3994
|
+
* @param skip (optional) Defines page start offset from beginning of sorted result list.
|
|
3995
|
+
* @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
|
|
3996
|
+
* @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
|
|
3997
|
+
* @param tenantId (optional) Tenant identifier.
|
|
3998
|
+
* @return Success
|
|
3999
|
+
*/
|
|
4000
|
+
getAllRoles(search, skip, take, sorting, tenantId) {
|
|
4001
|
+
let url_ = this.baseUrl + "/api/backoffice/v1/users/roles?";
|
|
4002
|
+
if (search !== undefined && search !== null)
|
|
4003
|
+
url_ += "search=" + encodeURIComponent("" + search) + "&";
|
|
4004
|
+
if (skip !== undefined && skip !== null)
|
|
4005
|
+
url_ += "skip=" + encodeURIComponent("" + skip) + "&";
|
|
4006
|
+
if (take !== undefined && take !== null)
|
|
4007
|
+
url_ += "take=" + encodeURIComponent("" + take) + "&";
|
|
4008
|
+
if (sorting !== undefined && sorting !== null)
|
|
4009
|
+
url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
|
|
4010
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
4011
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
4012
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
4013
|
+
let options_ = {
|
|
4014
|
+
observe: "response",
|
|
4015
|
+
responseType: "blob",
|
|
4016
|
+
headers: new HttpHeaders({
|
|
4017
|
+
"Accept": "application/json"
|
|
4018
|
+
})
|
|
4019
|
+
};
|
|
4020
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
4021
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
4022
|
+
})).pipe(mergeMap((response_) => {
|
|
4023
|
+
return this.transformResult(url_, response_, (r) => this.processGetAllRoles(r));
|
|
4024
|
+
})).pipe(catchError((response_) => {
|
|
4025
|
+
if (response_ instanceof HttpResponseBase) {
|
|
4026
|
+
try {
|
|
4027
|
+
return this.transformResult(url_, response_, (r) => this.processGetAllRoles(r));
|
|
4028
|
+
}
|
|
4029
|
+
catch (e) {
|
|
4030
|
+
return throwError(e);
|
|
4031
|
+
}
|
|
4032
|
+
}
|
|
4033
|
+
else
|
|
4034
|
+
return throwError(response_);
|
|
4035
|
+
}));
|
|
4036
|
+
}
|
|
4037
|
+
processGetAllRoles(response) {
|
|
4038
|
+
const status = response.status;
|
|
4039
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
4040
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
4041
|
+
let _headers = {};
|
|
4042
|
+
if (response.headers) {
|
|
4043
|
+
for (let key of response.headers.keys()) {
|
|
4044
|
+
_headers[key] = response.headers.get(key);
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
if (status === 200) {
|
|
4048
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4049
|
+
let result200 = null;
|
|
4050
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
4051
|
+
return of(result200);
|
|
4052
|
+
}));
|
|
4053
|
+
}
|
|
4054
|
+
else if (status === 401) {
|
|
4055
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4056
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
4057
|
+
}));
|
|
4058
|
+
}
|
|
4059
|
+
else if (status === 403) {
|
|
4060
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4061
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
4062
|
+
}));
|
|
4063
|
+
}
|
|
4064
|
+
else if (status !== 200 && status !== 204) {
|
|
4065
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
4066
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
4067
|
+
}));
|
|
4068
|
+
}
|
|
4069
|
+
return of(null);
|
|
4070
|
+
}
|
|
4071
|
+
}
|
|
4072
|
+
UsersManagementApiClient.ɵprov = ɵɵdefineInjectable({ factory: function UsersManagementApiClient_Factory() { return new UsersManagementApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: UsersManagementApiClient, providedIn: "root" });
|
|
4073
|
+
UsersManagementApiClient.decorators = [
|
|
4074
|
+
{ type: Injectable, args: [{
|
|
4075
|
+
providedIn: 'root'
|
|
4076
|
+
},] }
|
|
4077
|
+
];
|
|
4078
|
+
UsersManagementApiClient.ctorParameters = () => [
|
|
4079
|
+
{ type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
|
|
4080
|
+
{ type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
|
|
4081
|
+
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
|
|
4082
|
+
];
|
|
4083
|
+
/** Available product reference target types. */
|
|
4084
|
+
var ProductReferenceType;
|
|
4085
|
+
(function (ProductReferenceType) {
|
|
4086
|
+
ProductReferenceType["ProductSpecification"] = "ProductSpecification";
|
|
4087
|
+
ProductReferenceType["Product"] = "Product";
|
|
4088
|
+
ProductReferenceType["ProductLink"] = "ProductLink";
|
|
4089
|
+
})(ProductReferenceType || (ProductReferenceType = {}));
|
|
4090
|
+
/** Conflict types. */
|
|
4091
|
+
var ConflictType;
|
|
4092
|
+
(function (ConflictType) {
|
|
4093
|
+
ConflictType["NameConflict"] = "NameConflict";
|
|
4094
|
+
ConflictType["FolderOverwriteConflict"] = "FolderOverwriteConflict";
|
|
4095
|
+
ConflictType["IdConflict"] = "IdConflict";
|
|
4096
|
+
ConflictType["GeneralConflict"] = "GeneralConflict";
|
|
4097
|
+
})(ConflictType || (ConflictType = {}));
|
|
4098
|
+
/** Available option types. */
|
|
4099
|
+
var OptionType;
|
|
4100
|
+
(function (OptionType) {
|
|
4101
|
+
OptionType["Simple"] = "Simple";
|
|
4102
|
+
OptionType["Size"] = "Size";
|
|
4103
|
+
OptionType["PageCount"] = "PageCount";
|
|
4104
|
+
})(OptionType || (OptionType = {}));
|
|
4105
|
+
/** Available appearance types. */
|
|
4106
|
+
var AppearanceDataType;
|
|
4107
|
+
(function (AppearanceDataType) {
|
|
4108
|
+
AppearanceDataType["Radio"] = "Radio";
|
|
4109
|
+
AppearanceDataType["Dropdown"] = "Dropdown";
|
|
4110
|
+
AppearanceDataType["Chips"] = "Chips";
|
|
4111
|
+
AppearanceDataType["ColorGrid"] = "ColorGrid";
|
|
4112
|
+
AppearanceDataType["ColorList"] = "ColorList";
|
|
4113
|
+
AppearanceDataType["ImageGrid"] = "ImageGrid";
|
|
4114
|
+
AppearanceDataType["ImageList"] = "ImageList";
|
|
4115
|
+
})(AppearanceDataType || (AppearanceDataType = {}));
|
|
4116
|
+
/** Available product variant resource types. */
|
|
4117
|
+
var ProductVariantResourceType;
|
|
4118
|
+
(function (ProductVariantResourceType) {
|
|
4119
|
+
ProductVariantResourceType["Preview"] = "Preview";
|
|
4120
|
+
ProductVariantResourceType["EditorModel"] = "EditorModel";
|
|
4121
|
+
ProductVariantResourceType["Custom"] = "Custom";
|
|
4122
|
+
})(ProductVariantResourceType || (ProductVariantResourceType = {}));
|
|
4123
|
+
/** Available mockup types. */
|
|
4124
|
+
var ProductVariantMockupType;
|
|
4125
|
+
(function (ProductVariantMockupType) {
|
|
4126
|
+
ProductVariantMockupType["Thumbnail"] = "Thumbnail";
|
|
4127
|
+
ProductVariantMockupType["Editor"] = "Editor";
|
|
4128
|
+
ProductVariantMockupType["Preview"] = "Preview";
|
|
4129
|
+
})(ProductVariantMockupType || (ProductVariantMockupType = {}));
|
|
4130
|
+
/** Available surface usage types. */
|
|
4131
|
+
var SurfaceUsageType;
|
|
4132
|
+
(function (SurfaceUsageType) {
|
|
4133
|
+
SurfaceUsageType["Individual"] = "Individual";
|
|
4134
|
+
SurfaceUsageType["Custom"] = "Custom";
|
|
4135
|
+
SurfaceUsageType["All"] = "All";
|
|
4136
|
+
})(SurfaceUsageType || (SurfaceUsageType = {}));
|
|
4137
|
+
/** Product mockup type. */
|
|
4138
|
+
var ProductMockupType;
|
|
4139
|
+
(function (ProductMockupType) {
|
|
4140
|
+
ProductMockupType["Thumbnail"] = "Thumbnail";
|
|
4141
|
+
ProductMockupType["Editor"] = "Editor";
|
|
4142
|
+
ProductMockupType["Preview"] = "Preview";
|
|
4143
|
+
})(ProductMockupType || (ProductMockupType = {}));
|
|
4144
|
+
/** Type of editor that should be configured by workflow. */
|
|
4145
|
+
var WorkflowType;
|
|
4146
|
+
(function (WorkflowType) {
|
|
4147
|
+
WorkflowType["UIFramework"] = "UIFramework";
|
|
4148
|
+
WorkflowType["SimpleEditor"] = "SimpleEditor";
|
|
4149
|
+
WorkflowType["DesignEditor"] = "DesignEditor";
|
|
4150
|
+
WorkflowType["WorkflowElements"] = "WorkflowElements";
|
|
4151
|
+
})(WorkflowType || (WorkflowType = {}));
|
|
4152
|
+
/** Storefront types. */
|
|
4153
|
+
var StorefrontType;
|
|
4154
|
+
(function (StorefrontType) {
|
|
4155
|
+
StorefrontType["Custom"] = "Custom";
|
|
4156
|
+
StorefrontType["ShopifyLegacy"] = "ShopifyLegacy";
|
|
4157
|
+
StorefrontType["DocketManager"] = "DocketManager";
|
|
4158
|
+
StorefrontType["CustomSaml"] = "CustomSaml";
|
|
4159
|
+
StorefrontType["NopCommerce"] = "NopCommerce";
|
|
4160
|
+
StorefrontType["WooCommerce"] = "WooCommerce";
|
|
4161
|
+
StorefrontType["Magento"] = "Magento";
|
|
4162
|
+
StorefrontType["BigCommerce"] = "BigCommerce";
|
|
4163
|
+
StorefrontType["Shopify"] = "Shopify";
|
|
4164
|
+
StorefrontType["ShopifyCustom"] = "ShopifyCustom";
|
|
4165
|
+
})(StorefrontType || (StorefrontType = {}));
|
|
4166
|
+
class ApiException extends Error {
|
|
4167
|
+
constructor(message, status, response, headers, result) {
|
|
4168
|
+
super();
|
|
4169
|
+
this.isApiException = true;
|
|
4170
|
+
this.message = message;
|
|
4171
|
+
this.status = status;
|
|
4172
|
+
this.response = response;
|
|
4173
|
+
this.headers = headers;
|
|
4174
|
+
this.result = result;
|
|
4175
|
+
}
|
|
4176
|
+
static isApiException(obj) {
|
|
4177
|
+
return obj.isApiException === true;
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
function throwException(message, status, response, headers, result) {
|
|
4181
|
+
if (result !== null && result !== undefined)
|
|
4182
|
+
return throwError(result);
|
|
4183
|
+
else
|
|
4184
|
+
return throwError(new ApiException(message, status, response, headers, null));
|
|
4185
|
+
}
|
|
4186
|
+
function blobToText(blob) {
|
|
4187
|
+
return new Observable((observer) => {
|
|
4188
|
+
if (!blob) {
|
|
4189
|
+
observer.next("");
|
|
4190
|
+
observer.complete();
|
|
4191
|
+
}
|
|
4192
|
+
else {
|
|
4193
|
+
let reader = new FileReader();
|
|
4194
|
+
reader.onload = event => {
|
|
4195
|
+
observer.next(event.target.result);
|
|
4196
|
+
observer.complete();
|
|
4197
|
+
};
|
|
4198
|
+
reader.readAsText(blob);
|
|
4199
|
+
}
|
|
4200
|
+
});
|
|
4201
|
+
}
|
|
4202
|
+
|
|
4203
|
+
// @dynamic
|
|
4204
|
+
function CreateApiClientConfiguration(token, apiUrl, apiKey = 'ApiKey') {
|
|
4205
|
+
const apiConf = new ApiClientConfiguration();
|
|
4206
|
+
apiConf.apiKey = apiKey;
|
|
4207
|
+
apiConf.apiUrl = apiUrl;
|
|
4208
|
+
apiConf.setAuthorizationToken(token);
|
|
4209
|
+
return apiConf;
|
|
4210
|
+
}
|
|
4211
|
+
class BackOfficeModule {
|
|
4212
|
+
static forRoot(token, apiUrl, apiKey = 'ApiKey') {
|
|
4213
|
+
return {
|
|
4214
|
+
ngModule: BackOfficeModule,
|
|
4215
|
+
providers: [
|
|
4216
|
+
{
|
|
4217
|
+
provide: API_BASE_URL,
|
|
4218
|
+
useValue: apiUrl
|
|
4219
|
+
},
|
|
4220
|
+
{
|
|
4221
|
+
provide: ApiClientConfiguration,
|
|
4222
|
+
useFactory: CreateApiClientConfiguration.bind(this, token, apiUrl, apiKey)
|
|
4223
|
+
},
|
|
4224
|
+
]
|
|
4225
|
+
};
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
BackOfficeModule.decorators = [
|
|
4229
|
+
{ type: NgModule, args: [{
|
|
4230
|
+
declarations: [],
|
|
4231
|
+
imports: [],
|
|
4232
|
+
exports: []
|
|
4233
|
+
},] }
|
|
4234
|
+
];
|
|
4235
|
+
|
|
4236
|
+
/*
|
|
4237
|
+
* Public API Surface of client
|
|
4238
|
+
*/
|
|
4239
|
+
|
|
4240
|
+
/**
|
|
4241
|
+
* Generated bundle index. Do not edit.
|
|
4242
|
+
*/
|
|
4243
|
+
|
|
4244
|
+
export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, AppearanceDataType, BackOfficeModule, BuildInfoApiClient, ConflictType, CreateApiClientConfiguration, OptionType, ProductMockupType, ProductReferenceType, ProductReferencesManagementApiClient, ProductVariantMockupType, ProductVariantResourceType, ProductsManagementApiClient, StorefrontType, StorefrontsManagementApiClient, SurfaceUsageType, UsersManagementApiClient, WorkflowType };
|
|
4245
|
+
//# sourceMappingURL=aurigma-ng-backoffice-api-client.js.map
|