@veloceapps/api 7.0.2-43 → 7.0.2-44
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.
- package/esm2020/index.mjs +2 -1
- package/esm2020/lib/api.module.mjs +4 -1
- package/esm2020/lib/services/ui-definitions-api.service.mjs +76 -0
- package/fesm2015/veloceapps-api.mjs +71 -2
- package/fesm2015/veloceapps-api.mjs.map +1 -1
- package/fesm2020/veloceapps-api.mjs +74 -2
- package/fesm2020/veloceapps-api.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/services/ui-definitions-api.service.d.ts +15 -0
- package/package.json +1 -1
@@ -3,12 +3,13 @@ import { HttpParams, HttpErrorResponse, HttpClientModule } from '@angular/common
|
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { Injectable, NgModule } from '@angular/core';
|
5
5
|
import * as i1 from '@veloceapps/core';
|
6
|
-
import { uiDefinitionFromDTO, isLegacyUIDefinition, ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
|
6
|
+
import { uiDefinitionFromDTO, isLegacyUIDefinition, ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
|
7
7
|
import { noop, throwError, of, zip, forkJoin, map as map$1, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
|
8
8
|
import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
|
9
9
|
import * as i2 from 'primeng/api';
|
10
10
|
import { CurrencyPipe } from '@angular/common';
|
11
11
|
import * as _ from 'lodash';
|
12
|
+
import { omit } from 'lodash';
|
12
13
|
import moment from 'moment';
|
13
14
|
|
14
15
|
class AccountApiService {
|
@@ -2133,6 +2134,75 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
2133
2134
|
type: Injectable
|
2134
2135
|
}], ctorParameters: function () { return [{ type: ConfigurationSettingsApiService }]; } });
|
2135
2136
|
|
2137
|
+
class UIDefinitionsApiService {
|
2138
|
+
constructor(baseHttpService) {
|
2139
|
+
this.baseHttpService = baseHttpService;
|
2140
|
+
}
|
2141
|
+
fetch$(modelId, version) {
|
2142
|
+
const serviceUrl = this.getServiceUrl(modelId);
|
2143
|
+
let params = new HttpParams();
|
2144
|
+
if (version != null) {
|
2145
|
+
params = params.set('modelVersion', version);
|
2146
|
+
}
|
2147
|
+
return this.baseHttpService
|
2148
|
+
.api({
|
2149
|
+
method: 'get',
|
2150
|
+
url: serviceUrl,
|
2151
|
+
params: params,
|
2152
|
+
})
|
2153
|
+
.pipe(map$1(containers => containers.map(uiDefinitionFromDTO)));
|
2154
|
+
}
|
2155
|
+
create$(modelId, uiDefinitionContainer) {
|
2156
|
+
const serviceUrl = this.getServiceUrl(modelId);
|
2157
|
+
const dto = {
|
2158
|
+
...omit(uiDefinitionContainer, 'source'),
|
2159
|
+
sourceBlob: JSON.stringify(uiDefinitionContainer.source),
|
2160
|
+
};
|
2161
|
+
return this.baseHttpService
|
2162
|
+
.api({
|
2163
|
+
method: 'post',
|
2164
|
+
url: serviceUrl,
|
2165
|
+
body: dto,
|
2166
|
+
})
|
2167
|
+
.pipe(map$1(container => uiDefinitionFromDTO(container)));
|
2168
|
+
}
|
2169
|
+
get$(modelId, uiDefinitionId) {
|
2170
|
+
const serviceUrl = this.getServiceUrl(modelId);
|
2171
|
+
return this.baseHttpService
|
2172
|
+
.api({
|
2173
|
+
method: 'get',
|
2174
|
+
url: `${serviceUrl}/${uiDefinitionId}`,
|
2175
|
+
})
|
2176
|
+
.pipe(map$1(container => uiDefinitionFromDTO(container)));
|
2177
|
+
}
|
2178
|
+
update$(uiDefinitionContainer) {
|
2179
|
+
const serviceUrl = this.getServiceUrl(uiDefinitionContainer.modelId);
|
2180
|
+
const dto = uiDefinitionToDTO(uiDefinitionContainer);
|
2181
|
+
return this.baseHttpService
|
2182
|
+
.api({
|
2183
|
+
method: 'put',
|
2184
|
+
url: `${serviceUrl}/${uiDefinitionContainer.id}`,
|
2185
|
+
body: dto,
|
2186
|
+
})
|
2187
|
+
.pipe(map$1(container => uiDefinitionFromDTO(container)));
|
2188
|
+
}
|
2189
|
+
delete$(uiDefinitionContainer) {
|
2190
|
+
const serviceUrl = this.getServiceUrl(uiDefinitionContainer.modelId);
|
2191
|
+
return this.baseHttpService.api({
|
2192
|
+
method: 'delete',
|
2193
|
+
url: `${serviceUrl}/${uiDefinitionContainer.id}`,
|
2194
|
+
});
|
2195
|
+
}
|
2196
|
+
getServiceUrl(modelId) {
|
2197
|
+
return `/models/${modelId}/uidefinitions`;
|
2198
|
+
}
|
2199
|
+
}
|
2200
|
+
UIDefinitionsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|
2201
|
+
UIDefinitionsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService });
|
2202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: UIDefinitionsApiService, decorators: [{
|
2203
|
+
type: Injectable
|
2204
|
+
}], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
|
2205
|
+
|
2136
2206
|
const fromUIComponentStoryDTO = (dto, attachments) => {
|
2137
2207
|
return {
|
2138
2208
|
id: dto.id,
|
@@ -2456,6 +2526,7 @@ ApiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.
|
|
2456
2526
|
EndpointsApiService,
|
2457
2527
|
OrgInfoApiService,
|
2458
2528
|
OffersApiService,
|
2529
|
+
UIDefinitionsApiService,
|
2459
2530
|
], imports: [HttpClientModule] });
|
2460
2531
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: ApiModule, decorators: [{
|
2461
2532
|
type: NgModule,
|
@@ -2492,6 +2563,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
2492
2563
|
EndpointsApiService,
|
2493
2564
|
OrgInfoApiService,
|
2494
2565
|
OffersApiService,
|
2566
|
+
UIDefinitionsApiService,
|
2495
2567
|
],
|
2496
2568
|
}]
|
2497
2569
|
}] });
|
@@ -2500,5 +2572,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
2500
2572
|
* Generated bundle index. Do not edit.
|
2501
2573
|
*/
|
2502
2574
|
|
2503
|
-
export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, QuoteApiService, RampApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, UITemplatesApiService };
|
2575
|
+
export { AccountApiService, ApiModule, CatalogAdminApiService, CatalogApiService, ConfigurationApiService, ConfigurationSettingsApiService, ContextApiService, DeltaApiService, DocumentAttachmentApiService, DocumentTemplatesApiService, EndpointsApiService, FlowsApiService, GuidedSellingApiService, GuidedSellingsAdminApiService, OffersApiService, OrgInfoApiService, PicklistsApiService, PriceApiService, ProceduresApiService, ProductApiService, ProductModelApiService, QuoteApiService, RampApiService, RuleGroupsApiService, RulesApiService, SalesforceApiService, ScriptsApiService, ShoppingCartSettingsApiService, UIDefinitionsApiService, UITemplatesApiService };
|
2504
2576
|
//# sourceMappingURL=veloceapps-api.mjs.map
|