Skip to content

Commit

Permalink
chore: bump @dcl/eslint-config from 1.1.13 to 2.0.0 (#265)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Mariano Goldman <[email protected]>
  • Loading branch information
dependabot[bot] and Mariano Goldman authored Feb 8, 2024
1 parent 059a0ac commit 16f906f
Show file tree
Hide file tree
Showing 6 changed files with 1,215 additions and 1,534 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@
"start:db": "docker-compose up -d && docker exec world_content_server_db bash -c \"until pg_isready; do sleep 1; done\" && sleep 5"
},
"dependencies": {
"@aws-sdk/client-sns": "^3.431.0",
"@dcl/catalyst-api-specs": "^3.2.4",
"@aws-sdk/client-sns": "^3.501.0",
"@dcl/catalyst-api-specs": "^3.2.5",
"@dcl/catalyst-contracts": "^4.3.1",
"@dcl/catalyst-storage": "^4.1.0",
"@dcl/crypto": "^3.4.5",
"@dcl/hashing": "^3.0.4",
"@dcl/platform-crypto-middleware": "^1.0.2",
"@dcl/platform-server-commons": "^0.0.4",
"@dcl/schemas": "^9.11.1",
"@dcl/schemas": "^9.12.0",
"@ensdomains/eth-ens-namehash": "^2.0.15",
"@types/busboy": "^1.5.0",
"@types/busboy": "^1.5.3",
"@well-known-components/env-config-provider": "^1.2.0",
"@well-known-components/http-server": "^2.0.0",
"@well-known-components/interfaces": "^1.4.2",
"@well-known-components/logger": "^3.1.3",
"@well-known-components/metrics": "^2.0.1",
"@well-known-components/pg-component": "^0.2.2",
"@well-known-components/thegraph-component": "^1.6.0",
"aws-sdk": "^2.1427.0",
"aws-sdk": "^2.1545.0",
"bcrypt": "^5.1.1",
"busboy": "^1.6.0",
"cron": "^2.4.4",
"eth-connect": "^6.2.0",
"livekit-server-sdk": "^1.2.5",
"lru-cache": "^7.18.3",
"cron": "^3.1.6",
"eth-connect": "^6.2.4",
"livekit-server-sdk": "^1.2.7",
"lru-cache": "^10.2.0",
"p-queue": "^6.6.2"
},
"devDependencies": {
"@dcl/eslint-config": "^1.1.13",
"@types/bcrypt": "^5.0.0",
"@types/node": "^18.16.19",
"@dcl/eslint-config": "^2.0.0",
"@types/bcrypt": "^5.0.2",
"@types/node": "^20.11.10",
"@well-known-components/test-helpers": "^1.5.5",
"dcl-catalyst-client": "^21.5.5",
"typescript": "^4.9.5"
"typescript": "^5.3.3"
},
"prettier": {
"printWidth": 120,
Expand Down
4 changes: 2 additions & 2 deletions src/adapters/comms-adapter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AppComponents, CommsStatus, ICommsAdapter, WorldStatus } from '../types'
import { AccessToken, TrackSource } from 'livekit-server-sdk'
import { EthAddress } from '@dcl/schemas'
import LRU from 'lru-cache'
import { LRUCache } from 'lru-cache'

function chunk<T>(theArray: T[], size: number): T[][] {
return theArray.reduce((acc: T[][], _, i) => {
Expand Down Expand Up @@ -184,7 +184,7 @@ function cachingAdapter({ logs }: Pick<AppComponents, 'logs'>, wrappedAdapter: I
const logger = logs.getLogger('caching-comms-adapter')

const CACHE_KEY = 'comms_status'
const cache = new LRU<string, CommsStatus>({
const cache = new LRUCache<string, CommsStatus>({
max: 1,
ttl: 60 * 1000, // cache for 1 minute
fetchMethod: async (_, staleValue): Promise<CommsStatus | undefined> => {
Expand Down
4 changes: 2 additions & 2 deletions src/adapters/limits-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppComponents, ILimitsManager, MB_BigInt, Whitelist } from '../types'
import LRU from 'lru-cache'
import { LRUCache } from 'lru-cache'

const bigIntMax = (...args: bigint[]) => args.reduce((m, e) => (e > m ? e : m))

Expand All @@ -18,7 +18,7 @@ export async function createLimitsManagerComponent({
const whitelistUrl = await config.requireString('WHITELIST_URL')

const CONFIG_KEY = 'config'
const cache = new LRU<any, Whitelist>({
const cache = new LRUCache<any, Whitelist>({
max: 1,
ttl: 10 * 60 * 1000, // cache for 10 minutes
fetchMethod: async (_, staleValue): Promise<Whitelist> => {
Expand Down
6 changes: 3 additions & 3 deletions src/adapters/name-deny-list-checker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppComponents, INameDenyListChecker } from '../types'
import LRU from 'lru-cache'
import { LRUCache } from 'lru-cache'

export async function createNameDenyListChecker(
components: Pick<AppComponents, 'config' | 'logs' | 'fetch'>
Expand All @@ -13,7 +13,7 @@ export async function createNameDenyListChecker(
}

const NAME_DENY_LIST_ENTRY = 'NAME_DENY_LIST_ENTRY'
const nameDenyListCache = new LRU<string, string[]>({
const nameDenyListCache = new LRUCache<string, string[]>({
max: 1,
ttl: 60 * 60 * 1000, // cache for 1 hour
fetchMethod: async (_: string): Promise<string[]> => {
Expand All @@ -30,7 +30,7 @@ export async function createNameDenyListChecker(

const checkNameDenyList = async (worldName: string): Promise<boolean> => {
const bannedNames = await nameDenyListCache.fetch(NAME_DENY_LIST_ENTRY)
const isBanned = bannedNames.includes(worldName.replace('.eth', '').replace('.dcl', ''))
const isBanned = bannedNames?.includes(worldName.replace('.eth', '').replace('.dcl', ''))
if (isBanned) {
logger.warn(`Name ${worldName} is banned`)
}
Expand Down
4 changes: 2 additions & 2 deletions src/adapters/name-ownership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { l1Contracts, L1Network, registrarAbi } from '@dcl/catalyst-contracts'
import namehash from '@ensdomains/eth-ens-namehash'
import { keccak_256 as keccak256 } from '@noble/hashes/sha3'
import LRU from 'lru-cache'
import { LRUCache } from 'lru-cache'

type NamesResponse = {
nfts: { name: string; owner: { id: string } }[]
Expand Down Expand Up @@ -274,7 +274,7 @@ export async function createOnChainDclNameOwnership(
}

export async function createCachingNameOwnership(nameOwnership: INameOwnership): Promise<INameOwnership> {
const cache = new LRU<string, EthAddress | undefined>({
const cache = new LRUCache<string, EthAddress>({
max: 100,
ttl: 60 * 1000 // cache for 1 minute
})
Expand Down
Loading

0 comments on commit 16f906f

Please sign in to comment.