@veloceapps/api 11.0.0-17 → 11.0.0-19
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2020/src/index.mjs +1 -2
- package/esm2020/src/lib/api.module.mjs +1 -4
- package/esm2020/v2/services/ui-definitions-api.service.mjs +2 -10
- package/fesm2015/veloceapps-api-v2.mjs +3 -9
- package/fesm2015/veloceapps-api-v2.mjs.map +1 -1
- package/fesm2015/veloceapps-api.mjs +2 -222
- package/fesm2015/veloceapps-api.mjs.map +1 -1
- package/fesm2020/veloceapps-api-v2.mjs +1 -9
- package/fesm2020/veloceapps-api-v2.mjs.map +1 -1
- package/fesm2020/veloceapps-api.mjs +2 -222
- package/fesm2020/veloceapps-api.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +0 -1
- package/esm2020/src/lib/services/product-model-api.service.mjs +0 -223
- package/src/lib/services/product-model-api.service.d.ts +0 -29
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
|
|
4
4
|
import { Injectable, NgModule } from '@angular/core';
|
5
5
|
import { ApiV2Module } from '@veloceapps/api/v2';
|
6
6
|
import * as i1 from '@veloceapps/core';
|
7
|
-
import { Expression, Operator, isApexError, isCanvasError,
|
7
|
+
import { Expression, Operator, isApexError, isCanvasError, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
|
8
8
|
import { noop, of, map as map$1, from, catchError as catchError$1 } from 'rxjs';
|
9
9
|
import { map, catchError, tap } from 'rxjs/operators';
|
10
10
|
import * as i1$2 from 'primeng/api';
|
@@ -1418,224 +1418,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1418
1418
|
type: Injectable
|
1419
1419
|
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1420
1420
|
|
1421
|
-
class ProductModelApiService {
|
1422
|
-
constructor(httpService) {
|
1423
|
-
this.httpService = httpService;
|
1424
|
-
this.SERVICE_URL = '/models';
|
1425
|
-
}
|
1426
|
-
addModel(model) {
|
1427
|
-
return this.httpService
|
1428
|
-
.api({
|
1429
|
-
method: 'post',
|
1430
|
-
url: this.SERVICE_URL,
|
1431
|
-
body: model,
|
1432
|
-
errorHandler: this.httpService.handleValidationError,
|
1433
|
-
})
|
1434
|
-
.pipe(map(result => {
|
1435
|
-
if (result.successful) {
|
1436
|
-
return result;
|
1437
|
-
}
|
1438
|
-
else {
|
1439
|
-
throw new Error(result.message);
|
1440
|
-
}
|
1441
|
-
}));
|
1442
|
-
}
|
1443
|
-
releaseModel(model) {
|
1444
|
-
return this.httpService
|
1445
|
-
.api({
|
1446
|
-
method: 'put',
|
1447
|
-
url: `${this.SERVICE_URL}/${model.id}/release`,
|
1448
|
-
body: model,
|
1449
|
-
errorHandler: this.httpService.handleValidationError,
|
1450
|
-
})
|
1451
|
-
.pipe(map(result => {
|
1452
|
-
if (result.successful) {
|
1453
|
-
return '';
|
1454
|
-
}
|
1455
|
-
else {
|
1456
|
-
throw new Error(result.message);
|
1457
|
-
}
|
1458
|
-
}));
|
1459
|
-
}
|
1460
|
-
removeModel(modelId, successFn, failureFn) {
|
1461
|
-
const observable = this.httpService
|
1462
|
-
.api({
|
1463
|
-
method: 'delete',
|
1464
|
-
url: `${this.SERVICE_URL}/${modelId}`,
|
1465
|
-
errorHandler: this.httpService.handleValidationError,
|
1466
|
-
})
|
1467
|
-
.pipe(map(result => {
|
1468
|
-
if (result.successful) {
|
1469
|
-
return '';
|
1470
|
-
}
|
1471
|
-
else {
|
1472
|
-
throw new Error(result.message);
|
1473
|
-
}
|
1474
|
-
}));
|
1475
|
-
observable.subscribe(() => {
|
1476
|
-
successFn && successFn.apply();
|
1477
|
-
}, () => {
|
1478
|
-
failureFn && failureFn.apply();
|
1479
|
-
});
|
1480
|
-
}
|
1481
|
-
getModelVersions(modelId, count = 100, skip = 0) {
|
1482
|
-
return this.httpService.api({
|
1483
|
-
method: 'post',
|
1484
|
-
url: `${this.SERVICE_URL}/${modelId}/versions`,
|
1485
|
-
body: {
|
1486
|
-
skipCount: skip,
|
1487
|
-
count: count,
|
1488
|
-
},
|
1489
|
-
});
|
1490
|
-
}
|
1491
|
-
getModel(id, version) {
|
1492
|
-
let url = `${this.SERVICE_URL}/${id}`;
|
1493
|
-
if (version) {
|
1494
|
-
url += `/versions/${version}`;
|
1495
|
-
}
|
1496
|
-
return this.httpService.api({ url });
|
1497
|
-
}
|
1498
|
-
getModels(skipCount, searchText) {
|
1499
|
-
return this.httpService.api({
|
1500
|
-
method: 'post',
|
1501
|
-
url: `${this.SERVICE_URL}/search`,
|
1502
|
-
body: {
|
1503
|
-
nameRegex: searchText,
|
1504
|
-
skipCount: skipCount.toString(),
|
1505
|
-
count: ProductModelApiService.MAX_RESULTS,
|
1506
|
-
},
|
1507
|
-
});
|
1508
|
-
}
|
1509
|
-
getLinkedModels(id, version) {
|
1510
|
-
let url = `${this.SERVICE_URL}/${id}`;
|
1511
|
-
if (version) {
|
1512
|
-
url += `/versions/${version}`;
|
1513
|
-
}
|
1514
|
-
url += '/linked';
|
1515
|
-
return this.httpService.api({ url }).pipe(map((linkedModels) => {
|
1516
|
-
if (linkedModels) {
|
1517
|
-
linkedModels.forEach(model => ModelTranslatorUtils.toLocalModel(model));
|
1518
|
-
}
|
1519
|
-
return linkedModels;
|
1520
|
-
}));
|
1521
|
-
}
|
1522
|
-
getPML(modelId, version) {
|
1523
|
-
let url = `${this.SERVICE_URL}/${modelId}/pml/${version}`;
|
1524
|
-
if (version) {
|
1525
|
-
url += `/versions/${version}`;
|
1526
|
-
}
|
1527
|
-
return this.httpService.api({
|
1528
|
-
url,
|
1529
|
-
responseType: 'text',
|
1530
|
-
});
|
1531
|
-
}
|
1532
|
-
savePML(modelId, pml, comment) {
|
1533
|
-
return this.httpService
|
1534
|
-
.api({
|
1535
|
-
method: 'put',
|
1536
|
-
url: `${this.SERVICE_URL}/${modelId}/pml`,
|
1537
|
-
body: {
|
1538
|
-
id: modelId,
|
1539
|
-
pml: pml,
|
1540
|
-
comment: comment,
|
1541
|
-
},
|
1542
|
-
})
|
1543
|
-
.pipe(map(result => {
|
1544
|
-
if (result.successful) {
|
1545
|
-
return '';
|
1546
|
-
}
|
1547
|
-
else {
|
1548
|
-
throw new Error(result.message);
|
1549
|
-
}
|
1550
|
-
}), catchError(this.httpService.handleValidationError));
|
1551
|
-
}
|
1552
|
-
generateProducts(modelId) {
|
1553
|
-
return this.httpService.api({
|
1554
|
-
url: `${this.SERVICE_URL}/${modelId}/generate-products`,
|
1555
|
-
});
|
1556
|
-
}
|
1557
|
-
saveModel(productModel, comment) {
|
1558
|
-
const model = EntityUtil.clone(productModel);
|
1559
|
-
model.comment = comment;
|
1560
|
-
ModelTranslatorUtils.toServerModel(model);
|
1561
|
-
return this.httpService
|
1562
|
-
.api({
|
1563
|
-
method: 'put',
|
1564
|
-
url: `${this.SERVICE_URL}/${model.id}`,
|
1565
|
-
body: model,
|
1566
|
-
})
|
1567
|
-
.pipe(map(result => {
|
1568
|
-
if (result.successful) {
|
1569
|
-
return '';
|
1570
|
-
}
|
1571
|
-
else {
|
1572
|
-
throw new Error(result.message);
|
1573
|
-
}
|
1574
|
-
}), catchError(this.httpService.handleValidationError));
|
1575
|
-
}
|
1576
|
-
validateModel(productModel) {
|
1577
|
-
return this.httpService
|
1578
|
-
.api({
|
1579
|
-
method: 'post',
|
1580
|
-
url: `${this.SERVICE_URL}/validate`,
|
1581
|
-
body: productModel,
|
1582
|
-
errorHandler: this.httpService.handleValidationError,
|
1583
|
-
})
|
1584
|
-
.pipe(map(result => {
|
1585
|
-
if (result.successful) {
|
1586
|
-
return '';
|
1587
|
-
}
|
1588
|
-
else {
|
1589
|
-
throw new Error(result.message);
|
1590
|
-
}
|
1591
|
-
}));
|
1592
|
-
}
|
1593
|
-
renameModel(productModel, name) {
|
1594
|
-
const model = EntityUtil.clone(productModel);
|
1595
|
-
model.name = name;
|
1596
|
-
ModelTranslatorUtils.toServerModel(model);
|
1597
|
-
return this.httpService
|
1598
|
-
.api({
|
1599
|
-
method: 'patch',
|
1600
|
-
url: `${this.SERVICE_URL}/${model.id}`,
|
1601
|
-
body: model,
|
1602
|
-
})
|
1603
|
-
.pipe(catchError(this.httpService.handleValidationError));
|
1604
|
-
}
|
1605
|
-
uploadPmlFile(file, modelId) {
|
1606
|
-
const formData = new FormData();
|
1607
|
-
formData.append('file', file, file.name);
|
1608
|
-
return this.httpService.upload({
|
1609
|
-
url: `${this.SERVICE_URL}/${modelId}/pml/upload`,
|
1610
|
-
body: formData,
|
1611
|
-
});
|
1612
|
-
}
|
1613
|
-
runPml(modelId, pml, rootType, configurationMode) {
|
1614
|
-
return this.httpService.api({
|
1615
|
-
method: 'post',
|
1616
|
-
url: `${this.SERVICE_URL}/${modelId}/pml/run`,
|
1617
|
-
body: {
|
1618
|
-
pml,
|
1619
|
-
rootType,
|
1620
|
-
configurationMode,
|
1621
|
-
},
|
1622
|
-
responseType: 'text',
|
1623
|
-
});
|
1624
|
-
}
|
1625
|
-
evictAllCache() {
|
1626
|
-
return this.httpService.api({
|
1627
|
-
method: 'get',
|
1628
|
-
url: '/cache/evict/environment-variables',
|
1629
|
-
});
|
1630
|
-
}
|
1631
|
-
}
|
1632
|
-
ProductModelApiService.MAX_RESULTS = 200;
|
1633
|
-
ProductModelApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1634
|
-
ProductModelApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService });
|
1635
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, decorators: [{
|
1636
|
-
type: Injectable
|
1637
|
-
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
1638
|
-
|
1639
1421
|
class PromotionsApiService {
|
1640
1422
|
constructor(baseHttpService) {
|
1641
1423
|
this.baseHttpService = baseHttpService;
|
@@ -2183,7 +1965,6 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
|
|
2183
1965
|
ConfigurationSettingsApiService,
|
2184
1966
|
DocumentAttachmentApiService,
|
2185
1967
|
PriceApiService,
|
2186
|
-
ProductModelApiService,
|
2187
1968
|
RampApiService,
|
2188
1969
|
SalesforceApiService,
|
2189
1970
|
FlowsApiService,
|
@@ -2220,7 +2001,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
2220
2001
|
ConfigurationSettingsApiService,
|
2221
2002
|
DocumentAttachmentApiService,
|
2222
2003
|
PriceApiService,
|
2223
|
-
ProductModelApiService,
|
2224
2004
|
RampApiService,
|
2225
2005
|
SalesforceApiService,
|
2226
2006
|
FlowsApiService,
|
@@ -2254,5 +2034,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
2254
2034
|
* Generated bundle index. Do not edit.
|
2255
2035
|
*/
|
2256
2036
|
|
2257
|
-
export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationSettingsApiService, ContractedPriceApiService, DeltaApiService, DocumentAttachmentApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, PriceApiService, ProductApiService,
|
2037
|
+
export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationSettingsApiService, ContractedPriceApiService, DeltaApiService, DocumentAttachmentApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, PriceApiService, ProductApiService, PromotionsApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, SalesforceApiService, SandboxManagerApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, VeloceAuthService, VeloceObjectsApiService, handleCanvasResponse };
|
2258
2038
|
//# sourceMappingURL=veloceapps-api.mjs.map
|