nextcloud-node-client
Advanced tools
Comparing version 1.1.6 to 1.2.0
@@ -9,2 +9,13 @@ # Changelog | ||
## 1.2.0 - 2020-04-16 | ||
### Added | ||
- Object model in readme | ||
- usage of coveralls | ||
- increaded vode coverage | ||
- client updates: getNotifications, getUpdateNotifications, sendNotificationToUser, | ||
- client updates: getApps, getAppInfos | ||
- client updates: getGroups, getGroupsDetails, getGroupsDetailsByID | ||
## 1.1.1 - 2020-01-28 | ||
@@ -11,0 +22,0 @@ ### Added |
@@ -14,5 +14,2 @@ /// <reference types="node" /> | ||
export { Client, ClientError, Environment, Folder, File, FileSystemElement, ICreateShare, Tag, FakeServer, Server, SharePermission, RequestResponseLog, RequestResponseLogEntry, }; | ||
export interface ISysInfoNextcloudSystem { | ||
"version": string; | ||
} | ||
export interface ISysInfoNextcloudClient { | ||
@@ -22,6 +19,15 @@ "version": string; | ||
export interface ISysInfoNextcloud { | ||
"system": ISysInfoNextcloudSystem; | ||
"system": object; | ||
"storage": object; | ||
"shares": object; | ||
} | ||
export interface ISysBasicData { | ||
"serverTimeString": string; | ||
"uptimeString": string; | ||
"timeServersString": string; | ||
} | ||
export interface ISystemInfo { | ||
"nextcloud": ISysInfoNextcloud; | ||
"server": object; | ||
"activeUsers": object; | ||
"nextcloudClient": ISysInfoNextcloudClient; | ||
@@ -160,3 +166,3 @@ } | ||
*/ | ||
createFile(fileName: string, data: Buffer): Promise<File>; | ||
createFile(fileName: string, data: Buffer | NodeJS.ReadableStream): Promise<File>; | ||
/** | ||
@@ -186,2 +192,8 @@ * returns a nextcloud file object | ||
/** | ||
* returns the content of a file | ||
* @param fileName name of the file /d1/file1.txt | ||
* @returns Buffer with file content | ||
*/ | ||
pipeContentStream(fileName: string, destination: NodeJS.WritableStream): Promise<void>; | ||
/** | ||
* returns the link to a file for downloading | ||
@@ -226,6 +238,26 @@ * @param fileName name of the file /folder1/folder1.txt | ||
getSystemInfo(): Promise<ISystemInfo>; | ||
getSystemBasicData(): Promise<ISysBasicData>; | ||
/** | ||
* @returns array of notification objects | ||
*/ | ||
getNotifications(): Promise<object[]>; | ||
getUpdateNotifications(version: string): Promise<object>; | ||
sendNotificationToUser(userId: string, shortMessage: string, longMessage?: string): Promise<void>; | ||
/** | ||
* returns apps | ||
*/ | ||
getApps(): Promise<string[]>; | ||
getAppInfos(appName: string): Promise<object>; | ||
/** | ||
* returns groups | ||
*/ | ||
getGroups(): Promise<string[]>; | ||
getGroupsDetails(): Promise<object>; | ||
getGroupsDetailsByID(groupId: string): Promise<object>; | ||
/** | ||
* returns users | ||
*/ | ||
getUserIDs(): Promise<string[]>; | ||
getUserDetails(): Promise<object>; | ||
getUserDetailsByID(userId: string): Promise<object>; | ||
createUser(options: { | ||
@@ -232,0 +264,0 @@ userId: string; |
@@ -42,7 +42,7 @@ /// <reference types="node" /> | ||
* @param fileBaseName the base name of the file | ||
* @param data the buffer with file content | ||
* @param data the buffer or stream with file content | ||
* @returns the new file or null | ||
* @throws Error | ||
*/ | ||
createFile(fileBaseName: string, data: Buffer): Promise<File>; | ||
createFile(fileBaseName: string, data: Buffer | NodeJS.ReadableStream): Promise<File>; | ||
/** | ||
@@ -49,0 +49,0 @@ * deletes the folder and the contained files |
@@ -103,3 +103,3 @@ "use strict"; | ||
* @param fileBaseName the base name of the file | ||
* @param data the buffer with file content | ||
* @param data the buffer or stream with file content | ||
* @returns the new file or null | ||
@@ -106,0 +106,0 @@ * @throws Error |
@@ -76,2 +76,5 @@ "use strict"; | ||
}); | ||
response.body.pipe = (destination, options) => { | ||
destination.write(responseText); | ||
}; | ||
response.json = () => __awaiter(this, void 0, void 0, function* () { | ||
@@ -78,0 +81,0 @@ return JSON.parse(responseText); |
@@ -52,3 +52,3 @@ "use strict"; | ||
if (logEntry.request.body) { | ||
if (logEntry.request.body.indexOf("<?xml version") !== -1) { | ||
if (logEntry.request.body.indexOf && logEntry.request.body.indexOf("<?xml version") !== -1) { | ||
logEntry.request.jsonBody = this.xmlToJson(logEntry.request.body); | ||
@@ -55,0 +55,0 @@ } |
{ | ||
"name": "nextcloud-node-client", | ||
"version": "1.1.6", | ||
"version": "1.2.0", | ||
"description": "Nextcloud client API for node.js applications", | ||
@@ -50,2 +50,5 @@ "main": "dist/client.js", | ||
"author": "Holger Gockel", | ||
"contributors": [ | ||
"Scrounger" | ||
], | ||
"license": "Apache-2.0", | ||
@@ -56,3 +59,3 @@ "dependencies": { | ||
"fast-xml-parser": "^3.16.0", | ||
"http-proxy-agent": "^4.0.0", | ||
"http-proxy-agent": "^4.0.1", | ||
"node-fetch": "^2.6.0", | ||
@@ -62,10 +65,10 @@ "vcap_services": "^0.7.1" | ||
"devDependencies": { | ||
"@types/chai": "^4.2.8", | ||
"@types/chai": "^4.2.9", | ||
"@types/debug": "^4.1.5", | ||
"@types/http-proxy-agent": "^2.0.2", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^13.7.0", | ||
"@types/mocha": "^7.0.1", | ||
"@types/node": "^13.7.1", | ||
"@types/node-fetch": "^2.5.4", | ||
"chai": "^4.2.0", | ||
"codecov": "^3.6.4", | ||
"codecov": "^3.6.5", | ||
"mocha": "^7.0.1", | ||
@@ -75,4 +78,4 @@ "mocked-env": "^1.3.2", | ||
"ts-loader": "^6.2.1", | ||
"ts-node": "^8.6.1", | ||
"tslint": "^5.20.1", | ||
"ts-node": "^8.6.2", | ||
"tslint": "^6.1.0", | ||
"typedoc": "^0.16.9", | ||
@@ -79,0 +82,0 @@ "typescript": "^3.7.5" |
@@ -9,3 +9,3 @@ # nextcloud-node-client | ||
[![Dependency Status](https://david-dm.org/hobigo/nextcloud-node-client.svg?style=flat)](https://david-dm.org/hobigo/nextcloud-node-client) | ||
[![Coverage Status](https://coveralls.io/repos/github/hobigo/nextcloud-node-client/badge.svg)](https://coveralls.io/github/hobigo/nextcloud-node-client) | ||
[![Coverage Status](https://coveralls.io/repos/github/hobigo/nextcloud-node-client/badge.svg?branch=master)](https://coveralls.io/github/hobigo/nextcloud-node-client?branch=master) | ||
[![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=nextcloud-node-client) | ||
@@ -53,7 +53,7 @@ [![documentation](https://img.shields.io/website-up-down-green-red/https/hobigo.github.io/nextcloud-node-client.svg?label=documentation-website)](https://hobigo.github.io/nextcloud-node-client) | ||
# Documentation | ||
* [Installation](##-installation) | ||
* [Security and access management](##-security-and-access-management) | ||
* [Concepts](##-concepts) | ||
* [API](##-api) | ||
* [Architecture](##-architecture) | ||
* [Installation](#installation) | ||
* [Security and access management](#security-and-access-management) | ||
* [Concepts](#concepts) | ||
* [API](#api) | ||
* [Architecture](#architecture) | ||
@@ -120,3 +120,7 @@ ## Installation | ||
## Concepts | ||
## Concepts and Philosophy | ||
The nextcloud-node-client provids a object oriented API in TypeScript. The focus is to provide a simple access to the nextcloud resources rather than a full functional coverage. | ||
![nextcloud node client object model](https://raw.githubusercontent.com/hobigo/nextcloud-node-client/master/ncnc-object-model.png) | ||
The client comes with an object oriented API to access the APIs of nextcloud. The following object types are supported: | ||
@@ -280,6 +284,5 @@ ### Client | ||
![nextcloud node client component architecture](https://raw.githubusercontent.com/hobigo/nextcloud-node-client/master/ncnc-architecture.png) | ||
![alt text](https://raw.githubusercontent.com/hobigo/nextcloud-node-client/master/ncnc-architecture.png) | ||
## Quality | ||
@@ -295,2 +298,3 @@ Tested with nextcloud 17.0.1, 18.0.0 | ||
* get | ||
* getIds limit, offset, search | ||
* create | ||
@@ -297,0 +301,0 @@ * update |
Sorry, the diff of this file is too big to display
244782
39
3516
334
Updatedhttp-proxy-agent@^4.0.1