dtable-web-api
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -532,2 +532,121 @@ "use strict"; | ||
} | ||
}, { | ||
key: "sysAdminListAllDTables", | ||
value: function sysAdminListAllDTables(page, perPage) { | ||
var url = this.server + '/api/v2.1/admin/dtables/'; | ||
var params = { | ||
page: page, | ||
per_page: perPage | ||
}; | ||
return this.req.get(url, { | ||
params: params | ||
}); | ||
} // sysadmin org api | ||
}, { | ||
key: "sysAdminListOrgs", | ||
value: function sysAdminListOrgs() { | ||
var url = this.server + '/api/v2.1/admin/organizations/'; | ||
return this.req.get(url); | ||
} | ||
}, { | ||
key: "sysAdminGetOrg", | ||
value: function sysAdminGetOrg(orgID) { | ||
var url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/'; | ||
return this.req.get(url); | ||
} | ||
}, { | ||
key: "sysAdminUpdateOrg", | ||
value: function sysAdminUpdateOrg(orgID, orgInfo) { | ||
var url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/'; | ||
var formData = new _formData["default"](); | ||
if (orgInfo.orgName) { | ||
formData.append('org_name', orgInfo.orgName); | ||
} | ||
if (orgInfo.maxUserNumber) { | ||
formData.append('max_user_number', orgInfo.maxUserNumber); | ||
} | ||
if (orgInfo.quota) { | ||
formData.append('quota', orgInfo.quota); | ||
} | ||
if (orgInfo.role) { | ||
formData.append('role', orgInfo.role); | ||
} | ||
return this.req.put(url, formData); | ||
} | ||
}, { | ||
key: "sysAdminAddOrg", | ||
value: function sysAdminAddOrg(orgName, ownerEmail, owner_password) { | ||
var url = this.server + '/api/v2.1/admin/organizations/'; | ||
var formData = new _formData["default"](); | ||
formData.append('org_name', orgName); | ||
formData.append('owner_email', ownerEmail); | ||
formData.append('owner_password', owner_password); | ||
return this._sendPostRequest(url, formData); | ||
} | ||
}, { | ||
key: "sysAdminDeleteOrg", | ||
value: function sysAdminDeleteOrg(orgID) { | ||
var url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/'; | ||
return this.req["delete"](url); | ||
} | ||
}, { | ||
key: "sysAdminListOrgUsers", | ||
value: function sysAdminListOrgUsers(orgID) { | ||
var url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/users/'; | ||
return this.req.get(url); | ||
} | ||
}, { | ||
key: "sysAdminAddOrgUser", | ||
value: function sysAdminAddOrgUser(orgID, email, name, password) { | ||
var url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/users/'; | ||
var formData = new _formData["default"](); | ||
formData.append('email', email); | ||
formData.append('name', name); | ||
formData.append('password', password); | ||
return this._sendPostRequest(url, formData); | ||
} | ||
}, { | ||
key: "sysAdminUpdateOrgUser", | ||
value: function sysAdminUpdateOrgUser(orgID, email, attribute, value) { | ||
var url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/users/' + encodeURIComponent(email) + '/'; | ||
var formData = new _formData["default"](); | ||
switch (attribute) { | ||
case 'active': | ||
formData.append('active', value); | ||
break; | ||
case 'name': | ||
formData.append('name', value); | ||
break; | ||
case 'contact_email': | ||
formData.append('contact_email', value); | ||
break; | ||
case 'quota_total': | ||
formData.append('quota_total', value); | ||
break; | ||
} | ||
return this.req.put(url, formData); | ||
} | ||
}, { | ||
key: "sysAdminDeleteOrgUser", | ||
value: function sysAdminDeleteOrgUser(orgID, email) { | ||
var url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/users/' + encodeURIComponent(email) + '/'; | ||
return this.req["delete"](url); | ||
} | ||
}, { | ||
key: "sysAdminListOrgGroups", | ||
value: function sysAdminListOrgGroups(orgID) { | ||
var url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/groups/'; | ||
return this.req.get(url); | ||
} | ||
}]); | ||
@@ -534,0 +653,0 @@ |
{ | ||
"name": "dtable-web-api", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "an interface for dtable-web", | ||
@@ -5,0 +5,0 @@ "main": "lib/dtable-web-api.js", |
@@ -414,5 +414,101 @@ import axios from 'axios'; | ||
} | ||
sysAdminListAllDTables(page, perPage) { | ||
const url = this.server + '/api/v2.1/admin/dtables/'; | ||
let params = { | ||
page: page, | ||
per_page: perPage | ||
}; | ||
return this.req.get(url, {params: params}); | ||
} | ||
// sysadmin org api | ||
sysAdminListOrgs() { | ||
const url = this.server + '/api/v2.1/admin/organizations/'; | ||
return this.req.get(url); | ||
} | ||
sysAdminGetOrg(orgID) { | ||
const url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/'; | ||
return this.req.get(url); | ||
} | ||
sysAdminUpdateOrg(orgID, orgInfo) { | ||
const url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/'; | ||
let formData = new FormData(); | ||
if (orgInfo.orgName) { | ||
formData.append('org_name', orgInfo.orgName); | ||
} | ||
if (orgInfo.maxUserNumber) { | ||
formData.append('max_user_number', orgInfo.maxUserNumber); | ||
} | ||
if (orgInfo.quota) { | ||
formData.append('quota', orgInfo.quota); | ||
} | ||
if (orgInfo.role) { | ||
formData.append('role', orgInfo.role); | ||
} | ||
return this.req.put(url, formData); | ||
} | ||
sysAdminAddOrg(orgName, ownerEmail, owner_password) { | ||
const url = this.server + '/api/v2.1/admin/organizations/'; | ||
let formData = new FormData(); | ||
formData.append('org_name', orgName); | ||
formData.append('owner_email', ownerEmail); | ||
formData.append('owner_password', owner_password); | ||
return this._sendPostRequest(url, formData); | ||
} | ||
sysAdminDeleteOrg(orgID) { | ||
const url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/'; | ||
return this.req.delete(url); | ||
} | ||
sysAdminListOrgUsers(orgID) { | ||
const url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/users/'; | ||
return this.req.get(url); | ||
} | ||
sysAdminAddOrgUser(orgID, email, name, password) { | ||
const url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/users/'; | ||
let formData = new FormData(); | ||
formData.append('email', email); | ||
formData.append('name', name); | ||
formData.append('password', password); | ||
return this._sendPostRequest(url, formData); | ||
} | ||
sysAdminUpdateOrgUser(orgID, email, attribute, value) { | ||
const url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/users/' + encodeURIComponent(email) + '/'; | ||
let formData = new FormData(); | ||
switch (attribute) { | ||
case 'active': | ||
formData.append('active', value); | ||
break; | ||
case 'name': | ||
formData.append('name', value); | ||
break; | ||
case 'contact_email': | ||
formData.append('contact_email', value); | ||
break; | ||
case 'quota_total': | ||
formData.append('quota_total', value); | ||
break; | ||
} | ||
return this.req.put(url, formData); | ||
} | ||
sysAdminDeleteOrgUser(orgID, email) { | ||
const url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/users/' + encodeURIComponent(email) + '/'; | ||
return this.req.delete(url); | ||
} | ||
sysAdminListOrgGroups(orgID) { | ||
const url = this.server + '/api/v2.1/admin/organizations/' + orgID + '/groups/'; | ||
return this.req.get(url); | ||
} | ||
} | ||
export default DTableWebAPI; | ||
export default DTableWebAPI; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40060
1051