164d7660129285c6b6bf1e0218554d71dba13ea6
[ccsdk/cds.git] /
1 import {Injectable} from '@angular/core';
2 import {ApiService} from '../../../../common/core/services/api.typed.service';
3 import {BlueprintURLs} from '../../../../common/constants/app-constants';
4 import {Observable} from 'rxjs';
5 import {BluePrintDetailModel} from '../model/BluePrint.detail.model';
6
7
8 @Injectable({
9     providedIn: 'root'
10 })
11 export class ConfigurationDashboardService {
12     constructor(private api: ApiService<BluePrintDetailModel>) {
13
14     }
15
16     private getBluePrintModel(id: string): Observable<BluePrintDetailModel> {
17         return this.api.getOne(BlueprintURLs.getOneBlueprint + '/' + id);
18     }
19
20     getPagedPackages(id: string) {
21         return this.getBluePrintModel(id);
22     }
23
24     public downloadResource(path: string) {
25         return this.api.getCustomized(BlueprintURLs.download + path, {responseType: 'blob'});
26     }
27
28     deployPost(body: any | null): Observable<any> {
29         return this.api.post(BlueprintURLs.deploy, body, {responseType: 'text'});
30     }
31 }