@veloceapps/api 11.0.0-26 → 11.0.0-27

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.
@@ -5,7 +5,7 @@ import { Injectable, NgModule } from '@angular/core';
5
5
  import { ApiV2Module } from '@veloceapps/api/v2';
6
6
  import * as i1 from '@veloceapps/core';
7
7
  import { Expression, Operator, isApexError, isCanvasError, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
8
- import { noop, of, map as map$1, from, catchError as catchError$1 } from 'rxjs';
8
+ import { noop, of, map as map$1, from, catchError as catchError$1, tap as tap$1 } from 'rxjs';
9
9
  import { map, catchError, tap } from 'rxjs/operators';
10
10
  import * as i1$2 from 'primeng/api';
11
11
  import { isArray } from 'lodash';
@@ -1080,6 +1080,109 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1080
1080
  type: Injectable
1081
1081
  }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
1082
1082
 
1083
+ class SalesforceApiService {
1084
+ constructor(httpService) {
1085
+ this.httpService = httpService;
1086
+ this.SERVICE_URL = '/proxy';
1087
+ }
1088
+ query(searchRequest, objectName, options) {
1089
+ return this.httpService.api({
1090
+ method: 'post',
1091
+ body: { ...searchRequest, count: searchRequest.count || 100 },
1092
+ url: `${this.SERVICE_URL}/query/${objectName}`,
1093
+ ...options,
1094
+ });
1095
+ }
1096
+ queryObjects(search, options) {
1097
+ let params = new HttpParams();
1098
+ if (search) {
1099
+ params = params.append('search', search);
1100
+ }
1101
+ return this.httpService.api({
1102
+ url: `${this.SERVICE_URL}/query`,
1103
+ params,
1104
+ ...options,
1105
+ });
1106
+ }
1107
+ search(req, options) {
1108
+ return this.httpService.api({
1109
+ url: `${this.SERVICE_URL}/rest/search`,
1110
+ params: { q: req.searchString },
1111
+ ...options,
1112
+ });
1113
+ }
1114
+ describeObject(objectName, options) {
1115
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
1116
+ return this.httpService.api({ url: methodUrl, ...options });
1117
+ }
1118
+ describeField(objectName, fieldName, options) {
1119
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
1120
+ return this.httpService.api({ url: methodUrl, ...options });
1121
+ }
1122
+ describe2(objectName, fields, options) {
1123
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
1124
+ return this.httpService.api({ method: 'post', url: methodUrl, body: fields, ...options });
1125
+ }
1126
+ apexGetRequest(path, params, options) {
1127
+ // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
1128
+ const httpParams = new HttpParams({ fromString: params.toString() });
1129
+ return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams, ...options });
1130
+ }
1131
+ apexPostRequest(path, body, options) {
1132
+ return this.httpService.api({
1133
+ method: 'post',
1134
+ body,
1135
+ url: `${this.SERVICE_URL}/apex${path}`,
1136
+ ...options,
1137
+ });
1138
+ }
1139
+ restGetRequest(path, params, options) {
1140
+ const httpParams = new HttpParams({ fromString: params.toString() });
1141
+ return this.httpService.api({ url: `${this.SERVICE_URL}/rest${path}`, params: httpParams, ...options });
1142
+ }
1143
+ getGlobalPicklists() {
1144
+ return this.httpService.api({
1145
+ method: 'get',
1146
+ url: `${this.SERVICE_URL}/globalvalueset`,
1147
+ });
1148
+ }
1149
+ getGlobalPicklistValues(id) {
1150
+ return this.httpService.api({
1151
+ method: 'get',
1152
+ url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
1153
+ });
1154
+ }
1155
+ }
1156
+ SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1157
+ SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
1158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
1159
+ type: Injectable
1160
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1161
+
1162
+ class PCMApiService {
1163
+ constructor(sfApiService) {
1164
+ this.sfApiService = sfApiService;
1165
+ }
1166
+ fetchPCMByProductId(productId) {
1167
+ return this.sfApiService.restGetRequest(`/connect/pcm/products/${productId}`, new HttpParams()).pipe(tap$1(response => {
1168
+ if (response.status.code !== '200') {
1169
+ throw new Error(response.status.message);
1170
+ }
1171
+ }), map$1(response => {
1172
+ const pcm = response.products[0];
1173
+ if (!pcm) {
1174
+ throw new Error('PCM product is not found');
1175
+ }
1176
+ return pcm;
1177
+ }));
1178
+ }
1179
+ }
1180
+ PCMApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, deps: [{ token: SalesforceApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1181
+ PCMApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService });
1182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PCMApiService, decorators: [{
1183
+ type: Injectable
1184
+ }], ctorParameters: function () { return [{ type: SalesforceApiService }]; } });
1185
+
1083
1186
  class PicklistsApiService {
1084
1187
  constructor(baseHttpService) {
1085
1188
  this.baseHttpService = baseHttpService;
@@ -1527,81 +1630,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1527
1630
  type: Injectable
1528
1631
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1529
1632
 
1530
- class SalesforceApiService {
1531
- constructor(httpService) {
1532
- this.httpService = httpService;
1533
- this.SERVICE_URL = '/proxy';
1534
- }
1535
- query(searchRequest, objectName, options) {
1536
- return this.httpService.api({
1537
- method: 'post',
1538
- body: { ...searchRequest, count: searchRequest.count || 100 },
1539
- url: `${this.SERVICE_URL}/query/${objectName}`,
1540
- ...options,
1541
- });
1542
- }
1543
- queryObjects(search, options) {
1544
- let params = new HttpParams();
1545
- if (search) {
1546
- params = params.append('search', search);
1547
- }
1548
- return this.httpService.api({
1549
- url: `${this.SERVICE_URL}/query`,
1550
- params,
1551
- ...options,
1552
- });
1553
- }
1554
- search(req, options) {
1555
- return this.httpService.api({
1556
- url: `${this.SERVICE_URL}/rest/search`,
1557
- params: { q: req.searchString },
1558
- ...options,
1559
- });
1560
- }
1561
- describeObject(objectName, options) {
1562
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
1563
- return this.httpService.api({ url: methodUrl, ...options });
1564
- }
1565
- describeField(objectName, fieldName, options) {
1566
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
1567
- return this.httpService.api({ url: methodUrl, ...options });
1568
- }
1569
- describe2(objectName, fields, options) {
1570
- const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
1571
- return this.httpService.api({ method: 'post', url: methodUrl, body: fields, ...options });
1572
- }
1573
- apexGetRequest(path, params, options) {
1574
- // this line is needed because HttpParams instance from Integration behaves wrong in studio instance of Angular
1575
- const httpParams = new HttpParams({ fromString: params.toString() });
1576
- return this.httpService.api({ url: `${this.SERVICE_URL}/apex${path}`, params: httpParams, ...options });
1577
- }
1578
- apexPostRequest(path, body, options) {
1579
- return this.httpService.api({
1580
- method: 'post',
1581
- body,
1582
- url: `${this.SERVICE_URL}/apex${path}`,
1583
- ...options,
1584
- });
1585
- }
1586
- getGlobalPicklists() {
1587
- return this.httpService.api({
1588
- method: 'get',
1589
- url: `${this.SERVICE_URL}/globalvalueset`,
1590
- });
1591
- }
1592
- getGlobalPicklistValues(id) {
1593
- return this.httpService.api({
1594
- method: 'get',
1595
- url: `${this.SERVICE_URL}/globalvalueset/${id}/values`,
1596
- });
1597
- }
1598
- }
1599
- SalesforceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
1600
- SalesforceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService });
1601
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesforceApiService, decorators: [{
1602
- type: Injectable
1603
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1604
-
1605
1633
  class SandboxManagerApiService {
1606
1634
  constructor(messageService) {
1607
1635
  this.messageService = messageService;
@@ -1879,6 +1907,7 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
1879
1907
  PortalsApiService,
1880
1908
  FlowStateApiService,
1881
1909
  SandboxManagerApiService,
1910
+ PCMApiService,
1882
1911
  ], imports: [HttpClientModule, ApiV2Module] });
1883
1912
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, decorators: [{
1884
1913
  type: NgModule,
@@ -1912,6 +1941,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1912
1941
  PortalsApiService,
1913
1942
  FlowStateApiService,
1914
1943
  SandboxManagerApiService,
1944
+ PCMApiService,
1915
1945
  ],
1916
1946
  }]
1917
1947
  }] });
@@ -1920,5 +1950,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1920
1950
  * Generated bundle index. Do not edit.
1921
1951
  */
1922
1952
 
1923
- export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationSettingsApiService, ContractedPriceApiService, DocumentAttachmentApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PortalsApiService, ProductApiService, PromotionsApiService, RebateProgramApiService, RebateTypeApiService, SalesforceApiService, SandboxManagerApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, VeloceAuthService, VeloceObjectsApiService, handleCanvasResponse };
1953
+ export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationSettingsApiService, ContractedPriceApiService, DocumentAttachmentApiService, EndpointsApiService, FlowStateApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PCMApiService, PicklistsApiService, PortalsApiService, ProductApiService, PromotionsApiService, RebateProgramApiService, RebateTypeApiService, SalesforceApiService, SandboxManagerApiService, ShoppingCartSettingsApiService, StatefulConfigurationApiService, VeloceAuthService, VeloceObjectsApiService, handleCanvasResponse };
1924
1954
  //# sourceMappingURL=veloceapps-api.mjs.map