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

orientdb-js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orientdb-js - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

4

build/orientdb-js.min.js

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

/*! orientdb-js 2013-08-27 */
!function(a){"use strict";function b(a){return!!this.idRegex&&c(a)&&this.idRegex.test(a)}function c(a){return"[object String]"===s.call(a)}function d(a){return c(a)&&t.test(a)}function e(a){return"[object Object]"===s.call(a)}function f(a){return"[object Number]"===s.call(a)}function g(a){return c(a)&&u.test(a)}function h(a){return"[object Array]"===s.call(a)}function i(a,b){return a.replace(/<([^<>]*)>/g,function(a,d){var g=b[d];return e(g)?JSON.stringify(g):h(g)?g.join(","):c(g)||f(g)?g:a})}function j(a,b){var c=a.match(/<([^<>]*)>/g),d=c.length,f=a.match(/\[([^\[\]]*)\]/g);return function(){var g,h,j=this,k=arguments.length,l=0,m=0,n={},o=!1,q=p();if(1==k&&e(arguments[0])){for(m=0;d>m;m++)if(g=c[m].slice(1,-1),g in arguments[0]&&arguments[0].hasOwnProperty(g)){o=!0;break}o?n=arguments[0]:n[b.parameters[0]]=arguments[0]}else for(l=0;k>l;l++)n[b.parameters[l]]=arguments[l];h=i(a,n),b&&"defaults"in b&&(h=i(h,b.defaults));for(var l=f.length-1;l>=0;l--)h=h.replace(f[l],"");return h=h.replace(/\[|\]/g,""),q.call(j,h)}}function k(a,b){return function(){var c,d=this,e=h(arguments[0])?arguments[0]:arguments,f="";if(c=b?new v(d.OPTS,"/command/"):d._buildREST(d.params),"idx"==a&&e.length>1){for(var g in e[1])f=g+":",f+=l.call(d,e[1][g]);f="[["+f+"]]",e.length=1}return c.params+="."+a+q.call(d,e),c.params+=f,c}}function l(a){return e(a)&&a.hasOwnProperty("params")&&d(a.params)?a.params.toString():d(a)?a.toString():b.call(this,a)||isNaN(parseFloat(a))?"'"+a+"'":isNaN(parseFloat(a))?a:a.toString()}function m(){return function(a){var b=this._buildREST(this.params);return b.params+="["+a.toString()+"]",b}}function n(a){return function(){var b=this,c=b._buildREST(b.params),d=d(arguments[0]),e=d?arguments[0].length:arguments.length;c.params+="."+a+"(";for(var f=0;e>f;f++)c.params+=d?arguments[0][f].params||l.call(b,arguments[0][f]):arguments[f].params||l.call(b,arguments[f]),c.params+=",";return c.params=c.params.slice(0,-1),c.params+=")",c}}function o(a){return function(){var b=this._buildREST(this.params);b.params+="."+a+"([";for(var c=0,d=arguments[0].length;d>c;c++)b.params+=arguments[0][c].params,b.params+=",";return b.params=b.params.slice(0,-1),b.params+="])",b}}function p(){return function(){var a,b=arguments[0];return a=new v(this.OPTS,"/command/","/sql"),a.params=b,a}}function q(a){for(var b="",c="",f="",h=0,i=a.length;i>h;h++)g(a[h])?c+=a[h]:!e(a[h])||a[h].hasOwnProperty("params")&&d(a[h].params)?b+=l.call(this,a[h])+",":(f=JSON.stringify(a[h]),f=f.replace("{","["),b+=f.replace("}","]")+",");return b=b.slice(0,-1),"("+b+")"+c}var r=a.Q||{},s=Object.prototype.toString;Array.prototype.push;var t=/^T\.(gt|gte|eq|neq|lte|lt|incr|decr)$|^g\.|^Vertex(?=\.class\b)|^Edge(?=\.class\b)/,u=/^\{.*\}$/,v=function(){function b(a,b,e){f=this,"sid"in a&&(this.sid=a.sid),this.cmdUrl=b||"/command/",this.cmdTypeUrl=e||"/gremlin",this.OPTS=a,this.httpStr=a.ssl?"https://":"http://",this.params="g",this.ajax=function(a,b,e,f){var g,h,i=r.defer(),j="";e=e||{},f=f||{};try{g=d()}catch(k){return i.reject(-1),i.promise}h=c(e),"GET"===a&&h&&(b+=h,h=null),g.open(a,b,!0);for(var l in f)f.hasOwnProperty(l)&&g.setRequestHeader(l,f[l]);return g.onreadystatechange=function(){4===g.readyState&&(g.status>=200&&g.status<300?(j=g.responseText.length?JSON.parse(g.responseText):{status:g.status,statusText:g.statusText},i.resolve(j)):i.reject(g))},g.send(h),i.promise}}function c(a){var b="";if("string"==typeof a)b=a;else{var c=encodeURIComponent;for(var d in a)a.hasOwnProperty(d)&&(b+="&"+c(d)+"="+c(a[d]))}return b}function d(){var a;if(window.XMLHttpRequest)a=new XMLHttpRequest;else if("undefined"!=typeof XDomainRequest)a=new XDomainRequest;else if(window.ActiveXObject)try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){a=new ActiveXObject("Microsoft.XMLHTTP")}return a}function e(b,c){var d=b+":"+c,e=a.btoa(d);return"Basic "+e}var f,g=function(){return function(a,b){var c,d=this.cmdUrl+this.OPTS.database,e=this.params;return this.ajax.call(this,"POST",d+this.cmdTypeUrl,e,c).then(a,b)}},h=function(){return function(){return r.fcall(function(){var a=f.httpStr+f.OPTS.host+":"+f.OPTS.port+f.cmdUrl+f.OPTS.database,b=e(f.OPTS.user,f.OPTS.password),c={Authorization:b};return f.ajax("GET",a,null,c)})}};return b.prototype={_buildREST:function(a){return this.params=a,this},both:k("both"),bothE:k("bothE"),bothV:k("bothV"),cap:k("cap"),gather:k("gather"),id:k("id"),"in":k("in"),inE:k("inE"),inV:k("inV"),property:k("property"),label:k("label"),map:k("map"),memoize:k("memoize"),order:k("order"),orderMap:k("orderMap"),out:k("out"),outE:k("outE"),outV:k("outV"),path:k("path"),scatter:k("scatter"),select:k("select"),transform:k("transform"),index:m(),range:m(),and:n("and"),back:k("back"),dedup:k("dedup"),except:o("except"),filter:k("filter"),has:k("has"),hasNot:k("hasNot"),interval:k("interval"),or:n("or"),random:k("random"),retain:o("retain"),simplePath:k("simplePath"),as:k("as"),groupBy:k("groupBy"),groupCount:k("groupCount"),optional:k("optional"),sideEffect:k("sideEffect"),linkBoth:k("linkBoth"),linkIn:k("linkIn"),linkOut:k("linkOut"),copySplit:n("copySplit"),exhaustMerge:k("exhaustMerge"),fairMerge:k("fairMerge"),ifThenElse:k("ifThenElse"),loop:k("loop"),count:k("count"),iterate:k("iterate"),next:k("next"),toList:k("toList"),put:n("put"),getPropertyKeys:k("getPropertyKeys"),setProperty:k("setProperty"),getProperty:k("getProperty"),then:g(),authenticate:h()},b}(),w=function(){function a(a){var b=this;this.idRegex=/^[0-9]+:[0-9]+$/,this.sid="",this.OPTS={ssl:!1,host:"localhost",port:2480,database:"tinkergraph"},a&&this.setOptions(a),this._=k("_",!0),this.E=k("E",!0),this.V=k("V",!0),this.sql=p(),this.e=k("e",!0),this.idx=k("idx",!0),this.v=k("v",!0),this.createIndex=k("createIndex",!0),this.createKeyIndex=k("createKeyIndex",!0),this.getIndices=k("getIndices",!0),this.getIndexedKeys=k("getIndexedKeys",!0),this.getIndex=k("getIndex",!0),this.dropIndex=k("dropIndex",!0),this.dropKeyIndex=k("dropKeyIndex",!0),this.clear=k("clear",!0),this.shutdown=k("shutdown",!0),this.getFeatures=k("getFeatures",!0),this.addVertex=j("CREATE VERTEX [<class>] [CLUSTER <cluster>] [CONTENT <content>]",{parameters:["content"]}),this.addEdge=j("CREATE EDGE <class> [CLUSTER <cluster>] FROM <from> TO <to> [CONTENT <content>]",{defaults:{"class":"E"},parameters:["from","to","content"]}),this.connect=function(){var a=new v(this.OPTS,"/connect/");return a.authenticate().then(function(a){if(204===a.status)return"sid"in a&&b.setOptions({sid:a.sid}),b;throw{message:"Problem establishing connect to database.",response:a}})}}return a.prototype.setOptions=function(a){if(a)for(var b in a)a.hasOwnProperty(b)&&(this.OPTS[b]=a[b])},a}(),x=function(a){var b=new w(a);return b.connect()};"function"==typeof define&&"object"==typeof define.amd&&define.amd?define({connect:x}):"undefined"!=typeof module&&"undefined"!=typeof module.exports?(exports.REST=v.prototype,exports.connect=x):a.OrientDB={connect:x}}(this);
/*! orientdb-js 2013-10-02 */
!function(a){"use strict";function b(a){return!!this.idRegex&&c(a)&&this.idRegex.test(a)}function c(a){return"[object String]"===s.call(a)}function d(a){return c(a)&&t.test(a)}function e(a){return"[object Object]"===s.call(a)}function f(a){return"[object Number]"===s.call(a)}function g(a){return c(a)&&u.test(a)}function h(a){return"[object Array]"===s.call(a)}function i(a,b){return a.replace(/<([^<>]*)>/g,function(a,d){var g=b[d];return e(g)?JSON.stringify(g):h(g)?g.join(","):c(g)||f(g)?g:a})}function j(a,b){var c=a.match(/<([^<>]*)>/g),d=c.length,f=a.match(/\[([^\[\]]*)\]/g);return function(){var g,h,j=this,k=arguments.length,l=0,m=0,n={},o=!1,q=p();if(1==k&&e(arguments[0])){for(m=0;d>m;m++)if(g=c[m].slice(1,-1),g in arguments[0]&&arguments[0].hasOwnProperty(g)){o=!0;break}o?n=arguments[0]:n[b.parameters[0]]=arguments[0]}else for(l=0;k>l;l++)n[b.parameters[l]]=arguments[l];h=i(a,n),b&&"defaults"in b&&(h=i(h,b.defaults));for(var r=f.length-1;r>=0;r--)h=h.replace(f[r],"");return h=h.replace(/\[|\]/g,""),q.call(j,h)}}function k(a,b){return function(){var c,d=this,e=h(arguments[0])?arguments[0]:arguments,f="";if(c=b?new z(d.OPTS,"/command/"):d._buildREST(d.params),"idx"==a&&e.length>1){for(var g in e[1])f=g+":",f+=l.call(d,e[1][g]);f="[["+f+"]]",e.length=1}return c.params+="."+a+q.call(d,e),c.params+=f,c}}function l(a){return e(a)&&a.hasOwnProperty("params")&&d(a.params)?a.params.toString():d(a)?a.toString():b.call(this,a)||isNaN(parseFloat(a))?"'"+a+"'":isNaN(parseFloat(a))?a:a.toString()}function m(){return function(a){var b=this._buildREST(this.params);return b.params+="["+a.toString()+"]",b}}function n(a){return function(){var b=this,c=b._buildREST(b.params),d=d(arguments[0]),e=d?arguments[0].length:arguments.length;c.params+="."+a+"(";for(var f=0;e>f;f++)c.params+=d?arguments[0][f].params||l.call(b,arguments[0][f]):arguments[f].params||l.call(b,arguments[f]),c.params+=",";return c.params=c.params.slice(0,-1),c.params+=")",c}}function o(a){return function(){var b=this._buildREST(this.params);b.params+="."+a+"([";for(var c=0,d=arguments[0].length;d>c;c++)b.params+=arguments[0][c].params,b.params+=",";return b.params=b.params.slice(0,-1),b.params+="])",b}}function p(){return function(){var a,b=arguments[0];return a=new z(this.OPTS,"/command/","/sql"),a.params=b,a}}function q(a){for(var b="",c="",f="",h=0,i=a.length;i>h;h++)g(a[h])?c+=a[h]:!e(a[h])||a[h].hasOwnProperty("params")&&d(a[h].params)?b+=l.call(this,a[h])+",":(f=JSON.stringify(a[h]),f=f.replace("{","["),b+=f.replace("}","]")+",");return b=b.slice(0,-1),"("+b+")"+c}var r=a.Q||{},s=Object.prototype.toString;Array.prototype.push;var t=/^T\.(gt|gte|eq|neq|lte|lt|incr|decr|in|notin)$|^g\.|^Vertex(?=\.class\b)|^Edge(?=\.class\b)/,u=/^\{.*\}$/,v={gt:"T.gt",gte:"T.gte",eq:"T.eq",neq:"T.neq",lte:"T.lte",lt:"T.lt",decr:"T.decr",incr:"T.incr",notin:"T.notin","in":"T.in"},w={IN:"Contains.IN",NOT_IN:"Contains.NOT_IN"},x={"class":"Vertex.class"},y={"class":"Edge.class"},z=function(){function b(a,b,e){f=this,"sid"in a&&(this.sid=a.sid),this.cmdUrl=b||"/command/",this.cmdTypeUrl=e||"/gremlin",this.OPTS=a,this.httpStr=a.ssl?"https://":"http://",this.params="g",this.ajax=function(a,b,e,f){var g,h,i=r.defer(),j="";e=e||{},f=f||{};try{g=d()}catch(k){return i.reject(-1),i.promise}h=c(e),"GET"===a&&h&&(b+=h,h=null),g.open(a,b,!0);for(var l in f)f.hasOwnProperty(l)&&g.setRequestHeader(l,f[l]);return g.onreadystatechange=function(){4===g.readyState&&(g.status>=200&&g.status<300?(j=g.responseText.length?JSON.parse(g.responseText):{status:g.status,statusText:g.statusText},i.resolve(j)):i.reject(g))},g.send(h),i.promise}}function c(a){var b="";if("string"==typeof a)b=a;else{var c=encodeURIComponent;for(var d in a)a.hasOwnProperty(d)&&(b+="&"+c(d)+"="+c(a[d]))}return b}function d(){var a;if(window.XMLHttpRequest)a=new XMLHttpRequest;else if("undefined"!=typeof XDomainRequest)a=new XDomainRequest;else if(window.ActiveXObject)try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){a=new ActiveXObject("Microsoft.XMLHTTP")}return a}function e(b,c){var d=b+":"+c,e=a.btoa(d);return"Basic "+e}var f,g=function(){return function(a,b){var c,d=this.cmdUrl+this.OPTS.database,e=this.params;return this.ajax.call(this,"POST",d+this.cmdTypeUrl,e,c).then(a,b)}},h=function(){return function(){return r.fcall(function(){var a=f.httpStr+f.OPTS.host+":"+f.OPTS.port+f.cmdUrl+f.OPTS.database,b=e(f.OPTS.user,f.OPTS.password),c={Authorization:b};return f.ajax("GET",a,null,c)})}};return b.prototype={_buildREST:function(a){return this.params=a,this},_:k("_"),both:k("both"),bothE:k("bothE"),bothV:k("bothV"),cap:k("cap"),gather:k("gather"),id:k("id"),"in":k("in"),inE:k("inE"),inV:k("inV"),property:k("property"),label:k("label"),map:k("map"),memoize:k("memoize"),order:k("order"),orderMap:k("orderMap"),out:k("out"),outE:k("outE"),outV:k("outV"),path:k("path"),scatter:k("scatter"),select:k("select"),transform:k("transform"),index:m(),range:m(),and:n("and"),back:k("back"),dedup:k("dedup"),except:o("except"),filter:k("filter"),has:k("has"),hasNot:k("hasNot"),interval:k("interval"),or:n("or"),random:k("random"),retain:o("retain"),simplePath:k("simplePath"),as:k("as"),groupBy:k("groupBy"),groupCount:k("groupCount"),optional:k("optional"),sideEffect:k("sideEffect"),linkBoth:k("linkBoth"),linkIn:k("linkIn"),linkOut:k("linkOut"),copySplit:n("copySplit"),exhaustMerge:k("exhaustMerge"),fairMerge:k("fairMerge"),ifThenElse:k("ifThenElse"),loop:k("loop"),count:k("count"),iterate:k("iterate"),next:k("next"),toList:k("toList"),put:n("put"),getPropertyKeys:k("getPropertyKeys"),setProperty:k("setProperty"),getProperty:k("getProperty"),then:g(),authenticate:h()},b}(),A=function(){function a(a){var b=this;this.idRegex=/^[0-9]+:[0-9]+$/,this.sid="",this.OPTS={ssl:!1,host:"localhost",port:2480,database:"tinkergraph"},a&&this.setOptions(a),this._=k("_",!0),this.E=k("E",!0),this.V=k("V",!0),this.sql=p(),this.e=k("e",!0),this.idx=k("idx",!0),this.v=k("v",!0),this.createIndex=k("createIndex",!0),this.createKeyIndex=k("createKeyIndex",!0),this.getIndices=k("getIndices",!0),this.getIndexedKeys=k("getIndexedKeys",!0),this.getIndex=k("getIndex",!0),this.dropIndex=k("dropIndex",!0),this.dropKeyIndex=k("dropKeyIndex",!0),this.clear=k("clear",!0),this.shutdown=k("shutdown",!0),this.getFeatures=k("getFeatures",!0),this.addVertex=j("CREATE VERTEX [<class>] [CLUSTER <cluster>] [CONTENT <content>]",{parameters:["content"]}),this.addEdge=j("CREATE EDGE <class> [CLUSTER <cluster>] FROM <from> TO <to> [CONTENT <content>]",{defaults:{"class":"E"},parameters:["from","to","content"]}),this.connect=function(){var a=new z(this.OPTS,"/connect/");return a.authenticate().then(function(a){if(204===a.status)return"sid"in a&&b.setOptions({sid:a.sid}),b;throw{message:"Problem establishing connect to database.",response:a}})}}return a.prototype.setOptions=function(a){if(a)for(var b in a)a.hasOwnProperty(b)&&(this.OPTS[b]=a[b])},a}(),B=function(a){var b=new A(a);return b.connect()};"function"==typeof define&&"object"==typeof define.amd&&define.amd?define({connect:B}):"undefined"!=typeof module&&"undefined"!=typeof module.exports?(exports.REST=z.prototype,exports.connect=B,exports.T=v,exports.Contains=w,exports.Vertex=x,exports.Edge=y):a.OrientDB={connect:B,T:v,Contains:w,Vertex:x,Edge:y}}(this);

@@ -42,4 +42,4 @@ module.exports = function(grunt){

// Default task(s).
grunt.registerTask('default', ['jshint', 'grunt-mocha-test', 'uglify']);
grunt.registerTask('default', ['jshint', 'uglify']);
}
{
"name": "orientdb-js",
"description": "Javascript driver for OrientDB with a Blueprints/Gremlin like syntax.",
"version": "0.1.2",
"version": "0.1.3",
"keywords": [

@@ -6,0 +6,0 @@ "database",

orientdb-js
===========
New Javascript driver for OrientDB with a Blueprints/Gremlin like syntax
New Javascript driver for OrientDB with a Blueprints/Gremlin like syntax. This library is in Alpha status.

@@ -32,3 +32,3 @@ ;(function(global) {

return !!this.idRegex && isString(id) && this.idRegex.test(id);
};
}

@@ -69,9 +69,9 @@ function isString(o) {

return r;
};
}
return a;
}
);
};
}
function qryCommand(template, config){
function createCommand(template, config){
var vals = template.match(/<([^<>]*)>/g),

@@ -101,3 +101,3 @@ valLen = vals.length,

}
};
}

@@ -114,3 +114,3 @@ if(isDescriptor){

args[config.parameters[i]] = arguments[i];
};
}
}

@@ -122,8 +122,8 @@ temp = supplant(template, args);

for (var i = optionalVals.length - 1; i >= 0; i--) {
temp = temp.replace(optionalVals[i], "");
};
for (var m = optionalVals.length - 1; m >= 0; m--) {
temp = temp.replace(optionalVals[m], "");
}
temp = temp.replace(/\[|\]/g, "");
return sqlCmd.call(self, temp);
}
};
}

@@ -375,2 +375,3 @@

/*** Transform ***/
_: qryMain('_'),
both: qryMain('both'),

@@ -502,3 +503,3 @@ bothE: qryMain('bothE'),

//CUD
this.addVertex = qryCommand("CREATE VERTEX [<class>] [CLUSTER <cluster>] [CONTENT <content>]",
this.addVertex = createCommand("CREATE VERTEX [<class>] [CLUSTER <cluster>] [CONTENT <content>]",
{ parameters:['content']

@@ -508,4 +509,4 @@ });

this.addEdge = qryCommand("CREATE EDGE <class> [CLUSTER <cluster>] FROM <from> TO <to> [CONTENT <content>]"
,{ defaults:{ class: 'E' },
this.addEdge = createCommand("CREATE EDGE <class> [CLUSTER <cluster>] FROM <from> TO <to> [CONTENT <content>]",
{ defaults:{ class: 'E' },
parameters:['from','to','content']

@@ -512,0 +513,0 @@ });

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