electron-builder
Version:
A complete solution to package and build a ready for distribution Electron app for MacOS, Windows and Linux with “auto update” support out of the box
44 lines (40 loc) • 1.7 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BintrayClient = undefined;
var _restApiRequest;
function _load_restApiRequest() {
return _restApiRequest = require("./restApiRequest");
}
class BintrayClient {
constructor(options, apiKey) {
if (options.owner == null) {
throw new Error("owner is not specified");
}
if (options.package == null) {
throw new Error("package is not specified");
}
this.repo = options.repo || "generic";
this.packageName = options.package;
this.owner = options.owner;
this.user = options.user || options.owner;
this.auth = apiKey == null ? null : `Basic ${ new Buffer(`${ this.user }:${ apiKey }`).toString("base64") }`;
this.basePath = `/packages/${ this.owner }/${ this.repo }/${ this.packageName }`;
}
getVersion(version) {
return (0, (_restApiRequest || _load_restApiRequest()).bintrayRequest)(`${ this.basePath }/versions/${ version }`, this.auth);
}
getVersionFiles(version) {
return (0, (_restApiRequest || _load_restApiRequest()).bintrayRequest)(`${ this.basePath }/versions/${ version }/files`, this.auth);
}
createVersion(version) {
return (0, (_restApiRequest || _load_restApiRequest()).bintrayRequest)(`${ this.basePath }/versions`, this.auth, {
name: version
});
}
deleteVersion(version) {
return (0, (_restApiRequest || _load_restApiRequest()).bintrayRequest)(`${ this.basePath }/versions/${ version }`, this.auth, null, "DELETE");
}
}
exports.BintrayClient = BintrayClient; //# sourceMappingURL=bintray.js.map