Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigraine committed Nov 2, 2017
2 parents 1479fda + 01515c2 commit 21fb294
Show file tree
Hide file tree
Showing 17 changed files with 1,568 additions and 7 deletions.
38 changes: 38 additions & 0 deletions bitmovin/account/organizations/groups.js
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); };
10 changes: 8 additions & 2 deletions bitmovin/account/organizations/organizations.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import urljoin from 'url-join';
import http from '../../http';
import groups from './groups';

export const organizations = (configuration, http) => {
const { get, post, delete_ } = http;
const { get, post, delete_, put } = http;
const organizationsBaseUrl = urljoin(configuration.apiBaseUrl, 'account', 'organizations');

let fn = (organizationId) => {
Expand All @@ -14,7 +15,12 @@ export const organizations = (configuration, http) => {
delete: () => {
let url = urljoin(organizationsBaseUrl, organizationId);
return delete_(configuration, url);
}
},
update: (organization) => {
let url = urljoin(organizationsBaseUrl, organizationId);
return put(configuration, url, organization);
},
groups: groups(configuration, organizationId)
};
};

Expand Down
34 changes: 34 additions & 0 deletions bitmovin/account/organizations/permissions.js
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); };
34 changes: 34 additions & 0 deletions bitmovin/account/organizations/tenants.js
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); };
7 changes: 7 additions & 0 deletions bitmovin/analytics/query_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ class Builder {
}
return this;
}
licenseKey(licenseKey) {
this.query_ = {
...this.query_,
licenseKey
}
return this;
}
query() {
return this.target_(this.query_)
}
Expand Down
2 changes: 1 addition & 1 deletion bitmovin/bitmovin.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class Bitmovin {
'X-Api-Key' : configuration.apiKey,
'X-Tenant-Org-Id' : configuration.tenantOrgId,
'X-Api-Client' : configuration.xApiClient,
'X-Api-Client-Version': '1.1.19'
'X-Api-Client-Version': '1.2.2'
};

this.configuration = configuration;
Expand Down
3 changes: 2 additions & 1 deletion bitmovin/encoding/hlsManifestMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const hlsManifestMedia = (configuration, manifestId, http) => {
video : typeFn('video'),
audio : typeFn('audio'),
subtitles : typeFn('subtitles'),
closedCaptions: typeFn('closed-captions')
closedCaptions: typeFn('closed-captions'),
vtt : typeFn('vtt')
};
};

Expand Down
Loading

0 comments on commit 21fb294

Please sign in to comment.