Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
simplePatch: PATCH `/method/patch`
.body(SimpleMessage)
.response(rt.String),
simpleDelete: DELETE `/method/delete`
.response(rt.String),
noTemplateString: GET('/path/string')
.response(rt.String),
simpleQueryParams: GET `/query`
.query(rt.Record({
'mandatory': rt.String,
'union': rt.Union(rt.Literal('true'), rt.Literal('false')),
'optional': rt.Union(rt.String, rt.Undefined)
}))
.response(QueryParamsResponse),
optionalQueryParams: GET `/query/optional`
.query({
'maybeParam': '' as string | undefined
}),
simpleRequestBody: POST `/simpleBody`
.body(TodoItem)
.response(SavedTodoItem),
noRepsonseEndpoint: PUT `/noResponse`,
pathParams: GET `/path/${'kind'}/id/${'id'}`
.response(PathData),
t.Dictionary(t.Union(t.String, t.Array(t.String)))
)
export const GroupClause = t.Union(
t.String,
t.Array(t.String)
)
export const OrderClause = t.Union(
t.String,
t.Tuple(t.String, t.String)
)
export const TrilogyOptions = t.Partial({
client: t.Union(t.Literal('sqlite3'), t.Literal('sql.js')),
dir: t.String
})
export const ModelOptions = t.Partial({
index: Index,
primary: t.Array(t.String),
unique: t.Array(t.String),
timestamps: t.Boolean
})
export const AggregateOptions = t.Partial({
distinct: t.Boolean,
group: GroupClause,
order: OrderClause
})
export const CreateOptions = t.Partial({