UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

32 lines (31 loc) 951 B
import type { AuthorizationRepo } from '../repo/authorization'; import type { JWTSettingRepo } from '../repo/setting/jwt'; import type { TicketRepo } from '../repo/ticket'; import * as factory from '../factory'; type IToken = string; interface IPayload extends Pick<factory.clientUser.IClientUser, 'aud' | 'exp' | 'iat' | 'iss' | 'sub' | 'token_use' | 'typ' | 'version'> { version: string; typ: string; jti?: string; } /** * コードをトークンに変換する */ declare function getToken(params: { agent: { id: string; typeOf: factory.creativeWorkType.SoftwareApplication | factory.creativeWorkType.WebApplication | factory.personType.Person; }; project: { id: string; }; code: string; expiresIn: number; }): (repos: { authorization: AuthorizationRepo; jwtSetting: JWTSettingRepo; ticket: TicketRepo; }) => Promise<{ token: IToken; }>; export { IPayload, getToken };