-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,568 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import urljoin from 'url-join'; | ||
import http from '../../http'; | ||
import permissions from './permissions'; | ||
import tenants from './tenants'; | ||
|
||
export const groups = (configuration, organizationId, http) => { | ||
const { get, post, delete_ } = http; | ||
const groupsBaseUrl = urljoin(configuration.apiBaseUrl, 'account', 'organizations', organizationId, 'groups'); | ||
|
||
let fn = (groupId) => { | ||
return { | ||
details: () => { | ||
let url = urljoin(groupsBaseUrl, groupId); | ||
return get(configuration, url); | ||
}, | ||
delete: () => { | ||
let url = urljoin(groupsBaseUrl, groupId); | ||
return delete_(configuration, url); | ||
}, | ||
permissions: permissions(configuration, organizationId, groupId), | ||
tenants: tenants(configuration, organizationId, groupId) | ||
}; | ||
}; | ||
|
||
fn.add = (group) => { | ||
const url = urljoin(groupsBaseUrl); | ||
return post(configuration, url, group); | ||
}; | ||
|
||
fn.list = () => { | ||
const url = urljoin(groupsBaseUrl); | ||
return get(configuration, url); | ||
}; | ||
|
||
return fn; | ||
}; | ||
|
||
export default (configuration, organizationId) => { return groups(configuration, organizationId, http); }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import urljoin from 'url-join'; | ||
import http from '../../http'; | ||
|
||
export const permissions = (configuration, organizationId, groupId, http) => { | ||
const { get, post, delete_ } = http; | ||
const permissionsBaseUrl = urljoin(configuration.apiBaseUrl, 'account', 'organizations', organizationId, 'groups', groupId, 'permissions'); | ||
|
||
let fn = (groupId) => { | ||
return { | ||
details: () => { | ||
let url = urljoin(permissionsBaseUrl, groupId); | ||
return get(configuration, url); | ||
}, | ||
delete: () => { | ||
let url = urljoin(permissionsBaseUrl, groupId); | ||
return delete_(configuration, url); | ||
} | ||
}; | ||
}; | ||
|
||
fn.add = (permission) => { | ||
const url = urljoin(permissionsBaseUrl); | ||
return post(configuration, url, permission); | ||
}; | ||
|
||
fn.list = () => { | ||
const url = urljoin(permissionsBaseUrl); | ||
return get(configuration, url); | ||
}; | ||
|
||
return fn; | ||
}; | ||
|
||
export default (configuration, organizationId, groupId) => { return permissions(configuration, organizationId, groupId, http); }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import urljoin from 'url-join'; | ||
import http from '../../http'; | ||
|
||
export const tenants = (configuration, organizationId, groupId, http) => { | ||
const { get, post, delete_ } = http; | ||
const tenantsBaseUrl = urljoin(configuration.apiBaseUrl, 'account', 'organizations', organizationId, 'groups', groupId, 'tenants'); | ||
|
||
let fn = (tenantId) => { | ||
return { | ||
details: () => { | ||
let url = urljoin(tenantsBaseUrl, tenantId); | ||
return get(configuration, url); | ||
}, | ||
delete: () => { | ||
let url = urljoin(tenantsBaseUrl, tenantId); | ||
return delete_(configuration, url); | ||
} | ||
}; | ||
}; | ||
|
||
fn.add = (tenant) => { | ||
const url = urljoin(tenantsBaseUrl); | ||
return post(configuration, url, tenant); | ||
}; | ||
|
||
fn.list = () => { | ||
const url = urljoin(tenantsBaseUrl); | ||
return get(configuration, url); | ||
}; | ||
|
||
return fn; | ||
}; | ||
|
||
export default (configuration, organizationId, groupId) => { return tenants(configuration, organizationId, groupId, http); }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.