Skip to content

Commit

Permalink
v2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
natelindev committed Jun 24, 2023
1 parent 41009c7 commit abcd2ed
Show file tree
Hide file tree
Showing 16 changed files with 2,630 additions and 1,676 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v18
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## v2.0.5

**features**

DAVClient supports `digest` auth and `custom` auth, please go to `authHelpers` page in docs for more details.

fetchCalendars now supports `projectedProps`, previously customProps passed in will not get projected to fetched result properly.
with this object map you can map your custom prop to fetched result thanks to @m0dch3n

**improvements**

calendarMultiGet will not send `<filter/>` element if custom filters are null or undefined thanks to @jelmer

docs improvement thanks to @MathisFrenais

typescript type improvement thanks to @zomars

## v2.0.4

**features**
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/caldav/fetchCalendars.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const calendars = await fetchCalendars({
- `account` [DAVAccount](../types/DAVAccount.md)
- `header` request headers
- `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

:::caution
when overriding props, supported-calendar-component-set and resourcetype are required
:::
- `projectedProps` custom props projection object, used as a map to map fetched custom props to values
:::caution
when overriding props, supported-calendar-component-set and resourcetype are required
:::

### Return Value

Expand Down
21 changes: 21 additions & 0 deletions docs/docs/helpers/authHelpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,24 @@ const fn1 = (params: { a?: number; b?: number }) => {
};
const fn2 = defaultParam(fn1, { b: 10 });
```

### digest auth and custom auth

for digest auth, you need to handle the auth process yourself, pass the final digest string like

```
username="Mufasa",
realm="[email protected]",
nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
uri="/dir/index.html",
qop=auth,
nc=00000001,
cnonce="0a4f113b",
response="6629fae49393a05397450978507c4ef1",
opaque="5ccc069c403ebaf9f0171e9517f40e41
```

as `digestString` param in DAVCredentials

for custom auth, you can pass additional data via `customData` prop to DAVCredentials,
you can pass in your custom auth function as `authFunction` param and will have DAVCredentials available to it.
6 changes: 5 additions & 1 deletion docs/docs/types/DAVCalendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
export type DAVCalendar = {
components?: string[];
timezone?: string;
projectedProps?: Record<string, unknown>;
} & DAVCollection;
```

alias of [DAVCollection](DAVCollection.md) with

- `timezone` iana timezone name of calendar
- `components` array of calendar components defined in [rfc5455](https://datatracker.ietf.org/doc/html/rfc5545#section-3.6)
- `components` array of calendar components defined in [rfc5455](https://datatracker.ietf.org/doc/html/rfc5545#section-3.6)
- `projectedProps` object of fetched additional props by passing custom props to [fetchCalendars](../caldav/fetchCalendars.md) function
6 changes: 3 additions & 3 deletions docs/docs/types/DAVCollection.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type DAVCollection = {
objects?: DAVObject[];
ctag?: string;
description?: string;
displayName?: string;
displayName?: string | Record<string, unknown>;
reports?: any;
resourcetype?: any;
syncToken?: string;
Expand All @@ -16,7 +16,7 @@ export type DAVCollection = {
- `description` description of the collection
- `displayName` [display name of the collection](https://datatracker.ietf.org/doc/html/rfc2518#section-13.2)
- `reports` list of [reports that are supported by the
resource](https://datatracker.ietf.org/doc/html/rfc3253#section-3.1.5). (in camel case), usually a string array
resource](https://datatracker.ietf.org/doc/html/rfc3253#section-3.1.5). (in camel case), usually a string array
- `resourcetype` [type of the resource](https://datatracker.ietf.org/doc/html/rfc2518#section-13.9), usually a string array
- `syncToken` [the value of the synchronization token](https://datatracker.ietf.org/doc/html/rfc6578#section-4)
- `url` url of the resource
- `url` url of the resource
4 changes: 4 additions & 0 deletions docs/docs/types/DAVCredentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export type DAVCredentials = {
accessToken?: string;
refreshToken?: string;
expiration?: number;
digestString?: string;
customData?: Record<string, unknown>;
};
```

Expand All @@ -25,3 +27,5 @@ refer to [this page](https://developers.google.com/identity/protocols/oauth2) fo
- `accessToken` oauth access token
- `refreshToken` oauth refresh token
- `expiration` oauth access token expiration time
- `digestString` string used for digest auth
- `customData` custom data used for custom auth, can be anything
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = {
lastVersion: 'current',
versions: {
current: {
label: '2.0.4',
label: '2.0.5',
},
'1.1.6': {
label: '1.1.6',
Expand Down
23 changes: 12 additions & 11 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"docusaurus": "docusaurus",
"serve": "docusaurus serve",
"start": "docusaurus start",
"dev": "docusaurus start",
"swizzle": "docusaurus swizzle",
"write-heading-ids": "docusaurus write-heading-ids",
"write-translations": "docusaurus write-translations"
Expand All @@ -26,26 +27,26 @@
]
},
"dependencies": {
"@docusaurus/core": "2.0.0-beta.18",
"@docusaurus/preset-classic": "2.0.0-beta.18",
"@easyops-cn/docusaurus-search-local": "0.23.0",
"@docusaurus/core": "2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@easyops-cn/docusaurus-search-local": "0.35.0",
"@mdx-js/react": "1.6.22",
"@svgr/webpack": "6.2.1",
"buffer": "6.0.3",
"clsx": "1.1.1",
"clsx": "1.2.1",
"file-loader": "6.2.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"stream-browserify": "3.0.0",
"url-loader": "4.1.1",
"xml-js": "1.6.11"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-beta.18",
"@tsconfig/docusaurus": "1.0.5",
"@types/react": "17.0.43",
"@types/react-helmet": "6.1.5",
"@docusaurus/module-type-aliases": "2.4.1",
"@tsconfig/docusaurus": "1.0.7",
"@types/react": "18.2.14",
"@types/react-helmet": "6.1.6",
"@types/react-router-dom": "5.3.3",
"typescript": "4.6.3"
"typescript": "5.1.3"
}
}
Loading

0 comments on commit abcd2ed

Please sign in to comment.