9362a10
ZhenYi
refactor: remove OAuth-related modules and update references for identity service integration
9362a10
/**
* Generated by orval 🍺
* Do not edit manually.
* auth
* 认证与账号服务:工作量证明、口令与验证码登录、二次验证、注册、口令重置、访问令牌与 SSH 公钥。
* OpenAPI spec version: 1.0.0
*/
export interface AccessTokenCreateRequest {
/** @nullable */
description?: string | null;
/** @nullable */
expires_in_secs?: number | null;
name: string;
scope: string[];
}
export interface AccessTokenCreateResponse {
created_at: string;
/** @nullable */
expires_at?: string | null;
id: string;
name: string;
scope: string[];
token: string;
}
export interface AccessTokenSummary {
created_at: string;
/** @nullable */
description?: string | null;
/** @nullable */
expires_at?: string | null;
/** @nullable */
fingerprint?: string | null;
id: string;
/** @nullable */
last_used_at?: string | null;
name: string;
/** @nullable */
revoked_at?: string | null;
scope: string[];
}
export type OrgMemberRole = "member" | "admin" | "owner";
export interface AddMemberBody {
role?: OrgMemberRole | null;
role_keys?: string[];
user_id: number;
}
export interface AppTokenRequest {
app_id: string;
/**
* @minimum 0
* @nullable
*/
ttl_seconds?: number | null;
}
export interface AppTokenResponse {
app_id: string;
audience: string;
expires_at: string;
issued_at: string;
key_id: string;
token: string;
}
export interface AssignRoleBody {
member_id: string;
role_key: string;
}
export interface BanMemberBody {
/** @nullable */
reason?: string | null;
}
export interface ChallengeResponse {
context: string;
/** @minimum 0 */
difficulty: number;
/** @minimum 0 */
expires_at: number;
/** @minimum 0 */
issued_at: number;
}
export interface CheckPermissionBody {
permission: string;
/** @nullable */
user_id?: number | null;
}
export interface ComponentCheck {
component: string;
ready: boolean;
}
export interface CreateInviteBody {
max_uses?: number;
/** @nullable */
role_id?: string | null;
/** @nullable */
target_user_id?: number | null;
/**
* @minimum 0
* @nullable
*/
ttl_secs?: number | null;
}
export type OrgJoinMethod =
"direct" | "invite_link" | "invite_targeted" | "invite_email";
export interface InviteSummary {
created_at: string;
created_by: number;
/** @nullable */
email?: string | null;
/** @nullable */
expires_at?: string | null;
id: string;
max_uses: number;
method: OrgJoinMethod;
organization_id: string;
/** @nullable */
revoked_at?: string | null;
/** @nullable */
role_id?: string | null;
/** @nullable */
target_user_id?: number | null;
uses: number;
}
export interface CreateInviteResponse {
invite: InviteSummary;
token: string;
}
export type OrganizationJoinPolicy =
"open" | "approval" | "invite_only" | "private";
export interface CreateOrganizationBody {
/** @nullable */
allow_invite?: boolean | null;
/** @nullable */
allow_join?: boolean | null;
/** @nullable */
allow_join_level?: number | null;
/** @nullable */
avatar_url?: string | null;
/** @nullable */
description?: string | null;
join_policy?: OrganizationJoinPolicy | null;
/** @nullable */
member_must_enable_2fa?: boolean | null;
name: string;
/** @nullable */
require_email_verified?: boolean | null;
/** @nullable */
require_mfa?: boolean | null;
slug: string;
/** @nullable */
welcome_message?: string | null;
}
export type PermissionEffect = "allow" | "deny";
export interface PermissionGrant {
effect: PermissionEffect;
permission: string;
}
export interface CreateRoleBody {
default_role?: boolean;
/** @nullable */
description?: string | null;
key: string;
name: string;
permissions?: PermissionGrant[];
rank?: number;
self_assignable?: boolean;
}
export interface DeleteOrgQuery {
force?: boolean;
/** @nullable */
reason?: string | null;
}
export type EnvelopeAccessTokenCreateResponseData = {
created_at: string;
/** @nullable */
expires_at?: string | null;
id: string;
name: string;
scope: string[];
token: string;
};
export interface EnvelopeAccessTokenCreateResponse {
code: number;
data?: EnvelopeAccessTokenCreateResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeAppTokenResponseData = {
app_id: string;
audience: string;
expires_at: string;
issued_at: string;
key_id: string;
token: string;
};
export interface EnvelopeAppTokenResponse {
code: number;
data?: EnvelopeAppTokenResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeChallengeResponseData = {
context: string;
/** @minimum 0 */
difficulty: number;
/** @minimum 0 */
expires_at: number;
/** @minimum 0 */
issued_at: number;
};
export interface EnvelopeChallengeResponse {
code: number;
data?: EnvelopeChallengeResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeCreateInviteResponseData = {
invite: InviteSummary;
token: string;
};
export interface EnvelopeCreateInviteResponse {
code: number;
data?: EnvelopeCreateInviteResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeHealthResponseData = {
status: string;
version: string;
};
export interface EnvelopeHealthResponse {
code: number;
data?: EnvelopeHealthResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeLoginCodeResponseData = {
/** @minimum 0 */
expires_in_secs: number;
};
export interface EnvelopeLoginCodeResponse {
code: number;
data?: EnvelopeLoginCodeResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeLogoutResponseData = {
/** @nullable */
user_id?: number | null;
};
export interface EnvelopeLogoutResponse {
code: number;
data?: EnvelopeLogoutResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeMeResponseData = {
/** @nullable */
avatar_url?: string | null;
created_at: string;
/** @nullable */
displayname?: string | null;
email: string;
/** @nullable */
email_verified_at?: string | null;
is_admin: boolean;
user_id: number;
username: string;
version: number;
};
export interface EnvelopeMeResponse {
code: number;
data?: EnvelopeMeResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
/**
* 会籍的通知偏好,对应旧 `space_members.message_notifications`。
* 旧表用 0/1/2 存,这里用字符串存,便于跨服务读写时直接透传。
*/
export type MessageNotifications = "all" | "mentions" | "nothing";
export type EnvelopeMemberSummaryData = {
/** @nullable */
alias_avatar_url?: string | null;
/** @nullable */
alias_name?: string | null;
ban_allow_agent_join: boolean;
ban_allow_comment_any: boolean;
ban_allow_push_repo: boolean;
ban_allow_speak: boolean;
/** @nullable */
ban_expires_at?: string | null;
/** @nullable */
ban_reason?: string | null;
/** @nullable */
banned_at?: string | null;
/** @nullable */
displayname?: string | null;
hide_muted_channels: boolean;
id: string;
/** @nullable */
invited_by?: number | null;
join_method: OrgJoinMethod;
joined_at: string;
/** @nullable */
last_active_at?: string | null;
/** @nullable */
left_at?: string | null;
message_notifications: MessageNotifications;
mobile_push: boolean;
/** @nullable */
mute_until?: string | null;
muted: boolean;
organization_id: string;
permissions: string[];
role: OrgMemberRole;
role_keys: string[];
suppress_everyone: boolean;
suppress_roles: boolean;
user_id: number;
username: string;
version: number;
};
export interface EnvelopeMemberSummary {
code: number;
data?: EnvelopeMemberSummaryData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export interface EnvelopeNoData {
code: number;
data?: unknown;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type OrganizationStatus = "active" | "suspended" | "archived";
export type EnvelopeOrganizationSummaryData = {
allow_invite: boolean;
allow_join: boolean;
allow_join_level: number;
/** @nullable */
archived_at?: string | null;
/** @nullable */
avatar_url?: string | null;
created_at: string;
/** @nullable */
description?: string | null;
id: string;
join_policy: OrganizationJoinPolicy;
member_count: number;
member_must_enable_2fa: boolean;
my_role?: OrgMemberRole | null;
name: string;
owner_user_id: number;
require_email_verified: boolean;
require_mfa: boolean;
slug: string;
status: OrganizationStatus;
updated_at: string;
version: number;
/** @nullable */
welcome_message?: string | null;
};
export interface EnvelopeOrganizationSummary {
code: number;
data?: EnvelopeOrganizationSummaryData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopePasswordResetConfirmResponseData = {
user_id: number;
};
export interface EnvelopePasswordResetConfirmResponse {
code: number;
data?: EnvelopePasswordResetConfirmResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopePasswordResetResponseData = {
/** @minimum 0 */
expires_in_secs: number;
};
export interface EnvelopePasswordResetResponse {
code: number;
data?: EnvelopePasswordResetResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopePermissionCheckData = {
allowed: boolean;
matched_by: string;
organization_version: number;
reason: string;
};
export interface EnvelopePermissionCheck {
code: number;
data?: EnvelopePermissionCheckData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeReadinessResponseData = {
checks: ComponentCheck[];
status: string;
};
export interface EnvelopeReadinessResponse {
code: number;
data?: EnvelopeReadinessResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeRedeemInviteResponseData = {
joined: boolean;
member_id: string;
organization_id: string;
};
export interface EnvelopeRedeemInviteResponse {
code: number;
data?: EnvelopeRedeemInviteResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeRegisterCodeResponseData = {
/** @minimum 0 */
expires_in_secs: number;
};
export interface EnvelopeRegisterCodeResponse {
code: number;
data?: EnvelopeRegisterCodeResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeRoleSummaryData = {
/** @nullable */
color?: string | null;
created_at: string;
default_role: boolean;
/** @nullable */
description?: string | null;
/** @nullable */
emoji?: string | null;
/** @nullable */
icon_hash?: string | null;
id: string;
key: string;
member_count: number;
name: string;
organization_id: string;
permissions: PermissionGrant[];
position: number;
rank: number;
self_assignable: boolean;
system: boolean;
updated_at: string;
version: number;
};
export interface EnvelopeRoleSummary {
code: number;
data?: EnvelopeRoleSummaryData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type SshKeyAlgorithm = "rsa" | "ed25519" | "ecdsa";
export type EnvelopeSshKeySummaryData = {
algorithm: SshKeyAlgorithm;
created_at: string;
/** @nullable */
description?: string | null;
/** @nullable */
expires_at?: string | null;
fingerprint: string;
id: string;
/** @nullable */
last_used_at?: string | null;
name: string;
public_key: string;
/** @nullable */
revoked_at?: string | null;
};
export interface EnvelopeSshKeySummary {
code: number;
data?: EnvelopeSshKeySummaryData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeTokenResponseData = {
expires_at: string;
issued_at: string;
kid: string;
token: string;
token_type: string;
};
export interface EnvelopeTokenResponse {
code: number;
data?: EnvelopeTokenResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeUserLoginResponseData = {
/** @nullable */
challenge?: string | null;
/** @nullable */
displayname?: string | null;
mfa_required: boolean;
user_id: number;
username: string;
};
export interface EnvelopeUserLoginResponse {
code: number;
data?: EnvelopeUserLoginResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeUserRegisterResponseData = {
/** @nullable */
displayname?: string | null;
user_id: number;
username: string;
};
export interface EnvelopeUserRegisterResponse {
code: number;
data?: EnvelopeUserRegisterResponseData;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeVecAccessTokenSummaryDataItem = {
created_at: string;
/** @nullable */
description?: string | null;
/** @nullable */
expires_at?: string | null;
/** @nullable */
fingerprint?: string | null;
id: string;
/** @nullable */
last_used_at?: string | null;
name: string;
/** @nullable */
revoked_at?: string | null;
scope: string[];
};
export interface EnvelopeVecAccessTokenSummary {
code: number;
data?: EnvelopeVecAccessTokenSummaryDataItem[];
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeVecInviteSummaryDataItem = {
created_at: string;
created_by: number;
/** @nullable */
email?: string | null;
/** @nullable */
expires_at?: string | null;
id: string;
max_uses: number;
method: OrgJoinMethod;
organization_id: string;
/** @nullable */
revoked_at?: string | null;
/** @nullable */
role_id?: string | null;
/** @nullable */
target_user_id?: number | null;
uses: number;
};
export interface EnvelopeVecInviteSummary {
code: number;
data?: EnvelopeVecInviteSummaryDataItem[];
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeVecMemberSummaryDataItem = {
/** @nullable */
alias_avatar_url?: string | null;
/** @nullable */
alias_name?: string | null;
ban_allow_agent_join: boolean;
ban_allow_comment_any: boolean;
ban_allow_push_repo: boolean;
ban_allow_speak: boolean;
/** @nullable */
ban_expires_at?: string | null;
/** @nullable */
ban_reason?: string | null;
/** @nullable */
banned_at?: string | null;
/** @nullable */
displayname?: string | null;
hide_muted_channels: boolean;
id: string;
/** @nullable */
invited_by?: number | null;
join_method: OrgJoinMethod;
joined_at: string;
/** @nullable */
last_active_at?: string | null;
/** @nullable */
left_at?: string | null;
message_notifications: MessageNotifications;
mobile_push: boolean;
/** @nullable */
mute_until?: string | null;
muted: boolean;
organization_id: string;
permissions: string[];
role: OrgMemberRole;
role_keys: string[];
suppress_everyone: boolean;
suppress_roles: boolean;
user_id: number;
username: string;
version: number;
};
export interface EnvelopeVecMemberSummary {
code: number;
data?: EnvelopeVecMemberSummaryDataItem[];
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeVecOrganizationSummaryDataItem = {
allow_invite: boolean;
allow_join: boolean;
allow_join_level: number;
/** @nullable */
archived_at?: string | null;
/** @nullable */
avatar_url?: string | null;
created_at: string;
/** @nullable */
description?: string | null;
id: string;
join_policy: OrganizationJoinPolicy;
member_count: number;
member_must_enable_2fa: boolean;
my_role?: OrgMemberRole | null;
name: string;
owner_user_id: number;
require_email_verified: boolean;
require_mfa: boolean;
slug: string;
status: OrganizationStatus;
updated_at: string;
version: number;
/** @nullable */
welcome_message?: string | null;
};
export interface EnvelopeVecOrganizationSummary {
code: number;
data?: EnvelopeVecOrganizationSummaryDataItem[];
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeVecRoleSummaryDataItem = {
/** @nullable */
color?: string | null;
created_at: string;
default_role: boolean;
/** @nullable */
description?: string | null;
/** @nullable */
emoji?: string | null;
/** @nullable */
icon_hash?: string | null;
id: string;
key: string;
member_count: number;
name: string;
organization_id: string;
permissions: PermissionGrant[];
position: number;
rank: number;
self_assignable: boolean;
system: boolean;
updated_at: string;
version: number;
};
export interface EnvelopeVecRoleSummary {
code: number;
data?: EnvelopeVecRoleSummaryDataItem[];
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export type EnvelopeVecSshKeySummaryDataItem = {
algorithm: SshKeyAlgorithm;
created_at: string;
/** @nullable */
description?: string | null;
/** @nullable */
expires_at?: string | null;
fingerprint: string;
id: string;
/** @nullable */
last_used_at?: string | null;
name: string;
public_key: string;
/** @nullable */
revoked_at?: string | null;
};
export interface EnvelopeVecSshKeySummary {
code: number;
data?: EnvelopeVecSshKeySummaryDataItem[];
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export interface EnvelopeVecString {
code: number;
data?: string[];
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export interface EnvelopeBool {
code: number;
data?: boolean;
/** @nullable */
error?: string | null;
/** @nullable */
error_code?: string | null;
message: string;
request_id?: string;
}
export interface HealthResponse {
status: string;
version: string;
}
export interface PowProofRequest {
/** @minimum 0 */
nonce: number;
/** @items.minimum 0 */
payload: number[];
}
export interface LoginCodeRequest {
email: string;
pow_payload: PowProofRequest;
}
export interface LoginCodeResponse {
/** @minimum 0 */
expires_in_secs: number;
}
export interface LoginCodeVerifyRequest {
email: string;
email_code: string;
pow_payload: PowProofRequest;
}
export interface LoginVerifyRequest {
challenge: string;
code: string;
}
export interface LogoutResponse {
/** @nullable */
user_id?: number | null;
}
export interface MeResponse {
/** @nullable */
avatar_url?: string | null;
created_at: string;
/** @nullable */
displayname?: string | null;
email: string;
/** @nullable */
email_verified_at?: string | null;
is_admin: boolean;
user_id: number;
username: string;
version: number;
}
export interface MemberListQuery {
/** @nullable */
include_banned?: boolean | null;
/** @nullable */
include_inactive?: boolean | null;
/**
* @minimum 0
* @nullable
*/
page?: number | null;
/**
* @minimum 0
* @nullable
*/
page_size?: number | null;
}
export interface MemberSummary {
/** @nullable */
alias_avatar_url?: string | null;
/** @nullable */
alias_name?: string | null;
ban_allow_agent_join: boolean;
ban_allow_comment_any: boolean;
ban_allow_push_repo: boolean;
ban_allow_speak: boolean;
/** @nullable */
ban_expires_at?: string | null;
/** @nullable */
ban_reason?: string | null;
/** @nullable */
banned_at?: string | null;
/** @nullable */
displayname?: string | null;
hide_muted_channels: boolean;
id: string;
/** @nullable */
invited_by?: number | null;
join_method: OrgJoinMethod;
joined_at: string;
/** @nullable */
last_active_at?: string | null;
/** @nullable */
left_at?: string | null;
message_notifications: MessageNotifications;
mobile_push: boolean;
/** @nullable */
mute_until?: string | null;
muted: boolean;
organization_id: string;
permissions: string[];
role: OrgMemberRole;
role_keys: string[];
suppress_everyone: boolean;
suppress_roles: boolean;
user_id: number;
username: string;
version: number;
}
export interface NoData {}
export interface OrgInvitePath {
invite_id: string;
organization_id: string;
}
export interface OrgListQuery {
/** @nullable */
include_archived?: boolean | null;
/**
* @minimum 0
* @nullable
*/
page?: number | null;
/**
* @minimum 0
* @nullable
*/
page_size?: number | null;
}
export interface OrgMemberPath {
member_id: string;
organization_id: string;
}
export interface OrgPath {
organization_id: string;
}
export interface OrgRolePath {
organization_id: string;
role_id: string;
}
export interface OrganizationSummary {
allow_invite: boolean;
allow_join: boolean;
allow_join_level: number;
/** @nullable */
archived_at?: string | null;
/** @nullable */
avatar_url?: string | null;
created_at: string;
/** @nullable */
description?: string | null;
id: string;
join_policy: OrganizationJoinPolicy;
member_count: number;
member_must_enable_2fa: boolean;
my_role?: OrgMemberRole | null;
name: string;
owner_user_id: number;
require_email_verified: boolean;
require_mfa: boolean;
slug: string;
status: OrganizationStatus;
updated_at: string;
version: number;
/** @nullable */
welcome_message?: string | null;
}
export interface PasswordResetConfirmRequest {
password_hash: string;
pow_payload: PowProofRequest;
token: string;
}
export interface PasswordResetConfirmResponse {
user_id: number;
}
export interface PasswordResetRequest {
email: string;
pow_payload: PowProofRequest;
}
export interface PasswordResetResponse {
/** @minimum 0 */
expires_in_secs: number;
}
export interface PermissionCheck {
allowed: boolean;
matched_by: string;
organization_version: number;
reason: string;
}
export interface ReadinessResponse {
checks: ComponentCheck[];
status: string;
}
export interface ReasonBody {
/** @nullable */
reason?: string | null;
}
export interface RedeemInviteBody {
token: string;
}
export interface RedeemInviteResponse {
joined: boolean;
member_id: string;
organization_id: string;
}
export interface RegisterCodeRequest {
email: string;
pow_payload: PowProofRequest;
}
export interface RegisterCodeResponse {
/** @minimum 0 */
expires_in_secs: number;
}
export interface RoleSummary {
/** @nullable */
color?: string | null;
created_at: string;
default_role: boolean;
/** @nullable */
description?: string | null;
/** @nullable */
emoji?: string | null;
/** @nullable */
icon_hash?: string | null;
id: string;
key: string;
member_count: number;
name: string;
organization_id: string;
permissions: PermissionGrant[];
position: number;
rank: number;
self_assignable: boolean;
system: boolean;
updated_at: string;
version: number;
}
export interface SetMemberRoleBody {
expected_version?: number;
role: OrgMemberRole;
}
export interface SetRolePermissionsBody {
permissions?: PermissionGrant[];
}
export interface SshKeyAddRequest {
/** @nullable */
description?: string | null;
/** @nullable */
expires_at?: string | null;
name: string;
public_key: string;
}
export interface SshKeySummary {
algorithm: SshKeyAlgorithm;
created_at: string;
/** @nullable */
description?: string | null;
/** @nullable */
expires_at?: string | null;
fingerprint: string;
id: string;
/** @nullable */
last_used_at?: string | null;
name: string;
public_key: string;
/** @nullable */
revoked_at?: string | null;
}
export interface TokenRequest {
/** @nullable */
client_id?: string | null;
/** @nullable */
client_secret?: string | null;
/** @nullable */
code?: string | null;
/** @nullable */
code_verifier?: string | null;
grant_type: string;
/** @nullable */
redirect_uri?: string | null;
/** @nullable */
refresh_token?: string | null;
/** @nullable */
scope?: string | null;
}
export interface TokenResponse {
expires_at: string;
issued_at: string;
kid: string;
token: string;
token_type: string;
}
export interface TransferBody {
target_user_id: number;
}
/**
* 封禁更新:原因、到期时间与四个放行位。缺失表示不变,null 表示清空。
*/
export interface UpdateBanBody {
/** @nullable */
allow_agent_join?: boolean | null;
/** @nullable */
allow_comment_any?: boolean | null;
/** @nullable */
allow_push_repo?: boolean | null;
/** @nullable */
allow_speak?: boolean | null;
/** @nullable */
expires_at?: string | null;
/** @nullable */
reason?: string | null;
}
/**
* 会籍更新:管理端可改别名、通知偏好、免打扰与封禁附加信息。
* 所有字段缺失表示不变,显式 null 表示清空(仅限 Option 字段)。
*/
export interface UpdateMemberBody {
/** @nullable */
alias_avatar_url?: string | null;
/** @nullable */
alias_name?: string | null;
expected_version?: number;
/** @nullable */
hide_muted_channels?: boolean | null;
message_notifications?: MessageNotifications | null;
/** @nullable */
mobile_push?: boolean | null;
/** @nullable */
mute_until?: string | null;
/** @nullable */
muted?: boolean | null;
/** @nullable */
suppress_everyone?: boolean | null;
/** @nullable */
suppress_roles?: boolean | null;
}
export interface UpdateOrganizationBody {
/** @nullable */
allow_invite?: boolean | null;
/** @nullable */
allow_join?: boolean | null;
/** @nullable */
allow_join_level?: number | null;
/** @nullable */
avatar_url?: string | null;
/** @nullable */
description?: string | null;
expected_version?: number;
join_policy?: OrganizationJoinPolicy | null;
/** @nullable */
member_must_enable_2fa?: boolean | null;
/** @nullable */
name?: string | null;
/** @nullable */
require_email_verified?: boolean | null;
/** @nullable */
require_mfa?: boolean | null;
/** @nullable */
welcome_message?: string | null;
}
export interface UpdateRoleBody {
/** @nullable */
default_role?: boolean | null;
/** @nullable */
description?: string | null;
expected_version?: number;
/** @nullable */
name?: string | null;
/** @nullable */
rank?: number | null;
/** @nullable */
self_assignable?: boolean | null;
}
export interface UserLoginRequest {
identity: string;
password_hash: string;
pow_payload: PowProofRequest;
}
export interface UserLoginResponse {
/** @nullable */
challenge?: string | null;
/** @nullable */
displayname?: string | null;
mfa_required: boolean;
user_id: number;
username: string;
}
export interface UserRegisterRequest {
birth_date: string;
/** @nullable */
displayname?: string | null;
email: string;
email_code: string;
password_hash: string;
pow_payload: PowProofRequest;
username: string;
}
export interface UserRegisterResponse {
/** @nullable */
displayname?: string | null;
user_id: number;
username: string;
}
export type AuthAccessTokenListParams = {
/**
* 页码,从 1 开始;默认 1
* @minimum 0
*/
page?: number;
/**
* 每页条数,默认 20,最多 100
* @minimum 0
*/
page_size?: number;
};
export type AuthSshKeyListParams = {
/**
* 页码,从 1 开始;默认 1
* @minimum 0
*/
page?: number;
/**
* 每页条数,默认 20,最多 100
* @minimum 0
*/
page_size?: number;
};
export type AuthOrganizationDeleteParams = {
/**
* 是否连成员一并清理
*/
force?: boolean;
/**
* 删除原因,最长 512 字符
*/
reason?: string;
};
export type AuthOrganizationBanListParams = {
/**
* 页码,从 1 开始
* @minimum 0
*/
page?: number;
/**
* 每页条数
* @minimum 0
*/
page_size?: number;
};
export type AuthOrganizationInviteListParams = {
/**
* 包含已撤销邀请
*/
include_revoked?: boolean;
};
export type AuthOrganizationMemberListParams = {
/**
* 包含已退出成员
*/
include_inactive?: boolean;
/**
* 包含已封禁成员
*/
include_banned?: boolean;
};
export type AuthOrganizationMemberRemoveParams = {
/**
* 移除原因
*/
reason?: string;
};