@ebarooni/capacitor-calendar 7.3.0 → 7.5.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/README.md +49 -3
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +70 -25
- package/android/src/main/java/dev/barooni/capacitor/calendar/PluginError.kt +45 -22
- package/android/src/main/java/dev/barooni/capacitor/calendar/implementation/CapacitorCalendar.kt +1 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/data/CalendarInfo.kt +1 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/CreateEventInput.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/ModifyEvent.kt +8 -2
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/inputs/ModifyEventWithPromptInput.kt +1 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/GetDefaultCalendarResult.kt +1 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/models/results/ListCalendarsResult.kt +1 -1
- 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 +27 -2
- package/android/src/main/java/dev/barooni/capacitor/calendar/utils/PluginCallRejecter.kt +69 -0
- package/dist/docs.json +2 -2
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/schemas/enums/capacitor-calendar-error-code.d.ts +44 -0
- package/dist/esm/schemas/enums/capacitor-calendar-error-code.js +46 -0
- package/dist/esm/schemas/enums/capacitor-calendar-error-code.js.map +1 -0
- package/dist/esm/schemas/interfaces/calendar.d.ts +3 -1
- package/dist/esm/schemas/interfaces/calendar.js.map +1 -1
- package/dist/plugin.cjs.js +46 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +46 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorCalendarPlugin.swift +66 -22
- package/ios/Plugin/PluginError.swift +47 -0
- package/ios/Plugin/Utils/DeclarationCheck.swift +63 -0
- package/ios/Plugin/Utils/PluginCallRejecter.swift +36 -0
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
package dev.barooni.capacitor.calendar.utils
|
|
2
|
+
|
|
3
|
+
import android.Manifest
|
|
4
|
+
import android.content.Context
|
|
5
|
+
import android.content.pm.PackageManager
|
|
6
|
+
import android.os.Build
|
|
7
|
+
import dev.barooni.capacitor.calendar.PluginError
|
|
8
|
+
import dev.barooni.capacitor.calendar.models.enums.CalendarPermissionScope
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Early AndroidManifest permission checks for EB-CLDR-0100 MissingDeclaration.
|
|
12
|
+
* Callers pass only the permissions the method actually uses.
|
|
13
|
+
*/
|
|
14
|
+
class DeclarationCheck(
|
|
15
|
+
private val context: Context,
|
|
16
|
+
) {
|
|
17
|
+
/**
|
|
18
|
+
* Throws [PluginError.MissingDeclaration] when a required AndroidManifest permission is not declared.
|
|
19
|
+
*/
|
|
20
|
+
fun ensureManifestPermissions(vararg permissions: String) {
|
|
21
|
+
for (permission in permissions) {
|
|
22
|
+
if (!isPermissionDeclared(permission)) {
|
|
23
|
+
throw PluginError.MissingDeclaration(permission)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
fun ensureManifestPermissionsForScope(scope: CalendarPermissionScope) {
|
|
29
|
+
when (scope) {
|
|
30
|
+
CalendarPermissionScope.READ_CALENDAR -> {
|
|
31
|
+
ensureManifestPermissions(Manifest.permission.READ_CALENDAR)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
CalendarPermissionScope.WRITE_CALENDAR -> {
|
|
35
|
+
ensureManifestPermissions(Manifest.permission.WRITE_CALENDAR)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
CalendarPermissionScope.READ_REMINDERS,
|
|
39
|
+
CalendarPermissionScope.WRITE_REMINDERS,
|
|
40
|
+
-> {
|
|
41
|
+
Unit
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private fun isPermissionDeclared(permission: String): Boolean {
|
|
47
|
+
val packageInfo =
|
|
48
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
49
|
+
context.packageManager.getPackageInfo(
|
|
50
|
+
context.packageName,
|
|
51
|
+
PackageManager.PackageInfoFlags.of(PackageManager.GET_PERMISSIONS.toLong()),
|
|
52
|
+
)
|
|
53
|
+
} else {
|
|
54
|
+
@Suppress("DEPRECATION")
|
|
55
|
+
context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_PERMISSIONS)
|
|
56
|
+
}
|
|
57
|
+
return packageInfo.requestedPermissions?.contains(permission) == true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -123,7 +123,7 @@ class ImplementationHelper {
|
|
|
123
123
|
|
|
124
124
|
fun jsArrayToLongArray(array: JSArray): List<Long> {
|
|
125
125
|
val list = array.toList<String>()
|
|
126
|
-
return list.map { it.toLongOrNull() ?: throw PluginError.
|
|
126
|
+
return list.map { it.toLongOrNull() ?: throw PluginError.InvalidEventId }
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
fun hexToColorInt(hex: String?): Int? {
|
|
@@ -294,6 +294,7 @@ class ImplementationHelper {
|
|
|
294
294
|
CalendarContract.Calendars.MAX_REMINDERS,
|
|
295
295
|
CalendarContract.Calendars.CALENDAR_LOCATION,
|
|
296
296
|
CalendarContract.Calendars.IS_PRIMARY,
|
|
297
|
+
CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL,
|
|
297
298
|
)
|
|
298
299
|
|
|
299
300
|
val calendars = mutableListOf<CalendarInfo>()
|
|
@@ -385,14 +386,38 @@ class ImplementationHelper {
|
|
|
385
386
|
cursor.getColumnIndexOrThrow(CalendarContract.Calendars.IS_PRIMARY).let {
|
|
386
387
|
if (it < 0) null else cursor.getInt(it) == 1
|
|
387
388
|
}
|
|
389
|
+
val accessLevel =
|
|
390
|
+
cursor.getColumnIndex(CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL).let {
|
|
391
|
+
if (it < 0 || cursor.isNull(it)) null else cursor.getInt(it)
|
|
392
|
+
}
|
|
388
393
|
calendars.add(
|
|
389
|
-
CalendarInfo(
|
|
394
|
+
CalendarInfo(
|
|
395
|
+
id,
|
|
396
|
+
title,
|
|
397
|
+
internalName,
|
|
398
|
+
color,
|
|
399
|
+
visible,
|
|
400
|
+
accountName,
|
|
401
|
+
ownerAccount,
|
|
402
|
+
maxReminders,
|
|
403
|
+
location,
|
|
404
|
+
isPrimary,
|
|
405
|
+
allowsContentModifications(accessLevel),
|
|
406
|
+
),
|
|
390
407
|
)
|
|
391
408
|
}
|
|
392
409
|
}
|
|
393
410
|
return calendars
|
|
394
411
|
}
|
|
395
412
|
|
|
413
|
+
/**
|
|
414
|
+
* Whether events can be added to a calendar with the given `CALENDAR_ACCESS_LEVEL`: contributor
|
|
415
|
+
* access or above, the same threshold the AOSP Calendar app uses. `null` when the provider did
|
|
416
|
+
* not report a level.
|
|
417
|
+
*/
|
|
418
|
+
fun allowsContentModifications(accessLevel: Int?): Boolean? =
|
|
419
|
+
accessLevel?.let { it >= CalendarContract.Calendars.CAL_ACCESS_CONTRIBUTOR }
|
|
420
|
+
|
|
396
421
|
fun requiresInstanceDateForDelete(
|
|
397
422
|
cr: ContentResolver,
|
|
398
423
|
eventId: Long,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
package dev.barooni.capacitor.calendar.utils
|
|
2
|
+
|
|
3
|
+
import android.content.ActivityNotFoundException
|
|
4
|
+
import com.getcapacitor.PluginCall
|
|
5
|
+
import dev.barooni.capacitor.calendar.PluginError
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Maps thrown exceptions to [PluginError] and rejects the Capacitor call.
|
|
9
|
+
*/
|
|
10
|
+
object PluginCallRejecter {
|
|
11
|
+
fun reject(
|
|
12
|
+
call: PluginCall,
|
|
13
|
+
error: Exception?,
|
|
14
|
+
) {
|
|
15
|
+
val pluginError = toPluginError(error)
|
|
16
|
+
val message =
|
|
17
|
+
pluginError?.message
|
|
18
|
+
?: error?.message
|
|
19
|
+
?: PluginError.CustomError("An unknown error has occurred.").message
|
|
20
|
+
call.reject(message, pluginError?.code)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fun toPluginError(error: Exception?): PluginError? =
|
|
24
|
+
when (error) {
|
|
25
|
+
is PluginError -> {
|
|
26
|
+
error
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
is ActivityNotFoundException -> {
|
|
30
|
+
PluginError.NotSupported(
|
|
31
|
+
wrapSystemError("Failed to launch calendar app.", error.message),
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
is SecurityException -> {
|
|
36
|
+
PluginError.PermissionDenied(
|
|
37
|
+
wrapSystemError("Calendar permission was denied.", error.message),
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
null -> {
|
|
42
|
+
null
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
else -> {
|
|
46
|
+
PluginError.IoError(
|
|
47
|
+
wrapSystemError(
|
|
48
|
+
"An I/O error occurred while accessing the calendar.",
|
|
49
|
+
error.message,
|
|
50
|
+
),
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Lead with the stable plugin sentence; append a different non-blank OS message in parentheses.
|
|
57
|
+
*/
|
|
58
|
+
fun wrapSystemError(
|
|
59
|
+
canonicalMessage: String,
|
|
60
|
+
systemMessage: String?,
|
|
61
|
+
): String {
|
|
62
|
+
val detail = systemMessage?.trim().orEmpty()
|
|
63
|
+
return if (detail.isEmpty() || detail == canonicalMessage) {
|
|
64
|
+
canonicalMessage
|
|
65
|
+
} else {
|
|
66
|
+
"$canonicalMessage ($detail)"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
package/dist/docs.json
CHANGED
|
@@ -3896,7 +3896,7 @@
|
|
|
3896
3896
|
"name": "allowsContentModifications",
|
|
3897
3897
|
"tags": [
|
|
3898
3898
|
{
|
|
3899
|
-
"text": "iOS",
|
|
3899
|
+
"text": "Android, iOS",
|
|
3900
3900
|
"name": "platform"
|
|
3901
3901
|
},
|
|
3902
3902
|
{
|
|
@@ -3904,7 +3904,7 @@
|
|
|
3904
3904
|
"name": "since"
|
|
3905
3905
|
}
|
|
3906
3906
|
],
|
|
3907
|
-
"docs": "",
|
|
3907
|
+
"docs": "Whether events can be added to or changed in this calendar.",
|
|
3908
3908
|
"complexTypes": [],
|
|
3909
3909
|
"type": "boolean | null"
|
|
3910
3910
|
},
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-di
|
|
|
6
6
|
import { CalendarPermissionScope } from './schemas/enums/calendar-permission-scope';
|
|
7
7
|
import { CalendarSourceType } from './schemas/enums/calendar-source-type';
|
|
8
8
|
import { CalendarType } from './schemas/enums/calendar-type';
|
|
9
|
+
import { CapacitorCalendarErrorCode } from './schemas/enums/capacitor-calendar-error-code';
|
|
9
10
|
import { EventAvailability } from './schemas/enums/event-availability';
|
|
10
11
|
import { EventSpan } from './schemas/enums/event-span';
|
|
11
12
|
import { EventStatus } from './schemas/enums/event-status';
|
|
@@ -69,4 +70,4 @@ import { downloadIcsFile } from './web/download-ics-file';
|
|
|
69
70
|
declare const CapacitorCalendar: CapacitorCalendarPlugin;
|
|
70
71
|
export * from './definitions';
|
|
71
72
|
export type { Calendar, CalendarEvent, CalendarSource, CheckAllPermissionsResult, CheckPermissionOptions, CreateCalendarOptions, CreateCalendarResult, CreateEventOptions, CreateEventResult, CreateEventWithPromptOptions, CreateEventWithPromptResult, CreateReminderOptions, CreateReminderResult, CreateRemindersListOptions, CreateRemindersListResult, DeleteCalendarOptions, DeleteEventOptions, DeleteEventWithPromptOptions, DeleteEventsByIdOptions, DeleteEventsByIdResult, DeleteReminderOptions, DeleteReminderWithPromptOptions, DeleteReminderWithPromptResult, DeleteRemindersByIdOptions, DeleteRemindersByIdResult, DeleteRemindersListOptions, EventEditAction, EventGuest, FetchAllCalendarSourcesResult, GetDefaultCalendarOptions, GetDefaultRemindersListResult, GetReminderByIdOptions, GetReminderByIdResult, GetRemindersFromListsOptions, GetRemindersFromListsResult, GetRemindersListsResult, ListCalendarsResult, ListEventsInRangeOptions, ListEventsInRangeResult, ModifyCalendarOptions, ModifyEventOptions, ModifyEventWithPromptOptions, ModifyReminderOptions, OpenCalendarOptions, RecurrenceRule, Reminder, ReminderRecurrenceRule, RemindersList, RequestAllPermissionsResult, RequestPermissionOptions, SelectCalendarsWithPromptOptions, SelectCalendarsWithPromptResult, SystemColorName, UpdateRemindersListOptions, UpdateRemindersListResult, };
|
|
72
|
-
export { CalendarPermissionScope, EventAvailability, EventSpan, CalendarChooserDisplayStyle, CalendarType, CalendarSourceType, ReminderRecurrenceFrequency, RecurrenceFrequency, EventStatus, AttendeeRole, AttendeeType, AttendeeStatus, CapacitorCalendar, downloadIcsFile, };
|
|
73
|
+
export { CalendarPermissionScope, CapacitorCalendarErrorCode, EventAvailability, EventSpan, CalendarChooserDisplayStyle, CalendarType, CalendarSourceType, ReminderRecurrenceFrequency, RecurrenceFrequency, EventStatus, AttendeeRole, AttendeeType, AttendeeStatus, CapacitorCalendar, downloadIcsFile, };
|
package/dist/esm/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-di
|
|
|
6
6
|
import { CalendarPermissionScope } from './schemas/enums/calendar-permission-scope';
|
|
7
7
|
import { CalendarSourceType } from './schemas/enums/calendar-source-type';
|
|
8
8
|
import { CalendarType } from './schemas/enums/calendar-type';
|
|
9
|
+
import { CapacitorCalendarErrorCode } from './schemas/enums/capacitor-calendar-error-code';
|
|
9
10
|
import { EventAvailability } from './schemas/enums/event-availability';
|
|
10
11
|
import { EventSpan } from './schemas/enums/event-span';
|
|
11
12
|
import { EventStatus } from './schemas/enums/event-status';
|
|
@@ -15,5 +16,5 @@ const CapacitorCalendar = registerPlugin('CapacitorCalendar', {
|
|
|
15
16
|
web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),
|
|
16
17
|
});
|
|
17
18
|
export * from './definitions';
|
|
18
|
-
export { CalendarPermissionScope, EventAvailability, EventSpan, CalendarChooserDisplayStyle, CalendarType, CalendarSourceType, ReminderRecurrenceFrequency, EventStatus, AttendeeRole, AttendeeType, AttendeeStatus, CapacitorCalendar, downloadIcsFile, };
|
|
19
|
+
export { CalendarPermissionScope, CapacitorCalendarErrorCode, EventAvailability, EventSpan, CalendarChooserDisplayStyle, CalendarType, CalendarSourceType, ReminderRecurrenceFrequency, EventStatus, AttendeeRole, AttendeeType, AttendeeStatus, CapacitorCalendar, downloadIcsFile, };
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAwD5F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,iBAAiB,GAAG,cAAc,CAA0B,mBAAmB,EAAE;IACrF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AA0D9B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,2BAA2B,EAC3B,YAAY,EACZ,kBAAkB,EAClB,2BAA2B,EAE3B,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { CapacitorCalendarPlugin } from './definitions';\nimport { AttendeeRole } from './schemas/enums/attendee-role';\nimport { AttendeeStatus } from './schemas/enums/attendee-status';\nimport { AttendeeType } from './schemas/enums/attendee-type';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarPermissionScope } from './schemas/enums/calendar-permission-scope';\nimport { CalendarSourceType } from './schemas/enums/calendar-source-type';\nimport { CalendarType } from './schemas/enums/calendar-type';\nimport { EventAvailability } from './schemas/enums/event-availability';\nimport { EventSpan } from './schemas/enums/event-span';\nimport { EventStatus } from './schemas/enums/event-status';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { CalendarEvent } from './schemas/interfaces/calendar-event';\nimport type { CalendarSource } from './schemas/interfaces/calendar-source';\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 { EventGuest } from './schemas/interfaces/event-guest';\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 { RecurrenceRule } from './schemas/interfaces/recurrence-rule';\nimport type { Reminder } from './schemas/interfaces/reminder';\nimport type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';\nimport type { RemindersList } from './schemas/interfaces/reminders-list';\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 { RecurrenceFrequency } from './schemas/types/recurrence-frequency';\nimport type { SystemColorName } from './schemas/types/system-color-name';\nimport type { CheckAllPermissionsResult, RequestAllPermissionsResult } from './sub-definitions/calendar-access';\nimport type { DeleteEventsByIdResult } from './sub-definitions/event-operations';\nimport { downloadIcsFile } from './web/download-ics-file';\n\nconst CapacitorCalendar = registerPlugin<CapacitorCalendarPlugin>('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\n\nexport * from './definitions';\nexport type {\n Calendar,\n CalendarEvent,\n CalendarSource,\n CheckAllPermissionsResult,\n CheckPermissionOptions,\n CreateCalendarOptions,\n CreateCalendarResult,\n CreateEventOptions,\n CreateEventResult,\n CreateEventWithPromptOptions,\n CreateEventWithPromptResult,\n CreateReminderOptions,\n CreateReminderResult,\n CreateRemindersListOptions,\n CreateRemindersListResult,\n DeleteCalendarOptions,\n DeleteEventOptions,\n DeleteEventWithPromptOptions,\n DeleteEventsByIdOptions,\n DeleteEventsByIdResult,\n DeleteReminderOptions,\n DeleteReminderWithPromptOptions,\n DeleteReminderWithPromptResult,\n DeleteRemindersByIdOptions,\n DeleteRemindersByIdResult,\n DeleteRemindersListOptions,\n EventEditAction,\n EventGuest,\n FetchAllCalendarSourcesResult,\n GetDefaultCalendarOptions,\n GetDefaultRemindersListResult,\n GetReminderByIdOptions,\n GetReminderByIdResult,\n GetRemindersFromListsOptions,\n GetRemindersFromListsResult,\n GetRemindersListsResult,\n ListCalendarsResult,\n ListEventsInRangeOptions,\n ListEventsInRangeResult,\n ModifyCalendarOptions,\n ModifyEventOptions,\n ModifyEventWithPromptOptions,\n ModifyReminderOptions,\n OpenCalendarOptions,\n RecurrenceRule,\n Reminder,\n ReminderRecurrenceRule,\n RemindersList,\n RequestAllPermissionsResult,\n RequestPermissionOptions,\n SelectCalendarsWithPromptOptions,\n SelectCalendarsWithPromptResult,\n SystemColorName,\n UpdateRemindersListOptions,\n UpdateRemindersListResult,\n};\nexport {\n CalendarPermissionScope,\n EventAvailability,\n EventSpan,\n CalendarChooserDisplayStyle,\n CalendarType,\n CalendarSourceType,\n ReminderRecurrenceFrequency,\n RecurrenceFrequency,\n EventStatus,\n AttendeeRole,\n AttendeeType,\n AttendeeStatus,\n CapacitorCalendar,\n downloadIcsFile,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAwD5F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,iBAAiB,GAAG,cAAc,CAA0B,mBAAmB,EAAE;IACrF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;CACrE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AA0D9B,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,iBAAiB,EACjB,SAAS,EACT,2BAA2B,EAC3B,YAAY,EACZ,kBAAkB,EAClB,2BAA2B,EAE3B,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { CapacitorCalendarPlugin } from './definitions';\nimport { AttendeeRole } from './schemas/enums/attendee-role';\nimport { AttendeeStatus } from './schemas/enums/attendee-status';\nimport { AttendeeType } from './schemas/enums/attendee-type';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarPermissionScope } from './schemas/enums/calendar-permission-scope';\nimport { CalendarSourceType } from './schemas/enums/calendar-source-type';\nimport { CalendarType } from './schemas/enums/calendar-type';\nimport { CapacitorCalendarErrorCode } from './schemas/enums/capacitor-calendar-error-code';\nimport { EventAvailability } from './schemas/enums/event-availability';\nimport { EventSpan } from './schemas/enums/event-span';\nimport { EventStatus } from './schemas/enums/event-status';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nimport type { Calendar } from './schemas/interfaces/calendar';\nimport type { CalendarEvent } from './schemas/interfaces/calendar-event';\nimport type { CalendarSource } from './schemas/interfaces/calendar-source';\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 { EventGuest } from './schemas/interfaces/event-guest';\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 { RecurrenceRule } from './schemas/interfaces/recurrence-rule';\nimport type { Reminder } from './schemas/interfaces/reminder';\nimport type { ReminderRecurrenceRule } from './schemas/interfaces/reminder-recurrence-rule';\nimport type { RemindersList } from './schemas/interfaces/reminders-list';\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 { RecurrenceFrequency } from './schemas/types/recurrence-frequency';\nimport type { SystemColorName } from './schemas/types/system-color-name';\nimport type { CheckAllPermissionsResult, RequestAllPermissionsResult } from './sub-definitions/calendar-access';\nimport type { DeleteEventsByIdResult } from './sub-definitions/event-operations';\nimport { downloadIcsFile } from './web/download-ics-file';\n\nconst CapacitorCalendar = registerPlugin<CapacitorCalendarPlugin>('CapacitorCalendar', {\n web: () => import('./web').then((m) => new m.CapacitorCalendarWeb()),\n});\n\nexport * from './definitions';\nexport type {\n Calendar,\n CalendarEvent,\n CalendarSource,\n CheckAllPermissionsResult,\n CheckPermissionOptions,\n CreateCalendarOptions,\n CreateCalendarResult,\n CreateEventOptions,\n CreateEventResult,\n CreateEventWithPromptOptions,\n CreateEventWithPromptResult,\n CreateReminderOptions,\n CreateReminderResult,\n CreateRemindersListOptions,\n CreateRemindersListResult,\n DeleteCalendarOptions,\n DeleteEventOptions,\n DeleteEventWithPromptOptions,\n DeleteEventsByIdOptions,\n DeleteEventsByIdResult,\n DeleteReminderOptions,\n DeleteReminderWithPromptOptions,\n DeleteReminderWithPromptResult,\n DeleteRemindersByIdOptions,\n DeleteRemindersByIdResult,\n DeleteRemindersListOptions,\n EventEditAction,\n EventGuest,\n FetchAllCalendarSourcesResult,\n GetDefaultCalendarOptions,\n GetDefaultRemindersListResult,\n GetReminderByIdOptions,\n GetReminderByIdResult,\n GetRemindersFromListsOptions,\n GetRemindersFromListsResult,\n GetRemindersListsResult,\n ListCalendarsResult,\n ListEventsInRangeOptions,\n ListEventsInRangeResult,\n ModifyCalendarOptions,\n ModifyEventOptions,\n ModifyEventWithPromptOptions,\n ModifyReminderOptions,\n OpenCalendarOptions,\n RecurrenceRule,\n Reminder,\n ReminderRecurrenceRule,\n RemindersList,\n RequestAllPermissionsResult,\n RequestPermissionOptions,\n SelectCalendarsWithPromptOptions,\n SelectCalendarsWithPromptResult,\n SystemColorName,\n UpdateRemindersListOptions,\n UpdateRemindersListResult,\n};\nexport {\n CalendarPermissionScope,\n CapacitorCalendarErrorCode,\n EventAvailability,\n EventSpan,\n CalendarChooserDisplayStyle,\n CalendarType,\n CalendarSourceType,\n ReminderRecurrenceFrequency,\n RecurrenceFrequency,\n EventStatus,\n AttendeeRole,\n AttendeeType,\n AttendeeStatus,\n CapacitorCalendar,\n downloadIcsFile,\n};\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable reject codes for CapacitorCalendar. Compare with `error.code`.
|
|
3
|
+
*
|
|
4
|
+
* @since 7.4.0
|
|
5
|
+
*/
|
|
6
|
+
export declare enum CapacitorCalendarErrorCode {
|
|
7
|
+
/**
|
|
8
|
+
* Missing or invalid method arguments.
|
|
9
|
+
*
|
|
10
|
+
* @since 7.5.0
|
|
11
|
+
*/
|
|
12
|
+
InvalidArgument = "EB-CLDR-0001",
|
|
13
|
+
/**
|
|
14
|
+
* Requested calendar, event, list, reminder, or calendar source was not found.
|
|
15
|
+
*
|
|
16
|
+
* @since 7.5.0
|
|
17
|
+
*/
|
|
18
|
+
NotFound = "EB-CLDR-0002",
|
|
19
|
+
/**
|
|
20
|
+
* A calendar store read or write failed.
|
|
21
|
+
*
|
|
22
|
+
* @since 7.5.0
|
|
23
|
+
*/
|
|
24
|
+
IoError = "EB-CLDR-0004",
|
|
25
|
+
/**
|
|
26
|
+
* The device cannot open the calendar UI, reminders UI, or target URL.
|
|
27
|
+
*
|
|
28
|
+
* @since 7.5.0
|
|
29
|
+
*/
|
|
30
|
+
NotSupported = "EB-CLDR-0005",
|
|
31
|
+
/**
|
|
32
|
+
* Calendar access was denied.
|
|
33
|
+
* On Android, calendar operations that fail with a permission error reject with this code. Permission check and request APIs still resolve `"denied"` on Android and iOS.
|
|
34
|
+
*
|
|
35
|
+
* @since 7.5.0
|
|
36
|
+
*/
|
|
37
|
+
PermissionDenied = "EB-CLDR-0020",
|
|
38
|
+
/**
|
|
39
|
+
* Missing Info.plist usage description or AndroidManifest permission declaration.
|
|
40
|
+
*
|
|
41
|
+
* @since 7.4.0
|
|
42
|
+
*/
|
|
43
|
+
MissingDeclaration = "EB-CLDR-0100"
|
|
44
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable reject codes for CapacitorCalendar. Compare with `error.code`.
|
|
3
|
+
*
|
|
4
|
+
* @since 7.4.0
|
|
5
|
+
*/
|
|
6
|
+
export var CapacitorCalendarErrorCode;
|
|
7
|
+
(function (CapacitorCalendarErrorCode) {
|
|
8
|
+
/**
|
|
9
|
+
* Missing or invalid method arguments.
|
|
10
|
+
*
|
|
11
|
+
* @since 7.5.0
|
|
12
|
+
*/
|
|
13
|
+
CapacitorCalendarErrorCode["InvalidArgument"] = "EB-CLDR-0001";
|
|
14
|
+
/**
|
|
15
|
+
* Requested calendar, event, list, reminder, or calendar source was not found.
|
|
16
|
+
*
|
|
17
|
+
* @since 7.5.0
|
|
18
|
+
*/
|
|
19
|
+
CapacitorCalendarErrorCode["NotFound"] = "EB-CLDR-0002";
|
|
20
|
+
/**
|
|
21
|
+
* A calendar store read or write failed.
|
|
22
|
+
*
|
|
23
|
+
* @since 7.5.0
|
|
24
|
+
*/
|
|
25
|
+
CapacitorCalendarErrorCode["IoError"] = "EB-CLDR-0004";
|
|
26
|
+
/**
|
|
27
|
+
* The device cannot open the calendar UI, reminders UI, or target URL.
|
|
28
|
+
*
|
|
29
|
+
* @since 7.5.0
|
|
30
|
+
*/
|
|
31
|
+
CapacitorCalendarErrorCode["NotSupported"] = "EB-CLDR-0005";
|
|
32
|
+
/**
|
|
33
|
+
* Calendar access was denied.
|
|
34
|
+
* On Android, calendar operations that fail with a permission error reject with this code. Permission check and request APIs still resolve `"denied"` on Android and iOS.
|
|
35
|
+
*
|
|
36
|
+
* @since 7.5.0
|
|
37
|
+
*/
|
|
38
|
+
CapacitorCalendarErrorCode["PermissionDenied"] = "EB-CLDR-0020";
|
|
39
|
+
/**
|
|
40
|
+
* Missing Info.plist usage description or AndroidManifest permission declaration.
|
|
41
|
+
*
|
|
42
|
+
* @since 7.4.0
|
|
43
|
+
*/
|
|
44
|
+
CapacitorCalendarErrorCode["MissingDeclaration"] = "EB-CLDR-0100";
|
|
45
|
+
})(CapacitorCalendarErrorCode || (CapacitorCalendarErrorCode = {}));
|
|
46
|
+
//# sourceMappingURL=capacitor-calendar-error-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacitor-calendar-error-code.js","sourceRoot":"","sources":["../../../../src/schemas/enums/capacitor-calendar-error-code.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,0BA2CX;AA3CD,WAAY,0BAA0B;IACpC;;;;OAIG;IACH,8DAAgC,CAAA;IAEhC;;;;OAIG;IACH,uDAAyB,CAAA;IAEzB;;;;OAIG;IACH,sDAAwB,CAAA;IAExB;;;;OAIG;IACH,2DAA6B,CAAA;IAE7B;;;;;OAKG;IACH,+DAAiC,CAAA;IAEjC;;;;OAIG;IACH,iEAAmC,CAAA;AACrC,CAAC,EA3CW,0BAA0B,KAA1B,0BAA0B,QA2CrC","sourcesContent":["/**\n * Stable reject codes for CapacitorCalendar. Compare with `error.code`.\n *\n * @since 7.4.0\n */\nexport enum CapacitorCalendarErrorCode {\n /**\n * Missing or invalid method arguments.\n *\n * @since 7.5.0\n */\n InvalidArgument = 'EB-CLDR-0001',\n\n /**\n * Requested calendar, event, list, reminder, or calendar source was not found.\n *\n * @since 7.5.0\n */\n NotFound = 'EB-CLDR-0002',\n\n /**\n * A calendar store read or write failed.\n *\n * @since 7.5.0\n */\n IoError = 'EB-CLDR-0004',\n\n /**\n * The device cannot open the calendar UI, reminders UI, or target URL.\n *\n * @since 7.5.0\n */\n NotSupported = 'EB-CLDR-0005',\n\n /**\n * Calendar access was denied.\n * On Android, calendar operations that fail with a permission error reject with this code. Permission check and request APIs still resolve `\"denied\"` on Android and iOS.\n *\n * @since 7.5.0\n */\n PermissionDenied = 'EB-CLDR-0020',\n\n /**\n * Missing Info.plist usage description or AndroidManifest permission declaration.\n *\n * @since 7.4.0\n */\n MissingDeclaration = 'EB-CLDR-0100',\n}\n"]}
|
|
@@ -50,7 +50,9 @@ export interface Calendar {
|
|
|
50
50
|
*/
|
|
51
51
|
isImmutable: boolean | null;
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Whether events can be added to or changed in this calendar.
|
|
54
|
+
*
|
|
55
|
+
* @platform Android, iOS
|
|
54
56
|
* @since 7.1.0
|
|
55
57
|
*/
|
|
56
58
|
allowsContentModifications: boolean | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/calendar.ts"],"names":[],"mappings":"","sourcesContent":["import type { CalendarType } from '../enums/calendar-type';\nimport type { SystemColorName } from '../types/system-color-name';\n\nimport type { CalendarSource } from './calendar-source';\n\n/**\n * @since 7.1.0\n */\nexport interface Calendar {\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n id: string;\n /**\n * Display title of the calendar.\n * May be `null` when the platform does not provide a title.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n title: string | null;\n /**\n * Internal name of the calendar (`CalendarContract.Calendars.NAME`).\n *\n * @platform Android\n * @since 7.1.0\n */\n internalTitle: string | null;\n /**\n * Hex color string, or null when none is available.\n *\n * Format: `#RRGGBB` when opaque; `#RRGGBBAA` when alpha is below fully opaque.\n *\n * @platform Android, iOS\n * @example #0000FF\n * @example #0000FF80\n * @since 7.1.0\n */\n color: string | null;\n /**\n * Named color if the stored color matches one of the system colors;\n * otherwise null. May be null in dark mode or for custom hex. Always null on Android.\n *\n * @platform Android, iOS\n * @since 7.3.0\n */\n colorName?: SystemColorName | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n isImmutable: boolean | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n allowsContentModifications: boolean | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n type: CalendarType | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n isSubscribed: boolean | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n source: CalendarSource | null;\n /**\n * Indicates if the events from this calendar should be shown.\n *\n * @platform Android\n * @since 7.1.0\n */\n visible: boolean | null;\n /**\n * The account under which the calendar is registered.\n *\n * @platform Android\n * @since 7.1.0\n */\n accountName: string | null;\n /**\n * The owner of the calendar.\n *\n * @platform Android\n * @since 7.1.0\n */\n ownerAccount: string | null;\n /**\n * Maximum number of reminders allowed per event.\n *\n * @platform Android\n * @since 7.1.0\n */\n maxReminders: number | null;\n /**\n * @platform Android\n * @since 7.1.0\n */\n location: string | null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/calendar.ts"],"names":[],"mappings":"","sourcesContent":["import type { CalendarType } from '../enums/calendar-type';\nimport type { SystemColorName } from '../types/system-color-name';\n\nimport type { CalendarSource } from './calendar-source';\n\n/**\n * @since 7.1.0\n */\nexport interface Calendar {\n /**\n * @platform Android, iOS\n * @since 7.1.0\n */\n id: string;\n /**\n * Display title of the calendar.\n * May be `null` when the platform does not provide a title.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n title: string | null;\n /**\n * Internal name of the calendar (`CalendarContract.Calendars.NAME`).\n *\n * @platform Android\n * @since 7.1.0\n */\n internalTitle: string | null;\n /**\n * Hex color string, or null when none is available.\n *\n * Format: `#RRGGBB` when opaque; `#RRGGBBAA` when alpha is below fully opaque.\n *\n * @platform Android, iOS\n * @example #0000FF\n * @example #0000FF80\n * @since 7.1.0\n */\n color: string | null;\n /**\n * Named color if the stored color matches one of the system colors;\n * otherwise null. May be null in dark mode or for custom hex. Always null on Android.\n *\n * @platform Android, iOS\n * @since 7.3.0\n */\n colorName?: SystemColorName | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n isImmutable: boolean | null;\n /**\n * Whether events can be added to or changed in this calendar.\n *\n * @platform Android, iOS\n * @since 7.1.0\n */\n allowsContentModifications: boolean | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n type: CalendarType | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n isSubscribed: boolean | null;\n /**\n * @platform iOS\n * @since 7.1.0\n */\n source: CalendarSource | null;\n /**\n * Indicates if the events from this calendar should be shown.\n *\n * @platform Android\n * @since 7.1.0\n */\n visible: boolean | null;\n /**\n * The account under which the calendar is registered.\n *\n * @platform Android\n * @since 7.1.0\n */\n accountName: string | null;\n /**\n * The owner of the calendar.\n *\n * @platform Android\n * @since 7.1.0\n */\n ownerAccount: string | null;\n /**\n * Maximum number of reminders allowed per event.\n *\n * @platform Android\n * @since 7.1.0\n */\n maxReminders: number | null;\n /**\n * @platform Android\n * @since 7.1.0\n */\n location: string | null;\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -301,6 +301,52 @@ exports.CalendarType = void 0;
|
|
|
301
301
|
CalendarType[CalendarType["BIRTHDAY"] = 4] = "BIRTHDAY";
|
|
302
302
|
})(exports.CalendarType || (exports.CalendarType = {}));
|
|
303
303
|
|
|
304
|
+
/**
|
|
305
|
+
* Stable reject codes for CapacitorCalendar. Compare with `error.code`.
|
|
306
|
+
*
|
|
307
|
+
* @since 7.4.0
|
|
308
|
+
*/
|
|
309
|
+
exports.CapacitorCalendarErrorCode = void 0;
|
|
310
|
+
(function (CapacitorCalendarErrorCode) {
|
|
311
|
+
/**
|
|
312
|
+
* Missing or invalid method arguments.
|
|
313
|
+
*
|
|
314
|
+
* @since 7.5.0
|
|
315
|
+
*/
|
|
316
|
+
CapacitorCalendarErrorCode["InvalidArgument"] = "EB-CLDR-0001";
|
|
317
|
+
/**
|
|
318
|
+
* Requested calendar, event, list, reminder, or calendar source was not found.
|
|
319
|
+
*
|
|
320
|
+
* @since 7.5.0
|
|
321
|
+
*/
|
|
322
|
+
CapacitorCalendarErrorCode["NotFound"] = "EB-CLDR-0002";
|
|
323
|
+
/**
|
|
324
|
+
* A calendar store read or write failed.
|
|
325
|
+
*
|
|
326
|
+
* @since 7.5.0
|
|
327
|
+
*/
|
|
328
|
+
CapacitorCalendarErrorCode["IoError"] = "EB-CLDR-0004";
|
|
329
|
+
/**
|
|
330
|
+
* The device cannot open the calendar UI, reminders UI, or target URL.
|
|
331
|
+
*
|
|
332
|
+
* @since 7.5.0
|
|
333
|
+
*/
|
|
334
|
+
CapacitorCalendarErrorCode["NotSupported"] = "EB-CLDR-0005";
|
|
335
|
+
/**
|
|
336
|
+
* Calendar access was denied.
|
|
337
|
+
* On Android, calendar operations that fail with a permission error reject with this code. Permission check and request APIs still resolve `"denied"` on Android and iOS.
|
|
338
|
+
*
|
|
339
|
+
* @since 7.5.0
|
|
340
|
+
*/
|
|
341
|
+
CapacitorCalendarErrorCode["PermissionDenied"] = "EB-CLDR-0020";
|
|
342
|
+
/**
|
|
343
|
+
* Missing Info.plist usage description or AndroidManifest permission declaration.
|
|
344
|
+
*
|
|
345
|
+
* @since 7.4.0
|
|
346
|
+
*/
|
|
347
|
+
CapacitorCalendarErrorCode["MissingDeclaration"] = "EB-CLDR-0100";
|
|
348
|
+
})(exports.CapacitorCalendarErrorCode || (exports.CapacitorCalendarErrorCode = {}));
|
|
349
|
+
|
|
304
350
|
/**
|
|
305
351
|
* @since 7.1.0
|
|
306
352
|
*/
|