@ebarooni/capacitor-calendar 7.1.0 → 8.0.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 (149) hide show
  1. package/EbarooniCapacitorCalendar.podspec +2 -2
  2. package/Package.swift +4 -4
  3. package/README.md +238 -162
  4. package/android/build.gradle +20 -18
  5. package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +17 -0
  6. package/android/src/main/java/dev/barooni/capacitor/calendar/PluginError.kt +2 -0
  7. package/android/src/main/java/dev/barooni/capacitor/calendar/implementation/CapacitorCalendar.kt +105 -61
  8. package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/EventRecurrenceRule.kt +135 -0
  9. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateEventInput.kt +1 -0
  10. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateEventWithPromptInput.kt +5 -0
  11. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyCalendarInput.kt +13 -0
  12. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyEvent.kt +2 -0
  13. package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyEventWithPromptInput.kt +3 -0
  14. package/android/src/main/java/dev/barooni/capacitor/calendar/utils/ImplementationHelper.kt +48 -4
  15. package/dist/docs.json +792 -330
  16. package/dist/esm/definitions.d.ts +5 -5
  17. package/dist/esm/definitions.js.map +1 -1
  18. package/dist/esm/index.d.ts +47 -45
  19. package/dist/esm/index.js +16 -17
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/schemas/enums/attendee-role.js.map +1 -1
  22. package/dist/esm/schemas/enums/attendee-status.js.map +1 -1
  23. package/dist/esm/schemas/enums/attendee-type.js.map +1 -1
  24. package/dist/esm/schemas/enums/calendar-permission-scope.js.map +1 -1
  25. package/dist/esm/schemas/enums/event-status.js.map +1 -1
  26. package/dist/esm/schemas/interfaces/calendar-event.d.ts +7 -5
  27. package/dist/esm/schemas/interfaces/calendar-event.js.map +1 -1
  28. package/dist/esm/schemas/interfaces/calendar-source.d.ts +1 -1
  29. package/dist/esm/schemas/interfaces/calendar-source.js.map +1 -1
  30. package/dist/esm/schemas/interfaces/calendar.d.ts +2 -2
  31. package/dist/esm/schemas/interfaces/calendar.js.map +1 -1
  32. package/dist/esm/schemas/interfaces/create-event-options.d.ts +63 -46
  33. package/dist/esm/schemas/interfaces/create-event-options.js.map +1 -1
  34. package/dist/esm/schemas/interfaces/create-event-with-prompt-options.d.ts +42 -31
  35. package/dist/esm/schemas/interfaces/create-event-with-prompt-options.js.map +1 -1
  36. package/dist/esm/schemas/interfaces/create-reminder-options.d.ts +10 -1
  37. package/dist/esm/schemas/interfaces/create-reminder-options.js.map +1 -1
  38. package/dist/esm/schemas/interfaces/delete-event-options.d.ts +1 -1
  39. package/dist/esm/schemas/interfaces/delete-event-options.js.map +1 -1
  40. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.d.ts +1 -1
  41. package/dist/esm/schemas/interfaces/delete-event-with-prompt-options.js.map +1 -1
  42. package/dist/esm/schemas/interfaces/delete-events-by-id-options.d.ts +1 -1
  43. package/dist/esm/schemas/interfaces/delete-events-by-id-options.js.map +1 -1
  44. package/dist/esm/schemas/interfaces/delete-reminder-with-prompt-options.d.ts +35 -0
  45. package/dist/esm/schemas/interfaces/delete-reminder-with-prompt-options.js +2 -0
  46. package/dist/esm/schemas/interfaces/delete-reminder-with-prompt-options.js.map +1 -0
  47. package/dist/esm/schemas/interfaces/event-recurrence-rule.d.ts +96 -0
  48. package/dist/esm/schemas/interfaces/event-recurrence-rule.js +2 -0
  49. package/dist/esm/schemas/interfaces/event-recurrence-rule.js.map +1 -0
  50. package/dist/esm/schemas/interfaces/modify-calendar-options.d.ts +21 -0
  51. package/dist/esm/schemas/interfaces/modify-calendar-options.js +2 -0
  52. package/dist/esm/schemas/interfaces/modify-calendar-options.js.map +1 -0
  53. package/dist/esm/schemas/interfaces/modify-event-options.d.ts +61 -44
  54. package/dist/esm/schemas/interfaces/modify-event-options.js.map +1 -1
  55. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.d.ts +1 -1
  56. package/dist/esm/schemas/interfaces/modify-event-with-prompt-options.js.map +1 -1
  57. package/dist/esm/schemas/interfaces/modify-reminder-options.d.ts +12 -1
  58. package/dist/esm/schemas/interfaces/modify-reminder-options.js.map +1 -1
  59. package/dist/esm/schemas/interfaces/recurrence-rule.d.ts +1 -1
  60. package/dist/esm/schemas/interfaces/recurrence-rule.js.map +1 -1
  61. package/dist/esm/schemas/interfaces/reminder-recurrence-rule.d.ts +1 -1
  62. package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js.map +1 -1
  63. package/dist/esm/schemas/interfaces/reminder.d.ts +1 -1
  64. package/dist/esm/schemas/interfaces/reminder.js.map +1 -1
  65. package/dist/esm/schemas/interfaces/reminders-list.d.ts +2 -2
  66. package/dist/esm/schemas/interfaces/reminders-list.js.map +1 -1
  67. package/dist/esm/schemas/interfaces/select-calendars-with-prompt-options.d.ts +1 -1
  68. package/dist/esm/schemas/interfaces/select-calendars-with-prompt-options.js.map +1 -1
  69. package/dist/esm/schemas/types/event-edit-action.d.ts +1 -1
  70. package/dist/esm/schemas/types/event-edit-action.js.map +1 -1
  71. package/dist/esm/schemas/types/recurrence-frequency.d.ts +4 -0
  72. package/dist/esm/schemas/types/recurrence-frequency.js +2 -0
  73. package/dist/esm/schemas/types/recurrence-frequency.js.map +1 -0
  74. package/dist/esm/sub-definitions/calendar-access.d.ts +4 -4
  75. package/dist/esm/sub-definitions/calendar-access.js.map +1 -1
  76. package/dist/esm/sub-definitions/calendar-operations.d.ts +14 -6
  77. package/dist/esm/sub-definitions/calendar-operations.js.map +1 -1
  78. package/dist/esm/sub-definitions/event-operations.d.ts +10 -10
  79. package/dist/esm/sub-definitions/event-operations.js.map +1 -1
  80. package/dist/esm/sub-definitions/reminders-access.d.ts +1 -1
  81. package/dist/esm/sub-definitions/reminders-access.js.map +1 -1
  82. package/dist/esm/sub-definitions/reminders-operations.d.ts +19 -9
  83. package/dist/esm/sub-definitions/reminders-operations.js.map +1 -1
  84. package/dist/esm/web.d.ts +37 -30
  85. package/dist/esm/web.js +7 -1
  86. package/dist/esm/web.js.map +1 -1
  87. package/dist/plugin.cjs.js +7 -24
  88. package/dist/plugin.cjs.js.map +1 -1
  89. package/dist/plugin.js +7 -24
  90. package/dist/plugin.js.map +1 -1
  91. package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/CapacitorCalendarPlugin.swift +110 -65
  92. package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Implementation/CapacitorCalendar.swift +83 -59
  93. package/ios/Plugin/Info.plist +24 -0
  94. package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CreateEventInput.swift +25 -21
  95. package/ios/Plugin/Models/Inputs/CreateEventWithPromptInput.swift +171 -0
  96. package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CreateReminderInput.swift +2 -2
  97. package/ios/Plugin/Models/Inputs/DeleteReminderWithPromptInput.swift +46 -0
  98. package/ios/Plugin/Models/Inputs/ModifyCalendarInput.swift +32 -0
  99. package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ModifyEventInput.swift +63 -41
  100. package/ios/Plugin/Models/Structs/RecurrenceInput.swift +31 -0
  101. package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/PluginConfig.swift +3 -1
  102. package/package.json +37 -45
  103. package/dist/esm/schemas/enums/recurrence-frequency.d.ts +0 -21
  104. package/dist/esm/schemas/enums/recurrence-frequency.js +0 -23
  105. package/dist/esm/schemas/enums/recurrence-frequency.js.map +0 -1
  106. package/ios/Sources/CapacitorCalendarPlugin/Models/Inputs/CreateEventWithPromptInput.swift +0 -89
  107. package/ios/Tests/CapacitorCalendarPluginTests/CapacitorCalendarPluginTests.swift +0 -15
  108. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Enums/CAPPermissionState.swift +0 -0
  109. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Enums/CalendarPermissionScope.swift +0 -0
  110. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Enums/EventEditAction.swift +0 -0
  111. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CheckPermissionInput.swift +0 -0
  112. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/CreateCalendarInput.swift +0 -0
  113. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteCalendarInput.swift +0 -0
  114. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteEventInput.swift +0 -0
  115. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteEventWithPromptInput.swift +0 -0
  116. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteEventsByIdInput.swift +0 -0
  117. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteReminderInput.swift +0 -0
  118. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/DeleteRemindersByIdInput.swift +0 -0
  119. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/GetReminderByIdInput.swift +0 -0
  120. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/GetRemindersFromListsInput.swift +0 -0
  121. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ListEventsInRangeInput.swift +0 -0
  122. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ModifyEventWithPromptInput.swift +0 -0
  123. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/ModifyReminderInput.swift +0 -0
  124. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/OpenCalendarInput.swift +0 -0
  125. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/RequestPermissionInput.swift +0 -0
  126. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Inputs/SelectCalendarsWithPromptInput.swift +0 -0
  127. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CheckAllPermissionsResult.swift +0 -0
  128. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CheckPermissionResult.swift +0 -0
  129. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateCalendarResult.swift +0 -0
  130. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateEventResult.swift +0 -0
  131. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateEventWithPromptResult.swift +0 -0
  132. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/CreateReminderResult.swift +0 -0
  133. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/DeleteEventWithPromptResult.swift +0 -0
  134. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/DeleteEventsByIdResult.swift +0 -0
  135. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/DeleteRemindersByIdResult.swift +0 -0
  136. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/FetchAllCalendarSourcesResult.swift +0 -0
  137. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/GetDefaultCalendarResult.swift +0 -0
  138. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/GetReminderByIdResult.swift +0 -0
  139. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/GetRemindersFromListsResult.swift +0 -0
  140. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/ListCalendarsResult.swift +0 -0
  141. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/ListEventsInRangeResult.swift +0 -0
  142. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/ModifyEventWithPromptResult.swift +0 -0
  143. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/RequestAllPermissionsResult.swift +0 -0
  144. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/RequestPermissionResult.swift +0 -0
  145. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Results/SelectCalendarsWithPromptResult.swift +0 -0
  146. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Models/Templates/JSResult.swift +0 -0
  147. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/PluginError.swift +0 -0
  148. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Utils/ImplementationHelper.swift +0 -0
  149. /package/ios/{Sources/CapacitorCalendarPlugin → Plugin}/Utils/UIColorFromHexExtension.swift +0 -0
@@ -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,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
- }