Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update gun to 0.2019.930 #271

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"elliptic": "^6.4.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-react-hooks": "^2.0.1",
"gun": "0.2019.422",
"gun": "0.2019.930",
"husky": "^3.0.5",
"idb": "^4.0.3",
"json-stable-stringify": "^1.0.1",
Expand Down Expand Up @@ -112,8 +112,16 @@
"yargs": "^14.0.0"
},
"browserslist": {
"production": [">0.2%", "not dead", "not op_mini all"],
"development": ["last 1 chrome version", "last 1 firefox version", "last 1 safari version"]
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"husky": {
"hooks": {
Expand All @@ -122,6 +130,9 @@
}
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": ["node scripts/lint.js", "git add"]
"*.{ts,tsx,js,jsx}": [
"node scripts/lint.js",
"git add"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export async function getSharedListOfPost(
nameInDB.forEach(x => ids.add(x.toText()))
if (version === -40) {
// eslint-disable-next-line import/no-deprecated
const post = await Gun1.gun1
.get('posts')
.get(postSalt)
.once().then!()
const post = await Gun1.gun1.get('posts').get(postSalt).then!()
if (!post) return []
delete post._
const nameInGun = Object.keys(post)
Expand Down
5 changes: 1 addition & 4 deletions src/network/gun/version.1/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ import { gun1 } from '.'

/** @deprecated */
export async function queryPersonFromGun(username: string) {
return gun1
.get('users')
.get(username)
.once().then!()
return gun1.get('users').get(username).then!()
}
3 changes: 1 addition & 2 deletions src/network/gun/version.1/posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export async function queryPostAESKey(salt: string, myUsername: string) {
const result = await gun1
.get('posts')
.get(salt)
.get(myUsername)
.once().then!()
.get(myUsername).then!()
if (result && result.encryptedKey && result.salt) return result
return undefined
}
Expand Down
2 changes: 1 addition & 1 deletion src/network/gun/version.2/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { hashPersonIdentifier } from './hash'
* @param user Identifier
*/
export async function queryPersonFromGun2(user: PersonIdentifier): Promise<PersonOnGun2> {
const result = await gun2.get(await hashPersonIdentifier(user)).once().then!()
const result = await gun2.get(await hashPersonIdentifier(user)).then!()
return result || {}
}

Expand Down
5 changes: 2 additions & 3 deletions src/network/gun/version.2/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ export async function queryPostKeysOnGun2(
(await gun2
.get(postHash)
// @ts-ignore
.get(keyHash)
.once().then!()) || {}
.get(keyHash).then!()) || {}
// ? In this step we get something like ["jzarhbyjtexiE7aB1DvQ", "jzarhuse6xlTAtblKRx9"]
const internalKeys = Object.keys(internalNodes).filter(x => x !== '_')
// ? In this step we get all keys in this category (gun2[postHash][keyHash])
const resultPromise = internalKeys.map(key => gun2.get(key).once().then!())
const resultPromise = internalKeys.map(key => gun2.get(key).then!())
const result = (await Promise.all(resultPromise)) as SharedAESKeyGun2[]
console.info(`await gun2[${postHash}][${keyHash}]\n`, result)
return { keys: result, keyHash, postHash }
Expand Down
108 changes: 89 additions & 19 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,33 @@
"@nodelib/fs.scandir" "2.1.2"
fastq "^1.6.0"

"@peculiar/asn1-schema@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-1.0.3.tgz#e55ff9e98a1cf31832629aabacf85be3edf13a48"
integrity sha512-Tfgj9eNJ6cTKEtEuidKenLHMx/Q5M8KEE9hnohHqvdpqHJXWYr5RlT3GjAHPjGXy5+mr7sSfuXfzE6aAkEGN7A==
dependencies:
asn1js "^2.0.22"
tslib "^1.9.3"

"@peculiar/json-schema@^1.1.5":
version "1.1.5"
resolved "https://registry.yarnpkg.com/@peculiar/json-schema/-/json-schema-1.1.5.tgz#376e0e978d2bd7132487a5679ab375a34313e73f"
integrity sha512-y5XYA3pf9+c+YKVpWnPtQbNmlNCs2ehNHyMLJvq4K5Fjwc1N64YGy7MNecKW3uYLga+sqbGTQSUdOdlnaRRbpA==
dependencies:
tslib "^1.9.3"

"@peculiar/webcrypto@^1.0.19":
version "1.0.21"
resolved "https://registry.yarnpkg.com/@peculiar/webcrypto/-/webcrypto-1.0.21.tgz#d38eb883bf966b247954afc259054c3fa2a10c98"
integrity sha512-dMQe+vTKSKDpiizQj5q7lFqU56zBgavrjcST4d8RMxEbmgoUOuAUOXlkI5DoqVy3ktcfAhk6CRV4YkaSUEXdAg==
dependencies:
"@peculiar/asn1-schema" "^1.0.3"
"@peculiar/json-schema" "^1.1.5"
asn1js "^2.0.26"
pvtsutils "^1.0.6"
tslib "^1.10.0"
webcrypto-core "^1.0.14"

"@reach/router@^1.2.1":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@reach/router/-/router-1.2.1.tgz#34ae3541a5ac44fa7796e5506a5d7274a162be4e"
Expand Down Expand Up @@ -2999,6 +3026,11 @@ address@1.1.2, address@^1.0.1:
resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6"
integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==

addressparser@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-0.3.2.tgz#59873f35e8fcf6c7361c10239261d76e15348bb2"
integrity sha1-WYc/Nej89sc2HBAjkmHXbhU0i7I=

adjust-sourcemap-loader@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/adjust-sourcemap-loader/-/adjust-sourcemap-loader-2.0.0.tgz#6471143af75ec02334b219f54bc7970c52fb29a4"
Expand Down Expand Up @@ -3455,6 +3487,13 @@ asn1@~0.2.3:
dependencies:
safer-buffer "~2.1.0"

asn1js@^2.0.22, asn1js@^2.0.26:
version "2.0.26"
resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-2.0.26.tgz#0a6d435000f556a96c6012969d9704d981b71251"
integrity sha512-yG89F0j9B4B0MKIcFyWWxnpZPLaNTjCj4tkE3fjbAoo0qmpGw0PYYqSbX/4ebnd9Icn8ZgK4K1fvDyEtW1JYtQ==
dependencies:
pvutils latest

assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
Expand Down Expand Up @@ -6404,6 +6443,28 @@ email-validator@^2.0.4:
resolved "https://registry.yarnpkg.com/email-validator/-/email-validator-2.0.4.tgz#b8dfaa5d0dae28f1b03c95881d904d4e40bfe7ed"
integrity sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ==

emailjs-base64@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/emailjs-base64/-/emailjs-base64-1.1.4.tgz#392fa38cb6aa35dccd3af3637ffc14c1c7ce9612"
integrity sha512-4h0xp1jgVTnIQBHxSJWXWanNnmuc5o+k4aHEpcLXSToN8asjB5qbXAexs7+PEsUKcEyBteNYsSvXUndYT2CGGA==

emailjs-mime-codec@^2.0.7:
version "2.0.9"
resolved "https://registry.yarnpkg.com/emailjs-mime-codec/-/emailjs-mime-codec-2.0.9.tgz#d184451b6f2e55c5868b0f0a82d18fe2b82f0c97"
integrity sha512-7qJo4pFGcKlWh/kCeNjmcgj34YoJWY0ekZXEHYtluWg4MVBnXqGM4CRMtZQkfYwitOhUgaKN5EQktJddi/YIDQ==
dependencies:
emailjs-base64 "^1.1.4"
ramda "^0.26.1"
text-encoding "^0.7.0"

emailjs@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/emailjs/-/emailjs-2.2.0.tgz#ba5b23e4a4b0a4510f652e873b154e9407b6ca03"
integrity sha1-ulsj5KSwpFEPZS6HOxVOlAe2ygM=
dependencies:
addressparser "^0.3.2"
emailjs-mime-codec "^2.0.7"

emoji-regex@^7.0.1, emoji-regex@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
Expand Down Expand Up @@ -8220,14 +8281,15 @@ gud@^1.0.0:
resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0"
integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==

gun@0.2019.422:
version "0.2019.422"
resolved "https://registry.yarnpkg.com/gun/-/gun-0.2019.422.tgz#c20bf7fc063baca29e6958f0cc3f4bbb6ea80dd2"
integrity sha512-/eErT7bTr3k/5NgreCcNQsCqGdsYI3EHKaX3CYZ7whRFkQIMSJ/CYVcV6omhA1V+0lGRKRibuHBhMMGnVBCQpg==
gun@0.2019.930:
version "0.2019.930"
resolved "https://registry.yarnpkg.com/gun/-/gun-0.2019.930.tgz#9251c064d4408958626af3707f7ce0623e0c19b0"
integrity sha512-JZunmIcZqwq9MgrMHBRVAB7HbgNWUnwnHSJZPq0QCCbJwJ4rRctBcBWZF3BgS3AGpOUM9S+ecSQDacQHYJkujg==
dependencies:
ws "~>6.2.1"
ws "~>7.1.0"
optionalDependencies:
node-webcrypto-ossl "^1.0.43"
"@peculiar/webcrypto" "^1.0.19"
emailjs "^2.2.0"
text-encoding "^0.7.0"

gzip-size@5.1.1:
Expand Down Expand Up @@ -11604,16 +11666,6 @@ node-releases@^1.1.29:
dependencies:
semver "^5.3.0"

node-webcrypto-ossl@^1.0.43:
version "1.0.48"
resolved "https://registry.yarnpkg.com/node-webcrypto-ossl/-/node-webcrypto-ossl-1.0.48.tgz#640e9547f8ae1d0becc8374a65e1d0e11ab385ea"
integrity sha512-MWUkQ/5wrs7lpAr+fhsLMfjdxKGd3dQFVqWbNMkyYyCMRW8E7ScailqtCZYDLTnJtU6B+91rXxCJNyZvbYaSOg==
dependencies:
mkdirp "^0.5.1"
nan "^2.13.2"
tslib "^1.9.3"
webcrypto-core "^0.1.26"

nomnom@1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/nomnom/-/nomnom-1.8.1.tgz#2151f722472ba79e50a76fc125bb8c8f2e4dc2a7"
Expand Down Expand Up @@ -13547,14 +13599,19 @@ punycode@^2.1.0, punycode@^2.1.1:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==

pvtsutils@^1.0.4:
pvtsutils@^1.0.4, pvtsutils@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/pvtsutils/-/pvtsutils-1.0.6.tgz#e3883fd77abdd4c124131f6a49f3914cd9f21290"
integrity sha512-0yNrOdJyLE7FZzmeEHTKanwBr5XbmDAd020cKa4ZiTYuGMBYBZmq7vHOhcOqhVllh6gghDBbaz1lnVdOqiB7cw==
dependencies:
"@types/node" "^10.14.17"
tslib "^1.10.0"

pvutils@latest:
version "1.0.17"
resolved "https://registry.yarnpkg.com/pvutils/-/pvutils-1.0.17.tgz#ade3c74dfe7178944fe44806626bd2e249d996bf"
integrity sha512-wLHYUQxWaXVQvKnwIDWFVKDJku9XDCvyhhxoq8dc5MFdIlRenyPI9eSfEtcvgHgD7FlvCyGAlWgOzRnZD99GZQ==

q@^1.1.2, q@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
Expand Down Expand Up @@ -13635,6 +13692,11 @@ ramda@^0.21.0:
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.21.0.tgz#a001abedb3ff61077d4ff1d577d44de77e8d0a35"
integrity sha1-oAGr7bP/YQd9T/HVd9RN536NCjU=

ramda@^0.26.1:
version "0.26.1"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06"
integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==

randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5:
version "2.1.0"
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
Expand Down Expand Up @@ -17182,6 +17244,14 @@ webcrypto-core@^0.1.26:
dependencies:
tslib "^1.7.1"

webcrypto-core@^1.0.14:
version "1.0.14"
resolved "https://registry.yarnpkg.com/webcrypto-core/-/webcrypto-core-1.0.14.tgz#c015088fbc9c235ebd8b35047a131c5ff58f7152"
integrity sha512-iGZQcH/o3Jv6mpvCbzan6uAcUcLTTnUCil6RVYakcNh5/QXIKRRC06EFxHru9lHgVKucZy3gG4OBiup0IsOr0g==
dependencies:
pvtsutils "^1.0.4"
tslib "^1.10.0"

webcrypto-liner@0.1.38:
version "0.1.38"
resolved "https://registry.yarnpkg.com/webcrypto-liner/-/webcrypto-liner-0.1.38.tgz#be8ecac8ad70ec8fd832d31411ca62d24f4a2d7d"
Expand Down Expand Up @@ -17677,14 +17747,14 @@ ws@^5.2.0:
dependencies:
async-limiter "~1.0.0"

ws@^6.1.2, ws@~>6.2.1:
ws@^6.1.2:
version "6.2.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb"
integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==
dependencies:
async-limiter "~1.0.0"

ws@^7:
ws@^7, ws@~>7.1.0:
version "7.1.2"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.1.2.tgz#c672d1629de8bb27a9699eb599be47aeeedd8f73"
integrity sha512-gftXq3XI81cJCgkUiAVixA0raD9IVmXqsylCrjRygw4+UOOGzPoxnQ6r/CnVL9i+mDncJo94tSkyrtuuQVBmrg==
Expand Down