Renaming Files having BluePrint to have Blueprint
[ccsdk/cds.git] / cds-ui / designer-client / src / app / modules / feature-modules / packages / configuration-dashboard / configuration-dashboard.service.ts
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     deletePackage(id: string) {
32         return this.api.delete(BlueprintURLs.getOneBlueprint + '/' + id, { observe: 'response' });
33     }
34 }