groupware: add mock endpoints for tasklists and tasks

This commit is contained in:
Pascal Bleser
2025-10-02 10:41:22 +02:00
parent 27890bc3e5
commit 79fd20e7b2
9 changed files with 440 additions and 45 deletions

View File

@@ -799,7 +799,7 @@ func (j *Client) QueryEmailSummaries(accountIds []string, session *Session, ctx
invocations[i*2+0] = invocation(CommandEmailQuery, EmailQueryCommand{
AccountId: accountId,
Filter: filter,
Sort: []EmailComparator{EmailComparator{Property: emailSortByReceivedAt, IsAscending: false}},
Sort: []EmailComparator{{Property: emailSortByReceivedAt, IsAscending: false}},
Limit: limit,
//CalculateTotal: false,
}, mcid(accountId, "0"))

View File

@@ -114,7 +114,20 @@ type ResourceType string
// The Scope data type is used to represent the entities the quota applies to.
type Scope string
// Determines which action must be performed by the MUA or MTA upon receiption.
//
// !- `manual-action`: the disposition described by the disposition type was a result of an
// explicit instruction by the user rather than some sort of automatically performed action.
// (This might include the case when the user has manually configured her MUA to automatically
// respond to valid MDN requests.) Unless prescribed otherwise in a particular mail environment,
// in order to preserve the user's privacy, this MUST be the default for MUAs.
// !- `automatic-action`: the disposition described by the disposition type was a result of an
// automatic action rather than an explicit instruction by the user for this message. This
// is typically generated by a Mail Delivery Agent (e.g., MDN generations by Sieve reject action
// [RFC5429], Fax-over-Email [RFC3249], voice message system (see Voice Profile for Internet
// Mail (VPIM) [RFC3801]), or upon delivery to a mailing list).
type ActionMode string
type SendingMode string
type DispositionTypeOption string
@@ -184,11 +197,16 @@ const (
CalendarEventNotificationTypeOptionUpdated = CalendarEventNotificationTypeOption("updated")
CalendarEventNotificationTypeOptionDestroyed = CalendarEventNotificationTypeOption("destroyed")
// This represents a single person.
PrincipalTypeOptionIndividual = PrincipalTypeOption("individual")
PrincipalTypeOptionGroup = PrincipalTypeOption("group")
PrincipalTypeOptionResource = PrincipalTypeOption("resource")
PrincipalTypeOptionLocation = PrincipalTypeOption("location")
PrincipalTypeOptionOther = PrincipalTypeOption("other")
// This represents a group of people.
PrincipalTypeOptionGroup = PrincipalTypeOption("group")
// This represents some resource, e.g. a projector.
PrincipalTypeOptionResource = PrincipalTypeOption("resource")
// This represents a location.
PrincipalTypeOptionLocation = PrincipalTypeOption("location")
// This represents some other undefined principal.
PrincipalTypeOptionOther = PrincipalTypeOption("other")
HttpDigestAlgorithmAdler32 = HttpDigestAlgorithm("adler32")
HttpDigestAlgorithmCrc32c = HttpDigestAlgorithm("crc32c")
@@ -216,20 +234,64 @@ const (
// The quota information applies to all accounts belonging to the server.
ScopeGlobal = Scope("global")
ActionModeManualAction = ActionMode("manual-action")
// The disposition described by the disposition type was a result of an explicit instruction by the
// user rather than some sort of automatically performed action.
//
// (This might include the case when the user has manually configured her MUA to automatically
// respond to valid MDN requests.)
//
// Unless prescribed otherwise in a particular mail environment, in order to preserve the user's
// privacy, this MUST be the default for MUAs.
ActionModeManualAction = ActionMode("manual-action")
// The disposition described by the disposition type was a result of an automatic action rather than
// an explicit instruction by the user for this message.
//
// This is typically generated by a Mail Delivery Agent (e.g., MDN generations by Sieve reject
// action [RFC5429], Fax-over-Email [RFC3249], voice message system (see Voice Profile
// for Internet Mail (VPIM) [RFC3801]), or upon delivery to a mailing list).
ActionModeAutomaticAction = ActionMode("automatic-action")
SendingModeMdnSentManually = SendingMode("mdn-sent-manually")
// The user explicitly gave permission for this particular MDN to be sent.
//
// Unless prescribed otherwise in a particular mail environment, in order to preserve the
// user's privacy, this MUST be the default for MUAs.
SendingModeMdnSentManually = SendingMode("mdn-sent-manually")
// The MDN was sent because the MUA had previously been configured to do so automatically.
SendingModeMdnSentAutomatically = SendingMode("mdn-sent-automatically")
DispositionTypeOptionDeleted = DispositionTypeOption("deleted")
DispositionTypeOptionDispatched = DispositionTypeOption("dispatched")
DispositionTypeOptionDisplayed = DispositionTypeOption("displayed")
DispositionTypeOptionProcessed = DispositionTypeOption("processed")
// The message has been deleted.
//
// The recipient may or may not have seen the message.
//
// The recipient might "undelete" the message at a later time and read the message.
DispositionTypeOptionDeleted = DispositionTypeOption("deleted")
IncludeInAvailabilityAll = IncludeInAvailability("all")
// The message has been sent somewhere in some manner (e.g., printed, faxed, forwarded) without
// necessarily having been previously displayed to the user.
//
// The user may or may not see the message later.
DispositionTypeOptionDispatched = DispositionTypeOption("dispatched")
// The message has been displayed by the MUA to someone reading the recipient's mailbox.
//
// There is no guarantee that the content has been read or understood.
DispositionTypeOptionDisplayed = DispositionTypeOption("displayed")
// The message has been processed in some manner (i.e., by some sort of rules or server)
// without being displayed to the user.
//
// The user may or may not see the message later, or there may not even be a human user
// associated with the mailbox.
DispositionTypeOptionProcessed = DispositionTypeOption("processed")
// All events are considered.
IncludeInAvailabilityAll = IncludeInAvailability("all")
// Events the user is a confirmed or tentative participant of are considered.
IncludeInAvailabilityAttending = IncludeInAvailability("attending")
IncludeInAvailabilityNone = IncludeInAvailability("none")
// All events are ignored (but may be considered if also in another calendar).
IncludeInAvailabilityNone = IncludeInAvailability("none")
)
var (
@@ -540,16 +602,16 @@ type SessionMDNAccountCapabilities struct {
}
type SessionAccountCapabilities struct {
Mail SessionMailAccountCapabilities `json:"urn:ietf:params:jmap:mail"`
Submission SessionSubmissionAccountCapabilities `json:"urn:ietf:params:jmap:submission"`
VacationResponse SessionVacationResponseAccountCapabilities `json:"urn:ietf:params:jmap:vacationresponse"`
Sieve SessionSieveAccountCapabilities `json:"urn:ietf:params:jmap:sieve"`
Blob SessionBlobAccountCapabilities `json:"urn:ietf:params:jmap:blob"`
Quota SessionQuotaAccountCapabilities `json:"urn:ietf:params:jmap:quota"`
Contacts SessionContactsAccountCapabilities `json:"urn:ietf:params:jmap:contacts"`
Principals *SessionPrincipalsAccountCapabilities `json:"urn:ietf:params:jmap:principals,omitempty"`
PrincipalsOwner *SessionPrincipalsOwnerAccountCapabilities `json:"urn:ietf:params:jmap:principals:owner,omitempty"`
MDN *SessionMDNAccountCapabilities `json:"urn:ietf:params:jmap:mdn,omitempty"`
Mail *SessionMailAccountCapabilities `json:"urn:ietf:params:jmap:mail,omitempty"`
Submission *SessionSubmissionAccountCapabilities `json:"urn:ietf:params:jmap:submission,omitempty"`
VacationResponse *SessionVacationResponseAccountCapabilities `json:"urn:ietf:params:jmap:vacationresponse,omitempty"`
Sieve *SessionSieveAccountCapabilities `json:"urn:ietf:params:jmap:sieve,omitempty"`
Blob *SessionBlobAccountCapabilities `json:"urn:ietf:params:jmap:blob,omitempty"`
Quota *SessionQuotaAccountCapabilities `json:"urn:ietf:params:jmap:quota,omitempty"`
Contacts *SessionContactsAccountCapabilities `json:"urn:ietf:params:jmap:contacts,omitempty"`
Principals *SessionPrincipalsAccountCapabilities `json:"urn:ietf:params:jmap:principals,omitempty"`
PrincipalsOwner *SessionPrincipalsOwnerAccountCapabilities `json:"urn:ietf:params:jmap:principals:owner,omitempty"`
MDN *SessionMDNAccountCapabilities `json:"urn:ietf:params:jmap:mdn,omitempty"`
}
type Account struct {
@@ -558,7 +620,8 @@ type Account struct {
// This is true if the account belongs to the authenticated user rather than a group account or a personal account of another user that has been shared with them.
IsPersonal bool `json:"isPersonal"`
// This is true if the entire account is read-only.
IsReadOnly bool `json:"isReadOnly"`
IsReadOnly bool `json:"isReadOnly"`
// Account capabilities.
AccountCapabilities SessionAccountCapabilities `json:"accountCapabilities"`
}
@@ -4119,10 +4182,45 @@ type Principal struct {
Accounts map[string]Account `json:"accounts,omitempty"`
}
// TODO https://jmap.io/spec-sharing.html#object-properties
type ShareNotification struct {
type ShareChangePerson struct {
// The name of the person who made the change.
Name string `json:"name"`
// The email of the person who made the change, or null if no email is available.
Email string `json:"email,omitempty"`
// The id of the Principal corresponding to the person who made the change, or null if no associated principal.
PrincipalId string `json:"principalId,omitempty"`
}
type ShareNotification struct {
// The id of the `ShareNotification`.
Id string `json:"id"`
// The time this notification was created.
Created UTCDate `json:"created,omitzero"`
// Who made the change.
ChangedBy ShareChangePerson `json:"changedBy"`
// The name of the data type for the object whose permissions have changed, e.g. `Calendar` or `Mailbox`.
ObjectType ObjectType `json:"objectType"`
// The id of the account where this object exists.
ObjectAccountId string `json:"objectAccountId"`
// The id of the object that this notification is about.
ObjectId string `json:"objectId"`
// The name of the object at the time the notification was made.
Name string `json:"name"`
// The `myRights` property of the object for the user before the change.
OldRights map[string]bool `json:"oldRights,omitempty"`
// The `myRights` property of the object for the user after the change.
NewRights map[string]bool `json:"newRights,omitempty"`
}
// TODO unused
type Shareable struct {
// Has the user indicated they wish to see this data?
//