diff --git a/.gitignore b/.gitignore index c225d08..24b5d10 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,13 @@ package-lock.json example/config.js example/runData.json lib/ +src/index.js +src/koa.js +src/common/date.js +src/common/eventBuild.js +src/common/parseBody.js +src/common/response.js +src/common/tags.js +src/common/winston.js +src/common/xBuild.js +src/common/xml.js diff --git a/package.json b/package.json index 6420a2b..2de5e1f 100644 --- a/package.json +++ b/package.json @@ -22,32 +22,32 @@ }, "devDependencies": { "@types/ical": "^0.6.1", - "@types/koa": "^2.11.3", - "@types/lodash": "^4.14.151", - "@types/node": "^14.0.1", - "@types/xmldom": "^0.1.29", - "@typescript-eslint/eslint-plugin": "^2.31.0", - "@typescript-eslint/parser": "^2.31.0", - "eslint": "^6.8.0", - "koa": "^2.11.0", - "koa-compress": "^4.0.1", + "@types/koa": "^2.13.12", + "@types/lodash": "^4.14.202", + "@types/node": "^20.10.6", + "@types/xmldom": "^0.1.34", + "@typescript-eslint/eslint-plugin": "^6.16.0", + "@typescript-eslint/parser": "^6.16.0", + "eslint": "^8.56.0", + "koa": "^2.15.0", + "koa-compress": "^5.1.1", "koa-morgan": "^1.0.1", - "nodemon": "^2.0.4", - "typescript": "^3.9.2" + "nodemon": "^3.0.2", + "typescript": "^5.3.3" }, "dependencies": { "basic-auth": "^2.0.1", "ical": "^0.8.0", "ical-generator": "^1.10.0", - "lodash": "^4.17.15", - "moment": "^2.25.3", - "moment-timezone": "^0.5.28", - "path-to-regexp": "^6.1.0", - "raw-body": "^2.4.1", - "rrule": "^2.6.4", - "winston": "^3.2.0", - "xmlbuilder2": "^2.1.2", - "xmldom": "^0.3.0", - "xpath": "0.0.27" + "lodash": "^4.17.21", + "moment": "^2.30.1", + "moment-timezone": "^0.5.44", + "path-to-regexp": "^6.2.1", + "raw-body": "^2.5.2", + "rrule": "^2.8.1", + "winston": "^3.11.0", + "xmlbuilder2": "^3.1.1", + "xmldom": "^0.6.0", + "xpath": "0.0.34" } } diff --git a/src/common/eventBuild.ts b/src/common/eventBuild.ts index 1bc57b6..2977329 100644 --- a/src/common/eventBuild.ts +++ b/src/common/eventBuild.ts @@ -99,7 +99,6 @@ export default function(opts: CalDavOptionsModule) { } } const events = [evt, ...recur]; - const cal = ical({ domain: FIXED_DOMAIN, prodId: opts.proId, @@ -133,7 +132,7 @@ export default function(opts: CalDavOptionsModule) { } if (parsed.rrule) { obj.recurring = { - freq: rrule.FREQUENCIES[parsed.rrule.origOptions.freq] + freq: rrule.RRule.FREQUENCIES[parsed.rrule.origOptions.freq] }; if (parsed.rrule.origOptions.until) { obj.recurring.until = formatted(parsed.rrule.origOptions.until); diff --git a/src/index.ts b/src/index.ts index b742ddd..e6ea93a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,6 +30,7 @@ export type CalDavRecurrence = { createdOn?: string; lastModifiedOn?: string; }; + export type CalDavRecurring = { freq: 'SECONDLY' | 'MINUTELY' | 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY' | 'HOURLY'; until?: string;