New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

f3js-cli

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

f3js-cli - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/projects.js

2

lib/connector/api/modules.js

@@ -1,1 +0,1 @@

"use strict";function create(a,b){utils.ajax("http://"+f3domain+"/modules"+utils.querify(a),function(a,c){switch(c){case 200:return console.log("registration succeeded:",a),void(b&&b(null,new base.Module(a)));case 400:console.log("invalid data:",a);break;case 403:console.log("access denied");break;default:console.log("server error:",a)}b&&b("undefined"==typeof a?{}:a,null)},"json","post")}function createPath(a,b,c){return"/"+a+(b?"/"+b:"")+(c?"/"+c:"/latest")}function findDescendant(a,b){utils.ajax("http://"+f3domain+"/modules/"+a+utils.querify({find:"descendant",format:"json"}),function(a,c){b(404===c||null===a?null:new base.Module(a))},"json")}function readByName(a,b,c){utils.ajax("http://"+f3domain+"/modules/"+a+(b?"/"+b:"")+utils.querify({format:"json"}),function(a,b){c(404===b||null===a?null:new base.Module(a))},"json")}function list(a,b){var c=_.extend({format:"json",withoutOriginalAuthors:!0},b);utils.ajax("http://"+f3domain+"/modules"+utils.querify(c),function(b){if(!b)return a(null,{});var c=b.list;delete b.list,a(_.map(c,function(a){return new base.Module(a)}),b)},"json")}function count(a,b){var c=_.extend({format:"json",count:"true"},b);utils.ajax("http://"+f3domain+"/modules"+utils.querify(c),function(b){return b?void a(b.count):a(0)},"json")}function listAuthors(a,b){utils.ajax("http://"+f3domain+"/users/for/modules/"+a,function(a,c){return 404!==c&&a?void(b&&b(_.map(a,function(a){return new base.User(a)}))):void(b&&b(null))},"json")}function listReferenceUrls(a,b){utils.ajax("http://"+f3domain+"/urls/for/modules/"+a,function(a,c){return 404!==c&&a?void(b&&b(_.map(a,function(a){return new base.ModuleUrl(a)}))):void(b&&b(null))},"json")}function addReferenceUrls(a,b,c,d){utils.ajax("http://"+f3domain+"/urls/for/modules/"+a+utils.querify({_csrf:c,urls:JSON.stringify(b)}),function(a,b){return 404!==b&&a?void(d&&d(_.map(a,function(a){return new base.ModuleUrl(a)}))):void(d&&d(null))},"json","post")}function deleteUrl(a,b,c){utils.ajax("http://"+f3domain+"/urls/delete"+utils.querify({_csrf:b,urlId:a}),function(a,b){c&&c(404===b||200===b&&a)},"json","post")}function listForProject(a,b){utils.ajax("http://"+f3domain+"/modules/for/"+a,function(a,c){return 404===c||null===a?b(null):void b(_.map(a,function(a){return new base.Module(a)}))},"json")}var _=require("underscore"),base=require("../models/base"),utils=require("../utils"),f3domain=base.getServerDomainName();exports.create=create,exports.findDescendant=findDescendant,exports.readByName=readByName,exports.list=list,exports.count=count,exports.listAuthors=listAuthors,exports.listReferenceUrls=listReferenceUrls,exports.addReferenceUrls=addReferenceUrls,exports.deleteUrl=deleteUrl,exports.listForProject=listForProject;/*! f3js-cli - v0.0.2 - 2016-06-23 */
"use strict";function create(a,b){utils.ajax("http://"+base.getServerDomainName()+"/modules"+utils.querify(a),function(a,c){switch(c){case 200:return console.log("registration succeeded:",a),void(b&&b(null,new base.Module(a)));case 400:console.log("invalid data:",a);break;case 403:console.log("access denied");break;default:console.log("server error:",a)}b&&b("undefined"==typeof a?{}:a,null)},"json","post")}function createPath(a,b,c){return"/"+a+(b?"/"+b:"")+(c?"/"+c:"/latest")}function findDescendant(a,b){utils.ajax("http://"+base.getServerDomainName()+"/modules/"+a+utils.querify({find:"descendant",format:"json"}),function(a,c){b(404===c||null===a?null:new base.Module(a))},"json")}function readByName(a,b,c){utils.ajax("http://"+base.getServerDomainName()+"/modules/"+a+(b?"/"+b:"")+utils.querify({format:"json"}),function(a,b){c(404===b||null===a?null:new base.Module(a))},"json")}function list(a,b){var c=_.extend({format:"json",withoutOriginalAuthors:!0},b);utils.ajax("http://"+base.getServerDomainName()+"/modules"+utils.querify(c),function(b){if(!b)return a(null,{});var c=b.list;delete b.list,a(_.map(c,function(a){return new base.Module(a)}),b)},"json")}function count(a,b){var c=_.extend({format:"json",count:"true"},b);utils.ajax("http://"+base.getServerDomainName()+"/modules"+utils.querify(c),function(b){return b?void a(b.count):a(0)},"json")}function listAuthors(a,b){utils.ajax("http://"+base.getServerDomainName()+"/users/for/modules/"+a,function(a,c){return 404!==c&&a?void(b&&b(_.map(a,function(a){return new base.User(a)}))):void(b&&b(null))},"json")}function listReferenceUrls(a,b){utils.ajax("http://"+base.getServerDomainName()+"/urls/for/modules/"+a,function(a,c){return 404!==c&&a?void(b&&b(_.map(a,function(a){return new base.ModuleUrl(a)}))):void(b&&b(null))},"json")}function addReferenceUrls(a,b,c,d){utils.ajax("http://"+base.getServerDomainName()+"/urls/for/modules/"+a+utils.querify({_csrf:c,urls:JSON.stringify(b)}),function(a,b){return 404!==b&&a?void(d&&d(_.map(a,function(a){return new base.ModuleUrl(a)}))):void(d&&d(null))},"json","post")}function deleteUrl(a,b,c){utils.ajax("http://"+base.getServerDomainName()+"/urls/delete"+utils.querify({_csrf:b,urlId:a}),function(a,b){c&&c(404===b||200===b&&a)},"json","post")}function listForProject(a,b){utils.ajax("http://"+base.getServerDomainName()+"/modules/for/"+a,function(a,c){return 404===c||null===a?b(null):void b(_.map(a,function(a){return new base.Module(a)}))},"json")}var _=require("underscore"),base=require("../models/base"),utils=require("../utils");exports.create=create,exports.findDescendant=findDescendant,exports.readByName=readByName,exports.list=list,exports.count=count,exports.listAuthors=listAuthors,exports.listReferenceUrls=listReferenceUrls,exports.addReferenceUrls=addReferenceUrls,exports.deleteUrl=deleteUrl,exports.listForProject=listForProject;/*! f3js-cli - v0.0.3 - 2016-06-23 */

@@ -1,1 +0,1 @@

"use strict";function create(a,b){utils.ajax("http://"+f3domain+"/projects"+utils.querify(a),function(a,c){switch(c){case 200:return console.log("registration succeeded:",a),void(b&&b(null,new base.Project(a)));case 400:console.log("invalid data:",a);break;case 403:console.log("access denied");break;default:console.log("server error:",a)}b&&b("undefined"==typeof a?{}:a,null)},"json","post")}function findDescendant(a,b){utils.ajax("http://"+f3domain+"/projects/"+a+utils.querify({find:"descendant",format:"json"}),function(a,c){b(404===c||null===a?null:new base.Project(a))},"json")}function read(a,b){return null!==projectCache&&projectCache.id===a?(b&&setTimeout(function(){b(projectCache)},1),!0):void utils.ajax("http://"+f3domain+"/projects/"+a+utils.querify({format:"json"}),function(a,c){var d=null===a||200!==c?null:new base.Project(a);null!==d&&(projectCache=d),b&&b(d)},"json")}function list(a,b){var c=_.extend({format:"json",withoutOriginalAuthors:!0},b);utils.ajax("http://"+f3domain+"/projects"+utils.querify(c),function(b){if(!b)return a(null,{});var c=b.list;delete b.list,a(_.map(c,function(a){return new base.Project(a)}),b)},"json")}function listVariants(a,b){var c=_.extend({format:"json",withoutAuthors:!0,withoutOriginalAuthors:!0},b);utils.ajax("http://"+f3domain+"/variants"+utils.querify(c),function(b){if(!b)return a(null,{});var c=b.list;delete b.list,a(_.map(c,function(a){return new base.Variant(a)}),b)},"json")}function listAuthors(a,b){utils.ajax("http://"+f3domain+"/users/for/projects/"+a,function(a,c){return 404!==c&&a?void(b&&b(_.map(a,function(a){return new base.User(a)}))):void(b&&b(null))},"json")}function createVariant(a,b){utils.ajax("http://"+base.getServerDomainName()+"/variants"+utils.querify(a),function(a,c){if(200!==c||!a)return void(b&&b(null));var d=new base.Variant(a);download(d),b&&b(d)},"json","post")}function download(a,b){void 0===b&&(b="");var c=document.createElement("a"),d=a.contentType===base.Variant.PROGRAM_NODEJS;c.setAttribute("href",a.getDownloadLinkUrl()),c.setAttribute("download","f3js-"+(d?"nodejs-":"layout-")+a.id+(d?"zip"===b?".zip":".tar.gz":".pdf")),c.style.display="none",document.body.appendChild(c),c.click(),setTimeout(function(){document.body.removeChild(c)},1e3)}var _=require("underscore"),base=require("../models/base"),utils=require("../utils"),f3domain=base.getServerDomainName(),projectCache=null;exports.create=create,exports.findDescendant=findDescendant,exports.read=read,exports.list=list,exports.listVariants=listVariants,exports.listAuthors=listAuthors,exports.createVariant=createVariant,exports.download=download;/*! f3js-cli - v0.0.2 - 2016-06-23 */
"use strict";function create(a,b){utils.ajax("http://"+base.getServerDomainName()+"/projects"+utils.querify(a),function(a,c){switch(c){case 200:return console.log("registration succeeded:",a),void(b&&b(null,new base.Project(a)));case 400:console.log("invalid data:",a);break;case 403:console.log("access denied");break;default:console.log("server error:",a)}b&&b("undefined"==typeof a?{}:a,null)},"json","post")}function findDescendant(a,b){utils.ajax("http://"+base.getServerDomainName()+"/projects/"+a+utils.querify({find:"descendant",format:"json"}),function(a,c){b(404===c||null===a?null:new base.Project(a))},"json")}function read(a,b){return null!==projectCache&&projectCache.id===a?(b&&setTimeout(function(){b(projectCache)},1),!0):void utils.ajax("http://"+base.getServerDomainName()+"/projects/"+a+utils.querify({format:"json"}),function(a,c){var d=null===a||200!==c?null:new base.Project(a);null!==d&&(projectCache=d),b&&b(d)},"json")}function list(a,b){var c=_.extend({format:"json",withoutOriginalAuthors:!0},b);utils.ajax("http://"+base.getServerDomainName()+"/projects"+utils.querify(c),function(b){if(!b)return a(null,{});var c=b.list;delete b.list,a(_.map(c,function(a){return new base.Project(a)}),b)},"json")}function listVariants(a,b){var c=_.extend({format:"json",withoutAuthors:!0,withoutOriginalAuthors:!0},b);utils.ajax("http://"+base.getServerDomainName()+"/variants"+utils.querify(c),function(b){if(!b)return a(null,{});var c=b.list;delete b.list,a(_.map(c,function(a){return new base.Variant(a)}),b)},"json")}function listAuthors(a,b){utils.ajax("http://"+base.getServerDomainName()+"/users/for/projects/"+a,function(a,c){return 404!==c&&a?void(b&&b(_.map(a,function(a){return new base.User(a)}))):void(b&&b(null))},"json")}function createVariant(a,b){utils.ajax("http://"+base.getServerDomainName()+"/variants"+utils.querify(a),function(a,c){if(200!==c||!a)return void(b&&b(null));var d=new base.Variant(a);"undefined"!=typeof document&&download(d),b&&b(d)},"json","post")}function download(a,b){void 0===b&&(b="");var c=document.createElement("a"),d=a.contentType===base.Variant.PROGRAM_NODEJS;c.setAttribute("href",a.getDownloadLinkUrl()),c.setAttribute("download","f3js-"+(d?"nodejs-":"layout-")+a.id+(d?"zip"===b?".zip":".tar.gz":".pdf")),c.style.display="none",document.body.appendChild(c),c.click(),setTimeout(function(){document.body.removeChild(c)},1e3)}var _=require("underscore"),base=require("../models/base"),utils=require("../utils"),projectCache=null;exports.create=create,exports.findDescendant=findDescendant,exports.read=read,exports.list=list,exports.listVariants=listVariants,exports.listAuthors=listAuthors,exports.createVariant=createVariant,exports.download=download;/*! f3js-cli - v0.0.3 - 2016-06-23 */

@@ -1,1 +0,1 @@

"use strict";function read(a){utils.ajax("http://"+f3domain+"/profile"+utils.querify({format:"json"}),function(b,c){return 404!==c&&b?void a(new base.User(b)):a(null)},"json")}function listTokens(a){utils.ajax("http://"+f3domain+"/profile/tokens",function(b,c){return 404!==c&&b?void a(_.map(b,function(a){return{createdDate:new Date(a.createdDate),token:a.token}})):a([])},"json")}function createToken(a,b){utils.ajax("http://"+f3domain+"/profile/tokens/create"+utils.querify({_csrf:a}),function(a,c){return 200===c&&a?void(b&&b(a.token)):void(b&&b(null))},"json","post")}function deleteToken(a,b,c){utils.ajax("http://"+f3domain+"/profile/tokens/delete"+utils.querify({_csrf:b,token:a}),function(a,b){c&&c(200===b&&a)},"json","post")}var _=require("underscore"),base=require("../models/base"),utils=require("../utils"),f3domain=base.getServerDomainName();exports.read=read,exports.listTokens=listTokens,exports.createToken=createToken,exports.deleteToken=deleteToken;/*! f3js-cli - v0.0.2 - 2016-06-23 */
"use strict";function read(a){utils.ajax("http://"+base.getServerDomainName()+"/profile"+utils.querify({format:"json"}),function(b,c){return 404!==c&&b?void a(new base.User(b)):a(null)},"json")}function listTokens(a){utils.ajax("http://"+base.getServerDomainName()+"/profile/tokens",function(b,c){return 404!==c&&b?void a(_.map(b,function(a){return{createdDate:new Date(a.createdDate),token:a.token}})):a([])},"json")}function createToken(a,b){utils.ajax("http://"+base.getServerDomainName()+"/profile/tokens/create"+utils.querify({_csrf:a}),function(a,c){return 200===c&&a?void(b&&b(a.token)):void(b&&b(null))},"json","post")}function deleteToken(a,b,c){utils.ajax("http://"+base.getServerDomainName()+"/profile/tokens/delete"+utils.querify({_csrf:b,token:a}),function(a,b){c&&c(200===b&&a)},"json","post")}var _=require("underscore"),base=require("../models/base"),utils=require("../utils");exports.read=read,exports.listTokens=listTokens,exports.createToken=createToken,exports.deleteToken=deleteToken;/*! f3js-cli - v0.0.3 - 2016-06-23 */

@@ -1,1 +0,1 @@

"use strict";function setServerDomainName(a){f3domain=a}function getServerDomainName(){return f3domain}function getDateString(a){return modelUtils.getDateString(a)}function hash(a){var b,c,d,e=0;if(0===a.length)return e;for(b=0,d=a.length;b<d;b++)c=a.charCodeAt(b),e=(e<<5)-e+c,e|=0;return e}var __extends=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},_=require("underscore"),modelUtils=require("./modelUtils"),f3domain="undefined"!=typeof self&&self.f3domain||"undefined"!=typeof global&&global.f3domain||"f3js.org";exports.setServerDomainName=setServerDomainName,exports.getServerDomainName=getServerDomainName;var DbEntry=function(){function a(a,b){if(void 0===b&&(b=!1),this.id=-1,this.name=null,this.log=null,this.sourceId=-1,this.sourceOriginId=-1,this.forkOriginId=-1,this.author=null,this.originalAuthor=null,this.createdDate=null,this.accessCount=-1,this._numbers=["id","sourceId","sourceOriginId","forkOriginId","authorId","originalAuthorId","accessCount"],this._dates=["createdDate"],a){if(b){var c=a;return this.id=a[this.getBasePath()+"_id"]?a[this.getBasePath()+"_id"]:this.id,this.name=a[this.getBasePath()+"_name"]?a[this.getBasePath()+"_name"]:this.name,this.log=a[this.getBasePath()+"_log"]?a[this.getBasePath()+"_log"]:this.log,this.sourceId=c.source_id?c.source_id:this.sourceId,this.sourceOriginId=c.source_origin_id?c.source_origin_id:this.sourceOriginId,this.forkOriginId=c.fork_origin_id?c.fork_origin_id:this.forkOriginId,this.author=c.author_id?new User(a,(!0)):this.author,this.originalAuthor=c.original_author_id?new User(a,(!0),(!0)):this.originalAuthor,this.createdDate=c.created_date?new Date(c.created_date):this.createdDate,void(this.accessCount=c.access_count?c.access_count:this.accessCount)}if(a.author){var d=a.author;d instanceof User?this.author=d:this.author=new User(d)}if(a.originalAuthor){var e=a.originalAuthor;e instanceof User?this.originalAuthor=e:this.originalAuthor=new User(e)}}}return Object.defineProperty(a.prototype,"createdDateString",{get:function(){return this.createdDate?modelUtils.getDateString(this.createdDate):""},enumerable:!0,configurable:!0}),a.prototype.toSqlData=function(){var a={};return this.id>=0&&(a[this.getBasePath()+"_id"]=this.id),a[this.getBasePath()+"_name"]=this.name,"string"==typeof this.log&&(a[this.getBasePath()+"_log"]=this.log),this.sourceId>=0&&(a.source_id=this.sourceId),this.sourceOriginId>=0&&(a.source_origin_id=this.sourceOriginId),this.forkOriginId>=0&&(a.fork_origin_id=this.forkOriginId),null!==this.author&&(a.author_id=this.author.id),a},a.prototype.toJSON=function(){var a=modelUtils.toJSON(this);return this.author&&(a.author=this.author.toJSON()),this.originalAuthor&&(a.originalAuthor=this.originalAuthor.toJSON()),delete a.createdDateString,a},a.prototype.getBasePath=function(){return"undefined"},a.prototype.getBaseUrl=function(){return"http://"+f3domain+"/"+("undefined"===this.getBasePath()?"":this.getBasePath()+"s")},a.prototype.getId=function(){return this.id},a.prototype.getName=function(){return this.name},a.prototype.getLog=function(){return this.log},a.prototype.getRemoveLinkUrl=function(){return this.id<0?"":this.getBaseUrl()+"/delete?id="+this.id},a.prototype.getEditLinkUrl=function(){return this.id<0?"":this.getBaseUrl()+"/edit?id="+this.id},a.prototype.getLinkUrl=function(){return this.getBaseUrl()+(this.id<0?"":"/"+this.id)},a.prototype.getLink=function(a){return a||(a=this.getName()?modelUtils.escapeHtml(this.getName()):"ID: "+this.id),this.createLink(this.getLinkUrl(),a)},a.prototype.getSourceLinkUrl=function(){return this.getBaseUrl()+(this.sourceId<0?"":"/"+this.sourceId)},a.prototype.getSourceLink=function(a){return this.sourceId<0?"-":("undefined"!=typeof a&&a||(a="ID: "+this.sourceId),this.createLink(this.getSourceLinkUrl(),a))},a.prototype.getAuthor=function(){return this.author},a.prototype.getAuthorName=function(){return this.author?this.author.displayName:"Anonymous"},a.prototype.getCreatedDate=function(){return modelUtils.getDateString(this.createdDate)},a.prototype.createLink=function(a,b){return'<a href="'+a+'" class="'+this.getBasePath()+' link">'+b+"</a>"},a}();exports.DbEntry=DbEntry;var DbEntryI18n=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.nameJa=null,this.logJa=null,b&&c){this.nameJa=b[this.getBasePath()+"_name_ja"]?b[this.getBasePath()+"_name_ja"]:this.nameJa,this.logJa=b[this.getBasePath()+"_log_ja"]?b[this.getBasePath()+"_log_ja"]:this.logJa}}return __extends(b,a),b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return b[this.getBasePath()+"_name_ja"]=this.nameJa,"string"==typeof this.logJa&&(b[this.getBasePath()+"_log_ja"]=this.logJa),b},b.prototype.getName=function(a){return void 0===a&&(a=null),"ja"===a?this.nameJa:this.name},b.prototype.getNameIfAny=function(a){return"ja"===a&&this.nameJa?this.nameJa:this.name},b.prototype.getLog=function(a){return void 0===a&&(a=null),"ja"===a?this.logJa:this.log},b.prototype.getLogIfAny=function(a){return void 0===a&&(a=null),"ja"===a&&this.logJa?this.logJa:this.log},b}(DbEntry);exports.DbEntryI18n=DbEntryI18n;var User=function(){function a(a,b,c){if(void 0===b&&(b=!1),void 0===c&&(c=!1),this.id=-1,this.name=null,this.displayName=null,this.photoUrl=null,this.twitterId=-1,this.twitterName=null,this.twitterDisplayName=null,this.twitterPhotoUrl=null,this.githubId=-1,this.githubName=null,this.githubDisplayName=null,this.githubPhotoUrl=null,this.createdDate=null,this.updatedDate=null,this.token=null,this._numbers=["id","twitterId","githubId"],this._dates=["createdDate","updatedDate"],a)return b?void(c&&a.original_author_id?(this.id=a.original_author_id?a.original_author_id:this.id,this.name=a.original_user_name?a.original_user_name:this.name,this.displayName=a.original_display_name?a.original_display_name:this.displayName,this.photoUrl=a.original_photo_url?a.original_photo_url:this.photoUrl,this.createdDate=a.original_user_created_date?new Date(a.original_user_created_date):this.createdDate):(this.id=a.user_id?a.user_id:this.id,this.name=a.name?a.name:this.name,this.displayName=a.display_name?a.display_name:this.displayName,this.photoUrl=a.photo_url?a.photo_url:this.photoUrl,this.twitterId=a.twitter_id?a.twitter_id:this.twitterId,this.twitterName=a.twitter_name?a.twitter_name:this.twitterName,this.twitterDisplayName=a.twitter_display_name?a.twitter_display_name:this.twitterDisplayName,this.twitterPhotoUrl=a.twitter_photo_url?a.twitter_photo_url:this.twitterPhotoUrl,this.githubId=a.github_id?a.github_id:this.githubId,this.githubName=a.github_name?a.github_name:this.githubName,this.githubDisplayName=a.github_display_name?a.github_display_name:this.githubDisplayName,this.githubPhotoUrl=a.github_photo_url?a.github_photo_url:this.githubPhotoUrl,this.createdDate=a.created_date?new Date(a.created_date):this.createdDate,!c&&a.author_id&&(this.id=a.author_id?a.author_id:this.id,this.name=a.user_name?a.user_name:this.name,this.photoUrl=a.user_photo_url?a.user_photo_url:this.photoUrl,this.createdDate=a.user_created_date?new Date(a.user_created_date):this.createdDate))):void modelUtils.deserialize(a,this,this._numbers,this._dates)}return a.prototype.toSqlData=function(){var a={};return this.id>=0&&(a.user_id=this.id),"string"==typeof this.name&&(a.name=this.name),"string"==typeof this.displayName&&(a.display_name=this.displayName),"string"==typeof this.photoUrl&&(a.photo_url=this.photoUrl),this.twitterId<0?a.twitter_id=null:a.twitter_id=this.twitterId,a.twitter_name=this.twitterName,a.twitter_display_name=this.twitterDisplayName,a.twitter_photo_url=this.twitterPhotoUrl,this.githubId<0?a.github_id=null:a.github_id=this.githubId,a.github_name=this.githubName,a.github_display_name=this.githubDisplayName,a.github_photo_url=this.githubPhotoUrl,a},a.prototype.toJSON=function(){return modelUtils.toJSON(this)},a.prototype.getDisplayName=function(){return"string"==typeof this.displayName?this.displayName:"ID: "+this.id},a.prototype.getLinkUrl=function(){return"http://"+f3domain+(this.id<0?"":"/users/"+this.id)},a.prototype.getIconLink=function(a){void 0===a&&(a=!0);var b="string"==typeof a?a:this.getDisplayName();return'<a class="user icon link"><img class="icon" src="'+this.photoUrl+'" '+(a?'/><span class="label label-default name">'+modelUtils.escapeHtml(b)+"</span>":'alt="'+modelUtils.escapeHtml(b)+'" />')+"</a>"},a.prototype.getLink=function(a){return"undefined"==typeof a&&(a=modelUtils.escapeHtml(this.getDisplayName())),'<a href="'+this.getLinkUrl()+'" class="user link">'+a+"</a>"},a.prototype.getCreatedDate=function(){return modelUtils.getDateString(this.createdDate)},a.prototype.getUpdatedDate=function(){return modelUtils.getDateString(this.updatedDate)},a}();exports.User=User;var Project=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.photoUrl=null,this.packageJson=null,this.script=null,this.isUserEdit=!1,this.isPrivate=!1,b){if(c){var d=b;return this.photoUrl=d.photo_url?d.photo_url:this.photoUrl,this.packageJson=d.package_json?JSON.parse(d.package_json):this.packageJson,this.script=d.script?b.script:this.script,this.isUserEdit="number"==typeof d.is_user_edit?!!d.is_user_edit:this.isUserEdit,void(this.isPrivate="number"==typeof d.is_private?!!d.is_private:this.isPrivate)}modelUtils.deserialize(b,this,this._numbers,this._dates)}}return __extends(b,a),b.prototype.getBasePath=function(){return"project"},b.prototype.getForkLinkUrl=function(){return this.id<0?"":this.getBaseUrl()+"/fork?id="+this.id},b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return"string"==typeof this.photoUrl&&(b.photo_url=this.photoUrl),b.package_json=JSON.stringify(this.packageJson),"string"==typeof this.script&&(b.script=this.script),b.is_user_edit=this.isUserEdit?1:0,b.is_private=this.isPrivate?1:0,b},b}(DbEntryI18n);exports.Project=Project;var Code=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.projectId=-1,this.script=null,this._numbers.push("projectId"),b)return c?(this.projectId=b.project_id?b.project_id:this.projectId,void(this.script=b.script?b.script:this.script)):void modelUtils.deserialize(b,this,this._numbers,this._dates)}return __extends(b,a),b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return this.projectId>=0&&(b.project_id=this.projectId),"string"==typeof this.script&&(b.script=this.script),b},b}(DbEntryI18n);exports.Code=Code;var Variant=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.projectId=-1,this.projectSourceId=-1,this.projectName=null,this.projectNameJa=null,this.script=null,this.parametersJson=null,this.contentType=-1,this.archiver="tar.gz",this.isPrivate=!1,this._numbers.push("projectId","projectSourceId","contentType"),b){if(c){var d=b;return this.projectId=d.project_id?d.project_id:this.projectId,this.projectSourceId=d.project_source_id?d.project_source_id:this.projectSourceId,this.projectName=d.project_name?d.project_name:this.projectName,this.projectNameJa=d.project_name_ja?d.project_name_ja:this.projectNameJa,this.script=d.script?b.script:this.script,this.parametersJson=d.parameters_json?JSON.parse(d.parameters_json):this.parametersJson,this.contentType="number"==typeof d.content_type?d.content_type:this.contentType,void(this.isPrivate="number"==typeof d.is_private?!!d.is_private:this.isPrivate)}modelUtils.deserialize(b,this,this._numbers,this._dates),b.parametersJson&&("string"==typeof b.parametersJson?this.parametersJson=JSON.parse(b.parametersJson):this.parametersJson=_.extend({},b.parametersJson))}}return __extends(b,a),b.prototype.getBasePath=function(){return"variant"},b.prototype.getDownloadLinkUrl=function(c){if(void 0===c&&(c=-1),this.id<0)return a.prototype.getLinkUrl.call(this);c<0&&(c=this.contentType);var d=".";return d+=c===b.PROGRAM_NODEJS?"zip"===this.archiver?"zip":"tar.gz":"pdf",a.prototype.getLinkUrl.call(this)+d},b.prototype.toJSON=function(){var b=a.prototype.toJSON.call(this);return"object"==typeof b.parametersJson&&(b.parametersJson=JSON.stringify(b.parametersJson)),b},b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return this.projectId>=0&&(b.project_id=this.projectId),this.projectSourceId>=0&&(b.project_source_id=this.projectSourceId),b.script=this.script,b.parameters_json=this.parametersJson&&"object"==typeof this.parametersJson?JSON.stringify(this.parametersJson):this.parametersJson,this.contentType>=0&&(b.content_type=this.contentType),b.is_private=this.isPrivate?1:0,b},b.PROGRAM_NODEJS=0,b.LAYOUT_LASERCUT=1,b}(DbEntry);exports.Variant=Variant;var Module=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.platforms={},this.photoUrl=null,this.script=null,b){if(c){var d=b;return d.module_platforms&&this.parsePlatforms(d.module_platforms),this.photoUrl=d.photo_url?d.photo_url:this.photoUrl,void(this.script=d.script?b.script:this.script)}modelUtils.deserialize(b,this,this._numbers,this._dates),"string"==typeof b.platforms?this.parsePlatforms(b.platforms):b.platforms&&(this.platforms=b.platforms)}}return __extends(b,a),b.prototype.parsePlatforms=function(a){var b=this;this.platforms={};try{var c=JSON.parse(a);_.each(c,function(a,c){b.platforms[c]=new ModulePlatform(a)})}catch(d){}},b.prototype.stringifyPlatforms=function(){return b.stringifyPlatforms(this.platforms)},b.stringifyPlatforms=function(a){var b={};return _.each(a,function(a,c){return b[c]=ModulePlatform.stringify(a)}),JSON.stringify(b)},b.prototype.contains=function(a,c){return b.contains(this.platforms,a,c)},b.prototype.isCompatibleWith=function(a){return b.checkCompatibility(this.platforms,a.platforms)},b.checkCompatibility=function(a,c){var d=!1;return _.each(c,function(c){return d=d||b.contains(a,c.npmPackage,c.classPath)}),d},b.contains=function(a,b,c){var d=!1;return _.each(a,function(a){return d=d||a.npmPackage===b&&a.classPath===c}),d},b.prototype.getClassPathForPackage=function(a){var b;return _.each(this.platforms,function(c){c.npmPackage===a&&(b=c.classPath)}),b},b.prototype.getBasePath=function(){return"module"},b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return b.module_platforms=this.stringifyPlatforms(),"string"==typeof this.photoUrl&&(b.photo_url=this.photoUrl),"string"==typeof this.script&&(b.script=this.script),b},b}(DbEntryI18n);exports.Module=Module;var ModulePlatform=function(){function a(a){this.npmPackage=null,this.classPath=null;var b=a.indexOf(".");return b<0?void(this.npmPackage=a):(this.npmPackage=a.substring(0,b),void(this.classPath=a.substring(b+1)))}return a.prototype.toString=function(){return a.stringify(this)},a.stringify=function(a){return a.classPath?a.npmPackage+"."+a.classPath:a.npmPackage},a}(),ModuleUrl=function(){function a(a,b){if(void 0===b&&(b=!1),this.id=-1,this.moduleId=-1,this.name=null,this.url=null,this.author=null,this.createdDate=null,this.accessCount=-1,this._numbers=["id","moduleId","accessCount"],this._dates=["createdDate"],a){if(b)return this.id=a.module_url_id?a.module_url_id:this.id,this.name=a.module_url_name?a.module_url_name:this.name,this.moduleId=a.module_id?a.module_id:this.moduleId,this.url=a.url?a.url:this.url,this.author=a.author_id?new User(a,(!0)):this.author,this.createdDate=a.created_date?new Date(a.created_date):this.createdDate,void(this.accessCount=a.access_count?a.access_count:this.accessCount);modelUtils.deserialize(a,this,this._numbers,this._dates),a.author&&(a.author instanceof User?this.author=a.author:this.author=new User(a.author))}}return a.prototype.toSqlData=function(){var a={};return this.id>=0&&(a.module_url_id=this.id),a.module_url_name=this.name,this.moduleId>=0&&(a.module_id=this.moduleId),a.url=this.url,null!==this.author&&(a.author_id=this.author.id),a},a.prototype.getLinkUrl=function(){return"http://"+f3domain+"/urls/for/modules/redirect/"+this.id},a}();exports.ModuleUrl=ModuleUrl;var Request=function(){function a(a){this._numbers=["request_id","delete_id","delete_type"],this._dates=["created_date","updated_date"],modelUtils.deserialize(a,this,this._numbers,this._dates)}return a.prototype.toSqlData=function(){return modelUtils.toJSON(this,["request_id","delete_id","delete_type","name","email","reason","email_body"])},a}();exports.Request=Request,exports.getDateString=getDateString,exports.hash=hash;/*! f3js-cli - v0.0.2 - 2016-06-23 */
"use strict";function setServerDomainName(a){f3domain=a}function getServerDomainName(){return f3domain}function getDateString(a){return modelUtils.getDateString(a)}function hash(a){var b,c,d,e=0;if(0===a.length)return e;for(b=0,d=a.length;b<d;b++)c=a.charCodeAt(b),e=(e<<5)-e+c,e|=0;return e}var __extends=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},_=require("underscore"),modelUtils=require("./modelUtils"),f3domain="undefined"!=typeof self&&self.f3domain||"undefined"!=typeof global&&global.f3domain||"f3js.org";exports.setServerDomainName=setServerDomainName,exports.getServerDomainName=getServerDomainName;var DbEntry=function(){function a(a,b){if(void 0===b&&(b=!1),this.id=-1,this.name=null,this.log=null,this.sourceId=-1,this.sourceOriginId=-1,this.forkOriginId=-1,this.author=null,this.originalAuthor=null,this.createdDate=null,this.accessCount=-1,this._numbers=["id","sourceId","sourceOriginId","forkOriginId","authorId","originalAuthorId","accessCount"],this._dates=["createdDate"],a){if(b){var c=a;return this.id=a[this.getBasePath()+"_id"]?a[this.getBasePath()+"_id"]:this.id,this.name=a[this.getBasePath()+"_name"]?a[this.getBasePath()+"_name"]:this.name,this.log=a[this.getBasePath()+"_log"]?a[this.getBasePath()+"_log"]:this.log,this.sourceId=c.source_id?c.source_id:this.sourceId,this.sourceOriginId=c.source_origin_id?c.source_origin_id:this.sourceOriginId,this.forkOriginId=c.fork_origin_id?c.fork_origin_id:this.forkOriginId,this.author=c.author_id?new User(a,(!0)):this.author,this.originalAuthor=c.original_author_id?new User(a,(!0),(!0)):this.originalAuthor,this.createdDate=c.created_date?new Date(c.created_date):this.createdDate,void(this.accessCount=c.access_count?c.access_count:this.accessCount)}if(a.author){var d=a.author;d instanceof User?this.author=d:this.author=new User(d)}if(a.originalAuthor){var e=a.originalAuthor;e instanceof User?this.originalAuthor=e:this.originalAuthor=new User(e)}}}return Object.defineProperty(a.prototype,"createdDateString",{get:function(){return this.createdDate?modelUtils.getDateString(this.createdDate):""},enumerable:!0,configurable:!0}),a.prototype.toSqlData=function(){var a={};return this.id>=0&&(a[this.getBasePath()+"_id"]=this.id),a[this.getBasePath()+"_name"]=this.name,"string"==typeof this.log&&(a[this.getBasePath()+"_log"]=this.log),this.sourceId>=0&&(a.source_id=this.sourceId),this.sourceOriginId>=0&&(a.source_origin_id=this.sourceOriginId),this.forkOriginId>=0&&(a.fork_origin_id=this.forkOriginId),null!==this.author&&(a.author_id=this.author.id),a},a.prototype.toJSON=function(){var a=modelUtils.toJSON(this);return this.author&&(a.author=this.author.toJSON()),this.originalAuthor&&(a.originalAuthor=this.originalAuthor.toJSON()),delete a.createdDateString,a},a.prototype.getBasePath=function(){return"undefined"},a.prototype.getBaseUrl=function(){return"http://"+f3domain+"/"+("undefined"===this.getBasePath()?"":this.getBasePath()+"s")},a.prototype.getId=function(){return this.id},a.prototype.getName=function(){return this.name},a.prototype.getLog=function(){return this.log},a.prototype.getRemoveLinkUrl=function(){return this.id<0?"":this.getBaseUrl()+"/delete?id="+this.id},a.prototype.getEditLinkUrl=function(){return this.id<0?"":this.getBaseUrl()+"/edit?id="+this.id},a.prototype.getLinkUrl=function(){return this.getBaseUrl()+(this.id<0?"":"/"+this.id)},a.prototype.getLink=function(a){return a||(a=this.getName()?modelUtils.escapeHtml(this.getName()):"ID: "+this.id),this.createLink(this.getLinkUrl(),a)},a.prototype.getSourceLinkUrl=function(){return this.getBaseUrl()+(this.sourceId<0?"":"/"+this.sourceId)},a.prototype.getSourceLink=function(a){return this.sourceId<0?"-":("undefined"!=typeof a&&a||(a="ID: "+this.sourceId),this.createLink(this.getSourceLinkUrl(),a))},a.prototype.getAuthor=function(){return this.author},a.prototype.getAuthorName=function(){return this.author?this.author.displayName:"Anonymous"},a.prototype.getCreatedDate=function(){return modelUtils.getDateString(this.createdDate)},a.prototype.createLink=function(a,b){return'<a href="'+a+'" class="'+this.getBasePath()+' link">'+b+"</a>"},a}();exports.DbEntry=DbEntry;var DbEntryI18n=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.nameJa=null,this.logJa=null,b&&c){this.nameJa=b[this.getBasePath()+"_name_ja"]?b[this.getBasePath()+"_name_ja"]:this.nameJa,this.logJa=b[this.getBasePath()+"_log_ja"]?b[this.getBasePath()+"_log_ja"]:this.logJa}}return __extends(b,a),b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return b[this.getBasePath()+"_name_ja"]=this.nameJa,"string"==typeof this.logJa&&(b[this.getBasePath()+"_log_ja"]=this.logJa),b},b.prototype.getName=function(a){return void 0===a&&(a=null),"ja"===a?this.nameJa:this.name},b.prototype.getNameIfAny=function(a){return"ja"===a&&this.nameJa?this.nameJa:this.name},b.prototype.getLog=function(a){return void 0===a&&(a=null),"ja"===a?this.logJa:this.log},b.prototype.getLogIfAny=function(a){return void 0===a&&(a=null),"ja"===a&&this.logJa?this.logJa:this.log},b}(DbEntry);exports.DbEntryI18n=DbEntryI18n;var User=function(){function a(a,b,c){if(void 0===b&&(b=!1),void 0===c&&(c=!1),this.id=-1,this.name=null,this.displayName=null,this.photoUrl=null,this.twitterId=-1,this.twitterName=null,this.twitterDisplayName=null,this.twitterPhotoUrl=null,this.githubId=-1,this.githubName=null,this.githubDisplayName=null,this.githubPhotoUrl=null,this.createdDate=null,this.updatedDate=null,this.token=null,this._numbers=["id","twitterId","githubId"],this._dates=["createdDate","updatedDate"],a)return b?void(c&&a.original_author_id?(this.id=a.original_author_id?a.original_author_id:this.id,this.name=a.original_user_name?a.original_user_name:this.name,this.displayName=a.original_display_name?a.original_display_name:this.displayName,this.photoUrl=a.original_photo_url?a.original_photo_url:this.photoUrl,this.createdDate=a.original_user_created_date?new Date(a.original_user_created_date):this.createdDate):(this.id=a.user_id?a.user_id:this.id,this.name=a.name?a.name:this.name,this.displayName=a.display_name?a.display_name:this.displayName,this.photoUrl=a.photo_url?a.photo_url:this.photoUrl,this.twitterId=a.twitter_id?a.twitter_id:this.twitterId,this.twitterName=a.twitter_name?a.twitter_name:this.twitterName,this.twitterDisplayName=a.twitter_display_name?a.twitter_display_name:this.twitterDisplayName,this.twitterPhotoUrl=a.twitter_photo_url?a.twitter_photo_url:this.twitterPhotoUrl,this.githubId=a.github_id?a.github_id:this.githubId,this.githubName=a.github_name?a.github_name:this.githubName,this.githubDisplayName=a.github_display_name?a.github_display_name:this.githubDisplayName,this.githubPhotoUrl=a.github_photo_url?a.github_photo_url:this.githubPhotoUrl,this.createdDate=a.created_date?new Date(a.created_date):this.createdDate,!c&&a.author_id&&(this.id=a.author_id?a.author_id:this.id,this.name=a.user_name?a.user_name:this.name,this.photoUrl=a.user_photo_url?a.user_photo_url:this.photoUrl,this.createdDate=a.user_created_date?new Date(a.user_created_date):this.createdDate))):void modelUtils.deserialize(a,this,this._numbers,this._dates)}return a.prototype.toSqlData=function(){var a={};return this.id>=0&&(a.user_id=this.id),"string"==typeof this.name&&(a.name=this.name),"string"==typeof this.displayName&&(a.display_name=this.displayName),"string"==typeof this.photoUrl&&(a.photo_url=this.photoUrl),this.twitterId<0?a.twitter_id=null:a.twitter_id=this.twitterId,a.twitter_name=this.twitterName,a.twitter_display_name=this.twitterDisplayName,a.twitter_photo_url=this.twitterPhotoUrl,this.githubId<0?a.github_id=null:a.github_id=this.githubId,a.github_name=this.githubName,a.github_display_name=this.githubDisplayName,a.github_photo_url=this.githubPhotoUrl,a},a.prototype.toJSON=function(){return modelUtils.toJSON(this)},a.prototype.getDisplayName=function(){return"string"==typeof this.displayName?this.displayName:"ID: "+this.id},a.prototype.getLinkUrl=function(){return"http://"+f3domain+(this.id<0?"":"/users/"+this.id)},a.prototype.getIconLink=function(a){void 0===a&&(a=!0);var b="string"==typeof a?a:this.getDisplayName();return'<a class="user icon link"><img class="icon" src="'+this.photoUrl+'" '+(a?'/><span class="label label-default name">'+modelUtils.escapeHtml(b)+"</span>":'alt="'+modelUtils.escapeHtml(b)+'" />')+"</a>"},a.prototype.getLink=function(a){return"undefined"==typeof a&&(a=modelUtils.escapeHtml(this.getDisplayName())),'<a href="'+this.getLinkUrl()+'" class="user link">'+a+"</a>"},a.prototype.getCreatedDate=function(){return modelUtils.getDateString(this.createdDate)},a.prototype.getUpdatedDate=function(){return modelUtils.getDateString(this.updatedDate)},a}();exports.User=User;var Project=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.photoUrl=null,this.packageJson=null,this.script=null,this.isUserEdit=!1,this.isPrivate=!1,b){if(c){var d=b;return this.photoUrl=d.photo_url?d.photo_url:this.photoUrl,this.packageJson=d.package_json?JSON.parse(d.package_json):this.packageJson,this.script=d.script?b.script:this.script,this.isUserEdit="number"==typeof d.is_user_edit?!!d.is_user_edit:this.isUserEdit,void(this.isPrivate="number"==typeof d.is_private?!!d.is_private:this.isPrivate)}modelUtils.deserialize(b,this,this._numbers,this._dates)}}return __extends(b,a),b.prototype.getBasePath=function(){return"project"},b.prototype.getForkLinkUrl=function(){return this.id<0?"":this.getBaseUrl()+"/fork?id="+this.id},b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return"string"==typeof this.photoUrl&&(b.photo_url=this.photoUrl),b.package_json=JSON.stringify(this.packageJson),"string"==typeof this.script&&(b.script=this.script),b.is_user_edit=this.isUserEdit?1:0,b.is_private=this.isPrivate?1:0,b},b}(DbEntryI18n);exports.Project=Project;var Code=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.projectId=-1,this.script=null,this._numbers.push("projectId"),b)return c?(this.projectId=b.project_id?b.project_id:this.projectId,void(this.script=b.script?b.script:this.script)):void modelUtils.deserialize(b,this,this._numbers,this._dates)}return __extends(b,a),b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return this.projectId>=0&&(b.project_id=this.projectId),"string"==typeof this.script&&(b.script=this.script),b},b}(DbEntryI18n);exports.Code=Code;var Variant=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.projectId=-1,this.projectSourceId=-1,this.projectName=null,this.projectNameJa=null,this.script=null,this.parametersJson=null,this.contentType=-1,this.archiver="tar.gz",this.isPrivate=!1,this._numbers.push("projectId","projectSourceId","contentType"),b){if(c){var d=b;return this.projectId=d.project_id?d.project_id:this.projectId,this.projectSourceId=d.project_source_id?d.project_source_id:this.projectSourceId,this.projectName=d.project_name?d.project_name:this.projectName,this.projectNameJa=d.project_name_ja?d.project_name_ja:this.projectNameJa,this.script=d.script?b.script:this.script,this.parametersJson=d.parameters_json?JSON.parse(d.parameters_json):this.parametersJson,this.contentType="number"==typeof d.content_type?d.content_type:this.contentType,void(this.isPrivate="number"==typeof d.is_private?!!d.is_private:this.isPrivate)}modelUtils.deserialize(b,this,this._numbers,this._dates),b.parametersJson&&("string"==typeof b.parametersJson?this.parametersJson=JSON.parse(b.parametersJson):this.parametersJson=_.extend({},b.parametersJson))}}return __extends(b,a),b.prototype.getBasePath=function(){return"variant"},b.prototype.getDownloadLinkUrl=function(c){if(void 0===c&&(c=-1),this.id<0)return a.prototype.getLinkUrl.call(this);c<0&&(c=this.contentType);var d=".";return d+=c===b.PROGRAM_NODEJS?"zip"===this.archiver?"zip":"tar.gz":"pdf",a.prototype.getLinkUrl.call(this)+d},b.prototype.getFileBaseName=function(a){void 0===a&&(a=-1);var c="f3js-";return a<0&&(a=this.contentType),c+=a===b.PROGRAM_NODEJS?"nodejs-"+this.id:"layout-"+this.id},b.prototype.getFileExtension=function(a){return void 0===a&&(a=-1),a<0&&(a=this.contentType),a===b.PROGRAM_NODEJS?"zip"===this.archiver?".zip":".tar.gz":".pdf"},b.prototype.getFileName=function(a){return void 0===a&&(a=-1),this.getFileBaseName(a)+this.getFileExtension(a)},b.prototype.toJSON=function(){var b=a.prototype.toJSON.call(this);return"object"==typeof b.parametersJson&&(b.parametersJson=JSON.stringify(b.parametersJson)),b},b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return this.projectId>=0&&(b.project_id=this.projectId),this.projectSourceId>=0&&(b.project_source_id=this.projectSourceId),b.script=this.script,b.parameters_json=this.parametersJson&&"object"==typeof this.parametersJson?JSON.stringify(this.parametersJson):this.parametersJson,this.contentType>=0&&(b.content_type=this.contentType),b.is_private=this.isPrivate?1:0,b},b.PROGRAM_NODEJS=0,b.LAYOUT_LASERCUT=1,b}(DbEntry);exports.Variant=Variant;var Module=function(a){function b(b,c){if(void 0===c&&(c=!1),a.call(this,b,c),this.platforms={},this.photoUrl=null,this.script=null,b){if(c){var d=b;return d.module_platforms&&this.parsePlatforms(d.module_platforms),this.photoUrl=d.photo_url?d.photo_url:this.photoUrl,void(this.script=d.script?b.script:this.script)}modelUtils.deserialize(b,this,this._numbers,this._dates),"string"==typeof b.platforms?this.parsePlatforms(b.platforms):b.platforms&&(this.platforms=b.platforms)}}return __extends(b,a),b.prototype.parsePlatforms=function(a){var b=this;this.platforms={};try{var c=JSON.parse(a);_.each(c,function(a,c){b.platforms[c]=new ModulePlatform(a)})}catch(d){}},b.prototype.stringifyPlatforms=function(){return b.stringifyPlatforms(this.platforms)},b.stringifyPlatforms=function(a){var b={};return _.each(a,function(a,c){return b[c]=ModulePlatform.stringify(a)}),JSON.stringify(b)},b.prototype.contains=function(a,c){return b.contains(this.platforms,a,c)},b.prototype.isCompatibleWith=function(a){return b.checkCompatibility(this.platforms,a.platforms)},b.checkCompatibility=function(a,c){var d=!1;return _.each(c,function(c){return d=d||b.contains(a,c.npmPackage,c.classPath)}),d},b.contains=function(a,b,c){var d=!1;return _.each(a,function(a){return d=d||a.npmPackage===b&&a.classPath===c}),d},b.prototype.getClassPathForPackage=function(a){var b;return _.each(this.platforms,function(c){c.npmPackage===a&&(b=c.classPath)}),b},b.prototype.getBasePath=function(){return"module"},b.prototype.toSqlData=function(){var b=a.prototype.toSqlData.call(this);return b.module_platforms=this.stringifyPlatforms(),"string"==typeof this.photoUrl&&(b.photo_url=this.photoUrl),"string"==typeof this.script&&(b.script=this.script),b},b}(DbEntryI18n);exports.Module=Module;var ModulePlatform=function(){function a(a){this.npmPackage=null,this.classPath=null;var b=a.indexOf(".");return b<0?void(this.npmPackage=a):(this.npmPackage=a.substring(0,b),void(this.classPath=a.substring(b+1)))}return a.prototype.toString=function(){return a.stringify(this)},a.stringify=function(a){return a.classPath?a.npmPackage+"."+a.classPath:a.npmPackage},a}(),ModuleUrl=function(){function a(a,b){if(void 0===b&&(b=!1),this.id=-1,this.moduleId=-1,this.name=null,this.url=null,this.author=null,this.createdDate=null,this.accessCount=-1,this._numbers=["id","moduleId","accessCount"],this._dates=["createdDate"],a){if(b)return this.id=a.module_url_id?a.module_url_id:this.id,this.name=a.module_url_name?a.module_url_name:this.name,this.moduleId=a.module_id?a.module_id:this.moduleId,this.url=a.url?a.url:this.url,this.author=a.author_id?new User(a,(!0)):this.author,this.createdDate=a.created_date?new Date(a.created_date):this.createdDate,void(this.accessCount=a.access_count?a.access_count:this.accessCount);modelUtils.deserialize(a,this,this._numbers,this._dates),a.author&&(a.author instanceof User?this.author=a.author:this.author=new User(a.author))}}return a.prototype.toSqlData=function(){var a={};return this.id>=0&&(a.module_url_id=this.id),a.module_url_name=this.name,this.moduleId>=0&&(a.module_id=this.moduleId),a.url=this.url,null!==this.author&&(a.author_id=this.author.id),a},a.prototype.getLinkUrl=function(){return"http://"+f3domain+"/urls/for/modules/redirect/"+this.id},a}();exports.ModuleUrl=ModuleUrl;var Request=function(){function a(a){this._numbers=["request_id","delete_id","delete_type"],this._dates=["created_date","updated_date"],modelUtils.deserialize(a,this,this._numbers,this._dates)}return a.prototype.toSqlData=function(){return modelUtils.toJSON(this,["request_id","delete_id","delete_type","name","email","reason","email_body"])},a}();exports.Request=Request,exports.getDateString=getDateString,exports.hash=hash;/*! f3js-cli - v0.0.3 - 2016-06-23 */

@@ -1,1 +0,1 @@

"use strict";function deserialize(a,b,c,d){void 0===c&&(c=[]),void 0===d&&(d=[]);for(var e in a)a.hasOwnProperty(e)&&("object"==typeof a[e]?Array.isArray(a[e])?b[e]=a[e].slice(0):a[e]instanceof Date&&contains(d,e)&&(b[e]=a[e]):contains(c,e)?b[e]=Number(a[e]):contains(d,e)?a[e]instanceof Date?b[e]=new Date(a[e].getTime()):"string"==typeof a[e]&&(b[e]=new Date(a[e])):b[e]=a[e])}function contains(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return!0;return!1}function getDateString(a){return a instanceof Date?"'"+a.getFullYear().toString().substr(2)+"/"+(a.getMonth()+1)+"/"+a.getDate()+" "+a.getHours()+":"+a.getMinutes():"-"}function escapeHtml(a){var b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return a.replace(/[&<>"']/g,function(a){return b[a]})}function toJSON(a,b){void 0===b&&(b=null);var c={};if(b)_.each(b,function(b){c[b]=a[b]});else for(var d in a)0!=d.indexOf("_")&&"function"!=typeof a[d]&&(c[d]=a[d]);return c}var _=require("underscore");exports.deserialize=deserialize,exports.getDateString=getDateString,exports.escapeHtml=escapeHtml,exports.toJSON=toJSON;/*! f3js-cli - v0.0.2 - 2016-06-23 */
"use strict";function deserialize(a,b,c,d){void 0===c&&(c=[]),void 0===d&&(d=[]);for(var e in a)a.hasOwnProperty(e)&&("object"==typeof a[e]?Array.isArray(a[e])?b[e]=a[e].slice(0):a[e]instanceof Date&&contains(d,e)&&(b[e]=a[e]):contains(c,e)?b[e]=Number(a[e]):contains(d,e)?a[e]instanceof Date?b[e]=new Date(a[e].getTime()):"string"==typeof a[e]&&(b[e]=new Date(a[e])):b[e]=a[e])}function contains(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return!0;return!1}function getDateString(a){return a instanceof Date?"'"+a.getFullYear().toString().substr(2)+"/"+(a.getMonth()+1)+"/"+a.getDate()+" "+a.getHours()+":"+a.getMinutes():"-"}function escapeHtml(a){var b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return a.replace(/[&<>"']/g,function(a){return b[a]})}function toJSON(a,b){void 0===b&&(b=null);var c={};if(b)_.each(b,function(b){c[b]=a[b]});else for(var d in a)0!=d.indexOf("_")&&"function"!=typeof a[d]&&(c[d]=a[d]);return c}var _=require("underscore");exports.deserialize=deserialize,exports.getDateString=getDateString,exports.escapeHtml=escapeHtml,exports.toJSON=toJSON;/*! f3js-cli - v0.0.3 - 2016-06-23 */

@@ -1,1 +0,1 @@

"use strict";function msg(){return new Promise(function(a,b){return null!==message?a(message):void ajax("http://"+base.getServerDomainName()+"/message.json",function(c){return c?(message=c,void a(message)):b()},"json")})}function getMsg(){return message}function setToken(a){token=a}function getUser(){return userObj||self.user&&(userObj=new base.User(self.user)),userObj}function isExternalSite(){return base.getServerDomainName()!==location.host}function isUrl(a){return a.length<2083&&urlRegexp.test(a)}function getDateString(a){return base.getDateString(a)}function getCookie(a){for(var b=a+"=",c=document.cookie.split(";"),d=0;d<c.length;d++){var e=c[d].trim();if(0==e.indexOf(b))return e.substring(b.length,e.length)}return""}function setCookie(a,b,c){void 0===c&&(c=365);var d=new Date;d.setTime(d.getTime()+24*c*60*60*1e3);var e="expires="+d.toUTCString();document.cookie=a+"="+b+"; "+e}function parseQueryString(){if(!location||!location.search)return{};var a=location.search,b={};return"?"!==a.charAt(0)?{}:(_.each(a.substring(1).split("&"),function(a){var c=a.substring(0,a.indexOf("=")),d=a.substring(c.length+1);b[c]=d}),b)}function querify(a){return a?_.reduce(_.map(a,function(a,b){var c="undefined"==typeof a?null:encodeURIComponent(b)+"="+(a?encodeURIComponent(a.toString()):"");return c}),function(a,b){return b?(a?a+"&":"?")+b:a},null):""}function ajaxWithCredentials(a){withCredentialsCallback=a}function ajax(a,b,c,d){if(void 0===c&&(c="text"),void 0===d&&(d="GET"),a){var e;if("undefined"!=typeof ActiveXObject)try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(f){e=!1}}else if("undefined"!=typeof XMLHttpRequest)try{e=new XMLHttpRequest}catch(f){e=!1}else try{var g=require("xhr2");e=new g}catch(f){e=!1}if(e){c=c.toLowerCase(),d=d.toUpperCase();var h=null,i=a.split("?");"POST"==d&&(a=i[0],i.length>1&&(h=i[1])),token&&0===a.indexOf("http://"+base.getServerDomainName())&&("POST"==d?(i.length>1?h+="&":h="",h+="access-token="+token):(a+=i.length>1?"&":"?",a+="access-token="+token)),e.open(d,a),"undefined"!=typeof self&&self.debug&&console.log(d,a);var j=withCredentialsCallback(a);j&&(e.withCredentials=!0),"POST"==d&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.onreadystatechange=function(){if(4===e.readyState){var a="";if(e.responseText&&(a=e.responseText),"j"==c.charAt(0))try{a=JSON.parse(a)}catch(d){a=null}else"x"==c.charAt(0)&&(a=e.responseXML);"undefined"==typeof a&&(a=null),b&&b(a,e.status)}},e.send(h)}}}var PromiseModule=require("es6-promise");"undefined"==typeof self||self.Promise||(self.Promise=PromiseModule.Promise);var _=require("underscore"),base=require("./models/base"),message=null;exports.msg=msg,exports.getMsg=getMsg;var token=null;exports.setToken=setToken;var userObj=null;exports.getUser=getUser,exports.isExternalSite=isExternalSite;var urlRegexp=new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i");exports.isUrl=isUrl,exports.getDateString=getDateString,exports.getCookie=getCookie,exports.setCookie=setCookie,exports.parseQueryString=parseQueryString,exports.querify=querify;var withCredentialsCallback=function(a){return!1};exports.ajaxWithCredentials=ajaxWithCredentials,exports.ajax=ajax;/*! f3js-cli - v0.0.2 - 2016-06-23 */
"use strict";function msg(){return new Promise(function(a,b){return null!==message?a(message):void ajax("http://"+base.getServerDomainName()+"/message.json",function(c){return c?(message=c,void a(message)):b()},"json")})}function getMsg(){return message}function setToken(a){token=a}function getUser(){return userObj||self.user&&(userObj=new base.User(self.user)),userObj}function isExternalSite(){return base.getServerDomainName()!==location.host}function isUrl(a){return a.length<2083&&urlRegexp.test(a)}function getDateString(a){return base.getDateString(a)}function getCookie(a){for(var b=a+"=",c=document.cookie.split(";"),d=0;d<c.length;d++){var e=c[d].trim();if(0==e.indexOf(b))return e.substring(b.length,e.length)}return""}function setCookie(a,b,c){void 0===c&&(c=365);var d=new Date;d.setTime(d.getTime()+24*c*60*60*1e3);var e="expires="+d.toUTCString();document.cookie=a+"="+b+"; "+e}function parseQueryString(){if(!location||!location.search)return{};var a=location.search,b={};return"?"!==a.charAt(0)?{}:(_.each(a.substring(1).split("&"),function(a){var c=a.substring(0,a.indexOf("=")),d=a.substring(c.length+1);b[c]=d}),b)}function querify(a){return a?_.reduce(_.map(a,function(a,b){var c="undefined"==typeof a?null:encodeURIComponent(b)+"="+(a?encodeURIComponent(a.toString()):"");return c}),function(a,b){return b?(a?a+"&":"?")+b:a},null):""}function ajaxWithCredentials(a){withCredentialsCallback=a}function ajax(a,b,c,d){if(void 0===c&&(c="text"),void 0===d&&(d="GET"),a){var e;if("undefined"!=typeof ActiveXObject)try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(f){e=!1}}else if("undefined"!=typeof XMLHttpRequest)try{e=new XMLHttpRequest}catch(f){e=!1}else try{var g=require("xhr2");e=new g}catch(f){e=!1}if(e){c=c.toLowerCase(),d=d.toUpperCase();var h=null,i=a.split("?");if("POST"==d&&(a=i[0],i.length>1&&(h=i[1])),token&&0===a.indexOf("http://"+base.getServerDomainName())&&("POST"==d?(i.length>1?h+="&":h="",h+="access-token="+token):(a+=i.length>1?"&":"?",a+="access-token="+token)),e.open(d,a),"undefined"!=typeof self&&self.debug){var j=/([&?])access-token=(.+)$/.exec(a);j&&(a=a.substring(0,a.length-j[2].length)+"*"),console.log(d,a)}var k=withCredentialsCallback(a);k&&(e.withCredentials=!0),"POST"==d&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.onreadystatechange=function(){if(4===e.readyState){var a="";if(e.responseText&&(a=e.responseText),"j"==c.charAt(0))try{a=JSON.parse(a)}catch(d){a=null}else"x"==c.charAt(0)&&(a=e.responseXML);"undefined"==typeof a&&(a=null),b&&b(a,e.status)}},e.send(h)}}}var PromiseModule=require("es6-promise");"undefined"==typeof self||self.Promise||(self.Promise=PromiseModule.Promise);var _=require("underscore"),base=require("./models/base"),message=null;exports.msg=msg,exports.getMsg=getMsg;var token=null;exports.setToken=setToken;var userObj=null;exports.getUser=getUser,exports.isExternalSite=isExternalSite;var urlRegexp=new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i");exports.isUrl=isUrl,exports.getDateString=getDateString,exports.getCookie=getCookie,exports.setCookie=setCookie,exports.parseQueryString=parseQueryString,exports.querify=querify;var withCredentialsCallback=function(a){return!1};exports.ajaxWithCredentials=ajaxWithCredentials,exports.ajax=ajax;/*! f3js-cli - v0.0.3 - 2016-06-23 */
{
"name": "f3js-cli",
"version": "0.0.2",
"version": "0.0.3",
"description": "",

@@ -20,3 +20,6 @@ "main": "index.js",

"dependencies": {
"commander": "^2.9.0",
"download": "^4.4.3",
"es6-promise": "^3.2.1",
"home-config": "^0.1.0",
"underscore": "^1.8.3",

@@ -26,4 +29,5 @@ "xhr2": "^0.1.3"

"bin": {
"list-projects": "lib/list-projects.js"
"f3-users": "lib/users.js",
"f3-projects": "lib/projects.js"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc