diff --git a/dht-node/package.json b/dht-node/package.json index d27c891d3..ae217d839 100644 --- a/dht-node/package.json +++ b/dht-node/package.json @@ -20,7 +20,6 @@ "apollo-server-express": "2.25.2", "class-validator": "^0.13.2", "cross-env": "^7.0.3", - "decimal.js-light": "^2.5.1", "dotenv": "10.0.0", "express": "4.17.1", "graphql": "15.5.1", diff --git a/dht-node/src/graphql/arg/SearchUsersFilters.ts b/dht-node/src/graphql/arg/SearchUsersFilters.ts deleted file mode 100644 index dc19d456c..000000000 --- a/dht-node/src/graphql/arg/SearchUsersFilters.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Field, InputType } from 'type-graphql' - -@InputType() -export default class SearchUsersFilters { - @Field(() => Boolean, { nullable: true, defaultValue: null }) - byActivated: boolean - - @Field(() => Boolean, { nullable: true, defaultValue: null }) - byDeleted: boolean -} diff --git a/dht-node/src/graphql/scalar/Decimal.ts b/dht-node/src/graphql/scalar/Decimal.ts deleted file mode 100644 index da5a99e0c..000000000 --- a/dht-node/src/graphql/scalar/Decimal.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { GraphQLScalarType, Kind } from 'graphql' -import Decimal from 'decimal.js-light' - -export default new GraphQLScalarType({ - name: 'Decimal', - description: 'The `Decimal` scalar type to represent currency values', - - serialize(value: Decimal) { - return value.toString() - }, - - parseValue(value) { - return new Decimal(value) - }, - - parseLiteral(ast) { - if (ast.kind !== Kind.STRING) { - throw new TypeError(`${String(ast)} is not a valid decimal value.`) - } - - return new Decimal(ast.value) - }, -}) diff --git a/dht-node/src/graphql/schema.ts b/dht-node/src/graphql/schema.ts index 990f30da9..518e7f2aa 100644 --- a/dht-node/src/graphql/schema.ts +++ b/dht-node/src/graphql/schema.ts @@ -2,13 +2,9 @@ import { GraphQLSchema } from 'graphql' import { buildSchema } from 'type-graphql' import path from 'path' -import DecimalScalar from './scalar/Decimal' -import Decimal from 'decimal.js-light' - const schema = async (): Promise => { return await buildSchema({ resolvers: [path.join(__dirname, `./resolver/*Resolver.{ts,js}`)], - scalarsMap: [{ type: Decimal, scalar: DecimalScalar }], }) } diff --git a/dht-node/tsconfig.json b/dht-node/tsconfig.json index 72486ee78..ff42c7a42 100644 --- a/dht-node/tsconfig.json +++ b/dht-node/tsconfig.json @@ -59,7 +59,7 @@ "@entity/*": ["../database/entity/*", "../../database/build/entity/*"] }, // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - "typeRoots": ["src/dht-node/@types", "node_modules/@types"], /* List of folders to include type definitions from. */ + "typeRoots": ["src/dht_node/@types", "node_modules/@types"], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ diff --git a/dht-node/yarn.lock b/dht-node/yarn.lock index b4b4ec816..82636c64e 100644 --- a/dht-node/yarn.lock +++ b/dht-node/yarn.lock @@ -2013,11 +2013,6 @@ debugging-stream@^2.0.0: dependencies: streamx "^2.12.4" -decimal.js-light@^2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.1.tgz#134fd32508f19e208f4fb2f8dac0d2626a867934" - integrity sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg== - decimal.js@^10.2.1: version "10.4.3" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23"