Upgraded shock-common
This commit is contained in:
parent
f9e1404ea4
commit
b5317db2da
3 changed files with 26 additions and 19 deletions
|
|
@ -48,7 +48,7 @@
|
||||||
"request-promise": "^4.2.2",
|
"request-promise": "^4.2.2",
|
||||||
"response-time": "^2.3.2",
|
"response-time": "^2.3.2",
|
||||||
"shelljs": "^0.8.2",
|
"shelljs": "^0.8.2",
|
||||||
"shock-common": "6.0.0",
|
"shock-common": "11.0.0",
|
||||||
"socket.io": "2.1.1",
|
"socket.io": "2.1.1",
|
||||||
"text-encoding": "^0.7.0",
|
"text-encoding": "^0.7.0",
|
||||||
"tingodb": "^0.6.1",
|
"tingodb": "^0.6.1",
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,15 @@ const ordersProcessed = new Set()
|
||||||
* @prop {Buffer} r_hash
|
* @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 = ''
|
let currentOrderAddr = ''
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -227,23 +236,21 @@ const listenerForAddr = (addr, SEA) => async (order, orderID) => {
|
||||||
const hash = invoice.r_hash.toString('base64')
|
const hash = invoice.r_hash.toString('base64')
|
||||||
|
|
||||||
if (order.targetType === 'post') {
|
if (order.targetType === 'post') {
|
||||||
getUser()
|
/** @type {TipPaymentStatus} */
|
||||||
.get(Key.TIPS_PAYMENT_STATUS)
|
const paymentStatus = {
|
||||||
.get(hash)
|
|
||||||
.put(
|
|
||||||
{
|
|
||||||
hash,
|
hash,
|
||||||
state: 'OPEN',
|
state: 'OPEN',
|
||||||
targetType: order.targetType,
|
targetType: order.targetType,
|
||||||
// @ts-ignore
|
|
||||||
postID: order.postID,
|
postID: order.postID,
|
||||||
// @ts-ignore
|
|
||||||
postPage: order.postPage
|
postPage: order.postPage
|
||||||
},
|
|
||||||
response => {
|
|
||||||
console.log(response)
|
|
||||||
}
|
}
|
||||||
)
|
getUser()
|
||||||
|
.get(Key.TIPS_PAYMENT_STATUS)
|
||||||
|
.get(hash)
|
||||||
|
// @ts-ignore
|
||||||
|
.put(paymentStatus, response => {
|
||||||
|
console.log(response)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
|
||||||
|
|
@ -6016,10 +6016,10 @@ shellwords@^0.1.1:
|
||||||
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
|
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
|
||||||
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
|
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
|
||||||
|
|
||||||
shock-common@6.0.0:
|
shock-common@11.0.0:
|
||||||
version "6.0.0"
|
version "11.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/shock-common/-/shock-common-6.0.0.tgz#77701dabb344830046b85ece0103de21775197b9"
|
resolved "https://registry.yarnpkg.com/shock-common/-/shock-common-11.0.0.tgz#7bac5b614df2a62f29ec9ba116bb0f49d4dc8894"
|
||||||
integrity sha512-kbSkLTtWTK8qVcbW6uViWtar3otW2S5oJIMO/1twPs6Iuv9ATF0QviDtUiU1YN/Y4bX/SXAMm/jRZ3OJ3PLyUA==
|
integrity sha512-0ie3WY5Fovqh6k/oIc1z3ia4r9COhpH0LsF1BXNy2n9MAwnk5zkXG7K0qSppPsBXZ0aN8RFXvvmTXssRTrXcSA==
|
||||||
dependencies:
|
dependencies:
|
||||||
immer "^6.0.6"
|
immer "^6.0.6"
|
||||||
lodash "^4.17.19"
|
lodash "^4.17.19"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue