rest-on-couch-client
Advanced tools
Comparing version 3.3.4 to 3.4.0
# Changelog | ||
## [3.4.0](https://www.github.com/cheminfo/rest-on-couch-client/compare/v3.3.4...v3.4.0) (2021-11-19) | ||
### Features | ||
* add getGroupsInfo method ([2faa78a](https://www.github.com/cheminfo/rest-on-couch-client/commit/2faa78ae77f5a73db65fd04b2b51b3883b5494df)) | ||
### [3.3.4](https://www.github.com/cheminfo/rest-on-couch-client/compare/v3.3.3...v3.3.4) (2021-11-17) | ||
@@ -4,0 +11,0 @@ |
@@ -261,2 +261,16 @@ import { RocClientError, RocHTTPError } from '../Error'; | ||
} | ||
async getGroupsInfo() { | ||
return [ | ||
{ | ||
name: 'anonymousRead', | ||
rights: ['read'], | ||
users: ['test@test.com'], | ||
}, | ||
{ | ||
name: 'testGroup', | ||
rights: ['write', 'create'], | ||
users: ['test@test.com'], | ||
}, | ||
]; | ||
} | ||
} | ||
@@ -263,0 +277,0 @@ function randomBytes() { |
@@ -73,2 +73,6 @@ import axios from 'axios'; | ||
} | ||
async getGroupsInfo() { | ||
const response = await this.dbRequest.get('groups/info'); | ||
return response.data; | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
import { ICouchGroupInfo } from '..'; | ||
import { ICouchUser, ICouchUserGroup, INewDocument, IQueryOptions, IReduceQueryOptions } from '../types'; | ||
@@ -8,2 +9,3 @@ import BaseRocDocument from './BaseRocDocument'; | ||
abstract getUserGroups(): Promise<ICouchUserGroup[]>; | ||
abstract getGroupsInfo(): Promise<ICouchGroupInfo[]>; | ||
abstract getDocument<ContentType = Record<string, any>>(uuid: string): BaseRocDocument<ContentType>; | ||
@@ -10,0 +12,0 @@ abstract getQuery<KeyType = any, ValueType = any, ContentType = Record<string, any>>(viewName: string, options?: IQueryOptions): BaseRocQuery<KeyType, ValueType, ContentType>; |
@@ -77,2 +77,7 @@ /// <reference types="node" /> | ||
}[]>; | ||
getGroupsInfo(): Promise<{ | ||
name: string; | ||
rights: string[]; | ||
users: string[]; | ||
}[]>; | ||
} |
@@ -268,2 +268,16 @@ "use strict"; | ||
} | ||
async getGroupsInfo() { | ||
return [ | ||
{ | ||
name: 'anonymousRead', | ||
rights: ['read'], | ||
users: ['test@test.com'], | ||
}, | ||
{ | ||
name: 'testGroup', | ||
rights: ['write', 'create'], | ||
users: ['test@test.com'], | ||
}, | ||
]; | ||
} | ||
} | ||
@@ -270,0 +284,0 @@ exports.FakeRoc = FakeRoc; |
@@ -0,1 +1,2 @@ | ||
import { ICouchGroupInfo } from '..'; | ||
import { BaseRocReduceQuery } from '../base'; | ||
@@ -27,2 +28,3 @@ import BaseRoc from '../base/BaseRoc'; | ||
getUserGroups(): Promise<ICouchUserGroup[]>; | ||
getGroupsInfo(): Promise<ICouchGroupInfo[]>; | ||
} |
@@ -75,3 +75,7 @@ "use strict"; | ||
} | ||
async getGroupsInfo() { | ||
const response = await this.dbRequest.get('groups/info'); | ||
return response.data; | ||
} | ||
} | ||
exports.default = Roc; |
@@ -118,2 +118,8 @@ /// <reference types="node" /> | ||
} | ||
export interface ICouchGroupInfo { | ||
name: string; | ||
description?: string; | ||
users?: string[]; | ||
rights?: string[]; | ||
} | ||
export {}; |
{ | ||
"name": "rest-on-couch-client", | ||
"version": "3.3.4", | ||
"version": "3.4.0", | ||
"description": "A nodejs / browser client for rest-on-couch backend", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
229278
5133