feat(delivery): refine base service integrations
This commit is contained in:
@@ -66,6 +66,7 @@ export interface DeliveryTask {
|
||||
updated_at: string
|
||||
started_at?: string
|
||||
finished_at?: string
|
||||
credential_available?: boolean
|
||||
}
|
||||
|
||||
export interface TaskEvent {
|
||||
@@ -85,8 +86,12 @@ export interface DeliveryTaskSnapshot {
|
||||
}
|
||||
|
||||
export interface DeploymentCredential {
|
||||
username: string
|
||||
service: string
|
||||
instance_name: string
|
||||
host: string
|
||||
port: number
|
||||
username: string
|
||||
account_host: string
|
||||
password: string
|
||||
}
|
||||
|
||||
@@ -109,8 +114,13 @@ export const deliveryApi = {
|
||||
return Array.isArray(data.items) ? data.items : []
|
||||
},
|
||||
|
||||
async listTargetMountPaths(targetId: number, host: string): Promise<DeliveryMountPath[]> {
|
||||
const data = await authRequest(`/auth/api/v1/delivery/targets/${targetId}/hosts/${encodeURIComponent(host)}/mount-paths`)
|
||||
async listTargetMountPaths(targetId: number, host: string, prefix = ''): Promise<DeliveryMountPath[]> {
|
||||
const search = new URLSearchParams()
|
||||
if (prefix) search.set('prefix', prefix)
|
||||
const query = search.toString()
|
||||
const data = await authRequest(
|
||||
`/auth/api/v1/delivery/targets/${targetId}/hosts/${encodeURIComponent(host)}/mount-paths${query ? `?${query}` : ''}`,
|
||||
)
|
||||
return Array.isArray(data.items) ? data.items : []
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user