class-validator#Max TypeScript Examples

The following examples show how to use class-validator#Max. 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
/**
   * The priority level sent with the message.
   * @example 7
   * @default 5
   * @env GOTIFY_PRIORITY
   */
  @IsInt()
  @Min(0)
  @Max(10)
  @IsOptional()
  priority = 5;
Example #2
Source File: classes.ts    From epicgames-freegames-node with MIT License 6 votes vote down vote up
/**
   * The outgoing SMTP port (SSL or TLS, see secure)
   * @example 587
   * @env SMTP_PORT
   */
  @IsInt()
  @Min(0)
  @Max(65535)
  smtpPort: number;
Example #3
Source File: create-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: 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 #5
Source File: pagination-args.dto.ts    From ironfish-api with Mozilla Public License 2.0 6 votes vote down vote up
@ApiPropertyOptional({
    description:
      'An object identifier to use as a cursor pagination to fetch records after',
  })
  @Max(Number.MAX_SAFE_INTEGER)
  @IsNumber()
  @IsOptional()
  @Type(() => Number)
  readonly after?: number;
Example #6
Source File: page-options.dto.ts    From bank-server with MIT License 6 votes vote down vote up
@ApiPropertyOptional({
    minimum: 1,
    maximum: 50,
    default: 10,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  @Max(50)
  @IsOptional()
  readonly take?: number = 10;
Example #7
Source File: blocks-query.dto.ts    From ironfish-api with Mozilla Public License 2.0 6 votes vote down vote up
@ApiPropertyOptional({
    description: 'Greater than or equal to filter for Block sequence',
  })
  @Max(Number.MAX_SAFE_INTEGER)
  @Min(1)
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  readonly sequence_gte?: number;
Example #8
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 #9
Source File: pagination-args.dto.ts    From ironfish-api with Mozilla Public License 2.0 6 votes vote down vote up
@ApiPropertyOptional({
    description:
      'An object identifier to use as a cursor pagination to fetch records before',
  })
  @Max(Number.MAX_SAFE_INTEGER)
  @ApiPropertyOptional()
  @IsNumber()
  @IsOptional()
  @Type(() => Number)
  readonly before?: number;
Example #10
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 #11
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 #12
Source File: field.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@IsNumber()
  @Max(Number.MAX_SAFE_INTEGER)
  @Min(0)
  @Type(() => Number)
  readonly value!: number;
Example #13
Source File: upsert-transactions.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@Max(Number.MAX_SAFE_INTEGER)
  @IsInt()
  @Type(() => Number)
  readonly size!: number;
Example #14
Source File: upsert-transactions.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@Max(Number.MAX_SAFE_INTEGER)
  @IsInt()
  @Type(() => Number)
  readonly fee!: number;
Example #15
Source File: transactions-query.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@Max(Number.MAX_SAFE_INTEGER)
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  readonly block_id?: number;
Example #16
Source File: field.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@IsInt()
  @Max(Number.MAX_SAFE_INTEGER)
  @Min(0)
  @Type(() => Number)
  readonly value!: number;
Example #17
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 #18
Source File: createSubmission.dto.ts    From coronatest with GNU Affero General Public License v3.0 5 votes vote down vote up
@IsNumber()
    @Min(1)
    @Max(200)
    @IsOptional()
    symptoms_duration: number;
Example #19
Source File: createSubmission.dto.ts    From coronatest with GNU Affero General Public License v3.0 5 votes vote down vote up
@Min(36)
    @Max(50)
    @IsNumber()
    @IsOptional()
    fever_temperature: number;
Example #20
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 #21
Source File: login-normal-user.dto.ts    From mamori-i-japan-api with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@ApiProperty()
  @IsInt()
  @Min(0)
  @Max(47)
  prefecture: number
Example #22
Source File: create-prefecture.dto.ts    From mamori-i-japan-api with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@ApiProperty()
  @IsInt()
  @Min(0)
  @Max(47)
  prefectureId: number
Example #23
Source File: create-user.dto.ts    From mamori-i-japan-api with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@ApiProperty()
  @IsInt()
  @Min(0)
  @Max(47)
  prefecture: number
Example #24
Source File: create-user.dto.ts    From mamori-i-japan-api with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@ApiPropertyOptional({ example: 14 })
  @IsOptional()
  @IsInt()
  @Min(0)
  @Max(47)
  prefecture: number
Example #25
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 #26
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 #27
Source File: PostDto.ts    From jaebook-server with MIT License 5 votes vote down vote up
@IsNumber()
  @Max(20)
  @IsPositive()
  public limit: number;
Example #28
Source File: blocks-query.dto.ts    From ironfish-api with Mozilla Public License 2.0 5 votes vote down vote up
@ApiPropertyOptional({ description: 'Unique Transaction identifier' })
  @Max(Number.MAX_SAFE_INTEGER)
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  readonly transaction_id?: number;
Example #29
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;