class-validator#Min TypeScript Examples

The following examples show how to use class-validator#Min. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: classes.ts    From epicgames-freegames-node with MIT License 6 votes vote down vote up
/**
   * How long in milliseconds the browser navigation will wait before timing out.
   * 0 disables timeout (not recommended).
   * See: https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagesetdefaulttimeouttimeout
   * @example 120000
   * @default 30000
   * @env BROWSER_NAVIGATION_TIMEOUT
   */
  @IsOptional()
  @IsInt()
  @Min(0)
  browserNavigationTimeout = process.env.BROWSER_NAVIGATION_TIMEOUT
    ? parseInt(process.env.BROWSER_NAVIGATION_TIMEOUT, 10)
    : 30000;
Example #2
Source File: block-query.dto.ts    From ironfish-api with Mozilla Public License 2.0 6 votes vote down vote up
@ApiPropertyOptional({
    description:
      'Block sequence. Will only return blocks on the main chain if provided',
  })
  @ValidateIf((o: BlockQueryDto) => o.hash === undefined)
  @IsDefined({
    message: '"hash" or "sequence" required to query for single block',
  })
  @Max(Number.MAX_SAFE_INTEGER)
  @Min(1)
  @IsInt()
  @Type(() => Number)
  readonly sequence?: number;
Example #3
Source File: update-review.dto.ts    From edu-server with MIT License 6 votes vote down vote up
/**
   * The number of stars given in the review
   * @example 5
   */
  @IsNotEmpty()
  @IsNumber()
  @Max(5)
  @Min(0)
  stars: number;
Example #4
Source File: pagination-params.dto.ts    From nestjs-starter-rest-api with MIT License 6 votes vote down vote up
@ApiPropertyOptional({
    description: 'Optional, defaults to 100',
    type: Number,
  })
  @IsNumber()
  @IsOptional()
  @Min(0)
  @Transform(({ value }) => parseInt(value, 10), { toClassOnly: true })
  limit = 100;
Example #5
Source File: page-options.dto.ts    From bank-server with MIT License 6 votes vote down vote up
@ApiPropertyOptional({
    minimum: 1,
    default: 1,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @IsOptional()
  readonly page?: number = 1;
Example #6
Source File: classes.ts    From epicgames-freegames-node with MIT License 6 votes vote down vote up
/**
   * How many times to attempt retry attempts to launch a browser after it [times out](https://github.com/claabs/epicgames-freegames-node/issues/164)
   * @example 2
   * @default 5
   * @env BROWSER_LAUNCH_RETRY_ATTEMPTS
   */
  @IsOptional()
  @IsInt()
  @Min(0)
  browserLaunchRetryAttempts = process.env.BROWSER_LAUNCH_RETRY_ATTEMPTS
    ? parseInt(process.env.BROWSER_LAUNCH_RETRY_ATTEMPTS, 10)
    : 5;
Example #7
Source File: pagination-args.dto.ts    From ironfish-api with Mozilla Public License 2.0 6 votes vote down vote up
@ApiPropertyOptional({
    description: 'A limit on the number of objects to return between 1 and 100',
  })
  @Max(100)
  @Min(1)
  @IsNumber()
  @IsOptional()
  @Type(() => Number)
  readonly limit?: number;
Example #8
Source File: createSubmission.dto.ts    From coronatest with GNU Affero General Public License v3.0 5 votes vote down vote up
@IsNumber()
    @Min(0)
    @Max(200)
    age: number;
Example #9
Source File: next-faucet-transactions.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@Max(Number.MAX_SAFE_INTEGER)
  @Min(1)
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  readonly count?: number;
Example #10
Source File: weather-city.dto.ts    From life-helper-backend with MIT License 5 votes vote down vote up
/** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */
  @IsNumber()
  @Min(-180)
  @Max(180)
  longitude: number
Example #11
Source File: product.entity.ts    From rest-api.ts with MIT License 5 votes vote down vote up
@IsInt()
  @Min(0)
  @Column({type: 'integer', default: 0})
  quantity: number = 0;
Example #12
Source File: create-admin.dto.ts    From mamori-i-japan-api with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@ApiPropertyOptional({
    description: 'Optional, needed when admin role is PREFECTURE_ADMIN_ROLE',
  })
  @ValidateIf((o) => o.adminRole === AdminRole.prefectureAdminRole)
  @IsInt()
  @Min(0)
  @Max(47)
  prefectureId: number
Example #13
Source File: GeneratePrivateKey.ts    From tatum-blockchain-connector with MIT License 5 votes vote down vote up
@IsNotEmpty()
  @IsInt()
  @Min(0)
  @Max(2147483647)
  public index: number;
Example #14
Source File: get-account-dashboard.dto.ts    From etherspot-sdk with MIT License 5 votes vote down vote up
@IsOptional()
  @IsInt()
  @Min(2)
  days?: number;
Example #15
Source File: shared.dto.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
@IsOptional()
  @IsInt()
  @Min(1)
  limit?: number
Example #16
Source File: Student.ts    From Typescript_TypeORM with Apache License 2.0 5 votes vote down vote up
@Column()
  @Max(99999, { message: 'Chave inválida' })
  @Min(10000)
  key: number;
Example #17
Source File: ReorderTodos.ts    From remix-hexagonal-architecture with MIT License 5 votes vote down vote up
@Type(() => Number)
  @IsInt()
  @Min(0)
  newIndex!: number;
Example #18
Source File: find.dto.ts    From codeclannigeria-backend with MIT License 5 votes vote down vote up
@IsOptional()
  @Min(0)
  skip?: number = 0;
Example #19
Source File: list.dto.ts    From ddd-cqrs-es-aws-sam with MIT License 5 votes vote down vote up
@IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(1)
  @Max(100)
  limit?: number;
Example #20
Source File: create-event.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@IsOptional()
  @IsInt()
  @Max(Number.MAX_SAFE_INTEGER)
  @Min(0)
  @Type(() => Number)
  readonly points?: number;
Example #21
Source File: abstract.entity.ts    From life-helper-backend with MIT License 5 votes vote down vote up
/** 主键 ID */
  @PrimaryGeneratedColumn({
    comment: '主键 ID',
  })
  @Min(1)
  id: number
Example #22
Source File: shared.dto.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
@IsOptional()
  @IsInt()
  @Min(0)
  skip?: number
Example #23
Source File: blocks-query.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@ApiPropertyOptional({ description: 'Less than filter for Block sequence' })
  @Max(Number.MAX_SAFE_INTEGER)
  @Min(1)
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  readonly sequence_lt?: number;