@veloceapps/api 10.0.0-13 → 10.0.0-14

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.
@@ -3419,17 +3419,33 @@ class RlmApiService {
3419
3419
  this.serviceUrl = '/rlm';
3420
3420
  }
3421
3421
  fetchContextDefinitions$() {
3422
- return of([
3423
- { label: 'First', value: 'First' },
3424
- { label: 'Second', value: 'Second' },
3425
- ]);
3426
- // return this.baseHttpService.api<any[]>({ url: `${this.serviceUrl}/definitions` });
3427
- }
3428
- fetchContextMappings() {
3429
- return of([
3430
- { label: 'First', value: 'First' },
3431
- { label: 'Second', value: 'Second' },
3432
- ]);
3422
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/context` });
3423
+ }
3424
+ fetchContextMappings$(id) {
3425
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/context/${id}/mappings` });
3426
+ }
3427
+ fetchContextDefinitionStructure$(id) {
3428
+ return this.baseHttpService
3429
+ .api({
3430
+ url: `${this.serviceUrl}/context/${id}/structure/details`,
3431
+ })
3432
+ .pipe(map(objects => {
3433
+ return objects.map(object => {
3434
+ const tag = object.tags?.[0]?.title;
3435
+ return {
3436
+ id: object.id,
3437
+ title: tag || object.title,
3438
+ attributes: object.attributes.map(attribute => {
3439
+ const tag = attribute.tags?.[0]?.title;
3440
+ return {
3441
+ title: tag || attribute.title,
3442
+ fieldType: attribute.fieldType,
3443
+ dataType: attribute.dataType,
3444
+ };
3445
+ }),
3446
+ };
3447
+ });
3448
+ }));
3433
3449
  }
3434
3450
  }
3435
3451
  RlmApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RlmApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });