forked from baron/baron-sso
chore: consolidate local integration changes
This commit is contained in:
@@ -31,7 +31,8 @@ export type TenantSummary = {
|
||||
domains?: string[];
|
||||
parentId?: string;
|
||||
config?: Record<string, unknown>;
|
||||
memberCount: number; // Added member count
|
||||
memberCount: number; // 해당 테넌트 직접 소속 인원
|
||||
totalMemberCount?: number; // 하위 테넌트 포함 전체 인원
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
@@ -155,9 +156,24 @@ export type UserProjectionStatus = {
|
||||
projectedUsers: number;
|
||||
};
|
||||
|
||||
export type UserProjectionActionResult = {
|
||||
export type IdentityCacheStatus = {
|
||||
status: string;
|
||||
syncedUsers: number;
|
||||
redisReady: boolean;
|
||||
observedCount: number;
|
||||
keyCount: number;
|
||||
lastRefreshedAt?: string;
|
||||
lastError?: string;
|
||||
updatedAt?: string;
|
||||
};
|
||||
|
||||
export type OrySSOTSystemStatus = {
|
||||
userProjection: UserProjectionStatus;
|
||||
identityCache: IdentityCacheStatus;
|
||||
};
|
||||
|
||||
export type IdentityCacheFlushResult = {
|
||||
status: string;
|
||||
flushedKeys: number;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
@@ -261,16 +277,15 @@ export async function fetchUserProjectionStatus() {
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function reconcileUserProjection() {
|
||||
const { data } = await apiClient.post<UserProjectionActionResult>(
|
||||
"/v1/admin/projections/users/reconcile",
|
||||
);
|
||||
export async function fetchOrySSOTSystemStatus() {
|
||||
const { data } =
|
||||
await apiClient.get<OrySSOTSystemStatus>("/v1/admin/ory/ssot");
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function resetUserProjection() {
|
||||
const { data } = await apiClient.post<UserProjectionActionResult>(
|
||||
"/v1/admin/projections/users/reset",
|
||||
export async function flushIdentityCache() {
|
||||
const { data } = await apiClient.post<IdentityCacheFlushResult>(
|
||||
"/v1/admin/ory/ssot/identity-cache/flush",
|
||||
);
|
||||
return data;
|
||||
}
|
||||
@@ -716,6 +731,28 @@ export type UserUpdateRequest = {
|
||||
metadata?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type GlobalCustomClaimPermission = "admin_only" | "user_and_admin";
|
||||
|
||||
export type GlobalCustomClaimDefinition = {
|
||||
key: string;
|
||||
label: string;
|
||||
valueType:
|
||||
| "text"
|
||||
| "number"
|
||||
| "boolean"
|
||||
| "array"
|
||||
| "object"
|
||||
| "date"
|
||||
| "datetime";
|
||||
readPermission: GlobalCustomClaimPermission;
|
||||
writePermission: GlobalCustomClaimPermission;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
export type GlobalCustomClaimDefinitionsResponse = {
|
||||
items: GlobalCustomClaimDefinition[];
|
||||
};
|
||||
|
||||
export type UserAppointment = {
|
||||
tenantId: string;
|
||||
tenantSlug?: string;
|
||||
@@ -906,6 +943,23 @@ export async function fetchUser(userId: string) {
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function fetchGlobalCustomClaimDefinitions() {
|
||||
const { data } = await apiClient.get<GlobalCustomClaimDefinitionsResponse>(
|
||||
"/v1/admin/global-custom-claims",
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function updateGlobalCustomClaimDefinitions(
|
||||
payload: GlobalCustomClaimDefinitionsResponse,
|
||||
) {
|
||||
const { data } = await apiClient.put<GlobalCustomClaimDefinitionsResponse>(
|
||||
"/v1/admin/global-custom-claims",
|
||||
payload,
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function createUser(payload: UserCreateRequest) {
|
||||
const { data } = await apiClient.post<UserCreateResponse>(
|
||||
"/v1/admin/users",
|
||||
@@ -1040,14 +1094,21 @@ export async function enqueueWorksmobileUserSync(
|
||||
tenantId: string,
|
||||
userId: string,
|
||||
credentialBatchId?: string,
|
||||
initialPassword?: string,
|
||||
) {
|
||||
const trimmedBatchId = credentialBatchId?.trim();
|
||||
const trimmedInitialPassword = initialPassword?.trim();
|
||||
const path = `/v1/admin/tenants/${tenantId}/worksmobile/users/${userId}/sync`;
|
||||
const { data } = trimmedBatchId
|
||||
? await apiClient.post<WorksmobileOutboxItem>(path, {
|
||||
credentialBatchId: trimmedBatchId,
|
||||
})
|
||||
: await apiClient.post<WorksmobileOutboxItem>(path);
|
||||
const body = {
|
||||
...(trimmedBatchId ? { credentialBatchId: trimmedBatchId } : {}),
|
||||
...(trimmedInitialPassword
|
||||
? { initialPassword: trimmedInitialPassword }
|
||||
: {}),
|
||||
};
|
||||
const { data } =
|
||||
Object.keys(body).length > 0
|
||||
? await apiClient.post<WorksmobileOutboxItem>(path, body)
|
||||
: await apiClient.post<WorksmobileOutboxItem>(path);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user