Merge remote-tracking branch 'origin/renovate/node-ical-0-x' into renovate/node-ical-0-x
This commit is contained in:
commit
5501757bd5
3 files changed
+15
-11
No files matched your search
@@ -38,7 +38,7 @@
|
|||||||
"@homarr/redis": "workspace:^0.1.0",
|
"@homarr/redis": "workspace:^0.1.0",
|
||||||
"@homarr/translation": "workspace:^0.1.0",
|
"@homarr/translation": "workspace:^0.1.0",
|
||||||
"@homarr/validation": "workspace:^0.1.0",
|
"@homarr/validation": "workspace:^0.1.0",
|
||||||
"@immich/sdk": "^2.6.2",
|
"@immich/sdk": "^2.6.3",
|
||||||
"@jellyfin/sdk": "^0.13.0",
|
"@jellyfin/sdk": "^0.13.0",
|
||||||
"@octokit/auth-app": "^8.2.0",
|
"@octokit/auth-app": "^8.2.0",
|
||||||
"ical.js": "^2.2.1",
|
"ical.js": "^2.2.1",
|
||||||
|
|||||||
@@ -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
+5
-5
@@ -1466,8 +1466,8 @@ importers:
|
|||||||
specifier: workspace:^0.1.0
|
specifier: workspace:^0.1.0
|
||||||
version: link:../validation
|
version: link:../validation
|
||||||
'@immich/sdk':
|
'@immich/sdk':
|
||||||
specifier: ^2.6.2
|
specifier: ^2.6.3
|
||||||
version: 2.6.2
|
version: 2.6.3
|
||||||
'@jellyfin/sdk':
|
'@jellyfin/sdk':
|
||||||
specifier: ^0.13.0
|
specifier: ^0.13.0
|
||||||
version: 0.13.0(axios@1.12.2)
|
version: 0.13.0(axios@1.12.2)
|
||||||
@@ -3490,8 +3490,8 @@ packages:
|
|||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [win32]
|
os: [win32]
|
||||||
|
|
||||||
'@immich/sdk@2.6.2':
|
'@immich/sdk@2.6.3':
|
||||||
resolution: {integrity: sha512-GDUOOyP4q6HDF8X9J/cHUX2sSrlWKKvMntvLgC8J1+vExGKx7FKxZnUybTHDzjefs6c0G8kpVN3UwgCEQXJNDA==}
|
resolution: {integrity: sha512-LPQPgmnzRl01aaTpaM3Ts26MM/8swVKKWhDG4DvWHosV2GW+d7+8v7fAEsP8u7z2kvT1h7PKvgLcxpBNGzS3cA==}
|
||||||
|
|
||||||
'@inquirer/ansi@1.0.2':
|
'@inquirer/ansi@1.0.2':
|
||||||
resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==}
|
resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==}
|
||||||
@@ -11939,7 +11939,7 @@ snapshots:
|
|||||||
'@img/sharp-win32-x64@0.34.5':
|
'@img/sharp-win32-x64@0.34.5':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@immich/sdk@2.6.2':
|
'@immich/sdk@2.6.3':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@oazapfts/runtime': 1.2.0
|
'@oazapfts/runtime': 1.2.0
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user