Skip to content

Commit

Permalink
feat: add support to sharedWithMe
Browse files Browse the repository at this point in the history
  • Loading branch information
br14n-sol committed Jun 17, 2024
1 parent 59e068f commit 2785264
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ visibility({
```

</td></tr>
<tr><td>sharedWithMe</td><td>❌</td><td>❌</td></tr>
<tr><td>properties</td><td>

```ts
Expand Down Expand Up @@ -259,6 +258,23 @@ updatedAt({

</td></tr>
<tr><td>viewedByMeTime</td><td>❌</td><td>❌</td></tr>
<tr><td>sharedWithMe</td>
<td>

```ts
shared(bool?)
```
</td><td>
```js
shared()
//=> sharedWithMe = true
shared(false)
//=> sharedWithMe = false
```
</td></tr>
<tr><td>trashed</td><td>
```ts
Expand Down
10 changes: 9 additions & 1 deletion src/QueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class QueryBuilder {

// TODO: Add alternative to negate query.
// TODO: Add support to viewedByMeTime.
// TODO: Add support to sharedWithMe.
// TODO: Add support to shortcutDetails.targetId.
// TODO: Add support to memberCount.
// TODO: Add support to organizerCount.
Expand Down Expand Up @@ -149,6 +148,15 @@ class QueryBuilder {
return this
}

shared(bool?: boolean): QueryBuilder {
this.addQuery(QueryType.BOOLEAN, {
field: FileProperty.SHARED_WITH_ME,
defOperator: Operator.EQUAL,
entry: `${bool ?? true}`
})
return this
}

trashed(bool?: boolean): QueryBuilder {
this.addQuery(QueryType.BOOLEAN, {
field: FileProperty.TRASHED,
Expand Down
1 change: 1 addition & 0 deletions src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export enum FileProperty {
APP_PROPERTIES = 'appProperties',
CREATED_TIME = 'createdTime',
MODIFIED_TIME = 'modifiedTime',
SHARED_WITH_ME = 'sharedWithMe',
TRASHED = 'trashed',
STARRED = 'starred',
HIDDEN = 'hidden'
Expand Down

0 comments on commit 2785264

Please sign in to comment.