Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zimbra-admin-api-js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
zimbra-admin-api-js
Commits
a84f8c1a
Commit
a84f8c1a
authored
Apr 21, 2016
by
Patricio Bruna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added domain.getAllDistributionLists()
parent
739522ee
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
6 deletions
+36
-6
README.md
README.md
+9
-0
zimbra-admin-api.js
lib/zimbra-admin-api.js
+10
-0
zimbra-admin-api.js.map
lib/zimbra-admin-api.js.map
+1
-1
domain.js
src/zimbra/domain.js
+9
-0
test.js
test/js/spec/test.js
+7
-5
No files found.
README.md
View file @
a84f8c1a
...
...
@@ -326,3 +326,12 @@ Return an Array of the Domain Admins `Accounts`.
domain
.
getAdmins
(
callback
);
// [Account, Account]
```
### Distribution Lists
Return an Array of the Domain
`DistributionList`
s.
```
javascript
// domain is a Domain, you got it from zimbraApi.getDomain....
domain
.
getAllDistributionLists
(
callback
);
// [DistributionList, DistributionList]
```
lib/zimbra-admin-api.js
View file @
a84f8c1a
...
...
@@ -13161,6 +13161,16 @@ return /******/ (function(modules) { // webpackBootstrap
return callback(null, ids);
});
}
}, {
key: 'getAllDistributionLists',
value: function getAllDistributionLists(callback) {
var query_object = { domain: this.name };
this.api.getAllDistributionLists(function (e, d) {
if (e) return callback(e);
if (d.total === 0) return callback(null, []);
return callback(null, d.dl);
}, query_object);
}
}, {
key: 'countAccounts',
value: function countAccounts(callback) {
lib/zimbra-admin-api.js.map
View file @
a84f8c1a
This diff is collapsed.
Click to expand it.
src/zimbra/domain.js
View file @
a84f8c1a
...
...
@@ -43,6 +43,15 @@ export default class Domain extends Zimbra {
});
}
getAllDistributionLists
(
callback
)
{
let
query_object
=
{
domain
:
this
.
name
};
this
.
api
.
getAllDistributionLists
(
function
(
e
,
d
){
if
(
e
)
return
callback
(
e
);
if
(
d
.
total
===
0
)
return
callback
(
null
,
[]);
return
callback
(
null
,
d
.
dl
);
},
query_object
);
}
countAccounts
(
callback
)
{
const
maxAccountsByCos
=
this
.
maxAccountsByCos
();
this
.
api
.
countAccounts
(
this
.
id
,
function
(
e
,
d
){
...
...
test/js/spec/test.js
View file @
a84f8c1a
...
...
@@ -353,7 +353,7 @@
});
});
it
(
'domain.
a
dmins() should return the domain admins'
,
function
(
done
){
it
(
'domain.
getA
dmins() should return the domain admins'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
api
.
getDomain
(
'customer.dev'
,
function
(
err
,
data
){
if
(
err
)
console
.
error
(
err
);
...
...
@@ -366,19 +366,21 @@
});
});
it
(
'domain.
admins() should return empty array if no admin
s'
,
function
(
done
){
it
(
'domain.
getAllDistributionLists should return the DL
s'
,
function
(
done
){
let
api
=
new
ZimbraAdminApi
(
auth_data
);
api
.
getDomain
(
'
zboxapp
.dev'
,
function
(
err
,
data
){
api
.
getDomain
(
'
customer
.dev'
,
function
(
err
,
data
){
if
(
err
)
console
.
error
(
err
);
let
domain
=
data
;
domain
.
getA
dmin
s
(
function
(
e
,
d
){
domain
.
getA
llDistributionList
s
(
function
(
e
,
d
){
if
(
e
)
return
console
.
log
(
e
);
expect
(
d
.
length
).
to
.
be
.
empty
;
expect
(
d
[
0
].
constructor
.
name
).
to
.
be
.
equal
(
'DistributionList'
)
;
done
();
});
});
});
});
describe
(
'DistributionList tests'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment