Last active
February 23, 2019 19:05
-
-
Save uditalias/5bfd76f33b98736e90e1d9c4c63c7070 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RouteModel, validationParam, validator } from "appolo"; | |
import { enumValues } from "../../common/utils"; | |
import { GaugeType, OutputFormat } from "../../common/enums"; | |
import { TEN_MINUTES_IN_SECONDS } from "../../common/constants"; | |
export class LangaugeModel extends RouteModel { | |
// Git repository owner | |
@validationParam(validator.string().required()) | |
owner: string; | |
// Git repository name | |
@validationParam(validator.string().required()) | |
repo: string; | |
// Cache-Control max age | |
@validationParam(validator.number().min(1).optional().default(TEN_MINUTES_IN_SECONDS)) | |
maxAge: number; | |
// Gauge style type | |
@validationParam(validator.string().valid(enumValues(GaugeType)).optional().default(GaugeType.Solid)) | |
type: GaugeType; | |
// Output image format | |
@validationParam(validator.string().valid(enumValues(OutputFormat)).optional().default(OutputFormat.PNG)) | |
output: OutputFormat; | |
// Minimum langauge usage to include, in percentage | |
@validationParam(validator.number().min(0).max(100).optional().default(0)) | |
threshold: number; | |
// Include colors | |
@validationParam(validator.boolean().optional().default(true)) | |
colors: boolean; | |
// Gauges columns | |
@validationParam(validator.number().min(0).optional().default(0)) | |
columns: number; | |
// Scale the result image | |
@validationParam(validator.number().min(0.1).optional().default(1)) | |
scale: number; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment