Skip to content

Commit abcd2ed

Browse files
committed
v2.0.5
1 parent 41009c7 commit abcd2ed

16 files changed

+2630
-1676
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16
1+
v18

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## v2.0.5
2+
3+
**features**
4+
5+
DAVClient supports `digest` auth and `custom` auth, please go to `authHelpers` page in docs for more details.
6+
7+
fetchCalendars now supports `projectedProps`, previously customProps passed in will not get projected to fetched result properly.
8+
with this object map you can map your custom prop to fetched result thanks to @m0dch3n
9+
10+
**improvements**
11+
12+
calendarMultiGet will not send `<filter/>` element if custom filters are null or undefined thanks to @jelmer
13+
14+
docs improvement thanks to @MathisFrenais
15+
16+
typescript type improvement thanks to @zomars
17+
118
## v2.0.4
219

320
**features**

docs/docs/caldav/fetchCalendars.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ const calendars = await fetchCalendars({
2020
- `account` [DAVAccount](../types/DAVAccount.md)
2121
- `header` request headers
2222
- `props` [CALDAV prop element](https://datatracker.ietf.org/doc/html/rfc4791#section-9.6.4) in [ElementCompact](../types/ElementCompact.md) form, overriding default props to fetch
23-
24-
:::caution
25-
when overriding props, supported-calendar-component-set and resourcetype are required
26-
:::
23+
- `projectedProps` custom props projection object, used as a map to map fetched custom props to values
24+
:::caution
25+
when overriding props, supported-calendar-component-set and resourcetype are required
26+
:::
2727

2828
### Return Value
2929

docs/docs/helpers/authHelpers.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,24 @@ const fn1 = (params: { a?: number; b?: number }) => {
116116
};
117117
const fn2 = defaultParam(fn1, { b: 10 });
118118
```
119+
120+
### digest auth and custom auth
121+
122+
for digest auth, you need to handle the auth process yourself, pass the final digest string like
123+
124+
```
125+
username="Mufasa",
126+
realm="testrealm@host.com",
127+
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
128+
uri="/dir/index.html",
129+
qop=auth,
130+
nc=00000001,
131+
cnonce="0a4f113b",
132+
response="6629fae49393a05397450978507c4ef1",
133+
opaque="5ccc069c403ebaf9f0171e9517f40e41
134+
```
135+
136+
as `digestString` param in DAVCredentials
137+
138+
for custom auth, you can pass additional data via `customData` prop to DAVCredentials,
139+
you can pass in your custom auth function as `authFunction` param and will have DAVCredentials available to it.

docs/docs/types/DAVCalendar.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
export type DAVCalendar = {
33
components?: string[];
44
timezone?: string;
5+
projectedProps?: Record<string, unknown>;
56
} & DAVCollection;
67
```
8+
79
alias of [DAVCollection](DAVCollection.md) with
10+
811
- `timezone` iana timezone name of calendar
9-
- `components` array of calendar components defined in [rfc5455](https://datatracker.ietf.org/doc/html/rfc5545#section-3.6)
12+
- `components` array of calendar components defined in [rfc5455](https://datatracker.ietf.org/doc/html/rfc5545#section-3.6)
13+
- `projectedProps` object of fetched additional props by passing custom props to [fetchCalendars](../caldav/fetchCalendars.md) function

docs/docs/types/DAVCollection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export type DAVCollection = {
33
objects?: DAVObject[];
44
ctag?: string;
55
description?: string;
6-
displayName?: string;
6+
displayName?: string | Record<string, unknown>;
77
reports?: any;
88
resourcetype?: any;
99
syncToken?: string;
@@ -16,7 +16,7 @@ export type DAVCollection = {
1616
- `description` description of the collection
1717
- `displayName` [display name of the collection](https://datatracker.ietf.org/doc/html/rfc2518#section-13.2)
1818
- `reports` list of [reports that are supported by the
19-
resource](https://datatracker.ietf.org/doc/html/rfc3253#section-3.1.5). (in camel case), usually a string array
19+
resource](https://datatracker.ietf.org/doc/html/rfc3253#section-3.1.5). (in camel case), usually a string array
2020
- `resourcetype` [type of the resource](https://datatracker.ietf.org/doc/html/rfc2518#section-13.9), usually a string array
2121
- `syncToken` [the value of the synchronization token](https://datatracker.ietf.org/doc/html/rfc6578#section-4)
22-
- `url` url of the resource
22+
- `url` url of the resource

docs/docs/types/DAVCredentials.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export type DAVCredentials = {
1010
accessToken?: string;
1111
refreshToken?: string;
1212
expiration?: number;
13+
digestString?: string;
14+
customData?: Record<string, unknown>;
1315
};
1416
```
1517

@@ -25,3 +27,5 @@ refer to [this page](https://developers.google.com/identity/protocols/oauth2) fo
2527
- `accessToken` oauth access token
2628
- `refreshToken` oauth refresh token
2729
- `expiration` oauth access token expiration time
30+
- `digestString` string used for digest auth
31+
- `customData` custom data used for custom auth, can be anything

docs/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module.exports = {
5959
lastVersion: 'current',
6060
versions: {
6161
current: {
62-
label: '2.0.4',
62+
label: '2.0.5',
6363
},
6464
'1.1.6': {
6565
label: '1.1.6',

docs/package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"docusaurus": "docusaurus",
1010
"serve": "docusaurus serve",
1111
"start": "docusaurus start",
12+
"dev": "docusaurus start",
1213
"swizzle": "docusaurus swizzle",
1314
"write-heading-ids": "docusaurus write-heading-ids",
1415
"write-translations": "docusaurus write-translations"
@@ -26,26 +27,26 @@
2627
]
2728
},
2829
"dependencies": {
29-
"@docusaurus/core": "2.0.0-beta.18",
30-
"@docusaurus/preset-classic": "2.0.0-beta.18",
31-
"@easyops-cn/docusaurus-search-local": "0.23.0",
30+
"@docusaurus/core": "2.4.1",
31+
"@docusaurus/preset-classic": "2.4.1",
32+
"@easyops-cn/docusaurus-search-local": "0.35.0",
3233
"@mdx-js/react": "1.6.22",
3334
"@svgr/webpack": "6.2.1",
3435
"buffer": "6.0.3",
35-
"clsx": "1.1.1",
36+
"clsx": "1.2.1",
3637
"file-loader": "6.2.0",
37-
"react": "17.0.2",
38-
"react-dom": "17.0.2",
38+
"react": "18.2.0",
39+
"react-dom": "18.2.0",
3940
"stream-browserify": "3.0.0",
4041
"url-loader": "4.1.1",
4142
"xml-js": "1.6.11"
4243
},
4344
"devDependencies": {
44-
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
45-
"@tsconfig/docusaurus": "1.0.5",
46-
"@types/react": "17.0.43",
47-
"@types/react-helmet": "6.1.5",
45+
"@docusaurus/module-type-aliases": "2.4.1",
46+
"@tsconfig/docusaurus": "1.0.7",
47+
"@types/react": "18.2.14",
48+
"@types/react-helmet": "6.1.6",
4849
"@types/react-router-dom": "5.3.3",
49-
"typescript": "4.6.3"
50+
"typescript": "5.1.3"
5051
}
5152
}

0 commit comments

Comments
 (0)