23 lines
981 B
TypeScript
23 lines
981 B
TypeScript
import { Datetime } from 'oak-domain/lib/types/DataType';
|
|
import { Schema as User } from './User';
|
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
import { ActionDef } from 'oak-domain/lib/types';
|
|
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
|
|
import { Schema as OauthApplication } from './OauthApplication';
|
|
import { Schema as OauthToken } from './OauthToken';
|
|
import { Schema as OauthAuthorizationCode } from './OauthAuthorizationCode';
|
|
export interface Schema extends EntityShape {
|
|
user: User;
|
|
application: OauthApplication;
|
|
authorizedAt: Datetime;
|
|
code?: OauthAuthorizationCode;
|
|
token?: OauthToken;
|
|
}
|
|
export type UsageState = 'unused' | 'granted' | 'denied' | 'revoked';
|
|
export type UsageAction = 'revoke' | 'award' | 'deny';
|
|
export type Action = UsageAction;
|
|
export declare const UsageActionDef: ActionDef<UsageAction, UsageState>;
|
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
usageState: UsageState;
|
|
}>;
|