mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-06 23:56:37 +08:00
feat(pages): import deployment packages from URL
Add upload-from-url so admins can paste an HTTP(S) link and let the control plane download the archive with browser-like headers. Private/LAN hosts and insecure TLS certificates are allowed for internal artifact stores; package size and format checks reuse the existing local-upload pipeline.
This commit is contained in:
@@ -8,6 +8,7 @@ import { OpenFlareBaseService } from './base.service';
|
||||
import type {
|
||||
PagesDeployment,
|
||||
PagesDeploymentFile,
|
||||
PagesDeploymentUploadFromURLPayload,
|
||||
PagesDeploymentUploadPayload,
|
||||
PagesProject,
|
||||
PagesProjectPayload,
|
||||
@@ -67,6 +68,16 @@ export class PagesService extends OpenFlareBaseService {
|
||||
);
|
||||
}
|
||||
|
||||
static uploadDeploymentFromURL(
|
||||
projectId: number,
|
||||
payload: PagesDeploymentUploadFromURLPayload,
|
||||
): Promise<PagesDeployment> {
|
||||
return this.post<PagesDeployment>(
|
||||
`/${projectId}/deployments/upload-from-url`,
|
||||
payload,
|
||||
);
|
||||
}
|
||||
|
||||
static activateDeployment(
|
||||
projectId: number,
|
||||
deploymentId: number,
|
||||
|
||||
@@ -469,6 +469,10 @@ export interface PagesDeploymentUploadPayload {
|
||||
onProgress?: (percent: number) => void;
|
||||
}
|
||||
|
||||
export interface PagesDeploymentUploadFromURLPayload {
|
||||
url: string;
|
||||
}
|
||||
|
||||
// ==================== Origins ====================
|
||||
|
||||
export interface OriginItem {
|
||||
|
||||
Reference in New Issue
Block a user