Skip to content

Commit

Permalink
v2.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
natelindev committed Feb 22, 2024
1 parent 673bc43 commit 258e4b0
Show file tree
Hide file tree
Showing 19 changed files with 493 additions and 216 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v2.0.9

**improvements**

- fixed [#181](https://github.com/natelindev/tsdav/issues/181) where an option check is missing.
- fixed doc example, thanks to [#175](https://github.com/natelindev/tsdav/issues/175)
- added docs related to smart calendar syncing [#138](https://github.com/natelindev/tsdav/issues/138)

## v2.0.8

**improvements**
Expand Down
14 changes: 7 additions & 7 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tsdav",
"version": "2.0.8",
"version": "2.0.9",
"description": "WebDAV, CALDAV, and CARDDAV client for Nodejs and the Browser",
"keywords": [
"dav",
Expand Down Expand Up @@ -60,12 +60,12 @@
"@types/base-64": "1.0.2",
"@types/debug": "4.1.12",
"@types/jest": "29.5.12",
"@types/node": "20.11.17",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"@types/node": "20.11.19",
"@typescript-eslint/eslint-plugin": "7.0.2",
"@typescript-eslint/parser": "7.0.2",
"copyfiles": "2.4.1",
"cross-env": "7.0.3",
"dotenv": "16.4.1",
"dotenv": "16.4.5",
"eslint": "8.56.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "17.1.0",
Expand All @@ -76,12 +76,12 @@
"jest": "29.7.0",
"prettier": "3.2.5",
"rimraf": "5.0.5",
"rollup": "4.10.0",
"rollup": "4.12.0",
"rollup-plugin-dts": "6.1.0",
"rollup-plugin-node-builtins": "2.1.2",
"rollup-plugin-polyfill-node": "0.13.0",
"rollup-plugin-terser": "7.0.2",
"sort-package-json": "2.7.0",
"sort-package-json": "2.8.0",
"ts-jest": "29.1.2",
"tslib": "2.6.2",
"typescript": "5.3.3"
Expand Down
8 changes: 4 additions & 4 deletions dist/tsdav.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -832,21 +832,21 @@ const fetchCalendars = (params) => __awaiter(void 0, void 0, void 0, function* (
return Promise.all(res
.filter((r) => { var _a, _b; return Object.keys((_b = (_a = r.props) === null || _a === void 0 ? void 0 : _a.resourcetype) !== null && _b !== void 0 ? _b : {}).includes('calendar'); })
.filter((rc) => {
var _a, _b, _c;
var _a, _b, _c, _d;
// filter out none iCal format calendars.
const components = Array.isArray((_a = rc.props) === null || _a === void 0 ? void 0 : _a.supportedCalendarComponentSet.comp)
? (_b = rc.props) === null || _b === void 0 ? void 0 : _b.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp._attributes.name] || [];
: [(_d = (_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp) === null || _d === void 0 ? void 0 : _d._attributes.name] || [];
return components.some((c) => Object.values(ICALObjects).includes(c));
})
.map((rs) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
// debug(`Found calendar ${rs.props?.displayname}`);
const description = (_a = rs.props) === null || _a === void 0 ? void 0 : _a.calendarDescription;
const timezone = (_b = rs.props) === null || _b === void 0 ? void 0 : _b.calendarTimezone;
return Object.assign({ description: typeof description === 'string' ? description : '', timezone: typeof timezone === 'string' ? timezone : '', url: new URL((_c = rs.href) !== null && _c !== void 0 ? _c : '', (_d = account.rootUrl) !== null && _d !== void 0 ? _d : '').href, ctag: (_e = rs.props) === null || _e === void 0 ? void 0 : _e.getctag, calendarColor: (_f = rs.props) === null || _f === void 0 ? void 0 : _f.calendarColor, displayName: (_h = (_g = rs.props) === null || _g === void 0 ? void 0 : _g.displayname._cdata) !== null && _h !== void 0 ? _h : (_j = rs.props) === null || _j === void 0 ? void 0 : _j.displayname, components: Array.isArray((_k = rs.props) === null || _k === void 0 ? void 0 : _k.supportedCalendarComponentSet.comp)
? (_l = rs.props) === null || _l === void 0 ? void 0 : _l.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp._attributes.name], resourcetype: Object.keys((_o = rs.props) === null || _o === void 0 ? void 0 : _o.resourcetype), syncToken: (_p = rs.props) === null || _p === void 0 ? void 0 : _p.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_q = rs.props) !== null && _q !== void 0 ? _q : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
: [(_o = (_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp) === null || _o === void 0 ? void 0 : _o._attributes.name], resourcetype: Object.keys((_p = rs.props) === null || _p === void 0 ? void 0 : _p.resourcetype), syncToken: (_q = rs.props) === null || _q === void 0 ? void 0 : _q.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_r = rs.props) !== null && _r !== void 0 ? _r : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
})
.map((cal) => __awaiter(void 0, void 0, void 0, function* () {
return (Object.assign(Object.assign({}, cal), { reports: yield supportedReportSet({
Expand Down
8 changes: 4 additions & 4 deletions dist/tsdav.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,21 +832,21 @@ const fetchCalendars = (params) => __awaiter(void 0, void 0, void 0, function* (
return Promise.all(res
.filter((r) => { var _a, _b; return Object.keys((_b = (_a = r.props) === null || _a === void 0 ? void 0 : _a.resourcetype) !== null && _b !== void 0 ? _b : {}).includes('calendar'); })
.filter((rc) => {
var _a, _b, _c;
var _a, _b, _c, _d;
// filter out none iCal format calendars.
const components = Array.isArray((_a = rc.props) === null || _a === void 0 ? void 0 : _a.supportedCalendarComponentSet.comp)
? (_b = rc.props) === null || _b === void 0 ? void 0 : _b.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp._attributes.name] || [];
: [(_d = (_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp) === null || _d === void 0 ? void 0 : _d._attributes.name] || [];
return components.some((c) => Object.values(ICALObjects).includes(c));
})
.map((rs) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
// debug(`Found calendar ${rs.props?.displayname}`);
const description = (_a = rs.props) === null || _a === void 0 ? void 0 : _a.calendarDescription;
const timezone = (_b = rs.props) === null || _b === void 0 ? void 0 : _b.calendarTimezone;
return Object.assign({ description: typeof description === 'string' ? description : '', timezone: typeof timezone === 'string' ? timezone : '', url: new URL((_c = rs.href) !== null && _c !== void 0 ? _c : '', (_d = account.rootUrl) !== null && _d !== void 0 ? _d : '').href, ctag: (_e = rs.props) === null || _e === void 0 ? void 0 : _e.getctag, calendarColor: (_f = rs.props) === null || _f === void 0 ? void 0 : _f.calendarColor, displayName: (_h = (_g = rs.props) === null || _g === void 0 ? void 0 : _g.displayname._cdata) !== null && _h !== void 0 ? _h : (_j = rs.props) === null || _j === void 0 ? void 0 : _j.displayname, components: Array.isArray((_k = rs.props) === null || _k === void 0 ? void 0 : _k.supportedCalendarComponentSet.comp)
? (_l = rs.props) === null || _l === void 0 ? void 0 : _l.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp._attributes.name], resourcetype: Object.keys((_o = rs.props) === null || _o === void 0 ? void 0 : _o.resourcetype), syncToken: (_p = rs.props) === null || _p === void 0 ? void 0 : _p.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_q = rs.props) !== null && _q !== void 0 ? _q : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
: [(_o = (_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp) === null || _o === void 0 ? void 0 : _o._attributes.name], resourcetype: Object.keys((_p = rs.props) === null || _p === void 0 ? void 0 : _p.resourcetype), syncToken: (_q = rs.props) === null || _q === void 0 ? void 0 : _q.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_r = rs.props) !== null && _r !== void 0 ? _r : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
})
.map((cal) => __awaiter(void 0, void 0, void 0, function* () {
return (Object.assign(Object.assign({}, cal), { reports: yield supportedReportSet({
Expand Down
8 changes: 4 additions & 4 deletions dist/tsdav.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,21 +828,21 @@ const fetchCalendars = (params) => __awaiter(void 0, void 0, void 0, function* (
return Promise.all(res
.filter((r) => { var _a, _b; return Object.keys((_b = (_a = r.props) === null || _a === void 0 ? void 0 : _a.resourcetype) !== null && _b !== void 0 ? _b : {}).includes('calendar'); })
.filter((rc) => {
var _a, _b, _c;
var _a, _b, _c, _d;
// filter out none iCal format calendars.
const components = Array.isArray((_a = rc.props) === null || _a === void 0 ? void 0 : _a.supportedCalendarComponentSet.comp)
? (_b = rc.props) === null || _b === void 0 ? void 0 : _b.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp._attributes.name] || [];
: [(_d = (_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp) === null || _d === void 0 ? void 0 : _d._attributes.name] || [];
return components.some((c) => Object.values(ICALObjects).includes(c));
})
.map((rs) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
// debug(`Found calendar ${rs.props?.displayname}`);
const description = (_a = rs.props) === null || _a === void 0 ? void 0 : _a.calendarDescription;
const timezone = (_b = rs.props) === null || _b === void 0 ? void 0 : _b.calendarTimezone;
return Object.assign({ description: typeof description === 'string' ? description : '', timezone: typeof timezone === 'string' ? timezone : '', url: new URL((_c = rs.href) !== null && _c !== void 0 ? _c : '', (_d = account.rootUrl) !== null && _d !== void 0 ? _d : '').href, ctag: (_e = rs.props) === null || _e === void 0 ? void 0 : _e.getctag, calendarColor: (_f = rs.props) === null || _f === void 0 ? void 0 : _f.calendarColor, displayName: (_h = (_g = rs.props) === null || _g === void 0 ? void 0 : _g.displayname._cdata) !== null && _h !== void 0 ? _h : (_j = rs.props) === null || _j === void 0 ? void 0 : _j.displayname, components: Array.isArray((_k = rs.props) === null || _k === void 0 ? void 0 : _k.supportedCalendarComponentSet.comp)
? (_l = rs.props) === null || _l === void 0 ? void 0 : _l.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp._attributes.name], resourcetype: Object.keys((_o = rs.props) === null || _o === void 0 ? void 0 : _o.resourcetype), syncToken: (_p = rs.props) === null || _p === void 0 ? void 0 : _p.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_q = rs.props) !== null && _q !== void 0 ? _q : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
: [(_o = (_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp) === null || _o === void 0 ? void 0 : _o._attributes.name], resourcetype: Object.keys((_p = rs.props) === null || _p === void 0 ? void 0 : _p.resourcetype), syncToken: (_q = rs.props) === null || _q === void 0 ? void 0 : _q.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_r = rs.props) !== null && _r !== void 0 ? _r : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
})
.map((cal) => __awaiter(void 0, void 0, void 0, function* () {
return (Object.assign(Object.assign({}, cal), { reports: yield supportedReportSet({
Expand Down
8 changes: 4 additions & 4 deletions dist/tsdav.js
Original file line number Diff line number Diff line change
Expand Up @@ -9740,21 +9740,21 @@ const fetchCalendars = (params) => __awaiter(void 0, void 0, void 0, function* (
return Promise.all(res
.filter((r) => { var _a, _b; return Object.keys((_b = (_a = r.props) === null || _a === void 0 ? void 0 : _a.resourcetype) !== null && _b !== void 0 ? _b : {}).includes('calendar'); })
.filter((rc) => {
var _a, _b, _c;
var _a, _b, _c, _d;
// filter out none iCal format calendars.
const components = Array.isArray((_a = rc.props) === null || _a === void 0 ? void 0 : _a.supportedCalendarComponentSet.comp)
? (_b = rc.props) === null || _b === void 0 ? void 0 : _b.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp._attributes.name] || [];
: [(_d = (_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp) === null || _d === void 0 ? void 0 : _d._attributes.name] || [];
return components.some((c) => Object.values(ICALObjects).includes(c));
})
.map((rs) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
// debug(`Found calendar ${rs.props?.displayname}`);
const description = (_a = rs.props) === null || _a === void 0 ? void 0 : _a.calendarDescription;
const timezone = (_b = rs.props) === null || _b === void 0 ? void 0 : _b.calendarTimezone;
return Object.assign({ description: typeof description === 'string' ? description : '', timezone: typeof timezone === 'string' ? timezone : '', url: new URL((_c = rs.href) !== null && _c !== void 0 ? _c : '', (_d = account.rootUrl) !== null && _d !== void 0 ? _d : '').href, ctag: (_e = rs.props) === null || _e === void 0 ? void 0 : _e.getctag, calendarColor: (_f = rs.props) === null || _f === void 0 ? void 0 : _f.calendarColor, displayName: (_h = (_g = rs.props) === null || _g === void 0 ? void 0 : _g.displayname._cdata) !== null && _h !== void 0 ? _h : (_j = rs.props) === null || _j === void 0 ? void 0 : _j.displayname, components: Array.isArray((_k = rs.props) === null || _k === void 0 ? void 0 : _k.supportedCalendarComponentSet.comp)
? (_l = rs.props) === null || _l === void 0 ? void 0 : _l.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp._attributes.name], resourcetype: Object.keys((_o = rs.props) === null || _o === void 0 ? void 0 : _o.resourcetype), syncToken: (_p = rs.props) === null || _p === void 0 ? void 0 : _p.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_q = rs.props) !== null && _q !== void 0 ? _q : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
: [(_o = (_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp) === null || _o === void 0 ? void 0 : _o._attributes.name], resourcetype: Object.keys((_p = rs.props) === null || _p === void 0 ? void 0 : _p.resourcetype), syncToken: (_q = rs.props) === null || _q === void 0 ? void 0 : _q.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_r = rs.props) !== null && _r !== void 0 ? _r : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
})
.map((cal) => __awaiter(void 0, void 0, void 0, function* () {
return (Object.assign(Object.assign({}, cal), { reports: yield supportedReportSet({
Expand Down
2 changes: 1 addition & 1 deletion dist/tsdav.min.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tsdav.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tsdav.min.mjs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/tsdav.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -828,21 +828,21 @@ const fetchCalendars = (params) => __awaiter(void 0, void 0, void 0, function* (
return Promise.all(res
.filter((r) => { var _a, _b; return Object.keys((_b = (_a = r.props) === null || _a === void 0 ? void 0 : _a.resourcetype) !== null && _b !== void 0 ? _b : {}).includes('calendar'); })
.filter((rc) => {
var _a, _b, _c;
var _a, _b, _c, _d;
// filter out none iCal format calendars.
const components = Array.isArray((_a = rc.props) === null || _a === void 0 ? void 0 : _a.supportedCalendarComponentSet.comp)
? (_b = rc.props) === null || _b === void 0 ? void 0 : _b.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp._attributes.name] || [];
: [(_d = (_c = rc.props) === null || _c === void 0 ? void 0 : _c.supportedCalendarComponentSet.comp) === null || _d === void 0 ? void 0 : _d._attributes.name] || [];
return components.some((c) => Object.values(ICALObjects).includes(c));
})
.map((rs) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
// debug(`Found calendar ${rs.props?.displayname}`);
const description = (_a = rs.props) === null || _a === void 0 ? void 0 : _a.calendarDescription;
const timezone = (_b = rs.props) === null || _b === void 0 ? void 0 : _b.calendarTimezone;
return Object.assign({ description: typeof description === 'string' ? description : '', timezone: typeof timezone === 'string' ? timezone : '', url: new URL((_c = rs.href) !== null && _c !== void 0 ? _c : '', (_d = account.rootUrl) !== null && _d !== void 0 ? _d : '').href, ctag: (_e = rs.props) === null || _e === void 0 ? void 0 : _e.getctag, calendarColor: (_f = rs.props) === null || _f === void 0 ? void 0 : _f.calendarColor, displayName: (_h = (_g = rs.props) === null || _g === void 0 ? void 0 : _g.displayname._cdata) !== null && _h !== void 0 ? _h : (_j = rs.props) === null || _j === void 0 ? void 0 : _j.displayname, components: Array.isArray((_k = rs.props) === null || _k === void 0 ? void 0 : _k.supportedCalendarComponentSet.comp)
? (_l = rs.props) === null || _l === void 0 ? void 0 : _l.supportedCalendarComponentSet.comp.map((sc) => sc._attributes.name)
: [(_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp._attributes.name], resourcetype: Object.keys((_o = rs.props) === null || _o === void 0 ? void 0 : _o.resourcetype), syncToken: (_p = rs.props) === null || _p === void 0 ? void 0 : _p.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_q = rs.props) !== null && _q !== void 0 ? _q : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
: [(_o = (_m = rs.props) === null || _m === void 0 ? void 0 : _m.supportedCalendarComponentSet.comp) === null || _o === void 0 ? void 0 : _o._attributes.name], resourcetype: Object.keys((_p = rs.props) === null || _p === void 0 ? void 0 : _p.resourcetype), syncToken: (_q = rs.props) === null || _q === void 0 ? void 0 : _q.syncToken }, conditionalParam('projectedProps', Object.fromEntries(Object.entries((_r = rs.props) !== null && _r !== void 0 ? _r : {}).filter(([key]) => projectedProps === null || projectedProps === void 0 ? void 0 : projectedProps[key]))));
})
.map((cal) => __awaiter(void 0, void 0, void 0, function* () {
return (Object.assign(Object.assign({}, cal), { reports: yield supportedReportSet({
Expand Down
Loading

0 comments on commit 258e4b0

Please sign in to comment.