@ebarooni/capacitor-calendar 0.3.0 → 0.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/LICENSE.txt +21 -0
- package/README.md +73 -4
- package/android/build.gradle +1 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendar.kt +35 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +22 -0
- package/dist/docs.json +810 -6
- package/dist/esm/definitions.d.ts +41 -7
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +10 -0
- package/dist/esm/web.js +3 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +3 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +3 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorCalendar.swift +33 -0
- package/ios/Plugin/CapacitorCalendarPlugin.m +1 -0
- package/ios/Plugin/CapacitorCalendarPlugin.swift +28 -0
- package/package.json +7 -2
|
@@ -130,8 +130,8 @@ export interface CapacitorCalendarPlugin {
|
|
|
130
130
|
* where each calendar object contains an ID and a title.
|
|
131
131
|
* @example
|
|
132
132
|
* if (capacitor.getPlatform() === 'ios') {
|
|
133
|
-
* const
|
|
134
|
-
* console.log(
|
|
133
|
+
* const { result } = await selectCalendarsWithPrompt();
|
|
134
|
+
* console.log(result); // [{ id: '1', title: 'Work Calendar' }]
|
|
135
135
|
* }
|
|
136
136
|
*/
|
|
137
137
|
selectCalendarsWithPrompt(options: {
|
|
@@ -148,8 +148,8 @@ export interface CapacitorCalendarPlugin {
|
|
|
148
148
|
* @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.
|
|
149
149
|
* Each calendar object in the array contains an ID and a title.
|
|
150
150
|
* @example
|
|
151
|
-
* const
|
|
152
|
-
* console.log(
|
|
151
|
+
* const { result } = await listCalendars();
|
|
152
|
+
* console.log(result); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]
|
|
153
153
|
*/
|
|
154
154
|
listCalendars(): Promise<{
|
|
155
155
|
result: Calendar[];
|
|
@@ -157,15 +157,49 @@ export interface CapacitorCalendarPlugin {
|
|
|
157
157
|
/**
|
|
158
158
|
* Retrieves the default calendar set on the device.
|
|
159
159
|
*
|
|
160
|
-
* @async
|
|
161
160
|
* @method getDefaultCalendar
|
|
162
161
|
* @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.
|
|
163
162
|
* The returned calendar object contains an ID and a title.
|
|
164
163
|
* @example
|
|
165
|
-
* const
|
|
166
|
-
* console.log(
|
|
164
|
+
* const { result } = await getDefaultCalendar();
|
|
165
|
+
* console.log(result); // { id: '1', title: 'Default Calendar' }
|
|
167
166
|
*/
|
|
168
167
|
getDefaultCalendar(): Promise<{
|
|
169
168
|
result: Calendar;
|
|
170
169
|
}>;
|
|
170
|
+
/**
|
|
171
|
+
* Creates an event with the provided options.
|
|
172
|
+
*
|
|
173
|
+
* @method createEvent
|
|
174
|
+
* @param {object} options - Options for creating the event.
|
|
175
|
+
* @param {string} options.title - The title of the event.
|
|
176
|
+
* @param {string} options.calendarId - The id of the destination calendar. (Optional)
|
|
177
|
+
* @param {string} [options.location] - The location of the event. (Optional)
|
|
178
|
+
* @param {Date} [options.startDate] - The start date and time of the event. (Optional)
|
|
179
|
+
* @param {Date} [options.endDate] - The end date and time of the event. (Optional)
|
|
180
|
+
* @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)
|
|
181
|
+
* @returns {Promise<{ eventCreated: boolean }>} A Promise that resolves with an object indicating whether the event was created successfully.
|
|
182
|
+
* The resolved object has a property 'eventCreated' which is a boolean value representing whether the event was created.
|
|
183
|
+
* @example
|
|
184
|
+
* const now = Date.now();
|
|
185
|
+
* const eventOptions = {
|
|
186
|
+
* title: 'Team Meeting',
|
|
187
|
+
* location: 'Conference Room A',
|
|
188
|
+
* startDate: new Date(now),
|
|
189
|
+
* endDate: new Date(now + 2 * 60 * 60 * 1000),
|
|
190
|
+
* isAllDay: false
|
|
191
|
+
* };
|
|
192
|
+
* const { eventCreated } = await createEvent(eventOptions);
|
|
193
|
+
* console.log(eventCreated); // true
|
|
194
|
+
*/
|
|
195
|
+
createEvent(options: {
|
|
196
|
+
title: string;
|
|
197
|
+
calendarId?: string;
|
|
198
|
+
location?: string;
|
|
199
|
+
startDate?: Date;
|
|
200
|
+
endDate?: Date;
|
|
201
|
+
isAllDay?: boolean;
|
|
202
|
+
}): Promise<{
|
|
203
|
+
eventCreated: boolean;
|
|
204
|
+
}>;
|
|
171
205
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAN,IAAY,6BAUX;AAVD,WAAY,6BAA6B;IACvC;;OAEG;IACH,qFAAM,CAAA;IAEN;;OAEG;IACH,yFAAQ,CAAA;AACV,CAAC,EAVW,6BAA6B,KAA7B,6BAA6B,QAUxC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAUX;AAVD,WAAY,2BAA2B;IACrC;;OAEG;IACH,+FAAa,CAAA;IAEb;;OAEG;IACH,mHAAuB,CAAA;AACzB,CAAC,EAVW,2BAA2B,KAA3B,2BAA2B,QAUtC","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\n/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport enum CalendarChooserSelectionStyle {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n SINGLE,\n\n /**\n * Allows multiple selections in the calendar chooser.\n */\n MULTIPLE\n}\n\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport enum CalendarChooserDisplayStyle {\n /**\n * Display all calendars available for selection.\n */\n ALL_CALENDARS,\n\n /**\n * Display only writable calendars available for selection.\n */\n WRITABLE_CALENDARS_ONLY\n}\n\n/**\n * Represents a calendar object with an ID and title.\n *\n * @interface Calendar\n * @property {string} id - The unique identifier of the calendar.\n * @property {string} title - The title or name of the calendar.\n */\nexport interface Calendar {\n id: string;\n title: string;\n}\n\n/**\n * Describes the permission status for reading from the calendar.\n *\n * @interface\n */\nexport interface CalendarPermissionStatus {\n readCalendar: PermissionState;\n writeCalendar: PermissionState;\n}\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise<{ result: PermissionState }>} – A promise that resolves with the current status of the requested permission.\n * @example\n * const status = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @method\n * @returns {Promise<CalendarPermissionStatus>} – A promise that resolves with an object containing all the permissions and their status.\n * @example\n * const permissionsStatus = await this.checkAllPermissions();\n */\n checkAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Requests authorization to a specific permission, if not already granted.\n * If the permission is already granted, it will directly return the status.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise<{ result: PermissionState }>} – A promise that resolves with the new permission status after the request is made.\n * @example\n * const result = await this.requestPermission({ alias: 'readCalendar' });\n */\n requestPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Requests authorization to all the required permissions for the plugin, if they have not already been granted.\n *\n * @method\n * @returns {Promise<CalendarPermissionStatus>} – A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Creates an event in the calendar by using the native calendar.\n * On iOS opens a native sheet and on Android opens an intent.\n * This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\n * On Android, the user has to authorize for read access.\n *\n * @method\n * @returns {Promise<{ eventCreated: boolean }>} – A promise that resolves with the result of the action.\n * @example\n * let result: CalendarEventActionResult;\n * if (capacitor.getPlatform() === 'android') {\n * const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;\n * if (readCalendarStatus === 'granted') {\n * result = await this.createEventWithPrompt();\n * } else {\n * // handle the case when user rejects the permission\n * }\n * } else {\n * result = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ eventCreated: boolean }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @async\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAN,IAAY,6BAUX;AAVD,WAAY,6BAA6B;IACvC;;OAEG;IACH,qFAAM,CAAA;IAEN;;OAEG;IACH,yFAAQ,CAAA;AACV,CAAC,EAVW,6BAA6B,KAA7B,6BAA6B,QAUxC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAUX;AAVD,WAAY,2BAA2B;IACrC;;OAEG;IACH,+FAAa,CAAA;IAEb;;OAEG;IACH,mHAAuB,CAAA;AACzB,CAAC,EAVW,2BAA2B,KAA3B,2BAA2B,QAUtC","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\n/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport enum CalendarChooserSelectionStyle {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n SINGLE,\n\n /**\n * Allows multiple selections in the calendar chooser.\n */\n MULTIPLE\n}\n\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport enum CalendarChooserDisplayStyle {\n /**\n * Display all calendars available for selection.\n */\n ALL_CALENDARS,\n\n /**\n * Display only writable calendars available for selection.\n */\n WRITABLE_CALENDARS_ONLY\n}\n\n/**\n * Represents a calendar object with an ID and title.\n *\n * @interface Calendar\n * @property {string} id - The unique identifier of the calendar.\n * @property {string} title - The title or name of the calendar.\n */\nexport interface Calendar {\n id: string;\n title: string;\n}\n\n/**\n * Describes the permission status for reading from the calendar.\n *\n * @interface\n */\nexport interface CalendarPermissionStatus {\n readCalendar: PermissionState;\n writeCalendar: PermissionState;\n}\n\nexport interface CapacitorCalendarPlugin {\n /**\n * Checks the current authorization status of a specific permission.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise<{ result: PermissionState }>} – A promise that resolves with the current status of the requested permission.\n * @example\n * const status = await this.checkPermission({ alias: 'readCalendar' });\n */\n checkPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Checks the current authorization status of all the required permissions for the plugin.\n *\n * @method\n * @returns {Promise<CalendarPermissionStatus>} – A promise that resolves with an object containing all the permissions and their status.\n * @example\n * const permissionsStatus = await this.checkAllPermissions();\n */\n checkAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Requests authorization to a specific permission, if not already granted.\n * If the permission is already granted, it will directly return the status.\n *\n * @method\n * @param options An object with the name of the permission\n * @returns {Promise<{ result: PermissionState }>} – A promise that resolves with the new permission status after the request is made.\n * @example\n * const result = await this.requestPermission({ alias: 'readCalendar' });\n */\n requestPermission(options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }>;\n\n /**\n * Requests authorization to all the required permissions for the plugin, if they have not already been granted.\n *\n * @method\n * @returns {Promise<CalendarPermissionStatus>} – A promise that resolves with the new permission statuses after the request is made.\n * @example\n * const permissionResults = await this.requestAllPermissions();\n */\n requestAllPermissions(): Promise<CalendarPermissionStatus>;\n\n /**\n * Creates an event in the calendar by using the native calendar.\n * On iOS opens a native sheet and on Android opens an intent.\n * This method does not need any read or write authorization from the user on iOS. However, the entries in the Info.plist file are still needed.\n * On Android, the user has to authorize for read access.\n *\n * @method\n * @returns {Promise<{ eventCreated: boolean }>} – A promise that resolves with the result of the action.\n * @example\n * let result: CalendarEventActionResult;\n * if (capacitor.getPlatform() === 'android') {\n * const readCalendarStatus = (await this.requestPermission({ alias: 'readCalendar' })).result;\n * if (readCalendarStatus === 'granted') {\n * result = await this.createEventWithPrompt();\n * } else {\n * // handle the case when user rejects the permission\n * }\n * } else {\n * result = await this.createEventWithPrompt();\n * }\n */\n createEventWithPrompt(): Promise<{ eventCreated: boolean }>;\n\n /**\n * Presents a prompt to the user to select calendars. This method is available only on iOS.\n *\n * @method selectCalendarsWithPrompt\n * @param {object} options - Options for customizing the display and selection styles of the calendar chooser.\n * @async\n * @returns { Promise<{ result: Calendar[] }> } A promise that resolves with an array of selected calendars,\n * where each calendar object contains an ID and a title.\n * @example\n * if (capacitor.getPlatform() === 'ios') {\n * const { result } = await selectCalendarsWithPrompt();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }]\n * }\n */\n selectCalendarsWithPrompt(options: {\n displayStyle: CalendarChooserDisplayStyle,\n selectionStyle: CalendarChooserSelectionStyle\n }): Promise<{ result: Calendar[] }>\n\n\n /**\n * Retrieves a list of calendars available on the device.\n *\n * @async\n * @method listCalendars\n * @returns {Promise<{ result: Calendar[] }>} A promise that resolves with an array of calendars available on the device.\n * Each calendar object in the array contains an ID and a title.\n * @example\n * const { result } = await listCalendars();\n * console.log(result); // [{ id: '1', title: 'Work Calendar' }, { id: '2', title: 'Personal Calendar' }]\n */\n listCalendars(): Promise<{ result: Calendar[] }>;\n\n /**\n * Retrieves the default calendar set on the device.\n *\n * @method getDefaultCalendar\n * @returns {Promise<{ result: Calendar }>} A promise that resolves with the default calendar set on the device.\n * The returned calendar object contains an ID and a title.\n * @example\n * const { result } = await getDefaultCalendar();\n * console.log(result); // { id: '1', title: 'Default Calendar' }\n */\n getDefaultCalendar(): Promise<{ result: Calendar }>;\n\n /**\n * Creates an event with the provided options.\n *\n * @method createEvent\n * @param {object} options - Options for creating the event.\n * @param {string} options.title - The title of the event.\n * @param {string} options.calendarId - The id of the destination calendar. (Optional)\n * @param {string} [options.location] - The location of the event. (Optional)\n * @param {Date} [options.startDate] - The start date and time of the event. (Optional)\n * @param {Date} [options.endDate] - The end date and time of the event. (Optional)\n * @param {boolean} [options.isAllDay] - Weather the event is for the entire day or not. (Optional)\n * @returns {Promise<{ eventCreated: boolean }>} A Promise that resolves with an object indicating whether the event was created successfully.\n * The resolved object has a property 'eventCreated' which is a boolean value representing whether the event was created.\n * @example\n * const now = Date.now();\n * const eventOptions = {\n * title: 'Team Meeting',\n * location: 'Conference Room A',\n * startDate: new Date(now),\n * endDate: new Date(now + 2 * 60 * 60 * 1000),\n * isAllDay: false\n * };\n * const { eventCreated } = await createEvent(eventOptions);\n * console.log(eventCreated); // true\n */\n createEvent(options: { title: string, calendarId?: string, location?: string, startDate?: Date, endDate?: Date, isAllDay?: boolean }): Promise<{ eventCreated: boolean }>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -25,4 +25,14 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
|
|
|
25
25
|
getDefaultCalendar(): Promise<{
|
|
26
26
|
result: Calendar;
|
|
27
27
|
}>;
|
|
28
|
+
createEvent(_options: {
|
|
29
|
+
title: string;
|
|
30
|
+
calendarId?: string;
|
|
31
|
+
location?: string;
|
|
32
|
+
startDate?: Date;
|
|
33
|
+
endDate?: Date;
|
|
34
|
+
isAllDay?: boolean;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
eventCreated: boolean;
|
|
37
|
+
}>;
|
|
28
38
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -24,5 +24,8 @@ export class CapacitorCalendarWeb extends WebPlugin {
|
|
|
24
24
|
getDefaultCalendar() {
|
|
25
25
|
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
|
|
26
26
|
}
|
|
27
|
+
createEvent(_options) {
|
|
28
|
+
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI3D,MAAM,OAAO,oBACT,SAAQ,SAAS;IAGV,eAAe,CAAC,QAAmD;QACtE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAAC,CAAA;IAC1F,CAAC;IAEM,mBAAmB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC/F,CAAC;IAEM,iBAAiB,CAAC,QAAmD;QACxE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC7F,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,yBAAyB;QAC5B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI3D,MAAM,OAAO,oBACT,SAAQ,SAAS;IAGV,eAAe,CAAC,QAAmD;QACtE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAAC,CAAA;IAC1F,CAAC;IAEM,mBAAmB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC/F,CAAC;IAEM,iBAAiB,CAAC,QAAmD;QACxE,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC7F,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,yBAAyB;QAC5B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,aAAa;QAChB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACzF,CAAC;IAEM,kBAAkB;QACrB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC9F,CAAC;IAEM,WAAW,CAAC,QAAyH;QAGxI,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACvF,CAAC;CACJ","sourcesContent":["import {PermissionState, WebPlugin} from '@capacitor/core';\n\nimport {CapacitorCalendarPlugin, CalendarPermissionStatus, Calendar} from './definitions';\n\nexport class CapacitorCalendarWeb\n extends WebPlugin\n implements CapacitorCalendarPlugin\n{\n public checkPermission(_options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`)\n }\n\n public checkAllPermissions(): Promise<CalendarPermissionStatus> {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n\n public requestPermission(_options: { alias: keyof CalendarPermissionStatus }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n\n public requestAllPermissions(): Promise<CalendarPermissionStatus> {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n\n public createEventWithPrompt(): Promise<{ eventCreated: boolean}> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n public selectCalendarsWithPrompt(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n public listCalendars(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n\n public getDefaultCalendar(): Promise<{ result: Calendar }> {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n\n public createEvent(_options: { title: string; calendarId?: string, location?: string; startDate?: Date; endDate?: Date, isAllDay?: boolean }): Promise<{\n eventCreated: boolean\n }> {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -65,6 +65,9 @@ class CapacitorCalendarWeb extends core.WebPlugin {
|
|
|
65
65
|
getDefaultCalendar() {
|
|
66
66
|
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
|
|
67
67
|
}
|
|
68
|
+
createEvent(_options) {
|
|
69
|
+
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
70
|
+
}
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CapacitorCalendar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserSelectionStyle","CalendarChooserDisplayStyle","registerPlugin","WebPlugin"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACWA,+CAA8B;AACzC,CAAC,UAAU,6BAA6B,EAAE;AAC1C;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC1F;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC,CAAC;AAC1E;AACA;AACA;AACA;AACWC,6CAA4B;AACvC,CAAC,UAAU,2BAA2B,EAAE;AACxC;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;AACpG;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;AACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;AC7BhE,MAAC,iBAAiB,GAAGC,mBAAc,CAAC,mBAAmB,EAAE;AAC9D,IAAI,GAAG,EAAE,MAAM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CAAC,CAAC;AAC7F,KAAK;AACL,IAAI,kBAAkB,GAAG;AACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAClG,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CapacitorCalendar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserSelectionStyle","CalendarChooserDisplayStyle","registerPlugin","WebPlugin"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACWA,+CAA8B;AACzC,CAAC,UAAU,6BAA6B,EAAE;AAC1C;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC1F;AACA;AACA;AACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC,CAAC;AAC1E;AACA;AACA;AACA;AACWC,6CAA4B;AACvC,CAAC,UAAU,2BAA2B,EAAE;AACxC;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;AACpG;AACA;AACA;AACA,IAAI,2BAA2B,CAAC,2BAA2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CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AACrG,KAAK;AACL,IAAI,aAAa,GAAG;AACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC7F,KAAK;AACL,IAAI,kBAAkB,GAAG;AACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAClG,KAAK;AACL,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC3F,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -62,6 +62,9 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
62
62
|
getDefaultCalendar() {
|
|
63
63
|
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
|
|
64
64
|
}
|
|
65
|
+
createEvent(_options) {
|
|
66
|
+
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
67
|
+
}
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CapacitorCalendar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserSelectionStyle","CalendarChooserDisplayStyle","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA,mDAA8B;IACzC,CAAC,UAAU,6BAA6B,EAAE;IAC1C;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IAC1F;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC,CAAC;IAC1E;IACA;IACA;IACA;AACWC,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;IACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;AC7BhE,UAAC,iBAAiB,GAAGC,mBAAc,CAAC,mBAAmB,EAAE;IAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;IACtE,CAAC;;ICFM,MAAM,oBAAoB,SAASC,cAAS,CAAC;IACpD,IAAI,eAAe,CAAC,QAAQ,EAAE;IAC9B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC/F,KAAK;IACL,IAAI,mBAAmB,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IACnG,KAAK;IACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;IAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IACjG,KAAK;IACL,IAAI,qBAAqB,GAAG;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IACrG,KAAK;IACL,IAAI,qBAAqB,GAAG;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IACrG,KAAK;IACL,IAAI,yBAAyB,GAAG;IAChC,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IACrG,KAAK;IACL,IAAI,aAAa,GAAG;IACpB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC7F,KAAK;IACL,IAAI,kBAAkB,GAAG;IACzB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAClG,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the selection style for the calendar chooser.\n * @readonly\n * @enum\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CapacitorCalendar };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserSelectionStyle","CalendarChooserDisplayStyle","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA,mDAA8B;IACzC,CAAC,UAAU,6BAA6B,EAAE;IAC1C;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IAC1F;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC,CAAC;IAC1E;IACA;IACA;IACA;AACWC,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;IACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;AC7BhE,UAAC,iBAAiB,GAAGC,mBAAc,CAAC,mBAAmB,EAAE;IAC9D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;IACtE,CAAC;;ICFM,MAAM,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AE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAClG,KAAK;IACL,IAAI,WAAW,CAAC,QAAQ,EAAE;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC3F,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
@@ -73,6 +73,39 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
public func createEvent(title: String, calendarId: String?, location: String?, startDate: Date?, endDate: Date?, isAllDay: Bool?) throws -> Void {
|
|
77
|
+
let fallbackStartDate = Date()
|
|
78
|
+
let newEvent = EKEvent(eventStore: eventStore)
|
|
79
|
+
if let calendarId = calendarId, let calendar = eventStore.calendar(withIdentifier: calendarId) {
|
|
80
|
+
newEvent.calendar = calendar
|
|
81
|
+
} else {
|
|
82
|
+
newEvent.calendar = eventStore.defaultCalendarForNewEvents
|
|
83
|
+
}
|
|
84
|
+
newEvent.title = title
|
|
85
|
+
if let location = location {
|
|
86
|
+
newEvent.location = location
|
|
87
|
+
}
|
|
88
|
+
if let startDate = startDate {
|
|
89
|
+
newEvent.startDate = startDate
|
|
90
|
+
} else {
|
|
91
|
+
newEvent.startDate = fallbackStartDate
|
|
92
|
+
}
|
|
93
|
+
if let endDate = endDate {
|
|
94
|
+
newEvent.endDate = endDate
|
|
95
|
+
} else {
|
|
96
|
+
newEvent.endDate = fallbackStartDate.addingTimeInterval(3600)
|
|
97
|
+
}
|
|
98
|
+
if let isAllDay = isAllDay {
|
|
99
|
+
newEvent.isAllDay = isAllDay
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
do {
|
|
103
|
+
try eventStore.save(newEvent, span: .thisEvent)
|
|
104
|
+
} catch {
|
|
105
|
+
throw CapacitorCalendarPluginError.unknownActionEventCreationPrompt
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
76
109
|
public func checkAllPermissions() async throws -> [String: String] {
|
|
77
110
|
return try await withCheckedThrowingContinuation { continuation in
|
|
78
111
|
var permissionsState: [String: String]
|
|
@@ -12,4 +12,5 @@ CAP_PLUGIN(CapacitorCalendarPlugin, "CapacitorCalendar",
|
|
|
12
12
|
CAP_PLUGIN_METHOD(selectCalendarsWithPrompt, CAPPluginReturnPromise);
|
|
13
13
|
CAP_PLUGIN_METHOD(listCalendars, CAPPluginReturnPromise);
|
|
14
14
|
CAP_PLUGIN_METHOD(getDefaultCalendar, CAPPluginReturnPromise);
|
|
15
|
+
CAP_PLUGIN_METHOD(createEvent, CAPPluginReturnPromise);
|
|
15
16
|
)
|
|
@@ -139,6 +139,34 @@ public class CapacitorCalendarPlugin: CAPPlugin {
|
|
|
139
139
|
try call.resolve(["result": implementation.getDefaultCalendar()])
|
|
140
140
|
} catch {
|
|
141
141
|
call.reject("[CapacitorCalendar.\(#function)] No default calendar was found")
|
|
142
|
+
return
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@objc public func createEvent(_ call: CAPPluginCall) {
|
|
147
|
+
guard let title = call.getString("title") else {
|
|
148
|
+
call.reject("[CapacitorCalendar.\(#function)] A title for the event was not provided")
|
|
149
|
+
return
|
|
150
|
+
}
|
|
151
|
+
let location = call.getString("location")
|
|
152
|
+
let startDate = call.getDate("startDate")
|
|
153
|
+
let endDate = call.getDate("endDate")
|
|
154
|
+
let isAllDay = call.getBool("isAllDay")
|
|
155
|
+
let calendarId = call.getString("calendarId")
|
|
156
|
+
|
|
157
|
+
do {
|
|
158
|
+
try implementation.createEvent(
|
|
159
|
+
title: title,
|
|
160
|
+
calendarId: calendarId,
|
|
161
|
+
location: location,
|
|
162
|
+
startDate: startDate,
|
|
163
|
+
endDate: endDate,
|
|
164
|
+
isAllDay: isAllDay
|
|
165
|
+
)
|
|
166
|
+
call.resolve(["eventCreated": true])
|
|
167
|
+
} catch {
|
|
168
|
+
call.reject("[CapacitorCalendar.\(#function)] Unable to create event")
|
|
169
|
+
return
|
|
142
170
|
}
|
|
143
171
|
}
|
|
144
172
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebarooni/capacitor-calendar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The Capacitor Calendar Plugin exposes functionalities for interacting with the calendar of iOS and Android devices.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -26,7 +26,12 @@
|
|
|
26
26
|
"capacitor",
|
|
27
27
|
"plugin",
|
|
28
28
|
"native",
|
|
29
|
-
"calendar"
|
|
29
|
+
"calendar",
|
|
30
|
+
"reminders",
|
|
31
|
+
"eventkit",
|
|
32
|
+
"eventkitui",
|
|
33
|
+
"angular",
|
|
34
|
+
"ionic"
|
|
30
35
|
],
|
|
31
36
|
"homepage": "https://capacitor-calendar.pages.dev",
|
|
32
37
|
"scripts": {
|