Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

famous-cli

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

famous-cli - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

lib/init/fork.js

9

bin/famous.js

@@ -8,2 +8,3 @@ #!/usr/bin/env node

var create = require('../lib/project/create');
var fork = require('../lib/project/fork');
var develop = require('../lib/dev/dev');

@@ -18,3 +19,3 @@ var userGet = require('../lib/user/get');

storage.getGlobal(function(error, config){
if (config.tracking) metrics.track(process.argv[2] || 'help');
if (config.tracking) metrics.track('cli-event', {'command_data': process.argv.slice(2, process.argv.length).join(" ") || 'help'}, function(){});
});

@@ -49,2 +50,8 @@

program
.command('fork')
.description('fork a famous project')
.option('-n, --name', 'Name of forked project')
.action(fork);
program
.command('develop')

@@ -51,0 +58,0 @@ .alias('dev')

2

lib/project/update.js

@@ -88,3 +88,3 @@ 'use strict';

console.log(chalk.yellow('Share: https://' + config.hostname + '/codemanager/v1/containers/' + container_id + '/share' ));
console.log(chalk.cyan('Embed:' + '\n' + '<script src="https://' + config['assets-hostname'] + '/embed/embed.js"></script>' + '\n' + '<div class="famous-container" data-famous-container-identifier="' + container_id + '">'));
console.log(chalk.cyan('Embed:' + '\n' + '<script src="https://' + config['assets-hostname'] + '/embed/embed.js"></script>' + '\n' + '<div class="famous-container" data-famous-container-identifier="' + container_id + '"></div>'));

@@ -91,0 +91,0 @@ });

@@ -78,3 +78,3 @@ 'use strict';

console.log(chalk.yellow('Share: https://' + config.hostname + '/codemanager/v1/containers/' + container_id + '/share' ));
console.log(chalk.cyan('Embed:' + '\n' + '<script src="https://' + config['assets-hostname'] + '/embed/embed.js"></script>' + '\n' + '<div class="famous-container" data-famous-container-identifier="' + container_id + '">'));
console.log(chalk.cyan('Embed:' + '\n' + '<script src="https://' + config['assets-hostname'] + '/embed/embed.js"></script>' + '\n' + '<div class="famous-container" data-famous-container-identifier="' + container_id + '"></div>'));

@@ -81,0 +81,0 @@ });

{
"name": "famous-cli",
"version": "0.2.5",
"version": "0.2.6",
"description": "CLI interface for Famous Industries Web Services",

@@ -5,0 +5,0 @@ "main": "index.js",

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

var nodeRequire=require;var nodeModule=module;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _user=require("./user");var _user2=_interopRequireDefault(_user);var _container=require("./container");var _container2=_interopRequireDefault(_container);var _widget=require("./widget");var _widget2=_interopRequireDefault(_widget);var _version=require("./version");var _version2=_interopRequireDefault(_version);var _asset=require("./asset");var _asset2=_interopRequireDefault(_asset);var _rbac=require("./rbac");var _rbac2=_interopRequireDefault(_rbac);var _utilStorage=require("./util/storage");var _utilStorage2=_interopRequireDefault(_utilStorage);var _apiConfig=require("./api-config");var _apiConfig2=_interopRequireDefault(_apiConfig);var famous={user:_user2["default"],container:_container2["default"],widget:_widget2["default"],version:_version2["default"],asset:_asset2["default"],rbac:_rbac2["default"],storage:_utilStorage2["default"],config:_apiConfig2["default"]};nodeModule.exports=famous},{"./api-config":2,"./asset":3,"./container":5,"./rbac":15,"./user":35,"./util/storage":41,"./version":43,"./widget":47}],2:[function(require,module,exports){"use strict";module.exports={hostname:"api-te.famo.us","assets-hostname":"assets-te.famo.us",authHeader:"X-FAMOUS-USER-ID"}},{}],3:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _assetGet=require("./asset/get");var _assetGet2=_interopRequireDefault(_assetGet);exports["default"]={get:_assetGet2["default"]};module.exports=exports["default"]},{"./asset/get":4}],4:[function(require,module,exports){"use strict";var request=require("../request").request;var get=function get(blockId,versionRef,filename,callback){var base={path:"/codemanager/v1/blocks/"+blockId+"/versions/"+versionRef+"/assets/"+filename,method:"GET"};return request(base,{},callback)};module.exports=get},{"../request":34}],5:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _containerCreate=require("./container/create");var _containerCreate2=_interopRequireDefault(_containerCreate);var _containerGet=require("./container/get");var _containerGet2=_interopRequireDefault(_containerGet);var _containerUpdate=require("./container/update");var _containerUpdate2=_interopRequireDefault(_containerUpdate);var _containerDestroy=require("./container/destroy");var _containerDestroy2=_interopRequireDefault(_containerDestroy);var _containerCopy=require("./container/copy");var _containerCopy2=_interopRequireDefault(_containerCopy);var _containerIndex=require("./container/index");var _containerIndex2=_interopRequireDefault(_containerIndex);var _containerShare=require("./container/share");var _containerShare2=_interopRequireDefault(_containerShare);var _containerPeek=require("./container/peek");var _containerPeek2=_interopRequireDefault(_containerPeek);exports["default"]={create:_containerCreate2["default"],get:_containerGet2["default"],update:_containerUpdate2["default"],destroy:_containerDestroy2["default"],copy:_containerCopy2["default"],index:_containerIndex2["default"],share:_containerShare2["default"],peek:_containerPeek2["default"]};module.exports=exports["default"]},{"./container/copy":6,"./container/create":7,"./container/destroy":8,"./container/get":9,"./container/index":10,"./container/peek":11,"./container/share":12,"./container/update":13}],6:[function(require,module,exports){"use strict";var request=require("../request").request;var copy=function copy(id,callback){var base={path:"/codemanager/v1/containers/"+id+"/copy",method:"POST"};return request(base,{},callback)};module.exports=copy},{"../request":34}],7:[function(require,module,exports){"use strict";var request=require("../request").request;var create=function create(data,callback){console.log(data);var base={path:"/codemanager/v1/containers",method:"POST"};return request(base,{container:data},callback)};module.exports=create},{"../request":34}],8:[function(require,module,exports){"use strict";var request=require("../request").request;var destroy=function destroy(id,callback){var base={path:"/codemanager/v1/containers/"+id,method:"DELETE"};return request(base,{},callback)};module.exports=destroy},{"../request":34}],9:[function(require,module,exports){"use strict";var request=require("../request").request;var get=function get(id,callback){var base={path:"/codemanager/v1/containers/"+id,method:"GET"};return request(base,{},callback)};module.exports=get},{"../request":34}],10:[function(require,module,exports){"use strict";var request=require("../request").request;var index=function index(callback){var base={path:"/codemanager/v1/containers",method:"GET"};return request(base,{},callback)};module.exports=index},{"../request":34}],11:[function(require,module,exports){"use strict";var request=require("../request").request;var create=function create(data,callback){var base={path:"/codemanager/v1/containers",method:"POST"};return request(base,data,callback)};module.exports=create},{"../request":34}],12:[function(require,module,exports){"use strict";var request=require("../request").request;var share=function share(id,callback){var options={path:"/codemanager/v1/containers/"+id+"/share",method:"GET"};return request(options,{},callback)};module.exports=share},{"../request":34}],13:[function(require,module,exports){"use strict";var request=require("../request").request;var update=function update(id,data,callback){var base={path:"/codemanager/v1/containers/"+id,method:"PUT"};return request(base,{container:data},callback)};module.exports=update},{"../request":34}],14:[function(require,module,exports){"use strict";var CombinedStream=nodeRequire("combined-stream");var util=nodeRequire("util");var path=nodeRequire("path");var http=nodeRequire("http");var https=nodeRequire("https");var parseUrl=nodeRequire("url").parse;var fs=nodeRequire("fs");var mime=nodeRequire("mime-types");var async=nodeRequire("async");module.exports=FormData;function FormData(){this._overheadLength=0;this._valueLength=0;this._lengthRetrievers=[];CombinedStream.call(this)}util.inherits(FormData,CombinedStream);FormData.LINE_BREAK="\r\n";FormData.prototype.append=function(field,value,options){options=options||{};var append=CombinedStream.prototype.append.bind(this);if(typeof value=="number")value=""+value;if(util.isArray(value)){this._error(new Error("Arrays are not supported."));return}var header=this._multiPartHeader(field,value,options);var footer=this._multiPartFooter(field,value,options);append(header);append(value);append(footer);this._trackLength(header,value,options)};FormData.prototype._trackLength=function(header,value,options){var valueLength=0;if(options.knownLength!=null){valueLength+=+options.knownLength}else if(Buffer.isBuffer(value)){valueLength=value.length}else if(typeof value==="string"){valueLength=Buffer.byteLength(value)}this._valueLength+=valueLength;this._overheadLength+=Buffer.byteLength(header)+FormData.LINE_BREAK.length;if(!value||!value.path&&!(value.readable&&value.hasOwnProperty("httpVersion"))){return}if(!options.knownLength)this._lengthRetrievers.push(function(next){if(value.hasOwnProperty("fd")){if(value.end!=undefined&&value.end!=Infinity&&value.start!=undefined){next(null,value.end+1-(value.start?value.start:0))}else{fs.stat(value.path,function(err,stat){var fileSize;if(err){next(err);return}fileSize=stat.size-(value.start?value.start:0);next(null,fileSize)})}}else if(value.hasOwnProperty("httpVersion")){next(null,+value.headers["content-length"])}else if(value.hasOwnProperty("httpModule")){value.on("response",function(response){value.pause();next(null,+response.headers["content-length"])});value.resume()}else{next("Unknown stream")}})};FormData.prototype._multiPartHeader=function(field,value,options){var boundary=this.getBoundary();var header="";if(options.header!=null){header=options.header}else{header+="--"+boundary+FormData.LINE_BREAK+'Content-Disposition: form-data; name="'+field+'"';if(options.filename||value.path){header+='; filename="'+options.filename+'"'+FormData.LINE_BREAK+"Content-Type: "+(options.contentType||mime.lookup(options.filename||value.path))}else if(value.readable&&value.hasOwnProperty("httpVersion")){header+='; filename="'+path.basename(value.client._httpMessage.path)+'"'+FormData.LINE_BREAK+"Content-Type: "+value.headers["content-type"]}header+=FormData.LINE_BREAK+FormData.LINE_BREAK}return header};FormData.prototype._multiPartFooter=function(field,value,options){return function(next){var footer=FormData.LINE_BREAK;var lastPart=this._streams.length===0;if(lastPart){footer+=this._lastBoundary()}next(footer)}.bind(this)};FormData.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"};FormData.prototype.getHeaders=function(userHeaders){var formHeaders={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(var header in userHeaders){formHeaders[header.toLowerCase()]=userHeaders[header]}return formHeaders};FormData.prototype.getCustomHeaders=function(contentType){contentType=contentType?contentType:"multipart/form-data";var formHeaders={"content-type":contentType+"; boundary="+this.getBoundary(),"content-length":this.getLengthSync()};return formHeaders};FormData.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};FormData.prototype._generateBoundary=function(){var boundary="--------------------------";for(var i=0;i<24;i++){boundary+=Math.floor(Math.random()*10).toString(16)}this._boundary=boundary};FormData.prototype.getLengthSync=function(debug){var knownLength=this._overheadLength+this._valueLength;if(this._streams.length){knownLength+=this._lastBoundary().length}if(this._lengthRetrievers.length){this._error(new Error("Cannot calculate proper length in synchronous way."))}return knownLength};FormData.prototype.getLength=function(cb){var knownLength=this._overheadLength+this._valueLength;if(this._streams.length){knownLength+=this._lastBoundary().length}if(!this._lengthRetrievers.length){process.nextTick(cb.bind(this,null,knownLength));return}async.parallel(this._lengthRetrievers,function(err,values){if(err){cb(err);return}values.forEach(function(length){knownLength+=length});cb(null,knownLength)})};FormData.prototype.submit=function(params,cb){var request,options,defaults={method:"post"};if(typeof params=="string"){params=parseUrl(params);options=populate({port:params.port,path:params.pathname,host:params.hostname},defaults)}else{options=populate(params,defaults);if(!options.port){options.port=options.protocol=="https:"?443:80}}options.headers=this.getHeaders(params.headers);if(params.protocol=="https:"){request=https.request(options)}else{request=http.request(options)}this.getLength(function(err,length){request.setHeader("Content-Length",length);this.pipe(request);if(cb){request.on("error",cb);request.on("response",cb.bind(this,null))}}.bind(this));return request};FormData.prototype._error=function(err){if(this.error)return;this.error=err;this.pause();this.emit("error",err)};function populate(dst,src){for(var prop in src){if(!dst[prop])dst[prop]=src[prop]}return dst}},{}],15:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _rbacWidget=require("./rbac/widget");var _rbacWidget2=_interopRequireDefault(_rbacWidget);var _rbacContainer=require("./rbac/container");var _rbacContainer2=_interopRequireDefault(_rbacContainer);exports["default"]={widget:_rbacWidget2["default"],container:_rbacContainer2["default"]};module.exports=exports["default"]},{"./rbac/container":16,"./rbac/widget":28}],16:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _containerCreate=require("./container/create");var _containerCreate2=_interopRequireDefault(_containerCreate);var _containerDestroy=require("./container/destroy");var _containerDestroy2=_interopRequireDefault(_containerDestroy);var _containerGet=require("./container/get");var _containerGet2=_interopRequireDefault(_containerGet);var _containerIndex=require("./container/index");var _containerIndex2=_interopRequireDefault(_containerIndex);var _containerUpdate=require("./container/update");var _containerUpdate2=_interopRequireDefault(_containerUpdate);exports["default"]={create:_containerCreate2["default"],destroy:_containerDestroy2["default"],get:_containerGet2["default"],index:_containerIndex2["default"],update:_containerUpdate2["default"]};module.exports=exports["default"]},{"./container/create":17,"./container/destroy":18,"./container/get":19,"./container/index":20,"./container/update":21}],17:[function(require,module,exports){"use strict";var permission=require("../permission");var create=function create(data,callback){return permission.create("widget",data,callback)};module.exports=create},{"../permission":22}],18:[function(require,module,exports){"use strict";var permission=require("../permission");var destroy=function destroy(id,callback){return permission.destroy("widget",id,callback)};module.exports=destroy},{"../permission":22}],19:[function(require,module,exports){"use strict";var permission=require("../permission");var get=function get(id,callback){return permission.get("widget",id,callback)};module.exports=get},{"../permission":22}],20:[function(require,module,exports){"use strict";var permission=require("../permission");var index=function index(data,callback){return permission.index("widget",data,callback)};module.exports=index},{"../permission":22}],21:[function(require,module,exports){"use strict";var permission=require("../permission");var update=function update(data,callback){return permission.update("widget",data,callback)};module.exports=update},{"../permission":22}],22:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _permissionCreate=require("./permission/create");var _permissionCreate2=_interopRequireDefault(_permissionCreate);var _permissionDestroy=require("./permission/destroy");var _permissionDestroy2=_interopRequireDefault(_permissionDestroy);var _permissionGet=require("./permission/get");var _permissionGet2=_interopRequireDefault(_permissionGet);var _permissionIndex=require("./permission/index");var _permissionIndex2=_interopRequireDefault(_permissionIndex);var _permissionUpdate=require("./permission/update");var _permissionUpdate2=_interopRequireDefault(_permissionUpdate);exports["default"]={create:_permissionCreate2["default"],destroy:_permissionDestroy2["default"],get:_permissionGet2["default"],index:_permissionIndex2["default"],update:_permissionUpdate2["default"]};module.exports=exports["default"]},{"./permission/create":23,"./permission/destroy":24,"./permission/get":25,"./permission/index":26,"./permission/update":27}],23:[function(require,module,exports){"use strict";var request=require("../../request").request;var util=require("../../util/pluralize");var create=function create(resource_name,data,callback){var base={path:"/rbac/v1/"+util.pluralize(resource_name),method:"POST"};return request(base,{resource_name:data},callback)};module.exports=create},{"../../request":34,"../../util/pluralize":40}],24:[function(require,module,exports){"use strict";var request=require("../../request").request;var util=require("../../util/pluralize");var destroy=function destroy(resource_name,id,callback){var base={path:"/rbac/v1/"+util.pluralize(resource_name)+"/"+id,method:"DELETE"};return request(base,{},callback)};module.exports=destroy},{"../../request":34,"../../util/pluralize":40}],25:[function(require,module,exports){"use strict";var request=require("../../request").request;var util=require("../../util/pluralize");var get=function get(resource_name,id,callback){var base={path:"/rbac/v1/"+util.pluralize(resource_name)+"/"+id,method:"GET"};return request(base,{},callback)};module.exports=get},{"../../request":34,"../../util/pluralize":40}],26:[function(require,module,exports){"use strict";var request=require("../../request").request;var util=require("../../util/pluralize");var index=function index(resource_name,data,callback){var base={path:"/rbac/v1/"+util.pluralize(resource_name),method:"GET"};return request(base,{},callback)};module.exports=index},{"../../request":34,"../../util/pluralize":40}],27:[function(require,module,exports){"use strict";var request=require("../../request").request;var util=require("../../util/pluralize");var update=function update(resource_name,data,callback){var base={path:"/rbac/v1/"+util.pluralize(resource_name),method:"PUT"};return request(base,{resource_name:data},callback)};module.exports=update},{"../../request":34,"../../util/pluralize":40}],28:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _widgetCreate=require("./widget/create");var _widgetCreate2=_interopRequireDefault(_widgetCreate);var _widgetDestroy=require("./widget/destroy");var _widgetDestroy2=_interopRequireDefault(_widgetDestroy);var _widgetGet=require("./widget/get");var _widgetGet2=_interopRequireDefault(_widgetGet);var _widgetIndex=require("./widget/index");var _widgetIndex2=_interopRequireDefault(_widgetIndex);var _widgetUpdate=require("./widget/update");var _widgetUpdate2=_interopRequireDefault(_widgetUpdate);exports["default"]={create:_widgetCreate2["default"],destroy:_widgetDestroy2["default"],get:_widgetGet2["default"],index:_widgetIndex2["default"],update:_widgetUpdate2["default"]};module.exports=exports["default"]},{"./widget/create":29,"./widget/destroy":30,"./widget/get":31,"./widget/index":32,"./widget/update":33}],29:[function(require,module,exports){"use strict";var permission=require("../permission");var create=function create(data,callback){return permission.create("container",data,callback)};module.exports=create},{"../permission":22}],30:[function(require,module,exports){"use strict";var permission=require("../permission");var destroy=function destroy(id,callback){return permission.destroy("container",id,callback)};module.exports=destroy},{"../permission":22}],31:[function(require,module,exports){"use strict";var permission=require("../permission");var get=function get(id,callback){return permission.get("container",id,callback)};module.exports=get},{"../permission":22}],32:[function(require,module,exports){"use strict";var permission=require("../permission");var index=function index(data,callback){return permission.index("container",data,callback)};module.exports=index},{"../permission":22}],33:[function(require,module,exports){"use strict";var permission=require("../permission");var update=function update(data,callback){return permission.update("container",data,callback)};module.exports=update},{"../permission":22}],34:[function(require,module,exports){"use strict";var HTTP=nodeRequire("https");var FormData=require("./form-data/lib/form_data.js");var fs=nodeRequire("fs");var extend=require("./util/util").extend;var storage=require("./util/storage");var apiConfig=require("./api-config");var async=nodeRequire("async");var base_options={host:apiConfig.hostname,path:"/",method:"POST",headers:{"Content-Type":"application/json"},protocol:"https:",port:"443",withCredentials:false};var requestHandler=function requestHandler(response,callback){var chewie="";response.on("data",function(chunk){chewie+=chunk});response.on("end",function(){if(response.headers["content-type"]&&response.headers["content-type"].indexOf("application/json")>-1){try{chewie=JSON.parse(chewie)}catch(e){return callback(new Error("parsing"),chewie)}}if(parseInt(response.statusCode)>=400){return callback(new Error(response.statusCode),chewie)}else{return callback(null,chewie)}})};var authentication=function authentication(options,callback){storage.getGlobal(function(err,data){if(data&&data.authentication_token){options.headers["X-Authentication-Token"]=data.authentication_token}return callback(null,options)})};var Request=function Request(options,data,mainCallback){var request;var payload=JSON.stringify(data);options=extend(base_options,options);options.headers["Content-Length"]=Buffer.byteLength(payload);async.waterfall([function(callback){authentication(options,callback)},function(params,callback){request=HTTP.request(params,function(res){requestHandler(res,callback)});request.on("error",function(error){return callback(error,null)});request.write(payload,"utf-8");request.end()}],function(error,result){return mainCallback(error,result)})};var Multipart=function Multipart(options,data,mainCallback){var request;var form;form=new FormData;options=extend(base_options,options);data.forEach(function(current,index,array){form.append("files[]",fs.createReadStream(current.value),{filename:current.relative})});options.headers=form.getHeaders();async.waterfall([function(callback){authentication(options,callback)},function(params,callback){request=HTTP.request(params,function(res){requestHandler(res,callback)});form.pipe(request);request.on("error",function(error){return callback(error,null)})}],function(error,result){return mainCallback(error,result)})};module.exports.request=Request;module.exports.multipart=Multipart},{"./api-config":2,"./form-data/lib/form_data.js":14,"./util/storage":41,"./util/util":42}],35:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _userCreate=require("./user/create");var _userCreate2=_interopRequireDefault(_userCreate);var _userLogin=require("./user/login");var _userLogin2=_interopRequireDefault(_userLogin);var _userLogout=require("./user/logout");var _userLogout2=_interopRequireDefault(_userLogout);var _userOauth=require("./user/oauth");var _userOauth2=_interopRequireDefault(_userOauth);exports["default"]={create:_userCreate2["default"],login:_userLogin2["default"],logout:_userLogout2["default"],oauth:_userOauth2["default"]};module.exports=exports["default"]},{"./user/create":36,"./user/login":37,"./user/logout":38,"./user/oauth":39}],36:[function(require,module,exports){"use strict";var request=require("../request").request;var create=function create(data,callback){var status=data.tracking;var base={path:"/auth/v1",method:"POST"};return request(base,{user:data,metrics:status},callback)};module.exports=create},{"../request":34}],37:[function(require,module,exports){"use strict";var request=require("../request").request;var login=function login(data,callback){var base={path:"/auth/v1/login",method:"POST"};return request(base,{user:data},callback)};module.exports=login},{"../request":34}],38:[function(require,module,exports){"use strict";var request=require("../request").request;var logout=function logout(callback){var base={path:"/auth/v1/logout",method:"DELETE"};return request(base,{},callback)};module.exports=logout},{"../request":34}],39:[function(require,module,exports){"use strict";var request=require("../request").request;var oauth=function oauth(provider,token,callback){var base={path:"/auth/v1/oauth/"+provider,method:"POST",headers:{"X-AUTHENTICATION-TOKEN":token}};return request(base,{},callback)};module.exports=oauth},{"../request":34}],40:[function(require,module,exports){"use strict";function pluralize(string){return string+"s"}module.exports.pluralize=pluralize},{}],41:[function(require,module,exports){"use strict";var fs=nodeRequire("fs");var path=nodeRequire("path");var async=nodeRequire("async");var storage={setGlobal:function setGlobal(data,callback){var confpath=path.join(storage.home(),".famous",".config");async.waterfall([storage.init,storage.getGlobal,function(config,callback){for(var key in data){config[key]=data[key]}return callback(null,config)},function(config,callback){fs.writeFile(confpath,JSON.stringify(config),function(error){if(!error){return callback(null)}return callback(error)})}],function(error,result){return callback(error,result)})},getGlobal:function getGlobal(callback){var confpath=path.join(storage.home(),".famous",".config");async.waterfall([storage.init,function(callback){fs.readFile(confpath,function(error,data){if(!error){return callback(null,data.toString())}return error,null})},storage.parseLocalStore],function(error,data){if(!data)data={};return callback(null,data)})},parseLocalStore:function parseLocalStore(data,callback){var parsed;try{parsed=JSON.parse(data)}catch(error){return callback(error,null)}return callback(null,parsed)},setProjectMeta:function setProjectMeta(data,callback){var confpath=path.join(process.cwd(),".famous");async.waterfall([function(callback){storage.initProjectMeta(confpath,{},callback)},storage.getProjectMeta,function(config,callback){for(var key in data){config[key]=data[key]}return callback(null,config)},function(config,callback){var buff=new Buffer(JSON.stringify(config));fs.writeFile(confpath,buff,{encoding:"utf8"},callback)}],function(error,results){callback(error,results)})},getProjectMeta:function getProjectMeta(callback){var confpath=path.join(process.cwd(),".famous");async.waterfall([function(callback){storage.initProjectMeta(confpath,{},callback)},function(callback){fs.readFile(confpath,"utf-8",callback)}],function(error,results){try{callback(error,JSON.parse(results))}catch(e){return callback(e,{})}})},initProjectMeta:function initProjectMeta(path,obj,callback){var buff=new Buffer(JSON.stringify(obj));async.waterfall([function(callback){fs.open(path,"wx",callback)},function(fd,callback){fs.write(fd,buff,0,buff.length,null,function(err,written,buffer){callback(err,fd)})},function(fd,callback){fs.close(fd,callback)}],function(error,result){if(error){if(error.code==="EEXIST"){return callback(null)}}return callback(error)})},init:function init(callback){var famouspath=path.join(storage.home(),".famous");var conf=path.join(famouspath,".config");async.waterfall([function(callback){fs.mkdir(famouspath,function(error){return callback(null)})},function(callback){fs.open(conf,"a+",function(err,fd){return callback(err,fd)})},function(fd,callback){var buff=new Buffer(3);var buffer=fs.read(fd,buff,0,buff.length,null,function(error,bytesRead,buffer){return callback(error,fd,bytesRead,buffer)})}],function(error,fd,bytesread,buffer){fs.closeSync(fd);return callback(error)})},home:function home(){return process.env.HOME||process.env.USERPROFILE}};module.exports=storage},{}],42:[function(require,module,exports){"use strict";function extend(target,donor){for(var e in donor){target[e]=donor[e]}return target}module.exports.extend=extend},{}],43:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _versionCreate=require("./version/create");var _versionCreate2=_interopRequireDefault(_versionCreate);var _versionUpdate=require("./version/update");var _versionUpdate2=_interopRequireDefault(_versionUpdate);var _versionGet=require("./version/get");var _versionGet2=_interopRequireDefault(_versionGet);exports["default"]={create:_versionCreate2["default"],update:_versionUpdate2["default"],get:_versionGet2["default"]};module.exports=exports["default"]},{"./version/create":44,"./version/get":45,"./version/update":46}],44:[function(require,module,exports){"use strict";var request=require("../request").multipart;var create=function create(id,manifest,callback){var base={path:"/codemanager/v1/blocks/"+id+"/versions/",method:"POST"};return request(base,manifest,callback)};module.exports=create},{"../request":34}],45:[function(require,module,exports){"use strict";var request=require("../request").request;var get=function get(id,versionId,callback){var base={path:"/codemanager/v1/blocks/"+id+"/versions/"+versionId,method:"GET"};return request(base,{},callback)};module.exports=get},{"../request":34}],46:[function(require,module,exports){"use strict";var request=require("../request").request;var update=function update(blockid,versionref,manifest,callback){var base={path:"/codemanager/v1/blocks/"+blockid+"/versions/"+versionref,method:"POST"};return request(base,manifest,callback)};module.exports=update},{"../request":34}],47:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{"default":obj}}var _widgetCreate=require("./widget/create");var _widgetCreate2=_interopRequireDefault(_widgetCreate);var _widgetGet=require("./widget/get");var _widgetGet2=_interopRequireDefault(_widgetGet);var _widgetCopy=require("./widget/copy");var _widgetCopy2=_interopRequireDefault(_widgetCopy);var _widgetIndex=require("./widget/index");var _widgetIndex2=_interopRequireDefault(_widgetIndex);var _widgetPush=require("./widget/push");var _widgetPush2=_interopRequireDefault(_widgetPush);exports["default"]={create:_widgetCreate2["default"],push:_widgetPush2["default"],get:_widgetGet2["default"],copy:_widgetCopy2["default"],index:_widgetIndex2["default"]};module.exports=exports["default"]},{"./widget/copy":48,"./widget/create":49,"./widget/get":50,"./widget/index":51,"./widget/push":52}],48:[function(require,module,exports){"use strict";var request=require("../request").request;var copy=function copy(id,callback){var base={path:"/codemanager/v1/blocks/"+id+"/copy",method:"POST"};return request(base,{},callback)};module.exports=copy},{"../request":34}],49:[function(require,module,exports){"use strict";var request=require("../request").request;var create=function create(data,callback){var base={path:"/codemanager/v1/blocks",method:"POST"};return request(base,{block:data},function(error,result){return callback(error,result)})};module.exports=create},{"../request":34}],50:[function(require,module,exports){"use strict";var request=require("../request").request;var get=function get(id,callback){var base={path:"/codemanager/v1/blocks/"+id,method:"GET"};return request(base,{},callback)};module.exports=get},{"../request":34}],51:[function(require,module,exports){"use strict";var request=require("../request").request;var index=function index(callback){var base={path:"/codemanager/v1/blocks",method:"GET"};return request(base,{},callback)};module.exports=index},{"../request":34}],52:[function(require,module,exports){"use strict";var request=require("../request").multipart;var push=function push(id,manifest,callback){var base={path:"/codemanager/v1/blocks/"+id+"/versions",method:"POST",files:[]};manifest.forEach(function(current,index,array){var file={value:current.value,options:{filename:current.filename,contentType:current.contentType}};base.files.push(file)});return request(base,manifest,callback)};module.exports=push},{"../request":34}]},{},[1]);
var nodeRequire=require,nodeModule=module;!function e(t,r,n){function o(i,a){if(!r[i]){if(!t[i]){var s="function"==typeof require&&require;if(!a&&s)return s(i,!0);if(u)return u(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[i]={exports:{}};t[i][0].call(f.exports,function(e){var r=t[i][1][e];return o(r?r:e)},f,f.exports,e,t,r,n)}return r[i].exports}for(var u="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=e("./user"),u=n(o),i=e("./container"),a=n(i),s=e("./widget"),c=n(s),f=e("./version"),d=n(f),l=e("./asset"),p=n(l),h=e("./rbac"),v=n(h),g=e("./util/storage"),m=n(g),y=e("./api-config"),q=n(y),_={user:u["default"],container:a["default"],widget:c["default"],version:d["default"],asset:p["default"],rbac:v["default"],storage:m["default"],config:q["default"]};nodeModule.exports=_},{"./api-config":2,"./asset":3,"./container":5,"./rbac":15,"./user":35,"./util/storage":41,"./version":43,"./widget":47}],2:[function(e,t,r){"use strict";t.exports={hostname:"api-te.famo.us","assets-hostname":"assets-te.famo.us",authHeader:"X-FAMOUS-USER-ID"}},{}],3:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./asset/get"),u=n(o);r["default"]={get:u["default"]},t.exports=r["default"]},{"./asset/get":4}],4:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t,r,o){var u={path:"/codemanager/v1/blocks/"+e+"/versions/"+t+"/assets/"+r,method:"GET"};return n(u,{},o)};t.exports=o},{"../request":34}],5:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./container/create"),u=n(o),i=e("./container/get"),a=n(i),s=e("./container/update"),c=n(s),f=e("./container/destroy"),d=n(f),l=e("./container/copy"),p=n(l),h=e("./container/index"),v=n(h),g=e("./container/share"),m=n(g),y=e("./container/peek"),q=n(y);r["default"]={create:u["default"],get:a["default"],update:c["default"],destroy:d["default"],copy:p["default"],index:v["default"],share:m["default"],peek:q["default"]},t.exports=r["default"]},{"./container/copy":6,"./container/create":7,"./container/destroy":8,"./container/get":9,"./container/index":10,"./container/peek":11,"./container/share":12,"./container/update":13}],6:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/containers/"+e+"/copy",method:"POST"};return n(r,{},t)};t.exports=o},{"../request":34}],7:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/containers",method:"POST"};return n(r,{container:e},t)};t.exports=o},{"../request":34}],8:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/containers/"+e,method:"DELETE"};return n(r,{},t)};t.exports=o},{"../request":34}],9:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/containers/"+e,method:"GET"};return n(r,{},t)};t.exports=o},{"../request":34}],10:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e){var t={path:"/codemanager/v1/containers",method:"GET"};return n(t,{},e)};t.exports=o},{"../request":34}],11:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/containers",method:"POST"};return n(r,e,t)};t.exports=o},{"../request":34}],12:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/containers/"+e+"/share",method:"GET"};return n(r,{},t)};t.exports=o},{"../request":34}],13:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t,r){var o={path:"/codemanager/v1/containers/"+e,method:"PUT"};return n(o,{container:t},r)};t.exports=o},{"../request":34}],14:[function(e,t,r){"use strict";function n(){this._overheadLength=0,this._valueLength=0,this._lengthRetrievers=[],u.call(this)}function o(e,t){for(var r in t)e[r]||(e[r]=t[r]);return e}var u=nodeRequire("combined-stream"),i=nodeRequire("util"),a=nodeRequire("path"),s=nodeRequire("http"),c=nodeRequire("https"),f=nodeRequire("url").parse,d=nodeRequire("fs"),l=nodeRequire("mime-types"),p=nodeRequire("async");t.exports=n,i.inherits(n,u),n.LINE_BREAK="\r\n",n.prototype.append=function(e,t,r){r=r||{};var n=u.prototype.append.bind(this);if("number"==typeof t&&(t=""+t),i.isArray(t))return void this._error(new Error("Arrays are not supported."));var o=this._multiPartHeader(e,t,r),a=this._multiPartFooter(e,t,r);n(o),n(t),n(a),this._trackLength(o,t,r)},n.prototype._trackLength=function(e,t,r){var o=0;null!=r.knownLength?o+=+r.knownLength:Buffer.isBuffer(t)?o=t.length:"string"==typeof t&&(o=Buffer.byteLength(t)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(e)+n.LINE_BREAK.length,t&&(t.path||t.readable&&t.hasOwnProperty("httpVersion"))&&(r.knownLength||this._lengthRetrievers.push(function(e){t.hasOwnProperty("fd")?void 0!=t.end&&t.end!=1/0&&void 0!=t.start?e(null,t.end+1-(t.start?t.start:0)):d.stat(t.path,function(r,n){var o;return r?void e(r):(o=n.size-(t.start?t.start:0),void e(null,o))}):t.hasOwnProperty("httpVersion")?e(null,+t.headers["content-length"]):t.hasOwnProperty("httpModule")?(t.on("response",function(r){t.pause(),e(null,+r.headers["content-length"])}),t.resume()):e("Unknown stream")}))},n.prototype._multiPartHeader=function(e,t,r){var o=this.getBoundary(),u="";return null!=r.header?u=r.header:(u+="--"+o+n.LINE_BREAK+'Content-Disposition: form-data; name="'+e+'"',r.filename||t.path?u+='; filename="'+r.filename+'"'+n.LINE_BREAK+"Content-Type: "+(r.contentType||l.lookup(r.filename||t.path)):t.readable&&t.hasOwnProperty("httpVersion")&&(u+='; filename="'+a.basename(t.client._httpMessage.path)+'"'+n.LINE_BREAK+"Content-Type: "+t.headers["content-type"]),u+=n.LINE_BREAK+n.LINE_BREAK),u},n.prototype._multiPartFooter=function(e,t,r){return function(e){var t=n.LINE_BREAK,r=0===this._streams.length;r&&(t+=this._lastBoundary()),e(t)}.bind(this)},n.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"},n.prototype.getHeaders=function(e){var t={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(var r in e)t[r.toLowerCase()]=e[r];return t},n.prototype.getCustomHeaders=function(e){e=e?e:"multipart/form-data";var t={"content-type":e+"; boundary="+this.getBoundary(),"content-length":this.getLengthSync()};return t},n.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},n.prototype._generateBoundary=function(){for(var e="--------------------------",t=0;24>t;t++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},n.prototype.getLengthSync=function(e){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this._lengthRetrievers.length&&this._error(new Error("Cannot calculate proper length in synchronous way.")),t},n.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this._lengthRetrievers.length?void p.parallel(this._lengthRetrievers,function(r,n){return r?void e(r):(n.forEach(function(e){t+=e}),void e(null,t))}):void process.nextTick(e.bind(this,null,t))},n.prototype.submit=function(e,t){var r,n,u={method:"post"};return"string"==typeof e?(e=f(e),n=o({port:e.port,path:e.pathname,host:e.hostname},u)):(n=o(e,u),n.port||(n.port="https:"==n.protocol?443:80)),n.headers=this.getHeaders(e.headers),r="https:"==e.protocol?c.request(n):s.request(n),this.getLength(function(e,n){r.setHeader("Content-Length",n),this.pipe(r),t&&(r.on("error",t),r.on("response",t.bind(this,null)))}.bind(this)),r},n.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))}},{}],15:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./rbac/widget"),u=n(o),i=e("./rbac/container"),a=n(i);r["default"]={widget:u["default"],container:a["default"]},t.exports=r["default"]},{"./rbac/container":16,"./rbac/widget":28}],16:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./container/create"),u=n(o),i=e("./container/destroy"),a=n(i),s=e("./container/get"),c=n(s),f=e("./container/index"),d=n(f),l=e("./container/update"),p=n(l);r["default"]={create:u["default"],destroy:a["default"],get:c["default"],index:d["default"],update:p["default"]},t.exports=r["default"]},{"./container/create":17,"./container/destroy":18,"./container/get":19,"./container/index":20,"./container/update":21}],17:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.create("widget",e,t)};t.exports=o},{"../permission":22}],18:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.destroy("widget",e,t)};t.exports=o},{"../permission":22}],19:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.get("widget",e,t)};t.exports=o},{"../permission":22}],20:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.index("widget",e,t)};t.exports=o},{"../permission":22}],21:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.update("widget",e,t)};t.exports=o},{"../permission":22}],22:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./permission/create"),u=n(o),i=e("./permission/destroy"),a=n(i),s=e("./permission/get"),c=n(s),f=e("./permission/index"),d=n(f),l=e("./permission/update"),p=n(l);r["default"]={create:u["default"],destroy:a["default"],get:c["default"],index:d["default"],update:p["default"]},t.exports=r["default"]},{"./permission/create":23,"./permission/destroy":24,"./permission/get":25,"./permission/index":26,"./permission/update":27}],23:[function(e,t,r){"use strict";var n=e("../../request").request,o=e("../../util/pluralize"),u=function(e,t,r){var u={path:"/rbac/v1/"+o.pluralize(e),method:"POST"};return n(u,{resource_name:t},r)};t.exports=u},{"../../request":34,"../../util/pluralize":40}],24:[function(e,t,r){"use strict";var n=e("../../request").request,o=e("../../util/pluralize"),u=function(e,t,r){var u={path:"/rbac/v1/"+o.pluralize(e)+"/"+t,method:"DELETE"};return n(u,{},r)};t.exports=u},{"../../request":34,"../../util/pluralize":40}],25:[function(e,t,r){"use strict";var n=e("../../request").request,o=e("../../util/pluralize"),u=function(e,t,r){var u={path:"/rbac/v1/"+o.pluralize(e)+"/"+t,method:"GET"};return n(u,{},r)};t.exports=u},{"../../request":34,"../../util/pluralize":40}],26:[function(e,t,r){"use strict";var n=e("../../request").request,o=e("../../util/pluralize"),u=function(e,t,r){var u={path:"/rbac/v1/"+o.pluralize(e),method:"GET"};return n(u,{},r)};t.exports=u},{"../../request":34,"../../util/pluralize":40}],27:[function(e,t,r){"use strict";var n=e("../../request").request,o=e("../../util/pluralize"),u=function(e,t,r){var u={path:"/rbac/v1/"+o.pluralize(e),method:"PUT"};return n(u,{resource_name:t},r)};t.exports=u},{"../../request":34,"../../util/pluralize":40}],28:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./widget/create"),u=n(o),i=e("./widget/destroy"),a=n(i),s=e("./widget/get"),c=n(s),f=e("./widget/index"),d=n(f),l=e("./widget/update"),p=n(l);r["default"]={create:u["default"],destroy:a["default"],get:c["default"],index:d["default"],update:p["default"]},t.exports=r["default"]},{"./widget/create":29,"./widget/destroy":30,"./widget/get":31,"./widget/index":32,"./widget/update":33}],29:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.create("container",e,t)};t.exports=o},{"../permission":22}],30:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.destroy("container",e,t)};t.exports=o},{"../permission":22}],31:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.get("container",e,t)};t.exports=o},{"../permission":22}],32:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.index("container",e,t)};t.exports=o},{"../permission":22}],33:[function(e,t,r){"use strict";var n=e("../permission"),o=function(e,t){return n.update("container",e,t)};t.exports=o},{"../permission":22}],34:[function(e,t,r){"use strict";var n=nodeRequire("https"),o=e("./form-data/lib/form_data.js"),u=nodeRequire("fs"),i=e("./util/util").extend,a=e("./util/storage"),s=e("./api-config"),c=nodeRequire("async"),f={host:s.hostname,path:"/",method:"POST",headers:{"Content-Type":"application/json"},protocol:"https:",port:"443",withCredentials:!1},d=function(e,t){var r="";e.on("data",function(e){r+=e}),e.on("end",function(){if(e.headers["content-type"]&&e.headers["content-type"].indexOf("application/json")>-1)try{r=JSON.parse(r)}catch(n){return t(new Error("parsing"),r)}return parseInt(e.statusCode)>=400?t(new Error(e.statusCode),r):t(null,r)})},l=function(e,t){a.getGlobal(function(r,n){return n&&n.authentication_token&&(e.headers["X-Authentication-Token"]=n.authentication_token),t(null,e)})},p=function(e,t,r){var o,u=JSON.stringify(t);e=i(f,e),e.headers["Content-Length"]=Buffer.byteLength(u),c.waterfall([function(t){l(e,t)},function(e,t){o=n.request(e,function(e){d(e,t)}),o.on("error",function(e){return t(e,null)}),o.write(u,"utf-8"),o.end()}],function(e,t){return r(e,t)})},h=function(e,t,r){var a,s;s=new o,e=i(f,e),t.forEach(function(e,t,r){s.append("files[]",u.createReadStream(e.value),{filename:e.relative})}),e.headers=s.getHeaders(),c.waterfall([function(t){l(e,t)},function(e,t){a=n.request(e,function(e){d(e,t)}),s.pipe(a),a.on("error",function(e){return t(e,null)})}],function(e,t){return r(e,t)})};t.exports.request=p,t.exports.multipart=h},{"./api-config":2,"./form-data/lib/form_data.js":14,"./util/storage":41,"./util/util":42}],35:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./user/create"),u=n(o),i=e("./user/login"),a=n(i),s=e("./user/logout"),c=n(s),f=e("./user/oauth"),d=n(f);r["default"]={create:u["default"],login:a["default"],logout:c["default"],oauth:d["default"]},t.exports=r["default"]},{"./user/create":36,"./user/login":37,"./user/logout":38,"./user/oauth":39}],36:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r=e.tracking,o={path:"/auth/v1",method:"POST"};return n(o,{user:e,metrics:r},t)};t.exports=o},{"../request":34}],37:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/auth/v1/login",method:"POST"};return n(r,{user:e},t)};t.exports=o},{"../request":34}],38:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e){var t={path:"/auth/v1/logout",method:"DELETE"};return n(t,{},e)};t.exports=o},{"../request":34}],39:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t,r){var o={path:"/auth/v1/oauth/"+e,method:"POST",headers:{"X-AUTHENTICATION-TOKEN":t}};return n(o,{},r)};t.exports=o},{"../request":34}],40:[function(e,t,r){"use strict";function n(e){return e+"s"}t.exports.pluralize=n},{}],41:[function(e,t,r){"use strict";var n=nodeRequire("fs"),o=nodeRequire("path"),u=nodeRequire("async"),i={setGlobal:function(e,t){var r=o.join(i.home(),".famous",".config");u.waterfall([i.init,i.getGlobal,function(t,r){for(var n in e)t[n]=e[n];return r(null,t)},function(e,t){n.writeFile(r,JSON.stringify(e),function(e){return t(e?e:null)})}],function(e,r){return t(e,r)})},getGlobal:function(e){var t=o.join(i.home(),".famous",".config");u.waterfall([i.init,function(e){n.readFile(t,function(t,r){return t?null:e(null,r.toString())})},i.parseLocalStore],function(t,r){return r||(r={}),e(null,r)})},parseLocalStore:function(e,t){var r;try{r=JSON.parse(e)}catch(n){return t(n,null)}return t(null,r)},setProjectMeta:function(e,t){var r=o.join(process.cwd(),".famous");u.waterfall([function(e){i.initProjectMeta(r,{},e)},i.getProjectMeta,function(t,r){for(var n in e)t[n]=e[n];return r(null,t)},function(e,t){var o=new Buffer(JSON.stringify(e));n.writeFile(r,o,{encoding:"utf8"},t)}],function(e,r){t(e,r)})},getProjectMeta:function(e){var t=o.join(process.cwd(),".famous");u.waterfall([function(e){i.initProjectMeta(t,{},e)},function(e){n.readFile(t,"utf-8",e)}],function(t,r){try{e(t,JSON.parse(r))}catch(n){return e(n,{})}})},initProjectMeta:function(e,t,r){var o=new Buffer(JSON.stringify(t));u.waterfall([function(t){n.open(e,"wx",t)},function(e,t){n.write(e,o,0,o.length,null,function(r,n,o){t(r,e)})},function(e,t){n.close(e,t)}],function(e,t){return r(e&&"EEXIST"===e.code?null:e)})},init:function(e){var t=o.join(i.home(),".famous"),r=o.join(t,".config");u.waterfall([function(e){n.mkdir(t,function(t){return e(null)})},function(e){n.open(r,"a+",function(t,r){return e(t,r)})},function(e,t){var r=new Buffer(3);n.read(e,r,0,r.length,null,function(r,n,o){return t(r,e,n,o)})}],function(t,r,o,u){return n.closeSync(r),e(t)})},home:function(){return process.env.HOME||process.env.USERPROFILE}};t.exports=i},{}],42:[function(e,t,r){"use strict";function n(e,t){for(var r in t)e[r]=t[r];return e}t.exports.extend=n},{}],43:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./version/create"),u=n(o),i=e("./version/update"),a=n(i),s=e("./version/get"),c=n(s);r["default"]={create:u["default"],update:a["default"],get:c["default"]},t.exports=r["default"]},{"./version/create":44,"./version/get":45,"./version/update":46}],44:[function(e,t,r){"use strict";var n=e("../request").multipart,o=function(e,t,r){var o={path:"/codemanager/v1/blocks/"+e+"/versions/",method:"POST"};return n(o,t,r)};t.exports=o},{"../request":34}],45:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t,r){var o={path:"/codemanager/v1/blocks/"+e+"/versions/"+t,method:"GET"};return n(o,{},r)};t.exports=o},{"../request":34}],46:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t,r,o){var u={path:"/codemanager/v1/blocks/"+e+"/versions/"+t,method:"POST"};return n(u,r,o)};t.exports=o},{"../request":34}],47:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0});var o=e("./widget/create"),u=n(o),i=e("./widget/get"),a=n(i),s=e("./widget/copy"),c=n(s),f=e("./widget/index"),d=n(f),l=e("./widget/push"),p=n(l);r["default"]={create:u["default"],push:p["default"],get:a["default"],copy:c["default"],index:d["default"]},t.exports=r["default"]},{"./widget/copy":48,"./widget/create":49,"./widget/get":50,"./widget/index":51,"./widget/push":52}],48:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/blocks/"+e+"/copy",method:"POST"};return n(r,{},t)};t.exports=o},{"../request":34}],49:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/blocks",method:"POST"};return n(r,{block:e},function(e,r){return t(e,r)})};t.exports=o},{"../request":34}],50:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e,t){var r={path:"/codemanager/v1/blocks/"+e,method:"GET"};return n(r,{},t)};t.exports=o},{"../request":34}],51:[function(e,t,r){"use strict";var n=e("../request").request,o=function(e){var t={path:"/codemanager/v1/blocks",method:"GET"};return n(t,{},e)};t.exports=o},{"../request":34}],52:[function(e,t,r){"use strict";var n=e("../request").multipart,o=function(e,t,r){var o={path:"/codemanager/v1/blocks/"+e+"/versions",method:"POST",files:[]};return t.forEach(function(e,t,r){var n={value:e.value,options:{filename:e.filename,contentType:e.contentType}};o.files.push(n)}),n(o,t,r)};t.exports=o},{"../request":34}]},{},[1]);
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