Skip to content

Commit

Permalink
v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hobigo committed Jun 23, 2020
1 parent 4fa26f5 commit 9a75c55
Show file tree
Hide file tree
Showing 51 changed files with 8,873 additions and 3,825 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ logs
*.log
npm-debug.log*

tmp

# service defs
userProvidedService.json

Expand Down
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
tsconfig.json
tslint.json
dist/test
dist/examples
coverage
.nyc_output
.vscode
Expand All @@ -13,5 +14,11 @@ coverage.lcov
.github
docs
demo
tmp
.nojekyll
CONTRIBUTING.md
ncnc-architecture.png
ncnc-logo.png
ncnc-object-model.png
# exclude local environment definition .en
.env
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 1.4.0 - 2020-06-22
### Added
- client.getFileSystemObjectByTags - returns an array of file system objects that have all given tags assigned (AND)

## 1.3.0 - 2020-06-17
### Added
- new user group handing on Client and UserGroup object
Expand Down
56 changes: 52 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,50 @@ import Client, { User, UserGroup } from "nextcloud-node-client";
}
})();
```
### Tagging
```typescript
// typescript
import Client, { File, Folder, Share, Tag, FileSystemElement } from "nextcloud-node-client";

(async () => {
try {
// create a new client using connectivity information from environment
const client = new Client();
// create a folder structure if not available
const folder: Folder = await client.createFolder("folder/subfolder");
// create file within the folder
const file: File = await folder.createFile("myFile.txt", Buffer.from("My file content"));
// create two tags
const tag1: Tag = await client.createTag("tag 1");
const tag2: Tag = await client.createTag("tag 2");
// assign tag to folder
folder.addTag(tag1.name);
// assign tag to files
file.addTag(tag1.name);
file.addTag(tag2.name);

// get list of file system elements with the tag1 assigned
let fse: FileSystemElement[] = await client.getFileSystemElementByTags([tag1]);
// print names of folder and file
console.log(fse[0].name);
console.log(fse[1].name);

// get list of file system elements with the tag1 and tag2
fse = await client.getFileSystemElementByTags([tag1, tag2]);
// print name of file
console.log(fse[0].name);

// delete the tags
await tag1.delete();
await tag2.delete();
// delete the folder including the file and share
await folder.delete();
} catch (e) {
// some error handling
console.log(e);
}
})();
```

## Quality
Tested with nextcloud 17.0.1, 18.0.0
Expand All @@ -373,6 +417,13 @@ A code coverage of 100% is aspired

## Todo list

### Access using tags
<strike>* Get files and folders by tags client.getFileSystemObjectByTags</strike>

### Search
* Search for files api
* client in github actions - upload files

### User management
User:
* <strike>get</strike>
Expand Down Expand Up @@ -410,15 +461,12 @@ Share with
basic methods are available since 1.2.0 without strong typing
* notification object

### Access using tags
Get files and folders by tag

### Refactoring
* Introduction of exception classes instead of error codes (breaking change)
* <strike>Move from codecov to coveralls</strike>

### Search
Search for files api
* Search for files api
* client in github actions - upload files

## License
Expand Down
Loading

0 comments on commit 9a75c55

Please sign in to comment.