@veloceapps/api 12.0.0-13 → 12.0.0-15

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.
Files changed (145) hide show
  1. package/{fesm2020 → fesm2022}/veloceapps-api-v2.mjs +124 -124
  2. package/fesm2022/veloceapps-api-v2.mjs.map +1 -0
  3. package/{fesm2020 → fesm2022}/veloceapps-api.mjs +70 -70
  4. package/fesm2022/veloceapps-api.mjs.map +1 -0
  5. package/index.d.ts +382 -1
  6. package/package.json +7 -19
  7. package/v2/index.d.ts +562 -3
  8. package/esm2020/index.mjs +0 -2
  9. package/esm2020/src/index.mjs +0 -16
  10. package/esm2020/src/lib/api.module.mjs +0 -60
  11. package/esm2020/src/lib/services/account-api.service.mjs +0 -87
  12. package/esm2020/src/lib/services/auth.service.mjs +0 -22
  13. package/esm2020/src/lib/services/contracted-price-api.service.mjs +0 -45
  14. package/esm2020/src/lib/services/flow-state-api.mjs +0 -142
  15. package/esm2020/src/lib/services/offers-api.service.mjs +0 -76
  16. package/esm2020/src/lib/services/org-info-api.service.mjs +0 -54
  17. package/esm2020/src/lib/services/portals-api.service.mjs +0 -76
  18. package/esm2020/src/lib/services/promotions-api.service.mjs +0 -68
  19. package/esm2020/src/lib/services/rebate-program-api.service.mjs +0 -68
  20. package/esm2020/src/lib/services/rebate-type-api.service.mjs +0 -68
  21. package/esm2020/src/lib/services/sandbox-manager-api.service.mjs +0 -94
  22. package/esm2020/src/lib/services/stateful-configuration-api.mjs +0 -51
  23. package/esm2020/src/lib/types/auth.types.mjs +0 -2
  24. package/esm2020/src/lib/types/clone-request.types.mjs +0 -2
  25. package/esm2020/src/lib/types/delta-request.types.mjs +0 -2
  26. package/esm2020/src/lib/types/dto/offers-dto.types.mjs +0 -2
  27. package/esm2020/src/lib/types/index.mjs +0 -6
  28. package/esm2020/src/lib/types/org-info.types.mjs +0 -2
  29. package/esm2020/src/lib/types/search-request.types.mjs +0 -2
  30. package/esm2020/src/lib/types/stateful-configuration.types.mjs +0 -2
  31. package/esm2020/src/lib/utils/canvas.utils.mjs +0 -33
  32. package/esm2020/src/lib/utils/index.mjs +0 -2
  33. package/esm2020/v2/api-v2.module.mjs +0 -70
  34. package/esm2020/v2/index.mjs +0 -4
  35. package/esm2020/v2/services/cache-api.service.mjs +0 -22
  36. package/esm2020/v2/services/catalog-admin-api.service.mjs +0 -192
  37. package/esm2020/v2/services/catalog-api.service.mjs +0 -90
  38. package/esm2020/v2/services/configuration-processors-api.service.mjs +0 -38
  39. package/esm2020/v2/services/configuration-settings-api.service.mjs +0 -89
  40. package/esm2020/v2/services/context-definition-admin-api.service.mjs +0 -78
  41. package/esm2020/v2/services/document-attachment-api.service.mjs +0 -66
  42. package/esm2020/v2/services/endpoints-admin-api.service.mjs +0 -81
  43. package/esm2020/v2/services/flows-api.service.mjs +0 -29
  44. package/esm2020/v2/services/functions-admin-api.service.mjs +0 -116
  45. package/esm2020/v2/services/guided-sellings-admin-api.service.mjs +0 -65
  46. package/esm2020/v2/services/guided-sellings-api.service.mjs +0 -37
  47. package/esm2020/v2/services/index.mjs +0 -24
  48. package/esm2020/v2/services/orchestrations-admin-api.service.mjs +0 -87
  49. package/esm2020/v2/services/orchestrations-api.service.mjs +0 -23
  50. package/esm2020/v2/services/pcm-api.service.mjs +0 -38
  51. package/esm2020/v2/services/picklists-admin-api.service.mjs +0 -41
  52. package/esm2020/v2/services/products-admin-api.service.mjs +0 -90
  53. package/esm2020/v2/services/sales-transactions-api.service.mjs +0 -52
  54. package/esm2020/v2/services/salesforce-api.service.mjs +0 -83
  55. package/esm2020/v2/services/shopping-cart-settings-api.service.mjs +0 -28
  56. package/esm2020/v2/services/ui-definitions-admin-api.service.mjs +0 -70
  57. package/esm2020/v2/services/ui-templates-admin-api.service.mjs +0 -286
  58. package/esm2020/v2/services/veloce-objects-api.service.mjs +0 -90
  59. package/esm2020/v2/types/attachment.types.mjs +0 -2
  60. package/esm2020/v2/types/clone-request.types.mjs +0 -2
  61. package/esm2020/v2/types/dto/configuration-settings-dto.types.mjs +0 -22
  62. package/esm2020/v2/types/dto/ui-definition-dto.types.mjs +0 -2
  63. package/esm2020/v2/types/dto/ui-template-dto.types.mjs +0 -2
  64. package/esm2020/v2/types/endpoint.types.mjs +0 -2
  65. package/esm2020/v2/types/event-logs.types.mjs +0 -2
  66. package/esm2020/v2/types/function.types.mjs +0 -2
  67. package/esm2020/v2/types/index.mjs +0 -9
  68. package/esm2020/v2/types/pcm.types.mjs +0 -2
  69. package/esm2020/v2/types/procedure.types.mjs +0 -2
  70. package/esm2020/v2/types/sales-transaction.types.mjs +0 -2
  71. package/esm2020/v2/types/search-request.types.mjs +0 -2
  72. package/esm2020/v2/utils/ui-definition.utils.mjs +0 -23
  73. package/esm2020/v2/utils/ui-template.utils.mjs +0 -13
  74. package/esm2020/v2/veloceapps-api-v2.mjs +0 -5
  75. package/esm2020/veloceapps-api.mjs +0 -5
  76. package/fesm2015/veloceapps-api-v2.mjs +0 -1727
  77. package/fesm2015/veloceapps-api-v2.mjs.map +0 -1
  78. package/fesm2015/veloceapps-api.mjs +0 -853
  79. package/fesm2015/veloceapps-api.mjs.map +0 -1
  80. package/fesm2020/veloceapps-api-v2.mjs.map +0 -1
  81. package/fesm2020/veloceapps-api.mjs.map +0 -1
  82. package/src/index.d.ts +0 -15
  83. package/src/lib/api.module.d.ts +0 -8
  84. package/src/lib/services/account-api.service.d.ts +0 -23
  85. package/src/lib/services/auth.service.d.ts +0 -11
  86. package/src/lib/services/contracted-price-api.service.d.ts +0 -16
  87. package/src/lib/services/flow-state-api.d.ts +0 -84
  88. package/src/lib/services/offers-api.service.d.ts +0 -19
  89. package/src/lib/services/org-info-api.service.d.ts +0 -19
  90. package/src/lib/services/portals-api.service.d.ts +0 -20
  91. package/src/lib/services/promotions-api.service.d.ts +0 -19
  92. package/src/lib/services/rebate-program-api.service.d.ts +0 -19
  93. package/src/lib/services/rebate-type-api.service.d.ts +0 -19
  94. package/src/lib/services/sandbox-manager-api.service.d.ts +0 -24
  95. package/src/lib/services/stateful-configuration-api.d.ts +0 -30
  96. package/src/lib/types/auth.types.d.ts +0 -4
  97. package/src/lib/types/clone-request.types.d.ts +0 -5
  98. package/src/lib/types/delta-request.types.d.ts +0 -5
  99. package/src/lib/types/dto/offers-dto.types.d.ts +0 -9
  100. package/src/lib/types/index.d.ts +0 -5
  101. package/src/lib/types/org-info.types.d.ts +0 -43
  102. package/src/lib/types/search-request.types.d.ts +0 -8
  103. package/src/lib/types/stateful-configuration.types.d.ts +0 -10
  104. package/src/lib/utils/canvas.utils.d.ts +0 -18
  105. package/src/lib/utils/index.d.ts +0 -1
  106. package/v2/api-v2.module.d.ts +0 -7
  107. package/v2/services/cache-api.service.d.ts +0 -11
  108. package/v2/services/catalog-admin-api.service.d.ts +0 -39
  109. package/v2/services/catalog-api.service.d.ts +0 -20
  110. package/v2/services/configuration-processors-api.service.d.ts +0 -14
  111. package/v2/services/configuration-settings-api.service.d.ts +0 -18
  112. package/v2/services/context-definition-admin-api.service.d.ts +0 -16
  113. package/v2/services/document-attachment-api.service.d.ts +0 -17
  114. package/v2/services/endpoints-admin-api.service.d.ts +0 -20
  115. package/v2/services/flows-api.service.d.ts +0 -13
  116. package/v2/services/functions-admin-api.service.d.ts +0 -25
  117. package/v2/services/guided-sellings-admin-api.service.d.ts +0 -20
  118. package/v2/services/guided-sellings-api.service.d.ts +0 -13
  119. package/v2/services/index.d.ts +0 -23
  120. package/v2/services/orchestrations-admin-api.service.d.ts +0 -21
  121. package/v2/services/orchestrations-api.service.d.ts +0 -12
  122. package/v2/services/pcm-api.service.d.ts +0 -12
  123. package/v2/services/picklists-admin-api.service.d.ts +0 -17
  124. package/v2/services/products-admin-api.service.d.ts +0 -21
  125. package/v2/services/sales-transactions-api.service.d.ts +0 -26
  126. package/v2/services/salesforce-api.service.d.ts +0 -26
  127. package/v2/services/shopping-cart-settings-api.service.d.ts +0 -14
  128. package/v2/services/ui-definitions-admin-api.service.d.ts +0 -18
  129. package/v2/services/ui-templates-admin-api.service.d.ts +0 -50
  130. package/v2/services/veloce-objects-api.service.d.ts +0 -23
  131. package/v2/types/attachment.types.d.ts +0 -4
  132. package/v2/types/clone-request.types.d.ts +0 -5
  133. package/v2/types/dto/configuration-settings-dto.types.d.ts +0 -9
  134. package/v2/types/dto/ui-definition-dto.types.d.ts +0 -7
  135. package/v2/types/dto/ui-template-dto.types.d.ts +0 -6
  136. package/v2/types/endpoint.types.d.ts +0 -15
  137. package/v2/types/event-logs.types.d.ts +0 -9
  138. package/v2/types/function.types.d.ts +0 -17
  139. package/v2/types/index.d.ts +0 -8
  140. package/v2/types/pcm.types.d.ts +0 -10
  141. package/v2/types/procedure.types.d.ts +0 -73
  142. package/v2/types/sales-transaction.types.d.ts +0 -13
  143. package/v2/types/search-request.types.d.ts +0 -8
  144. package/v2/utils/ui-definition.utils.d.ts +0 -5
  145. package/v2/utils/ui-template.utils.d.ts +0 -3
@@ -1,853 +0,0 @@
1
- import * as i1$1 from '@angular/common/http';
2
- import { HttpParams, HttpHeaders, HttpClientModule } from '@angular/common/http';
3
- import * as i0 from '@angular/core';
4
- import { Injectable, NgModule } from '@angular/core';
5
- import { ApiV2Module } from '@veloceapps/api/v2';
6
- import * as i1 from '@veloceapps/core';
7
- import { isApexError, isCanvasError, BaseHttpService, XrayService } from '@veloceapps/core';
8
- import { map, from, catchError, of } from 'rxjs';
9
- import { isArray } from 'lodash';
10
- import * as i1$2 from 'primeng/api';
11
-
12
- class AccountApiService {
13
- constructor(httpService) {
14
- this.httpService = httpService;
15
- this.SERVICE_URL = '/accounts';
16
- }
17
- getAccounts$(options) {
18
- return this.httpService.api(Object.assign({ method: 'get', url: `${this.SERVICE_URL}` }, options));
19
- }
20
- searchAccounts$(searchParams, options) {
21
- const params = new HttpParams({ fromObject: searchParams });
22
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}`, params: params }, options));
23
- }
24
- getAccount$(id, options) {
25
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${id}` }, options));
26
- }
27
- getAssetsState(accountId, options) {
28
- return this.httpService.api(Object.assign({ method: 'get', url: `/v2${this.SERVICE_URL}/${accountId}/assets` }, options));
29
- }
30
- getAssets(accountId, options) {
31
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/assets` }, options));
32
- }
33
- getOrders(accountId, options) {
34
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/orders` }, options));
35
- }
36
- getQuotes(accountId, options) {
37
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/quotes` }, options));
38
- }
39
- getAsset(accountId, assetId, options) {
40
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/assets/${assetId}` }, options));
41
- }
42
- getOrder(accountId, orderId, options) {
43
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/orders/${orderId}` }, options));
44
- }
45
- getQuote(accountId, quoteId, options) {
46
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/quotes/${quoteId}` }, options));
47
- }
48
- quoteToOrder(accountId, quoteId, options) {
49
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/quotes/${quoteId}/to-order`, method: 'post', body: { id: quoteId } }, options));
50
- }
51
- orderToAsset(accountId, orderId, options) {
52
- return this.httpService.api(Object.assign({ url: `${this.SERVICE_URL}/${accountId}/orders/${orderId}/to-asset`, method: 'post', body: { id: orderId } }, options));
53
- }
54
- }
55
- AccountApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
56
- AccountApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService });
57
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AccountApiService, decorators: [{
58
- type: Injectable
59
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
60
-
61
- class VeloceAuthService {
62
- constructor(http) {
63
- this.http = http;
64
- }
65
- auth$(instanceUrl, accessToken) {
66
- const headers = new HttpHeaders({
67
- 'Content-Type': 'application/json',
68
- Authorization: `Bearer ${accessToken}`,
69
- });
70
- return this.http.get(`${instanceUrl}/services/apexrest/VELOCE_PRISM/veloce-auth`, { headers });
71
- }
72
- }
73
- VeloceAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceAuthService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
74
- VeloceAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceAuthService });
75
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: VeloceAuthService, decorators: [{
76
- type: Injectable
77
- }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
78
-
79
- class ContractedPriceApiService {
80
- constructor(baseHttpService) {
81
- this.baseHttpService = baseHttpService;
82
- this.serviceUrl = '/admin/contracted-price';
83
- this.fetchContractedPrices$ = () => {
84
- return this.baseHttpService.api({ url: `${this.serviceUrl}` });
85
- };
86
- this.fetchContractedPrice$ = (id) => {
87
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
88
- };
89
- this.createContractedPrice$ = (data) => {
90
- return this.baseHttpService.api({
91
- url: `${this.serviceUrl}`,
92
- method: 'put',
93
- body: data,
94
- });
95
- };
96
- this.updateContractedPrice$ = (data) => {
97
- return this.baseHttpService.api({
98
- url: `${this.serviceUrl}/${data.id}`,
99
- method: 'put',
100
- body: data,
101
- });
102
- };
103
- this.searchContractedPrices$ = (searchParams, expression) => {
104
- const params = new HttpParams({ fromObject: Object.assign({}, searchParams) });
105
- return this.baseHttpService.api({
106
- method: 'post',
107
- url: `${this.serviceUrl}/search`,
108
- params,
109
- body: expression || {},
110
- });
111
- };
112
- }
113
- }
114
- ContractedPriceApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
115
- ContractedPriceApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService });
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ContractedPriceApiService, decorators: [{
117
- type: Injectable
118
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
119
-
120
- class FlowStateApiService {
121
- constructor(httpService) {
122
- this.httpService = httpService;
123
- this.SERVICE_URL = '/configuration/states';
124
- }
125
- /**
126
- * Initialize flow state
127
- * @param request Request
128
- * @returns Flow initialization response, which contains session ID and result of selectors
129
- */
130
- init(request) {
131
- return this.httpService.api({
132
- method: 'post',
133
- url: `${this.SERVICE_URL}/quote/start`,
134
- body: request,
135
- });
136
- }
137
- /**
138
- * Get existing state by ID
139
- * @param id ID
140
- * @returns Flow State
141
- */
142
- get(id) {
143
- return this.httpService.api({
144
- url: `${this.SERVICE_URL}/${id}`,
145
- });
146
- }
147
- /**
148
- * Execute actions/selectors
149
- * @param id State ID
150
- * @param request Request
151
- * @returns Execute result
152
- */
153
- execute(id, request) {
154
- return this.httpService.api({
155
- method: 'post',
156
- url: `${this.SERVICE_URL}/quote/${id}/execute`,
157
- body: request,
158
- });
159
- }
160
- /**
161
- * Save Quote in the state
162
- * @param id State ID
163
- */
164
- save(id) {
165
- return this.httpService.api({
166
- method: 'post',
167
- url: `${this.SERVICE_URL}/quote/${id}/save`,
168
- });
169
- }
170
- /**
171
- * Submit Quote in the state
172
- * @param id State ID
173
- */
174
- submit(id) {
175
- return this.httpService.api({
176
- method: 'post',
177
- url: `${this.SERVICE_URL}/quote/${id}/submit`,
178
- });
179
- }
180
- /**
181
- * Close Flow state
182
- * @param id State ID
183
- */
184
- cancel(id) {
185
- return this.httpService.api({
186
- method: 'post',
187
- url: `${this.SERVICE_URL}/quote/${id}/cancel`,
188
- });
189
- }
190
- /**
191
- * Initialize stateful configuration
192
- * @param stateId string
193
- * @param request Request
194
- * @returns Flow initialization response, which contains session ID and result of selectors
195
- */
196
- newConfiguration(stateId, request) {
197
- return this.httpService.api({
198
- method: 'post',
199
- url: `${this.SERVICE_URL}/quote/${stateId}/configuration/new`,
200
- body: request,
201
- });
202
- }
203
- /**
204
- * Start stateful configuration
205
- * @param stateId string
206
- * @param request Request
207
- * @returns Flow initialization response, which contains session ID and result of selectors
208
- */
209
- startConfiguration(stateId, request) {
210
- return this.httpService.api({
211
- method: 'post',
212
- url: `${this.SERVICE_URL}/quote/${stateId}/configuration/start`,
213
- body: request,
214
- });
215
- }
216
- /**
217
- * Execute stateful configuration
218
- * @param stateId string
219
- * @param configurationId string
220
- * @param request Request
221
- * @returns Flow initialization response, which contains session ID and result of selectors
222
- */
223
- executeConfiguration(stateId, configurationId, request) {
224
- return this.httpService.api({
225
- method: 'post',
226
- url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/execute`,
227
- body: request,
228
- });
229
- }
230
- /**
231
- * Save stateful configuration
232
- * @param stateId string
233
- * @param configurationId string
234
- */
235
- saveConfiguration(stateId, configurationId) {
236
- return this.httpService.api({
237
- method: 'post',
238
- url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/save`,
239
- });
240
- }
241
- /**
242
- * Cancel stateful configuration
243
- * @param stateId string
244
- * @param configurationId string
245
- */
246
- cancelConfiguration(stateId, configurationId) {
247
- return this.httpService.api({
248
- method: 'post',
249
- url: `${this.SERVICE_URL}/quote/${stateId}/configuration/${configurationId}/cancel`,
250
- });
251
- }
252
- }
253
- FlowStateApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
254
- FlowStateApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService });
255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowStateApiService, decorators: [{
256
- type: Injectable
257
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
258
-
259
- class OffersApiService {
260
- constructor(baseHttpService) {
261
- this.baseHttpService = baseHttpService;
262
- this.serviceUrl = '/admin/offers';
263
- }
264
- createOffer$(body) {
265
- return this.baseHttpService.api({
266
- url: `${this.serviceUrl}`,
267
- method: 'post',
268
- body,
269
- });
270
- }
271
- fetchOffers$() {
272
- return this.baseHttpService.api({
273
- url: `${this.serviceUrl}`,
274
- });
275
- }
276
- fetchOffer$(id) {
277
- return this.baseHttpService.api({
278
- url: `${this.serviceUrl}/${id}`,
279
- });
280
- }
281
- updateOffer$(offer) {
282
- return this.baseHttpService.api({
283
- url: `${this.serviceUrl}/${offer.id}`,
284
- method: 'put',
285
- body: offer,
286
- });
287
- }
288
- removeOffer$(id) {
289
- return this.baseHttpService.api({
290
- url: `${this.serviceUrl}/${id}`,
291
- method: 'delete',
292
- });
293
- }
294
- searchOffers$(expression, skip, count) {
295
- let params = new HttpParams();
296
- params = params.set('skip', '' + skip);
297
- params = params.set('count', '' + count);
298
- return this.baseHttpService.api({
299
- method: 'post',
300
- url: `${this.serviceUrl}/search`,
301
- params,
302
- body: expression,
303
- });
304
- }
305
- fetchOfferProducts$(id) {
306
- return this.baseHttpService
307
- .api({
308
- url: `${this.serviceUrl}/${id}/products`,
309
- })
310
- .pipe(map(response => response.products));
311
- }
312
- upsertOfferProducts$(id, products) {
313
- const request = { products };
314
- return this.baseHttpService
315
- .api({
316
- url: `${this.serviceUrl}/${id}/products`,
317
- method: 'put',
318
- body: request,
319
- })
320
- .pipe(map(response => response.products));
321
- }
322
- }
323
- OffersApiService.MAX_RESULTS = 60;
324
- OffersApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
325
- OffersApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService });
326
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OffersApiService, decorators: [{
327
- type: Injectable
328
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
329
-
330
- /**
331
- * Parses the response from Canvas and checks for errors.
332
- * - If an error is found, publishes an error message and returns the failover value.
333
- * - If no error is found, returns the parsed response.
334
- *
335
- * Note! The API call first goes to APEX before reaching the Canvas, so errors can originate from either APEX or Canvas.
336
- *
337
- * @param {string} response - The JSON string response from the Canvas call.
338
- * @param {T} failover - The value to return in case of error.
339
- * @returns {T | K} The parsed response or the failover value.
340
- *
341
- * @template T The expected type of the parsed response.
342
- * @template K The type of the failover value.
343
- *
344
- * @remarks If there's an Apex error, the response data can be an array.
345
- * In such cases, the function extracts the first element of the array.
346
- */
347
- const handleCanvasResponse = (response, failover, errorPublisher) => {
348
- const parsed = JSON.parse(response);
349
- const errorCandidate = isArray(parsed) ? parsed[0] : parsed;
350
- if (isApexError(errorCandidate)) {
351
- errorPublisher(errorCandidate.message);
352
- return failover;
353
- }
354
- if (isCanvasError(errorCandidate)) {
355
- errorPublisher(errorCandidate.error);
356
- return failover;
357
- }
358
- return parsed;
359
- };
360
-
361
- class OrgInfoApiService {
362
- constructor(messageService) {
363
- this.messageService = messageService;
364
- /**
365
- * Shows an error message using the message service.
366
- *
367
- * @param {string} message - the error message to be published.
368
- */
369
- this.publishErrorMessage = (message) => {
370
- this.messageService.add({ severity: 'error', summary: message, sticky: true });
371
- };
372
- }
373
- getOrgInfo$() {
374
- try {
375
- return window.doCanvasCall && window.ORGANIZATION_ID
376
- ? from(window.doCanvasCall(`org-info/${window.ORGANIZATION_ID}`, null)).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
377
- : of(undefined);
378
- }
379
- catch (_a) {
380
- return of(undefined);
381
- }
382
- }
383
- getAvailableVersionsInfo$() {
384
- try {
385
- return window.doCanvasCall && window.ORGANIZATION_ID
386
- ? from(window.doCanvasCall('versions/available', 'include_all=true')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
387
- : of(undefined);
388
- }
389
- catch (_a) {
390
- return of(undefined);
391
- }
392
- }
393
- upgradeVersion$(targetVersion) {
394
- try {
395
- return window.doCanvasCall && window.ORGANIZATION_ID
396
- ? from(window.doCanvasCall('versions/upgrade', `target_version=${targetVersion}`)).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
397
- : of(undefined);
398
- }
399
- catch (_a) {
400
- return of(undefined);
401
- }
402
- }
403
- }
404
- OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
405
- OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService });
406
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, decorators: [{
407
- type: Injectable
408
- }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
409
-
410
- class PortalsApiService {
411
- constructor(baseHttpService) {
412
- this.baseHttpService = baseHttpService;
413
- this.serviceUrl = '/admin/portal';
414
- this.getPortals$ = (skip = 1, name = '') => {
415
- let params = new HttpParams();
416
- params = params.append('count', (PortalsApiService.MAX_RESULTS * skip).toString());
417
- params = params.append('skip', '0');
418
- params = params.append('name', name);
419
- return this.baseHttpService.api({ url: `${this.serviceUrl}`, params });
420
- };
421
- this.searchPortals$ = (skip = 0, expression) => {
422
- let params = new HttpParams();
423
- params = params.set('skip', '' + skip);
424
- params = params.set('count', '' + PortalsApiService.MAX_RESULTS);
425
- return this.baseHttpService.api({
426
- method: 'post',
427
- url: `${this.serviceUrl}/search`,
428
- params,
429
- body: expression || {},
430
- });
431
- };
432
- this.removePortal$ = (id) => {
433
- return this.baseHttpService.api({
434
- url: `${this.serviceUrl}/${id}`,
435
- method: 'delete',
436
- });
437
- };
438
- this.restore$ = (id) => {
439
- return this.baseHttpService.api({
440
- method: 'patch',
441
- url: `${this.serviceUrl}/${id}/restore`,
442
- });
443
- };
444
- this.duplicatePortal$ = (cloneRequest) => {
445
- return this.baseHttpService.api({
446
- url: `${this.serviceUrl}/${cloneRequest.id}/clone`,
447
- method: 'post',
448
- body: cloneRequest,
449
- });
450
- };
451
- this.getPortal$ = (id) => {
452
- return this.baseHttpService.api({
453
- url: `${this.serviceUrl}/${id}`,
454
- });
455
- };
456
- }
457
- createNewPortal$(body) {
458
- return this.baseHttpService.api({
459
- url: `${this.serviceUrl}`,
460
- method: 'post',
461
- body,
462
- });
463
- }
464
- updatePortal$(portal, settings) {
465
- return this.baseHttpService.api({
466
- url: `${this.serviceUrl}/${portal.id}`,
467
- method: 'put',
468
- body: Object.assign(Object.assign({}, portal), { settings: JSON.stringify(settings) }),
469
- });
470
- }
471
- }
472
- PortalsApiService.MAX_RESULTS = 60;
473
- PortalsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
474
- PortalsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService });
475
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PortalsApiService, decorators: [{
476
- type: Injectable
477
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
478
-
479
- class PromotionsApiService {
480
- constructor(baseHttpService) {
481
- this.baseHttpService = baseHttpService;
482
- this.serviceUrl = '/admin/promotion';
483
- this.fetchAll$ = () => {
484
- return this.baseHttpService.api({ url: this.serviceUrl });
485
- };
486
- this.fetchOne$ = (id) => {
487
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
488
- };
489
- this.remove$ = (id) => {
490
- return this.baseHttpService.api({
491
- url: `${this.serviceUrl}/${id}`,
492
- method: 'delete',
493
- });
494
- };
495
- this.restore$ = (id) => {
496
- return this.baseHttpService.api({
497
- method: 'patch',
498
- url: `${this.serviceUrl}/${id}/restore`,
499
- });
500
- };
501
- this.duplicate$ = (body) => {
502
- return this.baseHttpService
503
- .api({
504
- url: `${this.serviceUrl}/${body.id}/clone`,
505
- method: 'post',
506
- body,
507
- })
508
- .pipe(map(response => response.clonedRecordId));
509
- };
510
- }
511
- search$(expression, skip, count) {
512
- let params = new HttpParams();
513
- if (typeof skip === 'number') {
514
- params = params.set('skip', '' + skip);
515
- }
516
- if (typeof count === 'number') {
517
- params = params.set('count', '' + count);
518
- }
519
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
520
- }
521
- create$(body) {
522
- return this.baseHttpService.api({
523
- url: `${this.serviceUrl}`,
524
- method: 'post',
525
- body,
526
- });
527
- }
528
- update$(body) {
529
- return this.baseHttpService.api({
530
- url: `${this.serviceUrl}/${body.id}`,
531
- method: 'put',
532
- body,
533
- });
534
- }
535
- }
536
- PromotionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
537
- PromotionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService });
538
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: PromotionsApiService, decorators: [{
539
- type: Injectable
540
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
541
-
542
- class RebateProgramApiService {
543
- constructor(baseHttpService) {
544
- this.baseHttpService = baseHttpService;
545
- this.serviceUrl = '/admin/rebate-program';
546
- this.fetchAll$ = () => {
547
- return this.baseHttpService.api({ url: this.serviceUrl });
548
- };
549
- this.fetchOne$ = (id) => {
550
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
551
- };
552
- this.remove$ = (id) => {
553
- return this.baseHttpService.api({
554
- url: `${this.serviceUrl}/${id}`,
555
- method: 'delete',
556
- });
557
- };
558
- this.restore$ = (id) => {
559
- return this.baseHttpService.api({
560
- method: 'patch',
561
- url: `${this.serviceUrl}/${id}/restore`,
562
- });
563
- };
564
- this.duplicate$ = (body) => {
565
- return this.baseHttpService
566
- .api({
567
- url: `${this.serviceUrl}/${body.id}/clone`,
568
- method: 'post',
569
- body,
570
- })
571
- .pipe(map(response => response.clonedRecordId));
572
- };
573
- }
574
- search$(expression, skip, count) {
575
- let params = new HttpParams();
576
- if (typeof skip === 'number') {
577
- params = params.set('skip', '' + skip);
578
- }
579
- if (typeof count === 'number') {
580
- params = params.set('count', '' + count);
581
- }
582
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
583
- }
584
- create$(body) {
585
- return this.baseHttpService.api({
586
- url: `${this.serviceUrl}`,
587
- method: 'post',
588
- body,
589
- });
590
- }
591
- update$(body) {
592
- return this.baseHttpService.api({
593
- url: `${this.serviceUrl}/${body.id}`,
594
- method: 'put',
595
- body,
596
- });
597
- }
598
- }
599
- RebateProgramApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
600
- RebateProgramApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService });
601
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateProgramApiService, decorators: [{
602
- type: Injectable
603
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
604
-
605
- class RebateTypeApiService {
606
- constructor(baseHttpService) {
607
- this.baseHttpService = baseHttpService;
608
- this.serviceUrl = '/admin/rebate-type';
609
- this.fetchAll$ = () => {
610
- return this.baseHttpService.api({ url: this.serviceUrl });
611
- };
612
- this.fetchOne$ = (id) => {
613
- return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
614
- };
615
- this.remove$ = (id) => {
616
- return this.baseHttpService.api({
617
- url: `${this.serviceUrl}/${id}`,
618
- method: 'delete',
619
- });
620
- };
621
- this.restore$ = (id) => {
622
- return this.baseHttpService.api({
623
- method: 'patch',
624
- url: `${this.serviceUrl}/${id}/restore`,
625
- });
626
- };
627
- this.duplicate$ = (body) => {
628
- return this.baseHttpService
629
- .api({
630
- url: `${this.serviceUrl}/${body.id}/clone`,
631
- method: 'post',
632
- body,
633
- })
634
- .pipe(map(response => response.clonedRecordId));
635
- };
636
- }
637
- search$(expression, skip, count) {
638
- let params = new HttpParams();
639
- if (typeof skip === 'number') {
640
- params = params.set('skip', '' + skip);
641
- }
642
- if (typeof count === 'number') {
643
- params = params.set('count', '' + count);
644
- }
645
- return this.baseHttpService.api({ method: 'post', url: `${this.serviceUrl}/search`, params, body: expression });
646
- }
647
- create$(body) {
648
- return this.baseHttpService.api({
649
- url: `${this.serviceUrl}`,
650
- method: 'post',
651
- body,
652
- });
653
- }
654
- update$(body) {
655
- return this.baseHttpService.api({
656
- url: `${this.serviceUrl}/${body.id}`,
657
- method: 'put',
658
- body,
659
- });
660
- }
661
- }
662
- RebateTypeApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
663
- RebateTypeApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService });
664
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RebateTypeApiService, decorators: [{
665
- type: Injectable
666
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
667
-
668
- class SandboxManagerApiService {
669
- constructor(messageService) {
670
- this.messageService = messageService;
671
- /**
672
- * Shows an error message using the message service.
673
- *
674
- * @param {string} message - the error message to be published.
675
- */
676
- this.publishErrorMessage = (message) => {
677
- this.messageService.add({ severity: 'error', summary: message, sticky: true });
678
- };
679
- }
680
- getSalesforceOrganizations$() {
681
- try {
682
- return window.doSandboxCall
683
- ? from(window.doSandboxCall('orgs', '', 'GET')).pipe(map(response => handleCanvasResponse(response, [], this.publishErrorMessage)), catchError(() => of([])))
684
- : of([]);
685
- }
686
- catch (_a) {
687
- return of([]);
688
- }
689
- }
690
- getAvailableSalesforceOrganizationSizes$() {
691
- try {
692
- return window.doSandboxCall
693
- ? from(window.doSandboxCall('available-sizes', '', 'GET')).pipe(map(response => handleCanvasResponse(response, {}, this.publishErrorMessage)), catchError(() => of({})))
694
- : of({});
695
- }
696
- catch (_a) {
697
- return of({});
698
- }
699
- }
700
- createSalesforceOrganization$(payload) {
701
- try {
702
- return window.doSandboxCall
703
- ? from(window.doSandboxCall('orgs', JSON.stringify(payload), 'POST')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
704
- : of(undefined);
705
- }
706
- catch (err) {
707
- return of(undefined);
708
- }
709
- }
710
- updateSalesforceOrganization$(payload) {
711
- try {
712
- return window.doSandboxCall
713
- ? from(window.doSandboxCall(`orgs/${payload.orgId}`, JSON.stringify(payload), 'POST')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
714
- : of(undefined);
715
- }
716
- catch (_a) {
717
- return of(undefined);
718
- }
719
- }
720
- deleteSalesforceOrganization$(payload) {
721
- try {
722
- return window.doSandboxCall
723
- ? from(window.doSandboxCall(`orgs/${payload.orgId}`, '', 'DELETE')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
724
- : of(undefined);
725
- }
726
- catch (_a) {
727
- return of(undefined);
728
- }
729
- }
730
- activateSalesforceOrganization$(payload) {
731
- try {
732
- return window.doSandboxCall
733
- ? from(window.doSandboxCall(`orgs/${payload.orgId}/activate`, JSON.stringify({}), 'POST')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
734
- : of(undefined);
735
- }
736
- catch (_a) {
737
- return of(undefined);
738
- }
739
- }
740
- deactivateSalesforceOrganization$(payload) {
741
- try {
742
- return window.doSandboxCall
743
- ? from(window.doSandboxCall(`orgs/${payload.orgId}/deactivate`, JSON.stringify({}), 'POST')).pipe(map(response => handleCanvasResponse(response, undefined, this.publishErrorMessage)), catchError(() => of(undefined)))
744
- : of(undefined);
745
- }
746
- catch (_a) {
747
- return of(undefined);
748
- }
749
- }
750
- }
751
- SandboxManagerApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, deps: [{ token: i1$2.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
752
- SandboxManagerApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService });
753
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SandboxManagerApiService, decorators: [{
754
- type: Injectable
755
- }], ctorParameters: function () { return [{ type: i1$2.MessageService }]; } });
756
-
757
- class StatefulConfigurationApiService {
758
- constructor(httpService) {
759
- this.httpService = httpService;
760
- this.SERVICE_URL = '/configuration/states';
761
- }
762
- /**
763
- * Initialize configuration state
764
- * @param request Request
765
- * @returns ID of new configuration state
766
- */
767
- init(request) {
768
- return this.httpService.api({
769
- method: 'post',
770
- url: `${this.SERVICE_URL}/init`,
771
- body: request,
772
- responseType: 'text',
773
- });
774
- }
775
- /**
776
- * Get existing state by ID
777
- * @param id ID
778
- * @returns Configuration State
779
- */
780
- get(id) {
781
- return this.httpService.api({
782
- url: `${this.SERVICE_URL}/${id}`,
783
- });
784
- }
785
- /**
786
- * Execute actions/selectors
787
- * @param id State ID
788
- * @param request Request
789
- * @returns Execute result
790
- */
791
- execute(id, request) {
792
- return this.httpService.api({
793
- method: 'post',
794
- url: `${this.SERVICE_URL}/${id}/execute`,
795
- body: request,
796
- });
797
- }
798
- }
799
- StatefulConfigurationApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
800
- StatefulConfigurationApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService });
801
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: StatefulConfigurationApiService, decorators: [{
802
- type: Injectable
803
- }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
804
-
805
- class ApiModule {
806
- }
807
- ApiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
808
- ApiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, imports: [HttpClientModule, ApiV2Module] });
809
- ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, providers: [
810
- BaseHttpService,
811
- XrayService,
812
- AccountApiService,
813
- OrgInfoApiService,
814
- OffersApiService,
815
- StatefulConfigurationApiService,
816
- RebateProgramApiService,
817
- RebateTypeApiService,
818
- PromotionsApiService,
819
- VeloceAuthService,
820
- ContractedPriceApiService,
821
- PortalsApiService,
822
- FlowStateApiService,
823
- SandboxManagerApiService,
824
- ], imports: [HttpClientModule, ApiV2Module] });
825
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ApiModule, decorators: [{
826
- type: NgModule,
827
- args: [{
828
- imports: [HttpClientModule, ApiV2Module],
829
- providers: [
830
- BaseHttpService,
831
- XrayService,
832
- AccountApiService,
833
- OrgInfoApiService,
834
- OffersApiService,
835
- StatefulConfigurationApiService,
836
- RebateProgramApiService,
837
- RebateTypeApiService,
838
- PromotionsApiService,
839
- VeloceAuthService,
840
- ContractedPriceApiService,
841
- PortalsApiService,
842
- FlowStateApiService,
843
- SandboxManagerApiService,
844
- ],
845
- }]
846
- }] });
847
-
848
- /**
849
- * Generated bundle index. Do not edit.
850
- */
851
-
852
- export { AccountApiService, ApiModule, ContractedPriceApiService, FlowStateApiService, OffersApiService, OrgInfoApiService, PortalsApiService, PromotionsApiService, RebateProgramApiService, RebateTypeApiService, SandboxManagerApiService, StatefulConfigurationApiService, VeloceAuthService, handleCanvasResponse };
853
- //# sourceMappingURL=veloceapps-api.mjs.map