Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@existdb/node-exist

Package Overview
Dependencies
Maintainers
3
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@existdb/node-exist - npm Package Compare versions

Comparing version
4.4.0
to
4.5.0
+1
-1
components/users.js

@@ -6,3 +6,3 @@ function getUserInfo (client, userName) {

function list (client) {
return client.promisedMethodCall('getUsers', [])
return client.promisedMethodCall('getAccounts', [])
}

@@ -9,0 +9,0 @@

@@ -58,3 +58,3 @@ {

},
"version": "4.4.0"
"version": "4.5.0"
}

@@ -402,10 +402,37 @@ # node-exist

Status: failing
Status: working
#### byName
#### getUserInfo
Will return the information about the given user.
```js
db.users.byName(username)
db.users.getUserInfo(username)
```
Example:
```js
db.users.getUserInfo('admin')
```
Returns:
```js
{
uid: 1048574,
'default-group-id': 1048575,
umask: 18,
metadata: {
'http://exist-db.org/security/description': 'System Administrator',
'http://axschema.org/namePerson': 'admin'
},
'default-group-name': 'dba',
'default-group-realmId': 'exist',
name: 'admin',
groups: [ 'dba' ],
enabled: 'true'
}
```
#### list

@@ -417,2 +444,4 @@

Returns an array of user info objects (see [getUserInfo()](#getuserinfo)).
### server

@@ -487,4 +516,4 @@

**node-exist** is tested to be compatible with **eXist-db 4 and 5**.
It should be compatible with version 3, except XAR installation.
**node-exist** is tested to be compatible with **eXist-db 4, 5 and 6**.
It should be compatible with version 3, except for the XAR installation.

@@ -491,0 +520,0 @@ ## Disclaimer

@@ -23,3 +23,3 @@ # node-exist Command Line Scripts

- Install [dotenv-cli](https://www.npmjs.com/package/dotenv-cli) globally
- Install [dotenv-cli](https://www.npmjs.com/package/dotenv-cli) globally
```bash

@@ -26,0 +26,0 @@ npm install -g dotenv-cli

const test = require('tape')
const { connect } = require('../../index')
const connectionOptions = require('../connection')
const asGuest = Object.assign({},
connectionOptions,
{ basic_auth: { user: 'guest', pass: 'guest' } }
)
test.skip('list users', function (t) {
test('list users', function (t) {
const db = connect(connectionOptions)
db.users.list()
.then(function (r) {
console.log(r)
.then(function (list) {
t.plan(6)
t.ok(list.length, 'Returns a non-empty list of users')
const names = list.map(u => u.name)
t.true(names.includes('SYSTEM'), 'found user SYSTEM')
t.true(names.includes('admin'), 'found user admin')
t.true(names.includes('guest'), 'found user guest')
t.true(names.includes('monex'), 'found user monex')
t.true(names.includes('eXide'), 'found user eXide')
// exist 4.7.1 does not have these users
// t.true(names.includes('nobody'), 'found user nobody')
// t.true(names.includes('packageservice'), 'found user packageservice')
t.end()
})
.catch(function (e) {
console.error(e)
t.fail()
t.end()

@@ -18,2 +33,15 @@ })

test('list users as guest', function (t) {
const db = connect(asGuest)
db.users.list()
.then(function (list) {
t.ok(list.length, 'Returns a non-empty list of users')
t.end()
})
.catch(function (e) {
t.fail(e)
t.end()
})
})
test('get user info for admin', function (t) {

@@ -20,0 +48,0 @@ const db = connect(connectionOptions)