Skip to content

Commit

Permalink
docs: update jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnigir1 committed Jul 18, 2024
1 parent fa0b6f6 commit 08b9ca3
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 28 deletions.
10 changes: 10 additions & 0 deletions apps/api/src/api.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ import { ApiController } from "./api.controller";
import { RequestLoggerMiddleware } from "./common/middleware/request.middleware";
import { MetricsController } from "./metrics/metrics.controller";

/**
* The main API module of the application.
* Here we import all required modules and register the controllers for the ZKchainHub API.
*/
@Module({
imports: [ProvidersModule],
controllers: [ApiController, MetricsController],
providers: [],
})
export class ApiModule implements NestModule {
/**
* Configures middleware for the module.
* Applies RequestLoggerMiddleware to all routes except '/docs' and '/docs/(.*)'.
*
* @param {MiddlewareConsumer} consumer - The middleware consumer provided by NestJS.
*/
configure(consumer: MiddlewareConsumer) {
consumer.apply(RequestLoggerMiddleware).exclude("/docs", "/docs/(.*)").forRoutes("*");
}
Expand Down
8 changes: 1 addition & 7 deletions libs/dtos/src/dto/chain.dto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { AssetDistribution, BatchesInfo, FeeParams } from "@shared/dtos/dto/l1Metrics.dto";
import { L2ChainInfo } from "@shared/dtos/dto/l2Metrics.dto";
import { Metadata } from "@shared/dtos/dto/metadata.dto";
import { AssetDistribution, BatchesInfo, FeeParams, L2ChainInfo, Metadata } from "@shared/dtos/dto";
import { Chains, ChainType } from "@shared/dtos/types";

/**
Expand Down Expand Up @@ -62,10 +60,6 @@ export class ZKChainInfo {
@ApiPropertyOptional()
l2ChainInfo?: L2ChainInfo;

/**
* Constructs an instance of the ZKChainInfo class.
* @param {ZKChainInfo} data - The data to initialize the instance with.
*/
constructor(data: ZKChainInfo) {
this.chainType = data.chainType;
this.tvl = data.tvl;
Expand Down
6 changes: 1 addition & 5 deletions libs/dtos/src/dto/ecosystem.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiProperty } from "@nestjs/swagger";
import { AssetDistribution, EthGasInfo } from "@shared/dtos/dto/l1Metrics.dto";
import { AssetDistribution, EthGasInfo } from "@shared/dtos/dto";
import { Chains, ChainType } from "@shared/dtos/types";

/**
Expand Down Expand Up @@ -94,10 +94,6 @@ export class ZKChainSummary {
*/
rpc?: boolean;

/**
* Constructs an instance of the ZKChainSummary class.
* @param {ZKChainSummary} data - The data to initialize the instance with.
*/
constructor(data: ZKChainSummary) {
this.chainId = data.chainId;
this.chainType = data.chainType;
Expand Down
3 changes: 3 additions & 0 deletions libs/dtos/src/dto/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export * from "./l2Metrics.dto";
export * from "./metadata.dto";
export * from "./l1Metrics.dto";
export * from "./chain.dto";
export * from "./ecosystem.dto";
4 changes: 0 additions & 4 deletions libs/dtos/src/dto/l1Metrics.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ export class EthGasInfo {
*/
erc20Transfer: number;

/**
* Constructs an instance of the EthGasInfo class.
* @param {EthGasInfo} data - The data to initialize the instance with.
*/
constructor(data: EthGasInfo) {
this.gasPrice = data.gasPrice;
this.ethTransfer = data.ethTransfer;
Expand Down
4 changes: 0 additions & 4 deletions libs/dtos/src/dto/l2Metrics.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ export class L2ChainInfo {
*/
lastBlockVerified: number;

/**
* Constructs an instance of the L2ChainInfo class.
* @param {L2ChainInfo} data - The data to initialize the instance with.
*/
constructor(data: L2ChainInfo) {
this.tps = data.tps;
this.avgBlockTime = data.avgBlockTime;
Expand Down
8 changes: 0 additions & 8 deletions libs/dtos/src/dto/metadata.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ export class RPC {
*/
status?: boolean;

/**
* Constructs an instance of the RPC class.
* @param {RPC} data - The data to initialize the instance with.
*/
constructor(data: RPC) {
this.url = data.url;
this.status = data.status;
Expand Down Expand Up @@ -79,10 +75,6 @@ export class Metadata {
*/
nativeToken: string;

/**
* Constructs an instance of the Metadata class.
* @param {Metadata} data - The data to initialize the instance with.
*/
constructor(data: Metadata) {
this.iconUrl = data.iconUrl;
this.chainName = data.chainName;
Expand Down

0 comments on commit 08b9ca3

Please sign in to comment.