Use this module to interface with a Thea API instance.
$ npm install thea-js-sdk --save-devvar theaSdk = new TheaSdk({
api: 'https://my-thea-instance.com'
});
var theaSdk = new TheaSdk({
api: 'https://my-thea-instance.com',
project: '092f9894-26b0-4482-9eba-c287cb99fc62'
});
The api should not include /api.
A project can be set in the constructor to be utilized with other functions like startBuild and upload.
If it is not specified in the constructor, it can be specified with setProject.
theaSdk.setProject('092f9894-26b0-4482-9eba-c287cb99fc62');
This is passed through to the API server. Use this to specify configuration options for the project.
theaSdk.createProject({
service: {
name: 'github',
options: {
user: 'thea-diffing',
repository: 'thea-js-sdk'
}
}
});
This is passed through to the API server. If body.project is specified it will override the project specified with setProject.
theaSdk.startBuild({
head: headSha,
base: baseSha,
numBrowsers: 3
});
Upload a folder of images to the API server. If body.project is specified it will override the project specified with setProject.
theaSdk.upload({
sha: currentSha,
browser: 'Chrome',
imagePath: savedImagesPath
});