feat: add system disclosure policy gate
Memind CI / Test, build, and release guards (pull_request) Successful in 3m14s
Memind CI / Test, build, and release guards (pull_request) Successful in 3m14s
This commit is contained in:
@@ -177,12 +177,46 @@ export type CreateWechatNotificationPayload = {
|
||||
channels?: Array<'web' | 'wechat'>;
|
||||
};
|
||||
|
||||
export type SystemDisclosureMode = 'off' | 'shadow' | 'enforce';
|
||||
|
||||
export type SystemDisclosurePolicyConfig = {
|
||||
enabled: boolean;
|
||||
mode: SystemDisclosureMode;
|
||||
refusalText: string;
|
||||
productNames: string[];
|
||||
selfReferences: string[];
|
||||
categories: Record<string, boolean>;
|
||||
};
|
||||
|
||||
export type SystemDisclosurePolicyState = {
|
||||
config: SystemDisclosurePolicyConfig;
|
||||
policyVersion: number;
|
||||
updatedBy: string | null;
|
||||
updatedAt: number | null;
|
||||
source: string;
|
||||
refreshedAt?: number | null;
|
||||
lastRefreshError?: string | null;
|
||||
};
|
||||
|
||||
// ─── Summary ──────────────────────────────────────────────────────────────────
|
||||
|
||||
export async function fetchAdminSummary() {
|
||||
return adminFetch<{ summary: AdminSummary }>('/admin-api/summary');
|
||||
}
|
||||
|
||||
// ─── Trust & Policy ───────────────────────────────────────────────────────────
|
||||
|
||||
export async function fetchSystemDisclosurePolicy() {
|
||||
return adminFetch<SystemDisclosurePolicyState>('/admin-api/system-disclosure-policy/config');
|
||||
}
|
||||
|
||||
export async function updateSystemDisclosurePolicy(config: SystemDisclosurePolicyConfig) {
|
||||
return adminFetch<SystemDisclosurePolicyState>('/admin-api/system-disclosure-policy/config', {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ config }),
|
||||
});
|
||||
}
|
||||
|
||||
// ─── Users ────────────────────────────────────────────────────────────────────
|
||||
|
||||
export async function fetchAdminUsers(params: {
|
||||
|
||||
Reference in New Issue
Block a user