1 import { HttpResponse, http } from 'msw';
3 import { DEFAULT_MAILSETTINGS } from '@proton/shared/lib/mail/mailSettings';
5 import { addressBuilder, calendarBuilder, calendarEventBuilder, userBuilder } from './builders';
7 export const getHandlers = () => [
8 http.get('/addresses', () => {
9 return HttpResponse.json({
10 Addresses: [addressBuilder()],
14 http.get(`/calendar/v1/:calendarId/events/:eventId`, () => {
15 return HttpResponse.json({
16 Event: calendarEventBuilder(),
19 http.get(`/calendar/v1`, () => {
20 return HttpResponse.json({
21 Calendars: [calendarBuilder()],
24 http.get(`/calendar/v1/events`, () => {
25 return HttpResponse.json({
29 http.get(`/users`, () => {
30 return HttpResponse.json({
34 http.get(`/settings/calendar`, () => {
35 return HttpResponse.json({
36 CalendarUserSettings: {
42 AutoDetectPrimaryTimezone: 1,
43 PrimaryTimezone: 'Europe/Zurich',
44 DisplaySecondaryTimezone: 0,
45 SecondaryTimezone: null,
48 '8DqHHGgVZgEb9KJ0En3mhktAcUBNlAEfGdp5-KnBy2WedZq2Th_gBhphVfcSITxDpz914-LvghzmLf5dhOB5HQ==',
55 http.get(`/contacts/v4/contacts/emails`, () => {
56 return HttpResponse.json({
60 http.get(`/calendar/v1/:calendarId/bootstrap`, () => {
61 return HttpResponse.json({
64 ID: '8DqHHGgVZgEb9KJ0En3mhktAcUBNlAEfGdp5-KnBy2WedZq2Th_gBhphVfcSITxDpz914-LvghzmLf5dhOB5HQ==',
66 '-----BEGIN PGP PRIVATE KEY BLOCK-----\nVersion: ProtonMail\n\nxYYEYZYvsxYJKwYBBAHaRw8BAQdA5OCfLNgBD9N1o+rbYZ+T0cebDmXdqID9\nztWaA1Ks6g/+CQMIW87X8JxZQJZgbrTx1CiT3KHTzu6OPHyodLoBFTHsxuUk\nSH/QffB34h5ZcqBwjKXMXAxSUvSYoq3hA3SDpHWiYvpzVrXQGQPn6Z7nCvyu\njM0MQ2FsZW5kYXIga2V5wo8EEBYKACAFAmGWL7MGCwkHCAMCBBUICgIEFgIB\nAAIZAQIbA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rxoejL0mQBV6qx9TtuDAvOFIEy0EXEsY2QKg8QjAsz01siPoYLXOV3xJm6\nwD8U72xxxxvoMtIsx5OmmQYDzqpFTasZCgGJxsCo/y/tI+089KPjjC1YRHKG\ng6uJr+BnQrv7vsi65+AjRgmW\n=znTY\n-----END PGP MESSAGE-----\n',
84 '-----BEGIN PGP SIGNATURE-----\nVersion: ProtonMail\n\nwnUEARYKAAYFAmGWL+8AIQkQ1oODHu7bPjIWIQTbrouLuU2xuMzp19LWg4Me\n7ts+MialAQCWwcs4GNahH4ZwGLxoQ5zpFCcieySg9sg1fYoSJXdYLAEApOc2\nxmZLBSMdpd4QrfWp2IhIyro6bO4s6NFRhElLmAw=\n=n64B\n-----END PGP SIGNATURE-----\n',
87 CalendarID: '8DqHHGgVZgEb9KJ0En3mhktAcUBNlAEfGdp5-KnBy2WedZq2Th_gBhphVfcSITxDpz914-LvghzmLf5dhOB5HQ==',
91 ID: '8DqHHGgVZgEb9KJ0En3mhktAcUBNlAEfGdp5-KnBy2WedZq2Th_gBhphVfcSITxDpz914-LvghzmLf5dhOB5HQ==',
93 Email: 'stest1@proton.black',
95 'Lw5suur9q0eTrcp-ufF41Ar7WNj5FQQFz_iKVcCD8khv0eVLJ8MPyx9oiI1XfZJ3JVuTmpG2dgOIY2zCCrIVIw==',
97 '8DqHHGgVZgEb9KJ0En3mhktAcUBNlAEfGdp5-KnBy2WedZq2Th_gBhphVfcSITxDpz914-LvghzmLf5dhOB5HQ==',
103 ID: '8DqHHGgVZgEb9KJ0En3mhktAcUBNlAEfGdp5-KnBy2WedZq2Th_gBhphVfcSITxDpz914-LvghzmLf5dhOB5HQ==',
104 CalendarID: '8DqHHGgVZgEb9KJ0En3mhktAcUBNlAEfGdp5-KnBy2WedZq2Th_gBhphVfcSITxDpz914-LvghzmLf5dhOB5HQ==',
105 DefaultEventDuration: 30,
106 DefaultPartDayNotifications: [
112 DefaultFullDayNotifications: [
121 http.get(`/mail/v4/settings`, () => {
122 return HttpResponse.json({
123 MailSettings: DEFAULT_MAILSETTINGS,