buildbot-data
Advanced tools
Comparing version 1.0.8 to 1.0.9
{ | ||
"name": "buildbot-data", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"homepage": "https://github.com/tothandras/buildbot-data", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -24,3 +24,3 @@ (function() { | ||
/* @ngInject */ | ||
$httpProvider.interceptors.push(function($log, API) { | ||
$httpProvider.interceptors.push(["$log", "API", function($log, API) { | ||
return { | ||
@@ -34,3 +34,3 @@ request: function(config) { | ||
}; | ||
}); | ||
}]); | ||
} | ||
@@ -659,3 +659,3 @@ | ||
DataService.prototype.control = function(method, params) { | ||
return restService.post({ | ||
return restService.post('', { | ||
id: this.getNextId(), | ||
@@ -751,2 +751,3 @@ jsonrpc: '2.0', | ||
}; | ||
Data.prototype.$get.$inject = ["$log", "$injector", "$q", "restService", "socketService", "dataUtilsService", "ENDPOINTS"]; | ||
@@ -753,0 +754,0 @@ return Data; |
@@ -1,1 +0,1 @@ | ||
(function(){var t;t=function(){function t(){return[]}return t}(),angular.module("bbData",new t)}).call(this),function(){var t;t=function(){function t(t){t.interceptors.push(["$log","API",function(t,n){return{request:function(r){return 0===r.url.indexOf(n)&&t.debug(r.method+" "+r.url),r}}}])}return t}(),angular.module("bbData").config(["$httpProvider",t])}.call(this),function(){var t,n;t=function(){function t(){return"api/v2/"}return t}(),n=function(){function t(){return["builders","builds","buildrequests","buildslaves","buildsets","changes","changesources","masters","sourcestamps","schedulers","forceschedulers"]}return t}(),angular.module("bbData").constant("API",t()).constant("ENDPOINTS",n())}.call(this),function(){var t,n=[].slice;t=function(){function t(t,r,e){var o;return o=function(){function o(t,n,r){var o;if(this.endpoint=n,null==r&&(r=[]),!angular.isString(this.endpoint))throw new TypeError("Parameter 'endpoint' must be a string, not "+typeof this.endpoint);this.update(t),this.constructor.generateFunctions(r),o=e.classId(this.endpoint),this.id=this[o],this.subscribe()}return o.prototype.update=function(t){return angular.merge(this,t)},o.prototype.get=function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.get.apply(t,[this.endpoint,this.id].concat(n.call(r)))},o.prototype.subscribe=function(){var t;return t=function(t){return function(n){var r,e,o;return r=n.k,e=n.m,o=RegExp("^"+t.endpoint+"\\/"+t.id+"\\/\\w+$","g"),o.test(r)?t.update(e):void 0}}(this),this.unsubscribeEventListener=r.eventStream.subscribe(t),this.listenerId=t.id},o.prototype.unsubscribe=function(){var t,n;for(t in this)n=this[t],angular.isArray(n)&&n.forEach(function(t){return t instanceof o?t.unsubscribe():void 0});return this.unsubscribeEventListener()},o.generateFunctions=function(t){return t.forEach(function(t){return function(r){var o;return o=e.capitalize(r),t.prototype["load"+o]=function(){var t,e;return t=1<=arguments.length?n.call(arguments,0):[],e=this.get.apply(this,[r].concat(n.call(t))),this[r]=e.getArray(),e}}}(this))},o}()}return t}(),angular.module("bbData").factory("Base",["dataService","socketService","dataUtilsService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["changes","properties","steps"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Build",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["builds","buildrequests","forceschedulers","buildslaves","masters"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Builder",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["builds"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Buildrequest",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["properties"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Buildset",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Buildslave",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Change",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(r)}return t}(),angular.module("bbData").factory("Changesource",["dataService","Base",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Forcescheduler",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["builders","buildslaves","changesources","schedulers"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Master",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Scheduler",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["changes"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Sourcestamp",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){return function(){return t.apply(n,arguments)}},r=[].slice;t=function(){function t(){}return t.prototype.cache=!1,t.prototype.$get=function(t,e,o,u,i,s,c){var a;return new(a=function(){function a(){this.socketCloseListener=n(this.socketCloseListener,this),this.unsubscribeListener=n(this.unsubscribeListener,this),p=this,i.eventStream.onUnsubscribe=this.unsubscribeListener,i.socket.onclose=this.socketCloseListener,this.constructor.generateEndpoints()}var p;return p=null,a.prototype.get=function(){var n,c,a,p,l,f;return n=1<=arguments.length?r.call(arguments,0):[],n=n.filter(function(t){return null!=t}),c=n[n.length-1],l=c.subscribe||null==c.subscribe,angular.isObject(c)&&(p=n.pop(),delete p.subscribe),f=[],a=o(function(r){return function(c,a){var h,d,v,y;return l?(h=[],y=i.eventStream.subscribe(function(t){return h.push(t)}),d=s.socketPath(n),v=r.startConsuming(d)):v=o.resolve(),v.then(function(){var o,v;return o=s.restPath(n),v=u.get(o,p),v.then(function(u){var p,v,g,b,_,m;m=s.type(o),u=u[m];try{g=s.className(o),p=e.get(g)}catch(S){b=S,p=e.get("Base")}return angular.isArray(u)?(_=s.endpointPath(n),u=u.map(function(t){return new p(t,_)}),null==r.listeners&&(r.listeners={}),null==(v=r.listeners)[d]&&(v[d]=[]),u.forEach(function(t){return r.listeners[d].push(t.listenerId)}),i.eventStream.subscribe(function(t){var n,e,o,u;return n=t.k,e=t.m,u=RegExp("^"+_+"\\/(\\w+|\\d+)\\/new$","g"),u.test(n)?(o=new p(e,_),f.push(o),r.listeners[d].push(o.listenerId)):void 0}),l&&(h.forEach(function(t){return i.eventStream.push(t)}),y()),angular.copy(u,f),c(f)):(b=u+" is not an array",t.error(b),a(b))},function(t){return a(t)})},function(t){return a(t)})}}(this)),a.getArray=function(){return f},a},a.prototype.startConsuming=function(t){return i.send({cmd:"startConsuming",path:t})},a.prototype.stopConsuming=function(t){return i.send({cmd:"stopConsuming",path:t})},a.prototype.unsubscribeListener=function(t){var n,r,e,o,u;o=this.listeners,u=[];for(e in o)r=o[e],n=r.indexOf(t.id),n>-1?(r.splice(n,1),u.push(0===r.length?this.stopConsuming(e):void 0)):u.push(void 0);return u},a.prototype.socketCloseListener=function(){var t,n,r;if(null!=this.listeners){r=this.listeners;for(n in r)t=r[n],t.length>0&&this.startConsuming(n);return null}},a.prototype.control=function(t,n){return u.post({id:this.getNextId(),jsonrpc:"2.0",method:t,params:n})},a.prototype.getSpecification=function(){return u.get("application.spec")},a.prototype.getNextId=function(){return null==this.jsonrpc&&(this.jsonrpc=1),this.jsonrpc++},a.generateEndpoints=function(){return c.forEach(function(t){return function(n){var e;return e=s.capitalize(n),t.prototype["get"+e]=function(){var t;return t=1<=arguments.length?r.call(arguments,0):[],p.get.apply(p,[n].concat(r.call(t)))}}}(this))},a.prototype.open=function(){var t;return new(t=function(){function t(){this.rootClasses=n,this.constructor.generateEndpoints()}var n;return n=[],t.prototype.close=function(){return this.rootClasses.forEach(function(t){return t.unsubscribe()})},t.prototype.closeOnDestroy=function(t){if(!angular.isFunction(t.$on))throw new TypeError("Parameter 'scope' doesn't have an $on function");return t.$on("$destroy",function(t){return function(){return t.close()}}(this))},t.generateEndpoints=function(){return c.forEach(function(t){return function(e){var o;return o=s.capitalize(e),t.prototype["get"+o]=function(){var t,e;return t=1<=arguments.length?r.call(arguments,0):[],e=p["get"+o].apply(p,t),e.then(function(t){return t.forEach(function(t){return n.push(t)})}),e}}}(this))},t}())},a}())},t.prototype.$get.$inject=["$log","$injector","$q","restService","socketService","dataUtilsService","ENDPOINTS"],t}(),angular.module("bbData").provider("dataService",[t])}.call(this),function(){var t;t=function(){function t(){}return t.prototype.capitalize=function(t){return t[0].toUpperCase()+t.slice(1).toLowerCase()},t.prototype.type=function(t){var n,r,e;for(e=t.split("/");;)if(n=e.pop(),r=parseInt(n),0===e.length||!angular.isNumber(r)||isNaN(r))break;return n},t.prototype.singularType=function(t){return this.type(t).replace(/s$/,"")},t.prototype.classId=function(t){return this.singularType(t)+"id"},t.prototype.className=function(t){return this.capitalize(this.singularType(t))},t.prototype.socketPath=function(t){var n;return n=["*"],t.length%2===1&&n.push("*"),t.concat(n).join("/")},t.prototype.restPath=function(t){return t.slice().join("/")},t.prototype.endpointPath=function(t){var n;return n=t.slice(),n.length%2===0&&n.pop(),n.join("/")},t}(),angular.module("bbData").service("dataUtilsService",[t])}.call(this),function(){var t,n=[].slice;t=function(){function t(t,r,e){var o;return new(o=function(){function o(){}return o.prototype.execute=function(n){return r(function(r){return function(r,e){return t(n).success(function(t){var n,o;try{return n=angular.fromJson(t),r(n)}catch(u){return o=u,e(o)}}).error(function(t){return e(t)})}}(this))},o.prototype.get=function(t,n){var r;return null==n&&(n={}),r={method:"GET",url:this.parse(e,t),params:n,headers:{Accept:"application/json"}},this.execute(r)},o.prototype.post=function(t,n){var r;return null==n&&(n={}),r={method:"POST",url:this.parse(e,t),data:n,headers:{"Content-Type":"application/json"}},this.execute(r)},o.prototype.parse=function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],t.join("/").replace(/\/\//,"/")},o}())}return t}(),angular.module("bbData").service("restService",["$http","$q","API",t])}.call(this),function(){var t;t=function(){function t(t,n,r,e,o,u){var i;return new(i=function(){function i(){this.queue=[],this.deferred={},this.open()}return i.prototype.eventStream=null,i.prototype.open=function(){return null==this.socket&&(this.socket=u.getWebSocket(this.getUrl())),this.socket.onopen=function(t){return function(){return t.flush()}}(this),this.setupEventStream()},i.prototype.setupEventStream=function(){return null==this.eventStream&&(this.eventStream=new o),this.socket.onmessage=function(n){return function(e){var o,u,i,s,c,a;try{return o=angular.fromJson(e.data),t.debug("WS message",o),null!=o.code?(i=o._id,200===o.code?null!=(s=n.deferred[i])?s.resolve(!0):void 0:null!=(c=n.deferred[i])?c.reject(o):void 0):r.$applyAsync(function(){return n.eventStream.push(o)})}catch(p){return u=p,null!=(a=n.deferred[i])?a.reject(u):void 0}}}(this)},i.prototype.close=function(){return this.socket.close()},i.prototype.send=function(r){var e,o;return o=this.nextId(),r._id=o,null==(e=this.deferred)[o]&&(e[o]=n.defer()),r=angular.toJson(r),this.socket.readyState===(this.socket.OPEN||1)?(t.debug("WS send",angular.fromJson(r)),this.socket.send(r)):this.queue.push(r),this.deferred[o].promise},i.prototype.flush=function(){var n,r;for(r=[];n=this.queue.pop();)t.debug("WS send",angular.fromJson(n)),r.push(this.socket.send(n));return r},i.prototype.nextId=function(){return null==this.id&&(this.id=0),this.id=this.id<1e3?this.id+1:0,this.id},i.prototype.getUrl=function(){var t,n;return t=e.host(),n=80===e.port()?"":":"+e.port(),"ws://"+t+n+"/ws"},i}())}return t}(),angular.module("bbData").service("socketService",["$log","$q","$rootScope","$location","Stream","webSocketService",t])}.call(this),function(){var t;t=function(){function t(t){var n;return new(n=function(){function n(){}return n.prototype.getWebSocket=function(n){var r;if(r=/wss?:\/\//.exec(n),!r)throw new Error("Invalid url provided");return null!=t.ReconnectingWebSocket?new t.ReconnectingWebSocket(n):new t.WebSocket(n)},n}())}return t}(),angular.module("bbData").service("webSocketService",["$window",t])}.call(this),function(){var t;t=function(){function t(){var t;return t=function(){function t(){}return t.prototype.onUnsubscribe=null,t.prototype.listeners=[],t.prototype.subscribe=function(t){if(!angular.isFunction(t))throw new TypeError("Parameter 'listener' must be a function, not "+typeof t);return t.id=this.generateId(),this.listeners.push(t),function(n){return function(){var r,e;return r=n.listeners.indexOf(t),e=n.listeners.splice(r,1),angular.isFunction(n.onUnsubscribe)?n.onUnsubscribe(t):void 0}}(this)},t.prototype.push=function(t){var n,r,e,o,u;for(o=this.listeners,u=[],n=0,r=o.length;r>n;n++)e=o[n],u.push(e(t));return u},t.prototype.destroy=function(){var t;for(t=[];this.listeners.length>0;)t.push(this.listeners.pop());return t},t.prototype.generateId=function(){return null==this.lastId&&(this.lastId=0),this.lastId++},t}()}return t}(),angular.module("bbData").factory("Stream",[t])}.call(this); | ||
(function(){var t;t=function(){function t(){return[]}return t}(),angular.module("bbData",new t)}).call(this),function(){var t;t=function(){function t(t){t.interceptors.push(["$log","API",function(t,n){return{request:function(r){return 0===r.url.indexOf(n)&&t.debug(r.method+" "+r.url),r}}}])}return t}(),angular.module("bbData").config(["$httpProvider",t])}.call(this),function(){var t,n;t=function(){function t(){return"api/v2/"}return t}(),n=function(){function t(){return["builders","builds","buildrequests","buildslaves","buildsets","changes","changesources","masters","sourcestamps","schedulers","forceschedulers"]}return t}(),angular.module("bbData").constant("API",t()).constant("ENDPOINTS",n())}.call(this),function(){var t,n=[].slice;t=function(){function t(t,r,e){var o;return o=function(){function o(t,n,r){var o;if(this.endpoint=n,null==r&&(r=[]),!angular.isString(this.endpoint))throw new TypeError("Parameter 'endpoint' must be a string, not "+typeof this.endpoint);this.update(t),this.constructor.generateFunctions(r),o=e.classId(this.endpoint),this.id=this[o],this.subscribe()}return o.prototype.update=function(t){return angular.merge(this,t)},o.prototype.get=function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.get.apply(t,[this.endpoint,this.id].concat(n.call(r)))},o.prototype.subscribe=function(){var t;return t=function(t){return function(n){var r,e,o;return r=n.k,e=n.m,o=RegExp("^"+t.endpoint+"\\/"+t.id+"\\/\\w+$","g"),o.test(r)?t.update(e):void 0}}(this),this.unsubscribeEventListener=r.eventStream.subscribe(t),this.listenerId=t.id},o.prototype.unsubscribe=function(){var t,n;for(t in this)n=this[t],angular.isArray(n)&&n.forEach(function(t){return t instanceof o?t.unsubscribe():void 0});return this.unsubscribeEventListener()},o.generateFunctions=function(t){return t.forEach(function(t){return function(r){var o;return o=e.capitalize(r),t.prototype["load"+o]=function(){var t,e;return t=1<=arguments.length?n.call(arguments,0):[],e=this.get.apply(this,[r].concat(n.call(t))),this[r]=e.getArray(),e}}}(this))},o}()}return t}(),angular.module("bbData").factory("Base",["dataService","socketService","dataUtilsService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["changes","properties","steps"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Build",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["builds","buildrequests","forceschedulers","buildslaves","masters"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Builder",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["builds"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Buildrequest",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["properties"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Buildset",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Buildslave",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Change",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(r)}return t}(),angular.module("bbData").factory("Changesource",["dataService","Base",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Forcescheduler",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["builders","buildslaves","changesources","schedulers"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Master",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){r.__super__.constructor.call(this,t,n)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Scheduler",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){function e(){this.constructor=t}for(var o in n)r.call(n,o)&&(t[o]=n[o]);return e.prototype=n.prototype,t.prototype=new e,t.__super__=n.prototype,t},r={}.hasOwnProperty;t=function(){function t(t,r){var e;return e=function(t){function r(t,n){var e;e=["changes"],r.__super__.constructor.call(this,t,n,e)}return n(r,t),r}(t)}return t}(),angular.module("bbData").factory("Sourcestamp",["Base","dataService",t])}.call(this),function(){var t,n=function(t,n){return function(){return t.apply(n,arguments)}},r=[].slice;t=function(){function t(){}return t.prototype.cache=!1,t.prototype.$get=function(t,e,o,u,i,s,c){var a;return new(a=function(){function a(){this.socketCloseListener=n(this.socketCloseListener,this),this.unsubscribeListener=n(this.unsubscribeListener,this),p=this,i.eventStream.onUnsubscribe=this.unsubscribeListener,i.socket.onclose=this.socketCloseListener,this.constructor.generateEndpoints()}var p;return p=null,a.prototype.get=function(){var n,c,a,p,l,f;return n=1<=arguments.length?r.call(arguments,0):[],n=n.filter(function(t){return null!=t}),c=n[n.length-1],l=c.subscribe||null==c.subscribe,angular.isObject(c)&&(p=n.pop(),delete p.subscribe),f=[],a=o(function(r){return function(c,a){var h,d,v,y;return l?(h=[],y=i.eventStream.subscribe(function(t){return h.push(t)}),d=s.socketPath(n),v=r.startConsuming(d)):v=o.resolve(),v.then(function(){var o,v;return o=s.restPath(n),v=u.get(o,p),v.then(function(u){var p,v,g,b,_,m;m=s.type(o),u=u[m];try{g=s.className(o),p=e.get(g)}catch(S){b=S,p=e.get("Base")}return angular.isArray(u)?(_=s.endpointPath(n),u=u.map(function(t){return new p(t,_)}),null==r.listeners&&(r.listeners={}),null==(v=r.listeners)[d]&&(v[d]=[]),u.forEach(function(t){return r.listeners[d].push(t.listenerId)}),i.eventStream.subscribe(function(t){var n,e,o,u;return n=t.k,e=t.m,u=RegExp("^"+_+"\\/(\\w+|\\d+)\\/new$","g"),u.test(n)?(o=new p(e,_),f.push(o),r.listeners[d].push(o.listenerId)):void 0}),l&&(h.forEach(function(t){return i.eventStream.push(t)}),y()),angular.copy(u,f),c(f)):(b=u+" is not an array",t.error(b),a(b))},function(t){return a(t)})},function(t){return a(t)})}}(this)),a.getArray=function(){return f},a},a.prototype.startConsuming=function(t){return i.send({cmd:"startConsuming",path:t})},a.prototype.stopConsuming=function(t){return i.send({cmd:"stopConsuming",path:t})},a.prototype.unsubscribeListener=function(t){var n,r,e,o,u;o=this.listeners,u=[];for(e in o)r=o[e],n=r.indexOf(t.id),n>-1?(r.splice(n,1),u.push(0===r.length?this.stopConsuming(e):void 0)):u.push(void 0);return u},a.prototype.socketCloseListener=function(){var t,n,r;if(null!=this.listeners){r=this.listeners;for(n in r)t=r[n],t.length>0&&this.startConsuming(n);return null}},a.prototype.control=function(t,n){return u.post("",{id:this.getNextId(),jsonrpc:"2.0",method:t,params:n})},a.prototype.getSpecification=function(){return u.get("application.spec")},a.prototype.getNextId=function(){return null==this.jsonrpc&&(this.jsonrpc=1),this.jsonrpc++},a.generateEndpoints=function(){return c.forEach(function(t){return function(n){var e;return e=s.capitalize(n),t.prototype["get"+e]=function(){var t;return t=1<=arguments.length?r.call(arguments,0):[],p.get.apply(p,[n].concat(r.call(t)))}}}(this))},a.prototype.open=function(){var t;return new(t=function(){function t(){this.rootClasses=n,this.constructor.generateEndpoints()}var n;return n=[],t.prototype.close=function(){return this.rootClasses.forEach(function(t){return t.unsubscribe()})},t.prototype.closeOnDestroy=function(t){if(!angular.isFunction(t.$on))throw new TypeError("Parameter 'scope' doesn't have an $on function");return t.$on("$destroy",function(t){return function(){return t.close()}}(this))},t.generateEndpoints=function(){return c.forEach(function(t){return function(e){var o;return o=s.capitalize(e),t.prototype["get"+o]=function(){var t,e;return t=1<=arguments.length?r.call(arguments,0):[],e=p["get"+o].apply(p,t),e.then(function(t){return t.forEach(function(t){return n.push(t)})}),e}}}(this))},t}())},a}())},t.prototype.$get.$inject=["$log","$injector","$q","restService","socketService","dataUtilsService","ENDPOINTS"],t}(),angular.module("bbData").provider("dataService",[t])}.call(this),function(){var t;t=function(){function t(){}return t.prototype.capitalize=function(t){return t[0].toUpperCase()+t.slice(1).toLowerCase()},t.prototype.type=function(t){var n,r,e;for(e=t.split("/");;)if(n=e.pop(),r=parseInt(n),0===e.length||!angular.isNumber(r)||isNaN(r))break;return n},t.prototype.singularType=function(t){return this.type(t).replace(/s$/,"")},t.prototype.classId=function(t){return this.singularType(t)+"id"},t.prototype.className=function(t){return this.capitalize(this.singularType(t))},t.prototype.socketPath=function(t){var n;return n=["*"],t.length%2===1&&n.push("*"),t.concat(n).join("/")},t.prototype.restPath=function(t){return t.slice().join("/")},t.prototype.endpointPath=function(t){var n;return n=t.slice(),n.length%2===0&&n.pop(),n.join("/")},t}(),angular.module("bbData").service("dataUtilsService",[t])}.call(this),function(){var t,n=[].slice;t=function(){function t(t,r,e){var o;return new(o=function(){function o(){}return o.prototype.execute=function(n){return r(function(r){return function(r,e){return t(n).success(function(t){var n,o;try{return n=angular.fromJson(t),r(n)}catch(u){return o=u,e(o)}}).error(function(t){return e(t)})}}(this))},o.prototype.get=function(t,n){var r;return null==n&&(n={}),r={method:"GET",url:this.parse(e,t),params:n,headers:{Accept:"application/json"}},this.execute(r)},o.prototype.post=function(t,n){var r;return null==n&&(n={}),r={method:"POST",url:this.parse(e,t),data:n,headers:{"Content-Type":"application/json"}},this.execute(r)},o.prototype.parse=function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],t.join("/").replace(/\/\//,"/")},o}())}return t}(),angular.module("bbData").service("restService",["$http","$q","API",t])}.call(this),function(){var t;t=function(){function t(t,n,r,e,o,u){var i;return new(i=function(){function i(){this.queue=[],this.deferred={},this.open()}return i.prototype.eventStream=null,i.prototype.open=function(){return null==this.socket&&(this.socket=u.getWebSocket(this.getUrl())),this.socket.onopen=function(t){return function(){return t.flush()}}(this),this.setupEventStream()},i.prototype.setupEventStream=function(){return null==this.eventStream&&(this.eventStream=new o),this.socket.onmessage=function(n){return function(e){var o,u,i,s,c,a;try{return o=angular.fromJson(e.data),t.debug("WS message",o),null!=o.code?(i=o._id,200===o.code?null!=(s=n.deferred[i])?s.resolve(!0):void 0:null!=(c=n.deferred[i])?c.reject(o):void 0):r.$applyAsync(function(){return n.eventStream.push(o)})}catch(p){return u=p,null!=(a=n.deferred[i])?a.reject(u):void 0}}}(this)},i.prototype.close=function(){return this.socket.close()},i.prototype.send=function(r){var e,o;return o=this.nextId(),r._id=o,null==(e=this.deferred)[o]&&(e[o]=n.defer()),r=angular.toJson(r),this.socket.readyState===(this.socket.OPEN||1)?(t.debug("WS send",angular.fromJson(r)),this.socket.send(r)):this.queue.push(r),this.deferred[o].promise},i.prototype.flush=function(){var n,r;for(r=[];n=this.queue.pop();)t.debug("WS send",angular.fromJson(n)),r.push(this.socket.send(n));return r},i.prototype.nextId=function(){return null==this.id&&(this.id=0),this.id=this.id<1e3?this.id+1:0,this.id},i.prototype.getUrl=function(){var t,n;return t=e.host(),n=80===e.port()?"":":"+e.port(),"ws://"+t+n+"/ws"},i}())}return t}(),angular.module("bbData").service("socketService",["$log","$q","$rootScope","$location","Stream","webSocketService",t])}.call(this),function(){var t;t=function(){function t(t){var n;return new(n=function(){function n(){}return n.prototype.getWebSocket=function(n){var r;if(r=/wss?:\/\//.exec(n),!r)throw new Error("Invalid url provided");return null!=t.ReconnectingWebSocket?new t.ReconnectingWebSocket(n):new t.WebSocket(n)},n}())}return t}(),angular.module("bbData").service("webSocketService",["$window",t])}.call(this),function(){var t;t=function(){function t(){var t;return t=function(){function t(){}return t.prototype.onUnsubscribe=null,t.prototype.listeners=[],t.prototype.subscribe=function(t){if(!angular.isFunction(t))throw new TypeError("Parameter 'listener' must be a function, not "+typeof t);return t.id=this.generateId(),this.listeners.push(t),function(n){return function(){var r,e;return r=n.listeners.indexOf(t),e=n.listeners.splice(r,1),angular.isFunction(n.onUnsubscribe)?n.onUnsubscribe(t):void 0}}(this)},t.prototype.push=function(t){var n,r,e,o,u;for(o=this.listeners,u=[],n=0,r=o.length;r>n;n++)e=o[n],u.push(e(t));return u},t.prototype.destroy=function(){var t;for(t=[];this.listeners.length>0;)t.push(this.listeners.pop());return t},t.prototype.generateId=function(){return null==this.lastId&&(this.lastId=0),this.lastId++},t}()}return t}(),angular.module("bbData").factory("Stream",[t])}.call(this); |
{ | ||
"name": "buildbot-data", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Buildbot AngularJS data module", | ||
@@ -5,0 +5,0 @@ "readme": "README.md", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99301
922