more package updates

This commit is contained in:
keyan 2023-07-24 19:50:55 -05:00
parent e87610c45b
commit dae9c64e96
7 changed files with 1722 additions and 1990 deletions

View File

@ -7,7 +7,6 @@ const LIMIT = 5
export default function Related ({ title, itemId }) {
const variables = { title, id: itemId, limit: LIMIT }
return (
<AccordianItem
header={<div className='fw-bold'>related</div>}

View File

@ -1,6 +1,6 @@
import { NextSeo } from 'next-seo'
import { useRouter } from 'next/router'
import RemoveMarkdown from 'remove-markdown'
import removeMd from 'remove-markdown'
export function SeoSearch ({ sub }) {
const router = useRouter()
@ -50,7 +50,7 @@ export default function Seo ({ sub, item, user }) {
}
// at least for now subs (ie the only one is jobs) will always have text
if (item.text) {
desc = RemoveMarkdown(item.text)
desc = removeMd(item.text)
if (desc) {
desc = desc.replace(/\s+/g, ' ')
}

3655
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
"@apollo/server": "^4.8.1",
"@as-integrations/next": "^2.0.1",
"@graphql-tools/schema": "^10.0.0",
"@noble/secp256k1": "^1.7.1",
"@noble/curves": "^1.1.0",
"@opensearch-project/opensearch": "^2.3.1",
"@prisma/client": "^2.30.3",
"@synonymdev/slashtags-auth": "^1.0.0-alpha.5",
@ -29,23 +29,22 @@
"browserslist": "^4.21.4",
"canonical-json": "0.0.4",
"clipboard-copy": "^4.0.1",
"cross-fetch": "^3.1.8",
"cross-fetch": "^4.0.0",
"domino": "^2.1.6",
"eslint-config-next": "^13.4.12",
"formik": "^2.4.2",
"github-slugger": "^1.5.0",
"github-slugger": "^2.0.0",
"graphql": "^16.7.1",
"graphql-tag": "^2.12.6",
"graphql-type-json": "^0.3.2",
"ln-service": "^56.9.0",
"mathjs": "^11.9.1",
"mdast-util-find-and-replace": "^1.1.1",
"mdast-util-from-markdown": "^1.3.1",
"mdast-util-to-string": "^3.2.0",
"mdast-util-find-and-replace": "^3.0.0",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-to-string": "^4.0.0",
"next": "^13.4.12",
"next-auth": "^3.29.10",
"next-plausible": "^3.10.1",
"next-seo": "^4.29.0",
"next-seo": "^6.1.0",
"nextjs-progressbar": "0.0.16",
"node-s3-url-encode": "^0.0.4",
"nostr": "^0.2.8",
@ -62,20 +61,19 @@
"react-dom": "^18.2.0",
"react-longpressable": "^1.1.1",
"react-markdown": "^8.0.7",
"react-string-replace": "^0.4.4",
"react-string-replace": "^1.1.1",
"react-syntax-highlighter": "^15.5.0",
"react-textarea-autosize": "^8.5.2",
"react-twitter-embed": "^4.0.4",
"react-youtube": "^7.14.0",
"react-youtube": "^10.1.0",
"recharts": "^2.7.2",
"remark-directive": "^2.0.1",
"remark-gfm": "^3.0.1",
"remove-markdown": "^0.3.0",
"remove-markdown": "^0.5.0",
"sass": "^1.64.1",
"secp256k1": "^4.0.3",
"tldts": "^5.7.112",
"tldts": "^6.0.12",
"typescript": "^5.1.6",
"unist-util-visit": "^4.1.2",
"unist-util-visit": "^5.0.0",
"url-unshort": "^6.1.0",
"web-push": "^3.6.2",
"webln": "^0.3.2",
@ -93,21 +91,15 @@
},
"standard": {
"parser": "@babel/eslint-parser",
"plugins": [
"eslint-plugin-compat"
],
"extends": [
"plugin:compat/recommended"
],
"env": {
"browser": true
}
"next"
]
},
"devDependencies": {
"@babel/core": "^7.22.9",
"@babel/eslint-parser": "^7.22.9",
"@next/eslint-plugin-next": "^13.4.12",
"eslint": "^8.45.0",
"eslint-plugin-compat": "^4.1.4",
"standard": "^17.1.0"
}
}

View File

@ -1,7 +1,7 @@
// verify it's signed
// store pubkey in db
// create user with pubkey and name truncated pubkey
import secp256k1 from 'secp256k1'
import { secp256k1 } from '@noble/curves/secp256k1'
import models from '../../api/models'
const HOUR = 1000 * 60 * 60
@ -11,8 +11,7 @@ export default async ({ query }, res) => {
const sig = Buffer.from(query.sig, 'hex')
const k1 = Buffer.from(query.k1, 'hex')
const key = Buffer.from(query.key, 'hex')
const signature = secp256k1.signatureImport(sig)
if (secp256k1.ecdsaVerify(signature, k1, key)) {
if (secp256k1.verify(signature, k1, key)) {
const auth = await models.lnAuth.findUnique({ where: { k1: query.k1 } })
if (!auth || auth.pubkey || auth.createdAt < Date.now() - HOUR) {
return res.status(400).json({ status: 'ERROR', reason: 'token expired' })

View File

@ -3,7 +3,7 @@ import lnd from '../../../../api/lnd'
import { createInvoice } from 'ln-service'
import { lnurlPayDescriptionHashForUser } from '../../../../lib/lnurl'
import serialize from '../../../../api/resolvers/serial'
import * as secp256k1 from '@noble/secp256k1'
import { schnorr } from '@noble/curves/secp256k1';
import { createHash } from 'crypto'
export default async ({ query: { username, amount, nostr } }, res) => {
@ -19,8 +19,7 @@ export default async ({ query: { username, amount, nostr } }, res) => {
const note = JSON.parse(noteStr)
const hasPTag = note.tags?.filter(t => t[0] === 'p').length >= 1
const hasETag = note.tags?.filter(t => t[0] === 'e').length <= 1
if (await secp256k1.schnorr.verify(note.sig, note.id, note.pubkey) &&
hasPTag && hasETag) {
if (schnorr.verify(note.sig, note.id, note.pubkey) && hasPTag && hasETag) {
description = user.hideInvoiceDesc ? undefined : 'zap'
descriptionHash = createHash('sha256').update(noteStr).digest('hex')
} else {

View File

@ -1,5 +1,6 @@
const { gql } = require('graphql-tag')
const search = require('../api/search')
const removeMd = require('remove-markdown')
const ITEM_SEARCH_FIELDS = gql`
fragment ItemSearchFields on Item {
@ -50,6 +51,9 @@ async function _indexItem (item) {
if (!item.sub?.name && item.root?.subName) {
itemcp.sub = { name: item.root.subName }
}
if (item.text) {
itemcp.text = removeMd(item.text)
}
try {
await search.index({