forked from project-sunbird/sunbird-localization
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphrase.js
21 lines (17 loc) · 788 Bytes
/
phrase.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var http = require('./httpdata');
var request = require('request-promise');
const getProjects = (authToken, projectURL) => {
const projects = http.getData(authToken, projectURL);
return request(projects);
};
const getLocales = (authToken, projectURL, projectId) => {
const locales = http.getData(authToken, projectURL + '/' + projectId + '/locales');
return request(locales);
};
const downloadFile = (authToken, projectURL, projectId, localeId, fileformat, encoding) => {
const file = http.getData(authToken, projectURL + '/' + projectId + '/locales/' + localeId + '/download?file_format=' + fileformat + '&encoding=' + encoding);
return request(file);
};
exports.getProjects = getProjects;
exports.getLocales = getLocales;
exports.downloadFile = downloadFile;