Upgraded shock-common

This commit is contained in:
emad-salah 2020-10-03 18:20:21 +01:00
parent f9e1404ea4
commit b5317db2da
3 changed files with 26 additions and 19 deletions

View file

@ -48,7 +48,7 @@
"request-promise": "^4.2.2",
"response-time": "^2.3.2",
"shelljs": "^0.8.2",
"shock-common": "6.0.0",
"shock-common": "11.0.0",
"socket.io": "2.1.1",
"text-encoding": "^0.7.0",
"tingodb": "^0.6.1",

View file

@ -45,6 +45,15 @@ const ordersProcessed = new Set()
* @prop {Buffer} r_hash
*/
/**
* @typedef {object} TipPaymentStatus
* @prop {string} hash
* @prop {import('shock-common').Schema.InvoiceState} state
* @prop {string} targetType
* @prop {(string)=} postID
* @prop {(number)=} postPage
*/
let currentOrderAddr = ''
/**
@ -227,23 +236,21 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => {
const hash = invoice.r_hash.toString('base64')
if (order.targetType === 'post') {
/** @type {TipPaymentStatus} */
const paymentStatus = {
hash,
state: 'OPEN',
targetType: order.targetType,
postID: order.postID,
postPage: order.postPage
}
getUser()
.get(Key.TIPS_PAYMENT_STATUS)
.get(hash)
.put(
{
hash,
state: 'OPEN',
targetType: order.targetType,
// @ts-ignore
postID: order.postID,
// @ts-ignore
postPage: order.postPage
},
response => {
console.log(response)
}
)
// @ts-ignore
.put(paymentStatus, response => {
console.log(response)
})
}
} catch (err) {
logger.error(

View file

@ -6016,10 +6016,10 @@ shellwords@^0.1.1:
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
shock-common@6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/shock-common/-/shock-common-6.0.0.tgz#77701dabb344830046b85ece0103de21775197b9"
integrity sha512-kbSkLTtWTK8qVcbW6uViWtar3otW2S5oJIMO/1twPs6Iuv9ATF0QviDtUiU1YN/Y4bX/SXAMm/jRZ3OJ3PLyUA==
shock-common@11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/shock-common/-/shock-common-11.0.0.tgz#7bac5b614df2a62f29ec9ba116bb0f49d4dc8894"
integrity sha512-0ie3WY5Fovqh6k/oIc1z3ia4r9COhpH0LsF1BXNy2n9MAwnk5zkXG7K0qSppPsBXZ0aN8RFXvvmTXssRTrXcSA==
dependencies:
immer "^6.0.6"
lodash "^4.17.19"