Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions link_file_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ type CreateFileReq struct {
Hash string // Encrypted content hash
MIMEType string // MIME Type

// ClientUID is used for draft ownership tracking. In case of upload failure,
// the client can recognize its own draft and continue the upload.
// Per official Proton Drive API (OpenAPI spec).
ClientUID string `json:",omitempty"`

ContentKeyPacket string // The block's key packet, encrypted with the node key.
ContentKeyPacketSignature string // Unencrypted signature of the content session key, signed with the NodeKey

Expand Down
26 changes: 26 additions & 0 deletions link_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,29 @@ const (
RevisionStateObsolete
RevisionStateDeleted
)

// CheckAvailableHashesReq is used to check which file name hashes are available
// for upload in a given folder. Per official Proton Drive API (OpenAPI spec).
type CheckAvailableHashesReq struct {
Hashes []string

// ClientUID filters pending drafts. If provided, only drafts NOT belonging
// to these client UIDs will be returned in PendingHashes.
ClientUID []string `json:",omitempty"`
}

// CheckAvailableHashesRes contains the results of a hash availability check.
type CheckAvailableHashesRes struct {
AvailableHashes []string
PendingHashes []PendingHashData
}

// PendingHashData represents a pending draft that conflicts with a requested hash.
type PendingHashData struct {
Hash string
RevisionID string
LinkID string

// ClientUID identifies which client created this pending draft.
ClientUID string `json:",omitempty"`
}