Skip to content

Commit

Permalink
fix: jsdoc and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Sep 5, 2023
1 parent e8911a0 commit 52c3ad7
Show file tree
Hide file tree
Showing 71 changed files with 864 additions and 846 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@nestjs/serve-static": "^4.0.0",
"@nestjs/swagger": "^7.1.10",
"@nestjs/terminus": "^10.0.1",
"@nestjs/throttler": "^4.2.1",
"@nestjs/throttler": "^5.0.0",
"@nestjs/websockets": "^10.2.4",
"@ntegral/nestjs-sentry": "^4.0.0",
"@paralleldrive/cuid2": "^2.2.2",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

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

12 changes: 6 additions & 6 deletions src/common/@types/classes/common.response.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export class AuthenticationResponse {
/**
* @example fb9eac5f-eb94-489b-8fca-24324558be18
*/
* @example fb9eac5f-eb94-489b-8fca-24324558be18
*/
user: {
idx?: string;
};

/**
* @example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXKYjj.eyJ
*/
* @example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXKYjj.eyJ
*/
accessToken: string;

/**
* @example eyJh3d06e6e3e152ae839a6623c3cb6f961a.eyJ
*/
* @example eyJh3d06e6e3e152ae839a6623c3cb6f961a.eyJ
*/
refreshToken?: string;
}
16 changes: 8 additions & 8 deletions src/common/@types/classes/cursor.response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ import type { PaginationAbstractResponse } from "../interfaces";

export class CursorMeta {
/**
* @example AdVxY2F0ZWdvcnlfaWQ9MjMx
*/
* @example AdVxY2F0ZWdvcnlfaWQ9MjMx
*/
@ApiProperty()
nextCursor: string;

/**
* @example false
*/
* @example false
*/
@ApiProperty()
hasNextPage: boolean;

/**
* @example true
*/
* @example true
*/
@ApiProperty()
hasPreviousPage: boolean;

/**
* @example "lorem ipsum"
*/
* @example "lorem ipsum"
*/
@ApiProperty()
search?: string;
}
Expand Down
24 changes: 12 additions & 12 deletions src/common/@types/classes/offset.response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@ import type { OffsetPaginationDto } from "@common/dtos/offset-pagination.dto";

export class OffsetMeta {
/**
* @example 10
*/
* @example 10
*/
@ApiProperty()
readonly page: number;

/**
* @example 50
*/
* @example 50
*/
@ApiProperty()
readonly limit: number;

/**
* @example 20
*/
* @example 20
*/
@ApiProperty()
readonly itemCount: number;

/**
* @example 100
*/
* @example 100
*/
@ApiProperty()
readonly pageCount: number;

/**
* @example true
*/
* @example true
*/
@ApiProperty()
readonly hasPreviousPage: boolean;

/**
* @example true
*/
* @example true
*/
@ApiProperty()
readonly hasNextPage: boolean;

Expand Down
4 changes: 2 additions & 2 deletions src/common/@types/interfaces/crud.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type { User } from "@entities";
import type { BaseEntity } from "@common/database";

/**
* common interface that enforces common methods for controller and service
*/
* common interface that enforces common methods for controller and service
*/
export interface Crud<
Entity extends BaseEntity,
PaginationRequest extends TPaginationRequest,
Expand Down
14 changes: 7 additions & 7 deletions src/common/@types/interfaces/file.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ export interface File {
/** Name of the file on the uploader's computer. */
originalname: string;
/**
* Value of the `Content-Transfer-Encoding` header for this file.
* @deprecated since July 2015
* @see RFC 7578, Section 4.7
*/
* Value of the `Content-Transfer-Encoding` header for this file.
* @deprecated since July 2015
* @see RFC 7578, Section 4.7
*/
encoding: string;
/** Value of the `Content-Type` header for this file. */
mimetype: string;
/** Size of the file in bytes. */
size: number;
/**
* A readable stream of this file. Only available to the `_handleFile`
* callback for custom `StorageEngine`s.
*/
* A readable stream of this file. Only available to the `_handleFile`
* callback for custom `StorageEngine`s.
*/
stream: Readable;
/** `DiskStorage` only: Directory to which this file has been uploaded. */
destination: string;
Expand Down
28 changes: 14 additions & 14 deletions src/common/database/base.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,47 @@ import { ApiHideProperty } from "@nestjs/swagger";
import { HelperService } from "@common/helpers";

/**
* Base entity class for mikroorm models, that all other entities of the same type should extend.
*/
* Base entity class for mikroorm models, that all other entities of the same type should extend.
*/

export abstract class BaseEntity {
@ApiHideProperty()
@PrimaryKey({ hidden: true, index: true })
id!: number;

/**
* The unique id of the entity
*/
* The unique id of the entity
*/
@Property({ index: true })
idx?: string = randomUUID();

/**
* To enable or disable the entity
*/
* To enable or disable the entity
*/
@Property()
isActive? = true;

/**
* Marked true when entity is soft deleted
*/
* Marked true when entity is soft deleted
*/
@Property({ hidden: true })
isDeleted? = false;

/**
* The date that the entity was soft-deleted. Nullable because it's not set until the entity is soft-deleted.
*/
* The date that the entity was soft-deleted. Nullable because it's not set until the entity is soft-deleted.
*/
@Property()
deletedAt?: Date | null;

/**
* The date that the entity was created
*/
* The date that the entity was created
*/
@Property()
createdAt? = HelperService.getTimeInUtc(new Date());

/**
* The date that the entity was last updated
*/
* The date that the entity was last updated
*/
@Property({
onUpdate: () => HelperService.getTimeInUtc(new Date()),
hidden: true,
Expand Down
Loading

0 comments on commit 52c3ad7

Please sign in to comment.