@ebarooni/capacitor-calendar 7.2.0 → 7.4.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.
- package/EbarooniCapacitorCalendar.podspec +1 -1
- package/Package.swift +2 -2
- package/README.md +932 -466
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +128 -31
- package/android/src/main/java/dev/barooni/capacitor/calendar/PluginError.kt +43 -19
- package/android/src/main/java/dev/barooni/capacitor/calendar/implementation/CapacitorCalendar.kt +312 -85
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/CalendarEvent.kt +4 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/EventDeleteInfo.kt +8 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/EventRecurrenceRule.kt +135 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/enums/EventSpan.kt +13 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CheckPermissionInput.kt +0 -4
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateCalendarInput.kt +3 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateEventInput.kt +1 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateEventWithPromptInput.kt +5 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteCalendarInput.kt +4 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventInput.kt +4 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventWithPromptInput.kt +4 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/DeleteEventsByIdInput.kt +2 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/GetDefaultCalendarInput.kt +9 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyCalendarInput.kt +10 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyEvent.kt +3 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyEventWithPromptInput.kt +3 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/RequestPermissionInput.kt +3 -5
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CheckAllPermissionsResult.kt +3 -2
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CreateEventResult.kt +1 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/CreateEventWithPromptResult.kt +1 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/GetDefaultCalendarResult.kt +1 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/ListCalendarsResult.kt +1 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/ListEventsInRangeResult.kt +4 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/RequestAllPermissionsResult.kt +1 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/templates/PluginCompletion.kt +8 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/utils/DeclarationCheck.kt +59 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/utils/ImplementationHelper.kt +468 -39
- package/dist/docs.json +3046 -1048
- package/dist/esm/definitions.d.ts +5 -5
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +72 -48
- package/dist/esm/index.js +18 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/schemas/enums/attendee-role.js.map +1 -1
- package/dist/esm/schemas/enums/attendee-status.js.map +1 -1
- package/dist/esm/schemas/enums/attendee-type.js.map +1 -1
- package/dist/esm/schemas/enums/calendar-permission-scope.d.ts +9 -1
- package/dist/esm/schemas/enums/calendar-permission-scope.js +9 -1
- package/dist/esm/schemas/enums/calendar-permission-scope.js.map +1 -1
- package/dist/esm/schemas/enums/capacitor-calendar-error-code.d.ts +13 -0
- package/dist/esm/schemas/enums/capacitor-calendar-error-code.js +15 -0
- package/dist/esm/schemas/enums/capacitor-calendar-error-code.js.map +1 -0
- package/dist/esm/schemas/enums/event-span.d.ts +4 -0
- package/dist/esm/schemas/enums/event-span.js +4 -0
- package/dist/esm/schemas/enums/event-span.js.map +1 -1
- package/dist/esm/schemas/enums/event-status.js.map +1 -1
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.d.ts +5 -5
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.js +5 -5
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.js.map +1 -1
- package/dist/esm/schemas/interfaces/calendar-event.d.ts +145 -70
- package/dist/esm/schemas/interfaces/calendar-event.js.map +1 -1
- package/dist/esm/schemas/interfaces/calendar-source.d.ts +4 -1
- package/dist/esm/schemas/interfaces/calendar-source.js.map +1 -1
- package/dist/esm/schemas/interfaces/calendar.d.ts +22 -4
- package/dist/esm/schemas/interfaces/calendar.js.map +1 -1
- package/dist/esm/schemas/interfaces/check-permission-options.d.ts +19 -0
- package/dist/esm/schemas/interfaces/check-permission-options.js +2 -0
- package/dist/esm/schemas/interfaces/check-permission-options.js.map +1 -0
- package/dist/esm/schemas/interfaces/create-calendar-options.d.ts +19 -6
- package/dist/esm/schemas/interfaces/create-calendar-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/create-calendar-result.d.ts +12 -0
- package/dist/esm/schemas/interfaces/create-calendar-result.js +2 -0
- package/dist/esm/schemas/interfaces/create-calendar-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/create-event-options.d.ts +86 -51
- package/dist/esm/schemas/interfaces/create-event-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/create-event-result.d.ts +22 -0
- package/dist/esm/schemas/interfaces/create-event-result.js +2 -0
- package/dist/esm/schemas/interfaces/create-event-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/create-event-with-prompt-options.d.ts +73 -36
- package/dist/esm/schemas/interfaces/create-event-with-prompt-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/create-event-with-prompt-result.d.ts +23 -0
- package/dist/esm/schemas/interfaces/create-event-with-prompt-result.js +2 -0
- package/dist/esm/schemas/interfaces/create-event-with-prompt-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/create-reminder-options.d.ts +42 -12
- package/dist/esm/schemas/interfaces/create-reminder-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/create-reminder-result.d.ts +12 -0
- package/dist/esm/schemas/interfaces/create-reminder-result.js +2 -0
- package/dist/esm/schemas/interfaces/create-reminder-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/create-reminders-list-options.d.ts +46 -0
- package/dist/esm/schemas/interfaces/create-reminders-list-options.js +2 -0
- package/dist/esm/schemas/interfaces/create-reminders-list-options.js.map +1 -0
- package/dist/esm/schemas/interfaces/create-reminders-list-result.d.ts +12 -0
- package/dist/esm/schemas/interfaces/create-reminders-list-result.js +2 -0
- package/dist/esm/schemas/interfaces/create-reminders-list-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/delete-calendar-options.d.ts +1 -0
- package/dist/esm/schemas/interfaces/delete-calendar-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/delete-event-options.d.ts +29 -4
- package/dist/esm/schemas/interfaces/delete-event-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.d.ts +39 -14
- package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/delete-events-by-id-options.d.ts +16 -4
- package/dist/esm/schemas/interfaces/delete-events-by-id-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/delete-reminder-options.d.ts +10 -0
- package/dist/esm/schemas/interfaces/delete-reminder-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/delete-reminder-with-prompt-result.d.ts +12 -0
- package/dist/esm/schemas/interfaces/delete-reminder-with-prompt-result.js +2 -0
- package/dist/esm/schemas/interfaces/delete-reminder-with-prompt-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/delete-reminders-by-id-result.d.ts +13 -0
- package/dist/esm/schemas/interfaces/delete-reminders-by-id-result.js +2 -0
- package/dist/esm/schemas/interfaces/delete-reminders-by-id-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/delete-reminders-list-options.d.ts +23 -0
- package/dist/esm/schemas/interfaces/delete-reminders-list-options.js +2 -0
- package/dist/esm/schemas/interfaces/delete-reminders-list-options.js.map +1 -0
- package/dist/esm/schemas/interfaces/event-recurrence-rule.d.ts +96 -0
- package/dist/esm/schemas/interfaces/event-recurrence-rule.js +2 -0
- package/dist/esm/schemas/interfaces/event-recurrence-rule.js.map +1 -0
- package/dist/esm/schemas/interfaces/fetch-all-calendar-sources-result.d.ts +13 -0
- package/dist/esm/schemas/interfaces/fetch-all-calendar-sources-result.js +2 -0
- package/dist/esm/schemas/interfaces/fetch-all-calendar-sources-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/get-default-calendar-options.d.ts +13 -0
- package/dist/esm/schemas/interfaces/get-default-calendar-options.js +2 -0
- package/dist/esm/schemas/interfaces/get-default-calendar-options.js.map +1 -0
- package/dist/esm/schemas/interfaces/get-default-reminders-list-result.d.ts +13 -0
- package/dist/esm/schemas/interfaces/get-default-reminders-list-result.js +2 -0
- package/dist/esm/schemas/interfaces/get-default-reminders-list-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/get-reminder-by-id-result.d.ts +13 -0
- package/dist/esm/schemas/interfaces/get-reminder-by-id-result.js +2 -0
- package/dist/esm/schemas/interfaces/get-reminder-by-id-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/get-reminders-from-lists-result.d.ts +13 -0
- package/dist/esm/schemas/interfaces/get-reminders-from-lists-result.js +2 -0
- package/dist/esm/schemas/interfaces/get-reminders-from-lists-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/get-reminders-lists-result.d.ts +13 -0
- package/dist/esm/schemas/interfaces/get-reminders-lists-result.js +2 -0
- package/dist/esm/schemas/interfaces/get-reminders-lists-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/list-calendars-result.d.ts +13 -0
- package/dist/esm/schemas/interfaces/list-calendars-result.js +2 -0
- package/dist/esm/schemas/interfaces/list-calendars-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/list-events-in-range-options.d.ts +7 -2
- package/dist/esm/schemas/interfaces/list-events-in-range-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/list-events-in-range-result.d.ts +13 -0
- package/dist/esm/schemas/interfaces/list-events-in-range-result.js +2 -0
- package/dist/esm/schemas/interfaces/list-events-in-range-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/modify-calendar-options.d.ts +13 -2
- package/dist/esm/schemas/interfaces/modify-calendar-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/modify-event-options.d.ts +61 -44
- package/dist/esm/schemas/interfaces/modify-event-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.d.ts +77 -2
- package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/modify-reminder-options.d.ts +77 -13
- package/dist/esm/schemas/interfaces/modify-reminder-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/open-calendar-options.d.ts +5 -1
- package/dist/esm/schemas/interfaces/open-calendar-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/recurrence-rule.d.ts +8 -2
- package/dist/esm/schemas/interfaces/recurrence-rule.js.map +1 -1
- package/dist/esm/schemas/interfaces/reminder-recurrence-rule.d.ts +1 -1
- package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js.map +1 -1
- package/dist/esm/schemas/interfaces/reminder.d.ts +4 -1
- package/dist/esm/schemas/interfaces/reminder.js.map +1 -1
- package/dist/esm/schemas/interfaces/reminders-list.d.ts +8 -2
- package/dist/esm/schemas/interfaces/reminders-list.js.map +1 -1
- package/dist/esm/schemas/interfaces/request-permission-options.d.ts +16 -0
- package/dist/esm/schemas/interfaces/request-permission-options.js +2 -0
- package/dist/esm/schemas/interfaces/request-permission-options.js.map +1 -0
- package/dist/esm/schemas/interfaces/select-calendars-with-prompt-options.d.ts +1 -1
- package/dist/esm/schemas/interfaces/select-calendars-with-prompt-options.js.map +1 -1
- package/dist/esm/schemas/interfaces/select-calendars-with-prompt-result.d.ts +14 -0
- package/dist/esm/schemas/interfaces/select-calendars-with-prompt-result.js +2 -0
- package/dist/esm/schemas/interfaces/select-calendars-with-prompt-result.js.map +1 -0
- package/dist/esm/schemas/interfaces/update-reminders-list-options.d.ts +43 -0
- package/dist/esm/schemas/interfaces/update-reminders-list-options.js +2 -0
- package/dist/esm/schemas/interfaces/update-reminders-list-options.js.map +1 -0
- package/dist/esm/schemas/interfaces/update-reminders-list-result.d.ts +12 -0
- package/dist/esm/schemas/interfaces/update-reminders-list-result.js +2 -0
- package/dist/esm/schemas/interfaces/update-reminders-list-result.js.map +1 -0
- package/dist/esm/schemas/types/event-edit-action.d.ts +1 -1
- package/dist/esm/schemas/types/event-edit-action.js.map +1 -1
- package/dist/esm/schemas/types/recurrence-frequency.d.ts +4 -0
- package/dist/esm/schemas/types/recurrence-frequency.js +2 -0
- package/dist/esm/schemas/types/recurrence-frequency.js.map +1 -0
- package/dist/esm/schemas/types/system-color-name.d.ts +6 -0
- package/dist/esm/schemas/types/system-color-name.js +2 -0
- package/dist/esm/schemas/types/system-color-name.js.map +1 -0
- package/dist/esm/sub-definitions/calendar-access.d.ts +26 -14
- package/dist/esm/sub-definitions/calendar-access.js.map +1 -1
- package/dist/esm/sub-definitions/calendar-operations.d.ts +68 -21
- package/dist/esm/sub-definitions/calendar-operations.js.map +1 -1
- package/dist/esm/sub-definitions/event-operations.d.ts +46 -25
- package/dist/esm/sub-definitions/event-operations.js.map +1 -1
- package/dist/esm/sub-definitions/reminders-access.d.ts +6 -2
- package/dist/esm/sub-definitions/reminders-access.js.map +1 -1
- package/dist/esm/sub-definitions/reminders-operations.d.ts +78 -43
- package/dist/esm/sub-definitions/reminders-operations.js.map +1 -1
- package/dist/esm/web/download-ics-file.d.ts +18 -0
- package/dist/esm/web/download-ics-file.js +33 -0
- package/dist/esm/web/download-ics-file.js.map +1 -0
- package/dist/esm/web/ics.d.ts +27 -0
- package/dist/esm/web/ics.js +294 -0
- package/dist/esm/web/ics.js.map +1 -0
- package/dist/esm/web.d.ts +70 -82
- package/dist/esm/web.js +121 -6
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +479 -35
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +479 -35
- package/dist/plugin.js.map +1 -1
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/CapacitorCalendarPlugin.swift +190 -77
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Implementation/CapacitorCalendar.swift +203 -110
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Models/Enums/EventSpan.swift +8 -0
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CreateCalendarInput.swift +6 -4
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CreateEventInput.swift +25 -21
- package/ios/Plugin/Models/Inputs/CreateEventWithPromptInput.swift +171 -0
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CreateReminderInput.swift +14 -4
- package/ios/Plugin/Models/Inputs/CreateRemindersListInput.swift +43 -0
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteCalendarInput.swift +1 -1
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteEventInput.swift +9 -4
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteEventWithPromptInput.swift +9 -4
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteEventsByIdInput.swift +9 -4
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteReminderInput.swift +7 -1
- package/ios/Plugin/Models/Inputs/DeleteRemindersListInput.swift +22 -0
- package/ios/Plugin/Models/Inputs/GetDefaultCalendarInput.swift +13 -0
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ModifyCalendarInput.swift +6 -3
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ModifyEventInput.swift +63 -41
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ModifyReminderInput.swift +66 -5
- package/ios/Plugin/Models/Inputs/UpdateRemindersListInput.swift +41 -0
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateEventResult.swift +1 -0
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateEventWithPromptResult.swift +1 -0
- package/ios/Plugin/Models/Results/CreateRemindersListResult.swift +15 -0
- package/ios/Plugin/Models/Results/ListEventsInRangeResult.swift +29 -0
- package/ios/Plugin/Models/Results/UpdateRemindersListResult.swift +15 -0
- package/ios/Plugin/Models/Structs/RecurrenceInput.swift +41 -0
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/PluginConfig.swift +30 -27
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/PluginError.swift +87 -56
- package/ios/Plugin/Utils/DeclarationCheck.swift +63 -0
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Utils/ImplementationHelper.swift +140 -24
- package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Utils/UIColorFromHexExtension.swift +5 -0
- package/package.json +36 -43
- package/dist/esm/schemas/enums/recurrence-frequency.d.ts +0 -21
- package/dist/esm/schemas/enums/recurrence-frequency.js +0 -23
- package/dist/esm/schemas/enums/recurrence-frequency.js.map +0 -1
- package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/CreateEventWithPromptInput.swift +0 -89
- package/ios/Sources/CapacitorCalendarPlugin/Models/Results/ListEventsInRangeResult.swift +0 -16
- package/ios/Tests/CapacitorCalendarPluginTests/CapacitorCalendarPluginTests.swift +0 -15
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Enums/CAPPermissionState.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Enums/CalendarPermissionScope.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Enums/EventEditAction.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CheckPermissionInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteReminderWithPromptInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteRemindersByIdInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/GetReminderByIdInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/GetRemindersFromListsInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ListEventsInRangeInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ModifyEventWithPromptInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/OpenCalendarInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/RequestPermissionInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/SelectCalendarsWithPromptInput.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CheckAllPermissionsResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CheckPermissionResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateCalendarResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateReminderResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/DeleteEventWithPromptResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/DeleteEventsByIdResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/DeleteRemindersByIdResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/FetchAllCalendarSourcesResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/GetDefaultCalendarResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/GetReminderByIdResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/GetRemindersFromListsResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/ListCalendarsResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/ModifyEventWithPromptResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/RequestAllPermissionsResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/RequestPermissionResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/SelectCalendarsWithPromptResult.swift +0 -0
- /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Templates/JSResult.swift +0 -0
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import EventKit
|
|
2
2
|
import Capacitor
|
|
3
|
+
import UIKit
|
|
3
4
|
|
|
4
5
|
struct ImplementationHelper {
|
|
6
|
+
/// Default calendar color when `color` is omitted: `#007AFF` (light-mode iOS system blue).
|
|
7
|
+
static let defaultCalendarColorHex = "#007AFF"
|
|
8
|
+
|
|
9
|
+
/// Reads a JS number that may arrive as `Int`, `Double`, or `NSNumber`.
|
|
10
|
+
static func int(from value: Any?) -> Int? {
|
|
11
|
+
guard let value = value, !(value is NSNull) else { return nil }
|
|
12
|
+
if let number = value as? NSNumber { return number.intValue }
|
|
13
|
+
if let intValue = value as? Int { return intValue }
|
|
14
|
+
if let doubleValue = value as? Double { return Int(doubleValue) }
|
|
15
|
+
return nil
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/// Reads a JS number that may arrive as `Int`, `Double`, or `NSNumber`.
|
|
19
|
+
static func double(from value: Any?) -> Double? {
|
|
20
|
+
guard let value = value, !(value is NSNull) else { return nil }
|
|
21
|
+
if let number = value as? NSNumber { return number.doubleValue }
|
|
22
|
+
if let doubleValue = value as? Double { return doubleValue }
|
|
23
|
+
if let intValue = value as? Int { return Double(intValue) }
|
|
24
|
+
return nil
|
|
25
|
+
}
|
|
26
|
+
|
|
5
27
|
static func permissionStateToResult(state: EKAuthorizationStatus, scope: CalendarPermissionScope ) throws -> CAPPermissionState {
|
|
6
28
|
var result: CAPPermissionState
|
|
7
29
|
|
|
@@ -107,37 +129,84 @@ struct ImplementationHelper {
|
|
|
107
129
|
guard let components = color.components else { return nil }
|
|
108
130
|
|
|
109
131
|
if components.count == 2 {
|
|
110
|
-
let gray = Float(components[0])
|
|
111
|
-
let alpha = Float(components[1])
|
|
112
|
-
return alpha
|
|
113
|
-
? String(format: "#%02lX%02lX%02lX
|
|
114
|
-
: String(format: "#%02lX%02lX%02lX",
|
|
132
|
+
let gray = lroundf(Float(components[0]) * 255)
|
|
133
|
+
let alpha = lroundf(Float(components[1]) * 255)
|
|
134
|
+
return alpha == 255
|
|
135
|
+
? String(format: "#%02lX%02lX%02lX", gray, gray, gray)
|
|
136
|
+
: String(format: "#%02lX%02lX%02lX%02lX", gray, gray, gray, alpha)
|
|
115
137
|
}
|
|
116
138
|
|
|
117
139
|
guard components.count >= 3 else { return nil }
|
|
118
140
|
|
|
119
|
-
let red = Float(components[0])
|
|
120
|
-
let green = Float(components[1])
|
|
121
|
-
let blue = Float(components[2])
|
|
122
|
-
let alpha = components.count == 4 ? Float(components[3]) :
|
|
141
|
+
let red = lroundf(Float(components[0]) * 255)
|
|
142
|
+
let green = lroundf(Float(components[1]) * 255)
|
|
143
|
+
let blue = lroundf(Float(components[2]) * 255)
|
|
144
|
+
let alpha = components.count == 4 ? lroundf(Float(components[3]) * 255) : 255
|
|
145
|
+
|
|
146
|
+
return alpha == 255
|
|
147
|
+
? String(format: "#%02lX%02lX%02lX", red, green, blue)
|
|
148
|
+
: String(format: "#%02lX%02lX%02lX%02lX", red, green, blue, alpha)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/// Named system color or hex (`#RRGGBB` / `#RRGGBBAA`). Throws `invalidColor` when neither matches.
|
|
152
|
+
static func listColor(from colorString: String) throws -> CGColor {
|
|
153
|
+
if let namedColor = systemColor(named: colorString) {
|
|
154
|
+
return namedColor.cgColor
|
|
155
|
+
}
|
|
156
|
+
let trimmed = colorString.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
157
|
+
guard trimmed.hasPrefix("#") else {
|
|
158
|
+
throw PluginError.invalidColor
|
|
159
|
+
}
|
|
160
|
+
return try UIColor.fromHex(trimmed).cgColor
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/// Best-effort match of a stored calendar color to a known `UIColor.system*` name.
|
|
164
|
+
static func systemColorName(from color: CGColor) -> String? {
|
|
165
|
+
guard let hex = cgColorToHex(color) else { return nil }
|
|
166
|
+
for (name, systemColor) in systemColorPalette {
|
|
167
|
+
if cgColorToHex(systemColor.cgColor) == hex {
|
|
168
|
+
return name
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return nil
|
|
172
|
+
}
|
|
123
173
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
174
|
+
private static let systemColorPalette: [(String, UIColor)] = [
|
|
175
|
+
("blue", .systemBlue),
|
|
176
|
+
("brown", .systemBrown),
|
|
177
|
+
("gray", .systemGray),
|
|
178
|
+
("green", .systemGreen),
|
|
179
|
+
("indigo", .systemIndigo),
|
|
180
|
+
("orange", .systemOrange),
|
|
181
|
+
("pink", .systemPink),
|
|
182
|
+
("purple", .systemPurple),
|
|
183
|
+
("red", .systemRed),
|
|
184
|
+
("teal", .systemTeal),
|
|
185
|
+
("yellow", .systemYellow)
|
|
186
|
+
]
|
|
187
|
+
|
|
188
|
+
private static func systemColor(named colorName: String) -> UIColor? {
|
|
189
|
+
let key = colorName.lowercased()
|
|
190
|
+
return systemColorPalette.first(where: { $0.0 == key })?.1
|
|
127
191
|
}
|
|
128
192
|
|
|
129
|
-
static func deleteReminder(reminderId: String, eventStore: EKEventStore) throws {
|
|
193
|
+
static func deleteReminder(reminderId: String, eventStore: EKEventStore, commit: Bool = true) throws {
|
|
130
194
|
guard let reminder = eventStore.calendarItem(withIdentifier: reminderId) as? EKReminder else {
|
|
131
195
|
throw PluginError.reminderNotFound
|
|
132
196
|
}
|
|
133
|
-
try eventStore.remove(reminder, commit:
|
|
197
|
+
try eventStore.remove(reminder, commit: commit)
|
|
134
198
|
}
|
|
135
199
|
|
|
136
|
-
static func deleteEvent(_ id: String, _ span:
|
|
200
|
+
static func deleteEvent(commit: Bool, _ id: String, _ span: EventSpan, _ eventStore: EKEventStore) throws {
|
|
137
201
|
guard let event = eventStore.event(withIdentifier: id) else {
|
|
138
202
|
throw PluginError.eventNotFound
|
|
139
203
|
}
|
|
140
|
-
|
|
204
|
+
switch span {
|
|
205
|
+
case .thisEvent:
|
|
206
|
+
try eventStore.remove(event, span: .thisEvent, commit: commit)
|
|
207
|
+
case .thisAndFutureEvents:
|
|
208
|
+
try eventStore.remove(event, span: .futureEvents, commit: commit)
|
|
209
|
+
}
|
|
141
210
|
}
|
|
142
211
|
|
|
143
212
|
static func calendarsSetToJSArray(_ calendars: Set<EKCalendar>) -> [JSObject] {
|
|
@@ -153,6 +222,7 @@ struct ImplementationHelper {
|
|
|
153
222
|
"id": calendar.calendarIdentifier,
|
|
154
223
|
"title": calendar.title,
|
|
155
224
|
"color": ImplementationHelper.cgColorToHex(calendar.cgColor) ?? NSNull(),
|
|
225
|
+
"colorName": ImplementationHelper.systemColorName(from: calendar.cgColor) ?? NSNull(),
|
|
156
226
|
"isImmutable": calendar.isImmutable,
|
|
157
227
|
"allowsContentModifications": calendar.allowsContentModifications,
|
|
158
228
|
"type": calendar.type.rawValue,
|
|
@@ -231,13 +301,15 @@ struct ImplementationHelper {
|
|
|
231
301
|
return result
|
|
232
302
|
}
|
|
233
303
|
rules.forEach { rule in
|
|
304
|
+
guard let frequency = RecurrenceInput.Frequency.from(ekFrequency: rule.frequency) else {
|
|
305
|
+
return
|
|
306
|
+
}
|
|
234
307
|
var obj = JSObject()
|
|
235
|
-
obj["frequency"] =
|
|
308
|
+
obj["frequency"] = frequency.rawValue
|
|
236
309
|
obj["interval"] = rule.interval
|
|
237
|
-
if let recurrenceEnd = rule.recurrenceEnd
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
obj["end"] = NSNull()
|
|
310
|
+
if let recurrenceEnd = rule.recurrenceEnd,
|
|
311
|
+
let endMs = ImplementationHelper.dateToMillis(recurrenceEnd.endDate) {
|
|
312
|
+
obj["end"] = endMs
|
|
241
313
|
}
|
|
242
314
|
result.append(obj)
|
|
243
315
|
}
|
|
@@ -255,15 +327,28 @@ struct ImplementationHelper {
|
|
|
255
327
|
return result
|
|
256
328
|
}
|
|
257
329
|
|
|
258
|
-
static func eventToJSObject(
|
|
330
|
+
static func eventToJSObject(
|
|
331
|
+
_ event: EKEvent,
|
|
332
|
+
eventStore: EKEventStore,
|
|
333
|
+
seriesStartDateCache: inout [String: Double]
|
|
334
|
+
) -> JSObject {
|
|
335
|
+
let startDateMillis = ImplementationHelper.dateToMillis(event.startDate) ?? 0
|
|
259
336
|
var obj: JSObject = [
|
|
260
337
|
"id": event.eventIdentifier,
|
|
338
|
+
"masterId": NSNull(),
|
|
261
339
|
"title": event.title,
|
|
262
340
|
"calendarId": event.calendar?.calendarIdentifier ?? NSNull(),
|
|
341
|
+
"calendarItemExternalIdentifier": event.calendarItemExternalIdentifier ?? NSNull(),
|
|
263
342
|
"location": event.location ?? NSNull(),
|
|
264
|
-
"startDate":
|
|
343
|
+
"startDate": startDateMillis,
|
|
344
|
+
"seriesStartDate": ImplementationHelper.seriesStartDateMillis(
|
|
345
|
+
for: event,
|
|
346
|
+
occurrenceStartMillis: startDateMillis,
|
|
347
|
+
eventStore: eventStore,
|
|
348
|
+
cache: &seriesStartDateCache
|
|
349
|
+
),
|
|
265
350
|
"endDate": ImplementationHelper.dateToMillis(event.endDate) ?? NSNull(),
|
|
266
|
-
"
|
|
351
|
+
"isAllDay": event.isAllDay,
|
|
267
352
|
"alerts": ImplementationHelper.alarmsToJSObject(event.alarms),
|
|
268
353
|
"url": event.url?.absoluteString ?? NSNull(),
|
|
269
354
|
"description": event.notes ?? NSNull(),
|
|
@@ -272,6 +357,7 @@ struct ImplementationHelper {
|
|
|
272
357
|
"color": ImplementationHelper.cgColorToHex(event.calendar.cgColor) ?? NSNull(),
|
|
273
358
|
"duration": NSNull(),
|
|
274
359
|
"isDetached": event.isDetached,
|
|
360
|
+
"isPartOfSeries": event.hasRecurrenceRules || event.isDetached,
|
|
275
361
|
"birthdayContactIdentifier": event.birthdayContactIdentifier ?? NSNull(),
|
|
276
362
|
"status": ImplementationHelper.mapEKEventStatusToEventStatus(event.status),
|
|
277
363
|
"attendees": []
|
|
@@ -297,6 +383,36 @@ struct ImplementationHelper {
|
|
|
297
383
|
return obj
|
|
298
384
|
}
|
|
299
385
|
|
|
386
|
+
/// Series start in ms. Non-recurring and detached use the occurrence start.
|
|
387
|
+
/// Recurring non-detached use the first occurrence from `event(withIdentifier:)`, cached per call.
|
|
388
|
+
static func seriesStartDateMillis(
|
|
389
|
+
for event: EKEvent,
|
|
390
|
+
occurrenceStartMillis: Double,
|
|
391
|
+
eventStore: EKEventStore,
|
|
392
|
+
cache: inout [String: Double]
|
|
393
|
+
) -> Double {
|
|
394
|
+
if event.isDetached || !event.hasRecurrenceRules {
|
|
395
|
+
return occurrenceStartMillis
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
guard let identifier = event.eventIdentifier else {
|
|
399
|
+
return occurrenceStartMillis
|
|
400
|
+
}
|
|
401
|
+
if let cached = cache[identifier] {
|
|
402
|
+
return cached
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
let seriesStart: Double
|
|
406
|
+
if let firstOccurrence = eventStore.event(withIdentifier: identifier),
|
|
407
|
+
let millis = ImplementationHelper.dateToMillis(firstOccurrence.startDate) {
|
|
408
|
+
seriesStart = millis
|
|
409
|
+
} else {
|
|
410
|
+
seriesStart = occurrenceStartMillis
|
|
411
|
+
}
|
|
412
|
+
cache[identifier] = seriesStart
|
|
413
|
+
return seriesStart
|
|
414
|
+
}
|
|
415
|
+
|
|
300
416
|
static func eventAttendeeToJSObject(_ attendee: EKParticipant) -> JSObject {
|
|
301
417
|
var obj: JSObject = [
|
|
302
418
|
"email": NSNull(),
|
|
@@ -10,6 +10,11 @@ extension UIColor {
|
|
|
10
10
|
|
|
11
11
|
guard cleanedHex.count == 6 || cleanedHex.count == 8 else { throw PluginError.invalidColor }
|
|
12
12
|
|
|
13
|
+
let hexDigits = CharacterSet(charactersIn: "0123456789ABCDEF")
|
|
14
|
+
guard cleanedHex.unicodeScalars.allSatisfy({ hexDigits.contains($0) }) else {
|
|
15
|
+
throw PluginError.invalidColor
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
var rgbValue: UInt64 = 0
|
|
14
19
|
Scanner(string: cleanedHex).scanHexInt64(&rgbValue)
|
|
15
20
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebarooni/capacitor-calendar",
|
|
3
|
-
"version": "7.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "7.4.0",
|
|
4
|
+
"description": "A Capacitor plugin for native calendar events on iOS and Android (with reminders on iOS), and .ics event creation on the web.",
|
|
5
5
|
"author": "Ehsan Barooni",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://ebarooni.github.io/capacitor-calendar",
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"eventkit",
|
|
22
22
|
"ionic"
|
|
23
23
|
],
|
|
24
|
-
"engines": {
|
|
25
|
-
"node": ">=20.12.2"
|
|
26
|
-
},
|
|
27
24
|
"publishConfig": {
|
|
28
25
|
"access": "public"
|
|
29
26
|
},
|
|
@@ -35,72 +32,68 @@
|
|
|
35
32
|
"dist/",
|
|
36
33
|
"android/src/main/",
|
|
37
34
|
"android/build.gradle",
|
|
38
|
-
"ios/
|
|
39
|
-
"ios/Tests",
|
|
35
|
+
"ios/Plugin",
|
|
40
36
|
"Package.swift",
|
|
41
37
|
"EbarooniCapacitorCalendar.podspec",
|
|
42
38
|
"LICENSE"
|
|
43
39
|
],
|
|
44
40
|
"scripts": {
|
|
41
|
+
"bootstrap:app": "npm run install:lib && npm run build && npm run install:app && npm run build:app && npm run sync:app",
|
|
45
42
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
46
43
|
"build:app": "cd example-app && npm run build",
|
|
47
|
-
"bootstrap:app": "npm run build && npm run install:app && npm run build:app && npm run sync:app",
|
|
48
44
|
"clean": "rimraf ./dist",
|
|
45
|
+
"docgen": "docgen --api CapacitorCalendarPlugin --output-readme README.md --output-json dist/docs.json && prettier --write README.md",
|
|
46
|
+
"eslint": "eslint . --ext ts",
|
|
47
|
+
"fmt": "npm run eslint -- --fix && npm run prettier:fix && npm run swiftlint -- --fix --format && npm run fmt:android",
|
|
48
|
+
"fmt:android": "npm run ktlint -- -F",
|
|
49
|
+
"install:app": "cd example-app && npm i",
|
|
50
|
+
"install:lib": "npm i",
|
|
51
|
+
"ktlint": "ktlint",
|
|
52
|
+
"lint": "npm run eslint && npm run prettier:check && npm run swiftlint -- lint && npm run lint:android",
|
|
53
|
+
"lint:android": "npm run ktlint",
|
|
54
|
+
"pod:install": "cd ios && pod install --repo-update",
|
|
55
|
+
"prepublishOnly": "npm run build",
|
|
49
56
|
"prettier": "npx prettier",
|
|
50
57
|
"prettier:check": "npm run prettier -- . --check",
|
|
51
58
|
"prettier:fix": "npm run prettier -- . --write",
|
|
52
|
-
"eslint": "npx eslint",
|
|
53
|
-
"eslint:fix": "npm run eslint -- --fix",
|
|
54
|
-
"fmt": "npm run fmt:web && npm run fmt:android && npm run fmt:ios",
|
|
55
|
-
"fmt:android": "ktlint -F",
|
|
56
|
-
"fmt:ios": "npx swiftlint --fix --format",
|
|
57
|
-
"fmt:web": "npm run eslint:fix && npm run prettier:fix",
|
|
58
|
-
"install:app": "cd example-app && npm i",
|
|
59
|
-
"lint": "npm run lint:web && npm run lint:android && npm run lint:ios",
|
|
60
|
-
"lint:android": "npx ktlint",
|
|
61
|
-
"lint:ios": "npx swiftlint lint",
|
|
62
|
-
"lint:web": "npm run eslint && npm run prettier:check",
|
|
63
59
|
"spm:install": "swift package resolve",
|
|
60
|
+
"swiftlint": "node-swiftlint",
|
|
64
61
|
"sync:app": "cd example-app && npx cap sync",
|
|
65
62
|
"typedoc": "npx typedoc",
|
|
66
|
-
"docgen": "docgen --api CapacitorCalendarPlugin --output-readme README.md --output-json dist/docs.json",
|
|
67
63
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
68
|
-
"verify:ios": "xcodebuild build -scheme EbarooniCapacitorCalendar -destination generic/platform=iOS",
|
|
69
64
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
65
|
+
"verify:ios": "xcodebuild build -scheme EbarooniCapacitorCalendar -destination generic/platform=iOS",
|
|
70
66
|
"verify:web": "npm run build",
|
|
71
|
-
"
|
|
72
|
-
"version:patch": "npm version patch --git-tag-version false",
|
|
67
|
+
"version:major": "npm version major --git-tag-version false",
|
|
73
68
|
"version:minor": "npm version minor --git-tag-version false",
|
|
74
|
-
"version:
|
|
69
|
+
"version:patch": "npm version patch --git-tag-version false"
|
|
75
70
|
},
|
|
76
71
|
"devDependencies": {
|
|
77
72
|
"@capacitor/android": "^7.0.0",
|
|
78
73
|
"@capacitor/core": "^7.0.0",
|
|
79
74
|
"@capacitor/ios": "^7.0.0",
|
|
80
|
-
"@ebarooni/capacitor-docgen": "^0.0
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"
|
|
86
|
-
"@eslint/markdown": "^6.2.2",
|
|
87
|
-
"angular-eslint": "^19.0.2",
|
|
88
|
-
"eslint": "^9.19.0",
|
|
89
|
-
"eslint-config-prettier": "^10.0.1",
|
|
90
|
-
"eslint-plugin-promise": "^7.2.1",
|
|
75
|
+
"@ebarooni/capacitor-docgen": "^0.1.0",
|
|
76
|
+
"@ionic/eslint-config": "0.4.0",
|
|
77
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
78
|
+
"@ionic/swiftlint-config": "2.0.0",
|
|
79
|
+
"@types/node": "^25.0.3",
|
|
80
|
+
"eslint": "8.57.0",
|
|
91
81
|
"prettier": "^3.3.2",
|
|
92
|
-
"
|
|
93
|
-
"
|
|
82
|
+
"prettier-plugin-java": "^2.7.7",
|
|
83
|
+
"rimraf": "^6.1.0",
|
|
84
|
+
"rollup": "^4.53.3",
|
|
94
85
|
"swiftlint": "^2.0.0",
|
|
95
|
-
"typedoc": "^0.
|
|
96
|
-
"typescript": "
|
|
97
|
-
"typescript-eslint": "^8.22.0"
|
|
86
|
+
"typedoc": "^0.28.15",
|
|
87
|
+
"typescript": "^5.9.3"
|
|
98
88
|
},
|
|
99
89
|
"peerDependencies": {
|
|
100
|
-
"@capacitor/core": ">=7.0.0"
|
|
90
|
+
"@capacitor/core": ">=7.0.0 <8.0.0"
|
|
91
|
+
},
|
|
92
|
+
"eslintConfig": {
|
|
93
|
+
"extends": "@ionic/eslint-config/recommended"
|
|
101
94
|
},
|
|
102
|
-
"prettier": "@
|
|
103
|
-
"swiftlint": "@
|
|
95
|
+
"prettier": "@ionic/prettier-config",
|
|
96
|
+
"swiftlint": "@ionic/swiftlint-config",
|
|
104
97
|
"capacitor": {
|
|
105
98
|
"ios": {
|
|
106
99
|
"src": "ios"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @since 7.1.0
|
|
3
|
-
*/
|
|
4
|
-
export declare enum RecurrenceFrequency {
|
|
5
|
-
/**
|
|
6
|
-
* @since 7.1.0
|
|
7
|
-
*/
|
|
8
|
-
DAILY = 0,
|
|
9
|
-
/**
|
|
10
|
-
* @since 7.1.0
|
|
11
|
-
*/
|
|
12
|
-
WEEKLY = 1,
|
|
13
|
-
/**
|
|
14
|
-
* @since 7.1.0
|
|
15
|
-
*/
|
|
16
|
-
MONTHLY = 2,
|
|
17
|
-
/**
|
|
18
|
-
* @since 7.1.0
|
|
19
|
-
*/
|
|
20
|
-
YEARLY = 3
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @since 7.1.0
|
|
3
|
-
*/
|
|
4
|
-
export var RecurrenceFrequency;
|
|
5
|
-
(function (RecurrenceFrequency) {
|
|
6
|
-
/**
|
|
7
|
-
* @since 7.1.0
|
|
8
|
-
*/
|
|
9
|
-
RecurrenceFrequency[RecurrenceFrequency["DAILY"] = 0] = "DAILY";
|
|
10
|
-
/**
|
|
11
|
-
* @since 7.1.0
|
|
12
|
-
*/
|
|
13
|
-
RecurrenceFrequency[RecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY";
|
|
14
|
-
/**
|
|
15
|
-
* @since 7.1.0
|
|
16
|
-
*/
|
|
17
|
-
RecurrenceFrequency[RecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY";
|
|
18
|
-
/**
|
|
19
|
-
* @since 7.1.0
|
|
20
|
-
*/
|
|
21
|
-
RecurrenceFrequency[RecurrenceFrequency["YEARLY"] = 3] = "YEARLY";
|
|
22
|
-
})(RecurrenceFrequency || (RecurrenceFrequency = {}));
|
|
23
|
-
//# sourceMappingURL=recurrence-frequency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recurrence-frequency.js","sourceRoot":"","sources":["../../../../src/schemas/enums/recurrence-frequency.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,mBAiBX;AAjBD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,+DAAK,CAAA;IACL;;OAEG;IACH,iEAAM,CAAA;IACN;;OAEG;IACH,mEAAO,CAAA;IACP;;OAEG;IACH,iEAAM,CAAA;AACR,CAAC,EAjBW,mBAAmB,KAAnB,mBAAmB,QAiB9B","sourcesContent":["/**\n * @since 7.1.0\n */\nexport enum RecurrenceFrequency {\n /**\n * @since 7.1.0\n */\n DAILY,\n /**\n * @since 7.1.0\n */\n WEEKLY,\n /**\n * @since 7.1.0\n */\n MONTHLY,\n /**\n * @since 7.1.0\n */\n YEARLY,\n}\n"]}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import Capacitor
|
|
2
|
-
import EventKit
|
|
3
|
-
|
|
4
|
-
struct CreateEventWithPromptInput {
|
|
5
|
-
private let title: String
|
|
6
|
-
private let isAllDay: Bool
|
|
7
|
-
private var alerts: [Double]
|
|
8
|
-
private var calendarId: String?
|
|
9
|
-
private var location: String?
|
|
10
|
-
private var startDate: Double?
|
|
11
|
-
private var endDate: Double?
|
|
12
|
-
private var url: String?
|
|
13
|
-
private var description: String?
|
|
14
|
-
private var availability: EKEventAvailability?
|
|
15
|
-
|
|
16
|
-
init(call: CAPPluginCall) {
|
|
17
|
-
self.title = call.getString("title", "")
|
|
18
|
-
if let calendarId = call.getString("calendarId") {
|
|
19
|
-
self.calendarId = calendarId
|
|
20
|
-
}
|
|
21
|
-
if let location = call.getString("location") {
|
|
22
|
-
self.location = location
|
|
23
|
-
}
|
|
24
|
-
if let startDate = call.getDouble("startDate") as Double? {
|
|
25
|
-
self.startDate = startDate
|
|
26
|
-
}
|
|
27
|
-
if let endDate = call.getDouble("endDate") as Double? {
|
|
28
|
-
self.endDate = endDate
|
|
29
|
-
}
|
|
30
|
-
self.isAllDay = call.getBool("isAllDay", false)
|
|
31
|
-
if let alerts = call.getArray("alerts", []) as? [Double] {
|
|
32
|
-
self.alerts = alerts
|
|
33
|
-
} else {
|
|
34
|
-
self.alerts = []
|
|
35
|
-
}
|
|
36
|
-
if let url = call.getString("url") {
|
|
37
|
-
self.url = url
|
|
38
|
-
}
|
|
39
|
-
if let description = call.getString("description") {
|
|
40
|
-
self.description = description
|
|
41
|
-
}
|
|
42
|
-
if let availability = call.getInt("availability") {
|
|
43
|
-
self.availability = EKEventAvailability(rawValue: availability)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
func getTitle() -> String {
|
|
48
|
-
return title
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
func getIsAllDay() -> Bool {
|
|
52
|
-
return isAllDay
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
func getAlerts() -> [EKAlarm] {
|
|
56
|
-
return alerts.map { EKAlarm(relativeOffset: $0 * 60) }
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
func getCalendar(from eventStore: EKEventStore) -> EKCalendar? {
|
|
60
|
-
return ImplementationHelper.getCalendarFromId(eventStore: eventStore, calendarId: calendarId, fallback: true)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
func getLocation() -> String? {
|
|
64
|
-
return location
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
func getStartDate() -> Date? {
|
|
68
|
-
guard let startDate = startDate else { return nil }
|
|
69
|
-
return ImplementationHelper.dateFromTimestamp(startDate)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
func getEndDate() -> Date? {
|
|
73
|
-
guard let endDate = endDate else { return nil }
|
|
74
|
-
return ImplementationHelper.dateFromTimestamp(endDate)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
func getUrl() -> URL? {
|
|
78
|
-
guard let url = url else { return nil }
|
|
79
|
-
return URL(string: url)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
func getDescription() -> String? {
|
|
83
|
-
return description
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
func getAvailability() -> EKEventAvailability? {
|
|
87
|
-
return availability
|
|
88
|
-
}
|
|
89
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Capacitor
|
|
2
|
-
import EventKit
|
|
3
|
-
|
|
4
|
-
struct ListEventsInRangeResult: JSResult {
|
|
5
|
-
private let events: [EKEvent]
|
|
6
|
-
|
|
7
|
-
init(_ events: [EKEvent]) {
|
|
8
|
-
self.events = events
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
func toJSON() -> JSObject {
|
|
12
|
-
var result = JSObject()
|
|
13
|
-
result["result"] = events.map { ImplementationHelper.eventToJSObject($0) }
|
|
14
|
-
return result
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import XCTest
|
|
2
|
-
@testable import CapacitorCalendarPlugin
|
|
3
|
-
|
|
4
|
-
class CapacitorCalendarTests: XCTestCase {
|
|
5
|
-
func testEcho() {
|
|
6
|
-
// This is an example of a functional test case for a plugin.
|
|
7
|
-
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
8
|
-
|
|
9
|
-
let implementation = CapacitorCalendar()
|
|
10
|
-
let value = "Hello, World!"
|
|
11
|
-
let result = implementation.echo(value)
|
|
12
|
-
|
|
13
|
-
XCTAssertEqual(value, result)
|
|
14
|
-
}
|
|
15
|
-
}
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Enums/CAPPermissionState.swift
RENAMED
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Enums/CalendarPermissionScope.swift
RENAMED
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CheckPermissionInput.swift
RENAMED
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteRemindersByIdInput.swift
RENAMED
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/GetReminderByIdInput.swift
RENAMED
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ListEventsInRangeInput.swift
RENAMED
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/OpenCalendarInput.swift
RENAMED
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/RequestPermissionInput.swift
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CheckPermissionResult.swift
RENAMED
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateCalendarResult.swift
RENAMED
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateReminderResult.swift
RENAMED
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/DeleteEventsByIdResult.swift
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/GetReminderByIdResult.swift
RENAMED
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/ListCalendarsResult.swift
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/RequestPermissionResult.swift
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|