Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5501757bd5 | ||
|
|
beb2572cad | ||
|
|
fd79fb2b3a |
No files matched your search
@@ -43,7 +43,7 @@
|
|||||||
"@octokit/auth-app": "^8.2.0",
|
"@octokit/auth-app": "^8.2.0",
|
||||||
"ical.js": "^2.2.1",
|
"ical.js": "^2.2.1",
|
||||||
"maria2": "^0.4.1",
|
"maria2": "^0.4.1",
|
||||||
"node-ical": "^0.23.1",
|
"node-ical": "^0.25.6",
|
||||||
"octokit": "^5.0.5",
|
"octokit": "^5.0.5",
|
||||||
"proxmox-api": "1.1.1",
|
"proxmox-api": "1.1.1",
|
||||||
"tsdav": "^2.1.8",
|
"tsdav": "^2.1.8",
|
||||||
|
|||||||
@@ -68,15 +68,19 @@ export class NextcloudIntegration extends Integration implements ICalendarIntegr
|
|||||||
|
|
||||||
return calendarEvents
|
return calendarEvents
|
||||||
.map((event) => {
|
.map((event) => {
|
||||||
// @ts-expect-error the typescript definitions for this package are wrong
|
// @ts-expect-error the TypeScript definitions for this package are wrong
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
||||||
const icalData = ical.default.parseICS(event.data) as ical.CalendarResponse;
|
const icalData = ical.default.parseICS(event.data) as ical.CalendarResponse;
|
||||||
const veventObject = Object.values(icalData).find((data) => data.type === "VEVENT");
|
const veventObject = Object.values(icalData).find((data) => data?.type === "VEVENT");
|
||||||
|
|
||||||
if (!veventObject) {
|
if (!veventObject) {
|
||||||
throw new Error(`Invalid event data object: ${JSON.stringify(event.data)}. Unable to process the calendar.`);
|
throw new Error(`Invalid event data object: ${JSON.stringify(event.data)}. Unable to process the calendar.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!veventObject.end) {
|
||||||
|
throw new Error(`Event had no end date: ${JSON.stringify(event.data)}. Unable to process the calendar.`);
|
||||||
|
}
|
||||||
|
|
||||||
logger.debug(`Converting VEVENT event to ${event.etag} from Nextcloud: ${JSON.stringify(veventObject)}`);
|
logger.debug(`Converting VEVENT event to ${event.etag} from Nextcloud: ${JSON.stringify(veventObject)}`);
|
||||||
|
|
||||||
const eventUrlWithoutHost = new URL(event.url).pathname;
|
const eventUrlWithoutHost = new URL(event.url).pathname;
|
||||||
@@ -92,13 +96,13 @@ export class NextcloudIntegration extends Integration implements ICalendarIntegr
|
|||||||
const dateInMillis = utcStartDate.valueOf();
|
const dateInMillis = utcStartDate.valueOf();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: veventObject.summary,
|
title: veventObject.summary as string,
|
||||||
subTitle: null,
|
subTitle: null,
|
||||||
description: veventObject.description,
|
description: veventObject.description as string,
|
||||||
startDate: utcStartDate,
|
startDate: utcStartDate,
|
||||||
endDate,
|
endDate,
|
||||||
image: null,
|
image: null,
|
||||||
location: veventObject.location || null,
|
location: (veventObject.location as string | undefined) ?? null,
|
||||||
indicatorColor:
|
indicatorColor:
|
||||||
"color" in veventObject && typeof veventObject.color === "string" ? veventObject.color : "#ff8600",
|
"color" in veventObject && typeof veventObject.color === "string" ? veventObject.color : "#ff8600",
|
||||||
links: [
|
links: [
|
||||||
|
|||||||
Generated
+22
-10
@@ -1481,8 +1481,8 @@ importers:
|
|||||||
specifier: ^0.4.1
|
specifier: ^0.4.1
|
||||||
version: 0.4.1
|
version: 0.4.1
|
||||||
node-ical:
|
node-ical:
|
||||||
specifier: ^0.23.1
|
specifier: ^0.25.6
|
||||||
version: 0.23.1
|
version: 0.25.6
|
||||||
octokit:
|
octokit:
|
||||||
specifier: ^5.0.5
|
specifier: ^5.0.5
|
||||||
version: 5.0.5
|
version: 5.0.5
|
||||||
@@ -8465,8 +8465,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==}
|
resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
node-ical@0.23.1:
|
node-ical@0.25.6:
|
||||||
resolution: {integrity: sha512-4+FON2u++r7vU9VfTCris9hgxS5darN4P7aQZOJkzDazXLRS7cExb0G5OWO3CzRs8gHd5um1fdSMF0e45f7xAg==}
|
resolution: {integrity: sha512-Wo3GSBGYUNkcxOjHhevKTGa/+eB7ZwNLCq50h/eTX/YHSDZz1nT4KzXArO455CGHLD68gc5vw3nevqWQpOjjLQ==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
node-loader@2.1.0:
|
node-loader@2.1.0:
|
||||||
@@ -9500,8 +9500,8 @@ packages:
|
|||||||
rrdom@0.1.7:
|
rrdom@0.1.7:
|
||||||
resolution: {integrity: sha512-ZLd8f14z9pUy2Hk9y636cNv5Y2BMnNEY99wxzW9tD2BLDfe1xFxtLjB4q/xCBYo6HRe0wofzKzjm4JojmpBfFw==}
|
resolution: {integrity: sha512-ZLd8f14z9pUy2Hk9y636cNv5Y2BMnNEY99wxzW9tD2BLDfe1xFxtLjB4q/xCBYo6HRe0wofzKzjm4JojmpBfFw==}
|
||||||
|
|
||||||
rrule-temporal@1.3.0:
|
rrule-temporal@1.5.1:
|
||||||
resolution: {integrity: sha512-0duSf+wBX4FKNpznFDecEDkIzdoP7n3++Lt9TPpImhaRtENsa/qd3EhpV5Fi1TxVvBFN4ayOXVrK0aPvt+a80g==}
|
resolution: {integrity: sha512-mV82lZ7OzMOXX5g+SCR8FWRMSvhTnPSznjQ2Vguezjz1nEPEv/Ap/Z/FsIZ/AxA15M9X99m05911/MCXFY+FsA==}
|
||||||
|
|
||||||
rrweb-player@1.0.0-alpha.4:
|
rrweb-player@1.0.0-alpha.4:
|
||||||
resolution: {integrity: sha512-Wlmn9GZ5Fdqa37vd3TzsYdLl/JWEvXNUrLCrYpnOwEgmY409HwVIvvA5aIo7k582LoKgdRCsB87N+f0oWAR0Kg==}
|
resolution: {integrity: sha512-Wlmn9GZ5Fdqa37vd3TzsYdLl/JWEvXNUrLCrYpnOwEgmY409HwVIvvA5aIo7k582LoKgdRCsB87N+f0oWAR0Kg==}
|
||||||
@@ -10024,6 +10024,12 @@ packages:
|
|||||||
resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==}
|
resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==}
|
||||||
engines: {node: '>=14.16'}
|
engines: {node: '>=14.16'}
|
||||||
|
|
||||||
|
temporal-polyfill@0.3.2:
|
||||||
|
resolution: {integrity: sha512-TzHthD/heRK947GNiSu3Y5gSPpeUDH34+LESnfsq8bqpFhsB79HFBX8+Z834IVX68P3EUyRPZK5bL/1fh437Eg==}
|
||||||
|
|
||||||
|
temporal-spec@0.3.1:
|
||||||
|
resolution: {integrity: sha512-B4TUhezh9knfSIMwt7RVggApDRJZo73uZdj8AacL2mZ8RP5KtLianh2MXxL06GN9ESYiIsiuoLQhgVfwe55Yhw==}
|
||||||
|
|
||||||
tempy@3.1.0:
|
tempy@3.1.0:
|
||||||
resolution: {integrity: sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==}
|
resolution: {integrity: sha512-7jDLIdD2Zp0bDe5r3D2qtkd1QOCacylBuL7oa4udvN6v2pqr4+LcCr67C8DR1zkpaZ8XosF5m1yQSabKAW6f2g==}
|
||||||
engines: {node: '>=14.16'}
|
engines: {node: '>=14.16'}
|
||||||
@@ -17702,10 +17708,10 @@ snapshots:
|
|||||||
|
|
||||||
node-gyp-build@4.8.4: {}
|
node-gyp-build@4.8.4: {}
|
||||||
|
|
||||||
node-ical@0.23.1:
|
node-ical@0.25.6:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@js-temporal/polyfill': 0.5.1
|
rrule-temporal: 1.5.1
|
||||||
rrule-temporal: 1.3.0
|
temporal-polyfill: 0.3.2
|
||||||
|
|
||||||
node-loader@2.1.0(webpack@5.94.0):
|
node-loader@2.1.0(webpack@5.94.0):
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -18813,7 +18819,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
rrweb-snapshot: 2.0.0-alpha.4
|
rrweb-snapshot: 2.0.0-alpha.4
|
||||||
|
|
||||||
rrule-temporal@1.3.0:
|
rrule-temporal@1.5.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@js-temporal/polyfill': 0.5.1
|
'@js-temporal/polyfill': 0.5.1
|
||||||
|
|
||||||
@@ -19555,6 +19561,12 @@ snapshots:
|
|||||||
|
|
||||||
temp-dir@3.0.0: {}
|
temp-dir@3.0.0: {}
|
||||||
|
|
||||||
|
temporal-polyfill@0.3.2:
|
||||||
|
dependencies:
|
||||||
|
temporal-spec: 0.3.1
|
||||||
|
|
||||||
|
temporal-spec@0.3.1: {}
|
||||||
|
|
||||||
tempy@3.1.0:
|
tempy@3.1.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
is-stream: 3.0.0
|
is-stream: 3.0.0
|
||||||
|
|||||||
Reference in new issue
Block a user