@veloceapps/api 3.1.1 → 3.1.3

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.
@@ -28,6 +28,255 @@
28
28
  var ___namespace = /*#__PURE__*/_interopNamespace(_);
29
29
  var moment___namespace = /*#__PURE__*/_interopNamespace(moment_);
30
30
 
31
+ var CatalogAdminApiService = /** @class */ (function () {
32
+ function CatalogAdminApiService(baseHttpService) {
33
+ var _this = this;
34
+ this.baseHttpService = baseHttpService;
35
+ this.serviceUrl = '/catalogs';
36
+ this.fetchCatalogs$ = function (searchParams) {
37
+ var params = new i5.HttpParams({ fromObject: Object.assign({}, searchParams) });
38
+ return _this.baseHttpService.api({ url: "" + _this.serviceUrl, params: params });
39
+ };
40
+ this.searchCatalogs$ = function (searchParams, expression) {
41
+ var params = new i5.HttpParams({ fromObject: Object.assign({}, searchParams) });
42
+ return _this.baseHttpService.api({
43
+ method: 'post',
44
+ url: _this.serviceUrl + "/search",
45
+ params: params,
46
+ body: expression || {},
47
+ });
48
+ };
49
+ this.fetchCategories$ = function (catalogId) {
50
+ return _this.baseHttpService.api({ url: _this.serviceUrl + "/" + catalogId + "/categories" });
51
+ };
52
+ this.searchProducts$ = function (catalogId, categoryId) {
53
+ return _this.baseHttpService.api({
54
+ method: 'post',
55
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/products/search",
56
+ body: {},
57
+ });
58
+ };
59
+ this.fetchAttributes$ = function (catalogId, categoryId) {
60
+ return _this.baseHttpService.api({ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/attributes" });
61
+ };
62
+ this.createNewCatalog$ = function (catalogData) {
63
+ return _this.baseHttpService.api({
64
+ url: "" + _this.serviceUrl,
65
+ method: 'post',
66
+ body: catalogData,
67
+ });
68
+ };
69
+ this.duplicateCatalog$ = function (cloneRequest) {
70
+ return _this.baseHttpService.api({
71
+ url: _this.serviceUrl + "/" + cloneRequest.id + "/clone",
72
+ method: 'post',
73
+ body: cloneRequest,
74
+ });
75
+ };
76
+ this.updateCatalog$ = function (data) {
77
+ return _this.baseHttpService.api({
78
+ url: _this.serviceUrl + "/" + data.id,
79
+ method: 'put',
80
+ body: data,
81
+ });
82
+ };
83
+ this.removeCatalog$ = function (id) {
84
+ return _this.baseHttpService.api({
85
+ url: _this.serviceUrl + "/" + id,
86
+ method: 'delete',
87
+ });
88
+ };
89
+ this.restoreCatalog$ = function (id) {
90
+ return _this.baseHttpService.api({
91
+ url: _this.serviceUrl + "/" + id + "/restore",
92
+ method: 'patch',
93
+ });
94
+ };
95
+ this.createNewCategory$ = function (categoryData) {
96
+ return _this.baseHttpService.api({
97
+ url: _this.serviceUrl + "/" + categoryData.catalogId + "/categories",
98
+ method: 'post',
99
+ body: categoryData,
100
+ });
101
+ };
102
+ this.updateCategory$ = function (category) {
103
+ return _this.baseHttpService.api({
104
+ url: _this.serviceUrl + "/" + category.catalogId + "/categories/" + category.id,
105
+ method: 'put',
106
+ body: category,
107
+ });
108
+ };
109
+ this.duplicateCategory$ = function (catalogId, cloneRequest) {
110
+ return _this.baseHttpService.api({
111
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + cloneRequest.id + "/clone",
112
+ method: 'post',
113
+ body: cloneRequest,
114
+ });
115
+ };
116
+ this.removeCategory$ = function (id, catalogId) {
117
+ return _this.baseHttpService.api({
118
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + id,
119
+ method: 'delete',
120
+ });
121
+ };
122
+ this.restoreCategory$ = function (id, catalogId) {
123
+ return _this.baseHttpService.api({
124
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + id + "/restore",
125
+ method: 'patch',
126
+ });
127
+ };
128
+ this.removeAttribute$ = function (_a) {
129
+ var catalogId = _a.catalogId, categoryId = _a.categoryId, data = _a.data;
130
+ return _this.baseHttpService.api({
131
+ method: 'delete',
132
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/attributes/" + data.id,
133
+ body: data,
134
+ });
135
+ };
136
+ this.restoreAttribute$ = function (_a) {
137
+ var catalogId = _a.catalogId, categoryId = _a.categoryId, data = _a.data;
138
+ return _this.baseHttpService.api({
139
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/attributes/" + data.id + "/restore",
140
+ method: 'patch',
141
+ });
142
+ };
143
+ this.createNewAttribute$ = function (_a) {
144
+ var catalogId = _a.catalogId, categoryId = _a.categoryId, data = _a.data;
145
+ return _this.baseHttpService.api({
146
+ method: 'post',
147
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/attributes",
148
+ body: data,
149
+ });
150
+ };
151
+ this.updateAttribute$ = function (_a) {
152
+ var catalogId = _a.catalogId, categoryId = _a.categoryId, data = _a.data;
153
+ return _this.baseHttpService.api({
154
+ method: 'put',
155
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/attributes/" + data.id,
156
+ body: data,
157
+ });
158
+ };
159
+ this.searchProductCandidates$ = function (catalogId, categoryId, expression, searchParams) {
160
+ var params = new i5.HttpParams({ fromObject: Object.assign({}, searchParams) });
161
+ return _this.baseHttpService.api({
162
+ method: 'post',
163
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/candidates/search",
164
+ params: params,
165
+ body: expression,
166
+ });
167
+ };
168
+ this.addProduct$ = function (product, catalogId, categoryId) {
169
+ return _this.baseHttpService.api({
170
+ method: 'post',
171
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/products",
172
+ body: product,
173
+ });
174
+ };
175
+ this.removeProduct$ = function (_a) {
176
+ var catalogId = _a.catalogId, categoryId = _a.categoryId, data = _a.data;
177
+ return _this.baseHttpService.api({
178
+ method: 'delete',
179
+ url: _this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/products/" + data.id,
180
+ body: data,
181
+ });
182
+ };
183
+ }
184
+ return CatalogAdminApiService;
185
+ }());
186
+ CatalogAdminApiService.MAX_RESULTS = 60;
187
+ CatalogAdminApiService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CatalogAdminApiService, deps: [{ token: i1__namespace.BaseHttpService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
188
+ CatalogAdminApiService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CatalogAdminApiService });
189
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CatalogAdminApiService, decorators: [{
190
+ type: i0.Injectable
191
+ }], ctorParameters: function () { return [{ type: i1__namespace.BaseHttpService }]; } });
192
+
193
+ var CatalogApiService = /** @class */ (function () {
194
+ function CatalogApiService(service) {
195
+ this.service = service;
196
+ this.serviceUrl = '/product-catalogs';
197
+ }
198
+ CatalogApiService.prototype.fetchCatalogs$ = function () {
199
+ return this.service.api({
200
+ method: 'get',
201
+ url: "" + this.serviceUrl,
202
+ });
203
+ };
204
+ CatalogApiService.prototype.searchCatalogs$ = function (searchParams, expression) {
205
+ var params = new i5.HttpParams({ fromObject: searchParams });
206
+ return this.service.api({
207
+ method: 'post',
208
+ url: this.serviceUrl + "/search",
209
+ params: params,
210
+ body: expression,
211
+ });
212
+ };
213
+ CatalogApiService.prototype.getCatalog$ = function (id) {
214
+ return this.service.api({
215
+ method: 'get',
216
+ url: this.serviceUrl + "/" + id,
217
+ });
218
+ };
219
+ CatalogApiService.prototype.fetchCategories$ = function (catalogId) {
220
+ return this.service.api({
221
+ method: 'get',
222
+ url: this.serviceUrl + "/" + catalogId + "/categories",
223
+ });
224
+ };
225
+ CatalogApiService.prototype.fetchCatalogProducts$ = function (catalogId, searchParams, context) {
226
+ var params = new i5.HttpParams({ fromObject: searchParams });
227
+ return this.service.api({
228
+ method: 'post',
229
+ url: this.serviceUrl + "/" + catalogId + "/products",
230
+ params: params,
231
+ body: context,
232
+ });
233
+ };
234
+ CatalogApiService.prototype.fetchCategoryProducts$ = function (catalogId, categoryId, searchParams, context) {
235
+ var params = new i5.HttpParams({ fromObject: searchParams });
236
+ return this.service.api({
237
+ method: 'post',
238
+ url: this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/products",
239
+ params: params,
240
+ body: context,
241
+ });
242
+ };
243
+ CatalogApiService.prototype.searchCategoryProducts$ = function (catalogId, categoryId, searchParams, searchCriteria, context) {
244
+ var params = new i5.HttpParams({ fromObject: searchParams });
245
+ return this.service.api({
246
+ method: 'post',
247
+ url: this.serviceUrl + "/" + catalogId + "/categories/" + categoryId + "/products/search",
248
+ params: params,
249
+ body: {
250
+ configurationContext: context,
251
+ request: { searchCriteria: searchCriteria },
252
+ },
253
+ });
254
+ };
255
+ CatalogApiService.prototype.fetchEligibleProducts$ = function (searchParams, context) {
256
+ var params = new i5.HttpParams({ fromObject: searchParams });
257
+ return this.service.api({
258
+ method: 'post',
259
+ url: this.serviceUrl + "/products",
260
+ params: params,
261
+ body: context,
262
+ });
263
+ };
264
+ CatalogApiService.prototype.fetchProducts$ = function (searchParams) {
265
+ var params = new i5.HttpParams({ fromObject: searchParams });
266
+ return this.service.api({
267
+ method: 'get',
268
+ url: this.serviceUrl + "/products",
269
+ params: params,
270
+ });
271
+ };
272
+ return CatalogApiService;
273
+ }());
274
+ CatalogApiService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CatalogApiService, deps: [{ token: i1__namespace.BaseHttpService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
275
+ CatalogApiService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CatalogApiService });
276
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: CatalogApiService, decorators: [{
277
+ type: i0.Injectable
278
+ }], ctorParameters: function () { return [{ type: i1__namespace.BaseHttpService }]; } });
279
+
31
280
  /*! *****************************************************************************
32
281
  Copyright (c) Microsoft Corporation.
33
282
 
@@ -1527,6 +1776,148 @@
1527
1776
  type: i0.Injectable
1528
1777
  }], ctorParameters: function () { return [{ type: i1__namespace.BaseHttpService }]; } });
1529
1778
 
1779
+ var ProductApiService = /** @class */ (function () {
1780
+ function ProductApiService(baseHttpService) {
1781
+ var _this = this;
1782
+ this.baseHttpService = baseHttpService;
1783
+ this.serviceUrl = '/products';
1784
+ this.fetchProducts$ = function (payload) {
1785
+ var params = new i5.HttpParams();
1786
+ params = params.append('count', payload.count);
1787
+ params = params.append('skip', payload.skip);
1788
+ if (payload.name) {
1789
+ params = params.append('name', payload.name);
1790
+ }
1791
+ return _this.baseHttpService.api({ url: "" + _this.serviceUrl, params: params });
1792
+ };
1793
+ this.searchProducts$ = function (expression, skip, count) {
1794
+ var params = new i5.HttpParams();
1795
+ params = params.set('skip', '' + skip);
1796
+ params = params.set('count', '' + count);
1797
+ return _this.baseHttpService.api({
1798
+ method: 'post',
1799
+ url: _this.serviceUrl + "/search",
1800
+ params: params,
1801
+ body: expression,
1802
+ });
1803
+ };
1804
+ this.fetchProduct$ = function (id) { return _this.baseHttpService.api({ url: _this.serviceUrl + "/" + id }); };
1805
+ this.fetchAttributes$ = function () {
1806
+ return _this.baseHttpService.api({ url: _this.serviceUrl + "/attributes/definition" });
1807
+ };
1808
+ this.searchAttributes$ = function (expression, skip, count) {
1809
+ var params = new i5.HttpParams();
1810
+ params = params.set('skip', '' + skip);
1811
+ params = params.set('count', '' + count);
1812
+ return _this.baseHttpService.api({
1813
+ method: 'post',
1814
+ url: _this.serviceUrl + "/attributes/definition/search",
1815
+ params: params,
1816
+ body: expression,
1817
+ });
1818
+ };
1819
+ this.fetchAttributesByModel = function (modelId) {
1820
+ return _this.baseHttpService.api({ url: _this.serviceUrl + "/attributes/definition/forModel/" + modelId });
1821
+ };
1822
+ this.createNewProduct$ = function (productData) {
1823
+ return _this.baseHttpService.api({
1824
+ url: "" + _this.serviceUrl,
1825
+ method: 'post',
1826
+ body: productData,
1827
+ });
1828
+ };
1829
+ this.updateProduct$ = function (body) {
1830
+ return _this.baseHttpService.api({
1831
+ url: _this.serviceUrl + "/" + body.id,
1832
+ method: 'put',
1833
+ body: body,
1834
+ });
1835
+ };
1836
+ this.removeProduct$ = function (id) {
1837
+ return _this.baseHttpService.api({
1838
+ url: _this.serviceUrl + "/" + id,
1839
+ method: 'delete',
1840
+ });
1841
+ };
1842
+ this.restoreProduct$ = function (id) {
1843
+ return _this.baseHttpService.api({
1844
+ url: _this.serviceUrl + "/" + id + "/restore",
1845
+ method: 'patch',
1846
+ });
1847
+ };
1848
+ this.createProductAttribute$ = function (attributeData) {
1849
+ return _this.baseHttpService.api({
1850
+ url: _this.serviceUrl + "/attributes",
1851
+ method: 'post',
1852
+ body: attributeData,
1853
+ });
1854
+ };
1855
+ this.updateProductAttribute$ = function (attributeData) {
1856
+ return _this.baseHttpService.api({
1857
+ url: _this.serviceUrl + "/attributes/" + attributeData.id,
1858
+ method: 'put',
1859
+ body: attributeData,
1860
+ });
1861
+ };
1862
+ this.removeProductAttribute$ = function (id) {
1863
+ return _this.baseHttpService.api({
1864
+ url: _this.serviceUrl + "/attributes/" + id,
1865
+ method: 'delete',
1866
+ });
1867
+ };
1868
+ this.createNewAttribute$ = function (attributeData) {
1869
+ return _this.baseHttpService.api({
1870
+ url: _this.serviceUrl + "/attributes/definition",
1871
+ method: 'post',
1872
+ body: attributeData,
1873
+ });
1874
+ };
1875
+ this.updateAttribute$ = function (body) {
1876
+ return _this.baseHttpService.api({
1877
+ url: _this.serviceUrl + "/attributes/definition/" + body.id,
1878
+ method: 'put',
1879
+ body: body,
1880
+ });
1881
+ };
1882
+ this.removeAttribute$ = function (id) {
1883
+ return _this.baseHttpService.api({
1884
+ url: _this.serviceUrl + "/attributes/definition/" + id,
1885
+ method: 'delete',
1886
+ });
1887
+ };
1888
+ this.restoreAttribute$ = function (id) {
1889
+ return _this.baseHttpService.api({
1890
+ url: _this.serviceUrl + "/attributes/definition/" + id + "/restore",
1891
+ method: 'patch',
1892
+ });
1893
+ };
1894
+ }
1895
+ ProductApiService.prototype.attachImage$ = function (productId, file) {
1896
+ var data = new FormData();
1897
+ data.append('image', file);
1898
+ return this.baseHttpService.upload({
1899
+ method: 'post',
1900
+ url: this.serviceUrl + "/" + productId + "/image",
1901
+ body: data,
1902
+ });
1903
+ };
1904
+ ProductApiService.prototype.removeImage$ = function (productId) {
1905
+ return this.baseHttpService.api({
1906
+ method: 'delete',
1907
+ url: this.serviceUrl + "/" + productId + "/image",
1908
+ });
1909
+ };
1910
+ ProductApiService.prototype.getImageUrl = function (productId) {
1911
+ return this.serviceUrl + "/" + productId + "/image";
1912
+ };
1913
+ return ProductApiService;
1914
+ }());
1915
+ ProductApiService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductApiService, deps: [{ token: i1__namespace.BaseHttpService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1916
+ ProductApiService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductApiService });
1917
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductApiService, decorators: [{
1918
+ type: i0.Injectable
1919
+ }], ctorParameters: function () { return [{ type: i1__namespace.BaseHttpService }]; } });
1920
+
1530
1921
  var ProductModelApiService = /** @class */ (function () {
1531
1922
  function ProductModelApiService(httpService) {
1532
1923
  this.httpService = httpService;
@@ -2328,6 +2719,9 @@
2328
2719
  RulesApiService,
2329
2720
  RuleGroupsApiService,
2330
2721
  FlowsApiService,
2722
+ ProductApiService,
2723
+ CatalogAdminApiService,
2724
+ CatalogApiService,
2331
2725
  ], imports: [[i5.HttpClientModule]] });
2332
2726
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ApiModule, decorators: [{
2333
2727
  type: i0.NgModule,
@@ -2352,6 +2746,9 @@
2352
2746
  RulesApiService,
2353
2747
  RuleGroupsApiService,
2354
2748
  FlowsApiService,
2749
+ ProductApiService,
2750
+ CatalogAdminApiService,
2751
+ CatalogApiService,
2355
2752
  ],
2356
2753
  }]
2357
2754
  }] });
@@ -2361,6 +2758,8 @@
2361
2758
  */
2362
2759
 
2363
2760
  exports.ApiModule = ApiModule;
2761
+ exports.CatalogAdminApiService = CatalogAdminApiService;
2762
+ exports.CatalogApiService = CatalogApiService;
2364
2763
  exports.ConfigurationApiService = ConfigurationApiService;
2365
2764
  exports.ConfigurationSettingsApiService = ConfigurationSettingsApiService;
2366
2765
  exports.ContextApiService = ContextApiService;
@@ -2369,6 +2768,7 @@
2369
2768
  exports.FlowsApiService = FlowsApiService;
2370
2769
  exports.PriceApiService = PriceApiService;
2371
2770
  exports.ProceduresApiService = ProceduresApiService;
2771
+ exports.ProductApiService = ProductApiService;
2372
2772
  exports.ProductModelApiService = ProductModelApiService;
2373
2773
  exports.QuoteApiService = QuoteApiService;
2374
2774
  exports.RampApiService = RampApiService;