groupware: remove mock calendars and contacts

This commit is contained in:
Pascal Bleser
2025-11-05 14:22:03 +01:00
parent 814bc0e6d1
commit 4f596ba4aa
3 changed files with 10 additions and 820 deletions

View File

@@ -1,252 +0,0 @@
package groupware
import (
"github.com/opencloud-eu/opencloud/pkg/jmap"
"github.com/opencloud-eu/opencloud/pkg/jscalendar"
)
var C1 = jmap.Calendar{
Id: "thoo5she",
Name: "Personal Calendar",
Description: "Camina Drummer's Personal Calendar",
Color: "purple",
SortOrder: 1,
IsSubscribed: true,
IsVisible: true,
IsDefault: true,
IncludeInAvailability: jmap.IncludeInAvailabilityAll,
DefaultAlertsWithTime: map[string]jscalendar.Alert{
"eing7doh": {
Type: jscalendar.AlertType,
Trigger: jscalendar.AbsoluteTrigger{
Type: jscalendar.AbsoluteTriggerType,
When: mustParseTime("2025-09-30T20:34:12Z"),
},
},
},
DefaultAlertsWithoutTime: map[string]jscalendar.Alert{
"oayooy0u": {
Type: jscalendar.AlertType,
Trigger: jscalendar.OffsetTrigger{
Type: jscalendar.OffsetTriggerType,
Offset: "PT5M",
RelativeTo: jscalendar.RelativeToStart,
},
},
},
TimeZone: "CEST",
ShareWith: map[string]jmap.CalendarRights{
"ahn0doo8": {
MayReadFreeBusy: true,
MayReadItems: true,
MayWriteAll: true,
MayWriteOwn: true,
MayUpdatePrivate: true,
MayRSVP: false,
MayAdmin: false,
MayDelete: false,
},
},
MyRights: &jmap.CalendarRights{
MayReadFreeBusy: true,
MayReadItems: true,
MayWriteAll: false,
MayWriteOwn: false,
MayUpdatePrivate: true,
MayRSVP: true,
MayAdmin: false,
MayDelete: false,
},
}
var AllCalendars = []jmap.Calendar{C1}
var E1 = jmap.CalendarEvent{
Id: "ovei9oqu",
CalendarIds: map[string]bool{
C1.Id: true,
},
BaseEventId: "ahtah9qu",
IsDraft: true,
IsOrigin: true,
UtcStart: jmap.UTCDate{Time: mustParseTime("2025-10-01T00:00:00Z")},
UtcEnd: jmap.UTCDate{Time: mustParseTime("2025-10-07T00:00:00Z")},
Event: jscalendar.Event{
Type: jscalendar.EventType,
Start: jscalendar.LocalDateTime("2025-09-30T12:00:00"),
Duration: "PT30M",
Status: jscalendar.StatusConfirmed,
Object: jscalendar.Object{
CommonObject: jscalendar.CommonObject{
Uid: "9a7ab91a-edca-4988-886f-25e00743430d",
ProdId: "Mock 0.0",
Created: "2025-09-29T16:17:18",
Updated: "2025-09-29T16:17:18",
Title: "Meeting of the Minds",
Description: "Internal meeting about the grand strategy for the future",
DescriptionContentType: "text/plain",
Links: map[string]jscalendar.Link{
"cai0thoh": {
Type: jscalendar.LinkType,
Href: "https://example.com/9a7ab91a-edca-4988-886f-25e00743430d",
Rel: jscalendar.RelAbout,
ContentType: "text/html",
},
},
Locale: "en-US",
Keywords: map[string]bool{
"meeting": true,
"secret": true,
},
Categories: map[string]bool{
"secret": true,
"internal": true,
},
Color: "purple",
},
RelatedTo: map[string]jscalendar.Relation{},
Sequence: 0,
ShowWithoutTime: false,
Locations: map[string]jscalendar.Location{
"ux1uokie": {
Type: jscalendar.LocationType,
Name: "office",
Description: "Office meeting room upstairs",
LocationTypes: map[jscalendar.LocationTypeOption]bool{
jscalendar.LocationTypeOptionOffice: true,
},
Coordinates: "geo:52.5334956,13.4079872",
Links: map[string]jscalendar.Link{
"eefe2pax": {
Type: jscalendar.LinkType,
Href: "https://example.com/office",
},
},
},
},
VirtualLocations: map[string]jscalendar.VirtualLocation{
"em4eal0o": {
Type: jscalendar.VirtualLocationType,
Name: "opentalk",
Description: "The opentalk Conference Room",
Uri: "https://meet.opentalk.eu",
Features: map[jscalendar.VirtualLocationFeature]bool{
jscalendar.VirtualLocationFeatureAudio: true,
jscalendar.VirtualLocationFeatureChat: true,
jscalendar.VirtualLocationFeatureVideo: true,
jscalendar.VirtualLocationFeatureScreen: true,
},
},
},
RecurrenceRule: &jscalendar.RecurrenceRule{
Type: jscalendar.RecurrenceRuleType,
Frequency: jscalendar.FrequencyWeekly,
Interval: 1,
Rscale: jscalendar.RscaleIso8601,
Skip: jscalendar.SkipOmit,
FirstDayOfWeek: jscalendar.DayOfWeekMonday,
Count: 4,
},
FreeBusyStatus: jscalendar.FreeBusyStatusBusy,
Privacy: jscalendar.PrivacyPublic,
ReplyTo: map[jscalendar.ReplyMethod]string{
jscalendar.ReplyMethodImip: "mailto:organizer@example.com",
},
SentBy: "organizer@example.com",
Participants: map[string]jscalendar.Participant{
"eegh7uph": {
Type: jscalendar.ParticipantType,
Name: "Anderson Dawes",
Email: "adawes@opa.org",
Description: "Called the meeting",
SendTo: map[jscalendar.SendToMethod]string{
jscalendar.SendToMethodImip: "mailto:adawes@opa.org",
},
Kind: jscalendar.ParticipantKindIndividual,
Roles: map[jscalendar.Role]bool{
jscalendar.RoleAttendee: true,
jscalendar.RoleChair: true,
jscalendar.RoleOwner: true,
},
LocationId: "ux1uokie",
Language: "en-GB",
ParticipationStatus: jscalendar.ParticipationStatusAccepted,
ParticipationComment: "I'll be there for sure",
ExpectReply: true,
ScheduleAgent: jscalendar.ScheduleAgentServer,
ScheduleSequence: 1,
ScheduleStatus: []string{"1.0"},
ScheduleUpdated: mustParseTime("2025-10-01T11:59:12Z"),
SentBy: "adawes@opa.org",
InvitedBy: "eegh7uph",
Links: map[string]jscalendar.Link{
"ieni5eiw": {
Type: jscalendar.LinkType,
Href: "https://static.wikia.nocookie.net/expanse/images/1/1e/OPA_leader.png/revision/latest?cb=20250121103410",
ContentType: "image/png",
Rel: jscalendar.RelIcon,
Size: 192812,
Display: jscalendar.DisplayBadge,
Title: "Anderson Dawes' photo",
},
},
ScheduleId: "mailto:adawes@opa.org",
},
"xeikie9p": {
Type: jscalendar.ParticipantType,
Name: "Klaes Ashford",
Email: "ashford@opa.org",
Description: "As the first officer on the Behemoth",
SendTo: map[jscalendar.SendToMethod]string{
jscalendar.SendToMethodImip: "mailto:ashford@opa.org",
jscalendar.SendToMethodOther: "https://behemoth.example.com/ping/@ashford",
},
Kind: jscalendar.ParticipantKindIndividual,
Roles: map[jscalendar.Role]bool{
jscalendar.RoleAttendee: true,
},
LocationId: "em4eal0o",
Language: "en-GB",
ParticipationStatus: jscalendar.ParticipationStatusNeedsAction,
ExpectReply: true,
ScheduleAgent: jscalendar.ScheduleAgentServer,
ScheduleSequence: 0,
SentBy: "adawes@opa.org",
InvitedBy: "eegh7uph",
Links: map[string]jscalendar.Link{
"oifooj6g": {
Type: jscalendar.LinkType,
Href: "https://static.wikia.nocookie.net/expanse/images/0/02/Klaes_Ashford_-_Expanse_season_4_promotional_2.png/revision/latest?cb=20191206012007",
ContentType: "image/png",
Rel: jscalendar.RelIcon,
Size: 201291,
Display: jscalendar.DisplayBadge,
Title: "Ashford on Medina Station",
},
},
ScheduleId: "mailto:ashford@opa.org",
},
},
Alerts: map[string]jscalendar.Alert{
"ahqu4xi0": {
Type: jscalendar.AlertType,
Trigger: jscalendar.OffsetTrigger{
Type: jscalendar.OffsetTriggerType,
Offset: "PT-5M",
RelativeTo: jscalendar.RelativeToStart,
},
},
},
TimeZone: "UTC",
MayInviteSelf: true,
MayInviteOthers: true,
HideAttendees: false,
},
},
}
var EventsMapByCalendarId = map[string][]jmap.CalendarEvent{
C1.Id: {
E1,
},
}

View File

@@ -1,568 +0,0 @@
package groupware
import (
"time"
"github.com/opencloud-eu/opencloud/pkg/jmap"
"github.com/opencloud-eu/opencloud/pkg/jscontact"
)
func mustParseTime(text string) time.Time {
t, err := time.Parse(time.RFC3339, text)
if err != nil {
panic(err)
}
return t
}
var A1 = jmap.AddressBook{
Id: "a1",
Name: "Contacts",
Description: "Your good old personal address book",
SortOrder: 1,
IsDefault: true,
IsSubscribed: true,
MyRights: jmap.AddressBookRights{
MayRead: true,
MayWrite: true,
MayAdmin: true,
MayDelete: true,
},
}
var A2 = jmap.AddressBook{
Id: "a2",
Name: "Collected Contacts",
Description: "This address book contains the contacts that were collected when sending and receiving emails",
SortOrder: 10,
IsDefault: false,
IsSubscribed: true,
MyRights: jmap.AddressBookRights{
MayRead: true,
MayWrite: false,
MayAdmin: false,
MayDelete: false,
},
}
var CaminaDrummerContact = jscontact.ContactCard{
Type: jscontact.ContactCardType,
Id: "cc1",
AddressBookIds: map[string]bool{
A1.Id: true,
A2.Id: true,
},
Version: jscontact.JSContactVersion_1_0,
Created: mustParseTime("2025-09-30T11:00:12Z").UTC(),
Updated: mustParseTime("2025-09-30T11:00:12Z").UTC(),
Kind: jscontact.ContactCardKindIndividual,
Language: "en-GB",
ProdId: "Mock 0.0",
Uid: "e8317f89-2a09-481d-8ce5-de3ab968dc63",
Name: &jscontact.Name{
Type: jscontact.NameType,
Components: []jscontact.NameComponent{
{
Type: jscontact.NameComponentType,
Kind: jscontact.NameComponentKindGiven,
Value: "Camina",
},
{
Type: jscontact.NameComponentType,
Kind: jscontact.NameComponentKindSurname,
Value: "Drummer",
},
},
IsOrdered: true,
DefaultSeparator: " ",
Full: "Camina Drummer",
},
Nicknames: map[string]jscontact.Nickname{
"n1": {
Type: jscontact.NicknameType,
Name: "Bosmang",
Contexts: map[jscontact.NicknameContext]bool{
jscontact.NicknameContextWork: true,
},
Pref: 1,
},
},
Organizations: map[string]jscontact.Organization{
"o1": {
Type: jscontact.OrganizationType,
Name: "Outer Planets Alliance",
SortAs: "OPA",
Contexts: map[jscontact.OrganizationContext]bool{
jscontact.OrganizationContextWork: true,
},
},
},
SpeakToAs: &jscontact.SpeakToAs{
Type: jscontact.SpeakToAsType,
GrammaticalGender: jscontact.GrammaticalGenderFeminine,
Pronouns: map[string]jscontact.Pronouns{
"p1": {
Type: jscontact.PronounsType,
Pronouns: "she/her",
Contexts: map[jscontact.PronounsContext]bool{
jscontact.PronounsContextPrivate: true,
},
Pref: 1,
},
},
},
Titles: map[string]jscontact.Title{
"t1": {
Type: jscontact.TitleType,
Name: "Bosmang",
Kind: jscontact.TitleKindTitle,
OrganizationId: "o1",
},
},
Emails: map[string]jscontact.EmailAddress{
"e1": {
Type: jscontact.EmailAddressType,
Address: "cdrummer@opa.org",
Contexts: map[jscontact.EmailAddressContext]bool{
jscontact.EmailAddressContextWork: true,
jscontact.EmailAddressContextPrivate: true,
},
Pref: 10,
Label: "opa",
},
"e2": {
Type: jscontact.EmailAddressType,
Address: "camina.drummer@ceres.net",
Contexts: map[jscontact.EmailAddressContext]bool{
jscontact.EmailAddressContextPrivate: true,
},
Pref: 20,
},
},
OnlineServices: map[string]jscontact.OnlineService{
"s1": {
Type: jscontact.OnlineServiceType,
Service: "Ring Network",
Uri: "https://ring.example.com/contact/@cdrummer",
User: "@cdrummer18219",
Contexts: map[jscontact.OnlineServiceContext]bool{
jscontact.OnlineServiceContextPrivate: true,
jscontact.OnlineServiceContextWork: true,
},
Label: "ring",
},
},
Phones: map[string]jscontact.Phone{
"p1": {
Type: jscontact.PhoneType,
Number: "+1-999-555-1234",
Features: map[jscontact.PhoneFeature]bool{
jscontact.PhoneFeatureMainNumber: true,
jscontact.PhoneFeatureMobile: true,
jscontact.PhoneFeatureVoice: true,
jscontact.PhoneFeatureText: true,
jscontact.PhoneFeatureVideo: true,
},
Contexts: map[jscontact.PhoneContext]bool{
jscontact.PhoneContextPrivate: true,
jscontact.PhoneContextWork: true,
},
Pref: 1,
Label: "main",
},
},
PreferredLanguages: map[string]jscontact.LanguagePref{
"en": {
Type: jscontact.LanguagePrefType,
Language: "en-GB",
Contexts: map[jscontact.LanguagePrefContext]bool{
jscontact.LanguagePrefContextPrivate: true,
jscontact.LanguagePrefContextWork: true,
},
},
},
Calendars: map[string]jscontact.Calendar{
"c1": {
Type: jscontact.CalendarType,
Kind: jscontact.CalendarKindCalendar,
Uri: "https://ceres.org/calendars/@cdrummer/c1",
MediaType: "application/jscontact+json",
Contexts: map[jscontact.CalendarContext]bool{
jscontact.CalendarContextPrivate: true,
jscontact.CalendarContextWork: true,
},
Pref: 1,
Label: "main",
},
},
SchedulingAddresses: map[string]jscontact.SchedulingAddress{
"sa1": {
Type: jscontact.SchedulingAddressType,
Uri: "https://scheduling.example.com/@cdrummer/c1",
Contexts: map[jscontact.SchedulingAddressContext]bool{
jscontact.SchedulingAddressContextPrivate: true,
jscontact.SchedulingAddressContextWork: true,
},
Pref: 1,
Label: "main",
},
},
Addresses: map[string]jscontact.Address{
"ad1": {
Type: jscontact.AddressType,
Components: []jscontact.AddressComponent{
{
Kind: jscontact.AddressComponentKindNumber,
Value: "12",
},
{
Kind: jscontact.AddressComponentKindSeparator,
Value: " ",
},
{
Kind: jscontact.AddressComponentKindName,
Value: "Gravity Street",
},
{
Kind: jscontact.AddressComponentKindLocality,
Value: "Medina Station",
},
{
Kind: jscontact.AddressComponentKindRegion,
Value: "Outer Belt",
},
{
Kind: jscontact.AddressComponentKindSeparator,
Value: " ",
},
{
Kind: jscontact.AddressComponentKindPostcode,
Value: "618291",
},
{
Kind: jscontact.AddressComponentKindCountry,
Value: "Sol",
},
},
IsOrdered: true,
DefaultSeparator: ", ",
CountryCode: "SOL",
Coordinates: "geo:43.6466107,-79.3889872",
TimeZone: "EDT",
Contexts: map[jscontact.AddressContext]bool{
jscontact.AddressContextDelivery: true,
jscontact.AddressContextWork: true,
},
Full: "12 Gravity Street, Medina Station, Outer Belt 618291, Sol",
Pref: 1,
},
},
CryptoKeys: map[string]jscontact.CryptoKey{
"k1": {
Type: jscontact.CryptoKeyType,
Uri: "https://opa.org/keys/@cdrummer.gpg",
MediaType: "application/pgp-keys",
Contexts: map[jscontact.CryptoKeyContext]bool{
jscontact.CryptoKeyContextPrivate: true,
jscontact.CryptoKeyContextWork: true,
},
Pref: 10,
Label: "opa",
},
},
Directories: map[string]jscontact.Directory{
"d1": {
Type: jscontact.DirectoryType,
Kind: jscontact.DirectoryKindEntry,
Uri: "https://directory.opa.org/addrbook/cdrummer/Camina%20Drummer.vcf",
MediaType: "text/vcard",
},
"d2": {
Type: jscontact.DirectoryType,
Kind: jscontact.DirectoryKindDirectory,
Uri: "ldap://ldap.opa.org/o=OPA,ou=Bosmangs",
Pref: 1,
},
},
Links: map[string]jscontact.Link{
"l1": {
Type: jscontact.LinkType,
Kind: jscontact.LinkKindContact,
Uri: "mailto:contact@opa.org",
Pref: 1,
},
},
Media: map[string]jscontact.Media{
"m1": {
Type: jscontact.MediaType,
Kind: jscontact.MediaKindPhoto,
Uri: "https://static.wikia.nocookie.net/expanse/images/c/c7/Tycho-stn-14.png/revision/latest/scale-to-width-down/1000?cb=20170225140521",
MediaType: "image/png",
},
},
Anniversaries: map[string]jscontact.Anniversary{
"an1": {
Type: jscontact.AnniversaryType,
Kind: jscontact.AnniversaryKindBirth,
Date: jscontact.PartialDate{
Type: jscontact.PartialDateType,
Year: 1983,
Month: 7,
Day: 18,
CalendarScale: jscontact.RscaleIso8601,
},
},
},
Keywords: map[string]bool{
"bosmang": true,
"opa": true,
"tycho": true,
"rebel": true,
},
PersonalInfo: map[string]jscontact.PersonalInfo{
"p1": {
Type: jscontact.PersonalInfoType,
Kind: jscontact.PersonalInfoKindExpertise,
Value: "loyalty",
Level: jscontact.PersonalInfoLevelHigh,
},
},
Notes: map[string]jscontact.Note{
"n1": {
Type: jscontact.NoteType,
Created: mustParseTime("2025-09-30T11:00:12Z").UTC(),
Author: &jscontact.Author{
Type: jscontact.AuthorType,
Name: "expanse.fandom.com",
Uri: "https://expanse.fandom.com/wiki/Camina_Drummer_(TV)",
},
Note: "Cammina Drummer is a strong-willed, pragmatic, and no-nonsense Belter captain. Having a strong connection to her roots and her cultural identity, Drummer is a Belter through and through: She is resilient and adaptable, treats her crew with respect and equality, and is committed to the Belter way of life, which involves hard work, communal life shared with others, and not taking anything for granted.",
},
},
}
var AndersonDawesContact = jscontact.ContactCard{
Type: jscontact.ContactCardType,
Id: "cc2",
AddressBookIds: map[string]bool{
A1.Id: true,
},
Version: jscontact.JSContactVersion_1_0,
Created: mustParseTime("2025-09-30T11:00:12Z").UTC(),
Updated: mustParseTime("2025-09-30T11:00:12Z").UTC(),
Kind: jscontact.ContactCardKindIndividual,
Language: "en-GB",
ProdId: "Mock 0.0",
Uid: "3c1c478e-ac6c-4c2f-a01d-5e528015958d",
Name: &jscontact.Name{
Type: jscontact.NameType,
Components: []jscontact.NameComponent{
{
Type: jscontact.NameComponentType,
Kind: jscontact.NameComponentKindGiven,
Value: "Anderson",
},
{
Type: jscontact.NameComponentType,
Kind: jscontact.NameComponentKindSurname,
Value: "Dawes",
},
},
IsOrdered: true,
DefaultSeparator: " ",
Full: "Anderson Dawes",
},
Organizations: map[string]jscontact.Organization{
"o1": {
Type: jscontact.OrganizationType,
Name: "Outer Planets Alliance",
SortAs: "OPA",
Contexts: map[jscontact.OrganizationContext]bool{
jscontact.OrganizationContextWork: true,
},
},
},
SpeakToAs: &jscontact.SpeakToAs{
Type: jscontact.SpeakToAsType,
GrammaticalGender: jscontact.GrammaticalGenderMasculine,
Pronouns: map[string]jscontact.Pronouns{
"p1": {
Type: jscontact.PronounsType,
Pronouns: "he/him",
Contexts: map[jscontact.PronounsContext]bool{
jscontact.PronounsContextPrivate: true,
},
Pref: 1,
},
},
},
Titles: map[string]jscontact.Title{
"t1": {
Type: jscontact.TitleType,
Name: "President",
Kind: jscontact.TitleKindRole,
OrganizationId: "o1",
},
},
Emails: map[string]jscontact.EmailAddress{
"e1": {
Type: jscontact.EmailAddressType,
Address: "adawes@opa.org",
Contexts: map[jscontact.EmailAddressContext]bool{
jscontact.EmailAddressContextWork: true,
jscontact.EmailAddressContextPrivate: true,
},
Pref: 10,
Label: "opa",
},
},
OnlineServices: map[string]jscontact.OnlineService{
"s1": {
Type: jscontact.OnlineServiceType,
Service: "Ring Network",
Uri: "https://ring.example.com/contact/@adawes",
User: "@anderson.1882",
Contexts: map[jscontact.OnlineServiceContext]bool{
jscontact.OnlineServiceContextPrivate: true,
jscontact.OnlineServiceContextWork: true,
},
Label: "ring",
},
},
Phones: map[string]jscontact.Phone{
"p1": {
Type: jscontact.PhoneType,
Number: "+1-999-555-5678",
Features: map[jscontact.PhoneFeature]bool{
jscontact.PhoneFeatureMainNumber: true,
jscontact.PhoneFeatureMobile: true,
jscontact.PhoneFeatureVoice: true,
},
Contexts: map[jscontact.PhoneContext]bool{
jscontact.PhoneContextPrivate: true,
jscontact.PhoneContextWork: true,
},
},
},
PreferredLanguages: map[string]jscontact.LanguagePref{
"en": {
Type: jscontact.LanguagePrefType,
Language: "en-GB",
Contexts: map[jscontact.LanguagePrefContext]bool{
jscontact.LanguagePrefContextPrivate: true,
jscontact.LanguagePrefContextWork: true,
},
},
},
Calendars: map[string]jscontact.Calendar{
"c5": {
Type: jscontact.CalendarType,
Kind: jscontact.CalendarKindCalendar,
Uri: "https://ceres.org/calendars/@adawes/c5",
MediaType: "application/jscontact+json",
Contexts: map[jscontact.CalendarContext]bool{
jscontact.CalendarContextPrivate: true,
jscontact.CalendarContextWork: true,
},
},
},
SchedulingAddresses: map[string]jscontact.SchedulingAddress{
"sa1": {
Type: jscontact.SchedulingAddressType,
Uri: "mailto:adawes@opa.org",
Contexts: map[jscontact.SchedulingAddressContext]bool{
jscontact.SchedulingAddressContextPrivate: true,
jscontact.SchedulingAddressContextWork: true,
},
},
},
Addresses: map[string]jscontact.Address{
"ad1": {
Type: jscontact.AddressType,
Components: []jscontact.AddressComponent{
{
Kind: jscontact.AddressComponentKindNumber,
Value: "9218",
},
{
Kind: jscontact.AddressComponentKindSeparator,
Value: " ",
},
{
Kind: jscontact.AddressComponentKindName,
Value: "Main Street",
},
{
Kind: jscontact.AddressComponentKindLocality,
Value: "Ceres Station",
},
{
Kind: jscontact.AddressComponentKindSeparator,
Value: " ",
},
{
Kind: jscontact.AddressComponentKindPostcode,
Value: "87A",
},
{
Kind: jscontact.AddressComponentKindCountry,
Value: "Ceres",
},
},
IsOrdered: true,
DefaultSeparator: ", ",
CountryCode: "CRS",
Coordinates: "geo:43.6466107,-79.3889872",
TimeZone: "EDT",
Contexts: map[jscontact.AddressContext]bool{
jscontact.AddressContextWork: true,
},
},
},
CryptoKeys: map[string]jscontact.CryptoKey{
"k1": {
Type: jscontact.CryptoKeyType,
Uri: "https://opa.org/keys/@adawes.gpg",
MediaType: "application/pgp-keys",
Contexts: map[jscontact.CryptoKeyContext]bool{
jscontact.CryptoKeyContextPrivate: true,
jscontact.CryptoKeyContextWork: true,
},
},
},
Media: map[string]jscontact.Media{
"m1": {
Type: jscontact.MediaType,
Kind: jscontact.MediaKindPhoto,
Uri: "https://static.wikia.nocookie.net/expanse/images/0/0b/S02E07-JaredHarris_as_AndersonDawes_01c.jpg/revision/latest?cb=20170621040250",
MediaType: "image/png",
},
},
Anniversaries: map[string]jscontact.Anniversary{
"an1": {
Type: jscontact.AnniversaryType,
Kind: jscontact.AnniversaryKindBirth,
Date: jscontact.Timestamp{
Type: jscontact.TimestampType,
Utc: mustParseTime("1961-08-24T00:00:00Z"),
},
},
},
Keywords: map[string]bool{
"opa": true,
"ceres": true,
"rebel": true,
},
}
var AllAddressBooks = []jmap.AddressBook{A1, A2}
var ContactsMapByAddressBookId = map[string][]jscontact.ContactCard{
A1.Id: {
CaminaDrummerContact,
AndersonDawesContact,
},
A2.Id: {
CaminaDrummerContact,
},
}

View File

@@ -1,6 +1,8 @@
package groupware
import (
"time"
"github.com/opencloud-eu/opencloud/pkg/jmap"
"github.com/opencloud-eu/opencloud/pkg/jscalendar"
)
@@ -203,3 +205,11 @@ var TaskMapByTaskListId = map[string][]jmap.Task{
T1,
},
}
func mustParseTime(text string) time.Time {
t, err := time.Parse(time.RFC3339, text)
if err != nil {
panic(err)
}
return t
}