import { IBundle } from "@staticdeploy/core" ; import { AxiosInstance } from "axios" ; export default class BundlesClient { constructor ( private axios ) { } async getNames ( ) { const result = await this . axios . get ( "/bundleNames" ) ; return result . data ; } async getTagsByName ( name ) { const result = await this . axios . get ( `/bundleNames/${ encodeURIComponent ( name ) }/bundleTags` ) ; return result . data ; } async getByNameAndTag ( name , tag ) { const result = await this . axios . get ( `/bundleNames/${ encodeURIComponent ( name ) }/bundleTags/${ encodeURIComponent ( tag ) }/bundles` ) ; return result . data ; } async getAll ( ) { const result = await this . axios . get ( "/bundles" ) ; return result . data ; } async getOne ( id ) { const result = await this . axios . get ( `/bundles/${ id }` ) ; return result . data ; } async create ( bundle ) { const result = await this . axios . post ( "/bundles" , bundle ) ; return result . data ; } async deleteByNameAndTag ( name , tag ) { await this . axios . delete ( `/bundleNames/${ encodeURIComponent ( name ) }/bundleTags/${ encodeURIComponent ( tag ) }/bundles` ) ; } }