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