@aurigma/ng-storefront-api-client 2.30.6 → 2.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aurigma-ng-storefront-api-client.metadata.json +1 -1
- package/bundles/aurigma-ng-storefront-api-client.umd.js +254 -72
- package/bundles/aurigma-ng-storefront-api-client.umd.js.map +1 -1
- package/bundles/aurigma-ng-storefront-api-client.umd.min.js +1 -1
- package/bundles/aurigma-ng-storefront-api-client.umd.min.js.map +1 -1
- package/esm2015/lib/storefront-api-client.js +158 -1
- package/fesm2015/aurigma-ng-storefront-api-client.js +157 -0
- package/fesm2015/aurigma-ng-storefront-api-client.js.map +1 -1
- package/lib/storefront-api-client.d.ts +32 -0
- package/package.json +1 -1
|
@@ -1401,6 +1401,163 @@ class ProjectsApiClient extends ApiClientBase {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
return of(null);
|
|
1403
1403
|
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Returns a project preview file by project identifier.
|
|
1406
|
+
* @param id Project identifier.
|
|
1407
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1408
|
+
* @return Success
|
|
1409
|
+
*/
|
|
1410
|
+
getPreview(id, tenantId) {
|
|
1411
|
+
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/preview?";
|
|
1412
|
+
if (id === undefined || id === null)
|
|
1413
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1414
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1415
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1416
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1417
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1418
|
+
let options_ = {
|
|
1419
|
+
observe: "response",
|
|
1420
|
+
responseType: "blob",
|
|
1421
|
+
headers: new HttpHeaders({
|
|
1422
|
+
"Accept": "text/plain"
|
|
1423
|
+
})
|
|
1424
|
+
};
|
|
1425
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1426
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
1427
|
+
})).pipe(mergeMap((response_) => {
|
|
1428
|
+
return this.transformResult(url_, response_, (r) => this.processGetPreview(r));
|
|
1429
|
+
})).pipe(catchError((response_) => {
|
|
1430
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1431
|
+
try {
|
|
1432
|
+
return this.transformResult(url_, response_, (r) => this.processGetPreview(r));
|
|
1433
|
+
}
|
|
1434
|
+
catch (e) {
|
|
1435
|
+
return throwError(e);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
else
|
|
1439
|
+
return throwError(response_);
|
|
1440
|
+
}));
|
|
1441
|
+
}
|
|
1442
|
+
processGetPreview(response) {
|
|
1443
|
+
const status = response.status;
|
|
1444
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1445
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1446
|
+
let _headers = {};
|
|
1447
|
+
if (response.headers) {
|
|
1448
|
+
for (let key of response.headers.keys()) {
|
|
1449
|
+
_headers[key] = response.headers.get(key);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
if (status === 200 || status === 206) {
|
|
1453
|
+
const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
|
|
1454
|
+
const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
|
|
1455
|
+
const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
|
|
1456
|
+
return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
|
|
1457
|
+
}
|
|
1458
|
+
else if (status === 404) {
|
|
1459
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1460
|
+
let result404 = null;
|
|
1461
|
+
result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
1462
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1463
|
+
}));
|
|
1464
|
+
}
|
|
1465
|
+
else if (status === 401) {
|
|
1466
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1467
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1468
|
+
}));
|
|
1469
|
+
}
|
|
1470
|
+
else if (status === 403) {
|
|
1471
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1472
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1473
|
+
}));
|
|
1474
|
+
}
|
|
1475
|
+
else if (status !== 200 && status !== 204) {
|
|
1476
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1477
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1478
|
+
}));
|
|
1479
|
+
}
|
|
1480
|
+
return of(null);
|
|
1481
|
+
}
|
|
1482
|
+
/**
|
|
1483
|
+
* Returns a project preview URL by project identifier.
|
|
1484
|
+
* @param id Project identifier.
|
|
1485
|
+
* @param tenantId (optional) Tenant identifier.
|
|
1486
|
+
* @return Success
|
|
1487
|
+
*/
|
|
1488
|
+
getPreviewUrl(id, tenantId) {
|
|
1489
|
+
let url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/preview-url?";
|
|
1490
|
+
if (id === undefined || id === null)
|
|
1491
|
+
throw new Error("The parameter 'id' must be defined.");
|
|
1492
|
+
url_ = url_.replace("{id}", encodeURIComponent("" + id));
|
|
1493
|
+
if (tenantId !== undefined && tenantId !== null)
|
|
1494
|
+
url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
|
|
1495
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1496
|
+
let options_ = {
|
|
1497
|
+
observe: "response",
|
|
1498
|
+
responseType: "blob",
|
|
1499
|
+
headers: new HttpHeaders({
|
|
1500
|
+
"Accept": "text/plain"
|
|
1501
|
+
})
|
|
1502
|
+
};
|
|
1503
|
+
return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
|
|
1504
|
+
return this.http.request("get", url_, transformedOptions_);
|
|
1505
|
+
})).pipe(mergeMap((response_) => {
|
|
1506
|
+
return this.transformResult(url_, response_, (r) => this.processGetPreviewUrl(r));
|
|
1507
|
+
})).pipe(catchError((response_) => {
|
|
1508
|
+
if (response_ instanceof HttpResponseBase) {
|
|
1509
|
+
try {
|
|
1510
|
+
return this.transformResult(url_, response_, (r) => this.processGetPreviewUrl(r));
|
|
1511
|
+
}
|
|
1512
|
+
catch (e) {
|
|
1513
|
+
return throwError(e);
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
else
|
|
1517
|
+
return throwError(response_);
|
|
1518
|
+
}));
|
|
1519
|
+
}
|
|
1520
|
+
processGetPreviewUrl(response) {
|
|
1521
|
+
const status = response.status;
|
|
1522
|
+
const responseBlob = response instanceof HttpResponse ? response.body :
|
|
1523
|
+
response.error instanceof Blob ? response.error : undefined;
|
|
1524
|
+
let _headers = {};
|
|
1525
|
+
if (response.headers) {
|
|
1526
|
+
for (let key of response.headers.keys()) {
|
|
1527
|
+
_headers[key] = response.headers.get(key);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
if (status === 200) {
|
|
1531
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1532
|
+
let result200 = null;
|
|
1533
|
+
result200 = _responseText === "" ? null : _responseText;
|
|
1534
|
+
return of(result200);
|
|
1535
|
+
}));
|
|
1536
|
+
}
|
|
1537
|
+
else if (status === 404) {
|
|
1538
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1539
|
+
let result404 = null;
|
|
1540
|
+
result404 = _responseText === "" ? null : _responseText;
|
|
1541
|
+
return throwException("Not Found", status, _responseText, _headers, result404);
|
|
1542
|
+
}));
|
|
1543
|
+
}
|
|
1544
|
+
else if (status === 401) {
|
|
1545
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1546
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1547
|
+
}));
|
|
1548
|
+
}
|
|
1549
|
+
else if (status === 403) {
|
|
1550
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1551
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1552
|
+
}));
|
|
1553
|
+
}
|
|
1554
|
+
else if (status !== 200 && status !== 204) {
|
|
1555
|
+
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
1556
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1557
|
+
}));
|
|
1558
|
+
}
|
|
1559
|
+
return of(null);
|
|
1560
|
+
}
|
|
1404
1561
|
/**
|
|
1405
1562
|
* Creates a new project by 'Render HiRes' scenario.
|
|
1406
1563
|
* @param storefrontId Storefront identifier.
|