@ebarooni/capacitor-calendar 8.10.0 → 8.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +94 -54
  2. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +18 -0
  3. package/android/src/main/java/dev/barooni/capacitor/calendar/PluginError.kt +4 -0
  4. package/android/src/main/java/dev/barooni/capacitor/calendar/implementation/CapacitorCalendar.kt +128 -2
  5. package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/EventRecurrenceRule.kt +4 -3
  6. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/GetEventByIdInput.kt +13 -0
  7. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ListEventsInRangeInput.kt +5 -0
  8. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/GetEventByIdResult.kt +15 -0
  9. package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/ListEventsInRangeResult.kt +47 -43
  10. package/android/src/main/java/dev/barooni/capacitor/calendar/utils/ImplementationHelper.kt +35 -2
  11. package/dist/docs.json +204 -6
  12. package/dist/esm/index.d.ts +4 -1
  13. package/dist/esm/index.js.map +1 -1
  14. package/dist/esm/schemas/interfaces/delete-event-options.d.ts +2 -1
  15. package/dist/esm/schemas/interfaces/delete-event-options.js.map +1 -1
  16. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.d.ts +2 -1
  17. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.js.map +1 -1
  18. package/dist/esm/schemas/interfaces/get-event-by-id-options.d.ts +11 -0
  19. package/dist/esm/schemas/interfaces/get-event-by-id-options.js +2 -0
  20. package/dist/esm/schemas/interfaces/get-event-by-id-options.js.map +1 -0
  21. package/dist/esm/schemas/interfaces/get-event-by-id-result.d.ts +13 -0
  22. package/dist/esm/schemas/interfaces/get-event-by-id-result.js +2 -0
  23. package/dist/esm/schemas/interfaces/get-event-by-id-result.js.map +1 -0
  24. package/dist/esm/schemas/interfaces/list-events-in-range-options.d.ts +8 -0
  25. package/dist/esm/schemas/interfaces/list-events-in-range-options.js.map +1 -1
  26. package/dist/esm/schemas/interfaces/modify-event-options.d.ts +11 -0
  27. package/dist/esm/schemas/interfaces/modify-event-options.js.map +1 -1
  28. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.d.ts +10 -0
  29. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.js.map +1 -1
  30. package/dist/esm/sub-definitions/event-operations.d.ts +33 -0
  31. package/dist/esm/sub-definitions/event-operations.js.map +1 -1
  32. package/dist/esm/web.d.ts +3 -0
  33. package/dist/esm/web.js +3 -0
  34. package/dist/esm/web.js.map +1 -1
  35. package/dist/plugin.cjs.js +3 -0
  36. package/dist/plugin.cjs.js.map +1 -1
  37. package/dist/plugin.js +3 -0
  38. package/dist/plugin.js.map +1 -1
  39. package/ios/Plugin/CapacitorCalendarPlugin.swift +17 -1
  40. package/ios/Plugin/Implementation/CapacitorCalendar.swift +41 -7
  41. package/ios/Plugin/Models/Inputs/CreateEventInput.swift +1 -1
  42. package/ios/Plugin/Models/Inputs/CreateEventWithPromptInput.swift +61 -70
  43. package/ios/Plugin/Models/Inputs/DeleteEventInput.swift +7 -0
  44. package/ios/Plugin/Models/Inputs/DeleteEventWithPromptInput.swift +7 -0
  45. package/ios/Plugin/Models/Inputs/GetEventByIdInput.swift +16 -0
  46. package/ios/Plugin/Models/Inputs/ListEventsInRangeInput.swift +20 -0
  47. package/ios/Plugin/Models/Inputs/ModifyEventInput.swift +13 -23
  48. package/ios/Plugin/Models/Inputs/ModifyEventWithPromptInput.swift +10 -5
  49. package/ios/Plugin/Models/Results/GetEventByIdResult.swift +27 -0
  50. package/ios/Plugin/Models/Structs/RecurrenceInput.swift +14 -0
  51. package/ios/Plugin/PluginConfig.swift +1 -0
  52. package/ios/Plugin/PluginError.swift +7 -0
  53. package/ios/Plugin/Utils/ImplementationHelper.swift +33 -2
  54. package/package.json +1 -1
@@ -19,4 +19,12 @@ export interface ListEventsInRangeOptions {
19
19
  * @since 7.1.0
20
20
  */
21
21
  to: number;
22
+ /**
23
+ * Ids of the calendars to search. When omitted or empty, all calendars are searched.
24
+ * Rejects if an id does not match a calendar.
25
+ *
26
+ * @example ["1", "2"]
27
+ * @since 8.11.0
28
+ */
29
+ calendarIds?: string[];
22
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list-events-in-range-options.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/list-events-in-range-options.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @since 7.1.0\n */\nexport interface ListEventsInRangeOptions {\n /**\n * The start of the range, in milliseconds since the epoch.\n * Events still in progress at this time are included.\n *\n * @example 1719792000000\n * @since 7.1.0\n */\n from: number;\n /**\n * The end of the range, in milliseconds since the epoch.\n * Events that begin at or after this time are typically excluded; prefer the\n * next day's start when querying a single calendar day.\n *\n * @example 1719878400000\n * @since 7.1.0\n */\n to: number;\n}\n"]}
1
+ {"version":3,"file":"list-events-in-range-options.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/list-events-in-range-options.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @since 7.1.0\n */\nexport interface ListEventsInRangeOptions {\n /**\n * The start of the range, in milliseconds since the epoch.\n * Events still in progress at this time are included.\n *\n * @example 1719792000000\n * @since 7.1.0\n */\n from: number;\n /**\n * The end of the range, in milliseconds since the epoch.\n * Events that begin at or after this time are typically excluded; prefer the\n * next day's start when querying a single calendar day.\n *\n * @example 1719878400000\n * @since 7.1.0\n */\n to: number;\n /**\n * Ids of the calendars to search. When omitted or empty, all calendars are searched.\n * Rejects if an id does not match a calendar.\n *\n * @example [\"1\", \"2\"]\n * @since 8.11.0\n */\n calendarIds?: string[];\n}\n"]}
@@ -69,6 +69,17 @@ export interface ModifyEventOptions {
69
69
  * @since 7.1.0
70
70
  */
71
71
  id: string;
72
+ /**
73
+ * The start time of the occurrence to modify, in milliseconds since the epoch.
74
+ * Use `startDate` from `listEventsInRange`.
75
+ * If omitted, the first occurrence of a recurring series is the target.
76
+ * The call rejects when `recurrence` is also set and `span` is `THIS_EVENT`. Use `THIS_AND_FUTURE_EVENTS` to change the rule from this occurrence.
77
+ *
78
+ * @example 1716153600000
79
+ * @platform iOS
80
+ * @since 8.11.0
81
+ */
82
+ instanceDate?: number;
72
83
  /**
73
84
  * @platform Android, iOS
74
85
  * @since 0.1.0
@@ -1 +1 @@
1
- {"version":3,"file":"modify-event-options.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/modify-event-options.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventAvailability } from '../enums/event-availability';\nimport type { EventSpan } from '../enums/event-span';\n\nimport type { EventGuest } from './event-guest';\nimport type { EventRecurrenceRule } from './event-recurrence-rule';\n\n/**\n * @since 7.1.0\n */\nexport interface ModifyEventOptions {\n /**\n * Alert times in minutes relative to the event start.\n * Use negative numbers for alerts before the start, and positive numbers for alerts after the start.\n *\n * @example\n * // -1440 -> 1 day before\n * // -60 -> 1 hour before\n * // 30 -> 30 minutes after\n * [-1440, -60, 30]\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n alerts?: number[];\n /**\n * The event guests.\n *\n * @platform Android\n * @since 7.1.0\n */\n attendees?: EventGuest[];\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n availability?: EventAvailability;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n calendarId?: string;\n /**\n * @example #6750A4\n * @platform Android\n * @since 7.1.0\n */\n color?: string;\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n description?: string;\n /**\n * Duration of the event in RFC2445 format.\n *\n * @example P1D (1 day), P3W (3 weeks), P2DT4H30M (2 days, 4 hours, and 30 minutes).\n * @platform Android\n * @see {@link https://datatracker.ietf.org/doc/html/rfc2445}\n * @since 7.1.0\n */\n duration?: string;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n endDate?: number;\n /**\n * The ID of the event to be modified.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n id: string;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n isAllDay?: boolean;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n location?: string;\n /**\n * Rules for creating a recurring event.\n *\n * @platform Android, iOS\n * @since 7.3.0\n */\n recurrence?: EventRecurrenceRule;\n /**\n * Email of the event organizer.\n *\n * @platform Android\n * @since 7.1.0\n */\n organizer?: string;\n /**\n * The span of modifications.\n *\n * @default EventSpan.THIS_EVENT\n * @platform iOS\n * @see 7.1.0\n */\n span?: EventSpan;\n /**\n *\n * @platform Android, iOS\n * @since 0.1.0\n */\n startDate?: number;\n /**\n * @platform Android, iOS\n * @since 0.4.0\n */\n title?: string;\n /**\n * @platform iOS\n * @since 0.1.0\n */\n url?: string;\n}\n"]}
1
+ {"version":3,"file":"modify-event-options.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/modify-event-options.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventAvailability } from '../enums/event-availability';\nimport type { EventSpan } from '../enums/event-span';\n\nimport type { EventGuest } from './event-guest';\nimport type { EventRecurrenceRule } from './event-recurrence-rule';\n\n/**\n * @since 7.1.0\n */\nexport interface ModifyEventOptions {\n /**\n * Alert times in minutes relative to the event start.\n * Use negative numbers for alerts before the start, and positive numbers for alerts after the start.\n *\n * @example\n * // -1440 -> 1 day before\n * // -60 -> 1 hour before\n * // 30 -> 30 minutes after\n * [-1440, -60, 30]\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n alerts?: number[];\n /**\n * The event guests.\n *\n * @platform Android\n * @since 7.1.0\n */\n attendees?: EventGuest[];\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n availability?: EventAvailability;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n calendarId?: string;\n /**\n * @example #6750A4\n * @platform Android\n * @since 7.1.0\n */\n color?: string;\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n description?: string;\n /**\n * Duration of the event in RFC2445 format.\n *\n * @example P1D (1 day), P3W (3 weeks), P2DT4H30M (2 days, 4 hours, and 30 minutes).\n * @platform Android\n * @see {@link https://datatracker.ietf.org/doc/html/rfc2445}\n * @since 7.1.0\n */\n duration?: string;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n endDate?: number;\n /**\n * The ID of the event to be modified.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n id: string;\n /**\n * The start time of the occurrence to modify, in milliseconds since the epoch.\n * Use `startDate` from `listEventsInRange`.\n * If omitted, the first occurrence of a recurring series is the target.\n * The call rejects when `recurrence` is also set and `span` is `THIS_EVENT`. Use `THIS_AND_FUTURE_EVENTS` to change the rule from this occurrence.\n *\n * @example 1716153600000\n * @platform iOS\n * @since 8.11.0\n */\n instanceDate?: number;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n isAllDay?: boolean;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n location?: string;\n /**\n * Rules for creating a recurring event.\n *\n * @platform Android, iOS\n * @since 7.3.0\n */\n recurrence?: EventRecurrenceRule;\n /**\n * Email of the event organizer.\n *\n * @platform Android\n * @since 7.1.0\n */\n organizer?: string;\n /**\n * The span of modifications.\n *\n * @default EventSpan.THIS_EVENT\n * @platform iOS\n * @see 7.1.0\n */\n span?: EventSpan;\n /**\n *\n * @platform Android, iOS\n * @since 0.1.0\n */\n startDate?: number;\n /**\n * @platform Android, iOS\n * @since 0.4.0\n */\n title?: string;\n /**\n * @platform iOS\n * @since 0.1.0\n */\n url?: string;\n}\n"]}
@@ -46,6 +46,16 @@ export interface ModifyEventWithPromptOptions {
46
46
  * @since 7.1.0
47
47
  */
48
48
  id: string;
49
+ /**
50
+ * The start time of the occurrence to modify, in milliseconds since the epoch.
51
+ * Use `startDate` from `listEventsInRange`.
52
+ * If omitted, the first occurrence of a recurring series is the target.
53
+ *
54
+ * @example 1716153600000
55
+ * @platform iOS
56
+ * @since 8.11.0
57
+ */
58
+ instanceDate?: number;
49
59
  /**
50
60
  * An array of emails to invite.
51
61
  *
@@ -1 +1 @@
1
- {"version":3,"file":"modify-event-with-prompt-options.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/modify-event-with-prompt-options.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventAvailability } from '../enums/event-availability';\n\nimport type { EventRecurrenceRule } from './event-recurrence-rule';\n\n/**\n * @since 7.1.0\n */\nexport interface ModifyEventWithPromptOptions {\n /**\n * Alert times in minutes relative to the event start.\n * Use negative numbers for reminders before the start, and positive numbers for reminders after the start.\n * On iOS only 2 alerts are supported.\n *\n * @example\n * // -1440 -> 1 day before\n * // -60 -> 1 hour before\n * // 30 -> 30 minutes after\n * [-1440, -60, 30]\n *\n * @platform iOS\n * @since 7.1.0\n */\n alerts?: number[];\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n availability?: EventAvailability;\n /**\n * @platform iOS\n * @since 0.1.0\n */\n calendarId?: string;\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n description?: string;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n endDate?: number;\n /**\n * The ID of the event to be modified.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n id: string;\n /**\n * An array of emails to invite.\n *\n * @platform Android\n * @since 7.1.0\n */\n invitees?: string[];\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n isAllDay?: boolean;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n location?: string;\n /**\n * Rules for creating a recurring event.\n *\n * @platform Android, iOS\n * @since 7.3.0\n */\n recurrence?: EventRecurrenceRule;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n startDate?: number;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n title?: string;\n /**\n * @platform iOS\n * @since 0.1.0\n */\n url?: string;\n}\n"]}
1
+ {"version":3,"file":"modify-event-with-prompt-options.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/modify-event-with-prompt-options.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventAvailability } from '../enums/event-availability';\n\nimport type { EventRecurrenceRule } from './event-recurrence-rule';\n\n/**\n * @since 7.1.0\n */\nexport interface ModifyEventWithPromptOptions {\n /**\n * Alert times in minutes relative to the event start.\n * Use negative numbers for reminders before the start, and positive numbers for reminders after the start.\n * On iOS only 2 alerts are supported.\n *\n * @example\n * // -1440 -> 1 day before\n * // -60 -> 1 hour before\n * // 30 -> 30 minutes after\n * [-1440, -60, 30]\n *\n * @platform iOS\n * @since 7.1.0\n */\n alerts?: number[];\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n availability?: EventAvailability;\n /**\n * @platform iOS\n * @since 0.1.0\n */\n calendarId?: string;\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n description?: string;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n endDate?: number;\n /**\n * The ID of the event to be modified.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n id: string;\n /**\n * The start time of the occurrence to modify, in milliseconds since the epoch.\n * Use `startDate` from `listEventsInRange`.\n * If omitted, the first occurrence of a recurring series is the target.\n *\n * @example 1716153600000\n * @platform iOS\n * @since 8.11.0\n */\n instanceDate?: number;\n /**\n * An array of emails to invite.\n *\n * @platform Android\n * @since 7.1.0\n */\n invitees?: string[];\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n isAllDay?: boolean;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n location?: string;\n /**\n * Rules for creating a recurring event.\n *\n * @platform Android, iOS\n * @since 7.3.0\n */\n recurrence?: EventRecurrenceRule;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n startDate?: number;\n /**\n * @platform Android, iOS\n * @since 0.1.0\n */\n title?: string;\n /**\n * @platform iOS\n * @since 0.1.0\n */\n url?: string;\n}\n"]}
@@ -5,6 +5,8 @@ import type { CreateEventWithPromptResult } from '../schemas/interfaces/create-e
5
5
  import type { DeleteEventOptions } from '../schemas/interfaces/delete-event-options';
6
6
  import type { DeleteEventWithPromptOptions } from '../schemas/interfaces/delete-event-with-prompt-options';
7
7
  import type { DeleteEventsByIdOptions } from '../schemas/interfaces/delete-events-by-id-options';
8
+ import type { GetEventByIdOptions } from '../schemas/interfaces/get-event-by-id-options';
9
+ import type { GetEventByIdResult } from '../schemas/interfaces/get-event-by-id-result';
8
10
  import type { ListEventsInRangeOptions } from '../schemas/interfaces/list-events-in-range-options';
9
11
  import type { ListEventsInRangeResult } from '../schemas/interfaces/list-events-in-range-result';
10
12
  import type { ModifyEventOptions } from '../schemas/interfaces/modify-event-options';
@@ -24,6 +26,9 @@ export interface EventOperations {
24
26
  * }
25
27
  * await CapacitorCalendar.createEventWithPrompt(options)
26
28
  *
29
+ * @throws {Error} `Frequency must be provided.` — when `recurrence` is set without `frequency` (Android, iOS).
30
+ * @throws {Error} `Invalid frequency.` — when `recurrence.frequency` is not a supported value (Android, iOS).
31
+ *
27
32
  * @platform Android, iOS, Web
28
33
  * @since 0.1.0
29
34
  */
@@ -39,6 +44,10 @@ export interface EventOperations {
39
44
  * }
40
45
  * await CapacitorCalendar.modifyEventWithPrompt(options);
41
46
  *
47
+ * @throws {Error} `Event not found.` — when no event exists for `id`, or no occurrence starts at `instanceDate` (iOS).
48
+ * @throws {Error} `Frequency must be provided.` — when `recurrence` is set without `frequency`.
49
+ * @throws {Error} `Invalid frequency.` — when `recurrence.frequency` is not a supported value.
50
+ *
42
51
  * @platform Android, iOS
43
52
  * @since 6.6.0
44
53
  */
@@ -58,12 +67,21 @@ export interface EventOperations {
58
67
  * autoDownloadIcsFile: true,
59
68
  * });
60
69
  *
70
+ * @throws {Error} `Frequency must be provided.` — when `recurrence` is set without `frequency` (Android, iOS).
71
+ * @throws {Error} `Invalid frequency.` — when `recurrence.frequency` is not a supported value (Android, iOS).
72
+ *
61
73
  * @platform Android, iOS, Web
62
74
  * @since 0.4.0
63
75
  */
64
76
  createEvent(options: CreateEventOptions): Promise<CreateEventResult>;
65
77
  /**
66
78
  * Modifies an event.
79
+ * Fields that you omit keep their current values.
80
+ *
81
+ * @throws {Error} `Event not found.` — when no event exists for `id`, or no occurrence starts at `instanceDate` (iOS).
82
+ * @throws {Error} `Frequency must be provided.` — when `recurrence` is set without `frequency`.
83
+ * @throws {Error} `Invalid frequency.` — when `recurrence.frequency` is not a supported value.
84
+ * @throws {Error} `Recurrence cannot be changed for a single occurrence. Use THIS_AND_FUTURE_EVENTS.` — when `recurrence` is set with `instanceDate` and `THIS_EVENT` on a recurring event (iOS).
67
85
  *
68
86
  * @platform Android, iOS
69
87
  * @since 6.6.0
@@ -82,6 +100,7 @@ export interface EventOperations {
82
100
  /**
83
101
  * Deletes an event.
84
102
  *
103
+ * @throws {Error} `Event not found.` — when no event exists for `id`, or no occurrence starts at `instanceDate` (iOS).
85
104
  * @platform Android, iOS
86
105
  * @since 7.1.0
87
106
  */
@@ -89,6 +108,7 @@ export interface EventOperations {
89
108
  /**
90
109
  * Opens a dialog to delete an event.
91
110
  *
111
+ * @throws {Error} `Event not found.` — when no event exists for `id`, or no occurrence starts at `instanceDate` (iOS).
92
112
  * @platform Android, iOS
93
113
  * @since 7.1.0
94
114
  */
@@ -100,6 +120,7 @@ export interface EventOperations {
100
120
  *
101
121
  * An event is included when its time interval intersects `[from, to]`, including
102
122
  * multi-day events that span the range without starting or ending inside it.
123
+ * Pass `calendarIds` to search only some calendars.
103
124
  *
104
125
  * @example
105
126
  * const startOfDay = new Date();
@@ -116,6 +137,18 @@ export interface EventOperations {
116
137
  * @since 0.10.0
117
138
  */
118
139
  listEventsInRange(options: ListEventsInRangeOptions): Promise<ListEventsInRangeResult>;
140
+ /**
141
+ * Retrieves an event by id.
142
+ *
143
+ * For a recurring event, the result is the first occurrence on iOS and the series master on Android.
144
+ *
145
+ * @example
146
+ * const { event } = await CapacitorCalendar.getEventById({ id: eventId });
147
+ *
148
+ * @platform Android, iOS
149
+ * @since 8.11.0
150
+ */
151
+ getEventById(options: GetEventByIdOptions): Promise<GetEventByIdResult>;
119
152
  }
120
153
  /**
121
154
  * @since 7.1.0
@@ -1 +1 @@
1
- {"version":3,"file":"event-operations.js","sourceRoot":"","sources":["../../../src/sub-definitions/event-operations.ts"],"names":[],"mappings":"","sourcesContent":["import type { CreateEventOptions } from '../schemas/interfaces/create-event-options';\nimport type { CreateEventResult } from '../schemas/interfaces/create-event-result';\nimport type { CreateEventWithPromptOptions } from '../schemas/interfaces/create-event-with-prompt-options';\nimport type { CreateEventWithPromptResult } from '../schemas/interfaces/create-event-with-prompt-result';\nimport type { DeleteEventOptions } from '../schemas/interfaces/delete-event-options';\nimport type { DeleteEventWithPromptOptions } from '../schemas/interfaces/delete-event-with-prompt-options';\nimport type { DeleteEventsByIdOptions } from '../schemas/interfaces/delete-events-by-id-options';\nimport type { ListEventsInRangeOptions } from '../schemas/interfaces/list-events-in-range-options';\nimport type { ListEventsInRangeResult } from '../schemas/interfaces/list-events-in-range-result';\nimport type { ModifyEventOptions } from '../schemas/interfaces/modify-event-options';\nimport type { ModifyEventWithPromptOptions } from '../schemas/interfaces/modify-event-with-prompt-options';\nimport type { EventEditAction } from '../schemas/types/event-edit-action';\n\nexport interface EventOperations {\n /**\n * Opens a calendar UI to create an event.\n * On Android and iOS, opens the system editor. On Android, `id` is always `null`.\n * On Web, shows a confirm dialog, then builds an `.ics` `File` when the user confirms.\n * See MCP `docs://web-behavior` for Web details.\n *\n * @example\n * const options = {\n * title: 'Test event',\n * startDate: Date.now(),\n * }\n * await CapacitorCalendar.createEventWithPrompt(options)\n *\n * @platform Android, iOS, Web\n * @since 0.1.0\n */\n createEventWithPrompt(options?: CreateEventWithPromptOptions): Promise<CreateEventWithPromptResult>;\n /**\n * Opens a system calendar interface to modify an event.\n * On Android always returns `null`.\n *\n * @example\n * const options = {\n * id: 'EVENT_ID',\n * title: 'New title',\n * }\n * await CapacitorCalendar.modifyEventWithPrompt(options);\n *\n * @platform Android, iOS\n * @since 6.6.0\n */\n modifyEventWithPrompt(options: ModifyEventWithPromptOptions): Promise<{ result: EventEditAction | null }>;\n /**\n * Creates an event in the calendar.\n * On Android and iOS, inserts into the system calendar and returns its `id`.\n * On Web, builds an `.ics` `File` as `ics` (no calendar store). See MCP `docs://web-behavior`.\n *\n * @example\n * const { id, ics } = await CapacitorCalendar.createEvent({\n * title: 'Team standup',\n * startDate: Date.now(),\n * icsFileName: 'team-standup.ics',\n * autoDownloadIcsFile: true,\n * });\n *\n * @platform Android, iOS, Web\n * @since 0.4.0\n */\n createEvent(options: CreateEventOptions): Promise<CreateEventResult>;\n /**\n * Modifies an event.\n *\n * @platform Android, iOS\n * @since 6.6.0\n */\n modifyEvent(options: ModifyEventOptions): Promise<void>;\n /**\n * Deletes multiple events.\n *\n * @deprecated Use `deleteEvent(...)`.\n * @platform Android, iOS\n * @since 0.11.0\n */\n deleteEventsById(options: DeleteEventsByIdOptions): Promise<{ result: DeleteEventsByIdResult }>;\n /**\n * Deletes an event.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n deleteEvent(options: DeleteEventOptions): Promise<void>;\n /**\n * Opens a dialog to delete an event.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n deleteEventWithPrompt(options: DeleteEventWithPromptOptions): Promise<{ deleted: boolean }>;\n /**\n * Retrieves events that overlap a date range.\n *\n * An event is included when its time interval intersects `[from, to]`, including\n * multi-day events that span the range without starting or ending inside it.\n *\n * @example\n * const startOfDay = new Date();\n * startOfDay.setHours(0, 0, 0, 0);\n * const startOfNextDay = new Date(startOfDay);\n * startOfNextDay.setDate(startOfNextDay.getDate() + 1);\n *\n * const { result } = await CapacitorCalendar.listEventsInRange({\n * from: startOfDay.getTime(),\n * to: startOfNextDay.getTime(),\n * });\n *\n * @platform Android, iOS\n * @since 0.10.0\n */\n listEventsInRange(options: ListEventsInRangeOptions): Promise<ListEventsInRangeResult>;\n}\n\n/**\n * @since 7.1.0\n */\nexport interface DeleteEventsByIdResult {\n /**\n * @since 7.1.0\n */\n deleted: string[];\n /**\n * @since 7.1.0\n */\n failed: string[];\n}\n"]}
1
+ {"version":3,"file":"event-operations.js","sourceRoot":"","sources":["../../../src/sub-definitions/event-operations.ts"],"names":[],"mappings":"","sourcesContent":["import type { CreateEventOptions } from '../schemas/interfaces/create-event-options';\nimport type { CreateEventResult } from '../schemas/interfaces/create-event-result';\nimport type { CreateEventWithPromptOptions } from '../schemas/interfaces/create-event-with-prompt-options';\nimport type { CreateEventWithPromptResult } from '../schemas/interfaces/create-event-with-prompt-result';\nimport type { DeleteEventOptions } from '../schemas/interfaces/delete-event-options';\nimport type { DeleteEventWithPromptOptions } from '../schemas/interfaces/delete-event-with-prompt-options';\nimport type { DeleteEventsByIdOptions } from '../schemas/interfaces/delete-events-by-id-options';\nimport type { GetEventByIdOptions } from '../schemas/interfaces/get-event-by-id-options';\nimport type { GetEventByIdResult } from '../schemas/interfaces/get-event-by-id-result';\nimport type { ListEventsInRangeOptions } from '../schemas/interfaces/list-events-in-range-options';\nimport type { ListEventsInRangeResult } from '../schemas/interfaces/list-events-in-range-result';\nimport type { ModifyEventOptions } from '../schemas/interfaces/modify-event-options';\nimport type { ModifyEventWithPromptOptions } from '../schemas/interfaces/modify-event-with-prompt-options';\nimport type { EventEditAction } from '../schemas/types/event-edit-action';\n\nexport interface EventOperations {\n /**\n * Opens a calendar UI to create an event.\n * On Android and iOS, opens the system editor. On Android, `id` is always `null`.\n * On Web, shows a confirm dialog, then builds an `.ics` `File` when the user confirms.\n * See MCP `docs://web-behavior` for Web details.\n *\n * @example\n * const options = {\n * title: 'Test event',\n * startDate: Date.now(),\n * }\n * await CapacitorCalendar.createEventWithPrompt(options)\n *\n * @throws {Error} `Frequency must be provided.` — when `recurrence` is set without `frequency` (Android, iOS).\n * @throws {Error} `Invalid frequency.` — when `recurrence.frequency` is not a supported value (Android, iOS).\n *\n * @platform Android, iOS, Web\n * @since 0.1.0\n */\n createEventWithPrompt(options?: CreateEventWithPromptOptions): Promise<CreateEventWithPromptResult>;\n /**\n * Opens a system calendar interface to modify an event.\n * On Android always returns `null`.\n *\n * @example\n * const options = {\n * id: 'EVENT_ID',\n * title: 'New title',\n * }\n * await CapacitorCalendar.modifyEventWithPrompt(options);\n *\n * @throws {Error} `Event not found.` — when no event exists for `id`, or no occurrence starts at `instanceDate` (iOS).\n * @throws {Error} `Frequency must be provided.` — when `recurrence` is set without `frequency`.\n * @throws {Error} `Invalid frequency.` — when `recurrence.frequency` is not a supported value.\n *\n * @platform Android, iOS\n * @since 6.6.0\n */\n modifyEventWithPrompt(options: ModifyEventWithPromptOptions): Promise<{ result: EventEditAction | null }>;\n /**\n * Creates an event in the calendar.\n * On Android and iOS, inserts into the system calendar and returns its `id`.\n * On Web, builds an `.ics` `File` as `ics` (no calendar store). See MCP `docs://web-behavior`.\n *\n * @example\n * const { id, ics } = await CapacitorCalendar.createEvent({\n * title: 'Team standup',\n * startDate: Date.now(),\n * icsFileName: 'team-standup.ics',\n * autoDownloadIcsFile: true,\n * });\n *\n * @throws {Error} `Frequency must be provided.` — when `recurrence` is set without `frequency` (Android, iOS).\n * @throws {Error} `Invalid frequency.` — when `recurrence.frequency` is not a supported value (Android, iOS).\n *\n * @platform Android, iOS, Web\n * @since 0.4.0\n */\n createEvent(options: CreateEventOptions): Promise<CreateEventResult>;\n /**\n * Modifies an event.\n * Fields that you omit keep their current values.\n *\n * @throws {Error} `Event not found.` — when no event exists for `id`, or no occurrence starts at `instanceDate` (iOS).\n * @throws {Error} `Frequency must be provided.` — when `recurrence` is set without `frequency`.\n * @throws {Error} `Invalid frequency.` — when `recurrence.frequency` is not a supported value.\n * @throws {Error} `Recurrence cannot be changed for a single occurrence. Use THIS_AND_FUTURE_EVENTS.` — when `recurrence` is set with `instanceDate` and `THIS_EVENT` on a recurring event (iOS).\n *\n * @platform Android, iOS\n * @since 6.6.0\n */\n modifyEvent(options: ModifyEventOptions): Promise<void>;\n /**\n * Deletes multiple events.\n *\n * @deprecated Use `deleteEvent(...)`.\n * @platform Android, iOS\n * @since 0.11.0\n */\n deleteEventsById(options: DeleteEventsByIdOptions): Promise<{ result: DeleteEventsByIdResult }>;\n /**\n * Deletes an event.\n *\n * @throws {Error} `Event not found.` — when no event exists for `id`, or no occurrence starts at `instanceDate` (iOS).\n * @platform Android, iOS\n * @since 7.1.0\n */\n deleteEvent(options: DeleteEventOptions): Promise<void>;\n /**\n * Opens a dialog to delete an event.\n *\n * @throws {Error} `Event not found.` — when no event exists for `id`, or no occurrence starts at `instanceDate` (iOS).\n * @platform Android, iOS\n * @since 7.1.0\n */\n deleteEventWithPrompt(options: DeleteEventWithPromptOptions): Promise<{ deleted: boolean }>;\n /**\n * Retrieves events that overlap a date range.\n *\n * An event is included when its time interval intersects `[from, to]`, including\n * multi-day events that span the range without starting or ending inside it.\n * Pass `calendarIds` to search only some calendars.\n *\n * @example\n * const startOfDay = new Date();\n * startOfDay.setHours(0, 0, 0, 0);\n * const startOfNextDay = new Date(startOfDay);\n * startOfNextDay.setDate(startOfNextDay.getDate() + 1);\n *\n * const { result } = await CapacitorCalendar.listEventsInRange({\n * from: startOfDay.getTime(),\n * to: startOfNextDay.getTime(),\n * });\n *\n * @platform Android, iOS\n * @since 0.10.0\n */\n listEventsInRange(options: ListEventsInRangeOptions): Promise<ListEventsInRangeResult>;\n /**\n * Retrieves an event by id.\n *\n * For a recurring event, the result is the first occurrence on iOS and the series master on Android.\n *\n * @example\n * const { event } = await CapacitorCalendar.getEventById({ id: eventId });\n *\n * @platform Android, iOS\n * @since 8.11.0\n */\n getEventById(options: GetEventByIdOptions): Promise<GetEventByIdResult>;\n}\n\n/**\n * @since 7.1.0\n */\nexport interface DeleteEventsByIdResult {\n /**\n * @since 7.1.0\n */\n deleted: string[];\n /**\n * @since 7.1.0\n */\n failed: string[];\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -26,6 +26,8 @@ import type { DeleteRemindersListOptions } from './schemas/interfaces/delete-rem
26
26
  import type { FetchAllCalendarSourcesResult } from './schemas/interfaces/fetch-all-calendar-sources-result';
27
27
  import type { GetDefaultCalendarOptions } from './schemas/interfaces/get-default-calendar-options';
28
28
  import type { GetDefaultRemindersListResult } from './schemas/interfaces/get-default-reminders-list-result';
29
+ import type { GetEventByIdOptions } from './schemas/interfaces/get-event-by-id-options';
30
+ import type { GetEventByIdResult } from './schemas/interfaces/get-event-by-id-result';
29
31
  import type { GetReminderByIdOptions } from './schemas/interfaces/get-reminder-by-id-options';
30
32
  import type { GetReminderByIdResult } from './schemas/interfaces/get-reminder-by-id-result';
31
33
  import type { GetRemindersFromListsOptions } from './schemas/interfaces/get-reminders-from-lists-options';
@@ -100,6 +102,7 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
100
102
  }>;
101
103
  deleteReminder(_options: DeleteReminderOptions): Promise<void>;
102
104
  modifyReminder(_options: ModifyReminderOptions): Promise<void>;
105
+ getEventById(_options: GetEventByIdOptions): Promise<GetEventByIdResult>;
103
106
  getReminderById(_options: GetReminderByIdOptions): Promise<GetReminderByIdResult>;
104
107
  getRemindersFromLists(_options: GetRemindersFromListsOptions): Promise<GetRemindersFromListsResult>;
105
108
  deleteEventsById(_options: DeleteEventsByIdOptions): Promise<{
package/dist/esm/web.js CHANGED
@@ -124,6 +124,9 @@ export class CapacitorCalendarWeb extends WebPlugin {
124
124
  modifyReminder(_options) {
125
125
  return this.throwUnimplemented(this.modifyReminder.name);
126
126
  }
127
+ getEventById(_options) {
128
+ return this.throwUnimplemented(this.getEventById.name);
129
+ }
127
130
  getReminderById(_options) {
128
131
  return this.throwUnimplemented(this.getReminderById.name);
129
132
  }
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAiD5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE9E,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAA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OAAO,GAAG,QAAQ,IAAI,KAAK,IAAI,UAAU,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,iBAAiB,CAAC,EAAU;IACnC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAChD,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;KACf,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,EAAU;IACvC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE;QAC5C,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { PermissionState } from '@capacitor/core';\nimport { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorCalendarPlugin } from './definitions';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { CheckPermissionOptions } from './schemas/interfaces/check-permission-options';\nimport type { CreateCalendarOptions } from './schemas/interfaces/create-calendar-options';\nimport type { CreateCalendarResult } from './schemas/interfaces/create-calendar-result';\nimport type { CreateEventOptions } from './schemas/interfaces/create-event-options';\nimport type { CreateEventResult } from './schemas/interfaces/create-event-result';\nimport type { CreateEventWithPromptOptions } from './schemas/interfaces/create-event-with-prompt-options';\nimport type { CreateEventWithPromptResult } from './schemas/interfaces/create-event-with-prompt-result';\nimport type { CreateReminderOptions } from './schemas/interfaces/create-reminder-options';\nimport type { CreateReminderResult } from './schemas/interfaces/create-reminder-result';\nimport type { CreateRemindersListOptions } from './schemas/interfaces/create-reminders-list-options';\nimport type { CreateRemindersListResult } from './schemas/interfaces/create-reminders-list-result';\nimport type { DeleteCalendarOptions } from './schemas/interfaces/delete-calendar-options';\nimport type { DeleteEventOptions } from './schemas/interfaces/delete-event-options';\nimport type { DeleteEventWithPromptOptions } from './schemas/interfaces/delete-event-with-prompt-options';\nimport type { DeleteEventsByIdOptions } from './schemas/interfaces/delete-events-by-id-options';\nimport type { DeleteReminderOptions } from './schemas/interfaces/delete-reminder-options';\nimport type { DeleteReminderWithPromptOptions } from './schemas/interfaces/delete-reminder-with-prompt-options';\nimport type { DeleteReminderWithPromptResult } from './schemas/interfaces/delete-reminder-with-prompt-result';\nimport type { DeleteRemindersByIdOptions } from './schemas/interfaces/delete-reminders-by-id-options';\nimport type { DeleteRemindersByIdResult } from './schemas/interfaces/delete-reminders-by-id-result';\nimport type { DeleteRemindersListOptions } from './schemas/interfaces/delete-reminders-list-options';\nimport type { FetchAllCalendarSourcesResult } from './schemas/interfaces/fetch-all-calendar-sources-result';\nimport type { GetDefaultCalendarOptions } from './schemas/interfaces/get-default-calendar-options';\nimport type { GetDefaultRemindersListResult } from './schemas/interfaces/get-default-reminders-list-result';\nimport type { GetReminderByIdOptions } from './schemas/interfaces/get-reminder-by-id-options';\nimport type { GetReminderByIdResult } from './schemas/interfaces/get-reminder-by-id-result';\nimport type { GetRemindersFromListsOptions } from './schemas/interfaces/get-reminders-from-lists-options';\nimport type { GetRemindersFromListsResult } from './schemas/interfaces/get-reminders-from-lists-result';\nimport type { GetRemindersListsResult } from './schemas/interfaces/get-reminders-lists-result';\nimport type { ListCalendarsResult } from './schemas/interfaces/list-calendars-result';\nimport type { ListEventsInRangeOptions } from './schemas/interfaces/list-events-in-range-options';\nimport type { ListEventsInRangeResult } from './schemas/interfaces/list-events-in-range-result';\nimport type { ModifyCalendarOptions } from './schemas/interfaces/modify-calendar-options';\nimport type { ModifyEventOptions } from './schemas/interfaces/modify-event-options';\nimport type { ModifyEventWithPromptOptions } from './schemas/interfaces/modify-event-with-prompt-options';\nimport type { ModifyReminderOptions } from './schemas/interfaces/modify-reminder-options';\nimport type { OpenCalendarOptions } from './schemas/interfaces/open-calendar-options';\nimport type { RequestPermissionOptions } from './schemas/interfaces/request-permission-options';\nimport type { SelectCalendarsWithPromptOptions } from './schemas/interfaces/select-calendars-with-prompt-options';\nimport type { SelectCalendarsWithPromptResult } from './schemas/interfaces/select-calendars-with-prompt-result';\nimport type { UpdateRemindersListOptions } from './schemas/interfaces/update-reminders-list-options';\nimport type { UpdateRemindersListResult } from './schemas/interfaces/update-reminders-list-result';\nimport type { EventEditAction } from './schemas/types/event-edit-action';\nimport type { CheckAllPermissionsResult, RequestAllPermissionsResult } from './sub-definitions/calendar-access';\nimport type { DeleteEventsByIdResult } from './sub-definitions/event-operations';\nimport { downloadIcsFile } from './web/download-ics-file';\nimport { buildEventIcs, resolveEndDate, resolveIcsFileName } from './web/ics';\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\n\nexport class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {\n public checkPermission(_options: CheckPermissionOptions): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.checkPermission.name);\n }\n\n public checkAllPermissions(): Promise<{ result: CheckAllPermissionsResult }> {\n return this.throwUnimplemented(this.checkAllPermissions.name);\n }\n\n public requestPermission(_options: RequestPermissionOptions): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.requestPermission.name);\n }\n\n public createRemindersList(_options: CreateRemindersListOptions): Promise<CreateRemindersListResult> {\n return this.throwUnimplemented(this.createRemindersList.name);\n }\n\n public deleteRemindersList(_options: DeleteRemindersListOptions): Promise<void> {\n return this.throwUnimplemented(this.deleteRemindersList.name);\n }\n\n public requestAllPermissions(): Promise<{\n result: RequestAllPermissionsResult;\n }> {\n return this.throwUnimplemented(this.requestAllPermissions.name);\n }\n\n public requestWriteOnlyCalendarAccess(): Promise<{\n result: PermissionState;\n }> {\n return this.throwUnimplemented(this.requestWriteOnlyCalendarAccess.name);\n }\n\n public requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.requestReadOnlyCalendarAccess.name);\n }\n\n public requestFullCalendarAccess(): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.requestFullCalendarAccess.name);\n }\n\n public requestFullRemindersAccess(): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.requestFullRemindersAccess.name);\n }\n\n public async createEventWithPrompt(options: CreateEventWithPromptOptions = {}): Promise<CreateEventWithPromptResult> {\n try {\n const confirmed = window.confirm(buildCreateEventConfirmMessage(options));\n if (!confirmed) {\n return { id: null, ics: null };\n }\n\n const createOptions = mapPromptOptionsToCreateEvent(options);\n const content = buildEventIcs(createOptions);\n const ics = new File([content], resolveIcsFileName(createOptions), {\n type: 'text/calendar;charset=utf-8',\n });\n\n if (options.autoDownloadIcsFile !== false) {\n await downloadIcsFile(ics);\n }\n\n return { id: null, ics };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return Promise.reject(new Error(message));\n }\n }\n\n public modifyEventWithPrompt(_options: ModifyEventWithPromptOptions): Promise<{ result: EventEditAction | null }> {\n return this.throwUnimplemented(this.modifyEventWithPrompt.name);\n }\n\n public async createEvent(options: CreateEventOptions): Promise<CreateEventResult> {\n try {\n const content = buildEventIcs(options);\n const ics = new File([content], resolveIcsFileName(options), {\n type: 'text/calendar;charset=utf-8',\n });\n if (options.autoDownloadIcsFile === true) {\n await downloadIcsFile(ics);\n }\n return { id: null, ics };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return Promise.reject(new Error(message));\n }\n }\n\n public commit(): Promise<void> {\n return this.throwUnimplemented(this.commit.name);\n }\n\n public modifyEvent(_options: ModifyEventOptions): Promise<void> {\n return this.throwUnimplemented(this.modifyEvent.name);\n }\n\n public selectCalendarsWithPrompt(\n _options?: SelectCalendarsWithPromptOptions,\n ): Promise<SelectCalendarsWithPromptResult> {\n return this.throwUnimplemented(this.selectCalendarsWithPrompt.name);\n }\n\n public fetchAllCalendarSources(): Promise<FetchAllCalendarSourcesResult> {\n return this.throwUnimplemented(this.fetchAllCalendarSources.name);\n }\n\n public listCalendars(): Promise<ListCalendarsResult> {\n return this.throwUnimplemented(this.listCalendars.name);\n }\n\n public fetchAllRemindersSources(): Promise<FetchAllCalendarSourcesResult> {\n return this.throwUnimplemented(this.fetchAllRemindersSources.name);\n }\n\n public getDefaultCalendar(_options?: GetDefaultCalendarOptions): Promise<{ result: Calendar | null }> {\n return this.throwUnimplemented(this.getDefaultCalendar.name);\n }\n\n public getDefaultRemindersList(): Promise<GetDefaultRemindersListResult> {\n return this.throwUnimplemented(this.getDefaultRemindersList.name);\n }\n\n public openReminders(): Promise<void> {\n return this.throwUnimplemented(this.openReminders.name);\n }\n\n public getRemindersLists(): Promise<GetRemindersListsResult> {\n return this.throwUnimplemented(this.getRemindersLists.name);\n }\n\n public openCalendar(_options?: OpenCalendarOptions): Promise<void> {\n return this.throwUnimplemented(this.openCalendar.name);\n }\n\n public createCalendar(_options: CreateCalendarOptions): Promise<CreateCalendarResult> {\n return this.throwUnimplemented(this.createCalendar.name);\n }\n\n public deleteCalendar(_options: DeleteCalendarOptions): Promise<void> {\n return this.throwUnimplemented(this.deleteCalendar.name);\n }\n\n public createReminder(_options: CreateReminderOptions): Promise<CreateReminderResult> {\n return this.throwUnimplemented(this.createReminder.name);\n }\n\n public deleteRemindersById(_options: DeleteRemindersByIdOptions): Promise<{ result: DeleteRemindersByIdResult }> {\n return this.throwUnimplemented(this.deleteRemindersById.name);\n }\n\n public deleteReminder(_options: DeleteReminderOptions): Promise<void> {\n return this.throwUnimplemented(this.deleteReminder.name);\n }\n\n public modifyReminder(_options: ModifyReminderOptions): Promise<void> {\n return this.throwUnimplemented(this.modifyReminder.name);\n }\n\n public getReminderById(_options: GetReminderByIdOptions): Promise<GetReminderByIdResult> {\n return this.throwUnimplemented(this.getReminderById.name);\n }\n\n public getRemindersFromLists(_options: GetRemindersFromListsOptions): Promise<GetRemindersFromListsResult> {\n return this.throwUnimplemented(this.getRemindersFromLists.name);\n }\n\n public deleteEventsById(_options: DeleteEventsByIdOptions): Promise<{\n result: DeleteEventsByIdResult;\n }> {\n return this.throwUnimplemented(this.deleteEventsById.name);\n }\n\n public deleteEvent(_options: DeleteEventOptions): Promise<void> {\n return this.throwUnimplemented(this.deleteEvent.name);\n }\n\n public deleteEventWithPrompt(_options: DeleteEventWithPromptOptions): Promise<{ deleted: boolean }> {\n return this.throwUnimplemented(this.deleteEventWithPrompt.name);\n }\n\n public listEventsInRange(_options: ListEventsInRangeOptions): Promise<ListEventsInRangeResult> {\n return this.throwUnimplemented(this.listEventsInRange.name);\n }\n\n public modifyCalendar(_options: ModifyCalendarOptions): Promise<void> {\n return this.throwUnimplemented(this.modifyCalendar.name);\n }\n\n public deleteReminderWithPrompt(_options: DeleteReminderWithPromptOptions): Promise<DeleteReminderWithPromptResult> {\n return this.throwUnimplemented(this.deleteReminderWithPrompt.name);\n }\n\n public updateRemindersList(_options: UpdateRemindersListOptions): Promise<UpdateRemindersListResult> {\n return this.throwUnimplemented(this.updateRemindersList.name);\n }\n\n private throwUnimplemented<T>(methodName: string): Promise<T> {\n return Promise.reject(this.unimplemented(`${methodName} is not implemented on the web.`));\n }\n}\n\nfunction mapPromptOptionsToCreateEvent(options: CreateEventWithPromptOptions): CreateEventOptions {\n return {\n alerts: options.alerts,\n availability: options.availability,\n description: options.description,\n endDate: options.endDate,\n icsFileName: options.icsFileName,\n isAllDay: options.isAllDay,\n location: options.location,\n recurrence: options.recurrence,\n startDate: options.startDate,\n title: options.title ?? '',\n url: options.url,\n };\n}\n\nfunction buildCreateEventConfirmMessage(options: CreateEventWithPromptOptions): string {\n const custom = options.promptMessage?.trim();\n if (custom != null && custom.length > 0) {\n return custom;\n }\n\n const title = normalizeConfirmTitle(options.title);\n const timeSummary = formatEventTimeSummary(options);\n return `Create event?\\n\\n${title}\\n${timeSummary}`;\n}\n\nfunction normalizeConfirmTitle(title?: string): string {\n const collapsed = (title ?? '')\n .replace(/[\\r\\n]+/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n return collapsed.length > 0 ? collapsed : 'Untitled event';\n}\n\nfunction formatEventTimeSummary(options: CreateEventWithPromptOptions): string {\n const startDate = options.startDate ?? Date.now();\n const isAllDay = options.isAllDay === true;\n const endDate = resolveEndDate(startDate, options.endDate, undefined, isAllDay);\n\n if (isAllDay) {\n const startDay = formatLocalDate(startDate);\n const lastInclusiveMs = endDate - DAY_MS;\n const lastDay = formatLocalDate(lastInclusiveMs);\n if (lastDay <= startDay) {\n return `All day · ${formatDisplayDate(startDate)}`;\n }\n return `All day · ${formatDisplayDate(startDate)} – ${formatDisplayDate(lastInclusiveMs)}`;\n }\n\n return `${formatDisplayDateTime(startDate)} – ${formatDisplayDateTime(endDate)}`;\n}\n\nfunction formatLocalDate(ms: number): string {\n const date = new Date(ms);\n const fullYear = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const dayOfMonth = String(date.getDate()).padStart(2, '0');\n return `${fullYear}-${month}-${dayOfMonth}`;\n}\n\nfunction formatDisplayDate(ms: number): string {\n return new Date(ms).toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n}\n\nfunction formatDisplayDateTime(ms: number): string {\n return new Date(ms).toLocaleString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n });\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAmD5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE9E,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAC1C,eAAe,CAAC,QAAgC;QACrD,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAEM,mBAAmB;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9C,CAAC;AAED,SAAS,iBAAiB,CAAC,EAAU;IACnC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAChD,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;KACf,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,EAAU;IACvC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE;QAC5C,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { PermissionState } from '@capacitor/core';\nimport { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorCalendarPlugin } from './definitions';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { CheckPermissionOptions } from './schemas/interfaces/check-permission-options';\nimport type { CreateCalendarOptions } from './schemas/interfaces/create-calendar-options';\nimport type { CreateCalendarResult } from './schemas/interfaces/create-calendar-result';\nimport type { CreateEventOptions } from './schemas/interfaces/create-event-options';\nimport type { CreateEventResult } from './schemas/interfaces/create-event-result';\nimport type { CreateEventWithPromptOptions } from './schemas/interfaces/create-event-with-prompt-options';\nimport type { CreateEventWithPromptResult } from './schemas/interfaces/create-event-with-prompt-result';\nimport type { CreateReminderOptions } from './schemas/interfaces/create-reminder-options';\nimport type { CreateReminderResult } from './schemas/interfaces/create-reminder-result';\nimport type { CreateRemindersListOptions } from './schemas/interfaces/create-reminders-list-options';\nimport type { CreateRemindersListResult } from './schemas/interfaces/create-reminders-list-result';\nimport type { DeleteCalendarOptions } from './schemas/interfaces/delete-calendar-options';\nimport type { DeleteEventOptions } from './schemas/interfaces/delete-event-options';\nimport type { DeleteEventWithPromptOptions } from './schemas/interfaces/delete-event-with-prompt-options';\nimport type { DeleteEventsByIdOptions } from './schemas/interfaces/delete-events-by-id-options';\nimport type { DeleteReminderOptions } from './schemas/interfaces/delete-reminder-options';\nimport type { DeleteReminderWithPromptOptions } from './schemas/interfaces/delete-reminder-with-prompt-options';\nimport type { DeleteReminderWithPromptResult } from './schemas/interfaces/delete-reminder-with-prompt-result';\nimport type { DeleteRemindersByIdOptions } from './schemas/interfaces/delete-reminders-by-id-options';\nimport type { DeleteRemindersByIdResult } from './schemas/interfaces/delete-reminders-by-id-result';\nimport type { DeleteRemindersListOptions } from './schemas/interfaces/delete-reminders-list-options';\nimport type { FetchAllCalendarSourcesResult } from './schemas/interfaces/fetch-all-calendar-sources-result';\nimport type { GetDefaultCalendarOptions } from './schemas/interfaces/get-default-calendar-options';\nimport type { GetDefaultRemindersListResult } from './schemas/interfaces/get-default-reminders-list-result';\nimport type { GetEventByIdOptions } from './schemas/interfaces/get-event-by-id-options';\nimport type { GetEventByIdResult } from './schemas/interfaces/get-event-by-id-result';\nimport type { GetReminderByIdOptions } from './schemas/interfaces/get-reminder-by-id-options';\nimport type { GetReminderByIdResult } from './schemas/interfaces/get-reminder-by-id-result';\nimport type { GetRemindersFromListsOptions } from './schemas/interfaces/get-reminders-from-lists-options';\nimport type { GetRemindersFromListsResult } from './schemas/interfaces/get-reminders-from-lists-result';\nimport type { GetRemindersListsResult } from './schemas/interfaces/get-reminders-lists-result';\nimport type { ListCalendarsResult } from './schemas/interfaces/list-calendars-result';\nimport type { ListEventsInRangeOptions } from './schemas/interfaces/list-events-in-range-options';\nimport type { ListEventsInRangeResult } from './schemas/interfaces/list-events-in-range-result';\nimport type { ModifyCalendarOptions } from './schemas/interfaces/modify-calendar-options';\nimport type { ModifyEventOptions } from './schemas/interfaces/modify-event-options';\nimport type { ModifyEventWithPromptOptions } from './schemas/interfaces/modify-event-with-prompt-options';\nimport type { ModifyReminderOptions } from './schemas/interfaces/modify-reminder-options';\nimport type { OpenCalendarOptions } from './schemas/interfaces/open-calendar-options';\nimport type { RequestPermissionOptions } from './schemas/interfaces/request-permission-options';\nimport type { SelectCalendarsWithPromptOptions } from './schemas/interfaces/select-calendars-with-prompt-options';\nimport type { SelectCalendarsWithPromptResult } from './schemas/interfaces/select-calendars-with-prompt-result';\nimport type { UpdateRemindersListOptions } from './schemas/interfaces/update-reminders-list-options';\nimport type { UpdateRemindersListResult } from './schemas/interfaces/update-reminders-list-result';\nimport type { EventEditAction } from './schemas/types/event-edit-action';\nimport type { CheckAllPermissionsResult, RequestAllPermissionsResult } from './sub-definitions/calendar-access';\nimport type { DeleteEventsByIdResult } from './sub-definitions/event-operations';\nimport { downloadIcsFile } from './web/download-ics-file';\nimport { buildEventIcs, resolveEndDate, resolveIcsFileName } from './web/ics';\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\n\nexport class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {\n public checkPermission(_options: CheckPermissionOptions): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.checkPermission.name);\n }\n\n public checkAllPermissions(): Promise<{ result: CheckAllPermissionsResult }> {\n return this.throwUnimplemented(this.checkAllPermissions.name);\n }\n\n public requestPermission(_options: RequestPermissionOptions): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.requestPermission.name);\n }\n\n public createRemindersList(_options: CreateRemindersListOptions): Promise<CreateRemindersListResult> {\n return this.throwUnimplemented(this.createRemindersList.name);\n }\n\n public deleteRemindersList(_options: DeleteRemindersListOptions): Promise<void> {\n return this.throwUnimplemented(this.deleteRemindersList.name);\n }\n\n public requestAllPermissions(): Promise<{\n result: RequestAllPermissionsResult;\n }> {\n return this.throwUnimplemented(this.requestAllPermissions.name);\n }\n\n public requestWriteOnlyCalendarAccess(): Promise<{\n result: PermissionState;\n }> {\n return this.throwUnimplemented(this.requestWriteOnlyCalendarAccess.name);\n }\n\n public requestReadOnlyCalendarAccess(): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.requestReadOnlyCalendarAccess.name);\n }\n\n public requestFullCalendarAccess(): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.requestFullCalendarAccess.name);\n }\n\n public requestFullRemindersAccess(): Promise<{ result: PermissionState }> {\n return this.throwUnimplemented(this.requestFullRemindersAccess.name);\n }\n\n public async createEventWithPrompt(options: CreateEventWithPromptOptions = {}): Promise<CreateEventWithPromptResult> {\n try {\n const confirmed = window.confirm(buildCreateEventConfirmMessage(options));\n if (!confirmed) {\n return { id: null, ics: null };\n }\n\n const createOptions = mapPromptOptionsToCreateEvent(options);\n const content = buildEventIcs(createOptions);\n const ics = new File([content], resolveIcsFileName(createOptions), {\n type: 'text/calendar;charset=utf-8',\n });\n\n if (options.autoDownloadIcsFile !== false) {\n await downloadIcsFile(ics);\n }\n\n return { id: null, ics };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return Promise.reject(new Error(message));\n }\n }\n\n public modifyEventWithPrompt(_options: ModifyEventWithPromptOptions): Promise<{ result: EventEditAction | null }> {\n return this.throwUnimplemented(this.modifyEventWithPrompt.name);\n }\n\n public async createEvent(options: CreateEventOptions): Promise<CreateEventResult> {\n try {\n const content = buildEventIcs(options);\n const ics = new File([content], resolveIcsFileName(options), {\n type: 'text/calendar;charset=utf-8',\n });\n if (options.autoDownloadIcsFile === true) {\n await downloadIcsFile(ics);\n }\n return { id: null, ics };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n return Promise.reject(new Error(message));\n }\n }\n\n public commit(): Promise<void> {\n return this.throwUnimplemented(this.commit.name);\n }\n\n public modifyEvent(_options: ModifyEventOptions): Promise<void> {\n return this.throwUnimplemented(this.modifyEvent.name);\n }\n\n public selectCalendarsWithPrompt(\n _options?: SelectCalendarsWithPromptOptions,\n ): Promise<SelectCalendarsWithPromptResult> {\n return this.throwUnimplemented(this.selectCalendarsWithPrompt.name);\n }\n\n public fetchAllCalendarSources(): Promise<FetchAllCalendarSourcesResult> {\n return this.throwUnimplemented(this.fetchAllCalendarSources.name);\n }\n\n public listCalendars(): Promise<ListCalendarsResult> {\n return this.throwUnimplemented(this.listCalendars.name);\n }\n\n public fetchAllRemindersSources(): Promise<FetchAllCalendarSourcesResult> {\n return this.throwUnimplemented(this.fetchAllRemindersSources.name);\n }\n\n public getDefaultCalendar(_options?: GetDefaultCalendarOptions): Promise<{ result: Calendar | null }> {\n return this.throwUnimplemented(this.getDefaultCalendar.name);\n }\n\n public getDefaultRemindersList(): Promise<GetDefaultRemindersListResult> {\n return this.throwUnimplemented(this.getDefaultRemindersList.name);\n }\n\n public openReminders(): Promise<void> {\n return this.throwUnimplemented(this.openReminders.name);\n }\n\n public getRemindersLists(): Promise<GetRemindersListsResult> {\n return this.throwUnimplemented(this.getRemindersLists.name);\n }\n\n public openCalendar(_options?: OpenCalendarOptions): Promise<void> {\n return this.throwUnimplemented(this.openCalendar.name);\n }\n\n public createCalendar(_options: CreateCalendarOptions): Promise<CreateCalendarResult> {\n return this.throwUnimplemented(this.createCalendar.name);\n }\n\n public deleteCalendar(_options: DeleteCalendarOptions): Promise<void> {\n return this.throwUnimplemented(this.deleteCalendar.name);\n }\n\n public createReminder(_options: CreateReminderOptions): Promise<CreateReminderResult> {\n return this.throwUnimplemented(this.createReminder.name);\n }\n\n public deleteRemindersById(_options: DeleteRemindersByIdOptions): Promise<{ result: DeleteRemindersByIdResult }> {\n return this.throwUnimplemented(this.deleteRemindersById.name);\n }\n\n public deleteReminder(_options: DeleteReminderOptions): Promise<void> {\n return this.throwUnimplemented(this.deleteReminder.name);\n }\n\n public modifyReminder(_options: ModifyReminderOptions): Promise<void> {\n return this.throwUnimplemented(this.modifyReminder.name);\n }\n\n public getEventById(_options: GetEventByIdOptions): Promise<GetEventByIdResult> {\n return this.throwUnimplemented(this.getEventById.name);\n }\n\n public getReminderById(_options: GetReminderByIdOptions): Promise<GetReminderByIdResult> {\n return this.throwUnimplemented(this.getReminderById.name);\n }\n\n public getRemindersFromLists(_options: GetRemindersFromListsOptions): Promise<GetRemindersFromListsResult> {\n return this.throwUnimplemented(this.getRemindersFromLists.name);\n }\n\n public deleteEventsById(_options: DeleteEventsByIdOptions): Promise<{\n result: DeleteEventsByIdResult;\n }> {\n return this.throwUnimplemented(this.deleteEventsById.name);\n }\n\n public deleteEvent(_options: DeleteEventOptions): Promise<void> {\n return this.throwUnimplemented(this.deleteEvent.name);\n }\n\n public deleteEventWithPrompt(_options: DeleteEventWithPromptOptions): Promise<{ deleted: boolean }> {\n return this.throwUnimplemented(this.deleteEventWithPrompt.name);\n }\n\n public listEventsInRange(_options: ListEventsInRangeOptions): Promise<ListEventsInRangeResult> {\n return this.throwUnimplemented(this.listEventsInRange.name);\n }\n\n public modifyCalendar(_options: ModifyCalendarOptions): Promise<void> {\n return this.throwUnimplemented(this.modifyCalendar.name);\n }\n\n public deleteReminderWithPrompt(_options: DeleteReminderWithPromptOptions): Promise<DeleteReminderWithPromptResult> {\n return this.throwUnimplemented(this.deleteReminderWithPrompt.name);\n }\n\n public updateRemindersList(_options: UpdateRemindersListOptions): Promise<UpdateRemindersListResult> {\n return this.throwUnimplemented(this.updateRemindersList.name);\n }\n\n private throwUnimplemented<T>(methodName: string): Promise<T> {\n return Promise.reject(this.unimplemented(`${methodName} is not implemented on the web.`));\n }\n}\n\nfunction mapPromptOptionsToCreateEvent(options: CreateEventWithPromptOptions): CreateEventOptions {\n return {\n alerts: options.alerts,\n availability: options.availability,\n description: options.description,\n endDate: options.endDate,\n icsFileName: options.icsFileName,\n isAllDay: options.isAllDay,\n location: options.location,\n recurrence: options.recurrence,\n startDate: options.startDate,\n title: options.title ?? '',\n url: options.url,\n };\n}\n\nfunction buildCreateEventConfirmMessage(options: CreateEventWithPromptOptions): string {\n const custom = options.promptMessage?.trim();\n if (custom != null && custom.length > 0) {\n return custom;\n }\n\n const title = normalizeConfirmTitle(options.title);\n const timeSummary = formatEventTimeSummary(options);\n return `Create event?\\n\\n${title}\\n${timeSummary}`;\n}\n\nfunction normalizeConfirmTitle(title?: string): string {\n const collapsed = (title ?? '')\n .replace(/[\\r\\n]+/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n return collapsed.length > 0 ? collapsed : 'Untitled event';\n}\n\nfunction formatEventTimeSummary(options: CreateEventWithPromptOptions): string {\n const startDate = options.startDate ?? Date.now();\n const isAllDay = options.isAllDay === true;\n const endDate = resolveEndDate(startDate, options.endDate, undefined, isAllDay);\n\n if (isAllDay) {\n const startDay = formatLocalDate(startDate);\n const lastInclusiveMs = endDate - DAY_MS;\n const lastDay = formatLocalDate(lastInclusiveMs);\n if (lastDay <= startDay) {\n return `All day · ${formatDisplayDate(startDate)}`;\n }\n return `All day · ${formatDisplayDate(startDate)} – ${formatDisplayDate(lastInclusiveMs)}`;\n }\n\n return `${formatDisplayDateTime(startDate)} – ${formatDisplayDateTime(endDate)}`;\n}\n\nfunction formatLocalDate(ms: number): string {\n const date = new Date(ms);\n const fullYear = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const dayOfMonth = String(date.getDate()).padStart(2, '0');\n return `${fullYear}-${month}-${dayOfMonth}`;\n}\n\nfunction formatDisplayDate(ms: number): string {\n return new Date(ms).toLocaleDateString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n}\n\nfunction formatDisplayDateTime(ms: number): string {\n return new Date(ms).toLocaleString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n });\n}\n"]}
@@ -902,6 +902,9 @@ class CapacitorCalendarWeb extends core.WebPlugin {
902
902
  modifyReminder(_options) {
903
903
  return this.throwUnimplemented(this.modifyReminder.name);
904
904
  }
905
+ getEventById(_options) {
906
+ return this.throwUnimplemented(this.getEventById.name);
907
+ }
905
908
  getReminderById(_options) {
906
909
  return this.throwUnimplemented(this.getReminderById.name);
907
910
  }