Skip to content

Commit

Permalink
Update dependecies
Browse files Browse the repository at this point in the history
  • Loading branch information
danielailie committed Dec 15, 2023
1 parent 5bb83ee commit 8f577ca
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 132 deletions.
163 changes: 80 additions & 83 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
"@golevelup/nestjs-rabbitmq": "4.0.0",
"@multiversx/sdk-core": "12.14.0",
"@multiversx/sdk-native-auth-server": "1.0.7",
"@multiversx/sdk-nestjs-cache": "2.0.0-beta.2",
"@multiversx/sdk-nestjs-common": "2.0.0-beta.2",
"@multiversx/sdk-nestjs-elastic": "2.0.0-beta.2",
"@multiversx/sdk-nestjs-http": "2.0.0-beta.2",
"@multiversx/sdk-nestjs-monitoring": "2.0.0-beta.2",
"@multiversx/sdk-nestjs-redis": "2.0.0-beta.2",
"@multiversx/sdk-nestjs-cache": "3.0.0",
"@multiversx/sdk-nestjs-common": "3.0.0",
"@multiversx/sdk-nestjs-elastic": "3.0.0",
"@multiversx/sdk-nestjs-http": "3.0.0",
"@multiversx/sdk-nestjs-monitoring": "3.0.0",
"@multiversx/sdk-nestjs-redis": "3.0.0",
"@multiversx/sdk-network-providers": "^1.2.1",
"@nestjs/apollo": "12.0.7",
"@nestjs/common": "10.2.4",
Expand Down Expand Up @@ -75,7 +75,7 @@
"dataloader": "2.0.0",
"errorhandler": "1.5.1",
"form-data": "4.0.0",
"graphql": "16.8.0",
"graphql": "16.8.1",
"graphql-fields-list": "2.2.4",
"graphql-query-complexity": "0.12.0",
"graphql-relay": "0.10.0",
Expand Down
6 changes: 3 additions & 3 deletions src/crons/elastic.updater/nsfw-queries.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { NftTypeEnum } from 'src/modules/assets/models';
import { ElasticQuery, QueryType } from '@multiversx/sdk-nestjs-elastic';
import { ElasticQuery, MatchQuery, QueryType } from '@multiversx/sdk-nestjs-elastic';
import { constants } from 'src/config';
import { ELASTIC_NFT_NSFW } from 'src/utils/constants';

export const getNsfwNotMarkedQuery = ElasticQuery.create()
.withMustNotExistCondition(ELASTIC_NFT_NSFW)
.withMustExistCondition('identifier')
.withMustMultiShouldCondition([NftTypeEnum.NonFungibleESDT, NftTypeEnum.SemiFungibleESDT], (type) => QueryType.Match('type', type))
.withMustCondition(QueryType.Nested('data', { 'data.nonEmptyURIs': true }))
.withMustCondition(QueryType.Nested('data', [new MatchQuery('data.nonEmptyURIs', true)]))
.withPagination({ from: 0, size: constants.elasticMaxBatch });

export const getNsfwMarkedQuery = ElasticQuery.create()
.withFields([ELASTIC_NFT_NSFW])
.withMustExistCondition('identifier')
.withMustMultiShouldCondition([NftTypeEnum.NonFungibleESDT, NftTypeEnum.SemiFungibleESDT], (type) => QueryType.Match('type', type))
.withMustCondition(QueryType.Nested('data', { 'data.nonEmptyURIs': true }))
.withMustCondition(QueryType.Nested('data', [new MatchQuery('data.nonEmptyURIs', true)]))
.withPagination({ from: 0, size: constants.elasticMaxBatch });
4 changes: 2 additions & 2 deletions src/modules/admins/flag-nft.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElasticQuery, QueryOperator, QueryType } from '@multiversx/sdk-nestjs-elastic';
import { ElasticQuery, MatchQuery, QueryOperator, QueryType } from '@multiversx/sdk-nestjs-elastic';
import { Locker } from '@multiversx/sdk-nestjs-common';
import { forwardRef, Inject, Injectable, Logger } from '@nestjs/common';
import { MxElasticService, NftMedia } from 'src/common';
Expand Down Expand Up @@ -67,7 +67,7 @@ export class FlagNftService {
.withMustExistCondition('identifier')
.withMustCondition(QueryType.Match('token', collection, QueryOperator.AND))
.withMustMultiShouldCondition([NftTypeEnum.NonFungibleESDT, NftTypeEnum.SemiFungibleESDT], (type) => QueryType.Match('type', type))
.withMustCondition(QueryType.Nested('data', { 'data.nonEmptyURIs': true }))
.withMustCondition(QueryType.Nested('data', [new MatchQuery('data.nonEmptyURIs', true)]))
.withPagination({ from: 0, size: 10000 });
await this.elasticUpdater.getScrollableList(ELASTIC_TOKENS_INDEX, 'identifier', query, async (items) => {
const nsfwItems = items.map((item) => ({
Expand Down
26 changes: 4 additions & 22 deletions src/modules/analytics/elastic.indexer.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ElasticQuery, ElasticSortOrder, QueryType } from '@multiversx/sdk-nestjs-elastic';
import { ElasticQuery, ElasticSortOrder, MatchQuery, QueryType } from '@multiversx/sdk-nestjs-elastic';
import { Injectable } from '@nestjs/common';
import { MxElasticService } from 'src/common';

Expand All @@ -19,22 +19,10 @@ export class ElasticAnalyticsService {
const elasticQuery = ElasticQuery.create()
.withPagination({ from: 0, size: 500 })
.withMustCondition(
QueryType.Should(
eventNames.map((eventName) =>
QueryType.Nested('events', {
'events.identifier': eventName,
}),
),
),
QueryType.Should(eventNames.map((eventName) => QueryType.Nested('events', [new MatchQuery('events.identifier', eventName)]))),
)
.withMustCondition(
QueryType.Should(
addresses.map((address) =>
QueryType.Nested('events', {
'events.address': address,
}),
),
),
QueryType.Should(addresses.map((address) => QueryType.Nested('events', [new MatchQuery('events.address', address)]))),
)
.withDateRangeFilter('timestamp', lte, gte)
.withSort([{ name: 'timestamp', order: ElasticSortOrder.ascending }]);
Expand All @@ -56,13 +44,7 @@ export class ElasticAnalyticsService {
private async getTransactionsLogs(eventName: string, gte: number, lte: number): Promise<any[]> {
const elasticQuery = ElasticQuery.create()
.withMustCondition(
QueryType.Should(
[eventName].map((eventName) =>
QueryType.Nested('events', {
'events.identifier': eventName,
}),
),
),
QueryType.Should([eventName].map((eventName) => QueryType.Nested('events', [new MatchQuery('events.identifier', eventName)]))),
)
.withDateRangeFilter('timestamp', lte, gte)
.withSort([{ name: 'timestamp', order: ElasticSortOrder.ascending }]);
Expand Down
Loading

0 comments on commit 8f577ca

Please sign in to comment.