@veloceapps/api 11.0.0-18 → 11.0.0-19

Sign up to get free protection for your applications and to get access to all the features.
@@ -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, ModelTranslatorUtils, EntityUtil, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
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';
@@ -1343,224 +1343,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1343
1343
  type: Injectable
1344
1344
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1345
1345
 
1346
- class ProductModelApiService {
1347
- constructor(httpService) {
1348
- this.httpService = httpService;
1349
- this.SERVICE_URL = '/models';
1350
- }
1351
- addModel(model) {
1352
- return this.httpService
1353
- .api({
1354
- method: 'post',
1355
- url: this.SERVICE_URL,
1356
- body: model,
1357
- errorHandler: this.httpService.handleValidationError,
1358
- })
1359
- .pipe(map(result => {
1360
- if (result.successful) {
1361
- return result;
1362
- }
1363
- else {
1364
- throw new Error(result.message);
1365
- }
1366
- }));
1367
- }
1368
- releaseModel(model) {
1369
- return this.httpService
1370
- .api({
1371
- method: 'put',
1372
- url: `${this.SERVICE_URL}/${model.id}/release`,
1373
- body: model,
1374
- errorHandler: this.httpService.handleValidationError,
1375
- })
1376
- .pipe(map(result => {
1377
- if (result.successful) {
1378
- return '';
1379
- }
1380
- else {
1381
- throw new Error(result.message);
1382
- }
1383
- }));
1384
- }
1385
- removeModel(modelId, successFn, failureFn) {
1386
- const observable = this.httpService
1387
- .api({
1388
- method: 'delete',
1389
- url: `${this.SERVICE_URL}/${modelId}`,
1390
- errorHandler: this.httpService.handleValidationError,
1391
- })
1392
- .pipe(map(result => {
1393
- if (result.successful) {
1394
- return '';
1395
- }
1396
- else {
1397
- throw new Error(result.message);
1398
- }
1399
- }));
1400
- observable.subscribe(() => {
1401
- successFn && successFn.apply();
1402
- }, () => {
1403
- failureFn && failureFn.apply();
1404
- });
1405
- }
1406
- getModelVersions(modelId, count = 100, skip = 0) {
1407
- return this.httpService.api({
1408
- method: 'post',
1409
- url: `${this.SERVICE_URL}/${modelId}/versions`,
1410
- body: {
1411
- skipCount: skip,
1412
- count: count,
1413
- },
1414
- });
1415
- }
1416
- getModel(id, version) {
1417
- let url = `${this.SERVICE_URL}/${id}`;
1418
- if (version) {
1419
- url += `/versions/${version}`;
1420
- }
1421
- return this.httpService.api({ url });
1422
- }
1423
- getModels(skipCount, searchText) {
1424
- return this.httpService.api({
1425
- method: 'post',
1426
- url: `${this.SERVICE_URL}/search`,
1427
- body: {
1428
- nameRegex: searchText,
1429
- skipCount: skipCount.toString(),
1430
- count: ProductModelApiService.MAX_RESULTS,
1431
- },
1432
- });
1433
- }
1434
- getLinkedModels(id, version) {
1435
- let url = `${this.SERVICE_URL}/${id}`;
1436
- if (version) {
1437
- url += `/versions/${version}`;
1438
- }
1439
- url += '/linked';
1440
- return this.httpService.api({ url }).pipe(map((linkedModels) => {
1441
- if (linkedModels) {
1442
- linkedModels.forEach(model => ModelTranslatorUtils.toLocalModel(model));
1443
- }
1444
- return linkedModels;
1445
- }));
1446
- }
1447
- getPML(modelId, version) {
1448
- let url = `${this.SERVICE_URL}/${modelId}/pml/${version}`;
1449
- if (version) {
1450
- url += `/versions/${version}`;
1451
- }
1452
- return this.httpService.api({
1453
- url,
1454
- responseType: 'text',
1455
- });
1456
- }
1457
- savePML(modelId, pml, comment) {
1458
- return this.httpService
1459
- .api({
1460
- method: 'put',
1461
- url: `${this.SERVICE_URL}/${modelId}/pml`,
1462
- body: {
1463
- id: modelId,
1464
- pml: pml,
1465
- comment: comment,
1466
- },
1467
- })
1468
- .pipe(map(result => {
1469
- if (result.successful) {
1470
- return '';
1471
- }
1472
- else {
1473
- throw new Error(result.message);
1474
- }
1475
- }), catchError(this.httpService.handleValidationError));
1476
- }
1477
- generateProducts(modelId) {
1478
- return this.httpService.api({
1479
- url: `${this.SERVICE_URL}/${modelId}/generate-products`,
1480
- });
1481
- }
1482
- saveModel(productModel, comment) {
1483
- const model = EntityUtil.clone(productModel);
1484
- model.comment = comment;
1485
- ModelTranslatorUtils.toServerModel(model);
1486
- return this.httpService
1487
- .api({
1488
- method: 'put',
1489
- url: `${this.SERVICE_URL}/${model.id}`,
1490
- body: model,
1491
- })
1492
- .pipe(map(result => {
1493
- if (result.successful) {
1494
- return '';
1495
- }
1496
- else {
1497
- throw new Error(result.message);
1498
- }
1499
- }), catchError(this.httpService.handleValidationError));
1500
- }
1501
- validateModel(productModel) {
1502
- return this.httpService
1503
- .api({
1504
- method: 'post',
1505
- url: `${this.SERVICE_URL}/validate`,
1506
- body: productModel,
1507
- errorHandler: this.httpService.handleValidationError,
1508
- })
1509
- .pipe(map(result => {
1510
- if (result.successful) {
1511
- return '';
1512
- }
1513
- else {
1514
- throw new Error(result.message);
1515
- }
1516
- }));
1517
- }
1518
- renameModel(productModel, name) {
1519
- const model = EntityUtil.clone(productModel);
1520
- model.name = name;
1521
- ModelTranslatorUtils.toServerModel(model);
1522
- return this.httpService
1523
- .api({
1524
- method: 'patch',
1525
- url: `${this.SERVICE_URL}/${model.id}`,
1526
- body: model,
1527
- })
1528
- .pipe(catchError(this.httpService.handleValidationError));
1529
- }
1530
- uploadPmlFile(file, modelId) {
1531
- const formData = new FormData();
1532
- formData.append('file', file, file.name);
1533
- return this.httpService.upload({
1534
- url: `${this.SERVICE_URL}/${modelId}/pml/upload`,
1535
- body: formData,
1536
- });
1537
- }
1538
- runPml(modelId, pml, rootType, configurationMode) {
1539
- return this.httpService.api({
1540
- method: 'post',
1541
- url: `${this.SERVICE_URL}/${modelId}/pml/run`,
1542
- body: {
1543
- pml,
1544
- rootType,
1545
- configurationMode,
1546
- },
1547
- responseType: 'text',
1548
- });
1549
- }
1550
- evictAllCache() {
1551
- return this.httpService.api({
1552
- method: 'get',
1553
- url: '/cache/evict/environment-variables',
1554
- });
1555
- }
1556
- }
1557
- ProductModelApiService.MAX_RESULTS = 200;
1558
- ProductModelApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1559
- ProductModelApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService });
1560
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductModelApiService, decorators: [{
1561
- type: Injectable
1562
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1563
-
1564
1346
  class PromotionsApiService {
1565
1347
  constructor(baseHttpService) {
1566
1348
  this.baseHttpService = baseHttpService;
@@ -2080,7 +1862,6 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
2080
1862
  ConfigurationSettingsApiService,
2081
1863
  DocumentAttachmentApiService,
2082
1864
  PriceApiService,
2083
- ProductModelApiService,
2084
1865
  RampApiService,
2085
1866
  SalesforceApiService,
2086
1867
  FlowsApiService,
@@ -2117,7 +1898,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2117
1898
  ConfigurationSettingsApiService,
2118
1899
  DocumentAttachmentApiService,
2119
1900
  PriceApiService,
2120
- ProductModelApiService,
2121
1901
  RampApiService,
2122
1902
  SalesforceApiService,
2123
1903
  FlowsApiService,
@@ -2151,5 +1931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
2151
1931
  * Generated bundle index. Do not edit.
2152
1932
  */
2153
1933
 
2154
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationSettingsApiService, ContractedPriceApiService, DeltaApiService, DocumentAttachmentApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, PriceApiService, ProductApiService, ProductModelApiService, PromotionsApiService, RampApiService, RebateProgramApiService, RebateTypeApiService, SalesforceApiService, SandboxManagerApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, VeloceAuthService, VeloceObjectsApiService, handleCanvasResponse };
1934
+ 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 };
2155
1935
  //# sourceMappingURL=veloceapps-api.mjs.map