mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
shut heroku up
This commit is contained in:
parent
027d98c944
commit
f6ca116445
2
gun.min.js
vendored
2
gun.min.js
vendored
File diff suppressed because one or more lines are too long
37
package-lock.json
generated
37
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gun",
|
||||
"version": "0.9.998",
|
||||
"version": "0.9.999",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -81,7 +81,6 @@
|
||||
"version": "2.238.1",
|
||||
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.238.1.tgz",
|
||||
"integrity": "sha1-o1/ewSLtkV2kkIQOiCgzbaW+Tn8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer": "4.9.1",
|
||||
"events": "1.1.1",
|
||||
@ -116,8 +115,7 @@
|
||||
"base64-js": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
|
||||
"integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw=="
|
||||
},
|
||||
"base64id": {
|
||||
"version": "1.0.0",
|
||||
@ -202,7 +200,6 @@
|
||||
"version": "4.9.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
|
||||
"integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4",
|
||||
@ -474,8 +471,7 @@
|
||||
"events": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
|
||||
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=",
|
||||
"dev": true
|
||||
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ="
|
||||
},
|
||||
"express": {
|
||||
"version": "4.16.3",
|
||||
@ -653,8 +649,7 @@
|
||||
"ieee754": {
|
||||
"version": "1.1.8",
|
||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz",
|
||||
"integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=",
|
||||
"dev": true
|
||||
"integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q="
|
||||
},
|
||||
"indexof": {
|
||||
"version": "0.0.1",
|
||||
@ -699,14 +694,12 @@
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
||||
"dev": true
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"jmespath": {
|
||||
"version": "0.15.0",
|
||||
"resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",
|
||||
"integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=",
|
||||
"dev": true
|
||||
"integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc="
|
||||
},
|
||||
"json3": {
|
||||
"version": "3.3.2",
|
||||
@ -717,8 +710,7 @@
|
||||
"lodash": {
|
||||
"version": "4.17.10",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
|
||||
},
|
||||
"media-typer": {
|
||||
"version": "0.3.0",
|
||||
@ -989,8 +981,7 @@
|
||||
"punycode": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
|
||||
"integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=",
|
||||
"dev": true
|
||||
"integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.5.1",
|
||||
@ -1001,8 +992,7 @@
|
||||
"querystring": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
|
||||
"integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=",
|
||||
"dev": true
|
||||
"integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA="
|
||||
},
|
||||
"range-parser": {
|
||||
"version": "1.2.0",
|
||||
@ -1051,8 +1041,7 @@
|
||||
"sax": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz",
|
||||
"integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=",
|
||||
"dev": true
|
||||
"integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o="
|
||||
},
|
||||
"send": {
|
||||
"version": "0.16.2",
|
||||
@ -1300,7 +1289,6 @@
|
||||
"version": "0.10.3",
|
||||
"resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz",
|
||||
"integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"punycode": "1.3.2",
|
||||
"querystring": "0.2.0"
|
||||
@ -1315,8 +1303,7 @@
|
||||
"uuid": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz",
|
||||
"integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g=="
|
||||
},
|
||||
"vary": {
|
||||
"version": "1.1.2",
|
||||
@ -1348,7 +1335,6 @@
|
||||
"version": "0.4.17",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.17.tgz",
|
||||
"integrity": "sha1-F76T6q4/O3eTWceVtBlwWogX6Gg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "^4.1.0"
|
||||
@ -1358,7 +1344,6 @@
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-4.2.1.tgz",
|
||||
"integrity": "sha1-qlijBBoGb5DqoWwvU4n/GfP0YaU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lodash": "^4.0.0"
|
||||
}
|
||||
|
@ -48,7 +48,8 @@
|
||||
"node": ">=0.8.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"ws": "~>5.2.0"
|
||||
"ws": "~>5.2.0",
|
||||
"aws-sdk": ">=2.153.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@trust/webcrypto": "^0.7.1",
|
||||
|
20
src/put.js
20
src/put.js
@ -7,7 +7,7 @@ Gun.chain.put = function(data, cb, as){
|
||||
var gun = this, at = (gun._), root = at.root.gun, tmp;
|
||||
as = as || {};
|
||||
as.data = data;
|
||||
as.gun = as.gun || gun;
|
||||
as.via = as.gun = as.via || as.gun || gun;
|
||||
if(typeof cb === 'string'){
|
||||
as.soul = cb;
|
||||
} else {
|
||||
@ -22,9 +22,9 @@ Gun.chain.put = function(data, cb, as){
|
||||
if(as.res){ as.res() }
|
||||
return gun;
|
||||
}
|
||||
as.soul = as.soul || (as.not = Gun.node.soul(as.data) || ((root._).opt.uuid || Gun.text.random)());
|
||||
as.soul = as.soul || (as.not = Gun.node.soul(as.data) || (as.via.back('opt.uuid') || Gun.text.random)());
|
||||
if(!as.soul){ // polyfill async uuid for SEA
|
||||
(root._).opt.uuid(function(err, soul){ // TODO: improve perf without anonymous callback
|
||||
as.via.back('opt.uuid')(function(err, soul){ // TODO: improve perf without anonymous callback
|
||||
if(err){ return Gun.log(err) } // TODO: Handle error!
|
||||
(as.ref||as.gun).put(as.data, as.soul = soul, as);
|
||||
});
|
||||
@ -126,10 +126,10 @@ function map(v,k,n, at){ var as = this;
|
||||
ref = ref.get(path[i]);
|
||||
}
|
||||
if(Gun.node.soul(at.obj)){
|
||||
var id = Gun.node.soul(at.obj) || (ref.back('opt.uuid') || Gun.text.random)();
|
||||
var id = Gun.node.soul(at.obj) || (as.via.back('opt.uuid') || Gun.text.random)();
|
||||
if(!id){ // polyfill async uuid for SEA
|
||||
(as.stun = as.stun || {})[path] = true; // make DRY
|
||||
ref.back('opt.uuid')(function(err, id){ // TODO: improve perf without anonymous callback
|
||||
as.via.back('opt.uuid')(function(err, id){ // TODO: improve perf without anonymous callback
|
||||
if(err){ return Gun.log(err) } // TODO: Handle error.
|
||||
ref.back(-1).get(id);
|
||||
at.soul(id);
|
||||
@ -154,9 +154,9 @@ function soul(msg, ev){ var as = this.as, cat = as.at; as = as.as;
|
||||
var _id = (msg.put||empty)['#'];
|
||||
ev.off();
|
||||
at = (msg.gun._.back); // go up 1!
|
||||
var id = id || Gun.node.soul(cat.obj) || Gun.node.soul(at.put) || Gun.val.rel.is(at.put) || _id || at_._id || (as.gun.back('opt.uuid') || Gun.text.random)(); // TODO: BUG!? Do we really want the soul of the object given to us? Could that be dangerous?
|
||||
var id = id || Gun.node.soul(cat.obj) || Gun.node.soul(at.put) || Gun.val.rel.is(at.put) || _id || at_._id || (as.via.back('opt.uuid') || Gun.text.random)(); // TODO: BUG!? Do we really want the soul of the object given to us? Could that be dangerous?
|
||||
if(!id){ // polyfill async uuid for SEA
|
||||
at.gun.back('opt.uuid')(function(err, id){ // TODO: improve perf without anonymous callback
|
||||
at.via.back('opt.uuid')(function(err, id){ // TODO: improve perf without anonymous callback
|
||||
if(err){ return Gun.log(err) } // TODO: Handle error.
|
||||
solve(at, at_._id = at_._id || id, cat, as);
|
||||
});
|
||||
@ -206,16 +206,16 @@ function any(at, ev){
|
||||
}
|
||||
if(!as.not && !(as.soul = Gun.node.soul(data))){
|
||||
if(as.path && obj_is(as.data)){ // Apparently necessary
|
||||
as.soul = (opt.uuid || cat.root.opt.uuid || Gun.text.random)();
|
||||
as.soul = (opt.uuid || as.via.back('opt.uuid') || Gun.text.random)();
|
||||
} else {
|
||||
//as.data = obj_put({}, as.gun._.get, as.data);
|
||||
if(node_ == at.get){
|
||||
as.soul = (at.put||empty)['#'] || at._id;
|
||||
}
|
||||
as.soul = as.soul || at.soul || cat.soul || (opt.uuid || cat.root.opt.uuid || Gun.text.random)();
|
||||
as.soul = as.soul || at.soul || cat.soul || (opt.uuid || as.via.back('opt.uuid') || Gun.text.random)();
|
||||
}
|
||||
if(!as.soul){ // polyfill async uuid for SEA
|
||||
as.ref.back('opt.uuid')(function(err, soul){ // TODO: improve perf without anonymous callback
|
||||
as.via.back('opt.uuid')(function(err, soul){ // TODO: improve perf without anonymous callback
|
||||
if(err){ return Gun.log(err) } // Handle error.
|
||||
as.ref.put(as.data, as.soul = soul, as);
|
||||
});
|
||||
|
@ -6,11 +6,11 @@ Gun.chain.set = function(item, cb, opt){
|
||||
opt = opt || {}; opt.item = opt.item || item;
|
||||
if(soul = Gun.node.soul(item)){ return gun.set(gun.back(-1).get(soul), cb, opt) }
|
||||
if(!Gun.is(item)){
|
||||
var id = gun._.root.opt.uuid();
|
||||
var id = gun.back('opt.uuid')();
|
||||
if(id && Gun.obj.is(item)){
|
||||
return gun.set(gun._.root.gun.put(item, id), cb, opt);
|
||||
}
|
||||
return gun.get(id || (Gun.state.lex() + Gun.text.random(12))).put(item, cb, opt);
|
||||
return gun.get((Gun.state.lex() + Gun.text.random(7))).put(item, cb, opt);
|
||||
}
|
||||
item.get('_').get(function(at, ev){
|
||||
if(!at.gun || !at.gun._.back){ return }
|
||||
|
Loading…
x
Reference in New Issue
Block a user