FRE-682: Add folder/label management, search, and fix PGP build
- Add pop mail search CLI command with pagination support - Create internal/labels package with types and API client - Add folder list/create/update/delete CLI commands - Add label list/create/update/delete/apply/remove CLI commands - Register folder and label commands in root.go - Fix gopenpgp v2 API mismatches in pgp.go (NewPlainMessage, Armor, KeyRing.Encrypt/Decrypt, SessionKey) - Fix NewSessionManager error handling across cmd files - Fix variable shadowing bug in mail/client.go
This commit is contained in:
58
internal/labels/types.go
Normal file
58
internal/labels/types.go
Normal file
@@ -0,0 +1,58 @@
|
||||
package labels
|
||||
|
||||
// Folder represents a ProtonMail folder (system or custom)
|
||||
type Folder struct {
|
||||
ID string `json:"ID"`
|
||||
Name string `json:"Name"`
|
||||
Type int `json:"Type"`
|
||||
MessageCount int `json:"MessageCount,omitempty"`
|
||||
ParentID string `json:"ParentID,omitempty"`
|
||||
SortOrder int `json:"SortOrder,omitempty"`
|
||||
}
|
||||
|
||||
// Label represents a user-created label/tag
|
||||
type Label struct {
|
||||
ID string `json:"ID"`
|
||||
Name string `json:"Name"`
|
||||
Color string `json:"Color,omitempty"`
|
||||
}
|
||||
|
||||
// CreateFolderRequest for creating a new folder
|
||||
type CreateFolderRequest struct {
|
||||
Name string `json:"Name"`
|
||||
ParentID string `json:"ParentID,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateFolderRequest for updating a folder
|
||||
type UpdateFolderRequest struct {
|
||||
Name string `json:"Name,omitempty"`
|
||||
SortOrder *int `json:"SortOrder,omitempty"`
|
||||
}
|
||||
|
||||
// CreateLabelRequest for creating a new label
|
||||
type CreateLabelRequest struct {
|
||||
Name string `json:"Name"`
|
||||
Color string `json:"Color,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateLabelRequest for updating a label
|
||||
type UpdateLabelRequest struct {
|
||||
Name string `json:"Name,omitempty"`
|
||||
Color *string `json:"Color,omitempty"`
|
||||
}
|
||||
|
||||
// LabelMessageRequest for applying/removing labels from messages
|
||||
type LabelMessageRequest struct {
|
||||
MessageID string `json:"MessageID"`
|
||||
LabelID string `json:"LabelID"`
|
||||
}
|
||||
|
||||
// ListFoldersResponse for listing folders
|
||||
type ListFoldersResponse struct {
|
||||
Folders []Folder `json:"Folders"`
|
||||
}
|
||||
|
||||
// ListLabelsResponse for listing labels
|
||||
type ListLabelsResponse struct {
|
||||
Labels []Label `json:"Labels"`
|
||||
}
|
||||
Reference in New Issue
Block a user