type-arango
Version:
ArangoDB Foxx decorators and utilities for TypeScript
34 lines (26 loc) • 760 B
text/typescript
import {Attribute, Document, Entity, Index, Nested} from '../../../src' // type-arango
// creates a nested object for the users auth
()
class UserAuth {
()
method: string
()
hash: string
()
salt: string
}
// describe the user
()
export class User extends Entity {
()
name: string
(type => 'skiplist')
(string => string.email(), readers => ['viewer', 'admin'])
email: string
(readers => ['admin'])
auth: UserAuth
((array, $) => array.items($(String)), readers => ['viewer'], writers => ['admin'])
roles: string[]
(readers => ['viewer', 'admin'], writers => ['admin'])
secret: string
}