import { genericActions as actions } from "oak-domain/lib/actions/action"; export const desc = { attributes: { code: { notNull: true, type: "varchar", params: { length: 128 } }, applicationId: { notNull: true, type: "ref", ref: "application" }, oauthAppId: { notNull: true, type: "ref", ref: "oauthApplication" }, userId: { notNull: true, type: "ref", ref: "user" }, redirectUri: { notNull: true, type: "varchar", params: { length: 512 } }, scope: { notNull: true, type: "object" }, // PKCE 扩展 (RFC 7636) 暂时用不到 codeChallenge: { type: "varchar", params: { length: 128 } }, codeChallengeMethod: { type: "varchar", params: { length: 10 } }, // 生命周期管理 expiresAt: { notNull: true, type: "datetime" }, // 使用时间 usedAt: { type: "datetime" } }, actionType: "crud", actions };