Comparing version 2.1.5 to 2.1.6
@@ -6,18 +6,5 @@ 'use strict'; | ||
var Client = syncLib.Client; | ||
var Download = require('download'); | ||
var path = require('path'); | ||
var _ = require('lodash'); | ||
var fs = require('fs'); | ||
var Q = require('q'); | ||
var URL = require('url'); | ||
var $28 = (function() { | ||
var toPath = function(ns) { | ||
var url = URL.parse(ns); | ||
var segments = url.hostname.split('.').reverse(); | ||
segments = segments.concat(url.path.split('/').slice(1)); | ||
return segments.join('/') + '.jq'; | ||
}; | ||
function $28(apiEndpoint){ | ||
@@ -58,51 +45,2 @@ this.api = require('28.io-nodejs').$28(apiEndpoint); | ||
$28.prototype.install = function(){ | ||
var defered = Q.defer(); | ||
var manifest = JSON.parse(fs.readFileSync('28.json', 'utf-8')); | ||
var root = path.dirname(path.resolve('28.json')) + '/'; | ||
_.forEach(manifest.dependencies, function(hash, path){ | ||
var href = _.template('https://github.com/<%= path %>/archive/<%= hash %>.zip')({ | ||
path: path, | ||
hash: hash | ||
}); | ||
console.log('Installing ' + path + '#' + hash + '...'); | ||
var name = path.split('/')[1]; | ||
var output = root + 'jsoniq_modules/'; | ||
var base = output + name + '-' + hash; | ||
new Download({ mode: '755', extract: true }) | ||
.get(href) | ||
.dest(output) | ||
.run(function(){ | ||
var manifest = JSON.parse(fs.readFileSync(base + '/28.json', 'utf-8')); | ||
manifest.exports.forEach(function(ns){ | ||
var path = toPath(ns); | ||
fs.createReadStream(base + '/queries/modules/' + path) | ||
.pipe(fs.createWriteStream('queries/modules/' + path)).on('finish', function(){ | ||
defered.resolve(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
return defered.promise; | ||
}; | ||
$28.prototype.uninstall = function(){ | ||
var defered = Q.defer(); | ||
var manifest = JSON.parse(fs.readFileSync('28.json', 'utf-8')); | ||
var root = path.dirname(path.resolve('28.json')) + '/'; | ||
_.forEach(manifest.dependencies, function(hash, path){ | ||
console.log('Uninstalling ' + path + '#' + hash + '...'); | ||
var name = path.split('/')[1]; | ||
var output = root + 'jsoniq_modules/'; | ||
var base = output + name + '-' + hash; | ||
var manifest = JSON.parse(fs.readFileSync(base + '/28.json', 'utf-8')); | ||
manifest.exports.forEach(function(ns){ | ||
var path = toPath(ns); | ||
fs.unlinkSync('queries/modules/' + path); | ||
}); | ||
defered.resolve(); | ||
}); | ||
return defered.promise; | ||
}; | ||
$28.prototype.refreshTokens = function(email, token){ | ||
@@ -109,0 +47,0 @@ return this.api.Auth.authenticate({ |
@@ -16,3 +16,2 @@ 'use strict'; | ||
require('./commands/run'); | ||
require('./commands/install'); | ||
@@ -19,0 +18,0 @@ cli.command('projects', 'Project management'); |
@@ -9,3 +9,3 @@ { | ||
"description": "Command line utility to download and upload 28.io queries.", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"keywords": [ | ||
@@ -32,3 +32,2 @@ "jsoniq", | ||
"commander": "^2.7.1", | ||
"download": "^4.1.2", | ||
"final-fs": "~1.6.0", | ||
@@ -35,0 +34,0 @@ "lodash": "3.7.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14
5
184287
34
1253
- Removeddownload@^4.1.2
- Removedansi-gray@0.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedansi-wrap@0.1.0(transitive)
- Removedarchive-type@3.2.0(transitive)
- Removedarr-diff@2.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarray-differ@1.0.0(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedarray-unique@0.2.1(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbeeper@1.1.1(transitive)
- Removedbl@1.2.3(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@1.8.5(transitive)
- Removedbuffer-alloc@1.2.0(transitive)
- Removedbuffer-alloc-unsafe@1.1.0(transitive)
- Removedbuffer-crc32@0.2.13(transitive)
- Removedbuffer-fill@1.0.0(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedbuffer-to-vinyl@1.1.0(transitive)
- Removedcapture-stack-trace@1.0.2(transitive)
- Removedcaw@1.2.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedclone@0.2.01.0.4(transitive)
- Removedclone-stats@0.0.1(transitive)
- Removedco@3.1.0(transitive)
- Removedcolor-support@1.1.3(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removedcreate-error-class@3.0.2(transitive)
- Removeddateformat@2.2.0(transitive)
- Removeddecompress@3.0.0(transitive)
- Removeddecompress-tar@3.1.0(transitive)
- Removeddecompress-tarbz2@3.1.0(transitive)
- Removeddecompress-targz@3.1.0(transitive)
- Removeddecompress-unzip@3.4.0(transitive)
- Removeddownload@4.4.3(transitive)
- Removedduplexer2@0.0.20.1.4(transitive)
- Removedeach-async@1.1.1(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedexpand-brackets@0.1.5(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextend-shallow@2.0.1(transitive)
- Removedextglob@0.3.2(transitive)
- Removedfancy-log@1.3.3(transitive)
- Removedfd-slicer@1.1.0(transitive)
- Removedfile-type@3.9.0(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfilename-reserved-regex@1.0.0(transitive)
- Removedfilenamify@1.2.1(transitive)
- Removedfill-range@2.2.4(transitive)
- Removedfirst-chunk-stream@1.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedfs-constants@1.0.0(transitive)
- Removedget-proxy@1.1.0(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedglob@5.0.15(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.03.1.0(transitive)
- Removedglob-stream@5.3.5(transitive)
- Removedglogg@1.0.2(transitive)
- Removedgot@5.7.1(transitive)
- Removedgulp-decompress@1.2.0(transitive)
- Removedgulp-rename@1.4.0(transitive)
- Removedgulp-sourcemaps@1.6.0(transitive)
- Removedgulp-util@3.0.8(transitive)
- Removedgulplog@1.0.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-gulplog@0.1.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedis-absolute@0.1.7(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-bzip2@1.0.0(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extendable@0.1.1(transitive)
- Removedis-extglob@1.0.02.1.1(transitive)
- Removedis-glob@2.0.13.1.0(transitive)
- Removedis-gzip@1.0.0(transitive)
- Removedis-natural-number@2.1.1(transitive)
- Removedis-number@2.1.04.0.0(transitive)
- Removedis-obj@1.0.1(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedis-relative@0.1.3(transitive)
- Removedis-retry-allowed@1.2.0(transitive)
- Removedis-tar@1.0.0(transitive)
- Removedis-url@1.2.4(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedis-valid-glob@0.3.0(transitive)
- Removedis-zip@1.0.0(transitive)
- Removedisarray@0.0.1(transitive)
- Removedisobject@2.1.0(transitive)
- Removedjson-stable-stringify-without-jsonify@1.0.1(transitive)
- Removedkind-of@3.2.26.0.3(transitive)
- Removedlazystream@1.0.1(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._basetostring@3.0.1(transitive)
- Removedlodash._basevalues@3.0.0(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._reescape@3.0.0(transitive)
- Removedlodash._reevaluate@3.0.0(transitive)
- Removedlodash._reinterpolate@3.0.0(transitive)
- Removedlodash._root@3.0.1(transitive)
- Removedlodash.escape@3.2.0(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.isequal@4.5.0(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.template@3.6.2(transitive)
- Removedlodash.templatesettings@3.1.1(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmerge-stream@1.0.1(transitive)
- Removedmicromatch@2.3.11(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedmultipipe@0.1.2(transitive)
- Removednode-status-codes@1.0.0(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedonetime@1.1.0(transitive)
- Removedordered-read-streams@0.3.0(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedparse-node-version@1.0.1(transitive)
- Removedpath-dirname@1.0.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpend@1.2.0(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedreadable-stream@1.0.341.1.143.6.2(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedreplace-ext@0.0.1(transitive)
- Removedseek-bzip@1.0.6(transitive)
- Removedset-immediate-shim@1.0.1(transitive)
- Removedsparkles@1.0.1(transitive)
- Removedstat-mode@0.2.2(transitive)
- Removedstream-combiner2@1.1.1(transitive)
- Removedstring_decoder@0.10.311.3.0(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedstrip-bom-stream@1.0.0(transitive)
- Removedstrip-dirs@1.1.1(transitive)
- Removedstrip-outer@1.0.1(transitive)
- Removedsum-up@1.0.3(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedtar-stream@1.6.2(transitive)
- Removedthrough2@0.6.52.0.54.0.2(transitive)
- Removedthrough2-filter@2.0.03.1.0(transitive)
- Removedtime-stamp@1.1.0(transitive)
- Removedtimed-out@3.1.3(transitive)
- Removedto-absolute-glob@0.1.1(transitive)
- Removedto-buffer@1.1.1(transitive)
- Removedtrim-repeated@1.0.0(transitive)
- Removedtypedarray@0.0.6(transitive)
- Removedunique-stream@2.3.1(transitive)
- Removedunzip-response@1.0.2(transitive)
- Removedurl-parse-lax@1.0.0(transitive)
- Removedvali-date@1.0.0(transitive)
- Removedvinyl@0.4.60.5.31.2.0(transitive)
- Removedvinyl-assign@1.2.1(transitive)
- Removedvinyl-fs@2.4.4(transitive)
- Removedware@1.3.0(transitive)
- Removedwrap-fn@0.1.5(transitive)
- Removedxtend@4.0.2(transitive)
- Removedyauzl@2.10.0(transitive)