diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index b64887a8..39f5e1b9 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -74,6 +74,7 @@ const __createOutgoingFeed = async (withPublicKey, user, SEA) => { const newOutgoingFeedID = await new Promise((res, rej) => { const _outFeedNode = user .get(Key.OUTGOINGS) + //@ts-ignore .set(newPartialOutgoingFeed, ack => { if (ack.err && typeof ack.err !== 'number') { rej(new Error(ack.err)) @@ -98,6 +99,7 @@ const __createOutgoingFeed = async (withPublicKey, user, SEA) => { .get(Key.OUTGOINGS) .get(newOutgoingFeedID) .get(Key.MESSAGES) + //@ts-ignore .set(initialMsg, ack => { if (ack.err && typeof ack.err !== 'number') { rej(new Error(ack.err)) @@ -591,6 +593,7 @@ const sendHandshakeRequest = async (recipientPublicKey, gun, user, SEA) => { const hr = gun .get(Key.HANDSHAKE_NODES) .get(currentHandshakeAddress) + //@ts-ignore .set(handshakeRequestData, ack => { if (ack.err && typeof ack.err !== 'number') { rej(new Error(`Error trying to create request: ${ack.err}`)) @@ -627,6 +630,7 @@ const sendHandshakeRequest = async (recipientPublicKey, gun, user, SEA) => { } await new Promise((res, rej) => { + //@ts-ignore user.get(Key.STORED_REQS).set(storedReq, ack => { if (ack.err && typeof ack.err !== 'number') { rej( @@ -959,6 +963,7 @@ const sendSpontaneousPayment = async (to, amount, memo, feeLimit) => { .getGun() .get(Key.ORDER_NODES) .get(currOrderAddress) + //@ts-ignore .set(order, ack => { if (ack.err && typeof ack.err !== 'number') { rej( diff --git a/services/gunDB/contact-api/getters/feed.js b/services/gunDB/contact-api/getters/feed.js index 22e160a7..ba4704ce 100644 --- a/services/gunDB/contact-api/getters/feed.js +++ b/services/gunDB/contact-api/getters/feed.js @@ -1,6 +1,7 @@ /** * @format */ +//@ts-ignore const Common = require('shock-common') const isFinite = require('lodash/isFinite') const shuffle = require('lodash/shuffle') @@ -29,8 +30,9 @@ const calculateWallRequest = (numberOfPublicKeyGroups, pageRequested) => { * @param {number} page * @throws {TypeError} * @throws {RangeError} - * @returns {Promise} + * @returns {Promise} */ +//@returns {Promise} const getFeedPage = async page => { if (!isFinite(page)) { throw new TypeError(`Please provide an actual number for [page]`) diff --git a/services/gunDB/contact-api/getters/index.js b/services/gunDB/contact-api/getters/index.js index 4472ed41..c8811e45 100644 --- a/services/gunDB/contact-api/getters/index.js +++ b/services/gunDB/contact-api/getters/index.js @@ -47,8 +47,9 @@ exports.userToIncomingID = async pub => { } /** - * @returns {Promise} + * @returns {Promise} */ +//@returns {Promise} const getMyUser = async () => { const oldProfile = await Utils.tryAndWait( (_, user) => new Promise(res => user.get(Key.PROFILE).load(res)), @@ -85,7 +86,7 @@ const getMyUser = async () => { (_, user) => Promise.resolve(user.is && user.is.pub), v => typeof v !== 'string' ) - + //@ts-ignore /** @type {Common.SchemaTypes.User} */ const u = { avatar: oldProfile.avatar, diff --git a/services/gunDB/contact-api/getters/user.js b/services/gunDB/contact-api/getters/user.js index 52d04e72..f560d65c 100644 --- a/services/gunDB/contact-api/getters/user.js +++ b/services/gunDB/contact-api/getters/user.js @@ -9,8 +9,9 @@ const Utils = require('../utils') /** * @param {string} publicKey - * @returns {Promise} + * @returns {Promise} */ +//@returns {Promise} const getAnUser = async publicKey => { const oldProfile = await Utils.tryAndWait( (g, u) => { @@ -47,7 +48,7 @@ const getAnUser = async publicKey => { }, v => typeof v !== 'number' ) - + //@ts-ignore /** @type {Common.SchemaTypes.User} */ const u = { avatar: oldProfile.avatar || null, @@ -68,8 +69,9 @@ const getAnUser = async publicKey => { module.exports.getAnUser = getAnUser /** - * @returns {Promise} + * @returns {Promise} */ +//@returns {Promise} const getMyUser = async () => { const oldProfile = await Utils.tryAndWait( (_, user) => new Promise(res => user.get(Key.PROFILE).load(res)), @@ -106,7 +108,7 @@ const getMyUser = async () => { (_, user) => Promise.resolve(user.is && user.is.pub), v => typeof v !== 'string' ) - + //@ts-ignore /** @type {Common.SchemaTypes.User} */ const u = { avatar: oldProfile.avatar, diff --git a/services/gunDB/contact-api/getters/wall.js b/services/gunDB/contact-api/getters/wall.js index 879ec97b..96c7fd70 100644 --- a/services/gunDB/contact-api/getters/wall.js +++ b/services/gunDB/contact-api/getters/wall.js @@ -43,8 +43,9 @@ const getWallTotalPages = async publicKey => { * @param {string=} publicKey * @throws {TypeError} * @throws {RangeError} - * @returns {Promise} + * @returns {Promise} */ +////@returns {Promise} const getWallPage = async (page, publicKey) => { const totalPages = await getWallTotalPages(publicKey) @@ -103,9 +104,10 @@ const getWallPage = async (page, publicKey) => { */ const mockUser = await User.getMyUser() - /** + /* * @type {Common.SchemaTypes.WallPage} */ + //@ts-ignore const thePage = await Utils.tryAndWait( (g, u) => { /** diff --git a/services/gunDB/contact-api/jobs/onOrders.js b/services/gunDB/contact-api/jobs/onOrders.js index 840526f2..b7c3e43b 100644 --- a/services/gunDB/contact-api/jobs/onOrders.js +++ b/services/gunDB/contact-api/jobs/onOrders.js @@ -154,6 +154,7 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { getUser() .get(Key.ORDER_TO_RESPONSE) .get(orderID) + //@ts-ignore .put(orderResponse, ack => { if (ack.err && typeof ack.err !== 'number') { rej( @@ -183,6 +184,7 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => { getUser() .get(Key.ORDER_TO_RESPONSE) .get(orderID) + //@ts-ignore .put(orderResponse, ack => { if (ack.err && typeof ack.err !== 'number') { logger.error( diff --git a/services/gunDB/contact-api/streams/index.js b/services/gunDB/contact-api/streams/index.js index a76fecbf..d4fab683 100644 --- a/services/gunDB/contact-api/streams/index.js +++ b/services/gunDB/contact-api/streams/index.js @@ -151,6 +151,7 @@ const onStoredReqs = cb => { .get(Key.STORED_REQS) .open(d => { if (typeof d === 'object' && d !== null) { + //@ts-ignore encryptedStoredReqs = /** @type {StoredRequest[]} */ (Object.values( d ).filter(i => Schema.isStoredRequest(i))) diff --git a/services/gunDB/contact-api/streams/pubToFeed.js b/services/gunDB/contact-api/streams/pubToFeed.js index f6f96cc4..f140aaea 100644 --- a/services/gunDB/contact-api/streams/pubToFeed.js +++ b/services/gunDB/contact-api/streams/pubToFeed.js @@ -98,7 +98,7 @@ const onOpenForPubFeedPair = ([pub, feed]) => }) return } - + //@ts-ignore const incoming = /** @type {import('shock-common').Schema.Outgoing} */ (data) // incomplete data, let's not assume anything