Files
WarpBox/lib/models/models.go
Daniel Legt 041a9798a7 feat(boxstore): add retention options and box deletion support
Introduce configurable retention options and default selection, store
retention when creating manifests, and add a helper to delete box
directories to enable expiring/cleanup workflows. Update login and upload
styles (new login layout, taller upload window) to support the new UI.feat(boxstore): add retention options and box deletion support

Introduce configurable retention options and default selection, store
retention when creating manifests, and add a helper to delete box
directories to enable expiring/cleanup workflows. Update login and upload
styles (new login layout, taller upload window) to support the new UI.
2026-04-27 18:18:53 +03:00

61 lines
1.7 KiB
Go

package models
import "time"
const (
FileStatusFailed = "failed"
FileStatusReady = "complete"
FileStatusWait = "pending"
FileStatusWork = "uploading"
)
type RetentionOption struct {
Key string `json:"key"`
Label string `json:"label"`
Seconds int64 `json:"seconds"`
}
type BoxFile struct {
ID string `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
SizeLabel string `json:"size_label"`
MimeType string `json:"mime_type"`
Status string `json:"status"`
StatusLabel string `json:"status_label"`
Title string `json:"title"`
IconPath string `json:"icon_path"`
DownloadPath string `json:"download_path"`
UploadPath string `json:"upload_path"`
IsComplete bool `json:"is_complete"`
}
type BoxManifest struct {
Files []BoxFile `json:"files"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
RetentionKey string `json:"retention_key"`
RetentionLabel string `json:"retention_label"`
RetentionSecs int64 `json:"retention_seconds"`
PasswordSalt string `json:"password_salt,omitempty"`
PasswordHash string `json:"password_hash,omitempty"`
AuthToken string `json:"auth_token,omitempty"`
DisableZip bool `json:"disable_zip,omitempty"`
}
type CreateBoxRequest struct {
Files []CreateBoxFileRequest `json:"files"`
RetentionKey string `json:"retention_key"`
Password string `json:"password"`
AllowZip *bool `json:"allow_zip"`
}
type CreateBoxFileRequest struct {
Name string `json:"name"`
Size int64 `json:"size"`
}
type UpdateFileStatusRequest struct {
Status string `json:"status"`
}