github.com/argoproj/argo-cd@v1.8.7/ui/src/app/shared/services/cert-service.ts (about) 1 import * as models from '../models'; 2 import requests from './requests'; 3 4 export class CertificatesService { 5 public list(): Promise<models.RepoCert[]> { 6 return requests 7 .get('/certificates') 8 .then(res => res.body as models.RepoCertList) 9 .then(list => list.items || []); 10 } 11 12 public create(certificates: models.RepoCertList): Promise<models.RepoCertList> { 13 return requests 14 .post('/certificates') 15 .send(certificates) 16 .then(res => res.body as models.RepoCertList); 17 } 18 19 public delete(serverName: string, certType: string, certSubType: string): Promise<models.RepoCert> { 20 return requests 21 .delete('/certificates') 22 .query({hostNamePattern: serverName, certType, certSubType}) 23 .send() 24 .then(res => res.body as models.RepoCert); 25 } 26 }